@kinetixui/ui 0.1.0 → 0.4.0
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 +30 -21
- package/package.json +12 -4
- package/src/components/button.tsx +19 -12
- package/src/components/context-menu.tsx +1 -1
- package/src/components/dropdown-menu.tsx +1 -1
- package/src/components/input-group.tsx +2 -1
- package/src/components/list.tsx +3 -1
- package/src/components/menubar.tsx +2 -2
- package/src/components/navigation-bar.tsx +1 -1
- package/src/components/select.tsx +1 -1
- package/src/components/toggle.tsx +1 -1
- package/src/components-behavior.test.tsx +74 -0
- package/src/components-smoke.test.tsx +47 -0
- package/src/stories/Accordion.stories.tsx +49 -0
- package/src/stories/Alert.stories.tsx +38 -0
- package/src/stories/AlertDialog.stories.tsx +35 -0
- package/src/stories/AspectRatio.stories.tsx +32 -0
- package/src/stories/AudioPlayer.stories.tsx +26 -0
- package/src/stories/Avatar.stories.tsx +23 -0
- package/src/stories/AvatarGroup.stories.tsx +37 -0
- package/src/stories/Badge.stories.tsx +35 -0
- package/src/stories/Breadcrumb.stories.tsx +36 -0
- package/src/stories/Calendar.stories.tsx +25 -0
- package/src/stories/Card.stories.tsx +33 -0
- package/src/stories/Carousel.stories.tsx +33 -0
- package/src/stories/Chart.stories.tsx +44 -0
- package/src/stories/Checkbox.stories.tsx +29 -0
- package/src/stories/CircularProgress.stories.tsx +42 -0
- package/src/stories/CodeBlock.stories.tsx +25 -0
- package/src/stories/Collapsible.stories.tsx +50 -0
- package/src/stories/Combobox.stories.tsx +32 -0
- package/src/stories/Command.stories.tsx +32 -0
- package/src/stories/ContextMenu.stories.tsx +31 -0
- package/src/stories/DataTable.stories.tsx +31 -0
- package/src/stories/DatePicker.stories.tsx +30 -0
- package/src/stories/Dialog.stories.tsx +38 -0
- package/src/stories/Drawer.stories.tsx +39 -0
- package/src/stories/DropdownMenu.stories.tsx +32 -0
- package/src/stories/Fab.stories.tsx +47 -0
- package/src/stories/Field.stories.tsx +35 -0
- package/src/stories/FileUpload.stories.tsx +36 -0
- package/src/stories/Footer.stories.tsx +39 -0
- package/src/stories/Form.stories.tsx +28 -0
- package/src/stories/HoverCard.stories.tsx +41 -0
- package/src/stories/Image.stories.tsx +35 -0
- package/src/stories/Inform.stories.tsx +39 -0
- package/src/stories/InputGroup.stories.tsx +36 -0
- package/src/stories/InputOTP.stories.tsx +27 -0
- package/src/stories/Label.stories.tsx +24 -0
- package/src/stories/List.stories.tsx +26 -0
- package/src/stories/Menubar.stories.tsx +38 -0
- package/src/stories/Metric.stories.tsx +32 -0
- package/src/stories/Modal.stories.tsx +31 -0
- package/src/stories/NavigationBar.stories.tsx +32 -0
- package/src/stories/NavigationMenu.stories.tsx +34 -0
- package/src/stories/NumberInput.stories.tsx +29 -0
- package/src/stories/Pagination.stories.tsx +30 -0
- package/src/stories/PasswordInput.stories.tsx +23 -0
- package/src/stories/Popover.stories.tsx +47 -0
- package/src/stories/Progress.stories.tsx +31 -0
- package/src/stories/Quote.stories.tsx +32 -0
- package/src/stories/RadioGroup.stories.tsx +45 -0
- package/src/stories/Rating.stories.tsx +35 -0
- package/src/stories/Resizable.stories.tsx +29 -0
- package/src/stories/ScrollArea.stories.tsx +25 -0
- package/src/stories/Select.stories.tsx +46 -0
- package/src/stories/Separator.stories.tsx +41 -0
- package/src/stories/Sheet.stories.tsx +31 -0
- package/src/stories/Sidebar.stories.tsx +25 -0
- package/src/stories/Skeleton.stories.tsx +27 -0
- package/src/stories/Slider.stories.tsx +24 -0
- package/src/stories/Sonner.stories.tsx +26 -0
- package/src/stories/Spinner.stories.tsx +33 -0
- package/src/stories/Stepper.stories.tsx +35 -0
- package/src/stories/Switch.stories.tsx +29 -0
- package/src/stories/TabBar.stories.tsx +35 -0
- package/src/stories/Table.stories.tsx +42 -0
- package/src/stories/TableOfContents.stories.tsx +31 -0
- package/src/stories/Tabs.stories.tsx +50 -0
- package/src/stories/Tag.stories.tsx +42 -0
- package/src/stories/Toggle.stories.tsx +34 -0
- package/src/stories/ToggleGroup.stories.tsx +37 -0
- package/src/stories/Tooltip.stories.tsx +42 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
import { Stepper } from "@kinetixui/ui";
|
|
6
|
+
|
|
7
|
+
const Demo = () => (
|
|
8
|
+
<div className="flex w-full max-w-lg flex-col gap-8">
|
|
9
|
+
<Stepper
|
|
10
|
+
current={1}
|
|
11
|
+
steps={[{ label: "Account" }, { label: "Profile" }, { label: "Review" }]}
|
|
12
|
+
/>
|
|
13
|
+
<Stepper
|
|
14
|
+
orientation="vertical"
|
|
15
|
+
current={1}
|
|
16
|
+
steps={[
|
|
17
|
+
{ label: "Order placed", description: "We've received your order." },
|
|
18
|
+
{ label: "Processing", description: "Your order is being prepared." },
|
|
19
|
+
{ label: "Shipped", description: "On its way to you." },
|
|
20
|
+
]}
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const meta = {
|
|
26
|
+
title: "Navigation/Stepper",
|
|
27
|
+
parameters: {
|
|
28
|
+
layout: "padded",
|
|
29
|
+
docs: { source: { code: `<Stepper\n current={1}\n steps={[{ label: "Account" }, { label: "Profile" }, { label: "Review" }]}\n/>`, language: "tsx" } },
|
|
30
|
+
},
|
|
31
|
+
} satisfies Meta;
|
|
32
|
+
|
|
33
|
+
export default meta;
|
|
34
|
+
|
|
35
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx · controls: scripts/gen-stories.mjs CONTROLS */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
import { Label, Switch } from "@kinetixui/ui";
|
|
6
|
+
|
|
7
|
+
const Demo = () => (
|
|
8
|
+
<div className="flex items-center gap-2">
|
|
9
|
+
<Switch id="airplane" />
|
|
10
|
+
<Label htmlFor="airplane">Airplane mode</Label>
|
|
11
|
+
</div>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
const meta = {
|
|
15
|
+
title: "Form Inputs/Switch",
|
|
16
|
+
component: Switch,
|
|
17
|
+
args: { disabled: false, defaultChecked: false },
|
|
18
|
+
argTypes: { disabled: { control: "boolean" }, defaultChecked: { control: "boolean" } },
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: "centered",
|
|
21
|
+
docs: { source: { code: `<div className="flex items-center gap-2">\n <Switch id="airplane" />\n <Label htmlFor="airplane">Airplane mode</Label>\n</div>`, language: "tsx" } },
|
|
22
|
+
},
|
|
23
|
+
} satisfies Meta;
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
|
|
27
|
+
export const Playground: StoryObj<typeof meta> = { render: (args) => <Switch {...args} /> };
|
|
28
|
+
|
|
29
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
import { TabBar, TabBarItem } from "@kinetixui/ui";
|
|
6
|
+
import { Home, Mail, Search, User } from "lucide-react";
|
|
7
|
+
|
|
8
|
+
const Demo = () => {
|
|
9
|
+
const [active, setActive] = React.useState("home");
|
|
10
|
+
const items = [
|
|
11
|
+
{ key: "home", icon: <Home />, label: "Home" },
|
|
12
|
+
{ key: "search", icon: <Search />, label: "Search" },
|
|
13
|
+
{ key: "mail", icon: <Mail />, label: "Mail", badge: 3 },
|
|
14
|
+
{ key: "profile", icon: <User />, label: "Profile" },
|
|
15
|
+
];
|
|
16
|
+
return (
|
|
17
|
+
<TabBar className="w-full max-w-sm rounded-md">
|
|
18
|
+
{items.map((it) => (
|
|
19
|
+
<TabBarItem key={it.key} icon={it.icon} label={it.label} badge={it.badge} active={active === it.key} onClick={() => setActive(it.key)} />
|
|
20
|
+
))}
|
|
21
|
+
</TabBar>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const meta = {
|
|
26
|
+
title: "Navigation/TabBar",
|
|
27
|
+
parameters: {
|
|
28
|
+
layout: "centered",
|
|
29
|
+
docs: { source: { code: `<TabBar>\n <TabBarItem icon={<Home />} label="Home" active={tab === "home"} onClick={() => setTab("home")} />\n <TabBarItem icon={<Mail />} label="Mail" badge={3} active={tab === "mail"} onClick={() => setTab("mail")} />\n</TabBar>`, language: "tsx" } },
|
|
30
|
+
},
|
|
31
|
+
} satisfies Meta;
|
|
32
|
+
|
|
33
|
+
export default meta;
|
|
34
|
+
|
|
35
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@kinetixui/ui";
|
|
6
|
+
|
|
7
|
+
const Demo = () => (
|
|
8
|
+
<Table>
|
|
9
|
+
<TableHeader>
|
|
10
|
+
<TableRow>
|
|
11
|
+
<TableHead>Invoice</TableHead>
|
|
12
|
+
<TableHead>Status</TableHead>
|
|
13
|
+
<TableHead className="text-right">Amount</TableHead>
|
|
14
|
+
</TableRow>
|
|
15
|
+
</TableHeader>
|
|
16
|
+
<TableBody>
|
|
17
|
+
{[
|
|
18
|
+
["INV001", "Paid", "$250.00"],
|
|
19
|
+
["INV002", "Pending", "$150.00"],
|
|
20
|
+
["INV003", "Unpaid", "$350.00"],
|
|
21
|
+
].map((r) => (
|
|
22
|
+
<TableRow key={r[0]}>
|
|
23
|
+
<TableCell className="font-medium">{r[0]}</TableCell>
|
|
24
|
+
<TableCell>{r[1]}</TableCell>
|
|
25
|
+
<TableCell className="text-right">{r[2]}</TableCell>
|
|
26
|
+
</TableRow>
|
|
27
|
+
))}
|
|
28
|
+
</TableBody>
|
|
29
|
+
</Table>
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const meta = {
|
|
33
|
+
title: "Data Display/Table",
|
|
34
|
+
parameters: {
|
|
35
|
+
layout: "padded",
|
|
36
|
+
docs: { source: { code: `<Table>\n <TableHeader>…</TableHeader>\n <TableBody>\n <TableRow><TableCell>INV001</TableCell>…</TableRow>\n </TableBody>\n</Table>`, language: "tsx" } },
|
|
37
|
+
},
|
|
38
|
+
} satisfies Meta;
|
|
39
|
+
|
|
40
|
+
export default meta;
|
|
41
|
+
|
|
42
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
import { TableOfContents } from "@kinetixui/ui";
|
|
6
|
+
|
|
7
|
+
const Demo = () => (
|
|
8
|
+
<TableOfContents
|
|
9
|
+
className="w-full max-w-xs"
|
|
10
|
+
active="props"
|
|
11
|
+
items={[
|
|
12
|
+
{ id: "overview", label: "Overview", level: 1 },
|
|
13
|
+
{ id: "installation", label: "Installation", level: 1 },
|
|
14
|
+
{ id: "usage", label: "Usage", level: 1 },
|
|
15
|
+
{ id: "props", label: "Props", level: 2 },
|
|
16
|
+
{ id: "examples", label: "Examples", level: 2 },
|
|
17
|
+
]}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const meta = {
|
|
22
|
+
title: "Navigation/TableOfContents",
|
|
23
|
+
parameters: {
|
|
24
|
+
layout: "centered",
|
|
25
|
+
docs: { source: { code: `<TableOfContents\n active={activeId}\n items={[{ id: "overview", label: "Overview" }, { id: "props", label: "Props", level: 2 }]}\n/>`, language: "tsx" } },
|
|
26
|
+
},
|
|
27
|
+
} satisfies Meta;
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
30
|
+
|
|
31
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx · controls: scripts/gen-stories.mjs CONTROLS */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@kinetixui/ui";
|
|
6
|
+
|
|
7
|
+
const Demo = () => (
|
|
8
|
+
<Tabs defaultValue="account" className="w-[360px]">
|
|
9
|
+
<TabsList className="grid w-full grid-cols-2">
|
|
10
|
+
<TabsTrigger value="account">Account</TabsTrigger>
|
|
11
|
+
<TabsTrigger value="password">Password</TabsTrigger>
|
|
12
|
+
</TabsList>
|
|
13
|
+
<TabsContent value="account" className="text-sm text-muted-foreground">
|
|
14
|
+
Make changes to your account here.
|
|
15
|
+
</TabsContent>
|
|
16
|
+
<TabsContent value="password" className="text-sm text-muted-foreground">
|
|
17
|
+
Change your password here.
|
|
18
|
+
</TabsContent>
|
|
19
|
+
</Tabs>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const meta = {
|
|
23
|
+
title: "Navigation/Tabs",
|
|
24
|
+
component: Tabs,
|
|
25
|
+
args: { defaultValue: "account" },
|
|
26
|
+
argTypes: { defaultValue: { control: "inline-radio", options: ["account", "password"] } },
|
|
27
|
+
parameters: {
|
|
28
|
+
layout: "centered",
|
|
29
|
+
docs: { source: { code: `<Tabs defaultValue="account">\n <TabsList>\n <TabsTrigger value="account">Account</TabsTrigger>\n <TabsTrigger value="password">Password</TabsTrigger>\n </TabsList>\n <TabsContent value="account">…</TabsContent>\n</Tabs>`, language: "tsx" } },
|
|
30
|
+
},
|
|
31
|
+
} satisfies Meta;
|
|
32
|
+
|
|
33
|
+
export default meta;
|
|
34
|
+
|
|
35
|
+
export const Playground: StoryObj<typeof meta> = { render: (args) => (
|
|
36
|
+
<Tabs {...args} className="w-[360px]">
|
|
37
|
+
<TabsList className="grid w-full grid-cols-2">
|
|
38
|
+
<TabsTrigger value="account">Account</TabsTrigger>
|
|
39
|
+
<TabsTrigger value="password">Password</TabsTrigger>
|
|
40
|
+
</TabsList>
|
|
41
|
+
<TabsContent value="account" className="text-sm text-muted-foreground">
|
|
42
|
+
Make changes to your account here.
|
|
43
|
+
</TabsContent>
|
|
44
|
+
<TabsContent value="password" className="text-sm text-muted-foreground">
|
|
45
|
+
Change your password here.
|
|
46
|
+
</TabsContent>
|
|
47
|
+
</Tabs>
|
|
48
|
+
) };
|
|
49
|
+
|
|
50
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx · controls: scripts/gen-stories.mjs CONTROLS */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
import { Tag } from "@kinetixui/ui";
|
|
6
|
+
|
|
7
|
+
const Demo = () => {
|
|
8
|
+
const [tags, setTags] = React.useState(["design", "tokens", "figma"]);
|
|
9
|
+
return (
|
|
10
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
11
|
+
{tags.map((t) => (
|
|
12
|
+
<Tag key={t} onRemove={() => setTags((cur) => cur.filter((x) => x !== t))}>
|
|
13
|
+
{t}
|
|
14
|
+
</Tag>
|
|
15
|
+
))}
|
|
16
|
+
<Tag variant="secondary">secondary</Tag>
|
|
17
|
+
<Tag variant="destructive">destructive</Tag>
|
|
18
|
+
<Tag variant="warning">warning</Tag>
|
|
19
|
+
<Tag variant="outline">outline</Tag>
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const meta = {
|
|
25
|
+
title: "Feedback/Tag",
|
|
26
|
+
component: Tag,
|
|
27
|
+
args: { variant: "default", children: "tag" },
|
|
28
|
+
argTypes: {
|
|
29
|
+
variant: { control: "select", options: ["default", "secondary", "destructive", "warning", "outline"] },
|
|
30
|
+
children: { control: "text" },
|
|
31
|
+
},
|
|
32
|
+
parameters: {
|
|
33
|
+
layout: "centered",
|
|
34
|
+
docs: { source: { code: `<Tag onRemove={() => remove(t)}>{t}</Tag>\n<Tag variant="secondary">secondary</Tag>\n<Tag variant="warning">warning</Tag>\n<Tag variant="outline">outline</Tag>`, language: "tsx" } },
|
|
35
|
+
},
|
|
36
|
+
} satisfies Meta;
|
|
37
|
+
|
|
38
|
+
export default meta;
|
|
39
|
+
|
|
40
|
+
export const Playground: StoryObj<typeof meta> = { render: (args) => <Tag {...args} /> };
|
|
41
|
+
|
|
42
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx · controls: scripts/gen-stories.mjs CONTROLS */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
import { Toggle } from "@kinetixui/ui";
|
|
6
|
+
import { Italic } from "lucide-react";
|
|
7
|
+
|
|
8
|
+
const Demo = () => (
|
|
9
|
+
<Toggle aria-label="Toggle italic">
|
|
10
|
+
<Italic className="size-4" />
|
|
11
|
+
</Toggle>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
const meta = {
|
|
15
|
+
title: "Controls & Actions/Toggle",
|
|
16
|
+
component: Toggle,
|
|
17
|
+
args: { variant: "default", size: "default" },
|
|
18
|
+
argTypes: {
|
|
19
|
+
variant: { control: "inline-radio", options: ["default", "outline"] },
|
|
20
|
+
size: { control: "inline-radio", options: ["default", "sm", "lg"] },
|
|
21
|
+
},
|
|
22
|
+
parameters: {
|
|
23
|
+
layout: "centered",
|
|
24
|
+
docs: { source: { code: `<Toggle aria-label="Toggle italic"><Italic className="size-4" /></Toggle>`, language: "tsx" } },
|
|
25
|
+
},
|
|
26
|
+
} satisfies Meta;
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
|
|
30
|
+
export const Playground: StoryObj<typeof meta> = { render: (args) => (
|
|
31
|
+
<Toggle {...args} aria-label="Toggle italic"><Italic className="size-4" /></Toggle>
|
|
32
|
+
) };
|
|
33
|
+
|
|
34
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx · controls: scripts/gen-stories.mjs CONTROLS */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
import { ToggleGroup, ToggleGroupItem } from "@kinetixui/ui";
|
|
6
|
+
import { Bold, Italic, Underline } from "lucide-react";
|
|
7
|
+
|
|
8
|
+
const Demo = () => (
|
|
9
|
+
<ToggleGroup type="multiple">
|
|
10
|
+
<ToggleGroupItem value="bold"><Bold className="size-4" /></ToggleGroupItem>
|
|
11
|
+
<ToggleGroupItem value="italic"><Italic className="size-4" /></ToggleGroupItem>
|
|
12
|
+
<ToggleGroupItem value="underline"><Underline className="size-4" /></ToggleGroupItem>
|
|
13
|
+
</ToggleGroup>
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
const meta = {
|
|
17
|
+
title: "Controls & Actions/ToggleGroup",
|
|
18
|
+
component: ToggleGroup,
|
|
19
|
+
args: { type: "multiple" },
|
|
20
|
+
argTypes: { type: { control: "inline-radio", options: ["single", "multiple"] } },
|
|
21
|
+
parameters: {
|
|
22
|
+
layout: "centered",
|
|
23
|
+
docs: { source: { code: `<ToggleGroup type="multiple">\n <ToggleGroupItem value="bold"><Bold /></ToggleGroupItem>\n <ToggleGroupItem value="italic"><Italic /></ToggleGroupItem>\n</ToggleGroup>`, language: "tsx" } },
|
|
24
|
+
},
|
|
25
|
+
} satisfies Meta;
|
|
26
|
+
|
|
27
|
+
export default meta;
|
|
28
|
+
|
|
29
|
+
export const Playground: StoryObj<typeof meta> = { render: (args) => (
|
|
30
|
+
<ToggleGroup {...args}>
|
|
31
|
+
<ToggleGroupItem value="bold"><Bold className="size-4" /></ToggleGroupItem>
|
|
32
|
+
<ToggleGroupItem value="italic"><Italic className="size-4" /></ToggleGroupItem>
|
|
33
|
+
<ToggleGroupItem value="underline"><Underline className="size-4" /></ToggleGroupItem>
|
|
34
|
+
</ToggleGroup>
|
|
35
|
+
) };
|
|
36
|
+
|
|
37
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx · controls: scripts/gen-stories.mjs CONTROLS */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
import { Button, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@kinetixui/ui";
|
|
6
|
+
|
|
7
|
+
const Demo = () => (
|
|
8
|
+
<TooltipProvider>
|
|
9
|
+
<Tooltip>
|
|
10
|
+
<TooltipTrigger asChild>
|
|
11
|
+
<Button variant="Outline">Hover</Button>
|
|
12
|
+
</TooltipTrigger>
|
|
13
|
+
<TooltipContent>Add to library</TooltipContent>
|
|
14
|
+
</Tooltip>
|
|
15
|
+
</TooltipProvider>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const meta = {
|
|
19
|
+
title: "Overlays/Tooltip",
|
|
20
|
+
component: Tooltip,
|
|
21
|
+
args: { delayDuration: 200 },
|
|
22
|
+
argTypes: { delayDuration: { control: { type: "number", step: 100 } } },
|
|
23
|
+
parameters: {
|
|
24
|
+
layout: "centered",
|
|
25
|
+
docs: { source: { code: `<TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild><Button variant="Outline">Hover</Button></TooltipTrigger>\n <TooltipContent>Add to library</TooltipContent>\n </Tooltip>\n</TooltipProvider>`, language: "tsx" } },
|
|
26
|
+
},
|
|
27
|
+
} satisfies Meta;
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
30
|
+
|
|
31
|
+
export const Playground: StoryObj<typeof meta> = { render: (args) => (
|
|
32
|
+
<TooltipProvider>
|
|
33
|
+
<Tooltip {...args}>
|
|
34
|
+
<TooltipTrigger asChild>
|
|
35
|
+
<Button variant="Outline">Hover</Button>
|
|
36
|
+
</TooltipTrigger>
|
|
37
|
+
<TooltipContent>Add to library</TooltipContent>
|
|
38
|
+
</Tooltip>
|
|
39
|
+
</TooltipProvider>
|
|
40
|
+
) };
|
|
41
|
+
|
|
42
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|