@zentauri-ui/zentauri-components 0.0.84 → 0.0.91
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/README.md +47 -29
- package/dist/ui/accordion.cjs +311 -0
- package/dist/ui/accordion.cjs.map +1 -0
- package/dist/ui/accordion.d.cts +70 -0
- package/dist/ui/accordion.d.ts +70 -0
- package/dist/ui/accordion.js +286 -0
- package/dist/ui/accordion.js.map +1 -0
- package/dist/ui/alert.cjs +257 -0
- package/dist/ui/alert.cjs.map +1 -0
- package/dist/ui/alert.d.cts +66 -0
- package/dist/ui/alert.d.ts +66 -0
- package/dist/ui/alert.js +224 -0
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/badge.cjs +192 -0
- package/dist/ui/badge.cjs.map +1 -0
- package/dist/ui/badge.d.cts +37 -0
- package/dist/ui/badge.d.ts +37 -0
- package/dist/ui/badge.js +165 -0
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/buttons.cjs +202 -0
- package/dist/ui/buttons.cjs.map +1 -0
- package/dist/ui/buttons.d.cts +27 -0
- package/dist/ui/buttons.d.ts +27 -0
- package/dist/ui/buttons.js +176 -0
- package/dist/ui/buttons.js.map +1 -0
- package/dist/ui/card.cjs +293 -0
- package/dist/ui/card.cjs.map +1 -0
- package/dist/ui/card.d.cts +77 -0
- package/dist/ui/card.d.ts +77 -0
- package/dist/ui/card.js +258 -0
- package/dist/ui/card.js.map +1 -0
- package/dist/ui/divider.cjs +229 -0
- package/dist/ui/divider.cjs.map +1 -0
- package/dist/ui/divider.d.cts +39 -0
- package/dist/ui/divider.d.ts +39 -0
- package/dist/ui/divider.js +200 -0
- package/dist/ui/divider.js.map +1 -0
- package/dist/ui/drawer.cjs +408 -0
- package/dist/ui/drawer.cjs.map +1 -0
- package/dist/ui/drawer.d.cts +81 -0
- package/dist/ui/drawer.d.ts +81 -0
- package/dist/ui/drawer.js +383 -0
- package/dist/ui/drawer.js.map +1 -0
- package/dist/ui/dropdown.cjs +302 -0
- package/dist/ui/dropdown.cjs.map +1 -0
- package/dist/ui/dropdown.d.cts +50 -0
- package/dist/ui/dropdown.d.ts +50 -0
- package/dist/ui/dropdown.js +278 -0
- package/dist/ui/dropdown.js.map +1 -0
- package/dist/ui/empty-state.cjs +186 -0
- package/dist/ui/empty-state.cjs.map +1 -0
- package/dist/ui/empty-state.d.cts +55 -0
- package/dist/ui/empty-state.d.ts +55 -0
- package/dist/ui/empty-state.js +154 -0
- package/dist/ui/empty-state.js.map +1 -0
- package/dist/ui/index.d.cts +27 -1164
- package/dist/ui/index.d.ts +27 -1164
- package/dist/ui/inputs.cjs +458 -0
- package/dist/ui/inputs.cjs.map +1 -0
- package/dist/ui/inputs.d.cts +35 -0
- package/dist/ui/inputs.d.ts +35 -0
- package/dist/ui/inputs.js +432 -0
- package/dist/ui/inputs.js.map +1 -0
- package/dist/ui/modal.cjs +406 -0
- package/dist/ui/modal.cjs.map +1 -0
- package/dist/ui/modal.d.cts +84 -0
- package/dist/ui/modal.d.ts +84 -0
- package/dist/ui/modal.js +384 -0
- package/dist/ui/modal.js.map +1 -0
- package/dist/ui/pagination.cjs +523 -0
- package/dist/ui/pagination.cjs.map +1 -0
- package/dist/ui/pagination.d.cts +114 -0
- package/dist/ui/pagination.d.ts +114 -0
- package/dist/ui/pagination.js +494 -0
- package/dist/ui/pagination.js.map +1 -0
- package/dist/ui/progress.cjs +268 -0
- package/dist/ui/progress.cjs.map +1 -0
- package/dist/ui/progress.d.cts +61 -0
- package/dist/ui/progress.d.ts +61 -0
- package/dist/ui/progress.js +237 -0
- package/dist/ui/progress.js.map +1 -0
- package/dist/ui/select.cjs +360 -0
- package/dist/ui/select.cjs.map +1 -0
- package/dist/ui/select.d.cts +73 -0
- package/dist/ui/select.d.ts +73 -0
- package/dist/ui/select.js +327 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/skeleton.cjs +576 -0
- package/dist/ui/skeleton.cjs.map +1 -0
- package/dist/ui/skeleton.d.cts +90 -0
- package/dist/ui/skeleton.d.ts +90 -0
- package/dist/ui/skeleton.js +544 -0
- package/dist/ui/skeleton.js.map +1 -0
- package/dist/ui/spinner.cjs +219 -0
- package/dist/ui/spinner.cjs.map +1 -0
- package/dist/ui/spinner.d.cts +27 -0
- package/dist/ui/spinner.d.ts +27 -0
- package/dist/ui/spinner.js +193 -0
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/table.cjs +328 -0
- package/dist/ui/table.cjs.map +1 -0
- package/dist/ui/table.d.cts +81 -0
- package/dist/ui/table.d.ts +81 -0
- package/dist/ui/table.js +293 -0
- package/dist/ui/table.js.map +1 -0
- package/dist/ui/tabs.cjs +300 -0
- package/dist/ui/tabs.cjs.map +1 -0
- package/dist/ui/tabs.d.cts +58 -0
- package/dist/ui/tabs.d.ts +58 -0
- package/dist/ui/tabs.js +274 -0
- package/dist/ui/tabs.js.map +1 -0
- package/dist/ui/toast.cjs +285 -0
- package/dist/ui/toast.cjs.map +1 -0
- package/dist/ui/toast.d.cts +86 -0
- package/dist/ui/toast.d.ts +86 -0
- package/dist/ui/toast.js +258 -0
- package/dist/ui/toast.js.map +1 -0
- package/dist/ui/toggle.cjs +185 -0
- package/dist/ui/toggle.cjs.map +1 -0
- package/dist/ui/toggle.d.cts +37 -0
- package/dist/ui/toggle.d.ts +37 -0
- package/dist/ui/toggle.js +158 -0
- package/dist/ui/toggle.js.map +1 -0
- package/dist/ui/tooltip.cjs +242 -0
- package/dist/ui/tooltip.cjs.map +1 -0
- package/dist/ui/tooltip.d.cts +46 -0
- package/dist/ui/tooltip.d.ts +46 -0
- package/dist/ui/tooltip.js +214 -0
- package/dist/ui/tooltip.js.map +1 -0
- package/dist/variants-1Bx3BEeS.d.cts +8 -0
- package/dist/variants-1Bx3BEeS.d.ts +8 -0
- package/package.json +7 -1
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/ui/modal/index.ts
|
|
21
|
+
var modal_exports = {};
|
|
22
|
+
__export(modal_exports, {
|
|
23
|
+
Modal: () => Modal,
|
|
24
|
+
ModalBody: () => ModalBody,
|
|
25
|
+
ModalClose: () => ModalClose,
|
|
26
|
+
ModalContent: () => ModalContent,
|
|
27
|
+
ModalDescription: () => ModalDescription,
|
|
28
|
+
ModalFooter: () => ModalFooter,
|
|
29
|
+
ModalHeader: () => ModalHeader,
|
|
30
|
+
ModalTitle: () => ModalTitle,
|
|
31
|
+
ModalTrigger: () => ModalTrigger,
|
|
32
|
+
modalContentVariants: () => modalContentVariants,
|
|
33
|
+
modalOverlayAnimationPresets: () => modalOverlayAnimationPresets,
|
|
34
|
+
modalOverlayVariants: () => modalOverlayVariants
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(modal_exports);
|
|
37
|
+
|
|
38
|
+
// src/ui/modal/modal.tsx
|
|
39
|
+
var import_framer_motion = require("framer-motion");
|
|
40
|
+
var import_react = require("react");
|
|
41
|
+
var import_react_dom = require("react-dom");
|
|
42
|
+
|
|
43
|
+
// src/lib/utils.ts
|
|
44
|
+
var import_clsx = require("clsx");
|
|
45
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
46
|
+
function cn(...inputs) {
|
|
47
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// src/ui/modal/animations.ts
|
|
51
|
+
var modalOverlayAnimationPresets = {
|
|
52
|
+
none: {},
|
|
53
|
+
fade: {
|
|
54
|
+
initial: { opacity: 0 },
|
|
55
|
+
animate: { opacity: 1 },
|
|
56
|
+
exit: { opacity: 0 },
|
|
57
|
+
transition: { duration: 0.2 }
|
|
58
|
+
},
|
|
59
|
+
scale: {
|
|
60
|
+
initial: { opacity: 0, scale: 0.96 },
|
|
61
|
+
animate: { opacity: 1, scale: 1 },
|
|
62
|
+
exit: { opacity: 0, scale: 0.96 },
|
|
63
|
+
transition: { type: "spring", stiffness: 420, damping: 32 }
|
|
64
|
+
},
|
|
65
|
+
"slide-up": {
|
|
66
|
+
initial: { opacity: 0, y: 24 },
|
|
67
|
+
animate: { opacity: 1, y: 0 },
|
|
68
|
+
exit: { opacity: 0, y: 16 },
|
|
69
|
+
transition: { type: "spring", stiffness: 380, damping: 30 }
|
|
70
|
+
},
|
|
71
|
+
"slide-down": {
|
|
72
|
+
initial: { opacity: 0, y: -24 },
|
|
73
|
+
animate: { opacity: 1, y: 0 },
|
|
74
|
+
exit: { opacity: 0, y: -16 },
|
|
75
|
+
transition: { type: "spring", stiffness: 380, damping: 30 }
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// src/ui/modal/variants.ts
|
|
80
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
81
|
+
var modalOverlayVariants = (0, import_class_variance_authority.cva)(
|
|
82
|
+
"fixed inset-0 z-50 bg-slate-950/70 backdrop-blur-sm data-[state=open]:animate-in"
|
|
83
|
+
);
|
|
84
|
+
var modalTriggerVariants = (0, import_class_variance_authority.cva)(
|
|
85
|
+
"relative inline-flex shrink-0 cursor-pointer rounded-md border",
|
|
86
|
+
{
|
|
87
|
+
variants: {
|
|
88
|
+
appearance: {
|
|
89
|
+
default: "bg-slate-950",
|
|
90
|
+
glass: "border-white/15 bg-slate-950/70 backdrop-blur-xl",
|
|
91
|
+
sky: "border-sky-600 bg-sky-950/70 backdrop-blur-xl",
|
|
92
|
+
rose: "border-rose-600 bg-rose-950/70 backdrop-blur-xl",
|
|
93
|
+
purple: "border-purple-600 bg-purple-950/70 backdrop-blur-xl",
|
|
94
|
+
pink: "border-pink-600 bg-pink-950/70 backdrop-blur-xl",
|
|
95
|
+
orange: "border-orange-600 bg-orange-950/70 backdrop-blur-xl",
|
|
96
|
+
yellow: "border-yellow-600 bg-yellow-950/70 backdrop-blur-xl",
|
|
97
|
+
teal: "border-teal-600 bg-teal-950/70 backdrop-blur-xl",
|
|
98
|
+
indigo: "border-indigo-600 bg-indigo-950/70 backdrop-blur-xl",
|
|
99
|
+
emerald: "border-emerald-600 bg-emerald-950/70 backdrop-blur-xl",
|
|
100
|
+
gray: "border-gray-600 bg-gray-950/70 backdrop-blur-xl",
|
|
101
|
+
amber: "border-amber-600 bg-amber-950/70 backdrop-blur-xl",
|
|
102
|
+
violet: "border-violet-600 bg-violet-950/70 backdrop-blur-xl",
|
|
103
|
+
"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",
|
|
104
|
+
"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",
|
|
105
|
+
"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",
|
|
106
|
+
"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",
|
|
107
|
+
"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",
|
|
108
|
+
"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",
|
|
109
|
+
"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",
|
|
110
|
+
"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",
|
|
111
|
+
"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"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
defaultVariants: {
|
|
115
|
+
appearance: "default"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
var modalContentVariants = (0, import_class_variance_authority.cva)(
|
|
120
|
+
"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",
|
|
121
|
+
{
|
|
122
|
+
variants: {
|
|
123
|
+
size: {
|
|
124
|
+
sm: "max-w-md",
|
|
125
|
+
md: "max-w-lg",
|
|
126
|
+
lg: "max-w-2xl",
|
|
127
|
+
xl: "max-w-4xl",
|
|
128
|
+
full: "max-w-[calc(100%-2rem)]"
|
|
129
|
+
},
|
|
130
|
+
position: {
|
|
131
|
+
center: "top-1/2 translate-y-[-50%]",
|
|
132
|
+
top: "top-10 translate-y-0",
|
|
133
|
+
bottom: "bottom-10 translate-y-0"
|
|
134
|
+
},
|
|
135
|
+
appearance: {
|
|
136
|
+
default: "bg-slate-950",
|
|
137
|
+
glass: "border-white/15 bg-slate-950/70 backdrop-blur-xl",
|
|
138
|
+
sky: "border-sky-600 bg-sky-950/70 backdrop-blur-xl",
|
|
139
|
+
rose: "border-rose-600 bg-rose-950/70 backdrop-blur-xl",
|
|
140
|
+
purple: "border-purple-600 bg-purple-950/70 backdrop-blur-xl",
|
|
141
|
+
pink: "border-pink-600 bg-pink-950/70 backdrop-blur-xl",
|
|
142
|
+
orange: "border-orange-600 bg-orange-950/70 backdrop-blur-xl",
|
|
143
|
+
yellow: "border-yellow-600 bg-yellow-950/70 backdrop-blur-xl",
|
|
144
|
+
teal: "border-teal-600 bg-teal-950/70 backdrop-blur-xl",
|
|
145
|
+
indigo: "border-indigo-600 bg-indigo-950/70 backdrop-blur-xl",
|
|
146
|
+
emerald: "border-emerald-600 bg-emerald-950/70 backdrop-blur-xl",
|
|
147
|
+
gray: "border-gray-600 bg-gray-950/70 backdrop-blur-xl",
|
|
148
|
+
amber: "border-amber-600 bg-amber-950/70 backdrop-blur-xl",
|
|
149
|
+
violet: "border-violet-600 bg-violet-950/70 backdrop-blur-xl",
|
|
150
|
+
"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",
|
|
151
|
+
"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",
|
|
152
|
+
"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",
|
|
153
|
+
"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",
|
|
154
|
+
"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",
|
|
155
|
+
"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",
|
|
156
|
+
"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",
|
|
157
|
+
"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",
|
|
158
|
+
"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"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
defaultVariants: {
|
|
162
|
+
size: "md",
|
|
163
|
+
position: "center",
|
|
164
|
+
appearance: "default"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
// src/ui/modal/modal.tsx
|
|
170
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
171
|
+
var ModalContext = (0, import_react.createContext)(null);
|
|
172
|
+
function useModalContext(component) {
|
|
173
|
+
const ctx = (0, import_react.useContext)(ModalContext);
|
|
174
|
+
if (!ctx) {
|
|
175
|
+
throw new Error(`${component} must be used within <Modal>`);
|
|
176
|
+
}
|
|
177
|
+
return ctx;
|
|
178
|
+
}
|
|
179
|
+
var FOCUSABLE_SELECTOR = 'a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex="-1"])';
|
|
180
|
+
function useBodyScrollLock(locked) {
|
|
181
|
+
(0, import_react.useEffect)(() => {
|
|
182
|
+
if (!locked) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const previousOverflow = document.body.style.overflow;
|
|
186
|
+
document.body.style.overflow = "hidden";
|
|
187
|
+
return () => {
|
|
188
|
+
document.body.style.overflow = previousOverflow;
|
|
189
|
+
};
|
|
190
|
+
}, [locked]);
|
|
191
|
+
}
|
|
192
|
+
function Modal({ open, defaultOpen = false, onOpenChange, children }) {
|
|
193
|
+
const isControlled = open !== void 0;
|
|
194
|
+
const [uncontrolledOpen, setUncontrolledOpen] = (0, import_react.useState)(defaultOpen);
|
|
195
|
+
const resolvedOpen = isControlled ? Boolean(open) : uncontrolledOpen;
|
|
196
|
+
const setOpen = (0, import_react.useCallback)(
|
|
197
|
+
(next) => {
|
|
198
|
+
if (!isControlled) {
|
|
199
|
+
setUncontrolledOpen(next);
|
|
200
|
+
}
|
|
201
|
+
onOpenChange?.(next);
|
|
202
|
+
},
|
|
203
|
+
[isControlled, onOpenChange]
|
|
204
|
+
);
|
|
205
|
+
const baseId = (0, import_react.useId)();
|
|
206
|
+
const titleId = `${baseId}-title`;
|
|
207
|
+
const descriptionId = `${baseId}-description`;
|
|
208
|
+
const contentRef = (0, import_react.useRef)(null);
|
|
209
|
+
const ctx = (0, import_react.useMemo)(
|
|
210
|
+
() => ({
|
|
211
|
+
open: resolvedOpen,
|
|
212
|
+
setOpen,
|
|
213
|
+
titleId,
|
|
214
|
+
descriptionId,
|
|
215
|
+
contentRef
|
|
216
|
+
}),
|
|
217
|
+
[descriptionId, resolvedOpen, setOpen, titleId]
|
|
218
|
+
);
|
|
219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalContext.Provider, { value: ctx, children });
|
|
220
|
+
}
|
|
221
|
+
Modal.displayName = "Modal";
|
|
222
|
+
function ModalTrigger({ className, children, appearance, onClick, ref, ...rest }) {
|
|
223
|
+
const { setOpen } = useModalContext("ModalTrigger");
|
|
224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
225
|
+
"button",
|
|
226
|
+
{
|
|
227
|
+
ref,
|
|
228
|
+
type: "button",
|
|
229
|
+
"data-slot": "modal-trigger",
|
|
230
|
+
className: cn(modalTriggerVariants({ appearance }), className),
|
|
231
|
+
onClick: (event) => {
|
|
232
|
+
onClick?.(event);
|
|
233
|
+
if (!event.defaultPrevented) {
|
|
234
|
+
setOpen(true);
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
...rest,
|
|
238
|
+
children
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
ModalTrigger.displayName = "ModalTrigger";
|
|
243
|
+
function ModalContent({
|
|
244
|
+
className,
|
|
245
|
+
size,
|
|
246
|
+
position,
|
|
247
|
+
appearance,
|
|
248
|
+
animation = "scale",
|
|
249
|
+
children,
|
|
250
|
+
ref,
|
|
251
|
+
id,
|
|
252
|
+
style
|
|
253
|
+
}) {
|
|
254
|
+
const { open, setOpen, titleId, descriptionId, contentRef } = useModalContext("ModalContent");
|
|
255
|
+
const reduceMotion = (0, import_framer_motion.useReducedMotion)();
|
|
256
|
+
const overlayMotion = modalOverlayAnimationPresets[reduceMotion ? "fade" : animation];
|
|
257
|
+
const panelMotion = modalOverlayAnimationPresets[reduceMotion ? "fade" : animation];
|
|
258
|
+
useBodyScrollLock(open);
|
|
259
|
+
(0, import_react.useEffect)(() => {
|
|
260
|
+
if (!open) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
const handleKeyDown = (event) => {
|
|
264
|
+
if (event.key === "Escape") {
|
|
265
|
+
setOpen(false);
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
269
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
270
|
+
}, [open, setOpen]);
|
|
271
|
+
(0, import_react.useEffect)(() => {
|
|
272
|
+
if (!open) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
const node = contentRef.current;
|
|
276
|
+
if (!node) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const focusables = Array.from(
|
|
280
|
+
node.querySelectorAll(FOCUSABLE_SELECTOR)
|
|
281
|
+
).filter((element) => element.offsetParent !== null || element === node);
|
|
282
|
+
const target = focusables[0] ?? node;
|
|
283
|
+
const previouslyFocused = document.activeElement;
|
|
284
|
+
target.focus();
|
|
285
|
+
const handleFocusIn = (event) => {
|
|
286
|
+
if (!node.contains(event.target)) {
|
|
287
|
+
event.stopPropagation();
|
|
288
|
+
target.focus();
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
document.addEventListener("focusin", handleFocusIn);
|
|
292
|
+
return () => {
|
|
293
|
+
document.removeEventListener("focusin", handleFocusIn);
|
|
294
|
+
previouslyFocused?.focus?.();
|
|
295
|
+
};
|
|
296
|
+
}, [contentRef, open]);
|
|
297
|
+
const portalTarget = typeof document !== "undefined" ? document.body : null;
|
|
298
|
+
if (!portalTarget) {
|
|
299
|
+
return null;
|
|
300
|
+
}
|
|
301
|
+
return (0, import_react_dom.createPortal)(
|
|
302
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.AnimatePresence, { children: open ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "fixed inset-0 z-50", "data-slot": "modal-portal", children: [
|
|
303
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
304
|
+
import_framer_motion.motion.button,
|
|
305
|
+
{
|
|
306
|
+
type: "button",
|
|
307
|
+
"aria-hidden": true,
|
|
308
|
+
tabIndex: -1,
|
|
309
|
+
"data-slot": "modal-overlay",
|
|
310
|
+
className: modalOverlayVariants(),
|
|
311
|
+
onClick: () => setOpen(false),
|
|
312
|
+
initial: animation === "none" ? false : overlayMotion.initial,
|
|
313
|
+
animate: animation === "none" ? void 0 : overlayMotion.animate,
|
|
314
|
+
exit: animation === "none" ? void 0 : overlayMotion.exit,
|
|
315
|
+
transition: overlayMotion.transition
|
|
316
|
+
}
|
|
317
|
+
),
|
|
318
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
319
|
+
import_framer_motion.motion.div,
|
|
320
|
+
{
|
|
321
|
+
ref: (node) => {
|
|
322
|
+
contentRef.current = node;
|
|
323
|
+
if (typeof ref === "function") {
|
|
324
|
+
ref(node);
|
|
325
|
+
} else if (ref) {
|
|
326
|
+
ref.current = node;
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
role: "dialog",
|
|
330
|
+
"aria-modal": "true",
|
|
331
|
+
"aria-labelledby": titleId,
|
|
332
|
+
"aria-describedby": descriptionId,
|
|
333
|
+
"data-slot": "modal-content",
|
|
334
|
+
tabIndex: -1,
|
|
335
|
+
className: cn(modalContentVariants({ size, position, appearance }), className),
|
|
336
|
+
initial: animation === "none" ? false : panelMotion.initial,
|
|
337
|
+
animate: animation === "none" ? void 0 : panelMotion.animate,
|
|
338
|
+
exit: animation === "none" ? void 0 : panelMotion.exit,
|
|
339
|
+
transition: panelMotion.transition,
|
|
340
|
+
id,
|
|
341
|
+
style,
|
|
342
|
+
children
|
|
343
|
+
}
|
|
344
|
+
)
|
|
345
|
+
] }) : null }),
|
|
346
|
+
portalTarget
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
ModalContent.displayName = "ModalContent";
|
|
350
|
+
function ModalHeader({ className, children }) {
|
|
351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("header", { "data-slot": "modal-header", className: cn("mb-4 flex flex-col gap-2", className), children });
|
|
352
|
+
}
|
|
353
|
+
ModalHeader.displayName = "ModalHeader";
|
|
354
|
+
function ModalBody({ className, children }) {
|
|
355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { "data-slot": "modal-body", className: cn("text-sm text-slate-300", className), children });
|
|
356
|
+
}
|
|
357
|
+
ModalBody.displayName = "ModalBody";
|
|
358
|
+
function ModalFooter({ className, children }) {
|
|
359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("footer", { "data-slot": "modal-footer", className: cn("mt-6 flex justify-end gap-2", className), children });
|
|
360
|
+
}
|
|
361
|
+
ModalFooter.displayName = "ModalFooter";
|
|
362
|
+
function ModalTitle({ className, children }) {
|
|
363
|
+
const { titleId } = useModalContext("ModalTitle");
|
|
364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { id: titleId, "data-slot": "modal-title", className: cn("text-lg font-semibold", className), children });
|
|
365
|
+
}
|
|
366
|
+
ModalTitle.displayName = "ModalTitle";
|
|
367
|
+
function ModalDescription({ className, children }) {
|
|
368
|
+
const { descriptionId } = useModalContext("ModalDescription");
|
|
369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { id: descriptionId, "data-slot": "modal-description", className: cn("text-sm text-slate-400", className), children });
|
|
370
|
+
}
|
|
371
|
+
ModalDescription.displayName = "ModalDescription";
|
|
372
|
+
function ModalClose({ className, children, ...rest }) {
|
|
373
|
+
const { setOpen } = useModalContext("ModalClose");
|
|
374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
375
|
+
"button",
|
|
376
|
+
{
|
|
377
|
+
type: "button",
|
|
378
|
+
"data-slot": "modal-close",
|
|
379
|
+
className: cn(
|
|
380
|
+
"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",
|
|
381
|
+
className
|
|
382
|
+
),
|
|
383
|
+
"aria-label": "Close dialog",
|
|
384
|
+
onClick: () => setOpen(false),
|
|
385
|
+
...rest,
|
|
386
|
+
children: children ?? "\xD7"
|
|
387
|
+
}
|
|
388
|
+
);
|
|
389
|
+
}
|
|
390
|
+
ModalClose.displayName = "ModalClose";
|
|
391
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
392
|
+
0 && (module.exports = {
|
|
393
|
+
Modal,
|
|
394
|
+
ModalBody,
|
|
395
|
+
ModalClose,
|
|
396
|
+
ModalContent,
|
|
397
|
+
ModalDescription,
|
|
398
|
+
ModalFooter,
|
|
399
|
+
ModalHeader,
|
|
400
|
+
ModalTitle,
|
|
401
|
+
ModalTrigger,
|
|
402
|
+
modalContentVariants,
|
|
403
|
+
modalOverlayAnimationPresets,
|
|
404
|
+
modalOverlayVariants
|
|
405
|
+
});
|
|
406
|
+
//# sourceMappingURL=modal.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ui/modal/index.ts","../../src/ui/modal/modal.tsx","../../src/lib/utils.ts","../../src/ui/modal/animations.ts","../../src/ui/modal/variants.ts"],"sourcesContent":["export {\n Modal,\n ModalBody,\n ModalClose,\n ModalContent,\n ModalDescription,\n ModalFooter,\n ModalHeader,\n ModalTitle,\n ModalTrigger,\n} from \"./modal\";\nexport type {\n ModalAnimation,\n ModalContentProps,\n ModalProps,\n ModalSectionProps,\n ModalTriggerProps,\n} from \"./types\";\nexport { modalOverlayAnimationPresets } from \"./animations\";\nexport { modalContentVariants, modalOverlayVariants } from \"./variants\";\n","\"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 },\n defaultVariants: {\n size: \"md\",\n position: \"center\",\n appearance: \"default\",\n },\n },\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,2BAIO;AACP,mBASO;AACP,uBAA6B;;;ACjB7B,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACMO,IAAM,+BAAsD;AAAA,EACjE,MAAM,CAAC;AAAA,EACP,MAAM;AAAA,IACJ,SAAS,EAAE,SAAS,EAAE;AAAA,IACtB,SAAS,EAAE,SAAS,EAAE;AAAA,IACtB,MAAM,EAAE,SAAS,EAAE;AAAA,IACnB,YAAY,EAAE,UAAU,IAAI;AAAA,EAC9B;AAAA,EACA,OAAO;AAAA,IACL,SAAS,EAAE,SAAS,GAAG,OAAO,KAAK;AAAA,IACnC,SAAS,EAAE,SAAS,GAAG,OAAO,EAAE;AAAA,IAChC,MAAM,EAAE,SAAS,GAAG,OAAO,KAAK;AAAA,IAChC,YAAY,EAAE,MAAM,UAAU,WAAW,KAAK,SAAS,GAAG;A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ACH;AAEJ;AAEA,YAAY,cAAc;AAEnB,SAAS,UAAU,EAAE,WAAW,SAAS,GAAsB;AACpE,SACE,4CAAC,SAAI,aAAU,cAAa,WAAW,GAAG,0BAA0B,SAAS,GAC1E,UACH;AAEJ;AAEA,UAAU,cAAc;AAEjB,SAAS,YAAY,EAAE,WAAW,SAAS,GAAsB;AACtE,SACE,4CAAC,YAAO,aAAU,gBAAe,WAAW,GAAG,+BAA+B,SAAS,GACpF,UACH;AAEJ;AAEA,YAAY,cAAc;AAEnB,SAAS,WAAW,EAAE,WAAW,SAAS,GAAsB;AACrE,QAAM,EAAE,QAAQ,IAAI,gBAAgB,YAAY;AAChD,SACE,4CAAC,QAAG,IAAI,SAAS,aAAU,eAAc,WAAW,GAAG,yBAAyB,SAAS,GACtF,UACH;AAEJ;AAEA,WAAW,cAAc;AAElB,SAAS,iBAAiB,EAAE,WAAW,SAAS,GAAsB;AAC3E,QAAM,EAAE,cAAc,IAAI,gBAAgB,kBAAkB;AAC5D,SACE,4CAAC,OAAE,IAAI,eAAe,aAAU,qBAAoB,WAAW,GAAG,0BAA0B,SAAS,GAClG,UACH;AAEJ;AAEA,iBAAiB,cAAc;AAExB,SAAS,WAAW,EAAE,WAAW,UAAU,GAAG,KAAK,GAAsB;AAC9E,QAAM,EAAE,QAAQ,IAAI,gBAAgB,YAAY;AAChD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACA,cAAW;AAAA,MACX,SAAS,MAAM,QAAQ,KAAK;AAAA,MAC3B,GAAG;AAAA,MAEH,sBAAY;AAAA;AAAA,EACf;AAEJ;AAEA,WAAW,cAAc;","names":[]}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, Ref, CSSProperties, HTMLAttributes } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
7
|
+
|
|
8
|
+
declare const modalOverlayVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
9
|
+
declare const modalTriggerVariants: (props?: ({
|
|
10
|
+
appearance?: "default" | "sky" | "rose" | "purple" | "pink" | "orange" | "yellow" | "teal" | "indigo" | "emerald" | "gradient-blue" | "gradient-green" | "gradient-red" | "gradient-yellow" | "gradient-purple" | "gradient-teal" | "gradient-indigo" | "gradient-pink" | "gradient-orange" | "gray" | "violet" | "glass" | "amber" | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
declare const modalContentVariants: (props?: ({
|
|
13
|
+
size?: "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
|
|
14
|
+
position?: "bottom" | "top" | "center" | null | undefined;
|
|
15
|
+
appearance?: "default" | "sky" | "rose" | "purple" | "pink" | "orange" | "yellow" | "teal" | "indigo" | "emerald" | "gradient-blue" | "gradient-green" | "gradient-red" | "gradient-yellow" | "gradient-purple" | "gradient-teal" | "gradient-indigo" | "gradient-pink" | "gradient-orange" | "gray" | "violet" | "glass" | "amber" | null | undefined;
|
|
16
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
17
|
+
|
|
18
|
+
type ModalAnimation = "none" | "fade" | "scale" | "slide-up" | "slide-down";
|
|
19
|
+
type ModalContentVariantProps = VariantProps<typeof modalContentVariants>;
|
|
20
|
+
type ModalProps = {
|
|
21
|
+
open?: boolean;
|
|
22
|
+
defaultOpen?: boolean;
|
|
23
|
+
onOpenChange?: (open: boolean) => void;
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
};
|
|
26
|
+
type ModalTriggerProps = HTMLAttributes<HTMLButtonElement> & {
|
|
27
|
+
ref?: Ref<HTMLButtonElement>;
|
|
28
|
+
appearance?: VariantProps<typeof modalTriggerVariants>["appearance"];
|
|
29
|
+
};
|
|
30
|
+
type ModalContentProps = ModalContentVariantProps & {
|
|
31
|
+
animation?: ModalAnimation;
|
|
32
|
+
className?: string;
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
ref?: Ref<HTMLDivElement>;
|
|
35
|
+
id?: string;
|
|
36
|
+
style?: CSSProperties;
|
|
37
|
+
};
|
|
38
|
+
type ModalSectionProps = {
|
|
39
|
+
className?: string;
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
declare function Modal({ open, defaultOpen, onOpenChange, children }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
44
|
+
declare namespace Modal {
|
|
45
|
+
var displayName: string;
|
|
46
|
+
}
|
|
47
|
+
declare function ModalTrigger({ className, children, appearance, onClick, ref, ...rest }: ModalTriggerProps): react_jsx_runtime.JSX.Element;
|
|
48
|
+
declare namespace ModalTrigger {
|
|
49
|
+
var displayName: string;
|
|
50
|
+
}
|
|
51
|
+
declare function ModalContent({ className, size, position, appearance, animation, children, ref, id, style, }: ModalContentProps): react.ReactPortal | null;
|
|
52
|
+
declare namespace ModalContent {
|
|
53
|
+
var displayName: string;
|
|
54
|
+
}
|
|
55
|
+
declare function ModalHeader({ className, children }: ModalSectionProps): react_jsx_runtime.JSX.Element;
|
|
56
|
+
declare namespace ModalHeader {
|
|
57
|
+
var displayName: string;
|
|
58
|
+
}
|
|
59
|
+
declare function ModalBody({ className, children }: ModalSectionProps): react_jsx_runtime.JSX.Element;
|
|
60
|
+
declare namespace ModalBody {
|
|
61
|
+
var displayName: string;
|
|
62
|
+
}
|
|
63
|
+
declare function ModalFooter({ className, children }: ModalSectionProps): react_jsx_runtime.JSX.Element;
|
|
64
|
+
declare namespace ModalFooter {
|
|
65
|
+
var displayName: string;
|
|
66
|
+
}
|
|
67
|
+
declare function ModalTitle({ className, children }: ModalSectionProps): react_jsx_runtime.JSX.Element;
|
|
68
|
+
declare namespace ModalTitle {
|
|
69
|
+
var displayName: string;
|
|
70
|
+
}
|
|
71
|
+
declare function ModalDescription({ className, children }: ModalSectionProps): react_jsx_runtime.JSX.Element;
|
|
72
|
+
declare namespace ModalDescription {
|
|
73
|
+
var displayName: string;
|
|
74
|
+
}
|
|
75
|
+
declare function ModalClose({ className, children, ...rest }: ModalSectionProps): react_jsx_runtime.JSX.Element;
|
|
76
|
+
declare namespace ModalClose {
|
|
77
|
+
var displayName: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
type ModalPresetMotionProps = Pick<HTMLMotionProps<"div">, "initial" | "animate" | "exit" | "transition">;
|
|
81
|
+
type ModalAnimationPresets = Record<ModalAnimation, ModalPresetMotionProps>;
|
|
82
|
+
declare const modalOverlayAnimationPresets: ModalAnimationPresets;
|
|
83
|
+
|
|
84
|
+
export { Modal, type ModalAnimation, ModalBody, ModalClose, ModalContent, type ModalContentProps, ModalDescription, ModalFooter, ModalHeader, type ModalProps, type ModalSectionProps, ModalTitle, ModalTrigger, type ModalTriggerProps, modalContentVariants, modalOverlayAnimationPresets, modalOverlayVariants };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, Ref, CSSProperties, HTMLAttributes } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
7
|
+
|
|
8
|
+
declare const modalOverlayVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
9
|
+
declare const modalTriggerVariants: (props?: ({
|
|
10
|
+
appearance?: "default" | "sky" | "rose" | "purple" | "pink" | "orange" | "yellow" | "teal" | "indigo" | "emerald" | "gradient-blue" | "gradient-green" | "gradient-red" | "gradient-yellow" | "gradient-purple" | "gradient-teal" | "gradient-indigo" | "gradient-pink" | "gradient-orange" | "gray" | "violet" | "glass" | "amber" | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
declare const modalContentVariants: (props?: ({
|
|
13
|
+
size?: "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
|
|
14
|
+
position?: "bottom" | "top" | "center" | null | undefined;
|
|
15
|
+
appearance?: "default" | "sky" | "rose" | "purple" | "pink" | "orange" | "yellow" | "teal" | "indigo" | "emerald" | "gradient-blue" | "gradient-green" | "gradient-red" | "gradient-yellow" | "gradient-purple" | "gradient-teal" | "gradient-indigo" | "gradient-pink" | "gradient-orange" | "gray" | "violet" | "glass" | "amber" | null | undefined;
|
|
16
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
17
|
+
|
|
18
|
+
type ModalAnimation = "none" | "fade" | "scale" | "slide-up" | "slide-down";
|
|
19
|
+
type ModalContentVariantProps = VariantProps<typeof modalContentVariants>;
|
|
20
|
+
type ModalProps = {
|
|
21
|
+
open?: boolean;
|
|
22
|
+
defaultOpen?: boolean;
|
|
23
|
+
onOpenChange?: (open: boolean) => void;
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
};
|
|
26
|
+
type ModalTriggerProps = HTMLAttributes<HTMLButtonElement> & {
|
|
27
|
+
ref?: Ref<HTMLButtonElement>;
|
|
28
|
+
appearance?: VariantProps<typeof modalTriggerVariants>["appearance"];
|
|
29
|
+
};
|
|
30
|
+
type ModalContentProps = ModalContentVariantProps & {
|
|
31
|
+
animation?: ModalAnimation;
|
|
32
|
+
className?: string;
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
ref?: Ref<HTMLDivElement>;
|
|
35
|
+
id?: string;
|
|
36
|
+
style?: CSSProperties;
|
|
37
|
+
};
|
|
38
|
+
type ModalSectionProps = {
|
|
39
|
+
className?: string;
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
declare function Modal({ open, defaultOpen, onOpenChange, children }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
44
|
+
declare namespace Modal {
|
|
45
|
+
var displayName: string;
|
|
46
|
+
}
|
|
47
|
+
declare function ModalTrigger({ className, children, appearance, onClick, ref, ...rest }: ModalTriggerProps): react_jsx_runtime.JSX.Element;
|
|
48
|
+
declare namespace ModalTrigger {
|
|
49
|
+
var displayName: string;
|
|
50
|
+
}
|
|
51
|
+
declare function ModalContent({ className, size, position, appearance, animation, children, ref, id, style, }: ModalContentProps): react.ReactPortal | null;
|
|
52
|
+
declare namespace ModalContent {
|
|
53
|
+
var displayName: string;
|
|
54
|
+
}
|
|
55
|
+
declare function ModalHeader({ className, children }: ModalSectionProps): react_jsx_runtime.JSX.Element;
|
|
56
|
+
declare namespace ModalHeader {
|
|
57
|
+
var displayName: string;
|
|
58
|
+
}
|
|
59
|
+
declare function ModalBody({ className, children }: ModalSectionProps): react_jsx_runtime.JSX.Element;
|
|
60
|
+
declare namespace ModalBody {
|
|
61
|
+
var displayName: string;
|
|
62
|
+
}
|
|
63
|
+
declare function ModalFooter({ className, children }: ModalSectionProps): react_jsx_runtime.JSX.Element;
|
|
64
|
+
declare namespace ModalFooter {
|
|
65
|
+
var displayName: string;
|
|
66
|
+
}
|
|
67
|
+
declare function ModalTitle({ className, children }: ModalSectionProps): react_jsx_runtime.JSX.Element;
|
|
68
|
+
declare namespace ModalTitle {
|
|
69
|
+
var displayName: string;
|
|
70
|
+
}
|
|
71
|
+
declare function ModalDescription({ className, children }: ModalSectionProps): react_jsx_runtime.JSX.Element;
|
|
72
|
+
declare namespace ModalDescription {
|
|
73
|
+
var displayName: string;
|
|
74
|
+
}
|
|
75
|
+
declare function ModalClose({ className, children, ...rest }: ModalSectionProps): react_jsx_runtime.JSX.Element;
|
|
76
|
+
declare namespace ModalClose {
|
|
77
|
+
var displayName: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
type ModalPresetMotionProps = Pick<HTMLMotionProps<"div">, "initial" | "animate" | "exit" | "transition">;
|
|
81
|
+
type ModalAnimationPresets = Record<ModalAnimation, ModalPresetMotionProps>;
|
|
82
|
+
declare const modalOverlayAnimationPresets: ModalAnimationPresets;
|
|
83
|
+
|
|
84
|
+
export { Modal, type ModalAnimation, ModalBody, ModalClose, ModalContent, type ModalContentProps, ModalDescription, ModalFooter, ModalHeader, type ModalProps, type ModalSectionProps, ModalTitle, ModalTrigger, type ModalTriggerProps, modalContentVariants, modalOverlayAnimationPresets, modalOverlayVariants };
|