@syscore/ui-library 2.0.0-beta-publish-workflow-beta.9 → 2.0.0-beta-publish-workflow-beta.11

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.
Files changed (34) hide show
  1. package/client/components/ui/avatar-identity.tsx +16 -3
  2. package/client/components/ui/avatar.tsx +32 -4
  3. package/client/components/ui/back-link.tsx +35 -0
  4. package/client/components/ui/card.tsx +20 -3
  5. package/client/components/ui/centered-page.tsx +27 -0
  6. package/client/components/ui/checkbox-field.tsx +57 -0
  7. package/client/components/ui/dialog.tsx +6 -0
  8. package/client/components/ui/icon-button.tsx +45 -0
  9. package/client/components/ui/layout.tsx +32 -5
  10. package/client/components/ui/modal-panel.tsx +35 -4
  11. package/client/components/ui/outline-node.tsx +112 -0
  12. package/client/components/ui/radio-card.tsx +54 -0
  13. package/client/components/ui/resource-thumbnail.tsx +12 -1
  14. package/client/components/ui/side-nav.tsx +126 -0
  15. package/client/components/ui/status-pill.tsx +37 -4
  16. package/client/components/ui/table.tsx +26 -4
  17. package/client/components/ui/typography.tsx +29 -2
  18. package/client/global.css +815 -9
  19. package/client/ui/Avatar.stories.tsx +78 -0
  20. package/client/ui/BackLink.stories.tsx +50 -0
  21. package/client/ui/Card.stories.tsx +30 -0
  22. package/client/ui/CenteredPage.stories.tsx +43 -0
  23. package/client/ui/CheckboxField.stories.tsx +68 -0
  24. package/client/ui/Dialog.stories.tsx +31 -0
  25. package/client/ui/IconButton.stories.tsx +77 -0
  26. package/client/ui/OutlineNode.stories.tsx +106 -0
  27. package/client/ui/RadioCard.stories.tsx +75 -0
  28. package/client/ui/SideNav.stories.tsx +68 -0
  29. package/client/ui/StatusPill.stories.tsx +78 -0
  30. package/client/ui/Table/Table.stories.tsx +32 -0
  31. package/dist/index.cjs.js +1 -1
  32. package/dist/index.d.ts +84 -0
  33. package/dist/index.es.js +398 -40
  34. package/package.json +1 -1
@@ -0,0 +1,78 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Avatar, AvatarFallback, AvatarImage } from "../components/ui/avatar";
3
+
4
+ const meta = {
5
+ title: "Components/Avatar",
6
+ component: Avatar,
7
+ tags: ["autodocs"],
8
+ parameters: {
9
+ layout: "centered",
10
+ docs: {
11
+ description: {
12
+ component:
13
+ "Round user avatar. `size`: `sm` (32px), `md` (40px, default), `lg` (64px), `xl` (176px). " +
14
+ "`appearance=\"brand\"` shows initials on the brand teal with a thin gradient ring, " +
15
+ "for the signed-in user's disc in a header.",
16
+ },
17
+ },
18
+ },
19
+ } satisfies Meta<typeof Avatar>;
20
+
21
+ export default meta;
22
+
23
+ type Story = StoryObj<typeof meta>;
24
+
25
+ export const Default: Story = {
26
+ render: () => (
27
+ <Avatar>
28
+ <AvatarFallback>DS</AvatarFallback>
29
+ </Avatar>
30
+ ),
31
+ };
32
+
33
+ export const WithImage: Story = {
34
+ render: () => (
35
+ <Avatar>
36
+ <AvatarImage src="https://i.pravatar.cc/80?img=12" alt="Dheeraj Sanagani" />
37
+ <AvatarFallback>DS</AvatarFallback>
38
+ </Avatar>
39
+ ),
40
+ };
41
+
42
+ export const Brand: Story = {
43
+ render: () => (
44
+ <Avatar appearance="brand">
45
+ <AvatarFallback>DS</AvatarFallback>
46
+ </Avatar>
47
+ ),
48
+ };
49
+
50
+ export const AllVariants: Story = {
51
+ render: () => (
52
+ <div style={{ display: "flex", alignItems: "center", gap: 16 }}>
53
+ {(["sm", "md", "lg", "xl"] as const).map((size) => (
54
+ <Avatar key={size} size={size}>
55
+ <AvatarFallback>DS</AvatarFallback>
56
+ </Avatar>
57
+ ))}
58
+ {(["sm", "md", "lg", "xl"] as const).map((size) => (
59
+ <Avatar key={`brand-${size}`} size={size} appearance="brand">
60
+ <AvatarFallback>DS</AvatarFallback>
61
+ </Avatar>
62
+ ))}
63
+ </div>
64
+ ),
65
+ };
66
+
67
+ export const InteractiveAvatar: Story = {
68
+ args: { size: "md", appearance: "default" },
69
+ argTypes: {
70
+ size: { control: "select", options: ["sm", "md", "lg", "xl"] },
71
+ appearance: { control: "select", options: ["default", "brand"] },
72
+ },
73
+ render: (args) => (
74
+ <Avatar {...args}>
75
+ <AvatarFallback>DS</AvatarFallback>
76
+ </Avatar>
77
+ ),
78
+ };
@@ -0,0 +1,50 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { BackLink } from "../components/ui/back-link";
3
+
4
+ const meta = {
5
+ title: "Components/BackLink",
6
+ component: BackLink,
7
+ tags: ["autodocs"],
8
+ parameters: {
9
+ layout: "centered",
10
+ docs: {
11
+ description: {
12
+ component:
13
+ 'The "← Back to <list>" control above a detail page\'s title. A `<button>` by default; ' +
14
+ "use `asChild` with a router `<Link>` or `<a>` to navigate by href.",
15
+ },
16
+ },
17
+ },
18
+ } satisfies Meta<typeof BackLink>;
19
+
20
+ export default meta;
21
+
22
+ type Story = StoryObj<typeof meta>;
23
+
24
+ export const Default: Story = { args: { children: "Back" } };
25
+
26
+ export const WithLabel: Story = { args: { children: "Estimates" } };
27
+
28
+ export const AsLink: Story = {
29
+ render: () => (
30
+ <BackLink asChild>
31
+ <a href="#estimates">Estimates</a>
32
+ </BackLink>
33
+ ),
34
+ };
35
+
36
+ export const AllVariants: Story = {
37
+ render: () => (
38
+ <div style={{ display: "flex", flexDirection: "column", gap: 12, alignItems: "flex-start" }}>
39
+ <BackLink>Back</BackLink>
40
+ <BackLink>Standard content</BackLink>
41
+ <BackLink asChild>
42
+ <a href="#invoices">Invoices (link)</a>
43
+ </BackLink>
44
+ </div>
45
+ ),
46
+ };
47
+
48
+ export const InteractiveBackLink: Story = {
49
+ args: { children: "Back", onClick: () => undefined },
50
+ };
@@ -453,3 +453,33 @@ export const ConceptCard: Story = {
453
453
  );
454
454
  },
455
455
  };
456
+
457
+ export const Panel: Story = {
458
+ render: () => (
459
+ <Card variant="panel" className="w-full max-w-sm">
460
+ <CardTitle>Price</CardTitle>
461
+ <CardContent>A bordered 16px-radius panel for a side summary. Add `sticky` to pin it while the page scrolls.</CardContent>
462
+ </Card>
463
+ ),
464
+ };
465
+
466
+ export const Inset: Story = {
467
+ render: () => (
468
+ <Card variant="inset" className="w-full max-w-sm">
469
+ <CardTitle>Project 1</CardTitle>
470
+ <CardContent>A bordered 12px-radius box nested inside a form or another card.</CardContent>
471
+ </Card>
472
+ ),
473
+ };
474
+
475
+ export const RelaxedSpacing: Story = {
476
+ render: () => (
477
+ <Card variant="outlined" spacing="relaxed" className="w-full max-w-sm">
478
+ <CardHeader>
479
+ <CardTitle>Relaxed spacing</CardTitle>
480
+ <CardDescription>More air between the heading, its description and the content.</CardDescription>
481
+ </CardHeader>
482
+ <CardContent>Used on dense back-office pages.</CardContent>
483
+ </Card>
484
+ ),
485
+ };
@@ -0,0 +1,43 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { CenteredPage } from "../components/ui/centered-page";
3
+ import { ModalPanel, ModalTitle } from "../components/ui/modal-panel";
4
+ import { Text } from "../components/ui/typography";
5
+
6
+ const meta = {
7
+ title: "Components/CenteredPage",
8
+ component: CenteredPage,
9
+ tags: ["autodocs"],
10
+ parameters: {
11
+ layout: "fullscreen",
12
+ docs: {
13
+ description: {
14
+ component:
15
+ "A full-window page that sets a single 420px panel near the top, centred, on the page background. " +
16
+ "Used for a signed-out landing or a hand-off screen.",
17
+ },
18
+ },
19
+ },
20
+ } satisfies Meta<typeof CenteredPage>;
21
+
22
+ export default meta;
23
+
24
+ type Story = StoryObj<typeof meta>;
25
+
26
+ export const Default: Story = {
27
+ render: () => (
28
+ <CenteredPage>
29
+ <ModalPanel align="center" paddingTop="4xl" paddingBottom="2xl" gap="2xl">
30
+ <ModalTitle as="h1" size="large">
31
+ WELL Admin
32
+ </ModalTitle>
33
+ <Text variant="body-base" tone="muted" style={{ textAlign: "center" }}>
34
+ A short line about what this place is.
35
+ </Text>
36
+ </ModalPanel>
37
+ </CenteredPage>
38
+ ),
39
+ };
40
+
41
+ export const AllVariants: Story = { render: Default.render };
42
+
43
+ export const InteractiveCenteredPage: Story = { render: Default.render };
@@ -0,0 +1,68 @@
1
+ import * as React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { CheckboxField } from "../components/ui/checkbox-field";
4
+
5
+ const meta = {
6
+ title: "Components/CheckboxField",
7
+ component: CheckboxField,
8
+ tags: ["autodocs"],
9
+ parameters: {
10
+ layout: "centered",
11
+ docs: {
12
+ description: {
13
+ component:
14
+ "A checkbox with its label (and optional description) as one control. Clicking the text toggles the box.",
15
+ },
16
+ },
17
+ },
18
+ } satisfies Meta<typeof CheckboxField>;
19
+
20
+ export default meta;
21
+
22
+ type Story = StoryObj<typeof meta>;
23
+
24
+ export const Default: Story = {
25
+ args: { label: "Published (visible to customers)" },
26
+ };
27
+
28
+ export const Checked: Story = {
29
+ args: { label: "Featured in the public directory", defaultChecked: true },
30
+ };
31
+
32
+ export const WithDescription: Story = {
33
+ args: {
34
+ label: "Active",
35
+ description: "Inactive items are hidden from customers.",
36
+ defaultChecked: true,
37
+ },
38
+ };
39
+
40
+ export const Disabled: Story = {
41
+ args: { label: "Locked option", disabled: true },
42
+ };
43
+
44
+ export const AllVariants: Story = {
45
+ args: { label: "All variants" },
46
+ render: () => (
47
+ <div style={{ display: "flex", flexDirection: "column", gap: 12 }}>
48
+ <CheckboxField label="Default" />
49
+ <CheckboxField label="Checked" defaultChecked />
50
+ <CheckboxField label="With description" description="Helper text under the label." />
51
+ <CheckboxField label="Disabled" disabled />
52
+ </div>
53
+ ),
54
+ };
55
+
56
+ export const InteractiveCheckboxField: Story = {
57
+ args: { label: "This term is the active one" },
58
+ render: () => {
59
+ const [checked, setChecked] = React.useState(false);
60
+ return (
61
+ <CheckboxField
62
+ label="This term is the active one"
63
+ checked={checked}
64
+ onCheckedChange={(value) => setChecked(value === true)}
65
+ />
66
+ );
67
+ },
68
+ };
@@ -417,3 +417,34 @@ export const WithResponsiveDrawer: Story = {
417
417
  );
418
418
  },
419
419
  };
420
+
421
+ export const FormAppearance: Story = {
422
+ render: () => {
423
+ const [open, setOpen] = useState(false);
424
+ return (
425
+ <Dialog open={open} onOpenChange={setOpen}>
426
+ <DialogTrigger asChild>
427
+ <Button size="large" variant="general-primary" onClick={() => setOpen(true)}>
428
+ Open form dialog
429
+ </Button>
430
+ </DialogTrigger>
431
+ <DialogContent appearance="form">
432
+ <DialogHeader>
433
+ <DialogTitle>Deactivate Ada?</DialogTitle>
434
+ <DialogDescription>
435
+ The back-office dialog: a 560px panel, left-aligned title and description, roomier padding.
436
+ </DialogDescription>
437
+ </DialogHeader>
438
+ <DialogFooter>
439
+ <Button size="utility" variant="general-secondary" onClick={() => setOpen(false)}>
440
+ Cancel
441
+ </Button>
442
+ <Button size="utility" variant="primary-dark" onClick={() => setOpen(false)}>
443
+ Deactivate
444
+ </Button>
445
+ </DialogFooter>
446
+ </DialogContent>
447
+ </Dialog>
448
+ );
449
+ },
450
+ };
@@ -0,0 +1,77 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { AlignRight, ArrowDown, ArrowUp, Pencil, Trash2 } from "lucide-react";
3
+ import { IconButton } from "../components/ui/icon-button";
4
+ import { Avatar, AvatarFallback } from "../components/ui/avatar";
5
+
6
+ const meta = {
7
+ title: "Components/IconButton",
8
+ component: IconButton,
9
+ tags: ["autodocs"],
10
+ parameters: {
11
+ layout: "centered",
12
+ docs: {
13
+ description: {
14
+ component:
15
+ "A quiet icon-only button. `md` (36px) for shell chrome such as a sidebar toggle, `sm` (28px) " +
16
+ "for rows (move, edit, delete), `bare` for a custom child such as an avatar. Always pass `aria-label`.",
17
+ },
18
+ },
19
+ },
20
+ } satisfies Meta<typeof IconButton>;
21
+
22
+ export default meta;
23
+
24
+ type Story = StoryObj<typeof meta>;
25
+
26
+ export const Default: Story = {
27
+ args: { "aria-label": "Toggle sidebar", children: <AlignRight size={20} /> },
28
+ };
29
+
30
+ export const Small: Story = {
31
+ args: { "aria-label": "Edit", size: "sm", children: <Pencil size={15} /> },
32
+ };
33
+
34
+ export const Disabled: Story = {
35
+ args: { "aria-label": "Move up", size: "sm", disabled: true, children: <ArrowUp size={15} /> },
36
+ };
37
+
38
+ export const Bare: Story = {
39
+ args: {
40
+ "aria-label": "Account",
41
+ size: "bare",
42
+ children: (
43
+ <Avatar appearance="brand">
44
+ <AvatarFallback>SU</AvatarFallback>
45
+ </Avatar>
46
+ ),
47
+ },
48
+ };
49
+
50
+ export const AllVariants: Story = {
51
+ args: { "aria-label": "Toggle sidebar" },
52
+ render: () => (
53
+ <div style={{ display: "flex", gap: 16, alignItems: "center" }}>
54
+ <IconButton aria-label="Toggle sidebar">
55
+ <AlignRight size={20} />
56
+ </IconButton>
57
+ <div style={{ display: "flex", gap: 2 }}>
58
+ <IconButton aria-label="Move up" size="sm">
59
+ <ArrowUp size={15} />
60
+ </IconButton>
61
+ <IconButton aria-label="Move down" size="sm">
62
+ <ArrowDown size={15} />
63
+ </IconButton>
64
+ <IconButton aria-label="Edit" size="sm">
65
+ <Pencil size={15} />
66
+ </IconButton>
67
+ <IconButton aria-label="Delete" size="sm" disabled>
68
+ <Trash2 size={15} />
69
+ </IconButton>
70
+ </div>
71
+ </div>
72
+ ),
73
+ };
74
+
75
+ export const InteractiveIconButton: Story = {
76
+ args: { "aria-label": "Edit", size: "sm", children: <Pencil size={15} />, onClick: () => undefined },
77
+ };
@@ -0,0 +1,106 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { ArrowDown, ArrowUp, Pencil, Trash2 } from "lucide-react";
3
+ import { Button } from "../components/ui/button";
4
+ import {
5
+ OutlineNode,
6
+ OutlineNodeControls,
7
+ OutlineNodeHead,
8
+ OutlineNodeMeta,
9
+ OutlineNodeTitle,
10
+ } from "../components/ui/outline-node";
11
+ import { StatusPill } from "../components/ui/status-pill";
12
+
13
+ const meta = {
14
+ title: "Components/OutlineNode",
15
+ component: OutlineNode,
16
+ tags: ["autodocs"],
17
+ parameters: {
18
+ layout: "padded",
19
+ docs: {
20
+ description: {
21
+ component:
22
+ "One row of an editable outline or tree (concept, feature, requirement). " +
23
+ "`level` sets the look: `section` is a bordered card, `branch` is indented with a guide line, " +
24
+ "`leaf` is a compact row with a hover highlight. Nest child nodes inside the parent.",
25
+ },
26
+ },
27
+ },
28
+ } satisfies Meta<typeof OutlineNode>;
29
+
30
+ export default meta;
31
+
32
+ type Story = StoryObj<typeof meta>;
33
+
34
+ const controls = (
35
+ <OutlineNodeControls>
36
+ <Button variant="transparent-tertiary" size="icon" aria-label="Move up"><ArrowUp size={15} /></Button>
37
+ <Button variant="transparent-tertiary" size="icon" aria-label="Move down"><ArrowDown size={15} /></Button>
38
+ <Button variant="transparent-tertiary" size="icon" aria-label="Edit"><Pencil size={15} /></Button>
39
+ <Button variant="transparent-tertiary" size="icon" aria-label="Delete"><Trash2 size={15} /></Button>
40
+ </OutlineNodeControls>
41
+ );
42
+
43
+ export const Default: Story = {
44
+ render: () => (
45
+ <OutlineNode level="section">
46
+ <OutlineNodeHead>
47
+ <OutlineNodeTitle>
48
+ <strong>AIR</strong> · Clean air
49
+ </OutlineNodeTitle>
50
+ {controls}
51
+ </OutlineNodeHead>
52
+ </OutlineNode>
53
+ ),
54
+ };
55
+
56
+ export const Nested: Story = {
57
+ render: () => (
58
+ <div style={{ maxWidth: 720 }}>
59
+ <OutlineNode level="section">
60
+ <OutlineNodeHead>
61
+ <OutlineNodeTitle>
62
+ <strong>AIR</strong> · Clean air
63
+ </OutlineNodeTitle>
64
+ {controls}
65
+ </OutlineNodeHead>
66
+ <OutlineNode level="branch">
67
+ <OutlineNodeHead>
68
+ <OutlineNodeTitle>
69
+ <strong>A01</strong> · Air quality
70
+ <OutlineNodeMeta>12 pts</OutlineNodeMeta>
71
+ <StatusPill tone="info">Energy</StatusPill>
72
+ </OutlineNodeTitle>
73
+ {controls}
74
+ </OutlineNodeHead>
75
+ <OutlineNode level="leaf">
76
+ <OutlineNodeTitle>
77
+ Meet the particulate limits
78
+ <StatusPill tone="accent">precondition</StatusPill>
79
+ <OutlineNodeMeta>2 pts ×1</OutlineNodeMeta>
80
+ </OutlineNodeTitle>
81
+ {controls}
82
+ </OutlineNode>
83
+ <OutlineNode level="leaf" inactive>
84
+ <OutlineNodeTitle>
85
+ Retired requirement
86
+ <StatusPill tone="inactive">Inactive</StatusPill>
87
+ </OutlineNodeTitle>
88
+ {controls}
89
+ </OutlineNode>
90
+ </OutlineNode>
91
+ </OutlineNode>
92
+ </div>
93
+ ),
94
+ };
95
+
96
+ export const AllVariants: Story = Nested;
97
+
98
+ export const InteractiveOutlineNode: Story = {
99
+ args: { level: "section" },
100
+ argTypes: { level: { control: "select", options: ["section", "branch", "leaf"] } },
101
+ render: (args) => (
102
+ <OutlineNode {...args}>
103
+ <OutlineNodeTitle>Outline row</OutlineNodeTitle>
104
+ </OutlineNode>
105
+ ),
106
+ };
@@ -0,0 +1,75 @@
1
+ import * as React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { RadioCardGroup, RadioCardItem } from "../components/ui/radio-card";
4
+
5
+ const meta = {
6
+ title: "Components/RadioCard",
7
+ component: RadioCardGroup,
8
+ tags: ["autodocs"],
9
+ parameters: {
10
+ layout: "centered",
11
+ docs: {
12
+ description: {
13
+ component:
14
+ "Single choice where each option is a card with a title and a line of detail, for example a role and what it allows. Built on Radix RadioGroup.",
15
+ },
16
+ },
17
+ },
18
+ } satisfies Meta<typeof RadioCardGroup>;
19
+
20
+ export default meta;
21
+
22
+ type Story = StoryObj<typeof meta>;
23
+
24
+ const roles = (
25
+ <>
26
+ <RadioCardItem value="customer" title="Customer" description="Uses the customer platform only." />
27
+ <RadioCardItem value="admin" title="Admin" description="Can manage invoices, memberships and reviews." />
28
+ <RadioCardItem value="super" title="Super admin" description="Everything, including roles and the audit log." />
29
+ </>
30
+ );
31
+
32
+ export const Default: Story = {
33
+ render: () => (
34
+ <div style={{ width: 360 }}>
35
+ <RadioCardGroup defaultValue="admin">{roles}</RadioCardGroup>
36
+ </div>
37
+ ),
38
+ };
39
+
40
+ export const Disabled: Story = {
41
+ render: () => (
42
+ <div style={{ width: 360 }}>
43
+ <RadioCardGroup defaultValue="customer">
44
+ <RadioCardItem value="customer" title="Customer" description="Current role." />
45
+ <RadioCardItem value="admin" title="Admin" description="Not available." disabled />
46
+ </RadioCardGroup>
47
+ </div>
48
+ ),
49
+ };
50
+
51
+ export const AllVariants: Story = {
52
+ render: () => (
53
+ <div style={{ display: "flex", gap: 24 }}>
54
+ <div style={{ width: 320 }}>
55
+ <RadioCardGroup defaultValue="customer">{roles}</RadioCardGroup>
56
+ </div>
57
+ <div style={{ width: 320 }}>
58
+ <RadioCardGroup defaultValue="super">{roles}</RadioCardGroup>
59
+ </div>
60
+ </div>
61
+ ),
62
+ };
63
+
64
+ export const InteractiveRadioCard: Story = {
65
+ render: () => {
66
+ const [value, setValue] = React.useState("customer");
67
+ return (
68
+ <div style={{ width: 360 }}>
69
+ <RadioCardGroup value={value} onValueChange={setValue}>
70
+ {roles}
71
+ </RadioCardGroup>
72
+ </div>
73
+ );
74
+ },
75
+ };
@@ -0,0 +1,68 @@
1
+ import * as React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { BarChart3, FileText, LayoutDashboard, Users } from "lucide-react";
4
+ import { SideNav, SideNavGroup, SideNavItem } from "../components/ui/side-nav";
5
+
6
+ const meta = {
7
+ title: "Components/SideNav",
8
+ component: SideNav,
9
+ tags: ["autodocs"],
10
+ parameters: {
11
+ layout: "centered",
12
+ docs: {
13
+ description: {
14
+ component:
15
+ "Grouped, icon-led navigation for an app shell's side panel. Put it inside `LayoutPanel` " +
16
+ "(`width=\"rail\"` when `collapsed`). Use `asChild` on an item to render a router link.",
17
+ },
18
+ },
19
+ },
20
+ } satisfies Meta<typeof SideNav>;
21
+
22
+ export default meta;
23
+
24
+ type Story = StoryObj<typeof meta>;
25
+
26
+ function Demo({ collapsed = false }: { collapsed?: boolean }) {
27
+ const [current, setCurrent] = React.useState("dashboard");
28
+ const item = (id: string, label: string, icon: React.ReactNode) => (
29
+ <SideNavItem
30
+ icon={icon}
31
+ active={current === id}
32
+ onClick={() => setCurrent(id)}
33
+ >
34
+ {label}
35
+ </SideNavItem>
36
+ );
37
+ return (
38
+ <div style={{ width: collapsed ? 72 : 260, padding: "24px 12px", background: "#fff" }}>
39
+ <SideNav aria-label="Sections" collapsed={collapsed}>
40
+ <SideNavGroup label="Overview">
41
+ {item("dashboard", "Dashboard", <LayoutDashboard />)}
42
+ </SideNavGroup>
43
+ <SideNavGroup label="Customers & billing">
44
+ {item("customers", "Customers", <Users />)}
45
+ {item("invoices", "Invoices", <FileText />)}
46
+ {item("reports", "Reports", <BarChart3 />)}
47
+ </SideNavGroup>
48
+ </SideNav>
49
+ </div>
50
+ );
51
+ }
52
+
53
+ export const Default: Story = { render: () => <Demo /> };
54
+ export const Collapsed: Story = { render: () => <Demo collapsed /> };
55
+
56
+ export const AllVariants: Story = {
57
+ render: () => (
58
+ <div style={{ display: "flex", gap: 32 }}>
59
+ <Demo />
60
+ <Demo collapsed />
61
+ </div>
62
+ ),
63
+ };
64
+
65
+ export const InteractiveSideNav: Story = {
66
+ args: { collapsed: false },
67
+ render: (args) => <Demo collapsed={args.collapsed} />,
68
+ };