@kinetixui/ui 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -3
- package/package.json +4 -4
- package/src/components/chart.tsx +15 -3
- package/src/stories/Accordion.stories.tsx +2 -2
- package/src/stories/Alert.stories.tsx +2 -2
- package/src/stories/AlertDialog.stories.tsx +2 -2
- package/src/stories/AspectRatio.stories.tsx +2 -2
- package/src/stories/AudioPlayer.stories.tsx +2 -2
- package/src/stories/Avatar.stories.tsx +2 -2
- package/src/stories/AvatarGroup.stories.tsx +2 -2
- package/src/stories/Badge.stories.tsx +2 -2
- package/src/stories/Breadcrumb.stories.tsx +2 -2
- package/src/stories/Button.stories.tsx +1 -1
- package/src/stories/Calendar.stories.tsx +2 -2
- package/src/stories/Card.stories.tsx +2 -2
- package/src/stories/Carousel.stories.tsx +2 -2
- package/src/stories/Chart.stories.tsx +2 -2
- package/src/stories/Checkbox.stories.tsx +2 -2
- package/src/stories/CircularProgress.stories.tsx +2 -2
- package/src/stories/CodeBlock.stories.tsx +2 -2
- package/src/stories/Collapsible.stories.tsx +2 -2
- package/src/stories/Combobox.stories.tsx +2 -2
- package/src/stories/Command.stories.tsx +2 -2
- package/src/stories/ContextMenu.stories.tsx +2 -2
- package/src/stories/DataTable.stories.tsx +2 -2
- package/src/stories/DatePicker.stories.tsx +2 -2
- package/src/stories/Dialog.stories.tsx +2 -2
- package/src/stories/Drawer.stories.tsx +2 -2
- package/src/stories/DropdownMenu.stories.tsx +2 -2
- package/src/stories/Fab.stories.tsx +2 -2
- package/src/stories/Field.stories.tsx +2 -2
- package/src/stories/FileUpload.stories.tsx +2 -2
- package/src/stories/Footer.stories.tsx +2 -2
- package/src/stories/Form.stories.tsx +2 -2
- package/src/stories/HoverCard.stories.tsx +2 -2
- package/src/stories/Image.stories.tsx +2 -2
- package/src/stories/Inform.stories.tsx +2 -2
- package/src/stories/Input.stories.tsx +1 -1
- package/src/stories/InputGroup.stories.tsx +2 -2
- package/src/stories/InputOTP.stories.tsx +2 -2
- package/src/stories/Label.stories.tsx +2 -2
- package/src/stories/List.stories.tsx +2 -2
- package/src/stories/Menubar.stories.tsx +2 -2
- package/src/stories/Metric.stories.tsx +2 -2
- package/src/stories/Modal.stories.tsx +2 -2
- package/src/stories/NavigationBar.stories.tsx +2 -2
- package/src/stories/NavigationMenu.stories.tsx +2 -2
- package/src/stories/NumberInput.stories.tsx +2 -2
- package/src/stories/Pagination.stories.tsx +2 -2
- package/src/stories/PasswordInput.stories.tsx +2 -2
- package/src/stories/Popover.stories.tsx +2 -2
- package/src/stories/Progress.stories.tsx +2 -2
- package/src/stories/Quote.stories.tsx +2 -2
- package/src/stories/RadioGroup.stories.tsx +2 -2
- package/src/stories/Rating.stories.tsx +2 -2
- package/src/stories/Resizable.stories.tsx +2 -2
- package/src/stories/ScrollArea.stories.tsx +2 -2
- package/src/stories/Select.stories.tsx +2 -2
- package/src/stories/Separator.stories.tsx +2 -2
- package/src/stories/Sheet.stories.tsx +2 -2
- package/src/stories/Sidebar.stories.tsx +2 -2
- package/src/stories/Skeleton.stories.tsx +2 -2
- package/src/stories/Slider.stories.tsx +2 -2
- package/src/stories/Sonner.stories.tsx +2 -2
- package/src/stories/Spinner.stories.tsx +2 -2
- package/src/stories/Stepper.stories.tsx +2 -2
- package/src/stories/Switch.stories.tsx +2 -2
- package/src/stories/TabBar.stories.tsx +2 -2
- package/src/stories/Table.stories.tsx +2 -2
- package/src/stories/TableOfContents.stories.tsx +2 -2
- package/src/stories/Tabs.stories.tsx +2 -2
- package/src/stories/Tag.stories.tsx +2 -2
- package/src/stories/Textarea.stories.tsx +1 -1
- package/src/stories/Toggle.stories.tsx +2 -2
- package/src/stories/ToggleGroup.stories.tsx +2 -2
- package/src/stories/Tooltip.stories.tsx +2 -2
package/dist/index.js
CHANGED
|
@@ -1643,19 +1643,23 @@ function ChartSrTable({
|
|
|
1643
1643
|
/* @__PURE__ */ jsx37("tbody", { children: rows.map((r, i) => /* @__PURE__ */ jsx37("tr", { children: r.map((cell, j) => /* @__PURE__ */ jsx37("td", { children: cell }, j)) }, i)) })
|
|
1644
1644
|
] });
|
|
1645
1645
|
}
|
|
1646
|
+
var cssIdent = (s) => String(s).replace(/[^\w-]/g, "");
|
|
1647
|
+
var cssValue = (s) => /[<>{}\[\];@]|\/\*|\*\//.test(s) ? "" : s.trim();
|
|
1646
1648
|
var ChartStyle = ({ id, config }) => {
|
|
1647
1649
|
const colorConfig = Object.entries(config).filter(([, c]) => c.theme || c.color);
|
|
1648
1650
|
if (!colorConfig.length) return null;
|
|
1651
|
+
const chartSelector = cssIdent(id);
|
|
1649
1652
|
return /* @__PURE__ */ jsx37(
|
|
1650
1653
|
"style",
|
|
1651
1654
|
{
|
|
1652
1655
|
dangerouslySetInnerHTML: {
|
|
1653
1656
|
__html: Object.entries(THEMES).map(
|
|
1654
1657
|
([theme, prefix]) => `
|
|
1655
|
-
${prefix} [data-chart=${
|
|
1658
|
+
${prefix} [data-chart=${chartSelector}] {
|
|
1656
1659
|
${colorConfig.map(([key, itemConfig]) => {
|
|
1657
|
-
const
|
|
1658
|
-
|
|
1660
|
+
const raw = itemConfig.theme?.[theme] || itemConfig.color;
|
|
1661
|
+
const color = raw ? cssValue(raw) : "";
|
|
1662
|
+
return color ? ` --color-${cssIdent(key)}: ${color};` : null;
|
|
1659
1663
|
}).join("\n")}
|
|
1660
1664
|
}
|
|
1661
1665
|
`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinetixui/ui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "KinetixUI React components — CVA + Radix + Tailwind on the KinetixUI token contract. Also distributed via the kinetixui CLI as a component registry.",
|
|
6
6
|
"keywords": [
|
|
@@ -89,20 +89,20 @@
|
|
|
89
89
|
"react-dom": ">=18"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
|
-
"@kinetixui/tokens": "0.5.
|
|
92
|
+
"@kinetixui/tokens": "0.5.1",
|
|
93
93
|
"@testing-library/jest-dom": "^6.6.3",
|
|
94
94
|
"@testing-library/react": "^16.1.0",
|
|
95
95
|
"@testing-library/user-event": "^14.5.2",
|
|
96
96
|
"@types/react": "^18.3.17",
|
|
97
97
|
"@types/react-dom": "^18.3.5",
|
|
98
|
-
"@vitejs/plugin-react": "^
|
|
98
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
99
99
|
"jsdom": "^25.0.1",
|
|
100
100
|
"react": "^18.3.1",
|
|
101
101
|
"react-dom": "^18.3.1",
|
|
102
102
|
"tailwindcss": "^3.4.17",
|
|
103
103
|
"tsup": "^8.3.5",
|
|
104
104
|
"typescript": "^5.7.2",
|
|
105
|
-
"vitest": "^
|
|
105
|
+
"vitest": "^5.0.0"
|
|
106
106
|
},
|
|
107
107
|
"scripts": {
|
|
108
108
|
"build": "tsup src/index.ts --format esm --dts --external react --external react-dom",
|
package/src/components/chart.tsx
CHANGED
|
@@ -194,21 +194,33 @@ function ChartSrTable({
|
|
|
194
194
|
);
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
+
// This is the one spot that writes an inline <style>. `id`, the config keys and
|
|
198
|
+
// the colour strings are author-supplied, but harden the interpolation anyway:
|
|
199
|
+
// strip everything but `[\w-]` from identifiers, and drop any colour value that
|
|
200
|
+
// carries characters able to close the declaration or the rule.
|
|
201
|
+
const cssIdent = (s: string) => String(s).replace(/[^\w-]/g, "");
|
|
202
|
+
// keep parens (hsl(), var(), color-mix()…); reject only what can end the
|
|
203
|
+
// declaration, close the rule, open an at-rule, a comment, or the <style>.
|
|
204
|
+
const cssValue = (s: string) => (/[<>{}\[\];@]|\/\*|\*\//.test(s) ? "" : s.trim());
|
|
205
|
+
|
|
197
206
|
const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
|
198
207
|
const colorConfig = Object.entries(config).filter(([, c]) => c.theme || c.color);
|
|
199
208
|
if (!colorConfig.length) return null;
|
|
200
209
|
|
|
210
|
+
const chartSelector = cssIdent(id);
|
|
211
|
+
|
|
201
212
|
return (
|
|
202
213
|
<style
|
|
203
214
|
dangerouslySetInnerHTML={{
|
|
204
215
|
__html: Object.entries(THEMES)
|
|
205
216
|
.map(
|
|
206
217
|
([theme, prefix]) => `
|
|
207
|
-
${prefix} [data-chart=${
|
|
218
|
+
${prefix} [data-chart=${chartSelector}] {
|
|
208
219
|
${colorConfig
|
|
209
220
|
.map(([key, itemConfig]) => {
|
|
210
|
-
const
|
|
211
|
-
|
|
221
|
+
const raw = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] || itemConfig.color;
|
|
222
|
+
const color = raw ? cssValue(raw) : "";
|
|
223
|
+
return color ? ` --color-${cssIdent(key)}: ${color};` : null;
|
|
212
224
|
})
|
|
213
225
|
.join("\n")}
|
|
214
226
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx · controls: scripts/gen-stories.mjs CONTROLS */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => (
|
|
@@ -27,7 +27,7 @@ const meta = {
|
|
|
27
27
|
},
|
|
28
28
|
parameters: {
|
|
29
29
|
layout: "centered",
|
|
30
|
-
docs: { source: { code:
|
|
30
|
+
docs: { source: { code: "<Accordion type=\"single\" collapsible>\\n <AccordionItem value=\"a\">\\n <AccordionTrigger>Is it accessible?</AccordionTrigger>\\n <AccordionContent>Yes. It follows the WAI-ARIA design pattern.</AccordionContent>\\n </AccordionItem>\\n</Accordion>", language: "tsx" } },
|
|
31
31
|
},
|
|
32
32
|
} satisfies Meta;
|
|
33
33
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx · controls: scripts/gen-stories.mjs CONTROLS */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Alert, AlertDescription, AlertTitle } from "@kinetixui/ui";
|
|
6
6
|
import { Terminal } from "lucide-react";
|
|
7
7
|
|
|
@@ -22,7 +22,7 @@ const meta = {
|
|
|
22
22
|
},
|
|
23
23
|
parameters: {
|
|
24
24
|
layout: "centered",
|
|
25
|
-
docs: { source: { code:
|
|
25
|
+
docs: { source: { code: "<Alert>\\n <Terminal className=\"size-4\" />\\n <AlertTitle>Heads up!</AlertTitle>\\n <AlertDescription>You can add components to your app using the CLI.</AlertDescription>\\n</Alert>", language: "tsx" } },
|
|
26
26
|
},
|
|
27
27
|
} satisfies Meta;
|
|
28
28
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, Button } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => (
|
|
@@ -26,7 +26,7 @@ const meta = {
|
|
|
26
26
|
title: "Overlays/AlertDialog",
|
|
27
27
|
parameters: {
|
|
28
28
|
layout: "centered",
|
|
29
|
-
docs: { source: { code:
|
|
29
|
+
docs: { source: { code: "<AlertDialog>\\n <AlertDialogTrigger asChild><Button variant=\"Outline\">Delete account</Button></AlertDialogTrigger>\\n <AlertDialogContent>…</AlertDialogContent>\\n</AlertDialog>", language: "tsx" } },
|
|
30
30
|
},
|
|
31
31
|
} satisfies Meta;
|
|
32
32
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx · controls: scripts/gen-stories.mjs CONTROLS */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { AspectRatio } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => (
|
|
@@ -17,7 +17,7 @@ const meta = {
|
|
|
17
17
|
argTypes: { ratio: { control: { type: "number", step: 0.05 } } },
|
|
18
18
|
parameters: {
|
|
19
19
|
layout: "centered",
|
|
20
|
-
docs: { source: { code:
|
|
20
|
+
docs: { source: { code: "<AspectRatio ratio={16 / 9} className=\"bg-muted rounded-md\" />", language: "tsx" } },
|
|
21
21
|
},
|
|
22
22
|
} satisfies Meta;
|
|
23
23
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { AudioPlayer } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const SAMPLE_AUDIO = "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3";
|
|
@@ -17,7 +17,7 @@ const meta = {
|
|
|
17
17
|
title: "Data Display/AudioPlayer",
|
|
18
18
|
parameters: {
|
|
19
19
|
layout: "centered",
|
|
20
|
-
docs: { source: { code:
|
|
20
|
+
docs: { source: { code: "<AudioPlayer src=\"/audio/song.mp3\" title=\"Song 1\" artist=\"Artist\" />\\n\\n<AudioPlayer variant=\"mini\" src=\"/audio/song.mp3\" title=\"Song 1\" artist=\"Artist\" />", language: "tsx" } },
|
|
21
21
|
},
|
|
22
22
|
} satisfies Meta;
|
|
23
23
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Avatar, AvatarFallback } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => (
|
|
@@ -14,7 +14,7 @@ const meta = {
|
|
|
14
14
|
title: "Data Display/Avatar",
|
|
15
15
|
parameters: {
|
|
16
16
|
layout: "centered",
|
|
17
|
-
docs: { source: { code:
|
|
17
|
+
docs: { source: { code: "<Avatar>\\n <AvatarImage src=\"/avatar.png\" alt=\"@kinetixui\" />\\n <AvatarFallback>KX</AvatarFallback>\\n</Avatar>", language: "tsx" } },
|
|
18
18
|
},
|
|
19
19
|
} satisfies Meta;
|
|
20
20
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Avatar, AvatarFallback, AvatarGroup } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => (
|
|
@@ -28,7 +28,7 @@ const meta = {
|
|
|
28
28
|
title: "Data Display/AvatarGroup",
|
|
29
29
|
parameters: {
|
|
30
30
|
layout: "centered",
|
|
31
|
-
docs: { source: { code:
|
|
31
|
+
docs: { source: { code: "<AvatarGroup max={3}>\\n <Avatar><AvatarFallback>JD</AvatarFallback></Avatar>\\n <Avatar><AvatarFallback>AK</AvatarFallback></Avatar>\\n <Avatar><AvatarFallback>MO</AvatarFallback></Avatar>\\n</AvatarGroup>", language: "tsx" } },
|
|
32
32
|
},
|
|
33
33
|
} satisfies Meta;
|
|
34
34
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx · controls: scripts/gen-stories.mjs CONTROLS */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Badge } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => (
|
|
@@ -24,7 +24,7 @@ const meta = {
|
|
|
24
24
|
},
|
|
25
25
|
parameters: {
|
|
26
26
|
layout: "centered",
|
|
27
|
-
docs: { source: { code:
|
|
27
|
+
docs: { source: { code: "<Badge>Default</Badge>\\n<Badge variant=\"secondary\">Secondary</Badge>\\n<Badge variant=\"destructive\">Destructive</Badge>\\n<Badge variant=\"outline\">Outline</Badge>\\n<Badge variant=\"subtle\">Subtle</Badge>", language: "tsx" } },
|
|
28
28
|
},
|
|
29
29
|
} satisfies Meta;
|
|
30
30
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "@kinetixui/ui";
|
|
6
6
|
import { Home } from "lucide-react";
|
|
7
7
|
|
|
@@ -27,7 +27,7 @@ const meta = {
|
|
|
27
27
|
title: "Navigation/Breadcrumb",
|
|
28
28
|
parameters: {
|
|
29
29
|
layout: "centered",
|
|
30
|
-
docs: { source: { code:
|
|
30
|
+
docs: { source: { code: "<Breadcrumb>\\n <BreadcrumbList>\\n <BreadcrumbItem><BreadcrumbLink href=\"/\">Home</BreadcrumbLink></BreadcrumbItem>\\n <BreadcrumbSeparator />\\n <BreadcrumbItem><BreadcrumbPage>Breadcrumb</BreadcrumbPage></BreadcrumbItem>\\n </BreadcrumbList>\\n</Breadcrumb>", language: "tsx" } },
|
|
31
31
|
},
|
|
32
32
|
} satisfies Meta;
|
|
33
33
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Calendar } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => {
|
|
@@ -16,7 +16,7 @@ const meta = {
|
|
|
16
16
|
title: "Form Inputs/Calendar",
|
|
17
17
|
parameters: {
|
|
18
18
|
layout: "padded",
|
|
19
|
-
docs: { source: { code:
|
|
19
|
+
docs: { source: { code: "const [date, setDate] = React.useState<Date>()\\n<Calendar mode=\"single\" selected={date} onSelect={setDate} className=\"rounded-md border\" />", language: "tsx" } },
|
|
20
20
|
},
|
|
21
21
|
} satisfies Meta;
|
|
22
22
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Input } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => (
|
|
@@ -24,7 +24,7 @@ const meta = {
|
|
|
24
24
|
title: "Data Display/Card",
|
|
25
25
|
parameters: {
|
|
26
26
|
layout: "centered",
|
|
27
|
-
docs: { source: { code:
|
|
27
|
+
docs: { source: { code: "<Card>\\n <CardHeader>\\n <CardTitle>Create project</CardTitle>\\n <CardDescription>Deploy your new project in one click.</CardDescription>\\n </CardHeader>\\n <CardContent>…</CardContent>\\n <CardFooter>…</CardFooter>\\n</Card>", language: "tsx" } },
|
|
28
28
|
},
|
|
29
29
|
} satisfies Meta;
|
|
30
30
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => (
|
|
@@ -24,7 +24,7 @@ const meta = {
|
|
|
24
24
|
title: "Data Display/Carousel",
|
|
25
25
|
parameters: {
|
|
26
26
|
layout: "padded",
|
|
27
|
-
docs: { source: { code:
|
|
27
|
+
docs: { source: { code: "<Carousel>\\n <CarouselContent>\\n {items.map((n) => <CarouselItem key={n}>{n}</CarouselItem>)}\\n </CarouselContent>\\n <CarouselPrevious />\\n <CarouselNext />\\n</Carousel>", language: "tsx" } },
|
|
28
28
|
},
|
|
29
29
|
} satisfies Meta;
|
|
30
30
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { ChartContainer, ChartTooltip, ChartTooltipContent } from "@kinetixui/ui";
|
|
6
6
|
import { Bar, BarChart, CartesianGrid, XAxis } from "recharts";
|
|
7
7
|
|
|
@@ -35,7 +35,7 @@ const meta = {
|
|
|
35
35
|
title: "Data Display/Chart",
|
|
36
36
|
parameters: {
|
|
37
37
|
layout: "padded",
|
|
38
|
-
docs: { source: { code:
|
|
38
|
+
docs: { source: { code: "const config = {\\n desktop: { label: \"Desktop\", color: \"hsl(var(--chart-1))\" },\\n mobile: { label: \"Mobile\", color: \"hsl(var(--chart-2))\" },\\n}\\n<ChartContainer config={config}>\\n <BarChart data={data}>\\n <CartesianGrid vertical={false} />\\n <XAxis dataKey=\"month\" />\\n <ChartTooltip content={<ChartTooltipContent />} />\\n <Bar dataKey=\"desktop\" fill=\"var(--color-desktop)\" radius={4} />\\n </BarChart>\\n</ChartContainer>", language: "tsx" } },
|
|
39
39
|
},
|
|
40
40
|
} satisfies Meta;
|
|
41
41
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx · controls: scripts/gen-stories.mjs CONTROLS */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Checkbox, Label } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => (
|
|
@@ -18,7 +18,7 @@ const meta = {
|
|
|
18
18
|
argTypes: { disabled: { control: "boolean" }, defaultChecked: { control: "boolean" } },
|
|
19
19
|
parameters: {
|
|
20
20
|
layout: "centered",
|
|
21
|
-
docs: { source: { code:
|
|
21
|
+
docs: { source: { code: "<div className=\"flex items-center gap-2\">\\n <Checkbox id=\"c1\" />\\n <Label htmlFor=\"c1\">Accept terms and conditions</Label>\\n</div>", language: "tsx" } },
|
|
22
22
|
},
|
|
23
23
|
} satisfies Meta;
|
|
24
24
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx · controls: scripts/gen-stories.mjs CONTROLS */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { CircularProgress } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => {
|
|
@@ -31,7 +31,7 @@ const meta = {
|
|
|
31
31
|
},
|
|
32
32
|
parameters: {
|
|
33
33
|
layout: "centered",
|
|
34
|
-
docs: { source: { code:
|
|
34
|
+
docs: { source: { code: "<CircularProgress value={66} showValue />\\n<CircularProgress value={66} size={64} strokeWidth={6} showValue />", language: "tsx" } },
|
|
35
35
|
},
|
|
36
36
|
} satisfies Meta;
|
|
37
37
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Button, CodeBlock } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => (
|
|
@@ -16,7 +16,7 @@ const meta = {
|
|
|
16
16
|
title: "Foundations/CodeBlock",
|
|
17
17
|
parameters: {
|
|
18
18
|
layout: "centered",
|
|
19
|
-
docs: { source: { code:
|
|
19
|
+
docs: { source: { code: "<CodeBlock filename=\"button.tsx\" code={source} />", language: "tsx" } },
|
|
20
20
|
},
|
|
21
21
|
} satisfies Meta;
|
|
22
22
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx · controls: scripts/gen-stories.mjs CONTROLS */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Button, Collapsible, CollapsibleContent, CollapsibleTrigger, Toggle } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => (
|
|
@@ -26,7 +26,7 @@ const meta = {
|
|
|
26
26
|
argTypes: { defaultOpen: { control: "boolean" }, disabled: { control: "boolean" } },
|
|
27
27
|
parameters: {
|
|
28
28
|
layout: "centered",
|
|
29
|
-
docs: { source: { code:
|
|
29
|
+
docs: { source: { code: "<Collapsible>\\n <CollapsibleTrigger>Toggle</CollapsibleTrigger>\\n <CollapsibleContent>…</CollapsibleContent>\\n</Collapsible>", language: "tsx" } },
|
|
30
30
|
},
|
|
31
31
|
} satisfies Meta;
|
|
32
32
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Command as Cmd, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@kinetixui/ui";
|
|
6
6
|
import { Search } from "lucide-react";
|
|
7
7
|
|
|
@@ -23,7 +23,7 @@ const meta = {
|
|
|
23
23
|
title: "Controls & Actions/Combobox",
|
|
24
24
|
parameters: {
|
|
25
25
|
layout: "centered",
|
|
26
|
-
docs: { source: { code:
|
|
26
|
+
docs: { source: { code: "// Popover + Command\\n<Popover>\\n <PopoverTrigger asChild><Button variant=\"Outline\">Select framework…</Button></PopoverTrigger>\\n <PopoverContent className=\"p-0\">\\n <Command>…</Command>\\n </PopoverContent>\\n</Popover>", language: "tsx" } },
|
|
27
27
|
},
|
|
28
28
|
} satisfies Meta;
|
|
29
29
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Calendar, Command as Cmd, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@kinetixui/ui";
|
|
6
6
|
import { Search } from "lucide-react";
|
|
7
7
|
|
|
@@ -23,7 +23,7 @@ const meta = {
|
|
|
23
23
|
title: "Controls & Actions/Command",
|
|
24
24
|
parameters: {
|
|
25
25
|
layout: "centered",
|
|
26
|
-
docs: { source: { code:
|
|
26
|
+
docs: { source: { code: "<Command>\\n <CommandInput placeholder=\"Type a command…\" />\\n <CommandList>\\n <CommandEmpty>No results found.</CommandEmpty>\\n <CommandGroup heading=\"Suggestions\">\\n <CommandItem>Calendar</CommandItem>\\n </CommandGroup>\\n </CommandList>\\n</Command>", language: "tsx" } },
|
|
27
27
|
},
|
|
28
28
|
} satisfies Meta;
|
|
29
29
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => (
|
|
@@ -22,7 +22,7 @@ const meta = {
|
|
|
22
22
|
title: "Overlays/ContextMenu",
|
|
23
23
|
parameters: {
|
|
24
24
|
layout: "centered",
|
|
25
|
-
docs: { source: { code:
|
|
25
|
+
docs: { source: { code: "<ContextMenu>\\n <ContextMenuTrigger>Right-click here</ContextMenuTrigger>\\n <ContextMenuContent>\\n <ContextMenuItem>Back</ContextMenuItem>\\n </ContextMenuContent>\\n</ContextMenu>", language: "tsx" } },
|
|
26
26
|
},
|
|
27
27
|
} satisfies Meta;
|
|
28
28
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { DataTable } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => {
|
|
@@ -22,7 +22,7 @@ const meta = {
|
|
|
22
22
|
title: "Data Display/DataTable",
|
|
23
23
|
parameters: {
|
|
24
24
|
layout: "padded",
|
|
25
|
-
docs: { source: { code:
|
|
25
|
+
docs: { source: { code: "const columns: ColumnDef<Invoice>[] = [\\n { accessorKey: \"invoice\", header: \"Invoice\" },\\n { accessorKey: \"amount\", header: \"Amount\" },\\n]\\n<DataTable columns={columns} data={data} />", language: "tsx" } },
|
|
26
26
|
},
|
|
27
27
|
} satisfies Meta;
|
|
28
28
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { DatePicker } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => {
|
|
@@ -21,7 +21,7 @@ const meta = {
|
|
|
21
21
|
title: "Form Inputs/DatePicker",
|
|
22
22
|
parameters: {
|
|
23
23
|
layout: "centered",
|
|
24
|
-
docs: { source: { code:
|
|
24
|
+
docs: { source: { code: "<DatePicker\\n label=\"Appointment date\"\\n value={date}\\n onChange={setDate}\\n helperText=\"Choose a weekday\"\\n/>", language: "tsx" } },
|
|
25
25
|
},
|
|
26
26
|
} satisfies Meta;
|
|
27
27
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Input, Label } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => (
|
|
@@ -29,7 +29,7 @@ const meta = {
|
|
|
29
29
|
title: "Overlays/Dialog",
|
|
30
30
|
parameters: {
|
|
31
31
|
layout: "centered",
|
|
32
|
-
docs: { source: { code:
|
|
32
|
+
docs: { source: { code: "<Dialog>\\n <DialogTrigger asChild><Button variant=\"Outline\">Edit profile</Button></DialogTrigger>\\n <DialogContent>…</DialogContent>\\n</Dialog>", language: "tsx" } },
|
|
33
33
|
},
|
|
34
34
|
} satisfies Meta;
|
|
35
35
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Button, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => (
|
|
@@ -30,7 +30,7 @@ const meta = {
|
|
|
30
30
|
title: "Overlays/Drawer",
|
|
31
31
|
parameters: {
|
|
32
32
|
layout: "centered",
|
|
33
|
-
docs: { source: { code:
|
|
33
|
+
docs: { source: { code: "<Drawer>\\n <DrawerTrigger asChild><Button variant=\"Outline\">Open Drawer</Button></DrawerTrigger>\\n <DrawerContent>…</DrawerContent>\\n</Drawer>", language: "tsx" } },
|
|
34
34
|
},
|
|
35
35
|
} satisfies Meta;
|
|
36
36
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Button, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "@kinetixui/ui";
|
|
6
6
|
|
|
7
7
|
const Demo = () => (
|
|
@@ -23,7 +23,7 @@ const meta = {
|
|
|
23
23
|
title: "Overlays/DropdownMenu",
|
|
24
24
|
parameters: {
|
|
25
25
|
layout: "centered",
|
|
26
|
-
docs: { source: { code:
|
|
26
|
+
docs: { source: { code: "<DropdownMenu>\\n <DropdownMenuTrigger asChild><Button variant=\"Outline\">Open</Button></DropdownMenuTrigger>\\n <DropdownMenuContent>…</DropdownMenuContent>\\n</DropdownMenu>", language: "tsx" } },
|
|
27
27
|
},
|
|
28
28
|
} satisfies Meta;
|
|
29
29
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
2
|
Source of truth: apps/web/src/registry/demos.tsx · controls: scripts/gen-stories.mjs CONTROLS */
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
5
|
import { Fab } from "@kinetixui/ui";
|
|
6
6
|
import { Plus } from "lucide-react";
|
|
7
7
|
|
|
@@ -31,7 +31,7 @@ const meta = {
|
|
|
31
31
|
},
|
|
32
32
|
parameters: {
|
|
33
33
|
layout: "centered",
|
|
34
|
-
docs: { source: { code:
|
|
34
|
+
docs: { source: { code: "<Fab aria-label=\"Add\">\\n <Plus />\\n</Fab>\\n\\n<Fab extended>\\n <Plus />\\n New item\\n</Fab>", language: "tsx" } },
|
|
35
35
|
},
|
|
36
36
|
} satisfies Meta;
|
|
37
37
|
|