@bearmenu/ui 0.1.0 → 0.5.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/README.md +116 -0
- package/dist/{chunk-2CUFS5LF.js → chunk-2BMJRXQX.js} +1 -1
- package/dist/chunk-HLQ2IRE7.js +279 -0
- package/dist/chunk-IQASCH2V.js +25 -0
- package/dist/{chunk-UXAYXRFN.js → chunk-QJ54Z7TC.js} +15 -1
- package/dist/{chunk-X6GATUI2.js → chunk-UISA4CIG.js} +1 -0
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.d.ts +9 -7
- package/dist/components/calendar.js +153 -39
- package/dist/components/card.d.ts +2 -1
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.js +1 -1
- package/dist/components/checkbox.js +3 -25
- package/dist/components/command.d.ts +13 -13
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/empty-state.js +1 -1
- package/dist/components/haptic-button.js +1 -1
- package/dist/components/link-button.js +1 -1
- package/dist/components/multi-select-combobox.js +1 -1
- package/dist/components/multi-select-menu.d.ts +26 -0
- package/dist/components/multi-select-menu.js +71 -0
- package/dist/components/pagination.js +1 -1
- package/dist/components/phone-frame.d.ts +17 -0
- package/dist/components/phone-frame.js +41 -0
- package/dist/components/place-about-tab.d.ts +17 -0
- package/dist/components/place-about-tab.js +6 -0
- package/dist/components/place-card.d.ts +17 -0
- package/dist/components/place-card.js +145 -0
- package/dist/components/place-details-mobile.d.ts +18 -0
- package/dist/components/place-details-mobile.js +187 -0
- package/dist/components/place-types.d.ts +145 -0
- package/dist/components/place-types.js +1 -0
- package/dist/components/search-bar.js +1 -1
- package/dist/components/searchable-select.js +1 -1
- package/dist/components/skeleton-card.js +1 -1
- package/dist/components/skeleton.js +1 -1
- package/dist/components/sliding-panels.js +1 -1
- package/dist/components/sonner.js +11 -2
- package/dist/components/tabs.js +1 -1
- package/dist/components/text.d.ts +3 -3
- package/dist/components/toaster.js +1 -1
- package/package.json +28 -9
- package/src/components/accordion.stories.tsx +51 -0
- package/src/components/alert-dialog.stories.tsx +45 -0
- package/src/components/alert.stories.tsx +85 -0
- package/src/components/aspect-ratio.stories.tsx +47 -0
- package/src/components/avatar.stories.tsx +66 -0
- package/src/components/badge.stories.tsx +60 -0
- package/src/components/breadcrumb.stories.tsx +63 -0
- package/src/components/button.stories.tsx +115 -0
- package/src/components/button.tsx +1 -1
- package/src/components/calendar.stories.tsx +47 -0
- package/src/components/calendar.tsx +160 -40
- package/src/components/card.stories.tsx +72 -0
- package/src/components/card.tsx +13 -1
- package/src/components/carousel.stories.tsx +62 -0
- package/src/components/checkbox.stories.tsx +54 -0
- package/src/components/checkbox.tsx +1 -1
- package/src/components/collapsible.stories.tsx +34 -0
- package/src/components/command.stories.tsx +64 -0
- package/src/components/currency-input.stories.tsx +50 -0
- package/src/components/dialog.stories.tsx +75 -0
- package/src/components/drawer.stories.tsx +47 -0
- package/src/components/dropdown-menu.stories.tsx +64 -0
- package/src/components/dropdown-menu.tsx +1 -1
- package/src/components/empty-state.stories.tsx +67 -0
- package/src/components/form.stories.tsx +73 -0
- package/src/components/haptic-button.stories.tsx +41 -0
- package/src/components/input-otp.stories.tsx +42 -0
- package/src/components/input.stories.tsx +41 -0
- package/src/components/label.stories.tsx +35 -0
- package/src/components/markdown-renderer.stories.tsx +45 -0
- package/src/components/multi-select-combobox.stories.tsx +78 -0
- package/src/components/multi-select-menu.tsx +96 -0
- package/src/components/pagination.stories.tsx +48 -0
- package/src/components/phone-frame.stories.tsx +51 -0
- package/src/components/phone-frame.test.tsx +82 -0
- package/src/components/phone-frame.tsx +59 -0
- package/src/components/place-about-tab.stories.tsx +164 -0
- package/src/components/place-about-tab.test.tsx +325 -0
- package/src/components/place-about-tab.tsx +474 -0
- package/src/components/place-card.stories.tsx +120 -0
- package/src/components/place-card.test.tsx +187 -0
- package/src/components/place-card.tsx +187 -0
- package/src/components/place-details-mobile.tsx +251 -0
- package/src/components/place-types.ts +127 -0
- package/src/components/popover.stories.tsx +42 -0
- package/src/components/progress.stories.tsx +35 -0
- package/src/components/radio-group.stories.tsx +46 -0
- package/src/components/rating.stories.tsx +45 -0
- package/src/components/scroll-area.stories.tsx +48 -0
- package/src/components/search-bar.stories.tsx +92 -0
- package/src/components/searchable-select.stories.tsx +55 -0
- package/src/components/select.stories.tsx +92 -0
- package/src/components/separator.stories.tsx +33 -0
- package/src/components/sheet.stories.tsx +95 -0
- package/src/components/skeleton-card.stories.tsx +53 -0
- package/src/components/skeleton.stories.tsx +42 -0
- package/src/components/skeleton.tsx +1 -0
- package/src/components/slider.stories.tsx +27 -0
- package/src/components/sliding-panels.stories.tsx +68 -0
- package/src/components/sonner.tsx +17 -2
- package/src/components/sticky-container.stories.tsx +33 -0
- package/src/components/switch.stories.tsx +35 -0
- package/src/components/table.stories.tsx +60 -0
- package/src/components/tabs.stories.tsx +53 -0
- package/src/components/tabs.tsx +1 -1
- package/src/components/text.stories.tsx +82 -0
- package/src/components/textarea.stories.tsx +35 -0
- package/src/components/toast.stories.tsx +63 -0
- package/src/components/toggle-group.stories.tsx +60 -0
- package/src/components/toggle.stories.tsx +48 -0
- package/src/components/tooltip.stories.tsx +71 -0
- package/src/globals.css +14 -2
- package/src/test/setup.ts +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bearmenu/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "BearMenu design system — shared UI tokens, primitives, and components",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -45,7 +45,13 @@
|
|
|
45
45
|
"./components/link-button": "./src/components/link-button.tsx",
|
|
46
46
|
"./components/markdown-renderer": "./src/components/markdown-renderer.tsx",
|
|
47
47
|
"./components/multi-select-combobox": "./src/components/multi-select-combobox.tsx",
|
|
48
|
+
"./components/multi-select-menu": "./src/components/multi-select-menu.tsx",
|
|
48
49
|
"./components/pagination": "./src/components/pagination.tsx",
|
|
50
|
+
"./components/phone-frame": "./src/components/phone-frame.tsx",
|
|
51
|
+
"./components/place-about-tab": "./src/components/place-about-tab.tsx",
|
|
52
|
+
"./components/place-card": "./src/components/place-card.tsx",
|
|
53
|
+
"./components/place-details-mobile": "./src/components/place-details-mobile.tsx",
|
|
54
|
+
"./components/place-types": "./src/components/place-types.ts",
|
|
49
55
|
"./components/popover": "./src/components/popover.tsx",
|
|
50
56
|
"./components/progress": "./src/components/progress.tsx",
|
|
51
57
|
"./components/radio-group": "./src/components/radio-group.tsx",
|
|
@@ -98,6 +104,8 @@
|
|
|
98
104
|
}
|
|
99
105
|
},
|
|
100
106
|
"scripts": {
|
|
107
|
+
"storybook": "storybook dev -p 6006",
|
|
108
|
+
"build-storybook": "storybook build",
|
|
101
109
|
"build": "tsup",
|
|
102
110
|
"dev": "tsup --watch",
|
|
103
111
|
"typecheck": "tsc --noEmit",
|
|
@@ -105,7 +113,7 @@
|
|
|
105
113
|
"prepublishOnly": "pnpm run build"
|
|
106
114
|
},
|
|
107
115
|
"peerDependencies": {
|
|
108
|
-
"@hookform/resolvers": "^3.0.0",
|
|
116
|
+
"@hookform/resolvers": "^3.0.0 || ^5.0.0",
|
|
109
117
|
"@radix-ui/react-accordion": "*",
|
|
110
118
|
"@radix-ui/react-alert-dialog": "*",
|
|
111
119
|
"@radix-ui/react-aspect-ratio": "*",
|
|
@@ -135,7 +143,7 @@
|
|
|
135
143
|
"embla-carousel-react": "*",
|
|
136
144
|
"framer-motion": "^12.0.0",
|
|
137
145
|
"input-otp": "*",
|
|
138
|
-
"lucide-react": "
|
|
146
|
+
"lucide-react": ">=0.400.0",
|
|
139
147
|
"next": ">=14.0.0",
|
|
140
148
|
"next-themes": "^0.4.0",
|
|
141
149
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -144,10 +152,10 @@
|
|
|
144
152
|
"react-hook-form": "^7.0.0",
|
|
145
153
|
"react-markdown": "^10.0.0",
|
|
146
154
|
"remark-gfm": "^4.0.0",
|
|
147
|
-
"sonner": "^1.0.0",
|
|
148
|
-
"tailwind-merge": "^2.0.0",
|
|
155
|
+
"sonner": "^1.0.0 || ^2.0.0",
|
|
156
|
+
"tailwind-merge": "^2.0.0 || ^3.0.0",
|
|
149
157
|
"vaul": "^1.0.0",
|
|
150
|
-
"zod": "^3.0.0"
|
|
158
|
+
"zod": "^3.0.0 || ^4.0.0"
|
|
151
159
|
},
|
|
152
160
|
"devDependencies": {
|
|
153
161
|
"@hookform/resolvers": "^3.10.0",
|
|
@@ -174,15 +182,24 @@
|
|
|
174
182
|
"@radix-ui/react-toggle": "latest",
|
|
175
183
|
"@radix-ui/react-toggle-group": "latest",
|
|
176
184
|
"@radix-ui/react-tooltip": "latest",
|
|
185
|
+
"@storybook/addon-a11y": "^10.3.5",
|
|
186
|
+
"@storybook/addon-docs": "^10.3.5",
|
|
187
|
+
"@storybook/react-vite": "^10.3.5",
|
|
188
|
+
"@tailwindcss/postcss": "^4.2.4",
|
|
189
|
+
"@tailwindcss/vite": "^4.2.4",
|
|
190
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
191
|
+
"@testing-library/react": "^16.3.2",
|
|
177
192
|
"@types/react": "^19",
|
|
178
193
|
"@types/react-dom": "^19",
|
|
194
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
179
195
|
"class-variance-authority": "^0.7.1",
|
|
180
196
|
"clsx": "^2.1.1",
|
|
181
197
|
"cmdk": "latest",
|
|
182
198
|
"embla-carousel-react": "^8.6.0",
|
|
183
199
|
"framer-motion": "^12.23.22",
|
|
184
200
|
"input-otp": "^1.4.2",
|
|
185
|
-
"
|
|
201
|
+
"jsdom": "^29.1.0",
|
|
202
|
+
"lucide-react": "^1.0.1",
|
|
186
203
|
"next": "^16.1.7",
|
|
187
204
|
"next-themes": "^0.4.6",
|
|
188
205
|
"react": "19.2.4",
|
|
@@ -191,13 +208,15 @@
|
|
|
191
208
|
"react-hook-form": "7.72.0",
|
|
192
209
|
"react-markdown": "^10.1.0",
|
|
193
210
|
"remark-gfm": "^4.0.1",
|
|
194
|
-
"sonner": "^
|
|
195
|
-
"
|
|
211
|
+
"sonner": "^2.0.7",
|
|
212
|
+
"storybook": "^10.3.5",
|
|
213
|
+
"tailwind-merge": "^3.5.0",
|
|
196
214
|
"tailwindcss": "^4.2.4",
|
|
197
215
|
"tsup": "^8.5.0",
|
|
198
216
|
"tw-animate-css": "^1.4.0",
|
|
199
217
|
"typescript": "^5",
|
|
200
218
|
"vaul": "^1.1.2",
|
|
219
|
+
"vitest": "^4.1.5",
|
|
201
220
|
"zod": "^3.25.67"
|
|
202
221
|
}
|
|
203
222
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./accordion";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Components/Accordion",
|
|
6
|
+
component: Accordion,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
} satisfies Meta<typeof Accordion>;
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
|
|
13
|
+
export const Default: Story = {
|
|
14
|
+
render: () => (
|
|
15
|
+
<Accordion type="single" collapsible className="w-[400px]">
|
|
16
|
+
<AccordionItem value="item-1">
|
|
17
|
+
<AccordionTrigger>Is it accessible?</AccordionTrigger>
|
|
18
|
+
<AccordionContent>Yes. It adheres to the WAI-ARIA design pattern.</AccordionContent>
|
|
19
|
+
</AccordionItem>
|
|
20
|
+
<AccordionItem value="item-2">
|
|
21
|
+
<AccordionTrigger>Is it styled?</AccordionTrigger>
|
|
22
|
+
<AccordionContent>
|
|
23
|
+
Yes. It comes with default styles that match the design system.
|
|
24
|
+
</AccordionContent>
|
|
25
|
+
</AccordionItem>
|
|
26
|
+
<AccordionItem value="item-3">
|
|
27
|
+
<AccordionTrigger>Is it animated?</AccordionTrigger>
|
|
28
|
+
<AccordionContent>Yes. It uses CSS animations for smooth transitions.</AccordionContent>
|
|
29
|
+
</AccordionItem>
|
|
30
|
+
</Accordion>
|
|
31
|
+
),
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const Multiple: Story = {
|
|
35
|
+
render: () => (
|
|
36
|
+
<Accordion type="multiple" className="w-[400px]">
|
|
37
|
+
<AccordionItem value="item-1">
|
|
38
|
+
<AccordionTrigger>Section One</AccordionTrigger>
|
|
39
|
+
<AccordionContent>Content for section one.</AccordionContent>
|
|
40
|
+
</AccordionItem>
|
|
41
|
+
<AccordionItem value="item-2">
|
|
42
|
+
<AccordionTrigger>Section Two</AccordionTrigger>
|
|
43
|
+
<AccordionContent>Content for section two.</AccordionContent>
|
|
44
|
+
</AccordionItem>
|
|
45
|
+
<AccordionItem value="item-3">
|
|
46
|
+
<AccordionTrigger>Section Three</AccordionTrigger>
|
|
47
|
+
<AccordionContent>Content for section three.</AccordionContent>
|
|
48
|
+
</AccordionItem>
|
|
49
|
+
</Accordion>
|
|
50
|
+
),
|
|
51
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
AlertDialog,
|
|
4
|
+
AlertDialogAction,
|
|
5
|
+
AlertDialogCancel,
|
|
6
|
+
AlertDialogContent,
|
|
7
|
+
AlertDialogDescription,
|
|
8
|
+
AlertDialogFooter,
|
|
9
|
+
AlertDialogHeader,
|
|
10
|
+
AlertDialogTitle,
|
|
11
|
+
AlertDialogTrigger,
|
|
12
|
+
} from "./alert-dialog";
|
|
13
|
+
import { Button } from "./button";
|
|
14
|
+
|
|
15
|
+
const meta = {
|
|
16
|
+
title: "Components/AlertDialog",
|
|
17
|
+
component: AlertDialog,
|
|
18
|
+
tags: ["autodocs"],
|
|
19
|
+
} satisfies Meta<typeof AlertDialog>;
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryObj<typeof meta>;
|
|
23
|
+
|
|
24
|
+
export const Default: Story = {
|
|
25
|
+
render: () => (
|
|
26
|
+
<AlertDialog>
|
|
27
|
+
<AlertDialogTrigger asChild>
|
|
28
|
+
<Button variant="destructive">Delete Account</Button>
|
|
29
|
+
</AlertDialogTrigger>
|
|
30
|
+
<AlertDialogContent>
|
|
31
|
+
<AlertDialogHeader>
|
|
32
|
+
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
|
|
33
|
+
<AlertDialogDescription>
|
|
34
|
+
This action cannot be undone. This will permanently delete your account and remove your
|
|
35
|
+
data from our servers.
|
|
36
|
+
</AlertDialogDescription>
|
|
37
|
+
</AlertDialogHeader>
|
|
38
|
+
<AlertDialogFooter>
|
|
39
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
40
|
+
<AlertDialogAction>Continue</AlertDialogAction>
|
|
41
|
+
</AlertDialogFooter>
|
|
42
|
+
</AlertDialogContent>
|
|
43
|
+
</AlertDialog>
|
|
44
|
+
),
|
|
45
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Alert, AlertTitle, AlertDescription } from "./alert";
|
|
3
|
+
import { AlertCircle, CheckCircle, Info, AlertTriangle } from "lucide-react";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Components/Alert",
|
|
7
|
+
component: Alert,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
variant: {
|
|
11
|
+
control: "select",
|
|
12
|
+
options: ["default", "destructive", "warning", "success"],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
} satisfies Meta<typeof Alert>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
export const Default: Story = {
|
|
21
|
+
render: () => (
|
|
22
|
+
<Alert>
|
|
23
|
+
<Info className="h-4 w-4" />
|
|
24
|
+
<AlertTitle>Information</AlertTitle>
|
|
25
|
+
<AlertDescription>This is a default informational alert.</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>Something went wrong. Please try again.</AlertDescription>
|
|
36
|
+
</Alert>
|
|
37
|
+
),
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const Warning: Story = {
|
|
41
|
+
render: () => (
|
|
42
|
+
<Alert variant="warning">
|
|
43
|
+
<AlertTriangle className="h-4 w-4" />
|
|
44
|
+
<AlertTitle>Warning</AlertTitle>
|
|
45
|
+
<AlertDescription>Your session is about to expire.</AlertDescription>
|
|
46
|
+
</Alert>
|
|
47
|
+
),
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const Success: Story = {
|
|
51
|
+
render: () => (
|
|
52
|
+
<Alert variant="success">
|
|
53
|
+
<CheckCircle className="h-4 w-4" />
|
|
54
|
+
<AlertTitle>Success</AlertTitle>
|
|
55
|
+
<AlertDescription>Your changes have been saved.</AlertDescription>
|
|
56
|
+
</Alert>
|
|
57
|
+
),
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const AllVariants: Story = {
|
|
61
|
+
render: () => (
|
|
62
|
+
<div className="flex flex-col gap-4 w-[450px]">
|
|
63
|
+
<Alert>
|
|
64
|
+
<Info className="h-4 w-4" />
|
|
65
|
+
<AlertTitle>Default</AlertTitle>
|
|
66
|
+
<AlertDescription>Informational message.</AlertDescription>
|
|
67
|
+
</Alert>
|
|
68
|
+
<Alert variant="destructive">
|
|
69
|
+
<AlertCircle className="h-4 w-4" />
|
|
70
|
+
<AlertTitle>Destructive</AlertTitle>
|
|
71
|
+
<AlertDescription>Error message.</AlertDescription>
|
|
72
|
+
</Alert>
|
|
73
|
+
<Alert variant="warning">
|
|
74
|
+
<AlertTriangle className="h-4 w-4" />
|
|
75
|
+
<AlertTitle>Warning</AlertTitle>
|
|
76
|
+
<AlertDescription>Warning message.</AlertDescription>
|
|
77
|
+
</Alert>
|
|
78
|
+
<Alert variant="success">
|
|
79
|
+
<CheckCircle className="h-4 w-4" />
|
|
80
|
+
<AlertTitle>Success</AlertTitle>
|
|
81
|
+
<AlertDescription>Success message.</AlertDescription>
|
|
82
|
+
</Alert>
|
|
83
|
+
</div>
|
|
84
|
+
),
|
|
85
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { AspectRatio } from "./aspect-ratio";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Components/AspectRatio",
|
|
6
|
+
component: AspectRatio,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
} satisfies Meta<typeof AspectRatio>;
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
|
|
13
|
+
export const Default: Story = {
|
|
14
|
+
render: () => (
|
|
15
|
+
<div className="w-[450px]">
|
|
16
|
+
<AspectRatio ratio={16 / 9} className="bg-muted rounded-md overflow-hidden">
|
|
17
|
+
<div className="flex items-center justify-center h-full text-muted-foreground">
|
|
18
|
+
16:9
|
|
19
|
+
</div>
|
|
20
|
+
</AspectRatio>
|
|
21
|
+
</div>
|
|
22
|
+
),
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const Square: Story = {
|
|
26
|
+
render: () => (
|
|
27
|
+
<div className="w-[300px]">
|
|
28
|
+
<AspectRatio ratio={1} className="bg-muted rounded-md overflow-hidden">
|
|
29
|
+
<div className="flex items-center justify-center h-full text-muted-foreground">
|
|
30
|
+
1:1
|
|
31
|
+
</div>
|
|
32
|
+
</AspectRatio>
|
|
33
|
+
</div>
|
|
34
|
+
),
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Portrait: Story = {
|
|
38
|
+
render: () => (
|
|
39
|
+
<div className="w-[200px]">
|
|
40
|
+
<AspectRatio ratio={3 / 4} className="bg-muted rounded-md overflow-hidden">
|
|
41
|
+
<div className="flex items-center justify-center h-full text-muted-foreground">
|
|
42
|
+
3:4
|
|
43
|
+
</div>
|
|
44
|
+
</AspectRatio>
|
|
45
|
+
</div>
|
|
46
|
+
),
|
|
47
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Avatar, AvatarFallback, AvatarImage } from "./avatar";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Components/Avatar",
|
|
6
|
+
component: Avatar,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
} satisfies Meta<typeof Avatar>;
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
|
|
13
|
+
export const WithImage: Story = {
|
|
14
|
+
render: () => (
|
|
15
|
+
<Avatar>
|
|
16
|
+
<AvatarImage src="https://github.com/shadcn.png" alt="User" />
|
|
17
|
+
<AvatarFallback>CN</AvatarFallback>
|
|
18
|
+
</Avatar>
|
|
19
|
+
),
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const Fallback: Story = {
|
|
23
|
+
render: () => (
|
|
24
|
+
<Avatar>
|
|
25
|
+
<AvatarFallback>JD</AvatarFallback>
|
|
26
|
+
</Avatar>
|
|
27
|
+
),
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Sizes: Story = {
|
|
31
|
+
render: () => (
|
|
32
|
+
<div className="flex items-center gap-4">
|
|
33
|
+
<Avatar className="h-8 w-8">
|
|
34
|
+
<AvatarFallback className="text-xs">S</AvatarFallback>
|
|
35
|
+
</Avatar>
|
|
36
|
+
<Avatar>
|
|
37
|
+
<AvatarFallback>MD</AvatarFallback>
|
|
38
|
+
</Avatar>
|
|
39
|
+
<Avatar className="h-14 w-14">
|
|
40
|
+
<AvatarFallback className="text-lg">LG</AvatarFallback>
|
|
41
|
+
</Avatar>
|
|
42
|
+
<Avatar className="h-20 w-20">
|
|
43
|
+
<AvatarFallback className="text-xl">XL</AvatarFallback>
|
|
44
|
+
</Avatar>
|
|
45
|
+
</div>
|
|
46
|
+
),
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const Group: Story = {
|
|
50
|
+
render: () => (
|
|
51
|
+
<div className="flex -space-x-3">
|
|
52
|
+
<Avatar className="border-2 border-background">
|
|
53
|
+
<AvatarFallback>A</AvatarFallback>
|
|
54
|
+
</Avatar>
|
|
55
|
+
<Avatar className="border-2 border-background">
|
|
56
|
+
<AvatarFallback>B</AvatarFallback>
|
|
57
|
+
</Avatar>
|
|
58
|
+
<Avatar className="border-2 border-background">
|
|
59
|
+
<AvatarFallback>C</AvatarFallback>
|
|
60
|
+
</Avatar>
|
|
61
|
+
<Avatar className="border-2 border-background">
|
|
62
|
+
<AvatarFallback className="text-xs">+3</AvatarFallback>
|
|
63
|
+
</Avatar>
|
|
64
|
+
</div>
|
|
65
|
+
),
|
|
66
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Badge } from "./badge";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Components/Badge",
|
|
6
|
+
component: Badge,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
argTypes: {
|
|
9
|
+
variant: {
|
|
10
|
+
control: "select",
|
|
11
|
+
options: ["default", "secondary", "destructive", "outline", "overlay", "glass", "success", "warning"],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
} satisfies Meta<typeof Badge>;
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
type Story = StoryObj<typeof meta>;
|
|
18
|
+
|
|
19
|
+
export const Default: Story = {
|
|
20
|
+
args: { children: "Badge" },
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Secondary: Story = {
|
|
24
|
+
args: { children: "Secondary", variant: "secondary" },
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const Destructive: Story = {
|
|
28
|
+
args: { children: "Destructive", variant: "destructive" },
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const Outline: Story = {
|
|
32
|
+
args: { children: "Outline", variant: "outline" },
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const Glass: Story = {
|
|
36
|
+
args: { children: "Glass", variant: "glass" },
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Success: Story = {
|
|
40
|
+
args: { children: "Success", variant: "success" },
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const Warning: Story = {
|
|
44
|
+
args: { children: "Warning", variant: "warning" },
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const AllVariants: Story = {
|
|
48
|
+
render: () => (
|
|
49
|
+
<div className="flex flex-wrap items-center gap-3">
|
|
50
|
+
<Badge variant="default">Default</Badge>
|
|
51
|
+
<Badge variant="secondary">Secondary</Badge>
|
|
52
|
+
<Badge variant="destructive">Destructive</Badge>
|
|
53
|
+
<Badge variant="outline">Outline</Badge>
|
|
54
|
+
<Badge variant="overlay">Overlay</Badge>
|
|
55
|
+
<Badge variant="glass">Glass</Badge>
|
|
56
|
+
<Badge variant="success">Success</Badge>
|
|
57
|
+
<Badge variant="warning">Warning</Badge>
|
|
58
|
+
</div>
|
|
59
|
+
),
|
|
60
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
Breadcrumb,
|
|
4
|
+
BreadcrumbEllipsis,
|
|
5
|
+
BreadcrumbItem,
|
|
6
|
+
BreadcrumbLink,
|
|
7
|
+
BreadcrumbList,
|
|
8
|
+
BreadcrumbPage,
|
|
9
|
+
BreadcrumbSeparator,
|
|
10
|
+
} from "./breadcrumb";
|
|
11
|
+
|
|
12
|
+
const meta = {
|
|
13
|
+
title: "Components/Breadcrumb",
|
|
14
|
+
component: Breadcrumb,
|
|
15
|
+
tags: ["autodocs"],
|
|
16
|
+
} satisfies Meta<typeof Breadcrumb>;
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
|
|
21
|
+
export const Default: Story = {
|
|
22
|
+
render: () => (
|
|
23
|
+
<Breadcrumb>
|
|
24
|
+
<BreadcrumbList>
|
|
25
|
+
<BreadcrumbItem>
|
|
26
|
+
<BreadcrumbLink href="#">Home</BreadcrumbLink>
|
|
27
|
+
</BreadcrumbItem>
|
|
28
|
+
<BreadcrumbSeparator />
|
|
29
|
+
<BreadcrumbItem>
|
|
30
|
+
<BreadcrumbLink href="#">Products</BreadcrumbLink>
|
|
31
|
+
</BreadcrumbItem>
|
|
32
|
+
<BreadcrumbSeparator />
|
|
33
|
+
<BreadcrumbItem>
|
|
34
|
+
<BreadcrumbPage>Current Page</BreadcrumbPage>
|
|
35
|
+
</BreadcrumbItem>
|
|
36
|
+
</BreadcrumbList>
|
|
37
|
+
</Breadcrumb>
|
|
38
|
+
),
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const WithEllipsis: Story = {
|
|
42
|
+
render: () => (
|
|
43
|
+
<Breadcrumb>
|
|
44
|
+
<BreadcrumbList>
|
|
45
|
+
<BreadcrumbItem>
|
|
46
|
+
<BreadcrumbLink href="#">Home</BreadcrumbLink>
|
|
47
|
+
</BreadcrumbItem>
|
|
48
|
+
<BreadcrumbSeparator />
|
|
49
|
+
<BreadcrumbItem>
|
|
50
|
+
<BreadcrumbEllipsis />
|
|
51
|
+
</BreadcrumbItem>
|
|
52
|
+
<BreadcrumbSeparator />
|
|
53
|
+
<BreadcrumbItem>
|
|
54
|
+
<BreadcrumbLink href="#">Category</BreadcrumbLink>
|
|
55
|
+
</BreadcrumbItem>
|
|
56
|
+
<BreadcrumbSeparator />
|
|
57
|
+
<BreadcrumbItem>
|
|
58
|
+
<BreadcrumbPage>Product</BreadcrumbPage>
|
|
59
|
+
</BreadcrumbItem>
|
|
60
|
+
</BreadcrumbList>
|
|
61
|
+
</Breadcrumb>
|
|
62
|
+
),
|
|
63
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Button } from "./button";
|
|
3
|
+
import { Heart, Mail, Plus } from "lucide-react";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Components/Button",
|
|
7
|
+
component: Button,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
variant: {
|
|
11
|
+
control: "select",
|
|
12
|
+
options: [
|
|
13
|
+
"default",
|
|
14
|
+
"destructive",
|
|
15
|
+
"outline",
|
|
16
|
+
"secondary",
|
|
17
|
+
"ghost",
|
|
18
|
+
"link",
|
|
19
|
+
"glass",
|
|
20
|
+
"brown",
|
|
21
|
+
"antagonist",
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
size: {
|
|
25
|
+
control: "select",
|
|
26
|
+
options: ["default", "sm", "lg", "icon"],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
} satisfies Meta<typeof Button>;
|
|
30
|
+
|
|
31
|
+
export default meta;
|
|
32
|
+
type Story = StoryObj<typeof meta>;
|
|
33
|
+
|
|
34
|
+
export const Default: Story = {
|
|
35
|
+
args: { children: "Button" },
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const Destructive: Story = {
|
|
39
|
+
args: { children: "Delete", variant: "destructive" },
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const Outline: Story = {
|
|
43
|
+
args: { children: "Outline", variant: "outline" },
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const Secondary: Story = {
|
|
47
|
+
args: { children: "Secondary", variant: "secondary" },
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const Ghost: Story = {
|
|
51
|
+
args: { children: "Ghost", variant: "ghost" },
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const Link: Story = {
|
|
55
|
+
args: { children: "Link", variant: "link" },
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const Glass: Story = {
|
|
59
|
+
args: { children: "Glass", variant: "glass" },
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const Brown: Story = {
|
|
63
|
+
args: { children: "Brown", variant: "brown" },
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const Antagonist: Story = {
|
|
67
|
+
args: { children: "Antagonist", variant: "antagonist" },
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const Small: Story = {
|
|
71
|
+
args: { children: "Small", size: "sm" },
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const Large: Story = {
|
|
75
|
+
args: { children: "Large", size: "lg" },
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const Icon: Story = {
|
|
79
|
+
args: { size: "icon", children: <Plus className="h-4 w-4" /> },
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const WithIcon: Story = {
|
|
83
|
+
args: { children: <><Mail className="h-4 w-4" /> Send Email</> },
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const Disabled: Story = {
|
|
87
|
+
args: { children: "Disabled", disabled: true },
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const AllVariants: Story = {
|
|
91
|
+
render: () => (
|
|
92
|
+
<div className="flex flex-wrap items-center gap-4">
|
|
93
|
+
<Button variant="default">Default</Button>
|
|
94
|
+
<Button variant="destructive">Destructive</Button>
|
|
95
|
+
<Button variant="outline">Outline</Button>
|
|
96
|
+
<Button variant="secondary">Secondary</Button>
|
|
97
|
+
<Button variant="ghost">Ghost</Button>
|
|
98
|
+
<Button variant="link">Link</Button>
|
|
99
|
+
<Button variant="glass">Glass</Button>
|
|
100
|
+
<Button variant="brown">Brown</Button>
|
|
101
|
+
<Button variant="antagonist">Antagonist</Button>
|
|
102
|
+
</div>
|
|
103
|
+
),
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const AllSizes: Story = {
|
|
107
|
+
render: () => (
|
|
108
|
+
<div className="flex items-center gap-4">
|
|
109
|
+
<Button size="sm">Small</Button>
|
|
110
|
+
<Button size="default">Default</Button>
|
|
111
|
+
<Button size="lg">Large</Button>
|
|
112
|
+
<Button size="icon"><Heart className="h-4 w-4" /></Button>
|
|
113
|
+
</div>
|
|
114
|
+
),
|
|
115
|
+
};
|
|
@@ -14,7 +14,7 @@ const buttonVariants = cva(
|
|
|
14
14
|
destructive:
|
|
15
15
|
"bg-destructive text-destructive-foreground shadow-lg hover:bg-destructive/90 hover:shadow-destructive/20 backdrop-blur-sm border border-destructive/20",
|
|
16
16
|
outline:
|
|
17
|
-
"border border-border bg-
|
|
17
|
+
"border border-border bg-sidebar backdrop-blur-md hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:border-sidebar-accent-foreground/20 hover:shadow-lg",
|
|
18
18
|
secondary:
|
|
19
19
|
"bg-secondary text-secondary-foreground shadow-lg hover:bg-secondary/90 hover:shadow-secondary/20 backdrop-blur-sm border border-secondary/20",
|
|
20
20
|
ghost: "hover:bg-foreground/10 hover:text-foreground transition-colors duration-200",
|