@auto-engineer/generate-react-client 1.64.0 → 1.66.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/CHANGELOG.md +140 -0
- package/dist/starter/.storybook/main.ts +17 -22
- package/dist/starter/.storybook/manager-head.html +31 -31
- package/dist/starter/.storybook/manager.ts +133 -133
- package/dist/starter/.storybook/preview-head.html +12 -12
- package/dist/starter/.storybook/preview.tsx +79 -79
- package/dist/starter/biome.json +126 -0
- package/dist/starter/codegen.ts +11 -11
- package/dist/starter/components.json +27 -27
- package/dist/starter/package.json +86 -80
- package/dist/starter/public/mockServiceWorker.js +261 -261
- package/dist/starter/scripts/build-component-db.ts +17 -20
- package/dist/starter/src/App.tsx +15 -17
- package/dist/starter/src/components/ui/Accordion.stories.tsx +35 -35
- package/dist/starter/src/components/ui/Accordion.tsx +33 -33
- package/dist/starter/src/components/ui/Alert.stories.tsx +15 -15
- package/dist/starter/src/components/ui/Alert.tsx +32 -32
- package/dist/starter/src/components/ui/AlertDialog.stories.tsx +50 -50
- package/dist/starter/src/components/ui/AlertDialog.tsx +114 -115
- package/dist/starter/src/components/ui/AspectRatio.stories.tsx +20 -20
- package/dist/starter/src/components/ui/AspectRatio.tsx +1 -1
- package/dist/starter/src/components/ui/Avatar.stories.tsx +27 -27
- package/dist/starter/src/components/ui/Avatar.tsx +63 -63
- package/dist/starter/src/components/ui/Badge.stories.tsx +14 -14
- package/dist/starter/src/components/ui/Badge.tsx +27 -27
- package/dist/starter/src/components/ui/Breadcrumb.stories.tsx +38 -38
- package/dist/starter/src/components/ui/Breadcrumb.tsx +63 -62
- package/dist/starter/src/components/ui/Button.stories.tsx +55 -55
- package/dist/starter/src/components/ui/Button.tsx +49 -49
- package/dist/starter/src/components/ui/ButtonGroup.stories.tsx +17 -17
- package/dist/starter/src/components/ui/ButtonGroup.tsx +52 -53
- package/dist/starter/src/components/ui/Calendar.stories.tsx +20 -19
- package/dist/starter/src/components/ui/Calendar.tsx +142 -143
- package/dist/starter/src/components/ui/Card.stories.tsx +29 -29
- package/dist/starter/src/components/ui/Card.tsx +31 -31
- package/dist/starter/src/components/ui/Carousel.stories.tsx +41 -41
- package/dist/starter/src/components/ui/Carousel.tsx +171 -172
- package/dist/starter/src/components/ui/Chart.stories.tsx +21 -21
- package/dist/starter/src/components/ui/Chart.tsx +244 -247
- package/dist/starter/src/components/ui/Checkbox.stories.tsx +11 -11
- package/dist/starter/src/components/ui/Checkbox.tsx +18 -18
- package/dist/starter/src/components/ui/Collapsible.stories.tsx +40 -40
- package/dist/starter/src/components/ui/Collapsible.tsx +3 -3
- package/dist/starter/src/components/ui/Combobox.stories.tsx +48 -48
- package/dist/starter/src/components/ui/Combobox.tsx +204 -205
- package/dist/starter/src/components/ui/Command.stories.tsx +55 -55
- package/dist/starter/src/components/ui/Command.tsx +102 -103
- package/dist/starter/src/components/ui/ContextMenu.stories.tsx +52 -52
- package/dist/starter/src/components/ui/ContextMenu.tsx +151 -151
- package/dist/starter/src/components/ui/DesignSystem-Colors.stories.tsx +92 -92
- package/dist/starter/src/components/ui/DesignSystem-Layout.stories.tsx +139 -139
- package/dist/starter/src/components/ui/DesignSystem-Overview.stories.tsx +676 -657
- package/dist/starter/src/components/ui/DesignSystem-Typography.stories.tsx +59 -59
- package/dist/starter/src/components/ui/Dialog.stories.tsx +56 -56
- package/dist/starter/src/components/ui/Dialog.tsx +97 -98
- package/dist/starter/src/components/ui/Direction.stories.tsx +20 -20
- package/dist/starter/src/components/ui/Direction.tsx +7 -7
- package/dist/starter/src/components/ui/Drawer.stories.tsx +54 -54
- package/dist/starter/src/components/ui/Drawer.tsx +70 -70
- package/dist/starter/src/components/ui/DropdownMenu.stories.tsx +58 -58
- package/dist/starter/src/components/ui/DropdownMenu.tsx +157 -157
- package/dist/starter/src/components/ui/Empty.stories.tsx +22 -22
- package/dist/starter/src/components/ui/Empty.tsx +58 -58
- package/dist/starter/src/components/ui/Field.stories.tsx +31 -31
- package/dist/starter/src/components/ui/Field.tsx +180 -181
- package/dist/starter/src/components/ui/Form.stories.tsx +29 -29
- package/dist/starter/src/components/ui/Form.tsx +93 -96
- package/dist/starter/src/components/ui/HoverCard.stories.tsx +34 -34
- package/dist/starter/src/components/ui/HoverCard.tsx +21 -21
- package/dist/starter/src/components/ui/Input.stories.tsx +18 -18
- package/dist/starter/src/components/ui/Input.tsx +14 -14
- package/dist/starter/src/components/ui/InputGroup.stories.tsx +34 -34
- package/dist/starter/src/components/ui/InputGroup.tsx +110 -111
- package/dist/starter/src/components/ui/InputOTP.stories.tsx +28 -28
- package/dist/starter/src/components/ui/InputOTP.tsx +43 -43
- package/dist/starter/src/components/ui/Item.stories.tsx +45 -45
- package/dist/starter/src/components/ui/Item.tsx +113 -114
- package/dist/starter/src/components/ui/Kbd.stories.tsx +31 -31
- package/dist/starter/src/components/ui/Kbd.tsx +11 -11
- package/dist/starter/src/components/ui/Label.stories.tsx +62 -62
- package/dist/starter/src/components/ui/Label.tsx +26 -25
- package/dist/starter/src/components/ui/Menubar.stories.tsx +62 -62
- package/dist/starter/src/components/ui/Menubar.tsx +173 -173
- package/dist/starter/src/components/ui/NativeSelect.stories.tsx +26 -26
- package/dist/starter/src/components/ui/NativeSelect.tsx +29 -29
- package/dist/starter/src/components/ui/NavigationMenu.stories.tsx +64 -64
- package/dist/starter/src/components/ui/NavigationMenu.tsx +103 -103
- package/dist/starter/src/components/ui/Pagination.stories.tsx +61 -61
- package/dist/starter/src/components/ui/Pagination.tsx +69 -71
- package/dist/starter/src/components/ui/Popover.stories.tsx +38 -38
- package/dist/starter/src/components/ui/Popover.tsx +25 -25
- package/dist/starter/src/components/ui/Progress.stories.tsx +9 -9
- package/dist/starter/src/components/ui/Progress.tsx +14 -14
- package/dist/starter/src/components/ui/RadioGroup.stories.tsx +35 -35
- package/dist/starter/src/components/ui/RadioGroup.tsx +19 -19
- package/dist/starter/src/components/ui/Resizable.stories.tsx +54 -54
- package/dist/starter/src/components/ui/Resizable.tsx +29 -29
- package/dist/starter/src/components/ui/ScrollArea.stories.tsx +27 -27
- package/dist/starter/src/components/ui/ScrollArea.tsx +34 -34
- package/dist/starter/src/components/ui/Select.stories.tsx +43 -43
- package/dist/starter/src/components/ui/Select.tsx +120 -120
- package/dist/starter/src/components/ui/Separator.stories.tsx +27 -27
- package/dist/starter/src/components/ui/Separator.tsx +17 -17
- package/dist/starter/src/components/ui/Sheet.stories.tsx +53 -53
- package/dist/starter/src/components/ui/Sheet.tsx +69 -69
- package/dist/starter/src/components/ui/Sidebar.stories.tsx +77 -77
- package/dist/starter/src/components/ui/Sidebar.tsx +563 -564
- package/dist/starter/src/components/ui/Skeleton.stories.tsx +25 -25
- package/dist/starter/src/components/ui/Skeleton.tsx +1 -1
- package/dist/starter/src/components/ui/Slider.stories.tsx +5 -5
- package/dist/starter/src/components/ui/Slider.tsx +45 -44
- package/dist/starter/src/components/ui/Sonner.stories.tsx +32 -32
- package/dist/starter/src/components/ui/Sonner.tsx +23 -23
- package/dist/starter/src/components/ui/Spinner.stories.tsx +8 -8
- package/dist/starter/src/components/ui/Spinner.tsx +1 -1
- package/dist/starter/src/components/ui/Switch.stories.tsx +16 -17
- package/dist/starter/src/components/ui/Switch.tsx +24 -24
- package/dist/starter/src/components/ui/Table.stories.tsx +50 -50
- package/dist/starter/src/components/ui/Table.tsx +45 -45
- package/dist/starter/src/components/ui/Tabs.stories.tsx +39 -39
- package/dist/starter/src/components/ui/Tabs.tsx +47 -47
- package/dist/starter/src/components/ui/Textarea.stories.tsx +9 -9
- package/dist/starter/src/components/ui/Textarea.tsx +11 -11
- package/dist/starter/src/components/ui/Toast.stories.tsx +77 -77
- package/dist/starter/src/components/ui/Toast.tsx +75 -75
- package/dist/starter/src/components/ui/Toaster.tsx +17 -19
- package/dist/starter/src/components/ui/Toggle.stories.tsx +20 -20
- package/dist/starter/src/components/ui/Toggle.tsx +26 -26
- package/dist/starter/src/components/ui/ToggleGroup.stories.tsx +41 -41
- package/dist/starter/src/components/ui/ToggleGroup.tsx +61 -62
- package/dist/starter/src/components/ui/Tooltip.stories.tsx +26 -26
- package/dist/starter/src/components/ui/Tooltip.tsx +24 -24
- package/dist/starter/src/gql/execute.ts +1 -1
- package/dist/starter/src/gql/fragment-masking.ts +1 -1
- package/dist/starter/src/gql/graphql.ts +3 -0
- package/dist/starter/src/hooks/use-mobile.ts +11 -11
- package/dist/starter/src/hooks/use-toast.ts +135 -135
- package/dist/starter/src/index.css +105 -105
- package/dist/starter/src/lib/utils.ts +1 -1
- package/dist/starter/src/main.tsx +4 -1
- package/dist/starter/tsconfig.app.json +24 -24
- package/dist/starter/tsconfig.json +8 -8
- package/dist/starter/vite.config.ts +38 -37
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Button } from '@/components/ui/Button';
|
|
2
3
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
Drawer,
|
|
5
|
+
DrawerClose,
|
|
6
|
+
DrawerContent,
|
|
7
|
+
DrawerDescription,
|
|
8
|
+
DrawerFooter,
|
|
9
|
+
DrawerHeader,
|
|
10
|
+
DrawerTitle,
|
|
11
|
+
DrawerTrigger,
|
|
11
12
|
} from '@/components/ui/Drawer';
|
|
12
|
-
import { Button } from '@/components/ui/Button';
|
|
13
13
|
|
|
14
14
|
const meta: Meta<typeof Drawer> = {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
title: 'UI Components/Drawer',
|
|
16
|
+
component: Drawer,
|
|
17
17
|
};
|
|
18
18
|
export default meta;
|
|
19
19
|
type Story = StoryObj<typeof Drawer>;
|
|
20
20
|
|
|
21
21
|
/** Shows a bottom drawer with a title, description, body content, and action buttons. */
|
|
22
22
|
export const Default: Story = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
23
|
+
render: () => (
|
|
24
|
+
<Drawer>
|
|
25
|
+
<DrawerTrigger asChild>
|
|
26
|
+
<Button variant="outline">Open Drawer</Button>
|
|
27
|
+
</DrawerTrigger>
|
|
28
|
+
<DrawerContent>
|
|
29
|
+
<DrawerHeader>
|
|
30
|
+
<DrawerTitle>Move Goal</DrawerTitle>
|
|
31
|
+
<DrawerDescription>Set your daily activity goal.</DrawerDescription>
|
|
32
|
+
</DrawerHeader>
|
|
33
|
+
<div className="p-4">
|
|
34
|
+
<p className="text-muted-foreground text-sm">Adjust the settings below to configure your preferences.</p>
|
|
35
|
+
</div>
|
|
36
|
+
<DrawerFooter>
|
|
37
|
+
<Button>Submit</Button>
|
|
38
|
+
<DrawerClose asChild>
|
|
39
|
+
<Button variant="outline">Cancel</Button>
|
|
40
|
+
</DrawerClose>
|
|
41
|
+
</DrawerFooter>
|
|
42
|
+
</DrawerContent>
|
|
43
|
+
</Drawer>
|
|
44
|
+
),
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
/** Shows a drawer sliding in from the right side, useful for side panels and detail views. */
|
|
48
48
|
export const RightSide: Story = {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
49
|
+
render: () => (
|
|
50
|
+
<Drawer direction="right">
|
|
51
|
+
<DrawerTrigger asChild>
|
|
52
|
+
<Button variant="outline">Open Right Drawer</Button>
|
|
53
|
+
</DrawerTrigger>
|
|
54
|
+
<DrawerContent>
|
|
55
|
+
<DrawerHeader>
|
|
56
|
+
<DrawerTitle>Side Panel</DrawerTitle>
|
|
57
|
+
<DrawerDescription>This drawer opens from the right side.</DrawerDescription>
|
|
58
|
+
</DrawerHeader>
|
|
59
|
+
<div className="p-4">
|
|
60
|
+
<p className="text-muted-foreground text-sm">Content goes here.</p>
|
|
61
|
+
</div>
|
|
62
|
+
<DrawerFooter>
|
|
63
|
+
<DrawerClose asChild>
|
|
64
|
+
<Button variant="outline">Close</Button>
|
|
65
|
+
</DrawerClose>
|
|
66
|
+
</DrawerFooter>
|
|
67
|
+
</DrawerContent>
|
|
68
|
+
</Drawer>
|
|
69
|
+
),
|
|
70
70
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
1
|
+
import type * as React from 'react';
|
|
2
2
|
import { Drawer as DrawerPrimitive } from 'vaul';
|
|
3
3
|
|
|
4
4
|
import { cn } from '@/lib/utils';
|
|
@@ -10,36 +10,36 @@ import { cn } from '@/lib/utils';
|
|
|
10
10
|
* Compose with DrawerTrigger, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, and DrawerFooter.
|
|
11
11
|
*/
|
|
12
12
|
function Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) {
|
|
13
|
-
|
|
13
|
+
return <DrawerPrimitive.Root data-slot="drawer" {...props} />;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/** Button or element that opens the drawer when clicked. */
|
|
17
17
|
function DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {
|
|
18
|
-
|
|
18
|
+
return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/** Renders drawer content into a React portal. */
|
|
22
22
|
function DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {
|
|
23
|
-
|
|
23
|
+
return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/** Programmatic close trigger for the drawer. */
|
|
27
27
|
function DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>) {
|
|
28
|
-
|
|
28
|
+
return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/** Semi-transparent backdrop behind the drawer that dims the page content. */
|
|
32
32
|
function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
return (
|
|
34
|
+
<DrawerPrimitive.Overlay
|
|
35
|
+
data-slot="drawer-overlay"
|
|
36
|
+
className={cn(
|
|
37
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
|
|
38
|
+
className,
|
|
39
|
+
)}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/**
|
|
@@ -47,78 +47,78 @@ function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof Draw
|
|
|
47
47
|
* Automatically shows a drag handle for bottom drawers.
|
|
48
48
|
*/
|
|
49
49
|
function DrawerContent({ className, children, ...props }: React.ComponentProps<typeof DrawerPrimitive.Content>) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
50
|
+
return (
|
|
51
|
+
<DrawerPortal data-slot="drawer-portal">
|
|
52
|
+
<DrawerOverlay />
|
|
53
|
+
<DrawerPrimitive.Content
|
|
54
|
+
data-slot="drawer-content"
|
|
55
|
+
className={cn(
|
|
56
|
+
'group/drawer-content bg-background fixed z-50 flex h-auto flex-col',
|
|
57
|
+
'data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b',
|
|
58
|
+
'data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t',
|
|
59
|
+
'data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm',
|
|
60
|
+
'data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm',
|
|
61
|
+
className,
|
|
62
|
+
)}
|
|
63
|
+
{...props}
|
|
64
|
+
>
|
|
65
|
+
<div className="bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" />
|
|
66
|
+
{children}
|
|
67
|
+
</DrawerPrimitive.Content>
|
|
68
|
+
</DrawerPortal>
|
|
69
|
+
);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
/** Container for DrawerTitle and DrawerDescription at the top of the drawer. */
|
|
73
73
|
function DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
74
|
+
return (
|
|
75
|
+
<div
|
|
76
|
+
data-slot="drawer-header"
|
|
77
|
+
className={cn(
|
|
78
|
+
'flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left',
|
|
79
|
+
className,
|
|
80
|
+
)}
|
|
81
|
+
{...props}
|
|
82
|
+
/>
|
|
83
|
+
);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/** Container for action buttons at the bottom of the drawer. */
|
|
87
87
|
function DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
88
|
-
|
|
88
|
+
return <div data-slot="drawer-footer" className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
/** Accessible title for the drawer. */
|
|
92
92
|
function DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
return (
|
|
94
|
+
<DrawerPrimitive.Title
|
|
95
|
+
data-slot="drawer-title"
|
|
96
|
+
className={cn('text-foreground font-semibold', className)}
|
|
97
|
+
{...props}
|
|
98
|
+
/>
|
|
99
|
+
);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
/** Accessible description text for the drawer, displayed below the title. */
|
|
103
103
|
function DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
104
|
+
return (
|
|
105
|
+
<DrawerPrimitive.Description
|
|
106
|
+
data-slot="drawer-description"
|
|
107
|
+
className={cn('text-muted-foreground text-sm', className)}
|
|
108
|
+
{...props}
|
|
109
|
+
/>
|
|
110
|
+
);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
114
|
+
Drawer,
|
|
115
|
+
DrawerPortal,
|
|
116
|
+
DrawerOverlay,
|
|
117
|
+
DrawerTrigger,
|
|
118
|
+
DrawerClose,
|
|
119
|
+
DrawerContent,
|
|
120
|
+
DrawerHeader,
|
|
121
|
+
DrawerFooter,
|
|
122
|
+
DrawerTitle,
|
|
123
|
+
DrawerDescription,
|
|
124
124
|
};
|
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { CreditCardIcon, LogOutIcon, SettingsIcon, UserIcon } from 'lucide-react';
|
|
3
|
+
import { Button } from '@/components/ui/Button';
|
|
2
4
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
DropdownMenu,
|
|
6
|
+
DropdownMenuContent,
|
|
7
|
+
DropdownMenuGroup,
|
|
8
|
+
DropdownMenuItem,
|
|
9
|
+
DropdownMenuLabel,
|
|
10
|
+
DropdownMenuSeparator,
|
|
11
|
+
DropdownMenuShortcut,
|
|
12
|
+
DropdownMenuTrigger,
|
|
11
13
|
} from '@/components/ui/DropdownMenu';
|
|
12
|
-
import { Button } from '@/components/ui/Button';
|
|
13
|
-
import { UserIcon, SettingsIcon, LogOutIcon, CreditCardIcon } from 'lucide-react';
|
|
14
14
|
|
|
15
15
|
const meta: Meta<typeof DropdownMenu> = {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
title: 'UI Components/DropdownMenu',
|
|
17
|
+
component: DropdownMenu,
|
|
18
18
|
};
|
|
19
19
|
export default meta;
|
|
20
20
|
type Story = StoryObj<typeof DropdownMenu>;
|
|
21
21
|
|
|
22
22
|
/** Shows a dropdown menu with grouped items, icons, keyboard shortcuts, and a destructive logout action. */
|
|
23
23
|
export const Default: Story = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
24
|
+
render: () => (
|
|
25
|
+
<DropdownMenu>
|
|
26
|
+
<DropdownMenuTrigger asChild>
|
|
27
|
+
<Button variant="outline">Open Menu</Button>
|
|
28
|
+
</DropdownMenuTrigger>
|
|
29
|
+
<DropdownMenuContent className="w-56">
|
|
30
|
+
<DropdownMenuLabel>My Account</DropdownMenuLabel>
|
|
31
|
+
<DropdownMenuSeparator />
|
|
32
|
+
<DropdownMenuGroup>
|
|
33
|
+
<DropdownMenuItem>
|
|
34
|
+
<UserIcon />
|
|
35
|
+
<span>Profile</span>
|
|
36
|
+
<DropdownMenuShortcut>Ctrl+P</DropdownMenuShortcut>
|
|
37
|
+
</DropdownMenuItem>
|
|
38
|
+
<DropdownMenuItem>
|
|
39
|
+
<CreditCardIcon />
|
|
40
|
+
<span>Billing</span>
|
|
41
|
+
<DropdownMenuShortcut>Ctrl+B</DropdownMenuShortcut>
|
|
42
|
+
</DropdownMenuItem>
|
|
43
|
+
<DropdownMenuItem>
|
|
44
|
+
<SettingsIcon />
|
|
45
|
+
<span>Settings</span>
|
|
46
|
+
<DropdownMenuShortcut>Ctrl+S</DropdownMenuShortcut>
|
|
47
|
+
</DropdownMenuItem>
|
|
48
|
+
</DropdownMenuGroup>
|
|
49
|
+
<DropdownMenuSeparator />
|
|
50
|
+
<DropdownMenuItem variant="destructive">
|
|
51
|
+
<LogOutIcon />
|
|
52
|
+
<span>Log out</span>
|
|
53
|
+
</DropdownMenuItem>
|
|
54
|
+
</DropdownMenuContent>
|
|
55
|
+
</DropdownMenu>
|
|
56
|
+
),
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
/** Shows a minimal dropdown menu with basic edit/duplicate/delete actions. */
|
|
60
60
|
export const Simple: Story = {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
61
|
+
render: () => (
|
|
62
|
+
<DropdownMenu>
|
|
63
|
+
<DropdownMenuTrigger asChild>
|
|
64
|
+
<Button variant="outline">Actions</Button>
|
|
65
|
+
</DropdownMenuTrigger>
|
|
66
|
+
<DropdownMenuContent>
|
|
67
|
+
<DropdownMenuItem>Edit</DropdownMenuItem>
|
|
68
|
+
<DropdownMenuItem>Duplicate</DropdownMenuItem>
|
|
69
|
+
<DropdownMenuSeparator />
|
|
70
|
+
<DropdownMenuItem variant="destructive">Delete</DropdownMenuItem>
|
|
71
|
+
</DropdownMenuContent>
|
|
72
|
+
</DropdownMenu>
|
|
73
|
+
),
|
|
74
74
|
};
|