Skip to content

Commit 623d559

Browse files
Merge pull request #457 from thejackshelton/fix-cloudflare
fix(docs): fluffy button example now has a default export, changed to…
2 parents 02acf3e + c860579 commit 623d559

File tree

5 files changed

+34
-25
lines changed

5 files changed

+34
-25
lines changed

apps/website/src/routes/docs/fluffy/(components)/button/examples.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { JSXNode, component$ } from '@builder.io/qwik';
22
// eslint-disable-next-line @nx/enforce-module-boundaries
3-
import fluffyButtonCode from '../../../../../../../../packages/kit-fluffy/src/components/button/button?raw';
3+
import Button from '../../../../../../../../packages/kit-fluffy/src/components/button/button?raw';
44
import { CodeExampleContainer } from '../../../_components/code-example/code-example-container';
55
import { Highlight } from '../../../_components/highlight/highlight';
66
import { PreviewCodeExampleVertical } from '../../../_components/preview-code-example/preview-code-example-vertical';
@@ -62,9 +62,7 @@ export const examples: Record<string, Example> = {
6262
},
6363
};
6464

65-
export const InstallExample = component$(() => (
66-
<CodeExampleContainer code={fluffyButtonCode} />
67-
));
65+
export const InstallExample = component$(() => <CodeExampleContainer code={Button} />);
6866

6967
export const ShowExample = component$(({ example }: ShowExampleProps) => {
7068
const { component, code, cssClasses = '' } = examples[example];

apps/website/src/routes/docs/fluffy/(components)/navigation-bar/index.tsx renamed to apps/website/src/routes/docs/fluffy/(components)/navigation-bar/examples.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ export default component$(() => {
66
<>
77
<h2>This is the documentation for the Navigation Bar</h2>
88

9-
<div class="flex flex-col gap-8 mt-4">
9+
<div class="mt-4 flex flex-col gap-8">
1010
<h2>Basic Example</h2>
1111

1212
<NavigationBar class="bg-base-100 rounded-lg">
13-
<a q:slot="navbar-left" class="btn btn-ghost normal-case text-xl">
13+
<a q:slot="navbar-left" class="btn btn-ghost text-xl normal-case">
1414
tailwindUI
1515
</a>
1616
<ul q:slot="navbar-center" class="menu menu-horizontal px-1">
@@ -30,7 +30,7 @@ export default component$(() => {
3030
<path d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z" />
3131
</svg>
3232
</a>
33-
<ul class="p-2 bg-base-100">
33+
<ul class="bg-base-100 p-2">
3434
<li>
3535
<a>Submenu 1</a>
3636
</li>
@@ -43,13 +43,13 @@ export default component$(() => {
4343
<a>Item 3</a>
4444
</li>
4545
</ul>
46-
<a q:slot="navbar-right" class="btn btn-ghost normal-case text-xl">
46+
<a q:slot="navbar-right" class="btn btn-ghost text-xl normal-case">
4747
tailwindUI
4848
</a>
4949
</NavigationBar>
5050

5151
<NavigationBar class="bg-base-100 rounded-lg">
52-
<a q:slot="navbar-left" class="btn btn-ghost normal-case text-xl">
52+
<a q:slot="navbar-left" class="btn btn-ghost text-xl normal-case">
5353
tailwindUI
5454
</a>
5555
<ul q:slot="navbar-right" class="menu menu-horizontal px-1">
@@ -69,7 +69,7 @@ export default component$(() => {
6969
<path d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z" />
7070
</svg>
7171
</a>
72-
<ul class="p-2 bg-base-100">
72+
<ul class="bg-base-100 p-2">
7373
<li>
7474
<a>Submenu 1</a>
7575
</li>
@@ -85,7 +85,7 @@ export default component$(() => {
8585
</NavigationBar>
8686
<h2>Custom css</h2>
8787
<NavigationBar class=" bg-primary rounded-lg">
88-
<a q:slot="navbar-left" class="btn btn-ghost normal-case text-xl">
88+
<a q:slot="navbar-left" class="btn btn-ghost text-xl normal-case">
8989
tailwindUI
9090
</a>
9191
<ul q:slot="navbar-right" class="menu menu-horizontal px-1">
@@ -105,7 +105,7 @@ export default component$(() => {
105105
<path d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z" />
106106
</svg>
107107
</a>
108-
<ul class="p-2 bg-base-100">
108+
<ul class="bg-base-100 p-2">
109109
<li>
110110
<a>Submenu 1</a>
111111
</li>
Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
1-
import { Slot, component$ } from '@builder.io/qwik';
2-
import { Toggle } from '@qwik-ui/primitives';
3-
import { PreviewCodeExampleTabsDeprecated } from '../../../_components/preview-code-example/preview-code-example-tabs';
1+
import { component$, type JSXNode } from '@builder.io/qwik';
42

5-
export const Example01 = component$(() => {
6-
return (
7-
<PreviewCodeExampleTabsDeprecated>
8-
<div q:slot="actualComponent">
9-
<Toggle pressed={true} onClick$={() => console.log('Toggle')} />
10-
</div>
3+
import { PreviewCodeExampleTabs } from '../../../_components/preview-code-example/preview-code-example-tabs';
4+
// import styles from './index.css?inline';
5+
6+
export type Example = {
7+
component: JSXNode;
8+
code: string;
9+
cssClasses?: string;
10+
};
1111

12-
<div q:slot="codeExample">
13-
<Slot />
12+
export const examples: Record<string, Example> = {};
13+
14+
export type ShowExampleProps = {
15+
example: string;
16+
};
17+
18+
export const ShowExample = component$(({ example }: ShowExampleProps) => {
19+
const { component, code, cssClasses = '' } = examples[example];
20+
return (
21+
<PreviewCodeExampleTabs code={code}>
22+
<div q:slot="actualComponent" class={['tabs-example mr-auto', cssClasses]}>
23+
{component}
1424
</div>
15-
</PreviewCodeExampleTabsDeprecated>
25+
</PreviewCodeExampleTabs>
1626
);
1727
});

apps/website/src/routes/docs/headless/(components)/toggle/index.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
title: Qwik UI | Toggle
33
---
44

5-
import { Example01 } from './examples';
65
import { CodeExample } from '../../../_components/code-example/code-example';
76
import { KeyboardInteractionTable } from '../../../_components/keyboard-interaction-table/keyboard-interaction-table';
87
import { APITable } from '../../../_components/api-table/api-table';

packages/kit-fluffy/src/components/button/button.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,5 @@ export const Button = component$<ButtonProps>(
112112
);
113113
},
114114
);
115+
116+
export default Button;

0 commit comments

Comments
 (0)