@syscore/ui-library 1.1.10 → 1.1.12
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/client/App.tsx +47 -0
- package/client/components/icons/ConceptIcons.tsx +667 -0
- package/client/components/icons/NavAccount.tsx +31 -0
- package/client/components/icons/NavBullet.tsx +19 -0
- package/client/components/icons/NavLogo.tsx +36 -0
- package/client/components/icons/ProviderBadges.tsx +295 -0
- package/client/components/icons/ProviderSeals.tsx +319 -0
- package/client/components/icons/SealHealthSafetyRating.tsx +65 -0
- package/client/components/icons/SealIwbiMember.tsx +86 -0
- package/client/components/icons/SealWell.tsx +84 -0
- package/client/components/icons/SealWellCertification.tsx +138 -0
- package/client/components/icons/SealWellCommunity.tsx +122 -0
- package/client/components/icons/SealWellResidence.tsx +122 -0
- package/client/components/icons/SealWorksWithWell.tsx +140 -0
- package/client/components/icons/UtilityAccordion.tsx +21 -0
- package/client/components/icons/UtilityChevronDown.tsx +36 -0
- package/client/components/icons/UtilityClassification.tsx +45 -0
- package/client/components/icons/UtilityClose.tsx +41 -0
- package/client/components/icons/UtilityDrag.tsx +69 -0
- package/client/components/icons/UtilityEdit.tsx +42 -0
- package/client/components/icons/UtilityOptions.tsx +45 -0
- package/client/components/icons/UtilityPortfolio.tsx +87 -0
- package/client/components/icons/UtilityReset.tsx +41 -0
- package/client/components/icons/UtilityScoring.tsx +43 -0
- package/client/components/icons/UtilitySearch.tsx +38 -0
- package/client/components/icons/UtilitySort.tsx +52 -0
- package/client/components/icons/UtilityText.tsx +34 -0
- package/client/components/icons/WaterMarkWWWProducts.tsx +26 -0
- package/client/components/icons/WaterMarkWellProjects.tsx +30 -0
- package/client/components/icons/WatermarkMemberOrg.tsx +59 -0
- package/client/components/icons/WellSeal.tsx +79 -0
- package/client/components/icons/X.tsx +35 -0
- package/client/hooks/UseTabs.tsx +35 -0
- package/client/hooks/use-mobile.tsx +21 -0
- package/client/hooks/use-segmented-control.ts +42 -0
- package/client/hooks/use-toast.ts +188 -0
- package/client/pages/Index.tsx +88 -0
- package/client/pages/NotFound.tsx +29 -0
- package/client/ui/Accordion/Accordion.stories.tsx +74 -0
- package/client/ui/Alert/Alert.stories.tsx +82 -0
- package/client/ui/AlertDialog/AlertDialog.stories.tsx +106 -0
- package/client/ui/AspectRatio.stories.tsx +78 -0
- package/client/ui/Avatar/Avatar.stories.tsx +94 -0
- package/client/ui/Badge/Badge.stories.tsx +60 -0
- package/client/ui/Breadcrumb/Breadcrumb.stories.tsx +97 -0
- package/client/ui/Button.stories.tsx +429 -0
- package/client/ui/Calendar/Calendar.stories.tsx +99 -0
- package/client/ui/Card.stories.tsx +84 -0
- package/client/ui/Carousel/Carousel.stories.tsx +85 -0
- package/client/ui/Chart/Chart.stories.tsx +58 -0
- package/client/ui/Checkbox/Checkbox.stories.tsx +112 -0
- package/client/ui/Collapsible/Collapsible.stories.tsx +101 -0
- package/client/ui/Colors.stories.tsx +1041 -0
- package/client/ui/Command/Command.stories.tsx +97 -0
- package/client/ui/ContextMenu/ContextMenu.stories.tsx +74 -0
- package/client/ui/Dialog.stories.tsx +69 -0
- package/client/ui/Drawer/Drawer.stories.tsx +87 -0
- package/client/ui/DropdownMenu/DropdownMenu.stories.tsx +139 -0
- package/client/ui/Form/Form.stories.tsx +74 -0
- package/client/ui/HoverCard/HoverCard.stories.tsx +94 -0
- package/client/ui/Icons.stories.tsx +328 -0
- package/client/ui/Input/Input.stories.tsx +69 -0
- package/client/ui/InputOTP/InputOTP.stories.tsx +85 -0
- package/client/ui/Label.stories.tsx +66 -0
- package/client/ui/Menubar/Menubar.stories.tsx +88 -0
- package/client/ui/Navigation.stories.tsx +57 -0
- package/client/ui/NavigationMenu/NavigationMenu.stories.tsx +106 -0
- package/client/ui/Pagination/Pagination.stories.tsx +115 -0
- package/client/ui/Popover/Popover.stories.tsx +99 -0
- package/client/ui/Progress/Progress.stories.tsx +63 -0
- package/client/ui/RadioGroup/RadioGroup.stories.tsx +110 -0
- package/client/ui/Resizable/Resizable.stories.tsx +88 -0
- package/client/ui/ScrollArea/ScrollArea.stories.tsx +64 -0
- package/client/ui/SearchField.stories.tsx +63 -0
- package/client/ui/Select/Select.stories.tsx +111 -0
- package/client/ui/Separator/Separator.stories.tsx +67 -0
- package/client/ui/Sheet/Sheet.stories.tsx +138 -0
- package/client/ui/Sidebar/Sidebar.stories.tsx +92 -0
- package/client/ui/Skeleton/Skeleton.stories.tsx +65 -0
- package/client/ui/Slider/Slider.stories.tsx +101 -0
- package/client/ui/Sonner/Sonner.stories.tsx +48 -0
- package/client/ui/StrategyTable.stories.tsx +138 -0
- package/client/ui/Switch/Switch.stories.tsx +96 -0
- package/client/ui/Table/Table.stories.tsx +135 -0
- package/client/ui/Tabs.stories.tsx +33 -0
- package/client/ui/Tag.stories.tsx +190 -0
- package/client/ui/Textarea/Textarea.stories.tsx +56 -0
- package/client/ui/Toast/Toast.stories.tsx +76 -0
- package/client/ui/Toaster/Toaster.stories.tsx +52 -0
- package/client/ui/Toggle.stories.tsx +248 -0
- package/client/ui/ToggleGroup/ToggleGroup.stories.tsx +88 -0
- package/client/ui/Tooltip.stories.tsx +72 -0
- package/client/ui/Typography.stories.tsx +421 -0
- package/client/ui/WELLDashboard/WELLDashboard.stories.tsx +115 -0
- package/client/ui/WELLDashboard/index.tsx +317 -0
- package/client/vite-env.d.ts +1 -0
- package/dist/ui/index.cjs.js +1 -1
- package/dist/ui/index.d.ts +10 -1
- package/dist/ui/index.es.js +2233 -447
- package/package.json +2 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
Accordion,
|
|
4
|
+
AccordionItem,
|
|
5
|
+
AccordionTrigger,
|
|
6
|
+
AccordionContent,
|
|
7
|
+
} from "../../components/ui/accordion";
|
|
8
|
+
|
|
9
|
+
const meta = {
|
|
10
|
+
title: "UI/Accordion",
|
|
11
|
+
component: Accordion,
|
|
12
|
+
tags: ["autodocs"],
|
|
13
|
+
parameters: {
|
|
14
|
+
layout: "padded",
|
|
15
|
+
},
|
|
16
|
+
} satisfies Meta<typeof Accordion>;
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
|
|
20
|
+
type Story = StoryObj<typeof meta>;
|
|
21
|
+
|
|
22
|
+
export const Default: Story = {
|
|
23
|
+
render: () => (
|
|
24
|
+
<Accordion type="single" collapsible className="w-full max-w-md">
|
|
25
|
+
<AccordionItem value="item-1">
|
|
26
|
+
<AccordionTrigger>Is it accessible?</AccordionTrigger>
|
|
27
|
+
<AccordionContent>
|
|
28
|
+
Yes. It adheres to the WAI-ARIA design pattern.
|
|
29
|
+
</AccordionContent>
|
|
30
|
+
</AccordionItem>
|
|
31
|
+
<AccordionItem value="item-2">
|
|
32
|
+
<AccordionTrigger>Is it styled?</AccordionTrigger>
|
|
33
|
+
<AccordionContent>
|
|
34
|
+
Yes. It comes with default styles you can customize using CSS.
|
|
35
|
+
</AccordionContent>
|
|
36
|
+
</AccordionItem>
|
|
37
|
+
<AccordionItem value="item-3">
|
|
38
|
+
<AccordionTrigger>Is it animated?</AccordionTrigger>
|
|
39
|
+
<AccordionContent>
|
|
40
|
+
Yes. It's animated by default, but you can disable it if you
|
|
41
|
+
prefer.
|
|
42
|
+
</AccordionContent>
|
|
43
|
+
</AccordionItem>
|
|
44
|
+
</Accordion>
|
|
45
|
+
),
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const Multiple: Story = {
|
|
49
|
+
render: () => (
|
|
50
|
+
<Accordion type="multiple" className="w-full max-w-md">
|
|
51
|
+
<AccordionItem value="item-1">
|
|
52
|
+
<AccordionTrigger>Feature One</AccordionTrigger>
|
|
53
|
+
<AccordionContent>
|
|
54
|
+
This is the content for feature one. You can open multiple items at
|
|
55
|
+
once.
|
|
56
|
+
</AccordionContent>
|
|
57
|
+
</AccordionItem>
|
|
58
|
+
<AccordionItem value="item-2">
|
|
59
|
+
<AccordionTrigger>Feature Two</AccordionTrigger>
|
|
60
|
+
<AccordionContent>
|
|
61
|
+
This is the content for feature two. All sections can be expanded
|
|
62
|
+
simultaneously.
|
|
63
|
+
</AccordionContent>
|
|
64
|
+
</AccordionItem>
|
|
65
|
+
<AccordionItem value="item-3">
|
|
66
|
+
<AccordionTrigger>Feature Three</AccordionTrigger>
|
|
67
|
+
<AccordionContent>
|
|
68
|
+
This is the content for feature three. Great for detailed information
|
|
69
|
+
display.
|
|
70
|
+
</AccordionContent>
|
|
71
|
+
</AccordionItem>
|
|
72
|
+
</Accordion>
|
|
73
|
+
),
|
|
74
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Alert, AlertTitle, AlertDescription } from "../../components/ui/alert";
|
|
3
|
+
import { AlertCircle, Terminal, CheckCircle2 } from "lucide-react";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "UI/Alert",
|
|
7
|
+
component: Alert,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "padded",
|
|
11
|
+
},
|
|
12
|
+
} satisfies Meta<typeof Alert>;
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {
|
|
19
|
+
render: () => (
|
|
20
|
+
<Alert>
|
|
21
|
+
<Terminal className="h-4 w-4" />
|
|
22
|
+
<AlertTitle>Heads up!</AlertTitle>
|
|
23
|
+
<AlertDescription>
|
|
24
|
+
You can add components to your app using the code below.
|
|
25
|
+
</AlertDescription>
|
|
26
|
+
</Alert>
|
|
27
|
+
),
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Destructive: Story = {
|
|
31
|
+
render: () => (
|
|
32
|
+
<Alert variant="destructive">
|
|
33
|
+
<AlertCircle className="h-4 w-4" />
|
|
34
|
+
<AlertTitle>Error</AlertTitle>
|
|
35
|
+
<AlertDescription>
|
|
36
|
+
Your session has expired. Please log in again.
|
|
37
|
+
</AlertDescription>
|
|
38
|
+
</Alert>
|
|
39
|
+
),
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const Success: Story = {
|
|
43
|
+
render: () => (
|
|
44
|
+
<Alert>
|
|
45
|
+
<CheckCircle2 className="h-4 w-4" />
|
|
46
|
+
<AlertTitle>Success</AlertTitle>
|
|
47
|
+
<AlertDescription>
|
|
48
|
+
Your changes have been saved successfully.
|
|
49
|
+
</AlertDescription>
|
|
50
|
+
</Alert>
|
|
51
|
+
),
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const AllVariants: Story = {
|
|
55
|
+
render: () => (
|
|
56
|
+
<div className="space-y-4 max-w-md">
|
|
57
|
+
<Alert>
|
|
58
|
+
<Terminal className="h-4 w-4" />
|
|
59
|
+
<AlertTitle>Heads up!</AlertTitle>
|
|
60
|
+
<AlertDescription>
|
|
61
|
+
You can add components to your app using the code below.
|
|
62
|
+
</AlertDescription>
|
|
63
|
+
</Alert>
|
|
64
|
+
|
|
65
|
+
<Alert variant="destructive">
|
|
66
|
+
<AlertCircle className="h-4 w-4" />
|
|
67
|
+
<AlertTitle>Error</AlertTitle>
|
|
68
|
+
<AlertDescription>
|
|
69
|
+
Your session has expired. Please log in again.
|
|
70
|
+
</AlertDescription>
|
|
71
|
+
</Alert>
|
|
72
|
+
|
|
73
|
+
<Alert>
|
|
74
|
+
<CheckCircle2 className="h-4 w-4" />
|
|
75
|
+
<AlertTitle>Success</AlertTitle>
|
|
76
|
+
<AlertDescription>
|
|
77
|
+
Your changes have been saved successfully.
|
|
78
|
+
</AlertDescription>
|
|
79
|
+
</Alert>
|
|
80
|
+
</div>
|
|
81
|
+
),
|
|
82
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
AlertDialog,
|
|
4
|
+
AlertDialogTrigger,
|
|
5
|
+
AlertDialogContent,
|
|
6
|
+
AlertDialogHeader,
|
|
7
|
+
AlertDialogTitle,
|
|
8
|
+
AlertDialogDescription,
|
|
9
|
+
AlertDialogFooter,
|
|
10
|
+
AlertDialogAction,
|
|
11
|
+
AlertDialogCancel,
|
|
12
|
+
} from "../../components/ui/alert-dialog";
|
|
13
|
+
import { Button } from "../../components/ui/button";
|
|
14
|
+
import { useState } from "react";
|
|
15
|
+
|
|
16
|
+
const meta = {
|
|
17
|
+
title: "UI/AlertDialog",
|
|
18
|
+
component: AlertDialog,
|
|
19
|
+
tags: ["autodocs"],
|
|
20
|
+
parameters: {
|
|
21
|
+
layout: "centered",
|
|
22
|
+
},
|
|
23
|
+
} satisfies Meta<typeof AlertDialog>;
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
|
|
27
|
+
type Story = StoryObj<typeof meta>;
|
|
28
|
+
|
|
29
|
+
export const Default: Story = {
|
|
30
|
+
render: () => {
|
|
31
|
+
const [open, setOpen] = useState(false);
|
|
32
|
+
return (
|
|
33
|
+
<AlertDialog open={open} onOpenChange={setOpen}>
|
|
34
|
+
<AlertDialogTrigger asChild>
|
|
35
|
+
<Button>Open Alert</Button>
|
|
36
|
+
</AlertDialogTrigger>
|
|
37
|
+
<AlertDialogContent>
|
|
38
|
+
<AlertDialogHeader>
|
|
39
|
+
<AlertDialogTitle>Confirm Action</AlertDialogTitle>
|
|
40
|
+
<AlertDialogDescription>
|
|
41
|
+
Are you sure you want to proceed with this action?
|
|
42
|
+
</AlertDialogDescription>
|
|
43
|
+
</AlertDialogHeader>
|
|
44
|
+
<AlertDialogFooter>
|
|
45
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
46
|
+
<AlertDialogAction>Continue</AlertDialogAction>
|
|
47
|
+
</AlertDialogFooter>
|
|
48
|
+
</AlertDialogContent>
|
|
49
|
+
</AlertDialog>
|
|
50
|
+
);
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const Delete: Story = {
|
|
55
|
+
render: () => {
|
|
56
|
+
const [open, setOpen] = useState(false);
|
|
57
|
+
return (
|
|
58
|
+
<AlertDialog open={open} onOpenChange={setOpen}>
|
|
59
|
+
<AlertDialogTrigger asChild>
|
|
60
|
+
<Button variant="destructive">Delete Item</Button>
|
|
61
|
+
</AlertDialogTrigger>
|
|
62
|
+
<AlertDialogContent>
|
|
63
|
+
<AlertDialogHeader>
|
|
64
|
+
<AlertDialogTitle>Are you sure?</AlertDialogTitle>
|
|
65
|
+
<AlertDialogDescription>
|
|
66
|
+
This action cannot be undone. This will permanently delete the
|
|
67
|
+
item.
|
|
68
|
+
</AlertDialogDescription>
|
|
69
|
+
</AlertDialogHeader>
|
|
70
|
+
<AlertDialogFooter>
|
|
71
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
72
|
+
<AlertDialogAction className="bg-destructive text-destructive-foreground hover:bg-destructive/90">
|
|
73
|
+
Delete
|
|
74
|
+
</AlertDialogAction>
|
|
75
|
+
</AlertDialogFooter>
|
|
76
|
+
</AlertDialogContent>
|
|
77
|
+
</AlertDialog>
|
|
78
|
+
);
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const Warning: Story = {
|
|
83
|
+
render: () => {
|
|
84
|
+
const [open, setOpen] = useState(false);
|
|
85
|
+
return (
|
|
86
|
+
<AlertDialog open={open} onOpenChange={setOpen}>
|
|
87
|
+
<AlertDialogTrigger asChild>
|
|
88
|
+
<Button variant="outline">Show Warning</Button>
|
|
89
|
+
</AlertDialogTrigger>
|
|
90
|
+
<AlertDialogContent>
|
|
91
|
+
<AlertDialogHeader>
|
|
92
|
+
<AlertDialogTitle>Warning</AlertDialogTitle>
|
|
93
|
+
<AlertDialogDescription>
|
|
94
|
+
This action will have significant consequences. Please confirm
|
|
95
|
+
that you understand the risks.
|
|
96
|
+
</AlertDialogDescription>
|
|
97
|
+
</AlertDialogHeader>
|
|
98
|
+
<AlertDialogFooter>
|
|
99
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
100
|
+
<AlertDialogAction>I Understand</AlertDialogAction>
|
|
101
|
+
</AlertDialogFooter>
|
|
102
|
+
</AlertDialogContent>
|
|
103
|
+
</AlertDialog>
|
|
104
|
+
);
|
|
105
|
+
},
|
|
106
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { AspectRatio } from "@/components/ui/aspect-ratio";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Review/AspectRatio",
|
|
6
|
+
component: AspectRatio,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "padded",
|
|
10
|
+
},
|
|
11
|
+
} satisfies Meta<typeof AspectRatio>;
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
render: () => (
|
|
19
|
+
<div className="w-full max-w-md">
|
|
20
|
+
<AspectRatio ratio={16 / 9} className="bg-gray-200">
|
|
21
|
+
<img
|
|
22
|
+
src="https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?w=400"
|
|
23
|
+
alt="Aspect ratio example"
|
|
24
|
+
className="h-full w-full object-cover rounded-md"
|
|
25
|
+
/>
|
|
26
|
+
</AspectRatio>
|
|
27
|
+
</div>
|
|
28
|
+
),
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const Square: Story = {
|
|
32
|
+
render: () => (
|
|
33
|
+
<div className="w-48">
|
|
34
|
+
<AspectRatio ratio={1} className="bg-gray-200">
|
|
35
|
+
<img
|
|
36
|
+
src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=400"
|
|
37
|
+
alt="Square aspect ratio"
|
|
38
|
+
className="h-full w-full object-cover rounded-md"
|
|
39
|
+
/>
|
|
40
|
+
</AspectRatio>
|
|
41
|
+
</div>
|
|
42
|
+
),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const Portrait: Story = {
|
|
46
|
+
render: () => (
|
|
47
|
+
<div className="w-48">
|
|
48
|
+
<AspectRatio ratio={9 / 16} className="bg-gray-200">
|
|
49
|
+
<img
|
|
50
|
+
src="https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=400"
|
|
51
|
+
alt="Portrait aspect ratio"
|
|
52
|
+
className="h-full w-full object-cover rounded-md"
|
|
53
|
+
/>
|
|
54
|
+
</AspectRatio>
|
|
55
|
+
</div>
|
|
56
|
+
),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const Custom: Story = {
|
|
60
|
+
render: () => (
|
|
61
|
+
<div className="space-y-4">
|
|
62
|
+
<div className="w-64">
|
|
63
|
+
<AspectRatio ratio={3 / 2} className="bg-gray-200">
|
|
64
|
+
<div className="h-full w-full flex items-center justify-center">
|
|
65
|
+
<span className="text-gray-600">3:2 Ratio</span>
|
|
66
|
+
</div>
|
|
67
|
+
</AspectRatio>
|
|
68
|
+
</div>
|
|
69
|
+
<div className="w-64">
|
|
70
|
+
<AspectRatio ratio={4 / 3} className="bg-gray-200">
|
|
71
|
+
<div className="h-full w-full flex items-center justify-center">
|
|
72
|
+
<span className="text-gray-600">4:3 Ratio</span>
|
|
73
|
+
</div>
|
|
74
|
+
</AspectRatio>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
),
|
|
78
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
Avatar,
|
|
4
|
+
AvatarImage,
|
|
5
|
+
AvatarFallback,
|
|
6
|
+
} from "../../components/ui/avatar";
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: "UI/Avatar",
|
|
10
|
+
component: Avatar,
|
|
11
|
+
tags: ["autodocs"],
|
|
12
|
+
parameters: {
|
|
13
|
+
layout: "centered",
|
|
14
|
+
},
|
|
15
|
+
} satisfies Meta<typeof Avatar>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
|
|
21
|
+
export const Default: Story = {
|
|
22
|
+
render: () => (
|
|
23
|
+
<Avatar>
|
|
24
|
+
<AvatarImage src="https://github.com/shadcn.png" />
|
|
25
|
+
<AvatarFallback>CN</AvatarFallback>
|
|
26
|
+
</Avatar>
|
|
27
|
+
),
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Fallback: Story = {
|
|
31
|
+
render: () => (
|
|
32
|
+
<Avatar>
|
|
33
|
+
<AvatarImage src="" />
|
|
34
|
+
<AvatarFallback>JD</AvatarFallback>
|
|
35
|
+
</Avatar>
|
|
36
|
+
),
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Multiple: Story = {
|
|
40
|
+
render: () => (
|
|
41
|
+
<div className="flex gap-4">
|
|
42
|
+
<Avatar>
|
|
43
|
+
<AvatarImage src="https://github.com/shadcn.png" />
|
|
44
|
+
<AvatarFallback>CN</AvatarFallback>
|
|
45
|
+
</Avatar>
|
|
46
|
+
<Avatar>
|
|
47
|
+
<AvatarImage src="" />
|
|
48
|
+
<AvatarFallback>JD</AvatarFallback>
|
|
49
|
+
</Avatar>
|
|
50
|
+
<Avatar>
|
|
51
|
+
<AvatarImage src="" />
|
|
52
|
+
<AvatarFallback>AB</AvatarFallback>
|
|
53
|
+
</Avatar>
|
|
54
|
+
<Avatar>
|
|
55
|
+
<AvatarImage src="" />
|
|
56
|
+
<AvatarFallback>XY</AvatarFallback>
|
|
57
|
+
</Avatar>
|
|
58
|
+
</div>
|
|
59
|
+
),
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const WithUser: Story = {
|
|
63
|
+
render: () => (
|
|
64
|
+
<div className="flex items-center gap-3">
|
|
65
|
+
<Avatar>
|
|
66
|
+
<AvatarImage src="" />
|
|
67
|
+
<AvatarFallback>JD</AvatarFallback>
|
|
68
|
+
</Avatar>
|
|
69
|
+
<div>
|
|
70
|
+
<p className="text-sm font-semibold">John Doe</p>
|
|
71
|
+
<p className="text-xs text-gray-600">john@example.com</p>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
),
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const Sizes: Story = {
|
|
78
|
+
render: () => (
|
|
79
|
+
<div className="flex items-center gap-4">
|
|
80
|
+
<Avatar className="h-8 w-8">
|
|
81
|
+
<AvatarImage src="" />
|
|
82
|
+
<AvatarFallback>CN</AvatarFallback>
|
|
83
|
+
</Avatar>
|
|
84
|
+
<Avatar>
|
|
85
|
+
<AvatarImage src="" />
|
|
86
|
+
<AvatarFallback>CN</AvatarFallback>
|
|
87
|
+
</Avatar>
|
|
88
|
+
<Avatar className="h-16 w-16">
|
|
89
|
+
<AvatarImage src="" />
|
|
90
|
+
<AvatarFallback>CN</AvatarFallback>
|
|
91
|
+
</Avatar>
|
|
92
|
+
</div>
|
|
93
|
+
),
|
|
94
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Badge } from "../../components/ui/badge";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "UI/Badge",
|
|
6
|
+
component: Badge,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "centered",
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
variant: {
|
|
13
|
+
control: { type: "select" },
|
|
14
|
+
options: ["default", "secondary", "destructive", "outline-solid"],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
} satisfies Meta<typeof Badge>;
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
20
|
+
|
|
21
|
+
type Story = StoryObj<typeof meta>;
|
|
22
|
+
|
|
23
|
+
export const Default: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
children: "Default",
|
|
26
|
+
variant: "default",
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Secondary: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
children: "Secondary",
|
|
33
|
+
variant: "secondary",
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Destructive: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
children: "Destructive",
|
|
40
|
+
variant: "destructive",
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const Outline: Story = {
|
|
45
|
+
args: {
|
|
46
|
+
children: "Outline",
|
|
47
|
+
variant: "outline",
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const AllVariants: Story = {
|
|
52
|
+
render: () => (
|
|
53
|
+
<div className="flex flex-wrap gap-4">
|
|
54
|
+
<Badge variant="default">Default</Badge>
|
|
55
|
+
<Badge variant="secondary">Secondary</Badge>
|
|
56
|
+
<Badge variant="destructive">Destructive</Badge>
|
|
57
|
+
<Badge variant="outline">Outline</Badge>
|
|
58
|
+
</div>
|
|
59
|
+
),
|
|
60
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
Breadcrumb,
|
|
4
|
+
BreadcrumbItem,
|
|
5
|
+
BreadcrumbLink,
|
|
6
|
+
BreadcrumbList,
|
|
7
|
+
BreadcrumbPage,
|
|
8
|
+
BreadcrumbSeparator,
|
|
9
|
+
} from "../../components/ui/breadcrumb";
|
|
10
|
+
import { ChevronRight } from "lucide-react";
|
|
11
|
+
|
|
12
|
+
const meta = {
|
|
13
|
+
title: "UI/Breadcrumb",
|
|
14
|
+
component: Breadcrumb,
|
|
15
|
+
tags: ["autodocs"],
|
|
16
|
+
parameters: {
|
|
17
|
+
layout: "padded",
|
|
18
|
+
},
|
|
19
|
+
} satisfies Meta<typeof Breadcrumb>;
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
|
|
23
|
+
type Story = StoryObj<typeof meta>;
|
|
24
|
+
|
|
25
|
+
export const Default: Story = {
|
|
26
|
+
render: () => (
|
|
27
|
+
<Breadcrumb>
|
|
28
|
+
<BreadcrumbList>
|
|
29
|
+
<BreadcrumbItem>
|
|
30
|
+
<BreadcrumbLink href="/">Home</BreadcrumbLink>
|
|
31
|
+
</BreadcrumbItem>
|
|
32
|
+
<BreadcrumbSeparator />
|
|
33
|
+
<BreadcrumbItem>
|
|
34
|
+
<BreadcrumbLink href="/docs">Documentation</BreadcrumbLink>
|
|
35
|
+
</BreadcrumbItem>
|
|
36
|
+
<BreadcrumbSeparator />
|
|
37
|
+
<BreadcrumbItem>
|
|
38
|
+
<BreadcrumbPage>Getting Started</BreadcrumbPage>
|
|
39
|
+
</BreadcrumbItem>
|
|
40
|
+
</BreadcrumbList>
|
|
41
|
+
</Breadcrumb>
|
|
42
|
+
),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const WithCustomSeparator: Story = {
|
|
46
|
+
render: () => (
|
|
47
|
+
<Breadcrumb>
|
|
48
|
+
<BreadcrumbList>
|
|
49
|
+
<BreadcrumbItem>
|
|
50
|
+
<BreadcrumbLink href="/">Home</BreadcrumbLink>
|
|
51
|
+
</BreadcrumbItem>
|
|
52
|
+
<BreadcrumbSeparator>
|
|
53
|
+
<ChevronRight className="h-4 w-4" />
|
|
54
|
+
</BreadcrumbSeparator>
|
|
55
|
+
<BreadcrumbItem>
|
|
56
|
+
<BreadcrumbLink href="/products">Products</BreadcrumbLink>
|
|
57
|
+
</BreadcrumbItem>
|
|
58
|
+
<BreadcrumbSeparator>
|
|
59
|
+
<ChevronRight className="h-4 w-4" />
|
|
60
|
+
</BreadcrumbSeparator>
|
|
61
|
+
<BreadcrumbItem>
|
|
62
|
+
<BreadcrumbPage>Product Details</BreadcrumbPage>
|
|
63
|
+
</BreadcrumbItem>
|
|
64
|
+
</BreadcrumbList>
|
|
65
|
+
</Breadcrumb>
|
|
66
|
+
),
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const Long: Story = {
|
|
70
|
+
render: () => (
|
|
71
|
+
<Breadcrumb>
|
|
72
|
+
<BreadcrumbList>
|
|
73
|
+
<BreadcrumbItem>
|
|
74
|
+
<BreadcrumbLink href="/">Home</BreadcrumbLink>
|
|
75
|
+
</BreadcrumbItem>
|
|
76
|
+
<BreadcrumbSeparator />
|
|
77
|
+
<BreadcrumbItem>
|
|
78
|
+
<BreadcrumbLink href="/docs">Docs</BreadcrumbLink>
|
|
79
|
+
</BreadcrumbItem>
|
|
80
|
+
<BreadcrumbSeparator />
|
|
81
|
+
<BreadcrumbItem>
|
|
82
|
+
<BreadcrumbLink href="/docs/components">Components</BreadcrumbLink>
|
|
83
|
+
</BreadcrumbItem>
|
|
84
|
+
<BreadcrumbSeparator />
|
|
85
|
+
<BreadcrumbItem>
|
|
86
|
+
<BreadcrumbLink href="/docs/components/breadcrumb">
|
|
87
|
+
Breadcrumb
|
|
88
|
+
</BreadcrumbLink>
|
|
89
|
+
</BreadcrumbItem>
|
|
90
|
+
<BreadcrumbSeparator />
|
|
91
|
+
<BreadcrumbItem>
|
|
92
|
+
<BreadcrumbPage>Implementation</BreadcrumbPage>
|
|
93
|
+
</BreadcrumbItem>
|
|
94
|
+
</BreadcrumbList>
|
|
95
|
+
</Breadcrumb>
|
|
96
|
+
),
|
|
97
|
+
};
|