@catalystsoftware/ui 1.0.5 → 1.0.6
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/data/data.tsx +29 -29
- package/dist/data/tailwind.config.js +3821 -261
- package/dist/data.tsx +29 -29
- package/package.json +4 -3
- package/components/catalyst-ui/buttons/burger.tsx +0 -207
- package/components/catalyst-ui/core/data-display/timeline.tsx +0 -210
- package/components/catalyst-ui/core/feedback/alert.tsx +0 -491
- package/components/catalyst-ui/core/feedback/spinner-1.tsx +0 -65
- package/components/catalyst-ui/core/feedback/toast.tsx +0 -1857
- package/components/catalyst-ui/core/navigation/menu.tsx +0 -164
- package/components/catalyst-ui/forms/toggle-class.tsx +0 -176
- package/components/catalyst-ui/hooks/use-copy-to-clipboard.tsx +0 -419
- package/components/catalyst-ui/hooks/use-counter.tsx +0 -13
- package/components/catalyst-ui/hooks/use-event-listener.tsx +0 -23
- package/components/catalyst-ui/hooks/use-export-markdown.tsx +0 -47
- package/components/catalyst-ui/hooks/use-focus.tsx +0 -17
- package/components/catalyst-ui/hooks/use-interval.tsx +0 -23
- package/components/catalyst-ui/hooks/use-is-client.tsx +0 -16
- package/components/catalyst-ui/hooks/use-media-query.tsx +0 -19
- package/components/catalyst-ui/hooks/use-mobile.tsx +0 -19
- package/components/catalyst-ui/hooks/use-resize-observer.tsx +0 -81
- package/components/catalyst-ui/hooks/use-timeout.tsx +0 -21
- package/components/catalyst-ui/hooks/use-timer.tsx +0 -209
- package/components/catalyst-ui/hooks/use-toggle.tsx +0 -12
- package/components/catalyst-ui/media/image.tsx +0 -13
- package/components/catalyst-ui/overlays/dual-sidebar.tsx +0 -4142
- package/components/catalyst-ui/overlays/sidebar-original.tsx +0 -726
- package/components/catalyst-ui/primitives/accordion.tsx +0 -250
- package/components/catalyst-ui/primitives/alert-dialog.tsx +0 -126
- package/components/catalyst-ui/primitives/aspect-ratio.tsx +0 -9
- package/components/catalyst-ui/primitives/avatar.tsx +0 -296
- package/components/catalyst-ui/primitives/badge.tsx +0 -57
- package/components/catalyst-ui/primitives/breadcrumb.tsx +0 -101
- package/components/catalyst-ui/primitives/button.tsx +0 -265
- package/components/catalyst-ui/primitives/calendar-v4.tsx +0 -208
- package/components/catalyst-ui/primitives/calendar.tsx +0 -295
- package/components/catalyst-ui/primitives/card.tsx +0 -618
- package/components/catalyst-ui/primitives/carousel.tsx +0 -238
- package/components/catalyst-ui/primitives/chart.tsx +0 -347
- package/components/catalyst-ui/primitives/checkbox.tsx +0 -225
- package/components/catalyst-ui/primitives/collapsible.tsx +0 -212
- package/components/catalyst-ui/primitives/command.tsx +0 -393
- package/components/catalyst-ui/primitives/context-menu.tsx +0 -236
- package/components/catalyst-ui/primitives/dialog.tsx +0 -471
- package/components/catalyst-ui/primitives/drawer.tsx +0 -761
- package/components/catalyst-ui/primitives/dropdown-menu.tsx +0 -290
- package/components/catalyst-ui/primitives/empty.tsx +0 -104
- package/components/catalyst-ui/primitives/field.tsx +0 -244
- package/components/catalyst-ui/primitives/hover-card.tsx +0 -124
- package/components/catalyst-ui/primitives/input-otp.tsx +0 -76
- package/components/catalyst-ui/primitives/input.tsx +0 -64
- package/components/catalyst-ui/primitives/item.tsx +0 -196
- package/components/catalyst-ui/primitives/kbd.tsx +0 -75
- package/components/catalyst-ui/primitives/label.tsx +0 -24
- package/components/catalyst-ui/primitives/navigation-menu.tsx +0 -150
- package/components/catalyst-ui/primitives/pagination.tsx +0 -198
- package/components/catalyst-ui/primitives/popover.tsx +0 -232
- package/components/catalyst-ui/primitives/progress.tsx +0 -34
- package/components/catalyst-ui/primitives/radio-group.tsx +0 -43
- package/components/catalyst-ui/primitives/resizable.tsx +0 -56
- package/components/catalyst-ui/primitives/select.tsx +0 -155
- package/components/catalyst-ui/primitives/separator.tsx +0 -74
- package/components/catalyst-ui/primitives/sheet.tsx +0 -126
- package/components/catalyst-ui/primitives/skeleton.tsx +0 -15
- package/components/catalyst-ui/primitives/slider.tsx +0 -27
- package/components/catalyst-ui/primitives/switch.tsx +0 -187
- package/components/catalyst-ui/primitives/tabs.tsx +0 -335
- package/components/catalyst-ui/primitives/textarea.tsx +0 -24
- package/components/catalyst-ui/primitives/toggle-group.tsx +0 -55
- package/components/catalyst-ui/primitives/toggle.tsx +0 -42
- package/components/catalyst-ui/primitives/tooltip.tsx +0 -116
- package/components/catalyst-ui/utils/basic-auth.tsx +0 -40
- package/components/catalyst-ui/utils/context-storage.tsx +0 -19
- package/components/catalyst-ui/utils/cors-middleware.tsx +0 -71
- package/components/catalyst-ui/utils/deferred-content.tsx +0 -595
- package/components/catalyst-ui/utils/honeypot-middleware.tsx +0 -38
- package/components/catalyst-ui/utils/incId.tsx +0 -75
- package/components/catalyst-ui/utils/jwk-auth.tsx +0 -36
- package/components/catalyst-ui/utils/request-id.tsx +0 -14
- package/components/catalyst-ui/utils/secure-headers.tsx +0 -37
- package/components/catalyst-ui/utils/server-timing.tsx +0 -23
- package/components/catalyst-ui/utils/utils.ts +0 -43
- package/components/catalyst-ui/utils/with-cookie.tsx +0 -43
- package/components/catalyst-ui/x/accordian-x.tsx +0 -428
- package/components/catalyst-ui/x/alert-x.tsx +0 -413
- package/components/catalyst-ui/x/animated-text-x.tsx +0 -2242
- package/components/catalyst-ui/x/avatar-x.tsx +0 -515
- package/components/catalyst-ui/x/badge-x.tsx +0 -670
- package/components/catalyst-ui/x/button-X.tsx +0 -2857
- package/components/catalyst-ui/x/button-group-x.tsx +0 -847
- package/components/catalyst-ui/x/calendar-x.tsx +0 -1910
- package/components/catalyst-ui/x/card-x.tsx +0 -2597
- package/components/catalyst-ui/x/checkbox-x.tsx +0 -656
- package/components/catalyst-ui/x/collapsible-x.tsx +0 -1360
- package/components/catalyst-ui/x/combobox-x.tsx +0 -911
- package/components/catalyst-ui/x/data-table-x.tsx +0 -1753
- package/components/catalyst-ui/x/date-picker-x.tsx +0 -648
- package/components/catalyst-ui/x/dialog-x.tsx +0 -659
- package/components/catalyst-ui/x/dropdown-menu-x.tsx +0 -612
- package/components/catalyst-ui/x/hover-card-x.tsx +0 -375
- package/components/catalyst-ui/x/icon-x.tsx +0 -840
- package/components/catalyst-ui/x/input-mask-x.tsx +0 -981
- package/components/catalyst-ui/x/input-otp-x.tsx +0 -659
- package/components/catalyst-ui/x/loader-x.tsx +0 -1757
- package/components/catalyst-ui/x/pagination-x.tsx +0 -622
- package/components/catalyst-ui/x/popover-x.tsx +0 -744
- package/components/catalyst-ui/x/radio-group-x.tsx +0 -499
- package/components/catalyst-ui/x/select-x.tsx +0 -1127
- package/components/catalyst-ui/x/sheet-x.tsx +0 -668
- package/components/catalyst-ui/x/switch-x.tsx +0 -681
- package/components/catalyst-ui/x/table-x.tsx +0 -574
- package/components/catalyst-ui/x/tabs-x.tsx +0 -839
- package/components/catalyst-ui/x/textarea-x.tsx +0 -1263
- package/components/catalyst-ui/x/tooltip-x.tsx +0 -396
- package/components/catalyst-ui/x/tracker-x.tsx +0 -560
- package/data/bg-data.tsx +0 -901
- package/data/buttons-data.tsx +0 -2327
- package/data/charts-data.tsx +0 -102
- package/data/chat-data.tsx +0 -83
- package/data/code-data.tsx +0 -1040
- package/data/comboboxes-data.tsx +0 -1843
- package/data/command-data.tsx +0 -1381
- package/data/core-data.tsx +0 -15953
- package/data/crm-data.tsx +0 -47
- package/data/data.tsx +0 -159
- package/data/date-and-time-data.tsx +0 -554
- package/data/dependencies.tsx +0 -7
- package/data/ecommerce-data.tsx +0 -1387
- package/data/forms-data.tsx +0 -7890
- package/data/hooks-data.tsx +0 -5487
- package/data/index.ts +0 -34
- package/data/inputs-data.tsx +0 -557
- package/data/interactive-data.tsx +0 -5394
- package/data/lofi-data.tsx +0 -18295
- package/data/marketing-data.tsx +0 -2546
- package/data/media-data.tsx +0 -1510
- package/data/motion-data.tsx +0 -5801
- package/data/overlay-data.tsx +0 -4136
- package/data/pdf-data.tsx +0 -124
- package/data/pos-data.tsx +0 -213
- package/data/postcss.config.js +0 -6
- package/data/primitive-data.tsx +0 -5170
- package/data/prompt-data.tsx +0 -1226
- package/data/requiredLibs.ts +0 -4
- package/data/sandbox-data.tsx +0 -1
- package/data/sidebars-data.tsx +0 -5421
- package/data/stacks-data.tsx +0 -32
- package/data/table-data.tsx +0 -706
- package/data/tailwind.config.js +0 -270
- package/data/tailwind.config.ngin.js +0 -3830
- package/data/tailwind.css +0 -431
- package/data/tools-data.tsx +0 -6910
- package/data/typography-data.tsx +0 -2050
- package/data/utils-data.tsx +0 -6500
- package/data/x-data.tsx +0 -1171
|
@@ -1,761 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { cn, } from '~/components/catalyst-ui';
|
|
3
|
-
import { Button, } from '~/components/catalyst-ui';
|
|
4
|
-
import { Input, } from "~/components/catalyst-ui";
|
|
5
|
-
import { Label, } from "~/components/catalyst-ui";
|
|
6
|
-
import { Textarea, } from "~/components/catalyst-ui";
|
|
7
|
-
import { Settings, User, Mail, Phone, MapPin, Calendar, } from "lucide-react";
|
|
8
|
-
import { Drawer as DrawerPrimitive, } from "vaul";
|
|
9
|
-
import { motion, type Variants } from "framer-motion";
|
|
10
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
11
|
-
|
|
12
|
-
// @dev app/components/catalyst-ui/data/primitive-data.tsx:4285
|
|
13
|
-
const drawerVariants = cva(
|
|
14
|
-
["group/drawer-content fixed z-50 flex flex-col"],
|
|
15
|
-
{
|
|
16
|
-
variants: {
|
|
17
|
-
variant: {
|
|
18
|
-
default: "",
|
|
19
|
-
card: [
|
|
20
|
-
"bg-card rounded-t-xl shadow-xl",
|
|
21
|
-
"data-[vaul-drawer-direction=bottom]:mb-5",
|
|
22
|
-
"data-[vaul-drawer-direction=top]:mt-5",
|
|
23
|
-
"data-[vaul-drawer-direction=left]:ml-5",
|
|
24
|
-
"data-[vaul-drawer-direction=right]:mr-5",
|
|
25
|
-
],
|
|
26
|
-
glass: [
|
|
27
|
-
"backdrop-blur-xl bg-background/80 border-t border-white/10 max-w-sm",
|
|
28
|
-
"data-[vaul-drawer-direction=bottom]:mb-5",
|
|
29
|
-
"data-[vaul-drawer-direction=top]:mt-5",
|
|
30
|
-
"data-[vaul-drawer-direction=left]:ml-5",
|
|
31
|
-
"data-[vaul-drawer-direction=right]:mr-5",
|
|
32
|
-
],
|
|
33
|
-
elevated: [
|
|
34
|
-
"bg-background shadow-2xl max-w-sm",
|
|
35
|
-
"data-[vaul-drawer-direction=bottom]:mb-5",
|
|
36
|
-
"data-[vaul-drawer-direction=top]:mt-5",
|
|
37
|
-
"data-[vaul-drawer-direction=left]:ml-5",
|
|
38
|
-
"data-[vaul-drawer-direction=right]:mr-5",
|
|
39
|
-
],
|
|
40
|
-
bordered: [
|
|
41
|
-
"bg-background border-t-2 border-primary/20 max-w-sm",
|
|
42
|
-
"data-[vaul-drawer-direction=bottom]:mb-5",
|
|
43
|
-
"data-[vaul-drawer-direction=top]:mt-5",
|
|
44
|
-
"data-[vaul-drawer-direction=left]:ml-5",
|
|
45
|
-
"data-[vaul-drawer-direction=right]:mr-5",
|
|
46
|
-
],
|
|
47
|
-
macos: [
|
|
48
|
-
"backdrop-blur-xl bg-card/70 shadow-2xl border border-border/50 w-full max-w-sm rounded-3xl mx-auto",
|
|
49
|
-
"data-[vaul-drawer-direction=bottom]:mb-5",
|
|
50
|
-
"data-[vaul-drawer-direction=top]:mt-5",
|
|
51
|
-
"data-[vaul-drawer-direction=left]:ml-5",
|
|
52
|
-
"data-[vaul-drawer-direction=right]:mr-5",
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
direction: {
|
|
56
|
-
top: "border-b rounded-b-lg max-h-[80vh] mb-24 top-0 inset-x-0 left-1/2 -translate-x-1/2",
|
|
57
|
-
bottom: "border-t rounded-t-lg max-h-[80vh] mt-24 bottom-0 inset-x-0 left-1/2 -translate-x-1/2",
|
|
58
|
-
right: "sm:max-w-sm border-l w-3/4 right-0 inset-y-0 top-1/2 -translate-y-1/2",
|
|
59
|
-
left: "inset-y-0 left-0 w-3/4 border-r sm:max-w-sm top-1/2 -translate-y-1/2",
|
|
60
|
-
},
|
|
61
|
-
size: {
|
|
62
|
-
default: "h-auto",
|
|
63
|
-
sm: "h-[50vh]",
|
|
64
|
-
md: "h-[70vh]",
|
|
65
|
-
lg: "h-[90vh]",
|
|
66
|
-
full: "h-screen",
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
defaultVariants: {
|
|
70
|
-
variant: "default",
|
|
71
|
-
size: "default",
|
|
72
|
-
},
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
// Default motion variants
|
|
77
|
-
const defaultContentVariants: Variants = {
|
|
78
|
-
hidden: {
|
|
79
|
-
y: "100%",
|
|
80
|
-
opacity: 0,
|
|
81
|
-
transition: {
|
|
82
|
-
type: "spring",
|
|
83
|
-
stiffness: 300,
|
|
84
|
-
damping: 30,
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
visible: {
|
|
88
|
-
y: 0,
|
|
89
|
-
opacity: 1,
|
|
90
|
-
transition: {
|
|
91
|
-
type: "spring",
|
|
92
|
-
stiffness: 300,
|
|
93
|
-
damping: 30,
|
|
94
|
-
mass: 0.8,
|
|
95
|
-
staggerChildren: 0.07,
|
|
96
|
-
delayChildren: 0.1,
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const defaultItemVariants: Variants = {
|
|
102
|
-
hidden: {
|
|
103
|
-
y: 20,
|
|
104
|
-
opacity: 0,
|
|
105
|
-
transition: {
|
|
106
|
-
type: "spring",
|
|
107
|
-
stiffness: 300,
|
|
108
|
-
damping: 30,
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
visible: {
|
|
112
|
-
y: 0,
|
|
113
|
-
opacity: 1,
|
|
114
|
-
transition: {
|
|
115
|
-
type: "spring",
|
|
116
|
-
stiffness: 300,
|
|
117
|
-
damping: 30,
|
|
118
|
-
mass: 0.8,
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
type MotionConfig = {
|
|
124
|
-
contentVariants?: Variants;
|
|
125
|
-
itemVariants?: Variants;
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
const DrawerMotionContext = React.createContext<MotionConfig & { enabled: boolean }>({
|
|
129
|
-
enabled: false,
|
|
130
|
-
contentVariants: defaultContentVariants,
|
|
131
|
-
itemVariants: defaultItemVariants,
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
function Drawer({
|
|
135
|
-
motionConfig,
|
|
136
|
-
...props
|
|
137
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Root> & {
|
|
138
|
-
motionConfig?: MotionConfig;
|
|
139
|
-
}) {
|
|
140
|
-
return (
|
|
141
|
-
<DrawerMotionContext.Provider
|
|
142
|
-
value={{
|
|
143
|
-
enabled: false, // Will be set by DrawerContent based on variant
|
|
144
|
-
contentVariants: motionConfig?.contentVariants ?? defaultContentVariants,
|
|
145
|
-
itemVariants: motionConfig?.itemVariants ?? defaultItemVariants,
|
|
146
|
-
}}
|
|
147
|
-
>
|
|
148
|
-
<DrawerPrimitive.Root data-slot="drawer" {...props} />
|
|
149
|
-
</DrawerMotionContext.Provider>
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function DrawerTrigger({
|
|
154
|
-
...props
|
|
155
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {
|
|
156
|
-
return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function DrawerPortal({
|
|
160
|
-
...props
|
|
161
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {
|
|
162
|
-
return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function DrawerClose({
|
|
166
|
-
...props
|
|
167
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Close>) {
|
|
168
|
-
return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function DrawerOverlay({
|
|
172
|
-
className,
|
|
173
|
-
...props
|
|
174
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {
|
|
175
|
-
return (
|
|
176
|
-
<DrawerPrimitive.Overlay
|
|
177
|
-
data-slot="drawer-overlay"
|
|
178
|
-
className={cn(
|
|
179
|
-
"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",
|
|
180
|
-
className
|
|
181
|
-
)}
|
|
182
|
-
{...props}
|
|
183
|
-
/>
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
function DrawerContent({
|
|
188
|
-
className,
|
|
189
|
-
children,
|
|
190
|
-
variant,
|
|
191
|
-
direction,
|
|
192
|
-
size,
|
|
193
|
-
...props
|
|
194
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Content> &
|
|
195
|
-
VariantProps<typeof drawerVariants>) {
|
|
196
|
-
const motionConfigFromContext = React.useContext(DrawerMotionContext);
|
|
197
|
-
|
|
198
|
-
// Enable motion for all variants except "default"
|
|
199
|
-
const motionEnabled = variant && variant !== "default";
|
|
200
|
-
|
|
201
|
-
const motionConfig = {
|
|
202
|
-
...motionConfigFromContext,
|
|
203
|
-
enabled: motionEnabled,
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
const content = (
|
|
207
|
-
<>
|
|
208
|
-
<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" />
|
|
209
|
-
{children}
|
|
210
|
-
</>
|
|
211
|
-
);
|
|
212
|
-
|
|
213
|
-
return (
|
|
214
|
-
<DrawerPortal data-slot="drawer-portal">
|
|
215
|
-
<DrawerOverlay />
|
|
216
|
-
<DrawerMotionContext.Provider value={motionConfig}>
|
|
217
|
-
<DrawerPrimitive.Content
|
|
218
|
-
data-slot="drawer-content"
|
|
219
|
-
className={cn(
|
|
220
|
-
drawerVariants({ variant, direction, size }),
|
|
221
|
-
"bg-background",
|
|
222
|
-
"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0",
|
|
223
|
-
"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0",
|
|
224
|
-
"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0",
|
|
225
|
-
"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0",
|
|
226
|
-
className
|
|
227
|
-
)}
|
|
228
|
-
{...props}
|
|
229
|
-
>
|
|
230
|
-
{motionEnabled ? (
|
|
231
|
-
<motion.div
|
|
232
|
-
variants={motionConfig.contentVariants}
|
|
233
|
-
initial="hidden"
|
|
234
|
-
animate="visible"
|
|
235
|
-
className="h-full flex flex-col"
|
|
236
|
-
>
|
|
237
|
-
{content}
|
|
238
|
-
</motion.div>
|
|
239
|
-
) : (
|
|
240
|
-
content
|
|
241
|
-
)}
|
|
242
|
-
</DrawerPrimitive.Content>
|
|
243
|
-
</DrawerMotionContext.Provider>
|
|
244
|
-
</DrawerPortal>
|
|
245
|
-
);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
249
|
-
const motionConfig = React.useContext(DrawerMotionContext);
|
|
250
|
-
|
|
251
|
-
const Component = motionConfig.enabled ? motion.div : "div";
|
|
252
|
-
|
|
253
|
-
return (
|
|
254
|
-
<Component
|
|
255
|
-
data-slot="drawer-header"
|
|
256
|
-
className={cn(
|
|
257
|
-
"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",
|
|
258
|
-
className
|
|
259
|
-
)}
|
|
260
|
-
{...(motionConfig.enabled && {
|
|
261
|
-
variants: motionConfig.itemVariants,
|
|
262
|
-
})}
|
|
263
|
-
{...props}
|
|
264
|
-
/>
|
|
265
|
-
);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
function DrawerFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
269
|
-
const motionConfig = React.useContext(DrawerMotionContext);
|
|
270
|
-
|
|
271
|
-
const Component = motionConfig.enabled ? motion.div : "div";
|
|
272
|
-
|
|
273
|
-
return (
|
|
274
|
-
<Component
|
|
275
|
-
data-slot="drawer-footer"
|
|
276
|
-
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
277
|
-
{...(motionConfig.enabled && {
|
|
278
|
-
variants: motionConfig.itemVariants,
|
|
279
|
-
})}
|
|
280
|
-
{...props}
|
|
281
|
-
/>
|
|
282
|
-
);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
function DrawerTitle({
|
|
286
|
-
className,
|
|
287
|
-
...props
|
|
288
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Title>) {
|
|
289
|
-
const motionConfig = React.useContext(DrawerMotionContext);
|
|
290
|
-
|
|
291
|
-
return (
|
|
292
|
-
<DrawerPrimitive.Title
|
|
293
|
-
data-slot="drawer-title"
|
|
294
|
-
className={cn("text-foreground font-semibold", className)}
|
|
295
|
-
asChild={motionConfig.enabled}
|
|
296
|
-
{...props}
|
|
297
|
-
>
|
|
298
|
-
{motionConfig.enabled ? (
|
|
299
|
-
<motion.h2 variants={motionConfig.itemVariants}>{props.children}</motion.h2>
|
|
300
|
-
) : (
|
|
301
|
-
props.children
|
|
302
|
-
)}
|
|
303
|
-
</DrawerPrimitive.Title>
|
|
304
|
-
);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
function DrawerDescription({
|
|
308
|
-
className,
|
|
309
|
-
...props
|
|
310
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Description>) {
|
|
311
|
-
const motionConfig = React.useContext(DrawerMotionContext);
|
|
312
|
-
|
|
313
|
-
return (
|
|
314
|
-
<DrawerPrimitive.Description
|
|
315
|
-
data-slot="drawer-description"
|
|
316
|
-
className={cn("text-muted-foreground text-sm", className)}
|
|
317
|
-
asChild={motionConfig.enabled}
|
|
318
|
-
{...props}
|
|
319
|
-
>
|
|
320
|
-
{motionConfig.enabled ? (
|
|
321
|
-
<motion.p variants={motionConfig.itemVariants}>{props.children}</motion.p>
|
|
322
|
-
) : (
|
|
323
|
-
props.children
|
|
324
|
-
)}
|
|
325
|
-
</DrawerPrimitive.Description>
|
|
326
|
-
);
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
// Example usage
|
|
330
|
-
export default function DrawerDemooo() {
|
|
331
|
-
const [open, setOpen] = React.useState(false);
|
|
332
|
-
|
|
333
|
-
// Custom variants example
|
|
334
|
-
const customContentVariants: Variants = {
|
|
335
|
-
hidden: {
|
|
336
|
-
y: "100%",
|
|
337
|
-
opacity: 0,
|
|
338
|
-
scale: 0.95,
|
|
339
|
-
},
|
|
340
|
-
visible: {
|
|
341
|
-
y: 0,
|
|
342
|
-
opacity: 1,
|
|
343
|
-
scale: 1,
|
|
344
|
-
transition: {
|
|
345
|
-
type: "spring",
|
|
346
|
-
stiffness: 400,
|
|
347
|
-
damping: 40,
|
|
348
|
-
staggerChildren: 0.1,
|
|
349
|
-
delayChildren: 0.2,
|
|
350
|
-
},
|
|
351
|
-
},
|
|
352
|
-
};
|
|
353
|
-
|
|
354
|
-
const customItemVariants: Variants = {
|
|
355
|
-
hidden: {
|
|
356
|
-
x: -20,
|
|
357
|
-
opacity: 0,
|
|
358
|
-
},
|
|
359
|
-
visible: {
|
|
360
|
-
x: 0,
|
|
361
|
-
opacity: 1,
|
|
362
|
-
transition: {
|
|
363
|
-
type: "spring",
|
|
364
|
-
stiffness: 400,
|
|
365
|
-
damping: 40,
|
|
366
|
-
},
|
|
367
|
-
},
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
return (
|
|
371
|
-
<div className="flex min-h-screen items-center justify-center gap-4 p-8 bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-900 dark:to-gray-800">
|
|
372
|
-
<div className="space-y-4">
|
|
373
|
-
<h1 className="text-3xl font-bold mb-8 text-center">Drawer Motion Examples</h1>
|
|
374
|
-
|
|
375
|
-
<div className="flex flex-wrap gap-4 justify-center">
|
|
376
|
-
{/* Without Motion - Default variant */}
|
|
377
|
-
<Drawer>
|
|
378
|
-
<DrawerTrigger className="px-4 py-2 bg-gray-800 text-white rounded-lg hover:bg-gray-700 transition-colors">
|
|
379
|
-
Default (No Motion)
|
|
380
|
-
</DrawerTrigger>
|
|
381
|
-
<DrawerContent>
|
|
382
|
-
<DrawerHeader>
|
|
383
|
-
<DrawerTitle>Standard Drawer</DrawerTitle>
|
|
384
|
-
<DrawerDescription>
|
|
385
|
-
This drawer has no motion animations (default variant)
|
|
386
|
-
</DrawerDescription>
|
|
387
|
-
</DrawerHeader>
|
|
388
|
-
<div className="p-4">
|
|
389
|
-
<p className="text-sm text-gray-600 dark:text-gray-400">
|
|
390
|
-
Content without animations
|
|
391
|
-
</p>
|
|
392
|
-
</div>
|
|
393
|
-
<DrawerFooter>
|
|
394
|
-
<DrawerClose className="px-4 py-2 bg-gray-800 text-white rounded-lg hover:bg-gray-700 transition-colors">
|
|
395
|
-
Close
|
|
396
|
-
</DrawerClose>
|
|
397
|
-
</DrawerFooter>
|
|
398
|
-
</DrawerContent>
|
|
399
|
-
</Drawer>
|
|
400
|
-
|
|
401
|
-
{/* With Motion - Card variant */}
|
|
402
|
-
<Drawer>
|
|
403
|
-
<DrawerTrigger className="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors">
|
|
404
|
-
Card Variant (Motion)
|
|
405
|
-
</DrawerTrigger>
|
|
406
|
-
<DrawerContent variant="card">
|
|
407
|
-
<DrawerHeader>
|
|
408
|
-
<DrawerTitle>Card Drawer</DrawerTitle>
|
|
409
|
-
<DrawerDescription>
|
|
410
|
-
Motion automatically enabled with card variant
|
|
411
|
-
</DrawerDescription>
|
|
412
|
-
</DrawerHeader>
|
|
413
|
-
<div className="p-4">
|
|
414
|
-
<p className="text-sm text-gray-600 dark:text-gray-400">
|
|
415
|
-
Smooth spring animations with staggered children
|
|
416
|
-
</p>
|
|
417
|
-
</div>
|
|
418
|
-
<DrawerFooter>
|
|
419
|
-
<DrawerClose className="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors">
|
|
420
|
-
Close
|
|
421
|
-
</DrawerClose>
|
|
422
|
-
</DrawerFooter>
|
|
423
|
-
</DrawerContent>
|
|
424
|
-
</Drawer>
|
|
425
|
-
|
|
426
|
-
{/* With Motion - Glass variant */}
|
|
427
|
-
<Drawer>
|
|
428
|
-
<DrawerTrigger className="px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors">
|
|
429
|
-
Glass Variant (Motion)
|
|
430
|
-
</DrawerTrigger>
|
|
431
|
-
<DrawerContent variant="glass">
|
|
432
|
-
<DrawerHeader>
|
|
433
|
-
<DrawerTitle>Glass Drawer</DrawerTitle>
|
|
434
|
-
<DrawerDescription>
|
|
435
|
-
Motion automatically enabled with glass variant
|
|
436
|
-
</DrawerDescription>
|
|
437
|
-
</DrawerHeader>
|
|
438
|
-
<div className="p-4 space-y-4">
|
|
439
|
-
<div className="space-y-2">
|
|
440
|
-
<h3 className="font-semibold">Features:</h3>
|
|
441
|
-
<ul className="text-sm text-gray-600 dark:text-gray-400 space-y-1 list-disc list-inside">
|
|
442
|
-
<li>Automatic motion activation</li>
|
|
443
|
-
<li>Glassmorphism design</li>
|
|
444
|
-
<li>Staggered child animations</li>
|
|
445
|
-
<li>Spring physics</li>
|
|
446
|
-
</ul>
|
|
447
|
-
</div>
|
|
448
|
-
</div>
|
|
449
|
-
<DrawerFooter>
|
|
450
|
-
<DrawerClose className="px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors">
|
|
451
|
-
Close
|
|
452
|
-
</DrawerClose>
|
|
453
|
-
</DrawerFooter>
|
|
454
|
-
</DrawerContent>
|
|
455
|
-
</Drawer>
|
|
456
|
-
|
|
457
|
-
{/* With Custom Motion - macOS variant */}
|
|
458
|
-
<Drawer
|
|
459
|
-
open={open}
|
|
460
|
-
onOpenChange={setOpen}
|
|
461
|
-
motionConfig={{
|
|
462
|
-
contentVariants: customContentVariants,
|
|
463
|
-
itemVariants: customItemVariants,
|
|
464
|
-
}}
|
|
465
|
-
>
|
|
466
|
-
<DrawerTrigger className="px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors">
|
|
467
|
-
macOS + Custom Motion
|
|
468
|
-
</DrawerTrigger>
|
|
469
|
-
<DrawerContent variant="macos">
|
|
470
|
-
<DrawerHeader>
|
|
471
|
-
<DrawerTitle>Custom Motion Drawer</DrawerTitle>
|
|
472
|
-
<DrawerDescription>
|
|
473
|
-
macOS variant with custom animation variants
|
|
474
|
-
</DrawerDescription>
|
|
475
|
-
</DrawerHeader>
|
|
476
|
-
<div className="p-4 space-y-4">
|
|
477
|
-
<div className="space-y-2">
|
|
478
|
-
<h3 className="font-semibold">Custom Features:</h3>
|
|
479
|
-
<ul className="text-sm text-gray-600 dark:text-gray-400 space-y-1 list-disc list-inside">
|
|
480
|
-
<li>Custom entrance animations</li>
|
|
481
|
-
<li>Scale and slide effects</li>
|
|
482
|
-
<li>Faster spring physics</li>
|
|
483
|
-
<li>Horizontal slide animation</li>
|
|
484
|
-
</ul>
|
|
485
|
-
</div>
|
|
486
|
-
</div>
|
|
487
|
-
<DrawerFooter>
|
|
488
|
-
<button
|
|
489
|
-
onClick={() => setOpen(false)}
|
|
490
|
-
className="px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors"
|
|
491
|
-
>
|
|
492
|
-
Close
|
|
493
|
-
</button>
|
|
494
|
-
</DrawerFooter>
|
|
495
|
-
</DrawerContent>
|
|
496
|
-
</Drawer>
|
|
497
|
-
</div>
|
|
498
|
-
</div>
|
|
499
|
-
</div>
|
|
500
|
-
);
|
|
501
|
-
}
|
|
502
|
-
export {
|
|
503
|
-
Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
// SIMPLIFIED DEMO COMPONENT
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
export function DrawerDemooo1() {
|
|
510
|
-
return (
|
|
511
|
-
<div className="flex flex-col gap-4 p-8">
|
|
512
|
-
<h1 className="text-2xl font-bold mb-6">Simplified Drawer Demo</h1>
|
|
513
|
-
|
|
514
|
-
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
|
|
515
|
-
{/* Basic Drawer */}
|
|
516
|
-
<Drawer>
|
|
517
|
-
<DrawerTrigger asChild>
|
|
518
|
-
<Button variant="outline" className="w-full">
|
|
519
|
-
Open Basic Drawer
|
|
520
|
-
</Button>
|
|
521
|
-
</DrawerTrigger>
|
|
522
|
-
<DrawerContent position="right" size="md">
|
|
523
|
-
<DrawerHeader>
|
|
524
|
-
<DrawerTitle>Basic Drawer</DrawerTitle>
|
|
525
|
-
<DrawerDescription>
|
|
526
|
-
This is a simple drawer example with basic content.
|
|
527
|
-
</DrawerDescription>
|
|
528
|
-
</DrawerHeader>
|
|
529
|
-
<div className="space-y-4">
|
|
530
|
-
<p>This is the drawer content area.</p>
|
|
531
|
-
<p>You can put any content here - forms, lists, images, etc.</p>
|
|
532
|
-
<div className="bg-gray-100 p-4 rounded">
|
|
533
|
-
<h3 className="font-medium mb-2">Example Content</h3>
|
|
534
|
-
<p className="text-sm text-gray-600">
|
|
535
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
536
|
-
Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
537
|
-
</p>
|
|
538
|
-
</div>
|
|
539
|
-
</div>
|
|
540
|
-
<DrawerFooter>
|
|
541
|
-
<DrawerClose asChild>
|
|
542
|
-
<Button>Close</Button>
|
|
543
|
-
</DrawerClose>
|
|
544
|
-
</DrawerFooter>
|
|
545
|
-
</DrawerContent>
|
|
546
|
-
</Drawer>
|
|
547
|
-
|
|
548
|
-
{/* Profile Form Drawer */}
|
|
549
|
-
<Drawer>
|
|
550
|
-
<DrawerTrigger asChild>
|
|
551
|
-
<Button variant="outline" className="w-full">
|
|
552
|
-
<User className="h-4 w-4 mr-2" />
|
|
553
|
-
Edit Profile
|
|
554
|
-
</Button>
|
|
555
|
-
</DrawerTrigger>
|
|
556
|
-
<DrawerContent position="right" size="lg">
|
|
557
|
-
<DrawerHeader>
|
|
558
|
-
<DrawerTitle className="flex items-center gap-2">
|
|
559
|
-
<User className="h-5 w-5" />
|
|
560
|
-
Edit Profile
|
|
561
|
-
</DrawerTitle>
|
|
562
|
-
<DrawerDescription>
|
|
563
|
-
Update your profile information below.
|
|
564
|
-
</DrawerDescription>
|
|
565
|
-
</DrawerHeader>
|
|
566
|
-
<form className="space-y-6">
|
|
567
|
-
<div className="grid grid-cols-2 gap-4">
|
|
568
|
-
<div>
|
|
569
|
-
<Label htmlFor="firstName">First Name</Label>
|
|
570
|
-
<Input id="firstName" placeholder="John" />
|
|
571
|
-
</div>
|
|
572
|
-
<div>
|
|
573
|
-
<Label htmlFor="lastName">Last Name</Label>
|
|
574
|
-
<Input id="lastName" placeholder="Doe" />
|
|
575
|
-
</div>
|
|
576
|
-
</div>
|
|
577
|
-
|
|
578
|
-
<div>
|
|
579
|
-
<Label htmlFor="email">Email</Label>
|
|
580
|
-
<div className="relative">
|
|
581
|
-
<Mail className="absolute left-3 top-3 h-4 w-4 text-gray-400" />
|
|
582
|
-
<Input id="email" type="email" placeholder="john@example.com" className="pl-10" />
|
|
583
|
-
</div>
|
|
584
|
-
</div>
|
|
585
|
-
|
|
586
|
-
<div>
|
|
587
|
-
<Label htmlFor="phone">Phone</Label>
|
|
588
|
-
<div className="relative">
|
|
589
|
-
<Phone className="absolute left-3 top-3 h-4 w-4 text-gray-400" />
|
|
590
|
-
<Input id="phone" placeholder="+1 (555) 000-0000" className="pl-10" />
|
|
591
|
-
</div>
|
|
592
|
-
</div>
|
|
593
|
-
|
|
594
|
-
<div>
|
|
595
|
-
<Label htmlFor="address">Address</Label>
|
|
596
|
-
<div className="relative">
|
|
597
|
-
<MapPin className="absolute left-3 top-3 h-4 w-4 text-gray-400" />
|
|
598
|
-
<Input id="address" placeholder="123 Main St, City, State" className="pl-10" />
|
|
599
|
-
</div>
|
|
600
|
-
</div>
|
|
601
|
-
|
|
602
|
-
<div>
|
|
603
|
-
<Label htmlFor="bio">Bio</Label>
|
|
604
|
-
<Textarea id="bio" placeholder="Tell us about yourself..." rows={3} />
|
|
605
|
-
</div>
|
|
606
|
-
</form>
|
|
607
|
-
<DrawerFooter>
|
|
608
|
-
<DrawerClose asChild>
|
|
609
|
-
<Button className="w-full">Save Changes</Button>
|
|
610
|
-
</DrawerClose>
|
|
611
|
-
<DrawerClose asChild>
|
|
612
|
-
<Button variant="outline" className="w-full">Cancel</Button>
|
|
613
|
-
</DrawerClose>
|
|
614
|
-
</DrawerFooter>
|
|
615
|
-
</DrawerContent>
|
|
616
|
-
</Drawer>
|
|
617
|
-
|
|
618
|
-
{/* Settings Drawer */}
|
|
619
|
-
<Drawer>
|
|
620
|
-
<DrawerTrigger asChild>
|
|
621
|
-
<Button variant="outline" className="w-full">
|
|
622
|
-
<Settings className="h-4 w-4 mr-2" />
|
|
623
|
-
Settings
|
|
624
|
-
</Button>
|
|
625
|
-
</DrawerTrigger>
|
|
626
|
-
<DrawerContent position="left" size="md">
|
|
627
|
-
<DrawerHeader>
|
|
628
|
-
<DrawerTitle className="flex items-center gap-2">
|
|
629
|
-
<Settings className="h-5 w-5" />
|
|
630
|
-
Settings
|
|
631
|
-
</DrawerTitle>
|
|
632
|
-
<DrawerDescription>
|
|
633
|
-
Manage your application preferences.
|
|
634
|
-
</DrawerDescription>
|
|
635
|
-
</DrawerHeader>
|
|
636
|
-
<div className="space-y-6">
|
|
637
|
-
<div>
|
|
638
|
-
<h3 className="text-sm font-medium mb-3">Appearance</h3>
|
|
639
|
-
<div className="space-y-2">
|
|
640
|
-
<label className="flex items-center space-x-2">
|
|
641
|
-
<input type="radio" name="theme" value="light" defaultChecked />
|
|
642
|
-
<span className="text-sm">Light</span>
|
|
643
|
-
</label>
|
|
644
|
-
<label className="flex items-center space-x-2">
|
|
645
|
-
<input type="radio" name="theme" value="dark" />
|
|
646
|
-
<span className="text-sm">Dark</span>
|
|
647
|
-
</label>
|
|
648
|
-
<label className="flex items-center space-x-2">
|
|
649
|
-
<input type="radio" name="theme" value="system" />
|
|
650
|
-
<span className="text-sm">System</span>
|
|
651
|
-
</label>
|
|
652
|
-
</div>
|
|
653
|
-
</div>
|
|
654
|
-
|
|
655
|
-
<div>
|
|
656
|
-
<h3 className="text-sm font-medium mb-3">Notifications</h3>
|
|
657
|
-
<div className="space-y-2">
|
|
658
|
-
<label className="flex items-center justify-between">
|
|
659
|
-
<span className="text-sm">Email notifications</span>
|
|
660
|
-
<input type="checkbox" defaultChecked />
|
|
661
|
-
</label>
|
|
662
|
-
<label className="flex items-center justify-between">
|
|
663
|
-
<span className="text-sm">Push notifications</span>
|
|
664
|
-
<input type="checkbox" />
|
|
665
|
-
</label>
|
|
666
|
-
<label className="flex items-center justify-between">
|
|
667
|
-
<span className="text-sm">SMS notifications</span>
|
|
668
|
-
<input type="checkbox" defaultChecked />
|
|
669
|
-
</label>
|
|
670
|
-
</div>
|
|
671
|
-
</div>
|
|
672
|
-
|
|
673
|
-
<div>
|
|
674
|
-
<h3 className="text-sm font-medium mb-3">Privacy</h3>
|
|
675
|
-
<div className="space-y-2">
|
|
676
|
-
<label className="flex items-center justify-between">
|
|
677
|
-
<span className="text-sm">Profile visibility</span>
|
|
678
|
-
<input type="checkbox" defaultChecked />
|
|
679
|
-
</label>
|
|
680
|
-
<label className="flex items-center justify-between">
|
|
681
|
-
<span className="text-sm">Activity status</span>
|
|
682
|
-
<input type="checkbox" />
|
|
683
|
-
</label>
|
|
684
|
-
</div>
|
|
685
|
-
</div>
|
|
686
|
-
</div>
|
|
687
|
-
<DrawerFooter>
|
|
688
|
-
<DrawerClose asChild>
|
|
689
|
-
<Button>Save Settings</Button>
|
|
690
|
-
</DrawerClose>
|
|
691
|
-
</DrawerFooter>
|
|
692
|
-
</DrawerContent>
|
|
693
|
-
</Drawer>
|
|
694
|
-
|
|
695
|
-
{/* Bottom Drawer */}
|
|
696
|
-
<Drawer>
|
|
697
|
-
<DrawerTrigger asChild>
|
|
698
|
-
<Button variant="outline" className="w-full">
|
|
699
|
-
<Calendar className="h-4 w-4 mr-2" />
|
|
700
|
-
Bottom Drawer
|
|
701
|
-
</Button>
|
|
702
|
-
</DrawerTrigger>
|
|
703
|
-
<DrawerContent position="bottom" size="md">
|
|
704
|
-
<DrawerHeader>
|
|
705
|
-
<DrawerTitle>Select Date</DrawerTitle>
|
|
706
|
-
<DrawerDescription>
|
|
707
|
-
Choose a date from the calendar below.
|
|
708
|
-
</DrawerDescription>
|
|
709
|
-
</DrawerHeader>
|
|
710
|
-
<div className="grid grid-cols-7 gap-2 text-center text-sm">
|
|
711
|
-
<div className="font-medium py-2">Sun</div>
|
|
712
|
-
<div className="font-medium py-2">Mon</div>
|
|
713
|
-
<div className="font-medium py-2">Tue</div>
|
|
714
|
-
<div className="font-medium py-2">Wed</div>
|
|
715
|
-
<div className="font-medium py-2">Thu</div>
|
|
716
|
-
<div className="font-medium py-2">Fri</div>
|
|
717
|
-
<div className="font-medium py-2">Sat</div>
|
|
718
|
-
|
|
719
|
-
{Array.from({ length: 31 }, (_, i) => (
|
|
720
|
-
<DrawerClose key={i + 1} asChild>
|
|
721
|
-
<button className="py-2 hover:bg-gray-100 rounded transition-colors">
|
|
722
|
-
{i + 1}
|
|
723
|
-
</button>
|
|
724
|
-
</DrawerClose>
|
|
725
|
-
))}
|
|
726
|
-
</div>
|
|
727
|
-
<DrawerFooter>
|
|
728
|
-
<DrawerClose asChild>
|
|
729
|
-
<Button variant="outline">Cancel</Button>
|
|
730
|
-
</DrawerClose>
|
|
731
|
-
</DrawerFooter>
|
|
732
|
-
</DrawerContent>
|
|
733
|
-
</Drawer>
|
|
734
|
-
</div>
|
|
735
|
-
|
|
736
|
-
{/* Usage Example Code */}
|
|
737
|
-
<div className="mt-8 p-4 bg-gray-50 rounded-lg">
|
|
738
|
-
<h2 className="text-lg font-semibold mb-2">Simplified Usage</h2>
|
|
739
|
-
<pre className="text-sm overflow-x-auto">
|
|
740
|
-
{`<Drawer>
|
|
741
|
-
<DrawerTrigger asChild>
|
|
742
|
-
<Button>Open Drawer</Button>
|
|
743
|
-
</DrawerTrigger>
|
|
744
|
-
<DrawerContent position="right" size="md">
|
|
745
|
-
<DrawerHeader>
|
|
746
|
-
<DrawerTitle>Drawer Title</DrawerTitle>
|
|
747
|
-
<DrawerDescription>Drawer description</DrawerDescription>
|
|
748
|
-
</DrawerHeader>
|
|
749
|
-
{/* Your content here */}
|
|
750
|
-
<DrawerFooter>
|
|
751
|
-
<DrawerClose asChild>
|
|
752
|
-
<Button>Close</Button>
|
|
753
|
-
</DrawerClose>
|
|
754
|
-
</DrawerFooter>
|
|
755
|
-
</DrawerContent>
|
|
756
|
-
</Drawer>`}
|
|
757
|
-
</pre>
|
|
758
|
-
</div>
|
|
759
|
-
</div>
|
|
760
|
-
)
|
|
761
|
-
}
|