lizaui 9.0.61 → 9.0.63

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.
@@ -0,0 +1,431 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { c } from "react/compiler-runtime";
3
+ import ReactDOM__default from "react-dom";
4
+ import { forwardRef, useId, useState, useEffect } from "react";
5
+ import { c as cn } from "../chunks/utils-H80jjgLf.js";
6
+ import { B as Button } from "../chunks/button-CIYJojCH.js";
7
+ import { AnimatePresence, LazyMotion, m } from "framer-motion";
8
+ import { c as cva } from "../chunks/index-CEKmKomA.js";
9
+ const backdropVariants = cva("", {
10
+ variants: {
11
+ backdrop: {
12
+ transparent: "bg-transparent",
13
+ opaque: "bg-black/50",
14
+ blur: "backdrop-blur-md backdrop-saturate-150 bg-overlay/30"
15
+ }
16
+ },
17
+ defaultVariants: {
18
+ backdrop: "opaque"
19
+ }
20
+ });
21
+ const sizeVariants = cva("", {
22
+ variants: {
23
+ size: {
24
+ "xs": "w-80",
25
+ "sm": "w-96",
26
+ "md": "w-[448px]",
27
+ "lg": "w-[512px]",
28
+ "xl": "w-[640px]",
29
+ "2xl": "w-[768px]",
30
+ "3xl": "w-[896px]",
31
+ "4xl": "w-[1024px]",
32
+ "5xl": "w-[1152px]",
33
+ "full": "w-full"
34
+ }
35
+ },
36
+ defaultVariants: {
37
+ size: "md"
38
+ }
39
+ });
40
+ const sizeHorizontalVariants = cva("", {
41
+ variants: {
42
+ size: {
43
+ "xs": "h-80",
44
+ "sm": "h-96",
45
+ "md": "h-[448px]",
46
+ "lg": "h-[512px]",
47
+ "xl": "h-[640px]",
48
+ "2xl": "h-[768px]",
49
+ "3xl": "h-[896px]",
50
+ "4xl": "h-[1024px]",
51
+ "5xl": "h-[1152px]",
52
+ "full": "h-full"
53
+ }
54
+ },
55
+ defaultVariants: {
56
+ size: "md"
57
+ }
58
+ });
59
+ const radiusVariants = cva("", {
60
+ variants: {
61
+ radius: {
62
+ none: "rounded-none",
63
+ sm: "rounded-sm",
64
+ md: "rounded-md",
65
+ lg: "rounded-lg"
66
+ }
67
+ },
68
+ defaultVariants: {
69
+ radius: "lg"
70
+ }
71
+ });
72
+ const placementVariants = cva("fixed", {
73
+ variants: {
74
+ placement: {
75
+ left: "left-0 top-0 bottom-0",
76
+ right: "right-0 top-0 bottom-0",
77
+ top: "top-0 left-0 right-0",
78
+ bottom: "bottom-0 left-0 right-0"
79
+ }
80
+ },
81
+ defaultVariants: {
82
+ placement: "right"
83
+ }
84
+ });
85
+ const getDrawerVariants = (placement = "right") => {
86
+ const variants = {
87
+ left: {
88
+ enter: {
89
+ x: 0,
90
+ opacity: 1,
91
+ transition: {
92
+ type: "spring",
93
+ stiffness: 400,
94
+ damping: 40,
95
+ duration: 0.3
96
+ }
97
+ },
98
+ exit: {
99
+ x: "-100%",
100
+ opacity: 0,
101
+ transition: {
102
+ duration: 0.2,
103
+ ease: "easeOut"
104
+ }
105
+ }
106
+ },
107
+ right: {
108
+ enter: {
109
+ x: 0,
110
+ opacity: 1,
111
+ transition: {
112
+ type: "spring",
113
+ stiffness: 400,
114
+ damping: 40,
115
+ duration: 0.3
116
+ }
117
+ },
118
+ exit: {
119
+ x: "100%",
120
+ opacity: 0,
121
+ transition: {
122
+ duration: 0.2,
123
+ ease: "easeOut"
124
+ }
125
+ }
126
+ },
127
+ top: {
128
+ enter: {
129
+ y: 0,
130
+ opacity: 1,
131
+ transition: {
132
+ type: "spring",
133
+ stiffness: 400,
134
+ damping: 40,
135
+ duration: 0.3
136
+ }
137
+ },
138
+ exit: {
139
+ y: "-100%",
140
+ opacity: 0,
141
+ transition: {
142
+ duration: 0.2,
143
+ ease: "easeOut"
144
+ }
145
+ }
146
+ },
147
+ bottom: {
148
+ enter: {
149
+ y: 0,
150
+ opacity: 1,
151
+ transition: {
152
+ type: "spring",
153
+ stiffness: 400,
154
+ damping: 40,
155
+ duration: 0.3
156
+ }
157
+ },
158
+ exit: {
159
+ y: "100%",
160
+ opacity: 0,
161
+ transition: {
162
+ duration: 0.2,
163
+ ease: "easeOut"
164
+ }
165
+ }
166
+ }
167
+ };
168
+ return variants[placement];
169
+ };
170
+ const getInitialPosition = (placement = "right") => {
171
+ const positions = {
172
+ left: {
173
+ x: "-100%",
174
+ opacity: 0
175
+ },
176
+ right: {
177
+ x: "100%",
178
+ opacity: 0
179
+ },
180
+ top: {
181
+ y: "-100%",
182
+ opacity: 0
183
+ },
184
+ bottom: {
185
+ y: "100%",
186
+ opacity: 0
187
+ }
188
+ };
189
+ return positions[placement];
190
+ };
191
+ const Drawer = forwardRef(({
192
+ drawerId: propDrawerId,
193
+ children,
194
+ isOpen,
195
+ size = "md",
196
+ radius = "lg",
197
+ placement = "right",
198
+ isDismissable = true,
199
+ isKeyboardDismissDisabled = false,
200
+ shouldBlockScroll = true,
201
+ hideCloseButton = false,
202
+ backdrop = "opaque",
203
+ motionProps,
204
+ portalContainer,
205
+ disableAnimation = false,
206
+ classNames = {},
207
+ style,
208
+ onOpenChange,
209
+ onClose
210
+ }, ref) => {
211
+ const uniqueId = useId();
212
+ const drawerId = propDrawerId || uniqueId;
213
+ const [mounted, setMounted] = useState(false);
214
+ useEffect(() => {
215
+ setMounted(true);
216
+ }, []);
217
+ useEffect(() => {
218
+ if (typeof window !== "undefined" && isOpen && shouldBlockScroll) {
219
+ const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
220
+ document.body.style.overflow = "hidden";
221
+ document.body.style.paddingRight = `${scrollbarWidth}px`;
222
+ }
223
+ return () => {
224
+ if (typeof window !== "undefined" && shouldBlockScroll) {
225
+ document.body.style.overflow = "";
226
+ document.body.style.paddingRight = "";
227
+ }
228
+ };
229
+ }, [isOpen, shouldBlockScroll]);
230
+ useEffect(() => {
231
+ const handleKeyDown = (e) => {
232
+ if (e.key === "Escape" && !isKeyboardDismissDisabled && isDismissable) {
233
+ onClose?.();
234
+ onOpenChange?.(false);
235
+ }
236
+ };
237
+ if (isOpen) {
238
+ document.addEventListener("keydown", handleKeyDown);
239
+ }
240
+ return () => {
241
+ document.removeEventListener("keydown", handleKeyDown);
242
+ };
243
+ }, [isOpen, isKeyboardDismissDisabled, isDismissable, onClose, onOpenChange]);
244
+ const handleBackdropClick = () => {
245
+ if (isDismissable) {
246
+ onClose?.();
247
+ onOpenChange?.(false);
248
+ }
249
+ };
250
+ if (!mounted) return null;
251
+ const drawerRoot = portalContainer || document.getElementById("drawer-root") || document.body;
252
+ const isHorizontal = placement === "top" || placement === "bottom";
253
+ const sizeClass = isHorizontal ? sizeHorizontalVariants({
254
+ size
255
+ }) : sizeVariants({
256
+ size
257
+ });
258
+ const getRadiusClass = () => {
259
+ if (radius === "none") return radiusVariants({
260
+ radius
261
+ });
262
+ switch (placement) {
263
+ case "left":
264
+ return `rounded-r-${radius}`;
265
+ case "right":
266
+ return `rounded-l-${radius}`;
267
+ case "top":
268
+ return `rounded-b-${radius}`;
269
+ case "bottom":
270
+ return `rounded-t-${radius}`;
271
+ default:
272
+ return radiusVariants({
273
+ radius
274
+ });
275
+ }
276
+ };
277
+ const drawerVariants = motionProps?.variants || getDrawerVariants(placement);
278
+ const initialPosition = getInitialPosition(placement);
279
+ return ReactDOM__default.createPortal(/* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsx(LazyMotion, { features: () => import("framer-motion").then((res) => res.domAnimation), children: /* @__PURE__ */ jsxs("div", { className: cn("fixed inset-0 z-50 overflow-hidden", classNames.wrapper), children: [
280
+ /* @__PURE__ */ jsx(m.div, { initial: {
281
+ opacity: 0
282
+ }, animate: {
283
+ opacity: 1
284
+ }, exit: {
285
+ opacity: 0
286
+ }, transition: {
287
+ duration: 0.3
288
+ }, className: cn("fixed inset-0", backdropVariants({
289
+ backdrop
290
+ }), classNames.backdrop), onClick: handleBackdropClick, "aria-hidden": "true", tabIndex: -1, "data-dismissable": isDismissable }, "drawer-backdrop"),
291
+ /* @__PURE__ */ jsxs(m.div, { ref, id: drawerId, role: "dialog", "aria-modal": "true", "data-open": isOpen, "data-dismissable": isDismissable, initial: disableAnimation ? void 0 : initialPosition, animate: disableAnimation ? void 0 : "enter", exit: disableAnimation ? void 0 : "exit", variants: disableAnimation ? void 0 : drawerVariants, ...motionProps?.transition && {
292
+ transition: motionProps.transition
293
+ }, className: cn("z-50 flex flex-col bg-content1 shadow-lg max-h-full", placementVariants({
294
+ placement
295
+ }), sizeClass, getRadiusClass(), classNames.base), style, children: [
296
+ !hideCloseButton && /* @__PURE__ */ jsx("div", { className: cn("absolute top-3 right-3 z-10", classNames.closeButton), children: /* @__PURE__ */ jsx(Button, { isIconOnly: true, variant: "light", radius: "full", size: "sm", "aria-label": "Close drawer", onClick: () => {
297
+ onClose?.();
298
+ onOpenChange?.(false);
299
+ }, className: "p-0 w-8 h-8 min-w-auto bg-default-100 hover:bg-default-200 text-default-500 hover:text-default-600 dark:bg-default-100 dark:hover:bg-default-200", children: /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", fill: "currentColor", viewBox: "0 0 21 21", role: "img", "aria-hidden": "true", children: [
300
+ /* @__PURE__ */ jsx("path", { fill: "none", d: "M0 0h21v21H0z" }),
301
+ /* @__PURE__ */ jsx("path", { d: "m12.12 10 4.07-4.06a1.5 1.5 0 1 0-2.11-2.12L10 7.88 5.94 3.81a1.5 1.5 0 1 0-2.12 2.12L7.88 10l-4.07 4.06a1.5 1.5 0 0 0 0 2.12 1.51 1.51 0 0 0 2.13 0L10 12.12l4.06 4.07a1.45 1.45 0 0 0 1.06.44 1.5 1.5 0 0 0 1.06-2.56Z" })
302
+ ] }) }) }),
303
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col h-full overflow-hidden", children })
304
+ ] }, "drawer-content")
305
+ ] }) }) }), drawerRoot);
306
+ });
307
+ Drawer.displayName = "Drawer";
308
+ const DrawerContent = forwardRef((t0, ref) => {
309
+ const $ = c(7);
310
+ const {
311
+ children,
312
+ className,
313
+ style
314
+ } = t0;
315
+ let t1;
316
+ if ($[0] !== className) {
317
+ t1 = cn("flex flex-col h-full", className);
318
+ $[0] = className;
319
+ $[1] = t1;
320
+ } else {
321
+ t1 = $[1];
322
+ }
323
+ let t2;
324
+ if ($[2] !== children || $[3] !== ref || $[4] !== style || $[5] !== t1) {
325
+ t2 = /* @__PURE__ */ jsx("div", { ref, className: t1, style, children });
326
+ $[2] = children;
327
+ $[3] = ref;
328
+ $[4] = style;
329
+ $[5] = t1;
330
+ $[6] = t2;
331
+ } else {
332
+ t2 = $[6];
333
+ }
334
+ return t2;
335
+ });
336
+ DrawerContent.displayName = "DrawerContent";
337
+ const DrawerHeader = forwardRef((t0, ref) => {
338
+ const $ = c(7);
339
+ const {
340
+ children,
341
+ className,
342
+ style
343
+ } = t0;
344
+ let t1;
345
+ if ($[0] !== className) {
346
+ t1 = cn("flex flex-col gap-1 px-6 py-4 border-b border-divider", className);
347
+ $[0] = className;
348
+ $[1] = t1;
349
+ } else {
350
+ t1 = $[1];
351
+ }
352
+ let t2;
353
+ if ($[2] !== children || $[3] !== ref || $[4] !== style || $[5] !== t1) {
354
+ t2 = /* @__PURE__ */ jsx("div", { ref, className: t1, style, children });
355
+ $[2] = children;
356
+ $[3] = ref;
357
+ $[4] = style;
358
+ $[5] = t1;
359
+ $[6] = t2;
360
+ } else {
361
+ t2 = $[6];
362
+ }
363
+ return t2;
364
+ });
365
+ DrawerHeader.displayName = "DrawerHeader";
366
+ const DrawerBody = forwardRef((t0, ref) => {
367
+ const $ = c(7);
368
+ const {
369
+ children,
370
+ className,
371
+ style
372
+ } = t0;
373
+ let t1;
374
+ if ($[0] !== className) {
375
+ t1 = cn("flex flex-col gap-3 px-6 py-4 overflow-y-auto flex-1", className);
376
+ $[0] = className;
377
+ $[1] = t1;
378
+ } else {
379
+ t1 = $[1];
380
+ }
381
+ let t2;
382
+ if ($[2] !== children || $[3] !== ref || $[4] !== style || $[5] !== t1) {
383
+ t2 = /* @__PURE__ */ jsx("div", { ref, className: t1, style, children });
384
+ $[2] = children;
385
+ $[3] = ref;
386
+ $[4] = style;
387
+ $[5] = t1;
388
+ $[6] = t2;
389
+ } else {
390
+ t2 = $[6];
391
+ }
392
+ return t2;
393
+ });
394
+ DrawerBody.displayName = "DrawerBody";
395
+ const DrawerFooter = forwardRef((t0, ref) => {
396
+ const $ = c(7);
397
+ const {
398
+ children,
399
+ className,
400
+ style
401
+ } = t0;
402
+ let t1;
403
+ if ($[0] !== className) {
404
+ t1 = cn("flex flex-col-reverse px-6 py-3 gap-2 sm:flex-row sm:justify-end border-t border-divider mt-auto", className);
405
+ $[0] = className;
406
+ $[1] = t1;
407
+ } else {
408
+ t1 = $[1];
409
+ }
410
+ let t2;
411
+ if ($[2] !== children || $[3] !== ref || $[4] !== style || $[5] !== t1) {
412
+ t2 = /* @__PURE__ */ jsx("div", { ref, className: t1, style, children });
413
+ $[2] = children;
414
+ $[3] = ref;
415
+ $[4] = style;
416
+ $[5] = t1;
417
+ $[6] = t2;
418
+ } else {
419
+ t2 = $[6];
420
+ }
421
+ return t2;
422
+ });
423
+ DrawerFooter.displayName = "DrawerFooter";
424
+ export {
425
+ Drawer,
426
+ DrawerBody,
427
+ DrawerContent,
428
+ DrawerFooter,
429
+ DrawerHeader
430
+ };
431
+ //# sourceMappingURL=index.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es.js","sources":["../../src/components/drawer/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport ReactDOM from \"react-dom\";\nimport { forwardRef, type Ref, useEffect, useState, useId } from \"react\";\nimport type { DrawerType, DrawerContentType, DrawerHeaderType, DrawerBodyType, DrawerFooterType } from \"./drawer.type\";\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"../button\";\nimport { AnimatePresence, LazyMotion, m } from \"framer-motion\";\nimport { cva } from \"class-variance-authority\";\n\n// Backdrop variants\nconst backdropVariants = cva(\"\", {\n\tvariants: {\n\t\tbackdrop: {\n\t\t\ttransparent: \"bg-transparent\",\n\t\t\topaque: \"bg-black/50\",\n\t\t\tblur: \"backdrop-blur-md backdrop-saturate-150 bg-overlay/30\",\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tbackdrop: \"opaque\",\n\t},\n});\n\n// Size variants for drawer\nconst sizeVariants = cva(\"\", {\n\tvariants: {\n\t\tsize: {\n\t\t\t\"xs\": \"w-80\",\n\t\t\t\"sm\": \"w-96\",\n\t\t\t\"md\": \"w-[448px]\",\n\t\t\t\"lg\": \"w-[512px]\",\n\t\t\t\"xl\": \"w-[640px]\",\n\t\t\t\"2xl\": \"w-[768px]\",\n\t\t\t\"3xl\": \"w-[896px]\",\n\t\t\t\"4xl\": \"w-[1024px]\",\n\t\t\t\"5xl\": \"w-[1152px]\",\n\t\t\t\"full\": \"w-full\",\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tsize: \"md\",\n\t},\n});\n\n// Size variants for horizontal drawers (top/bottom)\nconst sizeHorizontalVariants = cva(\"\", {\n\tvariants: {\n\t\tsize: {\n\t\t\t\"xs\": \"h-80\",\n\t\t\t\"sm\": \"h-96\",\n\t\t\t\"md\": \"h-[448px]\",\n\t\t\t\"lg\": \"h-[512px]\",\n\t\t\t\"xl\": \"h-[640px]\",\n\t\t\t\"2xl\": \"h-[768px]\",\n\t\t\t\"3xl\": \"h-[896px]\",\n\t\t\t\"4xl\": \"h-[1024px]\",\n\t\t\t\"5xl\": \"h-[1152px]\",\n\t\t\t\"full\": \"h-full\",\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tsize: \"md\",\n\t},\n});\n\n// Radius variants\nconst radiusVariants = cva(\"\", {\n\tvariants: {\n\t\tradius: {\n\t\t\tnone: \"rounded-none\",\n\t\t\tsm: \"rounded-sm\",\n\t\t\tmd: \"rounded-md\",\n\t\t\tlg: \"rounded-lg\",\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tradius: \"lg\",\n\t},\n});\n\n// Placement variants\nconst placementVariants = cva(\"fixed\", {\n\tvariants: {\n\t\tplacement: {\n\t\t\tleft: \"left-0 top-0 bottom-0\",\n\t\t\tright: \"right-0 top-0 bottom-0\",\n\t\t\ttop: \"top-0 left-0 right-0\",\n\t\t\tbottom: \"bottom-0 left-0 right-0\",\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tplacement: \"right\",\n\t},\n});\n\n// Get motion variants based on placement\nconst getDrawerVariants = (placement: \"left\" | \"right\" | \"top\" | \"bottom\" = \"right\") => {\n\tconst variants: any = {\n\t\tleft: {\n\t\t\tenter: {\n\t\t\t\tx: 0,\n\t\t\t\topacity: 1,\n\t\t\t\ttransition: {\n\t\t\t\t\ttype: \"spring\",\n\t\t\t\t\tstiffness: 400,\n\t\t\t\t\tdamping: 40,\n\t\t\t\t\tduration: 0.3,\n\t\t\t\t},\n\t\t\t},\n\t\t\texit: {\n\t\t\t\tx: \"-100%\",\n\t\t\t\topacity: 0,\n\t\t\t\ttransition: {\n\t\t\t\t\tduration: 0.2,\n\t\t\t\t\tease: \"easeOut\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tright: {\n\t\t\tenter: {\n\t\t\t\tx: 0,\n\t\t\t\topacity: 1,\n\t\t\t\ttransition: {\n\t\t\t\t\ttype: \"spring\",\n\t\t\t\t\tstiffness: 400,\n\t\t\t\t\tdamping: 40,\n\t\t\t\t\tduration: 0.3,\n\t\t\t\t},\n\t\t\t},\n\t\t\texit: {\n\t\t\t\tx: \"100%\",\n\t\t\t\topacity: 0,\n\t\t\t\ttransition: {\n\t\t\t\t\tduration: 0.2,\n\t\t\t\t\tease: \"easeOut\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\ttop: {\n\t\t\tenter: {\n\t\t\t\ty: 0,\n\t\t\t\topacity: 1,\n\t\t\t\ttransition: {\n\t\t\t\t\ttype: \"spring\",\n\t\t\t\t\tstiffness: 400,\n\t\t\t\t\tdamping: 40,\n\t\t\t\t\tduration: 0.3,\n\t\t\t\t},\n\t\t\t},\n\t\t\texit: {\n\t\t\t\ty: \"-100%\",\n\t\t\t\topacity: 0,\n\t\t\t\ttransition: {\n\t\t\t\t\tduration: 0.2,\n\t\t\t\t\tease: \"easeOut\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tbottom: {\n\t\t\tenter: {\n\t\t\t\ty: 0,\n\t\t\t\topacity: 1,\n\t\t\t\ttransition: {\n\t\t\t\t\ttype: \"spring\",\n\t\t\t\t\tstiffness: 400,\n\t\t\t\t\tdamping: 40,\n\t\t\t\t\tduration: 0.3,\n\t\t\t\t},\n\t\t\t},\n\t\t\texit: {\n\t\t\t\ty: \"100%\",\n\t\t\t\topacity: 0,\n\t\t\t\ttransition: {\n\t\t\t\t\tduration: 0.2,\n\t\t\t\t\tease: \"easeOut\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t};\n\n\treturn variants[placement];\n};\n\nconst getInitialPosition = (placement: \"left\" | \"right\" | \"top\" | \"bottom\" = \"right\") => {\n\tconst positions: any = {\n\t\tleft: { x: \"-100%\", opacity: 0 },\n\t\tright: { x: \"100%\", opacity: 0 },\n\t\ttop: { y: \"-100%\", opacity: 0 },\n\t\tbottom: { y: \"100%\", opacity: 0 },\n\t};\n\n\treturn positions[placement];\n};\n\nexport const Drawer = forwardRef(\n\t(\n\t\t{\n\t\t\tdrawerId: propDrawerId,\n\t\t\tchildren,\n\t\t\tisOpen,\n\t\t\tsize = \"md\",\n\t\t\tradius = \"lg\",\n\t\t\tplacement = \"right\",\n\t\t\tisDismissable = true,\n\t\t\tisKeyboardDismissDisabled = false,\n\t\t\tshouldBlockScroll = true,\n\t\t\thideCloseButton = false,\n\t\t\tbackdrop = \"opaque\",\n\t\t\tmotionProps,\n\t\t\tportalContainer,\n\t\t\tdisableAnimation = false,\n\t\t\tclassNames = {},\n\t\t\tstyle,\n\t\t\tonOpenChange,\n\t\t\tonClose,\n\t\t}: DrawerType,\n\t\tref: Ref<HTMLDivElement>,\n\t) => {\n\t\tconst uniqueId = useId();\n\t\tconst drawerId = propDrawerId || uniqueId;\n\t\tconst [mounted, setMounted] = useState(false);\n\n\t\t// Handle SSR\n\t\tuseEffect(() => {\n\t\t\tsetMounted(true);\n\t\t}, []);\n\n\t\t// Block scroll when drawer is open\n\t\tuseEffect(() => {\n\t\t\tif (typeof window !== \"undefined\" && isOpen && shouldBlockScroll) {\n\t\t\t\tconst scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;\n\t\t\t\tdocument.body.style.overflow = \"hidden\";\n\t\t\t\tdocument.body.style.paddingRight = `${scrollbarWidth}px`;\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\tif (typeof window !== \"undefined\" && shouldBlockScroll) {\n\t\t\t\t\tdocument.body.style.overflow = \"\";\n\t\t\t\t\tdocument.body.style.paddingRight = \"\";\n\t\t\t\t}\n\t\t\t};\n\t\t}, [isOpen, shouldBlockScroll]);\n\n\t\t// Handle escape key\n\t\tuseEffect(() => {\n\t\t\tconst handleKeyDown = (e: KeyboardEvent) => {\n\t\t\t\tif (e.key === \"Escape\" && !isKeyboardDismissDisabled && isDismissable) {\n\t\t\t\t\tonClose?.();\n\t\t\t\t\tonOpenChange?.(false);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif (isOpen) {\n\t\t\t\tdocument.addEventListener(\"keydown\", handleKeyDown);\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\tdocument.removeEventListener(\"keydown\", handleKeyDown);\n\t\t\t};\n\t\t}, [isOpen, isKeyboardDismissDisabled, isDismissable, onClose, onOpenChange]);\n\n\t\tconst handleBackdropClick = () => {\n\t\t\tif (isDismissable) {\n\t\t\t\tonClose?.();\n\t\t\t\tonOpenChange?.(false);\n\t\t\t}\n\t\t};\n\n\t\tif (!mounted) return null;\n\n\t\tconst drawerRoot = portalContainer || document.getElementById(\"drawer-root\") || document.body;\n\n\t\tconst isHorizontal = placement === \"top\" || placement === \"bottom\";\n\t\tconst sizeClass = isHorizontal ? sizeHorizontalVariants({ size }) : sizeVariants({ size });\n\n\t\t// Apply radius only to the appropriate edges based on placement\n\t\tconst getRadiusClass = () => {\n\t\t\tif (radius === \"none\") return radiusVariants({ radius });\n\n\t\t\tswitch (placement) {\n\t\t\t\tcase \"left\":\n\t\t\t\t\treturn `rounded-r-${radius}`;\n\t\t\t\tcase \"right\":\n\t\t\t\t\treturn `rounded-l-${radius}`;\n\t\t\t\tcase \"top\":\n\t\t\t\t\treturn `rounded-b-${radius}`;\n\t\t\t\tcase \"bottom\":\n\t\t\t\t\treturn `rounded-t-${radius}`;\n\t\t\t\tdefault:\n\t\t\t\t\treturn radiusVariants({ radius });\n\t\t\t}\n\t\t};\n\n\t\tconst drawerVariants = motionProps?.variants || getDrawerVariants(placement);\n\t\tconst initialPosition = getInitialPosition(placement);\n\n\t\treturn ReactDOM.createPortal(\n\t\t\t<AnimatePresence>\n\t\t\t\t{isOpen && (\n\t\t\t\t\t<LazyMotion features={() => import(\"framer-motion\").then((res) => res.domAnimation)}>\n\t\t\t\t\t\t<div className={cn(\"fixed inset-0 z-50 overflow-hidden\", classNames.wrapper)}>\n\t\t\t\t\t\t\t{/* Backdrop */}\n\t\t\t\t\t\t\t<m.div\n\t\t\t\t\t\t\t\tkey=\"drawer-backdrop\"\n\t\t\t\t\t\t\t\tinitial={{ opacity: 0 }}\n\t\t\t\t\t\t\t\tanimate={{ opacity: 1 }}\n\t\t\t\t\t\t\t\texit={{ opacity: 0 }}\n\t\t\t\t\t\t\t\ttransition={{ duration: 0.3 }}\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\"fixed inset-0\",\n\t\t\t\t\t\t\t\t\tbackdropVariants({ backdrop }),\n\t\t\t\t\t\t\t\t\tclassNames.backdrop,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tonClick={handleBackdropClick}\n\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\t\tdata-dismissable={isDismissable}\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t{/* Drawer */}\n\t\t\t\t\t\t\t<m.div\n\t\t\t\t\t\t\t\tkey=\"drawer-content\"\n\t\t\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\t\t\tid={drawerId}\n\t\t\t\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\t\t\t\tdata-open={isOpen}\n\t\t\t\t\t\t\t\tdata-dismissable={isDismissable}\n\t\t\t\t\t\t\t\tinitial={disableAnimation ? undefined : initialPosition}\n\t\t\t\t\t\t\t\tanimate={disableAnimation ? undefined : \"enter\"}\n\t\t\t\t\t\t\t\texit={disableAnimation ? undefined : \"exit\"}\n\t\t\t\t\t\t\t\tvariants={disableAnimation ? undefined : drawerVariants}\n\t\t\t\t\t\t\t\t{...(motionProps?.transition && { transition: motionProps.transition })}\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\"z-50 flex flex-col bg-content1 shadow-lg max-h-full\",\n\t\t\t\t\t\t\t\t\tplacementVariants({ placement }),\n\t\t\t\t\t\t\t\t\tsizeClass,\n\t\t\t\t\t\t\t\t\tgetRadiusClass(),\n\t\t\t\t\t\t\t\t\tclassNames.base,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tstyle={style}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{/* Close button - positioned absolutely */}\n\t\t\t\t\t\t\t\t{!hideCloseButton && (\n\t\t\t\t\t\t\t\t\t<div className={cn(\"absolute top-3 right-3 z-10\", classNames.closeButton)}>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tisIconOnly\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"light\"\n\t\t\t\t\t\t\t\t\t\t\tradius=\"full\"\n\t\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\t\taria-label=\"Close drawer\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\t\t\tonClose?.();\n\t\t\t\t\t\t\t\t\t\t\t\tonOpenChange?.(false);\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"p-0 w-8 h-8 min-w-auto bg-default-100 hover:bg-default-200 text-default-500 hover:text-default-600 dark:bg-default-100 dark:hover:bg-default-200\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<svg width=\"16\" height=\"16\" fill=\"currentColor\" viewBox=\"0 0 21 21\" role=\"img\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t<path fill=\"none\" d=\"M0 0h21v21H0z\"></path>\n\t\t\t\t\t\t\t\t\t\t\t\t<path d=\"m12.12 10 4.07-4.06a1.5 1.5 0 1 0-2.11-2.12L10 7.88 5.94 3.81a1.5 1.5 0 1 0-2.12 2.12L7.88 10l-4.07 4.06a1.5 1.5 0 0 0 0 2.12 1.51 1.51 0 0 0 2.13 0L10 12.12l4.06 4.07a1.45 1.45 0 0 0 1.06.44 1.5 1.5 0 0 0 1.06-2.56Z\"></path>\n\t\t\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t\t\t{/* Content */}\n\t\t\t\t\t\t\t\t<div className=\"flex flex-col h-full overflow-hidden\">\n\t\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</m.div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</LazyMotion>\n\t\t\t\t)}\n\t\t\t</AnimatePresence>,\n\t\t\tdrawerRoot,\n\t\t);\n\t},\n);\n\nDrawer.displayName = \"Drawer\";\n\nexport const DrawerContent = forwardRef(\n\t({ children, className, style }: DrawerContentType, ref: Ref<HTMLDivElement>) => {\n\t\treturn (\n\t\t\t<div ref={ref} className={cn(\"flex flex-col h-full\", className)} style={style}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\n\nDrawerContent.displayName = \"DrawerContent\";\n\nexport const DrawerHeader = forwardRef(\n\t({ children, className, style }: DrawerHeaderType, ref: Ref<HTMLDivElement>) => {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"flex flex-col gap-1 px-6 py-4 border-b border-divider\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tstyle={style}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\n\nDrawerHeader.displayName = \"DrawerHeader\";\n\nexport const DrawerBody = forwardRef(\n\t({ children, className, style }: DrawerBodyType, ref: Ref<HTMLDivElement>) => {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"flex flex-col gap-3 px-6 py-4 overflow-y-auto flex-1\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tstyle={style}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\n\nDrawerBody.displayName = \"DrawerBody\";\n\nexport const DrawerFooter = forwardRef(\n\t({ children, className, style }: DrawerFooterType, ref: Ref<HTMLDivElement>) => {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"flex flex-col-reverse px-6 py-3 gap-2 sm:flex-row sm:justify-end border-t border-divider mt-auto\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tstyle={style}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\n\nDrawerFooter.displayName = \"DrawerFooter\";\n"],"names":["backdropVariants","cva","variants","backdrop","transparent","opaque","blur","defaultVariants","sizeVariants","size","sizeHorizontalVariants","radiusVariants","radius","none","sm","md","lg","placementVariants","placement","left","right","top","bottom","getDrawerVariants","enter","x","opacity","transition","type","stiffness","damping","duration","exit","ease","y","getInitialPosition","positions","Drawer","forwardRef","drawerId","propDrawerId","children","isOpen","isDismissable","isKeyboardDismissDisabled","shouldBlockScroll","hideCloseButton","motionProps","portalContainer","disableAnimation","classNames","style","onOpenChange","onClose","ref","uniqueId","useId","mounted","setMounted","useState","useEffect","window","scrollbarWidth","innerWidth","document","documentElement","clientWidth","body","overflow","paddingRight","handleKeyDown","e","key","addEventListener","removeEventListener","handleBackdropClick","drawerRoot","getElementById","isHorizontal","sizeClass","getRadiusClass","drawerVariants","initialPosition","ReactDOM","createPortal","then","res","domAnimation","cn","wrapper","undefined","base","closeButton","displayName","DrawerContent","t0","$","_c","className","t1","t2","DrawerHeader","DrawerBody","DrawerFooter"],"mappings":";;;;;;;;AAWA,MAAMA,mBAAmBC,IAAI,IAAI;AAAA,EAChCC,UAAU;AAAA,IACTC,UAAU;AAAA,MACTC,aAAa;AAAA,MACbC,QAAQ;AAAA,MACRC,MAAM;AAAA,IAAA;AAAA,EACP;AAAA,EAEDC,iBAAiB;AAAA,IAChBJ,UAAU;AAAA,EAAA;AAEZ,CAAC;AAGD,MAAMK,eAAeP,IAAI,IAAI;AAAA,EAC5BC,UAAU;AAAA,IACTO,MAAM;AAAA,MACL,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,OAAO;AAAA,MACP,OAAO;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,IAAA;AAAA,EACT;AAAA,EAEDF,iBAAiB;AAAA,IAChBE,MAAM;AAAA,EAAA;AAER,CAAC;AAGD,MAAMC,yBAAyBT,IAAI,IAAI;AAAA,EACtCC,UAAU;AAAA,IACTO,MAAM;AAAA,MACL,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,OAAO;AAAA,M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CC,SAAAX,GACV,oGACAU,SACD;AAACF,WAAAE;AAAAF,WAAAG;AAAAA,EAAA,OAAA;AAAAA,SAAAH,EAAA,CAAA;AAAA,EAAA;AAAA,MAAAI;AAAA,MAAAJ,EAAA,CAAA,MAAAvD,YAAAuD,EAAA,CAAA,MAAA1C,OAAA0C,EAAA,CAAA,MAAA7C,SAAA6C,SAAAG,IAAA;AALFC,6BAAA,OAAA,EACM9C,KACM,WAAA6C,IAIJhD,OAENV,UACF;AAAMuD,WAAAvD;AAAAuD,WAAA1C;AAAA0C,WAAA7C;AAAA6C,WAAAG;AAAAH,WAAAI;AAAAA,EAAA,OAAA;AAAAA,SAAAJ,EAAA,CAAA;AAAA,EAAA;AAAA,SATNI;AASM,CAGT;AAEAG,aAAaV,cAAc;"}
@@ -0,0 +1,2 @@
1
+ export * from './components/drawer/index'
2
+ export {}
@@ -0,0 +1,18 @@
1
+ export interface UseDrawerInterface<T = any> {
2
+ drawerId: string;
3
+ isDrawer: boolean;
4
+ isVisibleDrawer: boolean;
5
+ drawerBody: any;
6
+ paramBody: T;
7
+ showDrawer: (value?: any) => void;
8
+ visibleDrawer: () => void;
9
+ hiddenDrawer: () => void;
10
+ closeDrawer: () => void;
11
+ updateParamBody: (value: T) => void;
12
+ }
13
+ export interface UseDrawerProps {
14
+ drawerId?: string;
15
+ defaultOpen?: boolean;
16
+ }
17
+ export declare function useDrawer<T = any>(props?: UseDrawerProps): UseDrawerInterface<T>;
18
+ //# sourceMappingURL=use-drawer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-drawer.d.ts","sourceRoot":"","sources":["../../src/hooks/use-drawer.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,GAAG;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,GAAG,CAAC;IAChB,SAAS,EAAE,CAAC,CAAC;IACb,UAAU,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAClC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,eAAe,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,SAAS,CAAC,CAAC,GAAG,GAAG,EAAE,KAAK,GAAE,cAAmB,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAiDpF"}
package/dist/index.cjs.js CHANGED
@@ -110,6 +110,116 @@ function _temp2() {
110
110
  }
111
111
  function _temp$1() {
112
112
  }
113
+ function useDrawer(t0) {
114
+ const $ = compilerRuntime.c(14);
115
+ let t1;
116
+ if ($[0] !== t0) {
117
+ t1 = t0 === void 0 ? {} : t0;
118
+ $[0] = t0;
119
+ $[1] = t1;
120
+ } else {
121
+ t1 = $[1];
122
+ }
123
+ const props = t1;
124
+ const {
125
+ drawerId: t2,
126
+ defaultOpen: t3
127
+ } = props;
128
+ const drawerId = t2 === void 0 ? "drawer-default" : t2;
129
+ const defaultOpen = t3 === void 0 ? false : t3;
130
+ const [isDrawer, setIsDrawer] = React.useState(defaultOpen);
131
+ const [isVisibleDrawer, setIsVisibleDrawer] = React.useState(defaultOpen);
132
+ const [drawerBody, setDrawerBody] = React.useState(null);
133
+ let t4;
134
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
135
+ t4 = {};
136
+ $[2] = t4;
137
+ } else {
138
+ t4 = $[2];
139
+ }
140
+ const [paramBody, setParamBody] = React.useState(t4);
141
+ let t5;
142
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
143
+ t5 = (value) => {
144
+ setDrawerBody(value || null);
145
+ setIsDrawer(true);
146
+ setTimeout(() => setIsVisibleDrawer(true), 10);
147
+ };
148
+ $[3] = t5;
149
+ } else {
150
+ t5 = $[3];
151
+ }
152
+ const showDrawer = t5;
153
+ let t6;
154
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
155
+ t6 = () => {
156
+ setIsVisibleDrawer(true);
157
+ };
158
+ $[4] = t6;
159
+ } else {
160
+ t6 = $[4];
161
+ }
162
+ const visibleDrawer = t6;
163
+ let t7;
164
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
165
+ t7 = () => {
166
+ setIsVisibleDrawer(false);
167
+ setTimeout(() => setIsDrawer(false), 300);
168
+ };
169
+ $[5] = t7;
170
+ } else {
171
+ t7 = $[5];
172
+ }
173
+ const hiddenDrawer = t7;
174
+ let t8;
175
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
176
+ t8 = () => {
177
+ setIsVisibleDrawer(false);
178
+ setTimeout(() => {
179
+ setIsDrawer(false);
180
+ setDrawerBody(null);
181
+ }, 300);
182
+ };
183
+ $[6] = t8;
184
+ } else {
185
+ t8 = $[6];
186
+ }
187
+ const closeDrawer = t8;
188
+ let t9;
189
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
190
+ t9 = (value_0) => {
191
+ setParamBody(value_0);
192
+ };
193
+ $[7] = t9;
194
+ } else {
195
+ t9 = $[7];
196
+ }
197
+ const updateParamBody = t9;
198
+ let t10;
199
+ if ($[8] !== drawerBody || $[9] !== drawerId || $[10] !== isDrawer || $[11] !== isVisibleDrawer || $[12] !== paramBody) {
200
+ t10 = {
201
+ drawerId,
202
+ isDrawer,
203
+ isVisibleDrawer,
204
+ drawerBody,
205
+ paramBody,
206
+ showDrawer,
207
+ visibleDrawer,
208
+ hiddenDrawer,
209
+ closeDrawer,
210
+ updateParamBody
211
+ };
212
+ $[8] = drawerBody;
213
+ $[9] = drawerId;
214
+ $[10] = isDrawer;
215
+ $[11] = isVisibleDrawer;
216
+ $[12] = paramBody;
217
+ $[13] = t10;
218
+ } else {
219
+ t10 = $[13];
220
+ }
221
+ return t10;
222
+ }
113
223
  const defaultAlertState = {
114
224
  title: "",
115
225
  description: "",
@@ -732,5 +842,6 @@ function useDraggable(props) {
732
842
  }
733
843
  exports.useConfirmationAlert = useConfirmationAlert;
734
844
  exports.useDraggable = useDraggable;
845
+ exports.useDrawer = useDrawer;
735
846
  exports.useModalHooks = useModalHooks;
736
847
  //# sourceMappingURL=index.cjs.js.map