@mzc-fe/design-system 0.0.1 → 0.0.2-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion.d.ts +7 -0
- package/dist/components/alert-dialog.d.ts +14 -0
- package/dist/components/alert.d.ts +9 -0
- package/dist/components/aspect-ratio.d.ts +3 -0
- package/dist/components/avatar.d.ts +6 -0
- package/dist/components/badge.d.ts +9 -0
- package/dist/components/breadcrumb.d.ts +11 -0
- package/dist/components/button-group.d.ts +11 -0
- package/dist/components/button.d.ts +10 -0
- package/dist/components/calendar.d.ts +8 -0
- package/dist/components/card.d.ts +9 -0
- package/dist/components/carousel.d.ts +19 -0
- package/dist/components/chart.d.ts +40 -0
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/collapsible.d.ts +5 -0
- package/dist/components/command.d.ts +18 -0
- package/dist/components/context-menu.d.ts +25 -0
- package/dist/components/dialog.d.ts +15 -0
- package/dist/components/drawer.d.ts +13 -0
- package/dist/components/dropdown-menu.d.ts +25 -0
- package/dist/components/empty.d.ts +11 -0
- package/dist/components/field.d.ts +24 -0
- package/dist/components/form.d.ts +24 -0
- package/dist/components/hover-card.d.ts +6 -0
- package/dist/components/input-group.d.ts +16 -0
- package/dist/components/input-otp.d.ts +11 -0
- package/dist/components/input.d.ts +3 -0
- package/dist/components/item.d.ts +23 -0
- package/dist/components/kbd.d.ts +3 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/menubar.d.ts +26 -0
- package/dist/components/navigation-menu.d.ts +14 -0
- package/dist/components/pagination.d.ts +13 -0
- package/dist/components/popover.d.ts +7 -0
- package/dist/components/progress.d.ts +4 -0
- package/dist/components/radio-group.d.ts +5 -0
- package/dist/components/resizable.d.ts +8 -0
- package/dist/components/scroll-area.d.ts +5 -0
- package/dist/components/select.d.ts +15 -0
- package/dist/components/separator.d.ts +4 -0
- package/dist/components/sheet.d.ts +13 -0
- package/dist/components/sidebar.d.ts +69 -0
- package/dist/components/skeleton.d.ts +2 -0
- package/dist/components/slider.d.ts +4 -0
- package/dist/components/sonner.d.ts +3 -0
- package/dist/components/spinner.d.ts +2 -0
- package/dist/components/switch.d.ts +4 -0
- package/dist/components/table.d.ts +10 -0
- package/dist/components/tabs.d.ts +7 -0
- package/dist/components/textarea.d.ts +3 -0
- package/dist/components/toggle-group.d.ts +9 -0
- package/dist/components/toggle.d.ts +9 -0
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/design-system.css +1 -0
- package/dist/design-system.es.js +30200 -0
- package/dist/design-system.umd.js +260 -0
- package/dist/foundations/ThemeProvider.d.ts +13 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/index.d.ts +54 -0
- package/dist/lib/utils.d.ts +2 -0
- package/package.json +14 -1
- package/.husky/pre-push +0 -21
- package/.storybook/main.ts +0 -11
- package/.storybook/preview.tsx +0 -30
- package/.vscode/settings.json +0 -12
- package/.vscode/tailwind.json +0 -105
- package/bitbucket-pipelines.yml +0 -50
- package/components.json +0 -21
- package/eslint.config.js +0 -38
- package/src/components/accordion.stories.tsx +0 -258
- package/src/components/accordion.test.tsx +0 -390
- package/src/components/accordion.tsx +0 -64
- package/src/components/alert-dialog.stories.tsx +0 -213
- package/src/components/alert-dialog.test.tsx +0 -80
- package/src/components/alert-dialog.tsx +0 -155
- package/src/components/alert.stories.tsx +0 -84
- package/src/components/alert.test.tsx +0 -35
- package/src/components/alert.tsx +0 -66
- package/src/components/aspect-ratio.stories.tsx +0 -97
- package/src/components/aspect-ratio.test.tsx +0 -47
- package/src/components/aspect-ratio.tsx +0 -11
- package/src/components/avatar.stories.tsx +0 -76
- package/src/components/avatar.test.tsx +0 -50
- package/src/components/avatar.tsx +0 -51
- package/src/components/badge.stories.tsx +0 -64
- package/src/components/badge.test.tsx +0 -34
- package/src/components/badge.tsx +0 -46
- package/src/components/breadcrumb.stories.tsx +0 -86
- package/src/components/breadcrumb.test.tsx +0 -74
- package/src/components/breadcrumb.tsx +0 -109
- package/src/components/button-group.stories.tsx +0 -62
- package/src/components/button-group.tsx +0 -83
- package/src/components/button.stories.tsx +0 -118
- package/src/components/button.test.tsx +0 -64
- package/src/components/button.tsx +0 -62
- package/src/components/calendar.stories.tsx +0 -81
- package/src/components/calendar.tsx +0 -220
- package/src/components/card.stories.tsx +0 -110
- package/src/components/card.test.tsx +0 -56
- package/src/components/card.tsx +0 -92
- package/src/components/carousel.stories.tsx +0 -90
- package/src/components/carousel.tsx +0 -239
- package/src/components/chart.tsx +0 -357
- package/src/components/checkbox.stories.tsx +0 -108
- package/src/components/checkbox.test.tsx +0 -67
- package/src/components/checkbox.tsx +0 -32
- package/src/components/collapsible.stories.tsx +0 -106
- package/src/components/collapsible.test.tsx +0 -92
- package/src/components/collapsible.tsx +0 -31
- package/src/components/command.stories.tsx +0 -90
- package/src/components/command.tsx +0 -182
- package/src/components/context-menu.stories.tsx +0 -63
- package/src/components/context-menu.tsx +0 -252
- package/src/components/dialog.stories.tsx +0 -128
- package/src/components/dialog.tsx +0 -141
- package/src/components/drawer.stories.tsx +0 -104
- package/src/components/drawer.tsx +0 -135
- package/src/components/dropdown-menu.stories.tsx +0 -97
- package/src/components/dropdown-menu.tsx +0 -255
- package/src/components/empty.stories.tsx +0 -90
- package/src/components/empty.test.tsx +0 -55
- package/src/components/empty.tsx +0 -104
- package/src/components/field.tsx +0 -246
- package/src/components/form.tsx +0 -168
- package/src/components/hover-card.stories.tsx +0 -66
- package/src/components/hover-card.tsx +0 -44
- package/src/components/input-group.stories.tsx +0 -57
- package/src/components/input-group.test.tsx +0 -40
- package/src/components/input-group.tsx +0 -170
- package/src/components/input-otp.stories.tsx +0 -94
- package/src/components/input-otp.test.tsx +0 -60
- package/src/components/input-otp.tsx +0 -75
- package/src/components/input.stories.tsx +0 -94
- package/src/components/input.test.tsx +0 -53
- package/src/components/input.tsx +0 -21
- package/src/components/item.tsx +0 -193
- package/src/components/kbd.stories.tsx +0 -100
- package/src/components/kbd.test.tsx +0 -28
- package/src/components/kbd.tsx +0 -28
- package/src/components/label.stories.tsx +0 -48
- package/src/components/label.test.tsx +0 -28
- package/src/components/label.tsx +0 -24
- package/src/components/menubar.tsx +0 -274
- package/src/components/navigation-menu.tsx +0 -168
- package/src/components/pagination.stories.tsx +0 -107
- package/src/components/pagination.tsx +0 -127
- package/src/components/popover.stories.tsx +0 -102
- package/src/components/popover.tsx +0 -48
- package/src/components/progress.stories.tsx +0 -76
- package/src/components/progress.test.tsx +0 -36
- package/src/components/progress.tsx +0 -29
- package/src/components/radio-group.stories.tsx +0 -73
- package/src/components/radio-group.test.tsx +0 -74
- package/src/components/radio-group.tsx +0 -45
- package/src/components/resizable.stories.tsx +0 -120
- package/src/components/resizable.tsx +0 -54
- package/src/components/scroll-area.stories.tsx +0 -64
- package/src/components/scroll-area.test.tsx +0 -46
- package/src/components/scroll-area.tsx +0 -58
- package/src/components/select.stories.tsx +0 -111
- package/src/components/select.test.tsx +0 -90
- package/src/components/select.tsx +0 -188
- package/src/components/separator.stories.tsx +0 -76
- package/src/components/separator.test.tsx +0 -24
- package/src/components/separator.tsx +0 -28
- package/src/components/sheet.stories.tsx +0 -122
- package/src/components/sheet.tsx +0 -137
- package/src/components/sidebar.tsx +0 -726
- package/src/components/skeleton.stories.tsx +0 -53
- package/src/components/skeleton.test.tsx +0 -24
- package/src/components/skeleton.tsx +0 -13
- package/src/components/slider.stories.tsx +0 -97
- package/src/components/slider.test.tsx +0 -49
- package/src/components/slider.tsx +0 -63
- package/src/components/sonner.stories.tsx +0 -96
- package/src/components/sonner.tsx +0 -38
- package/src/components/spinner.stories.tsx +0 -54
- package/src/components/spinner.test.tsx +0 -30
- package/src/components/spinner.tsx +0 -16
- package/src/components/switch.stories.tsx +0 -108
- package/src/components/switch.test.tsx +0 -62
- package/src/components/switch.tsx +0 -31
- package/src/components/table.stories.tsx +0 -139
- package/src/components/table.test.tsx +0 -85
- package/src/components/table.tsx +0 -114
- package/src/components/tabs.stories.tsx +0 -99
- package/src/components/tabs.test.tsx +0 -64
- package/src/components/tabs.tsx +0 -66
- package/src/components/textarea.stories.tsx +0 -89
- package/src/components/textarea.test.tsx +0 -53
- package/src/components/textarea.tsx +0 -18
- package/src/components/toggle-group.stories.tsx +0 -108
- package/src/components/toggle-group.test.tsx +0 -66
- package/src/components/toggle-group.tsx +0 -81
- package/src/components/toggle.stories.tsx +0 -98
- package/src/components/toggle.test.tsx +0 -42
- package/src/components/toggle.tsx +0 -45
- package/src/components/tooltip.stories.tsx +0 -111
- package/src/components/tooltip.tsx +0 -61
- package/src/foundations/README.md +0 -141
- package/src/foundations/ThemeProvider.tsx +0 -77
- package/src/foundations/color.css +0 -232
- package/src/foundations/color.stories.tsx +0 -719
- package/src/foundations/palette.css +0 -249
- package/src/foundations/spacing.css +0 -8
- package/src/foundations/typography.css +0 -143
- package/src/foundations/typography.stories.tsx +0 -17
- package/src/hooks/use-mobile.ts +0 -19
- package/src/index.css +0 -176
- package/src/index.ts +0 -336
- package/src/lib/utils.ts +0 -6
- package/src/test/setup.ts +0 -8
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.app.json +0 -33
- package/tsconfig.json +0 -13
- package/tsconfig.node.json +0 -25
- package/vite.config.ts +0 -30
- package/vitest.config.ts +0 -25
- /package/{public → dist}/vite.svg +0 -0
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu"
|
|
5
|
-
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
|
|
9
|
-
function ContextMenu({
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {
|
|
12
|
-
return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function ContextMenuTrigger({
|
|
16
|
-
...props
|
|
17
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {
|
|
18
|
-
return (
|
|
19
|
-
<ContextMenuPrimitive.Trigger data-slot="context-menu-trigger" {...props} />
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function ContextMenuGroup({
|
|
24
|
-
...props
|
|
25
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {
|
|
26
|
-
return (
|
|
27
|
-
<ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function ContextMenuPortal({
|
|
32
|
-
...props
|
|
33
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {
|
|
34
|
-
return (
|
|
35
|
-
<ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function ContextMenuSub({
|
|
40
|
-
...props
|
|
41
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {
|
|
42
|
-
return <ContextMenuPrimitive.Sub data-slot="context-menu-sub" {...props} />
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function ContextMenuRadioGroup({
|
|
46
|
-
...props
|
|
47
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {
|
|
48
|
-
return (
|
|
49
|
-
<ContextMenuPrimitive.RadioGroup
|
|
50
|
-
data-slot="context-menu-radio-group"
|
|
51
|
-
{...props}
|
|
52
|
-
/>
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function ContextMenuSubTrigger({
|
|
57
|
-
className,
|
|
58
|
-
inset,
|
|
59
|
-
children,
|
|
60
|
-
...props
|
|
61
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
62
|
-
inset?: boolean
|
|
63
|
-
}) {
|
|
64
|
-
return (
|
|
65
|
-
<ContextMenuPrimitive.SubTrigger
|
|
66
|
-
data-slot="context-menu-sub-trigger"
|
|
67
|
-
data-inset={inset}
|
|
68
|
-
className={cn(
|
|
69
|
-
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
70
|
-
className
|
|
71
|
-
)}
|
|
72
|
-
{...props}
|
|
73
|
-
>
|
|
74
|
-
{children}
|
|
75
|
-
<ChevronRightIcon className="ml-auto" />
|
|
76
|
-
</ContextMenuPrimitive.SubTrigger>
|
|
77
|
-
)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function ContextMenuSubContent({
|
|
81
|
-
className,
|
|
82
|
-
...props
|
|
83
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {
|
|
84
|
-
return (
|
|
85
|
-
<ContextMenuPrimitive.SubContent
|
|
86
|
-
data-slot="context-menu-sub-content"
|
|
87
|
-
className={cn(
|
|
88
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
|
|
89
|
-
className
|
|
90
|
-
)}
|
|
91
|
-
{...props}
|
|
92
|
-
/>
|
|
93
|
-
)
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function ContextMenuContent({
|
|
97
|
-
className,
|
|
98
|
-
...props
|
|
99
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {
|
|
100
|
-
return (
|
|
101
|
-
<ContextMenuPrimitive.Portal>
|
|
102
|
-
<ContextMenuPrimitive.Content
|
|
103
|
-
data-slot="context-menu-content"
|
|
104
|
-
className={cn(
|
|
105
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
106
|
-
className
|
|
107
|
-
)}
|
|
108
|
-
{...props}
|
|
109
|
-
/>
|
|
110
|
-
</ContextMenuPrimitive.Portal>
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function ContextMenuItem({
|
|
115
|
-
className,
|
|
116
|
-
inset,
|
|
117
|
-
variant = "default",
|
|
118
|
-
...props
|
|
119
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
|
|
120
|
-
inset?: boolean
|
|
121
|
-
variant?: "default" | "destructive"
|
|
122
|
-
}) {
|
|
123
|
-
return (
|
|
124
|
-
<ContextMenuPrimitive.Item
|
|
125
|
-
data-slot="context-menu-item"
|
|
126
|
-
data-inset={inset}
|
|
127
|
-
data-variant={variant}
|
|
128
|
-
className={cn(
|
|
129
|
-
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
130
|
-
className
|
|
131
|
-
)}
|
|
132
|
-
{...props}
|
|
133
|
-
/>
|
|
134
|
-
)
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function ContextMenuCheckboxItem({
|
|
138
|
-
className,
|
|
139
|
-
children,
|
|
140
|
-
checked,
|
|
141
|
-
...props
|
|
142
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {
|
|
143
|
-
return (
|
|
144
|
-
<ContextMenuPrimitive.CheckboxItem
|
|
145
|
-
data-slot="context-menu-checkbox-item"
|
|
146
|
-
className={cn(
|
|
147
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
148
|
-
className
|
|
149
|
-
)}
|
|
150
|
-
checked={checked}
|
|
151
|
-
{...props}
|
|
152
|
-
>
|
|
153
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
154
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
155
|
-
<CheckIcon className="size-4" />
|
|
156
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
157
|
-
</span>
|
|
158
|
-
{children}
|
|
159
|
-
</ContextMenuPrimitive.CheckboxItem>
|
|
160
|
-
)
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function ContextMenuRadioItem({
|
|
164
|
-
className,
|
|
165
|
-
children,
|
|
166
|
-
...props
|
|
167
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {
|
|
168
|
-
return (
|
|
169
|
-
<ContextMenuPrimitive.RadioItem
|
|
170
|
-
data-slot="context-menu-radio-item"
|
|
171
|
-
className={cn(
|
|
172
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
173
|
-
className
|
|
174
|
-
)}
|
|
175
|
-
{...props}
|
|
176
|
-
>
|
|
177
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
178
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
179
|
-
<CircleIcon className="size-2 fill-current" />
|
|
180
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
181
|
-
</span>
|
|
182
|
-
{children}
|
|
183
|
-
</ContextMenuPrimitive.RadioItem>
|
|
184
|
-
)
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
function ContextMenuLabel({
|
|
188
|
-
className,
|
|
189
|
-
inset,
|
|
190
|
-
...props
|
|
191
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
|
|
192
|
-
inset?: boolean
|
|
193
|
-
}) {
|
|
194
|
-
return (
|
|
195
|
-
<ContextMenuPrimitive.Label
|
|
196
|
-
data-slot="context-menu-label"
|
|
197
|
-
data-inset={inset}
|
|
198
|
-
className={cn(
|
|
199
|
-
"text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
200
|
-
className
|
|
201
|
-
)}
|
|
202
|
-
{...props}
|
|
203
|
-
/>
|
|
204
|
-
)
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
function ContextMenuSeparator({
|
|
208
|
-
className,
|
|
209
|
-
...props
|
|
210
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {
|
|
211
|
-
return (
|
|
212
|
-
<ContextMenuPrimitive.Separator
|
|
213
|
-
data-slot="context-menu-separator"
|
|
214
|
-
className={cn("bg-border -mx-1 my-1 h-px", className)}
|
|
215
|
-
{...props}
|
|
216
|
-
/>
|
|
217
|
-
)
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
function ContextMenuShortcut({
|
|
221
|
-
className,
|
|
222
|
-
...props
|
|
223
|
-
}: React.ComponentProps<"span">) {
|
|
224
|
-
return (
|
|
225
|
-
<span
|
|
226
|
-
data-slot="context-menu-shortcut"
|
|
227
|
-
className={cn(
|
|
228
|
-
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
229
|
-
className
|
|
230
|
-
)}
|
|
231
|
-
{...props}
|
|
232
|
-
/>
|
|
233
|
-
)
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
export {
|
|
237
|
-
ContextMenu,
|
|
238
|
-
ContextMenuTrigger,
|
|
239
|
-
ContextMenuContent,
|
|
240
|
-
ContextMenuItem,
|
|
241
|
-
ContextMenuCheckboxItem,
|
|
242
|
-
ContextMenuRadioItem,
|
|
243
|
-
ContextMenuLabel,
|
|
244
|
-
ContextMenuSeparator,
|
|
245
|
-
ContextMenuShortcut,
|
|
246
|
-
ContextMenuGroup,
|
|
247
|
-
ContextMenuPortal,
|
|
248
|
-
ContextMenuSub,
|
|
249
|
-
ContextMenuSubContent,
|
|
250
|
-
ContextMenuSubTrigger,
|
|
251
|
-
ContextMenuRadioGroup,
|
|
252
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import {
|
|
4
|
-
Dialog,
|
|
5
|
-
DialogContent,
|
|
6
|
-
DialogDescription,
|
|
7
|
-
DialogFooter,
|
|
8
|
-
DialogHeader,
|
|
9
|
-
DialogTitle,
|
|
10
|
-
DialogTrigger,
|
|
11
|
-
} from "./dialog";
|
|
12
|
-
import { Button } from "./button";
|
|
13
|
-
|
|
14
|
-
const meta = {
|
|
15
|
-
title: "Components/Dialog",
|
|
16
|
-
component: Dialog,
|
|
17
|
-
parameters: {
|
|
18
|
-
layout: "padded",
|
|
19
|
-
},
|
|
20
|
-
tags: ["autodocs"],
|
|
21
|
-
} satisfies Meta<typeof Dialog>;
|
|
22
|
-
|
|
23
|
-
export default meta;
|
|
24
|
-
type Story = StoryObj<typeof meta>;
|
|
25
|
-
|
|
26
|
-
export const Default: Story = {
|
|
27
|
-
render: () => {
|
|
28
|
-
const [open, setOpen] = useState(false);
|
|
29
|
-
return (
|
|
30
|
-
<Dialog open={open} onOpenChange={setOpen}>
|
|
31
|
-
<DialogTrigger asChild>
|
|
32
|
-
<Button>Open Dialog</Button>
|
|
33
|
-
</DialogTrigger>
|
|
34
|
-
<DialogContent>
|
|
35
|
-
<DialogHeader>
|
|
36
|
-
<DialogTitle>Are you absolutely sure?</DialogTitle>
|
|
37
|
-
<DialogDescription>
|
|
38
|
-
This action cannot be undone. This will permanently delete your
|
|
39
|
-
account and remove your data from our servers.
|
|
40
|
-
</DialogDescription>
|
|
41
|
-
</DialogHeader>
|
|
42
|
-
<DialogFooter>
|
|
43
|
-
<Button variant="outline" onClick={() => setOpen(false)}>
|
|
44
|
-
Cancel
|
|
45
|
-
</Button>
|
|
46
|
-
<Button onClick={() => setOpen(false)}>Continue</Button>
|
|
47
|
-
</DialogFooter>
|
|
48
|
-
</DialogContent>
|
|
49
|
-
</Dialog>
|
|
50
|
-
);
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const Simple: Story = {
|
|
55
|
-
render: () => {
|
|
56
|
-
const [open, setOpen] = useState(false);
|
|
57
|
-
return (
|
|
58
|
-
<Dialog open={open} onOpenChange={setOpen}>
|
|
59
|
-
<DialogTrigger asChild>
|
|
60
|
-
<Button variant="outline">Show Dialog</Button>
|
|
61
|
-
</DialogTrigger>
|
|
62
|
-
<DialogContent>
|
|
63
|
-
<DialogHeader>
|
|
64
|
-
<DialogTitle>Simple Dialog</DialogTitle>
|
|
65
|
-
<DialogDescription>
|
|
66
|
-
This is a simple dialog with minimal content.
|
|
67
|
-
</DialogDescription>
|
|
68
|
-
</DialogHeader>
|
|
69
|
-
</DialogContent>
|
|
70
|
-
</Dialog>
|
|
71
|
-
);
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export const LongContent: Story = {
|
|
76
|
-
render: () => {
|
|
77
|
-
const [open, setOpen] = useState(false);
|
|
78
|
-
return (
|
|
79
|
-
<Dialog open={open} onOpenChange={setOpen}>
|
|
80
|
-
<DialogTrigger asChild>
|
|
81
|
-
<Button>View Terms</Button>
|
|
82
|
-
</DialogTrigger>
|
|
83
|
-
<DialogContent className="max-h-[80vh] overflow-y-auto">
|
|
84
|
-
<DialogHeader>
|
|
85
|
-
<DialogTitle>Terms and Conditions</DialogTitle>
|
|
86
|
-
<DialogDescription>
|
|
87
|
-
<div className="space-y-4 mt-4">
|
|
88
|
-
<p>
|
|
89
|
-
Please read these terms and conditions carefully before using
|
|
90
|
-
our service.
|
|
91
|
-
</p>
|
|
92
|
-
<p>
|
|
93
|
-
<strong>1. Acceptance of Terms</strong>
|
|
94
|
-
</p>
|
|
95
|
-
<p>
|
|
96
|
-
By accessing and using this service, you accept and agree to
|
|
97
|
-
be bound by the terms and provision of this agreement.
|
|
98
|
-
</p>
|
|
99
|
-
<p>
|
|
100
|
-
<strong>2. Use License</strong>
|
|
101
|
-
</p>
|
|
102
|
-
<p>
|
|
103
|
-
Permission is granted to temporarily download one copy of the
|
|
104
|
-
materials on our website for personal, non-commercial
|
|
105
|
-
transitory viewing only.
|
|
106
|
-
</p>
|
|
107
|
-
<p>
|
|
108
|
-
<strong>3. Disclaimer</strong>
|
|
109
|
-
</p>
|
|
110
|
-
<p>
|
|
111
|
-
The materials on our website are provided on an 'as is' basis.
|
|
112
|
-
We make no warranties, expressed or implied.
|
|
113
|
-
</p>
|
|
114
|
-
</div>
|
|
115
|
-
</DialogDescription>
|
|
116
|
-
</DialogHeader>
|
|
117
|
-
<DialogFooter>
|
|
118
|
-
<Button variant="outline" onClick={() => setOpen(false)}>
|
|
119
|
-
Decline
|
|
120
|
-
</Button>
|
|
121
|
-
<Button onClick={() => setOpen(false)}>Accept</Button>
|
|
122
|
-
</DialogFooter>
|
|
123
|
-
</DialogContent>
|
|
124
|
-
</Dialog>
|
|
125
|
-
);
|
|
126
|
-
},
|
|
127
|
-
};
|
|
128
|
-
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as DialogPrimitive from "@radix-ui/react-dialog"
|
|
3
|
-
import { XIcon } from "lucide-react"
|
|
4
|
-
|
|
5
|
-
import { cn } from "@/lib/utils"
|
|
6
|
-
|
|
7
|
-
function Dialog({
|
|
8
|
-
...props
|
|
9
|
-
}: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
|
10
|
-
return <DialogPrimitive.Root data-slot="dialog" {...props} />
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function DialogTrigger({
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
|
|
16
|
-
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function DialogPortal({
|
|
20
|
-
...props
|
|
21
|
-
}: React.ComponentProps<typeof DialogPrimitive.Portal>) {
|
|
22
|
-
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function DialogClose({
|
|
26
|
-
...props
|
|
27
|
-
}: React.ComponentProps<typeof DialogPrimitive.Close>) {
|
|
28
|
-
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function DialogOverlay({
|
|
32
|
-
className,
|
|
33
|
-
...props
|
|
34
|
-
}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
|
|
35
|
-
return (
|
|
36
|
-
<DialogPrimitive.Overlay
|
|
37
|
-
data-slot="dialog-overlay"
|
|
38
|
-
className={cn(
|
|
39
|
-
"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",
|
|
40
|
-
className
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function DialogContent({
|
|
48
|
-
className,
|
|
49
|
-
children,
|
|
50
|
-
showCloseButton = true,
|
|
51
|
-
...props
|
|
52
|
-
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
53
|
-
showCloseButton?: boolean
|
|
54
|
-
}) {
|
|
55
|
-
return (
|
|
56
|
-
<DialogPortal data-slot="dialog-portal">
|
|
57
|
-
<DialogOverlay />
|
|
58
|
-
<DialogPrimitive.Content
|
|
59
|
-
data-slot="dialog-content"
|
|
60
|
-
className={cn(
|
|
61
|
-
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",
|
|
62
|
-
className
|
|
63
|
-
)}
|
|
64
|
-
{...props}
|
|
65
|
-
>
|
|
66
|
-
{children}
|
|
67
|
-
{showCloseButton && (
|
|
68
|
-
<DialogPrimitive.Close
|
|
69
|
-
data-slot="dialog-close"
|
|
70
|
-
className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
71
|
-
>
|
|
72
|
-
<XIcon />
|
|
73
|
-
<span className="sr-only">Close</span>
|
|
74
|
-
</DialogPrimitive.Close>
|
|
75
|
-
)}
|
|
76
|
-
</DialogPrimitive.Content>
|
|
77
|
-
</DialogPortal>
|
|
78
|
-
)
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
82
|
-
return (
|
|
83
|
-
<div
|
|
84
|
-
data-slot="dialog-header"
|
|
85
|
-
className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
|
|
86
|
-
{...props}
|
|
87
|
-
/>
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
92
|
-
return (
|
|
93
|
-
<div
|
|
94
|
-
data-slot="dialog-footer"
|
|
95
|
-
className={cn(
|
|
96
|
-
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
97
|
-
className
|
|
98
|
-
)}
|
|
99
|
-
{...props}
|
|
100
|
-
/>
|
|
101
|
-
)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function DialogTitle({
|
|
105
|
-
className,
|
|
106
|
-
...props
|
|
107
|
-
}: React.ComponentProps<typeof DialogPrimitive.Title>) {
|
|
108
|
-
return (
|
|
109
|
-
<DialogPrimitive.Title
|
|
110
|
-
data-slot="dialog-title"
|
|
111
|
-
className={cn("text-lg leading-none font-semibold", className)}
|
|
112
|
-
{...props}
|
|
113
|
-
/>
|
|
114
|
-
)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function DialogDescription({
|
|
118
|
-
className,
|
|
119
|
-
...props
|
|
120
|
-
}: React.ComponentProps<typeof DialogPrimitive.Description>) {
|
|
121
|
-
return (
|
|
122
|
-
<DialogPrimitive.Description
|
|
123
|
-
data-slot="dialog-description"
|
|
124
|
-
className={cn("text-muted-foreground text-sm", className)}
|
|
125
|
-
{...props}
|
|
126
|
-
/>
|
|
127
|
-
)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export {
|
|
131
|
-
Dialog,
|
|
132
|
-
DialogClose,
|
|
133
|
-
DialogContent,
|
|
134
|
-
DialogDescription,
|
|
135
|
-
DialogFooter,
|
|
136
|
-
DialogHeader,
|
|
137
|
-
DialogOverlay,
|
|
138
|
-
DialogPortal,
|
|
139
|
-
DialogTitle,
|
|
140
|
-
DialogTrigger,
|
|
141
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import {
|
|
4
|
-
Drawer,
|
|
5
|
-
DrawerClose,
|
|
6
|
-
DrawerContent,
|
|
7
|
-
DrawerDescription,
|
|
8
|
-
DrawerFooter,
|
|
9
|
-
DrawerHeader,
|
|
10
|
-
DrawerTitle,
|
|
11
|
-
DrawerTrigger,
|
|
12
|
-
} from "./drawer";
|
|
13
|
-
import { Button } from "./button";
|
|
14
|
-
|
|
15
|
-
const meta = {
|
|
16
|
-
title: "Components/Drawer",
|
|
17
|
-
component: Drawer,
|
|
18
|
-
parameters: {
|
|
19
|
-
layout: "padded",
|
|
20
|
-
},
|
|
21
|
-
tags: ["autodocs"],
|
|
22
|
-
} satisfies Meta<typeof Drawer>;
|
|
23
|
-
|
|
24
|
-
export default meta;
|
|
25
|
-
type Story = StoryObj<typeof meta>;
|
|
26
|
-
|
|
27
|
-
export const Default: Story = {
|
|
28
|
-
render: () => {
|
|
29
|
-
const [open, setOpen] = useState(false);
|
|
30
|
-
return (
|
|
31
|
-
<Drawer open={open} onOpenChange={setOpen}>
|
|
32
|
-
<DrawerTrigger asChild>
|
|
33
|
-
<Button>Open Drawer</Button>
|
|
34
|
-
</DrawerTrigger>
|
|
35
|
-
<DrawerContent>
|
|
36
|
-
<DrawerHeader>
|
|
37
|
-
<DrawerTitle>Are you absolutely sure?</DrawerTitle>
|
|
38
|
-
<DrawerDescription>
|
|
39
|
-
This action cannot be undone. This will permanently delete your
|
|
40
|
-
account and remove your data from our servers.
|
|
41
|
-
</DrawerDescription>
|
|
42
|
-
</DrawerHeader>
|
|
43
|
-
<DrawerFooter>
|
|
44
|
-
<Button>Submit</Button>
|
|
45
|
-
<DrawerClose asChild>
|
|
46
|
-
<Button variant="outline">Cancel</Button>
|
|
47
|
-
</DrawerClose>
|
|
48
|
-
</DrawerFooter>
|
|
49
|
-
</DrawerContent>
|
|
50
|
-
</Drawer>
|
|
51
|
-
);
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export const WithForm: Story = {
|
|
56
|
-
render: () => {
|
|
57
|
-
const [open, setOpen] = useState(false);
|
|
58
|
-
return (
|
|
59
|
-
<Drawer open={open} onOpenChange={setOpen}>
|
|
60
|
-
<DrawerTrigger asChild>
|
|
61
|
-
<Button variant="outline">Edit Profile</Button>
|
|
62
|
-
</DrawerTrigger>
|
|
63
|
-
<DrawerContent>
|
|
64
|
-
<DrawerHeader>
|
|
65
|
-
<DrawerTitle>Edit Profile</DrawerTitle>
|
|
66
|
-
<DrawerDescription>
|
|
67
|
-
Make changes to your profile here. Click save when you're done.
|
|
68
|
-
</DrawerDescription>
|
|
69
|
-
</DrawerHeader>
|
|
70
|
-
<div className="p-4 space-y-4">
|
|
71
|
-
<div className="space-y-2">
|
|
72
|
-
<label htmlFor="name" className="text-sm font-medium">
|
|
73
|
-
Name
|
|
74
|
-
</label>
|
|
75
|
-
<input
|
|
76
|
-
id="name"
|
|
77
|
-
defaultValue="John Doe"
|
|
78
|
-
className="w-full rounded-md border px-3 py-2 text-sm"
|
|
79
|
-
/>
|
|
80
|
-
</div>
|
|
81
|
-
<div className="space-y-2">
|
|
82
|
-
<label htmlFor="email" className="text-sm font-medium">
|
|
83
|
-
Email
|
|
84
|
-
</label>
|
|
85
|
-
<input
|
|
86
|
-
id="email"
|
|
87
|
-
type="email"
|
|
88
|
-
defaultValue="john@example.com"
|
|
89
|
-
className="w-full rounded-md border px-3 py-2 text-sm"
|
|
90
|
-
/>
|
|
91
|
-
</div>
|
|
92
|
-
</div>
|
|
93
|
-
<DrawerFooter>
|
|
94
|
-
<Button onClick={() => setOpen(false)}>Save</Button>
|
|
95
|
-
<DrawerClose asChild>
|
|
96
|
-
<Button variant="outline">Cancel</Button>
|
|
97
|
-
</DrawerClose>
|
|
98
|
-
</DrawerFooter>
|
|
99
|
-
</DrawerContent>
|
|
100
|
-
</Drawer>
|
|
101
|
-
);
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
|