@zentauri-ui/zentauri-components 0.0.8 → 0.0.9

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.
Files changed (132) hide show
  1. package/README.md +27 -2
  2. package/dist/ui/accordion.cjs +311 -0
  3. package/dist/ui/accordion.cjs.map +1 -0
  4. package/dist/ui/accordion.d.cts +70 -0
  5. package/dist/ui/accordion.d.ts +70 -0
  6. package/dist/ui/accordion.js +286 -0
  7. package/dist/ui/accordion.js.map +1 -0
  8. package/dist/ui/alert.cjs +257 -0
  9. package/dist/ui/alert.cjs.map +1 -0
  10. package/dist/ui/alert.d.cts +66 -0
  11. package/dist/ui/alert.d.ts +66 -0
  12. package/dist/ui/alert.js +224 -0
  13. package/dist/ui/alert.js.map +1 -0
  14. package/dist/ui/badge.cjs +192 -0
  15. package/dist/ui/badge.cjs.map +1 -0
  16. package/dist/ui/badge.d.cts +37 -0
  17. package/dist/ui/badge.d.ts +37 -0
  18. package/dist/ui/badge.js +165 -0
  19. package/dist/ui/badge.js.map +1 -0
  20. package/dist/ui/buttons.cjs +202 -0
  21. package/dist/ui/buttons.cjs.map +1 -0
  22. package/dist/ui/buttons.d.cts +27 -0
  23. package/dist/ui/buttons.d.ts +27 -0
  24. package/dist/ui/buttons.js +176 -0
  25. package/dist/ui/buttons.js.map +1 -0
  26. package/dist/ui/card.cjs +293 -0
  27. package/dist/ui/card.cjs.map +1 -0
  28. package/dist/ui/card.d.cts +77 -0
  29. package/dist/ui/card.d.ts +77 -0
  30. package/dist/ui/card.js +258 -0
  31. package/dist/ui/card.js.map +1 -0
  32. package/dist/ui/divider.cjs +229 -0
  33. package/dist/ui/divider.cjs.map +1 -0
  34. package/dist/ui/divider.d.cts +39 -0
  35. package/dist/ui/divider.d.ts +39 -0
  36. package/dist/ui/divider.js +200 -0
  37. package/dist/ui/divider.js.map +1 -0
  38. package/dist/ui/drawer.cjs +408 -0
  39. package/dist/ui/drawer.cjs.map +1 -0
  40. package/dist/ui/drawer.d.cts +81 -0
  41. package/dist/ui/drawer.d.ts +81 -0
  42. package/dist/ui/drawer.js +383 -0
  43. package/dist/ui/drawer.js.map +1 -0
  44. package/dist/ui/dropdown.cjs +302 -0
  45. package/dist/ui/dropdown.cjs.map +1 -0
  46. package/dist/ui/dropdown.d.cts +50 -0
  47. package/dist/ui/dropdown.d.ts +50 -0
  48. package/dist/ui/dropdown.js +278 -0
  49. package/dist/ui/dropdown.js.map +1 -0
  50. package/dist/ui/empty-state.cjs +186 -0
  51. package/dist/ui/empty-state.cjs.map +1 -0
  52. package/dist/ui/empty-state.d.cts +55 -0
  53. package/dist/ui/empty-state.d.ts +55 -0
  54. package/dist/ui/empty-state.js +154 -0
  55. package/dist/ui/empty-state.js.map +1 -0
  56. package/dist/ui/index.d.cts +27 -1164
  57. package/dist/ui/index.d.ts +27 -1164
  58. package/dist/ui/inputs.cjs +458 -0
  59. package/dist/ui/inputs.cjs.map +1 -0
  60. package/dist/ui/inputs.d.cts +35 -0
  61. package/dist/ui/inputs.d.ts +35 -0
  62. package/dist/ui/inputs.js +432 -0
  63. package/dist/ui/inputs.js.map +1 -0
  64. package/dist/ui/modal.cjs +406 -0
  65. package/dist/ui/modal.cjs.map +1 -0
  66. package/dist/ui/modal.d.cts +84 -0
  67. package/dist/ui/modal.d.ts +84 -0
  68. package/dist/ui/modal.js +384 -0
  69. package/dist/ui/modal.js.map +1 -0
  70. package/dist/ui/pagination.cjs +523 -0
  71. package/dist/ui/pagination.cjs.map +1 -0
  72. package/dist/ui/pagination.d.cts +114 -0
  73. package/dist/ui/pagination.d.ts +114 -0
  74. package/dist/ui/pagination.js +494 -0
  75. package/dist/ui/pagination.js.map +1 -0
  76. package/dist/ui/progress.cjs +268 -0
  77. package/dist/ui/progress.cjs.map +1 -0
  78. package/dist/ui/progress.d.cts +61 -0
  79. package/dist/ui/progress.d.ts +61 -0
  80. package/dist/ui/progress.js +237 -0
  81. package/dist/ui/progress.js.map +1 -0
  82. package/dist/ui/select.cjs +360 -0
  83. package/dist/ui/select.cjs.map +1 -0
  84. package/dist/ui/select.d.cts +73 -0
  85. package/dist/ui/select.d.ts +73 -0
  86. package/dist/ui/select.js +327 -0
  87. package/dist/ui/select.js.map +1 -0
  88. package/dist/ui/skeleton.cjs +576 -0
  89. package/dist/ui/skeleton.cjs.map +1 -0
  90. package/dist/ui/skeleton.d.cts +90 -0
  91. package/dist/ui/skeleton.d.ts +90 -0
  92. package/dist/ui/skeleton.js +544 -0
  93. package/dist/ui/skeleton.js.map +1 -0
  94. package/dist/ui/spinner.cjs +219 -0
  95. package/dist/ui/spinner.cjs.map +1 -0
  96. package/dist/ui/spinner.d.cts +27 -0
  97. package/dist/ui/spinner.d.ts +27 -0
  98. package/dist/ui/spinner.js +193 -0
  99. package/dist/ui/spinner.js.map +1 -0
  100. package/dist/ui/table.cjs +328 -0
  101. package/dist/ui/table.cjs.map +1 -0
  102. package/dist/ui/table.d.cts +81 -0
  103. package/dist/ui/table.d.ts +81 -0
  104. package/dist/ui/table.js +293 -0
  105. package/dist/ui/table.js.map +1 -0
  106. package/dist/ui/tabs.cjs +300 -0
  107. package/dist/ui/tabs.cjs.map +1 -0
  108. package/dist/ui/tabs.d.cts +58 -0
  109. package/dist/ui/tabs.d.ts +58 -0
  110. package/dist/ui/tabs.js +274 -0
  111. package/dist/ui/tabs.js.map +1 -0
  112. package/dist/ui/toast.cjs +285 -0
  113. package/dist/ui/toast.cjs.map +1 -0
  114. package/dist/ui/toast.d.cts +86 -0
  115. package/dist/ui/toast.d.ts +86 -0
  116. package/dist/ui/toast.js +258 -0
  117. package/dist/ui/toast.js.map +1 -0
  118. package/dist/ui/toggle.cjs +185 -0
  119. package/dist/ui/toggle.cjs.map +1 -0
  120. package/dist/ui/toggle.d.cts +37 -0
  121. package/dist/ui/toggle.d.ts +37 -0
  122. package/dist/ui/toggle.js +158 -0
  123. package/dist/ui/toggle.js.map +1 -0
  124. package/dist/ui/tooltip.cjs +242 -0
  125. package/dist/ui/tooltip.cjs.map +1 -0
  126. package/dist/ui/tooltip.d.cts +46 -0
  127. package/dist/ui/tooltip.d.ts +46 -0
  128. package/dist/ui/tooltip.js +214 -0
  129. package/dist/ui/tooltip.js.map +1 -0
  130. package/dist/variants-1Bx3BEeS.d.cts +8 -0
  131. package/dist/variants-1Bx3BEeS.d.ts +8 -0
  132. package/package.json +7 -3
@@ -0,0 +1,384 @@
1
+ "use client";
2
+
3
+
4
+ // src/ui/modal/modal.tsx
5
+ import {
6
+ AnimatePresence,
7
+ motion,
8
+ useReducedMotion
9
+ } from "framer-motion";
10
+ import {
11
+ createContext,
12
+ useCallback,
13
+ useContext,
14
+ useEffect,
15
+ useId,
16
+ useMemo,
17
+ useRef,
18
+ useState
19
+ } from "react";
20
+ import { createPortal } from "react-dom";
21
+
22
+ // src/lib/utils.ts
23
+ import { clsx } from "clsx";
24
+ import { twMerge } from "tailwind-merge";
25
+ function cn(...inputs) {
26
+ return twMerge(clsx(inputs));
27
+ }
28
+
29
+ // src/ui/modal/animations.ts
30
+ var modalOverlayAnimationPresets = {
31
+ none: {},
32
+ fade: {
33
+ initial: { opacity: 0 },
34
+ animate: { opacity: 1 },
35
+ exit: { opacity: 0 },
36
+ transition: { duration: 0.2 }
37
+ },
38
+ scale: {
39
+ initial: { opacity: 0, scale: 0.96 },
40
+ animate: { opacity: 1, scale: 1 },
41
+ exit: { opacity: 0, scale: 0.96 },
42
+ transition: { type: "spring", stiffness: 420, damping: 32 }
43
+ },
44
+ "slide-up": {
45
+ initial: { opacity: 0, y: 24 },
46
+ animate: { opacity: 1, y: 0 },
47
+ exit: { opacity: 0, y: 16 },
48
+ transition: { type: "spring", stiffness: 380, damping: 30 }
49
+ },
50
+ "slide-down": {
51
+ initial: { opacity: 0, y: -24 },
52
+ animate: { opacity: 1, y: 0 },
53
+ exit: { opacity: 0, y: -16 },
54
+ transition: { type: "spring", stiffness: 380, damping: 30 }
55
+ }
56
+ };
57
+
58
+ // src/ui/modal/variants.ts
59
+ import { cva } from "class-variance-authority";
60
+ var modalOverlayVariants = cva(
61
+ "fixed inset-0 z-50 bg-slate-950/70 backdrop-blur-sm data-[state=open]:animate-in"
62
+ );
63
+ var modalTriggerVariants = cva(
64
+ "relative inline-flex shrink-0 cursor-pointer rounded-md border",
65
+ {
66
+ variants: {
67
+ appearance: {
68
+ default: "bg-slate-950",
69
+ glass: "border-white/15 bg-slate-950/70 backdrop-blur-xl",
70
+ sky: "border-sky-600 bg-sky-950/70 backdrop-blur-xl",
71
+ rose: "border-rose-600 bg-rose-950/70 backdrop-blur-xl",
72
+ purple: "border-purple-600 bg-purple-950/70 backdrop-blur-xl",
73
+ pink: "border-pink-600 bg-pink-950/70 backdrop-blur-xl",
74
+ orange: "border-orange-600 bg-orange-950/70 backdrop-blur-xl",
75
+ yellow: "border-yellow-600 bg-yellow-950/70 backdrop-blur-xl",
76
+ teal: "border-teal-600 bg-teal-950/70 backdrop-blur-xl",
77
+ indigo: "border-indigo-600 bg-indigo-950/70 backdrop-blur-xl",
78
+ emerald: "border-emerald-600 bg-emerald-950/70 backdrop-blur-xl",
79
+ gray: "border-gray-600 bg-gray-950/70 backdrop-blur-xl",
80
+ amber: "border-amber-600 bg-amber-950/70 backdrop-blur-xl",
81
+ violet: "border-violet-600 bg-violet-950/70 backdrop-blur-xl",
82
+ "gradient-blue": "border-gradient-to-r from-blue-600 to-purple-600 bg-gradient-to-r from-blue-950/70 to-purple-950/70 backdrop-blur-xl",
83
+ "gradient-green": "border-gradient-to-r from-green-600 to-lime-600 bg-gradient-to-r from-green-950/70 to-lime-950/70 backdrop-blur-xl",
84
+ "gradient-red": "border-gradient-to-r from-red-600 to-pink-600 bg-gradient-to-r from-red-950/70 to-pink-950/70 backdrop-blur-xl",
85
+ "gradient-yellow": "border-gradient-to-r from-yellow-600 to-orange-600 bg-gradient-to-r from-yellow-950/70 to-orange-950/70 backdrop-blur-xl",
86
+ "gradient-purple": "border-gradient-to-r from-purple-600 to-pink-600 bg-gradient-to-r from-purple-950/70 to-pink-950/70 backdrop-blur-xl",
87
+ "gradient-teal": "border-gradient-to-r from-teal-600 to-cyan-600 bg-gradient-to-r from-teal-950/70 to-cyan-950/70 backdrop-blur-xl",
88
+ "gradient-indigo": "border-gradient-to-r from-indigo-600 to-purple-600 bg-gradient-to-r from-indigo-950/70 to-purple-950/70 backdrop-blur-xl",
89
+ "gradient-pink": "border-gradient-to-r from-pink-600 to-rose-600 bg-gradient-to-r from-pink-950/70 to-rose-950/70 backdrop-blur-xl",
90
+ "gradient-orange": "border-gradient-to-r from-orange-600 to-red-600 bg-gradient-to-r from-orange-950/70 to-red-950/70 backdrop-blur-xl"
91
+ }
92
+ },
93
+ defaultVariants: {
94
+ appearance: "default"
95
+ }
96
+ }
97
+ );
98
+ var modalContentVariants = cva(
99
+ "fixed left-1/2 z-50 w-[calc(100%-2rem)] max-h-[min(90vh,720px)] translate-x-[-50%] overflow-y-auto border border-white/10 bg-slate-950 p-6 text-slate-50 shadow-[0_24px_80px_rgba(15,23,42,0.55)] focus:outline-none",
100
+ {
101
+ variants: {
102
+ size: {
103
+ sm: "max-w-md",
104
+ md: "max-w-lg",
105
+ lg: "max-w-2xl",
106
+ xl: "max-w-4xl",
107
+ full: "max-w-[calc(100%-2rem)]"
108
+ },
109
+ position: {
110
+ center: "top-1/2 translate-y-[-50%]",
111
+ top: "top-10 translate-y-0",
112
+ bottom: "bottom-10 translate-y-0"
113
+ },
114
+ appearance: {
115
+ default: "bg-slate-950",
116
+ glass: "border-white/15 bg-slate-950/70 backdrop-blur-xl",
117
+ sky: "border-sky-600 bg-sky-950/70 backdrop-blur-xl",
118
+ rose: "border-rose-600 bg-rose-950/70 backdrop-blur-xl",
119
+ purple: "border-purple-600 bg-purple-950/70 backdrop-blur-xl",
120
+ pink: "border-pink-600 bg-pink-950/70 backdrop-blur-xl",
121
+ orange: "border-orange-600 bg-orange-950/70 backdrop-blur-xl",
122
+ yellow: "border-yellow-600 bg-yellow-950/70 backdrop-blur-xl",
123
+ teal: "border-teal-600 bg-teal-950/70 backdrop-blur-xl",
124
+ indigo: "border-indigo-600 bg-indigo-950/70 backdrop-blur-xl",
125
+ emerald: "border-emerald-600 bg-emerald-950/70 backdrop-blur-xl",
126
+ gray: "border-gray-600 bg-gray-950/70 backdrop-blur-xl",
127
+ amber: "border-amber-600 bg-amber-950/70 backdrop-blur-xl",
128
+ violet: "border-violet-600 bg-violet-950/70 backdrop-blur-xl",
129
+ "gradient-blue": "border-gradient-to-r from-blue-600 to-purple-600 bg-gradient-to-r from-blue-950/70 to-purple-950/70 backdrop-blur-xl",
130
+ "gradient-green": "border-gradient-to-r from-green-600 to-lime-600 bg-gradient-to-r from-green-950/70 to-lime-950/70 backdrop-blur-xl",
131
+ "gradient-red": "border-gradient-to-r from-red-600 to-pink-600 bg-gradient-to-r from-red-950/70 to-pink-950/70 backdrop-blur-xl",
132
+ "gradient-yellow": "border-gradient-to-r from-yellow-600 to-orange-600 bg-gradient-to-r from-yellow-950/70 to-orange-950/70 backdrop-blur-xl",
133
+ "gradient-purple": "border-gradient-to-r from-purple-600 to-pink-600 bg-gradient-to-r from-purple-950/70 to-pink-950/70 backdrop-blur-xl",
134
+ "gradient-teal": "border-gradient-to-r from-teal-600 to-cyan-600 bg-gradient-to-r from-teal-950/70 to-cyan-950/70 backdrop-blur-xl",
135
+ "gradient-indigo": "border-gradient-to-r from-indigo-600 to-purple-600 bg-gradient-to-r from-indigo-950/70 to-purple-950/70 backdrop-blur-xl",
136
+ "gradient-pink": "border-gradient-to-r from-pink-600 to-rose-600 bg-gradient-to-r from-pink-950/70 to-rose-950/70 backdrop-blur-xl",
137
+ "gradient-orange": "border-gradient-to-r from-orange-600 to-red-600 bg-gradient-to-r from-orange-950/70 to-red-950/70 backdrop-blur-xl"
138
+ }
139
+ },
140
+ defaultVariants: {
141
+ size: "md",
142
+ position: "center",
143
+ appearance: "default"
144
+ }
145
+ }
146
+ );
147
+
148
+ // src/ui/modal/modal.tsx
149
+ import { jsx, jsxs } from "react/jsx-runtime";
150
+ var ModalContext = createContext(null);
151
+ function useModalContext(component) {
152
+ const ctx = useContext(ModalContext);
153
+ if (!ctx) {
154
+ throw new Error(`${component} must be used within <Modal>`);
155
+ }
156
+ return ctx;
157
+ }
158
+ var FOCUSABLE_SELECTOR = 'a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex="-1"])';
159
+ function useBodyScrollLock(locked) {
160
+ useEffect(() => {
161
+ if (!locked) {
162
+ return;
163
+ }
164
+ const previousOverflow = document.body.style.overflow;
165
+ document.body.style.overflow = "hidden";
166
+ return () => {
167
+ document.body.style.overflow = previousOverflow;
168
+ };
169
+ }, [locked]);
170
+ }
171
+ function Modal({ open, defaultOpen = false, onOpenChange, children }) {
172
+ const isControlled = open !== void 0;
173
+ const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
174
+ const resolvedOpen = isControlled ? Boolean(open) : uncontrolledOpen;
175
+ const setOpen = useCallback(
176
+ (next) => {
177
+ if (!isControlled) {
178
+ setUncontrolledOpen(next);
179
+ }
180
+ onOpenChange?.(next);
181
+ },
182
+ [isControlled, onOpenChange]
183
+ );
184
+ const baseId = useId();
185
+ const titleId = `${baseId}-title`;
186
+ const descriptionId = `${baseId}-description`;
187
+ const contentRef = useRef(null);
188
+ const ctx = useMemo(
189
+ () => ({
190
+ open: resolvedOpen,
191
+ setOpen,
192
+ titleId,
193
+ descriptionId,
194
+ contentRef
195
+ }),
196
+ [descriptionId, resolvedOpen, setOpen, titleId]
197
+ );
198
+ return /* @__PURE__ */ jsx(ModalContext.Provider, { value: ctx, children });
199
+ }
200
+ Modal.displayName = "Modal";
201
+ function ModalTrigger({ className, children, appearance, onClick, ref, ...rest }) {
202
+ const { setOpen } = useModalContext("ModalTrigger");
203
+ return /* @__PURE__ */ jsx(
204
+ "button",
205
+ {
206
+ ref,
207
+ type: "button",
208
+ "data-slot": "modal-trigger",
209
+ className: cn(modalTriggerVariants({ appearance }), className),
210
+ onClick: (event) => {
211
+ onClick?.(event);
212
+ if (!event.defaultPrevented) {
213
+ setOpen(true);
214
+ }
215
+ },
216
+ ...rest,
217
+ children
218
+ }
219
+ );
220
+ }
221
+ ModalTrigger.displayName = "ModalTrigger";
222
+ function ModalContent({
223
+ className,
224
+ size,
225
+ position,
226
+ appearance,
227
+ animation = "scale",
228
+ children,
229
+ ref,
230
+ id,
231
+ style
232
+ }) {
233
+ const { open, setOpen, titleId, descriptionId, contentRef } = useModalContext("ModalContent");
234
+ const reduceMotion = useReducedMotion();
235
+ const overlayMotion = modalOverlayAnimationPresets[reduceMotion ? "fade" : animation];
236
+ const panelMotion = modalOverlayAnimationPresets[reduceMotion ? "fade" : animation];
237
+ useBodyScrollLock(open);
238
+ useEffect(() => {
239
+ if (!open) {
240
+ return;
241
+ }
242
+ const handleKeyDown = (event) => {
243
+ if (event.key === "Escape") {
244
+ setOpen(false);
245
+ }
246
+ };
247
+ window.addEventListener("keydown", handleKeyDown);
248
+ return () => window.removeEventListener("keydown", handleKeyDown);
249
+ }, [open, setOpen]);
250
+ useEffect(() => {
251
+ if (!open) {
252
+ return;
253
+ }
254
+ const node = contentRef.current;
255
+ if (!node) {
256
+ return;
257
+ }
258
+ const focusables = Array.from(
259
+ node.querySelectorAll(FOCUSABLE_SELECTOR)
260
+ ).filter((element) => element.offsetParent !== null || element === node);
261
+ const target = focusables[0] ?? node;
262
+ const previouslyFocused = document.activeElement;
263
+ target.focus();
264
+ const handleFocusIn = (event) => {
265
+ if (!node.contains(event.target)) {
266
+ event.stopPropagation();
267
+ target.focus();
268
+ }
269
+ };
270
+ document.addEventListener("focusin", handleFocusIn);
271
+ return () => {
272
+ document.removeEventListener("focusin", handleFocusIn);
273
+ previouslyFocused?.focus?.();
274
+ };
275
+ }, [contentRef, open]);
276
+ const portalTarget = typeof document !== "undefined" ? document.body : null;
277
+ if (!portalTarget) {
278
+ return null;
279
+ }
280
+ return createPortal(
281
+ /* @__PURE__ */ jsx(AnimatePresence, { children: open ? /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-50", "data-slot": "modal-portal", children: [
282
+ /* @__PURE__ */ jsx(
283
+ motion.button,
284
+ {
285
+ type: "button",
286
+ "aria-hidden": true,
287
+ tabIndex: -1,
288
+ "data-slot": "modal-overlay",
289
+ className: modalOverlayVariants(),
290
+ onClick: () => setOpen(false),
291
+ initial: animation === "none" ? false : overlayMotion.initial,
292
+ animate: animation === "none" ? void 0 : overlayMotion.animate,
293
+ exit: animation === "none" ? void 0 : overlayMotion.exit,
294
+ transition: overlayMotion.transition
295
+ }
296
+ ),
297
+ /* @__PURE__ */ jsx(
298
+ motion.div,
299
+ {
300
+ ref: (node) => {
301
+ contentRef.current = node;
302
+ if (typeof ref === "function") {
303
+ ref(node);
304
+ } else if (ref) {
305
+ ref.current = node;
306
+ }
307
+ },
308
+ role: "dialog",
309
+ "aria-modal": "true",
310
+ "aria-labelledby": titleId,
311
+ "aria-describedby": descriptionId,
312
+ "data-slot": "modal-content",
313
+ tabIndex: -1,
314
+ className: cn(modalContentVariants({ size, position, appearance }), className),
315
+ initial: animation === "none" ? false : panelMotion.initial,
316
+ animate: animation === "none" ? void 0 : panelMotion.animate,
317
+ exit: animation === "none" ? void 0 : panelMotion.exit,
318
+ transition: panelMotion.transition,
319
+ id,
320
+ style,
321
+ children
322
+ }
323
+ )
324
+ ] }) : null }),
325
+ portalTarget
326
+ );
327
+ }
328
+ ModalContent.displayName = "ModalContent";
329
+ function ModalHeader({ className, children }) {
330
+ return /* @__PURE__ */ jsx("header", { "data-slot": "modal-header", className: cn("mb-4 flex flex-col gap-2", className), children });
331
+ }
332
+ ModalHeader.displayName = "ModalHeader";
333
+ function ModalBody({ className, children }) {
334
+ return /* @__PURE__ */ jsx("div", { "data-slot": "modal-body", className: cn("text-sm text-slate-300", className), children });
335
+ }
336
+ ModalBody.displayName = "ModalBody";
337
+ function ModalFooter({ className, children }) {
338
+ return /* @__PURE__ */ jsx("footer", { "data-slot": "modal-footer", className: cn("mt-6 flex justify-end gap-2", className), children });
339
+ }
340
+ ModalFooter.displayName = "ModalFooter";
341
+ function ModalTitle({ className, children }) {
342
+ const { titleId } = useModalContext("ModalTitle");
343
+ return /* @__PURE__ */ jsx("h2", { id: titleId, "data-slot": "modal-title", className: cn("text-lg font-semibold", className), children });
344
+ }
345
+ ModalTitle.displayName = "ModalTitle";
346
+ function ModalDescription({ className, children }) {
347
+ const { descriptionId } = useModalContext("ModalDescription");
348
+ return /* @__PURE__ */ jsx("p", { id: descriptionId, "data-slot": "modal-description", className: cn("text-sm text-slate-400", className), children });
349
+ }
350
+ ModalDescription.displayName = "ModalDescription";
351
+ function ModalClose({ className, children, ...rest }) {
352
+ const { setOpen } = useModalContext("ModalClose");
353
+ return /* @__PURE__ */ jsx(
354
+ "button",
355
+ {
356
+ type: "button",
357
+ "data-slot": "modal-close",
358
+ className: cn(
359
+ "absolute right-4 top-4 inline-flex size-9 items-center justify-center rounded-md text-slate-200 transition hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/30",
360
+ className
361
+ ),
362
+ "aria-label": "Close dialog",
363
+ onClick: () => setOpen(false),
364
+ ...rest,
365
+ children: children ?? "\xD7"
366
+ }
367
+ );
368
+ }
369
+ ModalClose.displayName = "ModalClose";
370
+ export {
371
+ Modal,
372
+ ModalBody,
373
+ ModalClose,
374
+ ModalContent,
375
+ ModalDescription,
376
+ ModalFooter,
377
+ ModalHeader,
378
+ ModalTitle,
379
+ ModalTrigger,
380
+ modalContentVariants,
381
+ modalOverlayAnimationPresets,
382
+ modalOverlayVariants
383
+ };
384
+ //# sourceMappingURL=modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/ui/modal/modal.tsx","../../src/lib/utils.ts","../../src/ui/modal/animations.ts","../../src/ui/modal/variants.ts"],"sourcesContent":["\"use client\";\n\nimport {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from \"framer-motion\";\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport { cn } from \"../../lib/utils\";\n\nimport { modalOverlayAnimationPresets } from \"./animations\";\nimport type {\n ModalContentProps,\n ModalProps,\n ModalSectionProps,\n ModalTriggerProps,\n} from \"./types\";\nimport { modalContentVariants, modalOverlayVariants, modalTriggerVariants } from \"./variants\";\n\ntype ModalCtx = {\n open: boolean;\n setOpen: (next: boolean) => void;\n titleId: string;\n descriptionId: string;\n contentRef: React.RefObject<HTMLDivElement | null>;\n};\n\nconst ModalContext = createContext<ModalCtx | null>(null);\n\nfunction useModalContext(component: string): ModalCtx {\n const ctx = useContext(ModalContext);\n if (!ctx) {\n throw new Error(`${component} must be used within <Modal>`);\n }\n return ctx;\n}\n\nconst FOCUSABLE_SELECTOR =\n 'a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex=\"-1\"])';\n\nfunction useBodyScrollLock(locked: boolean) {\n useEffect(() => {\n if (!locked) {\n return;\n }\n const previousOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n return () => {\n document.body.style.overflow = previousOverflow;\n };\n }, [locked]);\n}\n\nexport function Modal({ open, defaultOpen = false, onOpenChange, children }: ModalProps) {\n const isControlled = open !== undefined;\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const resolvedOpen = isControlled ? Boolean(open) : uncontrolledOpen;\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isControlled) {\n setUncontrolledOpen(next);\n }\n onOpenChange?.(next);\n },\n [isControlled, onOpenChange],\n );\n\n const baseId = useId();\n const titleId = `${baseId}-title`;\n const descriptionId = `${baseId}-description`;\n const contentRef = useRef<HTMLDivElement | null>(null);\n\n const ctx = useMemo(\n () => ({\n open: resolvedOpen,\n setOpen,\n titleId,\n descriptionId,\n contentRef,\n }),\n [descriptionId, resolvedOpen, setOpen, titleId],\n );\n\n return <ModalContext.Provider value={ctx}>{children}</ModalContext.Provider>;\n}\n\nModal.displayName = \"Modal\";\n\nexport function ModalTrigger({ className, children, appearance, onClick, ref, ...rest }: ModalTriggerProps) {\n const { setOpen } = useModalContext(\"ModalTrigger\");\n return (\n <button\n ref={ref}\n type=\"button\"\n data-slot=\"modal-trigger\"\n className={cn(modalTriggerVariants({ appearance }), className)}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n setOpen(true);\n }\n }}\n {...rest}\n >\n {children}\n </button>\n );\n}\n\nModalTrigger.displayName = \"ModalTrigger\";\n\nexport function ModalContent({\n className,\n size,\n position,\n appearance,\n animation = \"scale\",\n children,\n ref,\n id,\n style,\n}: ModalContentProps) {\n const { open, setOpen, titleId, descriptionId, contentRef } = useModalContext(\"ModalContent\");\n const reduceMotion = useReducedMotion();\n const overlayMotion = modalOverlayAnimationPresets[reduceMotion ? \"fade\" : animation];\n const panelMotion = modalOverlayAnimationPresets[reduceMotion ? \"fade\" : animation];\n\n useBodyScrollLock(open);\n\n useEffect(() => {\n if (!open) {\n return;\n }\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n setOpen(false);\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => window.removeEventListener(\"keydown\", handleKeyDown);\n }, [open, setOpen]);\n\n useEffect(() => {\n if (!open) {\n return;\n }\n const node = contentRef.current;\n if (!node) {\n return;\n }\n const focusables = Array.from(\n node.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),\n ).filter((element) => element.offsetParent !== null || element === node);\n const target = focusables[0] ?? node;\n const previouslyFocused = document.activeElement as HTMLElement | null;\n target.focus();\n\n const handleFocusIn = (event: FocusEvent) => {\n if (!node.contains(event.target as Node)) {\n event.stopPropagation();\n target.focus();\n }\n };\n document.addEventListener(\"focusin\", handleFocusIn);\n return () => {\n document.removeEventListener(\"focusin\", handleFocusIn);\n previouslyFocused?.focus?.();\n };\n }, [contentRef, open]);\n\n const portalTarget = typeof document !== \"undefined\" ? document.body : null;\n\n if (!portalTarget) {\n return null;\n }\n\n return createPortal(\n <AnimatePresence>\n {open ? (\n <div className=\"fixed inset-0 z-50\" data-slot=\"modal-portal\">\n <motion.button\n type=\"button\"\n aria-hidden\n tabIndex={-1}\n data-slot=\"modal-overlay\"\n className={modalOverlayVariants()}\n onClick={() => setOpen(false)}\n initial={animation === \"none\" ? false : overlayMotion.initial}\n animate={animation === \"none\" ? undefined : overlayMotion.animate}\n exit={animation === \"none\" ? undefined : overlayMotion.exit}\n transition={overlayMotion.transition}\n />\n <motion.div\n ref={(node) => {\n contentRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n (ref as React.RefObject<HTMLDivElement | null>).current = node;\n }\n }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n aria-describedby={descriptionId}\n data-slot=\"modal-content\"\n tabIndex={-1}\n className={cn(modalContentVariants({ size, position, appearance }), className)}\n initial={animation === \"none\" ? false : panelMotion.initial}\n animate={animation === \"none\" ? undefined : panelMotion.animate}\n exit={animation === \"none\" ? undefined : panelMotion.exit}\n transition={panelMotion.transition}\n id={id}\n style={style}\n >\n {children}\n </motion.div>\n </div>\n ) : null}\n </AnimatePresence>,\n portalTarget,\n );\n}\n\nModalContent.displayName = \"ModalContent\";\n\nexport function ModalHeader({ className, children }: ModalSectionProps) {\n return (\n <header data-slot=\"modal-header\" className={cn(\"mb-4 flex flex-col gap-2\", className)}>\n {children}\n </header>\n );\n}\n\nModalHeader.displayName = \"ModalHeader\";\n\nexport function ModalBody({ className, children }: ModalSectionProps) {\n return (\n <div data-slot=\"modal-body\" className={cn(\"text-sm text-slate-300\", className)}>\n {children}\n </div>\n );\n}\n\nModalBody.displayName = \"ModalBody\";\n\nexport function ModalFooter({ className, children }: ModalSectionProps) {\n return (\n <footer data-slot=\"modal-footer\" className={cn(\"mt-6 flex justify-end gap-2\", className)}>\n {children}\n </footer>\n );\n}\n\nModalFooter.displayName = \"ModalFooter\";\n\nexport function ModalTitle({ className, children }: ModalSectionProps) {\n const { titleId } = useModalContext(\"ModalTitle\");\n return (\n <h2 id={titleId} data-slot=\"modal-title\" className={cn(\"text-lg font-semibold\", className)}>\n {children}\n </h2>\n );\n}\n\nModalTitle.displayName = \"ModalTitle\";\n\nexport function ModalDescription({ className, children }: ModalSectionProps) {\n const { descriptionId } = useModalContext(\"ModalDescription\");\n return (\n <p id={descriptionId} data-slot=\"modal-description\" className={cn(\"text-sm text-slate-400\", className)}>\n {children}\n </p>\n );\n}\n\nModalDescription.displayName = \"ModalDescription\";\n\nexport function ModalClose({ className, children, ...rest }: ModalSectionProps) {\n const { setOpen } = useModalContext(\"ModalClose\");\n return (\n <button\n type=\"button\"\n data-slot=\"modal-close\"\n className={cn(\n \"absolute right-4 top-4 inline-flex size-9 items-center justify-center rounded-md text-slate-200 transition hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/30\",\n className,\n )}\n aria-label=\"Close dialog\"\n onClick={() => setOpen(false)}\n {...rest}\n >\n {children ?? \"×\"}\n </button>\n );\n}\n\nModalClose.displayName = \"ModalClose\";\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}","import type { HTMLMotionProps } from \"framer-motion\";\n\nimport type { ModalAnimation } from \"./types\";\n\ntype ModalPresetMotionProps = Pick<\n HTMLMotionProps<\"div\">,\n \"initial\" | \"animate\" | \"exit\" | \"transition\"\n>;\n\nexport type ModalAnimationPresets = Record<ModalAnimation, ModalPresetMotionProps>;\n\nexport const modalOverlayAnimationPresets: ModalAnimationPresets = {\n none: {},\n fade: {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n transition: { duration: 0.2 },\n },\n scale: {\n initial: { opacity: 0, scale: 0.96 },\n animate: { opacity: 1, scale: 1 },\n exit: { opacity: 0, scale: 0.96 },\n transition: { type: \"spring\", stiffness: 420, damping: 32 },\n },\n \"slide-up\": {\n initial: { opacity: 0, y: 24 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: 16 },\n transition: { type: \"spring\", stiffness: 380, damping: 30 },\n },\n \"slide-down\": {\n initial: { opacity: 0, y: -24 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: -16 },\n transition: { type: \"spring\", stiffness: 380, damping: 30 },\n },\n};\n","import { cva } from \"class-variance-authority\";\n\nexport const modalOverlayVariants = cva(\n \"fixed inset-0 z-50 bg-slate-950/70 backdrop-blur-sm data-[state=open]:animate-in\",\n);\n\nexport const modalTriggerVariants = cva(\n \"relative inline-flex shrink-0 cursor-pointer rounded-md border\",\n {\n variants: {\n appearance: {\n default: \"bg-slate-950\",\n glass: \"border-white/15 bg-slate-950/70 backdrop-blur-xl\",\n sky: \"border-sky-600 bg-sky-950/70 backdrop-blur-xl\",\n rose: \"border-rose-600 bg-rose-950/70 backdrop-blur-xl\",\n purple: \"border-purple-600 bg-purple-950/70 backdrop-blur-xl\",\n pink: \"border-pink-600 bg-pink-950/70 backdrop-blur-xl\",\n orange: \"border-orange-600 bg-orange-950/70 backdrop-blur-xl\",\n yellow: \"border-yellow-600 bg-yellow-950/70 backdrop-blur-xl\",\n teal: \"border-teal-600 bg-teal-950/70 backdrop-blur-xl\",\n indigo: \"border-indigo-600 bg-indigo-950/70 backdrop-blur-xl\",\n emerald: \"border-emerald-600 bg-emerald-950/70 backdrop-blur-xl\",\n gray: \"border-gray-600 bg-gray-950/70 backdrop-blur-xl\",\n amber: \"border-amber-600 bg-amber-950/70 backdrop-blur-xl\",\n violet: \"border-violet-600 bg-violet-950/70 backdrop-blur-xl\",\n \"gradient-blue\": \"border-gradient-to-r from-blue-600 to-purple-600 bg-gradient-to-r from-blue-950/70 to-purple-950/70 backdrop-blur-xl\",\n \"gradient-green\": \"border-gradient-to-r from-green-600 to-lime-600 bg-gradient-to-r from-green-950/70 to-lime-950/70 backdrop-blur-xl\",\n \"gradient-red\": \"border-gradient-to-r from-red-600 to-pink-600 bg-gradient-to-r from-red-950/70 to-pink-950/70 backdrop-blur-xl\",\n \"gradient-yellow\": \"border-gradient-to-r from-yellow-600 to-orange-600 bg-gradient-to-r from-yellow-950/70 to-orange-950/70 backdrop-blur-xl\",\n \"gradient-purple\": \"border-gradient-to-r from-purple-600 to-pink-600 bg-gradient-to-r from-purple-950/70 to-pink-950/70 backdrop-blur-xl\",\n \"gradient-teal\": \"border-gradient-to-r from-teal-600 to-cyan-600 bg-gradient-to-r from-teal-950/70 to-cyan-950/70 backdrop-blur-xl\",\n \"gradient-indigo\": \"border-gradient-to-r from-indigo-600 to-purple-600 bg-gradient-to-r from-indigo-950/70 to-purple-950/70 backdrop-blur-xl\",\n \"gradient-pink\": \"border-gradient-to-r from-pink-600 to-rose-600 bg-gradient-to-r from-pink-950/70 to-rose-950/70 backdrop-blur-xl\",\n \"gradient-orange\": \"border-gradient-to-r from-orange-600 to-red-600 bg-gradient-to-r from-orange-950/70 to-red-950/70 backdrop-blur-xl\",\n },\n },\n defaultVariants: {\n appearance: \"default\",\n },\n },\n);\n\nexport const modalContentVariants = cva(\n \"fixed left-1/2 z-50 w-[calc(100%-2rem)] max-h-[min(90vh,720px)] translate-x-[-50%] overflow-y-auto border border-white/10 bg-slate-950 p-6 text-slate-50 shadow-[0_24px_80px_rgba(15,23,42,0.55)] focus:outline-none\",\n {\n variants: {\n size: {\n sm: \"max-w-md\",\n md: \"max-w-lg\",\n lg: \"max-w-2xl\",\n xl: \"max-w-4xl\",\n full: \"max-w-[calc(100%-2rem)]\",\n },\n position: {\n center: \"top-1/2 translate-y-[-50%]\",\n top: \"top-10 translate-y-0\",\n bottom: \"bottom-10 translate-y-0\",\n },\n appearance: {\n default: \"bg-slate-950\",\n glass: \"border-white/15 bg-slate-950/70 backdrop-blur-xl\",\n sky: \"border-sky-600 bg-sky-950/70 backdrop-blur-xl\",\n rose: \"border-rose-600 bg-rose-950/70 backdrop-blur-xl\",\n purple: \"border-purple-600 bg-purple-950/70 backdrop-blur-xl\",\n pink: \"border-pink-600 bg-pink-950/70 backdrop-blur-xl\",\n orange: \"border-orange-600 bg-orange-950/70 backdrop-blur-xl\",\n yellow: \"border-yellow-600 bg-yellow-950/70 backdrop-blur-xl\",\n teal: \"border-teal-600 bg-teal-950/70 backdrop-blur-xl\",\n indigo: \"border-indigo-600 bg-indigo-950/70 backdrop-blur-xl\",\n emerald: \"border-emerald-600 bg-emerald-950/70 backdrop-blur-xl\",\n gray: \"border-gray-600 bg-gray-950/70 backdrop-blur-xl\",\n amber: \"border-amber-600 bg-amber-950/70 backdrop-blur-xl\",\n violet: \"border-violet-600 bg-violet-950/70 backdrop-blur-xl\",\n \"gradient-blue\": \"border-gradient-to-r from-blue-600 to-purple-600 bg-gradient-to-r from-blue-950/70 to-purple-950/70 backdrop-blur-xl\",\n \"gradient-green\": \"border-gradient-to-r from-green-600 to-lime-600 bg-gradient-to-r from-green-950/70 to-lime-950/70 backdrop-blur-xl\",\n \"gradient-red\": \"border-gradient-to-r from-red-600 to-pink-600 bg-gradient-to-r from-red-950/70 to-pink-950/70 backdrop-blur-xl\",\n \"gradient-yellow\": \"border-gradient-to-r from-yellow-600 to-orange-600 bg-gradient-to-r from-yellow-950/70 to-orange-950/70 backdrop-blur-xl\",\n \"gradient-purple\": \"border-gradient-to-r from-purple-600 to-pink-600 bg-gradient-to-r from-purple-950/70 to-pink-950/70 backdrop-blur-xl\",\n \"gradient-teal\": \"border-gradient-to-r from-teal-600 to-cyan-600 bg-gradient-to-r from-teal-950/70 to-cyan-950/70 backdrop-blur-xl\",\n \"gradient-indigo\": \"border-gradient-to-r from-indigo-600 to-purple-600 bg-gradient-to-r from-indigo-950/70 to-purple-950/70 backdrop-blur-xl\",\n \"gradient-pink\": \"border-gradient-to-r from-pink-600 to-rose-600 bg-gradient-to-r from-pink-950/70 to-rose-950/70 backdrop-blur-xl\",\n \"gradient-orange\": \"border-gradient-to-r from-orange-600 to-red-600 bg-gradient-to-r from-orange-950/70 to-red-950/70 backdrop-blur-xl\",\n },\n },\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