@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,278 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// src/ui/dropdown/dropdown.tsx
|
|
5
|
+
import {
|
|
6
|
+
createContext,
|
|
7
|
+
useContext,
|
|
8
|
+
useState,
|
|
9
|
+
useRef,
|
|
10
|
+
useEffect
|
|
11
|
+
} from "react";
|
|
12
|
+
import { FiCheck } from "react-icons/fi";
|
|
13
|
+
|
|
14
|
+
// src/lib/utils.ts
|
|
15
|
+
import { clsx } from "clsx";
|
|
16
|
+
import { twMerge } from "tailwind-merge";
|
|
17
|
+
function cn(...inputs) {
|
|
18
|
+
return twMerge(clsx(inputs));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// src/ui/dropdown/variants.ts
|
|
22
|
+
import { cva } from "class-variance-authority";
|
|
23
|
+
var triggerVariants = cva(
|
|
24
|
+
"inline-flex items-center justify-between rounded-md font-medium transition focus:outline-none cursor-pointer",
|
|
25
|
+
{
|
|
26
|
+
variants: {
|
|
27
|
+
variant: {
|
|
28
|
+
default: "bg-gray-900 text-white",
|
|
29
|
+
outline: "border border-gray-300",
|
|
30
|
+
ghost: "bg-transparent",
|
|
31
|
+
white: "bg-white text-gray-900",
|
|
32
|
+
black: "bg-black text-white",
|
|
33
|
+
sky: "border border-sky-600 text-sky-600",
|
|
34
|
+
rose: "border border-rose-600 text-rose-600",
|
|
35
|
+
purple: "border border-purple-600 text-purple-600",
|
|
36
|
+
pink: "border border-pink-600 text-pink-600",
|
|
37
|
+
orange: "border border-orange-600 text-orange-600",
|
|
38
|
+
yellow: "border border-yellow-600 text-yellow-600",
|
|
39
|
+
teal: "border border-teal-600 text-teal-600",
|
|
40
|
+
indigo: "border border-indigo-600 text-indigo-600",
|
|
41
|
+
emerald: "border border-emerald-600 text-emerald-600",
|
|
42
|
+
gray: "border border-gray-600 text-gray-600",
|
|
43
|
+
amber: "border border-amber-600 text-amber-600",
|
|
44
|
+
violet: "border border-violet-600 text-violet-600",
|
|
45
|
+
"gradient-blue": "bg-gradient-to-r from-blue-600 to-purple-600 text-gradient-to-r from-blue-600 to-purple-600",
|
|
46
|
+
"gradient-green": "bg-gradient-to-r from-green-600 to-lime-600 text-gradient-to-r from-green-600 to-lime-600",
|
|
47
|
+
"gradient-red": "bg-gradient-to-r from-red-600 to-pink-600 text-gradient-to-r from-red-600 to-pink-600",
|
|
48
|
+
"gradient-yellow": "bg-gradient-to-r from-yellow-600 to-orange-600 text-gradient-to-r from-yellow-600 to-orange-600",
|
|
49
|
+
"gradient-purple": "bg-gradient-to-r from-purple-600 to-pink-600 text-gradient-to-r from-purple-600 to-pink-600",
|
|
50
|
+
"gradient-teal": "bg-gradient-to-r from-teal-600 to-cyan-600 text-gradient-to-r from-teal-600 to-cyan-600",
|
|
51
|
+
"gradient-indigo": "bg-gradient-to-r from-indigo-600 to-purple-600 text-gradient-to-r from-indigo-600 to-purple-600",
|
|
52
|
+
"gradient-pink": "bg-gradient-to-r from-pink-600 to-rose-600 text-gradient-to-r from-pink-600 to-rose-600",
|
|
53
|
+
"gradient-orange": "bg-gradient-to-r from-orange-600 to-red-600 text-gradient-to-r from-orange-600 to-red-600"
|
|
54
|
+
},
|
|
55
|
+
size: {
|
|
56
|
+
sm: "px-2 py-1 text-sm",
|
|
57
|
+
md: "px-3 py-2 text-base",
|
|
58
|
+
lg: "px-4 py-3 text-lg"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
defaultVariants: {
|
|
62
|
+
variant: "default",
|
|
63
|
+
size: "md"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
var contentVariants = cva(
|
|
68
|
+
"absolute min-w-[200px] rounded-md p-2 shadow-md z-50 border",
|
|
69
|
+
{
|
|
70
|
+
variants: {
|
|
71
|
+
placement: {
|
|
72
|
+
top: "bottom-full mb-2",
|
|
73
|
+
bottom: "top-full mt-2",
|
|
74
|
+
left: "right-full mr-2",
|
|
75
|
+
right: "left-full ml-2"
|
|
76
|
+
},
|
|
77
|
+
spacing: {
|
|
78
|
+
none: "space-y-0",
|
|
79
|
+
default: "space-y-1",
|
|
80
|
+
sm: "space-y-2",
|
|
81
|
+
md: "space-y-3",
|
|
82
|
+
lg: "space-y-4",
|
|
83
|
+
xl: "space-y-5"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
defaultVariants: {
|
|
87
|
+
placement: "bottom",
|
|
88
|
+
spacing: "default"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
var itemVariants = cva(
|
|
93
|
+
"flex items-center justify-between px-3 py-2 text-sm cursor-pointer rounded-md transition-colors",
|
|
94
|
+
{
|
|
95
|
+
variants: {
|
|
96
|
+
variant: {
|
|
97
|
+
default: "hover:bg-gray-100 hover:text-gray-900 text-gray-100",
|
|
98
|
+
outline: "hover:bg-gray-100 hover:text-gray-900 border border-white text-gray-100",
|
|
99
|
+
ghost: "hover:bg-gray-100 hover:text-gray-900 bg-transparent text-gray-100",
|
|
100
|
+
white: "hover:bg-gray-100 hover:text-gray-900 bg-white text-gray-900",
|
|
101
|
+
black: "hover:bg-gray-100 hover:text-gray-900 bg-black text-white",
|
|
102
|
+
sky: "hover:bg-sky-100 hover:text-sky-600 bg-sky-200 text-sky-800",
|
|
103
|
+
rose: "hover:bg-rose-100 hover:text-rose-600 bg-rose-200 text-rose-800",
|
|
104
|
+
purple: "hover:bg-purple-100 hover:text-purple-600 bg-purple-200 text-purple-800",
|
|
105
|
+
pink: "hover:bg-pink-100 hover:text-pink-600 bg-pink-200 text-pink-800",
|
|
106
|
+
orange: "hover:bg-orange-100 hover:text-orange-600 bg-orange-200 text-orange-800",
|
|
107
|
+
yellow: "hover:bg-yellow-100 hover:text-yellow-600 bg-yellow-200 text-yellow-800",
|
|
108
|
+
teal: "hover:bg-teal-100 hover:text-teal-600 bg-teal-200 text-teal-800",
|
|
109
|
+
indigo: "hover:bg-indigo-100 hover:text-indigo-600 bg-indigo-200 text-indigo-800",
|
|
110
|
+
emerald: "hover:bg-emerald-100 hover:text-emerald-600 bg-emerald-200 text-emerald-800",
|
|
111
|
+
gray: "hover:bg-gray-100 hover:text-gray-900 bg-gray-200 text-gray-800",
|
|
112
|
+
amber: "hover:bg-amber-100 hover:text-amber-600 bg-amber-200 text-amber-800",
|
|
113
|
+
violet: "hover:bg-violet-100 hover:text-violet-600 bg-violet-200 text-violet-800",
|
|
114
|
+
"gradient-blue": "hover:bg-gradient-to-r from-blue-600 to-purple-600 hover:text-blue-900 bg-gradient-to-r from-blue-200 to-purple-200 text-blue-800",
|
|
115
|
+
"gradient-green": "hover:bg-gradient-to-r from-green-600 to-lime-600 hover:text-green-900 bg-gradient-to-r from-green-200 to-lime-200 text-green-800",
|
|
116
|
+
"gradient-red": "hover:bg-gradient-to-r from-red-600 to-pink-600 hover:text-red-900 bg-gradient-to-r from-red-200 to-pink-200 text-red-800",
|
|
117
|
+
"gradient-yellow": "hover:bg-gradient-to-r from-yellow-600 to-orange-600 hover:text-yellow-900 bg-gradient-to-r from-yellow-200 to-orange-200 text-yellow-800",
|
|
118
|
+
"gradient-purple": "hover:bg-gradient-to-r from-purple-600 to-pink-600 hover:text-purple-900 bg-gradient-to-r from-purple-200 to-pink-200 text-purple-800",
|
|
119
|
+
"gradient-teal": "hover:bg-gradient-to-r from-teal-600 to-cyan-600 hover:text-teal-900 bg-gradient-to-r from-teal-200 to-cyan-200 text-teal-800",
|
|
120
|
+
"gradient-indigo": "hover:bg-gradient-to-r from-indigo-600 to-purple-600 hover:text-indigo-900 bg-gradient-to-r from-indigo-200 to-purple-200 text-indigo-800",
|
|
121
|
+
"gradient-pink": "hover:bg-gradient-to-r from-pink-600 to-rose-600 hover:text-pink-900 bg-gradient-to-r from-pink-200 to-rose-200 text-pink-800",
|
|
122
|
+
"gradient-orange": "hover:bg-gradient-to-r from-orange-600 to-red-600 hover:text-orange-900 bg-gradient-to-r from-orange-200 to-red-200 text-orange-800"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
defaultVariants: {
|
|
126
|
+
variant: "default"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
// src/ui/dropdown/dropdown.tsx
|
|
132
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
133
|
+
var DropdownContext = createContext(null);
|
|
134
|
+
var useDropdown = () => {
|
|
135
|
+
const ctx = useContext(DropdownContext);
|
|
136
|
+
if (!ctx) throw new Error("Use inside Dropdown");
|
|
137
|
+
return ctx;
|
|
138
|
+
};
|
|
139
|
+
var Dropdown = ({
|
|
140
|
+
children,
|
|
141
|
+
defaultOpen = false,
|
|
142
|
+
open: controlledOpen,
|
|
143
|
+
onOpenChange,
|
|
144
|
+
multiSelect = false
|
|
145
|
+
}) => {
|
|
146
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
147
|
+
const [selectedValues, setSelectedValues] = useState([]);
|
|
148
|
+
const open = controlledOpen ?? uncontrolledOpen;
|
|
149
|
+
const setOpen = (val) => {
|
|
150
|
+
if (controlledOpen !== void 0) {
|
|
151
|
+
onOpenChange?.(val);
|
|
152
|
+
} else {
|
|
153
|
+
setUncontrolledOpen(val);
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
const toggle = () => setOpen(!open);
|
|
157
|
+
const toggleSelect = (value) => {
|
|
158
|
+
if (!multiSelect) {
|
|
159
|
+
setSelectedValues([value]);
|
|
160
|
+
setOpen(false);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
setSelectedValues(
|
|
164
|
+
(prev) => prev.includes(value) ? prev.filter((v) => v !== value) : [...prev, value]
|
|
165
|
+
);
|
|
166
|
+
};
|
|
167
|
+
return /* @__PURE__ */ jsx(
|
|
168
|
+
DropdownContext.Provider,
|
|
169
|
+
{
|
|
170
|
+
value: {
|
|
171
|
+
open,
|
|
172
|
+
setOpen,
|
|
173
|
+
toggle,
|
|
174
|
+
selectedValues,
|
|
175
|
+
toggleSelect,
|
|
176
|
+
multiSelect
|
|
177
|
+
},
|
|
178
|
+
children: /* @__PURE__ */ jsx("div", { className: "relative inline-block", children })
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
};
|
|
182
|
+
var DropdownTrigger = ({
|
|
183
|
+
children,
|
|
184
|
+
className,
|
|
185
|
+
variant,
|
|
186
|
+
size,
|
|
187
|
+
...props
|
|
188
|
+
}) => {
|
|
189
|
+
const { toggle } = useDropdown();
|
|
190
|
+
return /* @__PURE__ */ jsx(
|
|
191
|
+
"button",
|
|
192
|
+
{
|
|
193
|
+
onClick: toggle,
|
|
194
|
+
className: cn(triggerVariants({ variant, size }), className),
|
|
195
|
+
...props,
|
|
196
|
+
children
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
};
|
|
200
|
+
var DropdownContent = ({
|
|
201
|
+
children,
|
|
202
|
+
className,
|
|
203
|
+
placement = "bottom",
|
|
204
|
+
spacing = "default",
|
|
205
|
+
divider,
|
|
206
|
+
...props
|
|
207
|
+
}) => {
|
|
208
|
+
const { open, setOpen } = useDropdown();
|
|
209
|
+
const ref = useRef(null);
|
|
210
|
+
useEffect(() => {
|
|
211
|
+
const handleClickOutside = (e) => {
|
|
212
|
+
if (ref.current && !ref.current.contains(e.target)) {
|
|
213
|
+
setOpen(false);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
217
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
218
|
+
}, [setOpen]);
|
|
219
|
+
if (!open) return null;
|
|
220
|
+
return /* @__PURE__ */ jsx(
|
|
221
|
+
"div",
|
|
222
|
+
{
|
|
223
|
+
ref,
|
|
224
|
+
className: cn(contentVariants({ placement, spacing }), className, divider && "divide-y divide-current"),
|
|
225
|
+
...props,
|
|
226
|
+
children
|
|
227
|
+
}
|
|
228
|
+
);
|
|
229
|
+
};
|
|
230
|
+
var DropdownItem = ({
|
|
231
|
+
children,
|
|
232
|
+
value,
|
|
233
|
+
className,
|
|
234
|
+
variant,
|
|
235
|
+
onSelect,
|
|
236
|
+
leftIcon,
|
|
237
|
+
rightIcon,
|
|
238
|
+
...props
|
|
239
|
+
}) => {
|
|
240
|
+
const { toggleSelect, selectedValues } = useDropdown();
|
|
241
|
+
const isSelected = selectedValues.includes(value);
|
|
242
|
+
const handleClick = () => {
|
|
243
|
+
toggleSelect(value);
|
|
244
|
+
onSelect?.();
|
|
245
|
+
};
|
|
246
|
+
return /* @__PURE__ */ jsxs(
|
|
247
|
+
"div",
|
|
248
|
+
{
|
|
249
|
+
tabIndex: 0,
|
|
250
|
+
onClick: handleClick,
|
|
251
|
+
onKeyDown: (e) => {
|
|
252
|
+
if (e.key === "Enter") handleClick();
|
|
253
|
+
},
|
|
254
|
+
className: cn(itemVariants({ variant }), className),
|
|
255
|
+
...props,
|
|
256
|
+
children: [
|
|
257
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
258
|
+
leftIcon,
|
|
259
|
+
children
|
|
260
|
+
] }),
|
|
261
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
262
|
+
isSelected && /* @__PURE__ */ jsx(FiCheck, {}),
|
|
263
|
+
rightIcon
|
|
264
|
+
] })
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
);
|
|
268
|
+
};
|
|
269
|
+
export {
|
|
270
|
+
Dropdown,
|
|
271
|
+
DropdownContent,
|
|
272
|
+
DropdownItem,
|
|
273
|
+
DropdownTrigger,
|
|
274
|
+
contentVariants,
|
|
275
|
+
itemVariants,
|
|
276
|
+
triggerVariants
|
|
277
|
+
};
|
|
278
|
+
//# sourceMappingURL=dropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ui/dropdown/dropdown.tsx","../../src/lib/utils.ts","../../src/ui/dropdown/variants.ts"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n useContext,\n useState,\n useRef,\n useEffect,\n} from \"react\";\nimport { FiCheck } from \"react-icons/fi\";\nimport { cn } from \"../../lib/utils\";\nimport type { DropdownContextType, DropdownProps, DropdownTriggerProps, DropdownContentProps, DropdownItemProps } from \"./types\";\nimport { triggerVariants, contentVariants, itemVariants } from \"./variants\";\n\n/* =========================\n Context\n========================= */\nconst DropdownContext = createContext<DropdownContextType | null>(null);\n\nconst useDropdown = () => {\n const ctx = useContext(DropdownContext);\n if (!ctx) throw new Error(\"Use inside Dropdown\");\n return ctx;\n};\n\n/* =========================\n Root\n========================= */\nexport const Dropdown = ({\n children,\n defaultOpen = false,\n open: controlledOpen,\n onOpenChange,\n multiSelect = false,\n}: DropdownProps) => {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const [selectedValues, setSelectedValues] = useState<string[]>([]);\n\n const open = controlledOpen ?? uncontrolledOpen;\n\n const setOpen = (val: boolean) => {\n if (controlledOpen !== undefined) {\n onOpenChange?.(val);\n } else {\n setUncontrolledOpen(val);\n }\n };\n\n const toggle = () => setOpen(!open);\n\n const toggleSelect = (value: string) => {\n if (!multiSelect) {\n setSelectedValues([value]);\n setOpen(false);\n return;\n }\n\n setSelectedValues((prev) =>\n prev.includes(value)\n ? prev.filter((v) => v !== value)\n : [...prev, value]\n );\n };\n\n return (\n <DropdownContext.Provider\n value={{\n open,\n setOpen,\n toggle,\n selectedValues,\n toggleSelect,\n multiSelect,\n }}\n >\n <div className=\"relative inline-block\">{children}</div>\n </DropdownContext.Provider>\n );\n};\n\n/* =========================\n Trigger\n========================= */\nexport const DropdownTrigger = ({\n children,\n className,\n variant,\n size,\n ...props\n}: DropdownTriggerProps) => {\n const { toggle } = useDropdown();\n\n return (\n <button\n onClick={toggle}\n className={cn(triggerVariants({ variant, size }), className)}\n {...props}\n >\n {children}\n </button>\n );\n};\n\n/* =========================\n Content\n========================= */\nexport const DropdownContent = ({\n children,\n className,\n placement = \"bottom\",\n spacing = \"default\",\n divider,\n ...props\n}: DropdownContentProps) => {\n const { open, setOpen } = useDropdown();\n const ref = useRef<HTMLDivElement>(null);\n\n // click outside\n useEffect(() => {\n const handleClickOutside = (e: MouseEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node)) {\n setOpen(false);\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () =>\n document.removeEventListener(\"mousedown\", handleClickOutside);\n }, [setOpen]);\n\n if (!open) return null;\n\n return (\n <div\n ref={ref}\n className={cn(contentVariants({ placement, spacing }), className, divider && \"divide-y divide-current\")}\n {...props}\n >\n {children}\n </div>\n );\n};\n\n/* =========================\n Item\n========================= */\nexport const DropdownItem = ({\n children,\n value,\n className,\n variant,\n onSelect,\n leftIcon,\n rightIcon,\n ...props\n}: DropdownItemProps) => {\n const { toggleSelect, selectedValues } = useDropdown();\n const isSelected = selectedValues.includes(value);\n\n const handleClick = () => {\n toggleSelect(value);\n onSelect?.();\n };\n\n return (\n <div\n tabIndex={0}\n onClick={handleClick}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") handleClick();\n }}\n className={cn(itemVariants({ variant }), className)}\n {...props}\n >\n <div className=\"flex items-center gap-2\">\n {leftIcon}\n {children}\n </div>\n\n <div className=\"flex items-center gap-2\">\n {isSelected && <FiCheck />}\n {rightIcon}\n </div>\n </div>\n );\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 { cva } from \"class-variance-authority\";\n\nexport const triggerVariants = cva(\n \"inline-flex items-center justify-between rounded-md font-medium transition focus:outline-none cursor-pointer\",\n {\n variants: {\n variant: {\n default: \"bg-gray-900 text-white\",\n outline: \"border border-gray-300\",\n ghost: \"bg-transparent\",\n white: \"bg-white text-gray-900\",\n black: \"bg-black text-white\",\n sky: \"border border-sky-600 text-sky-600\",\n rose: \"border border-rose-600 text-rose-600\",\n purple: \"border border-purple-600 text-purple-600\",\n pink: \"border border-pink-600 text-pink-600\",\n orange: \"border border-orange-600 text-orange-600\",\n yellow: \"border border-yellow-600 text-yellow-600\",\n teal: \"border border-teal-600 text-teal-600\",\n indigo: \"border border-indigo-600 text-indigo-600\",\n emerald: \"border border-emerald-600 text-emerald-600\",\n gray: \"border border-gray-600 text-gray-600\",\n amber: \"border border-amber-600 text-amber-600\",\n violet: \"border border-violet-600 text-violet-600\",\n \"gradient-blue\": \"bg-gradient-to-r from-blue-600 to-purple-600 text-gradient-to-r from-blue-600 to-purple-600\",\n \"gradient-green\": \"bg-gradient-to-r from-green-600 to-lime-600 text-gradient-to-r from-green-600 to-lime-600\",\n \"gradient-red\": \"bg-gradient-to-r from-red-600 to-pink-600 text-gradient-to-r from-red-600 to-pink-600\",\n \"gradient-yellow\": \"bg-gradient-to-r from-yellow-600 to-orange-600 text-gradient-to-r from-yellow-600 to-orange-600\",\n \"gradient-purple\": \"bg-gradient-to-r from-purple-600 to-pink-600 text-gradient-to-r from-purple-600 to-pink-600\",\n \"gradient-teal\": \"bg-gradient-to-r from-teal-600 to-cyan-600 text-gradient-to-r from-teal-600 to-cyan-600\",\n \"gradient-indigo\": \"bg-gradient-to-r from-indigo-600 to-purple-600 text-gradient-to-r from-indigo-600 to-purple-600\",\n \"gradient-pink\": \"bg-gradient-to-r from-pink-600 to-rose-600 text-gradient-to-r from-pink-600 to-rose-600\",\n \"gradient-orange\": \"bg-gradient-to-r from-orange-600 to-red-600 text-gradient-to-r from-orange-600 to-red-600\",\n },\n size: {\n sm: \"px-2 py-1 text-sm\",\n md: \"px-3 py-2 text-base\",\n lg: \"px-4 py-3 text-lg\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n }\n);\n\nexport const contentVariants = cva(\n \"absolute min-w-[200px] rounded-md p-2 shadow-md z-50 border\",\n {\n variants: {\n placement: {\n top: \"bottom-full mb-2\",\n bottom: \"top-full mt-2\",\n left: \"right-full mr-2\",\n right: \"left-full ml-2\",\n },\n spacing:{\n none: \"space-y-0\",\n default: \"space-y-1\",\n sm: \"space-y-2\",\n md: \"space-y-3\",\n lg: \"space-y-4\",\n xl: \"space-y-5\",\n }\n },\n defaultVariants: {\n placement: \"bottom\",\n spacing: \"default\",\n },\n }\n);\n\nexport const itemVariants = cva(\n \"flex items-center justify-between px-3 py-2 text-sm cursor-pointer rounded-md transition-colors\",\n {\n variants: {\n variant: {\n default: \"hover:bg-gray-100 hover:text-gray-900 text-gray-100\",\n outline: \"hover:bg-gray-100 hover:text-gray-900 border border-white text-gray-100\",\n ghost: \"hover:bg-gray-100 hover:text-gray-900 bg-transparent text-gray-100\",\n white: \"hover:bg-gray-100 hover:text-gray-900 bg-white text-gray-900\",\n black: \"hover:bg-gray-100 hover:text-gray-900 bg-black text-white\",\n sky: \"hover:bg-sky-100 hover:text-sky-600 bg-sky-200 text-sky-800\",\n rose: \"hover:bg-rose-100 hover:text-rose-600 bg-rose-200 text-rose-800\",\n purple: \"hover:bg-purple-100 hover:text-purple-600 bg-purple-200 text-purple-800\",\n pink: \"hover:bg-pink-100 hover:text-pink-600 bg-pink-200 text-pink-800\",\n orange: \"hover:bg-orange-100 hover:text-orange-600 bg-orange-200 text-orange-800\",\n yellow: \"hover:bg-yellow-100 hover:text-yellow-600 bg-yellow-200 text-yellow-800\",\n teal: \"hover:bg-teal-100 hover:text-teal-600 bg-teal-200 text-teal-800\",\n indigo: \"hover:bg-indigo-100 hover:text-indigo-600 bg-indigo-200 text-indigo-800\",\n emerald: \"hover:bg-emerald-100 hover:text-emerald-600 bg-emerald-200 text-emerald-800\",\n gray: \"hover:bg-gray-100 hover:text-gray-900 bg-gray-200 text-gray-800\",\n amber: \"hover:bg-amber-100 hover:text-amber-600 bg-amber-200 text-amber-800\",\n violet: \"hover:bg-violet-100 hover:text-violet-600 bg-violet-200 text-violet-800\",\n \"gradient-blue\": \"hover:bg-gradient-to-r from-blue-600 to-purple-600 hover:text-blue-900 bg-gradient-to-r from-blue-200 to-purple-200 text-blue-800\",\n \"gradient-green\": \"hover:bg-gradient-to-r from-green-600 to-lime-600 hover:text-green-900 bg-gradient-to-r from-green-200 to-lime-200 text-green-800\",\n \"gradient-red\": \"hover:bg-gradient-to-r from-red-600 to-pink-600 hover:text-red-900 bg-gradient-to-r from-red-200 to-pink-200 text-red-800\",\n \"gradient-yellow\": \"hover:bg-gradient-to-r from-yellow-600 to-orange-600 hover:text-yellow-900 bg-gradient-to-r from-yellow-200 to-orange-200 text-yellow-800\",\n \"gradient-purple\": \"hover:bg-gradient-to-r from-purple-600 to-pink-600 hover:text-purple-900 bg-gradient-to-r from-purple-200 to-pink-200 text-purple-800\",\n \"gradient-teal\": \"hover:bg-gradient-to-r from-teal-600 to-cyan-600 hover:text-teal-900 bg-gradient-to-r from-teal-200 to-cyan-200 text-teal-800\",\n \"gradient-indigo\": \"hover:bg-gradient-to-r from-indigo-600 to-purple-600 hover:text-indigo-900 bg-gradient-to-r from-indigo-200 to-purple-200 text-indigo-800\",\n \"gradient-pink\": \"hover:bg-gradient-to-r from-pink-600 to-rose-600 hover:text-pink-900 bg-gradient-to-r from-pink-200 to-rose-200 text-pink-800\",\n \"gradient-orange\": \"hover:bg-gradient-to-r from-orange-600 to-red-600 hover:text-orange-900 bg-gradient-to-r from-orange-200 to-red-200 text-orange-800\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);"],"mappings":";;;;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe;;;ACTxB,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACLA,SAAS,WAAW;AAEb,IAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,SAAS;AAAA,QACT,OAAO;AAAA,QACP,OAAO;AAAA,QACP,OAAO;AAAA,QACP,KAAK;AAAA,QACL,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,MAAM;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,QAAM,EAAE,cAAc,eAAe,IAAI,YAAY;AACrD,QAAM,aAAa,eAAe,SAAS,KAAK;AAEhD,QAAM,cAAc,MAAM;AACxB,iBAAa,KAAK;AAClB,eAAW;AAAA,EACb;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU;AAAA,MACV,SAAS;AAAA,MACT,WAAW,CAAC,MAAM;AAChB,YAAI,EAAE,QAAQ,QAAS,aAAY;AAAA,MACrC;AAAA,MACA,WAAW,GAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,MACjD,GAAG;AAAA,MAEJ;AAAA,6BAAC,SAAI,WAAU,2BACZ;AAAA;AAAA,UACA;AAAA,WACH;AAAA,QAEA,qBAAC,SAAI,WAAU,2BACZ;AAAA,wBAAc,oBAAC,WAAQ;AAAA,UACvB;AAAA,WACH;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,186 @@
|
|
|
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/empty-state/index.ts
|
|
21
|
+
var empty_state_exports = {};
|
|
22
|
+
__export(empty_state_exports, {
|
|
23
|
+
EmptyState: () => EmptyState,
|
|
24
|
+
EmptyStateAction: () => EmptyStateAction,
|
|
25
|
+
EmptyStateDescription: () => EmptyStateDescription,
|
|
26
|
+
EmptyStateIcon: () => EmptyStateIcon,
|
|
27
|
+
EmptyStateTitle: () => EmptyStateTitle,
|
|
28
|
+
emptyStateAnimationPresets: () => emptyStateAnimationPresets,
|
|
29
|
+
emptyStateDescriptionVariants: () => emptyStateDescriptionVariants,
|
|
30
|
+
emptyStateTitleVariants: () => emptyStateTitleVariants,
|
|
31
|
+
emptyStateVariants: () => emptyStateVariants
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(empty_state_exports);
|
|
34
|
+
|
|
35
|
+
// src/ui/empty-state/empty-state.tsx
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var import_framer_motion = require("framer-motion");
|
|
38
|
+
|
|
39
|
+
// src/lib/utils.ts
|
|
40
|
+
var import_clsx = require("clsx");
|
|
41
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
42
|
+
function cn(...inputs) {
|
|
43
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// src/ui/empty-state/animations.ts
|
|
47
|
+
var emptyStateAnimationPresets = {
|
|
48
|
+
none: {},
|
|
49
|
+
float: {
|
|
50
|
+
whileHover: { y: -4 },
|
|
51
|
+
transition: { type: "spring", stiffness: 260, damping: 22 }
|
|
52
|
+
},
|
|
53
|
+
fade: {
|
|
54
|
+
initial: { opacity: 0, y: 8 },
|
|
55
|
+
animate: { opacity: 1, y: 0 },
|
|
56
|
+
transition: { duration: 0.25, ease: "easeOut" }
|
|
57
|
+
},
|
|
58
|
+
"slide-up": {
|
|
59
|
+
initial: { opacity: 0, y: 16 },
|
|
60
|
+
animate: { opacity: 1, y: 0 },
|
|
61
|
+
transition: { type: "spring", stiffness: 380, damping: 28 }
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// src/ui/empty-state/variants.ts
|
|
66
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
67
|
+
var emptyStateVariants = (0, import_class_variance_authority.cva)("flex w-full flex-col items-center text-center", {
|
|
68
|
+
variants: {
|
|
69
|
+
size: {
|
|
70
|
+
sm: "gap-2 p-4 text-sm",
|
|
71
|
+
md: "gap-3 p-6 text-sm",
|
|
72
|
+
lg: "gap-4 p-8 text-base"
|
|
73
|
+
},
|
|
74
|
+
appearance: {
|
|
75
|
+
default: "text-slate-50",
|
|
76
|
+
ghost: "text-slate-200",
|
|
77
|
+
card: "rounded-2xl border border-white/10 bg-white/5 p-8 text-slate-50 shadow-[0_18px_48px_rgba(15,23,42,0.35)]"
|
|
78
|
+
},
|
|
79
|
+
align: {
|
|
80
|
+
start: "items-start text-left",
|
|
81
|
+
center: "items-center text-center",
|
|
82
|
+
end: "items-end text-right"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
defaultVariants: {
|
|
86
|
+
size: "md",
|
|
87
|
+
appearance: "default",
|
|
88
|
+
align: "center"
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
var emptyStateTitleVariants = (0, import_class_variance_authority.cva)("font-semibold tracking-tight", {
|
|
92
|
+
variants: {
|
|
93
|
+
size: {
|
|
94
|
+
sm: "text-base",
|
|
95
|
+
md: "text-lg",
|
|
96
|
+
lg: "text-xl"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
defaultVariants: { size: "md" }
|
|
100
|
+
});
|
|
101
|
+
var emptyStateDescriptionVariants = (0, import_class_variance_authority.cva)("max-w-md text-slate-400", {
|
|
102
|
+
variants: {
|
|
103
|
+
size: {
|
|
104
|
+
sm: "text-xs",
|
|
105
|
+
md: "text-sm",
|
|
106
|
+
lg: "text-base"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
defaultVariants: { size: "md" }
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
// src/ui/empty-state/empty-state.tsx
|
|
113
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
114
|
+
var EmptyStateSizeContext = (0, import_react.createContext)("md");
|
|
115
|
+
function useEmptyStateSize() {
|
|
116
|
+
return (0, import_react.useContext)(EmptyStateSizeContext);
|
|
117
|
+
}
|
|
118
|
+
function EmptyState(props) {
|
|
119
|
+
const {
|
|
120
|
+
className,
|
|
121
|
+
size = "md",
|
|
122
|
+
appearance,
|
|
123
|
+
align,
|
|
124
|
+
animation = "none",
|
|
125
|
+
children,
|
|
126
|
+
ref,
|
|
127
|
+
...rest
|
|
128
|
+
} = props;
|
|
129
|
+
const motionProps = emptyStateAnimationPresets[animation];
|
|
130
|
+
const ctx = (0, import_react.useMemo)(() => size ?? "md", [size]);
|
|
131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EmptyStateSizeContext.Provider, { value: ctx, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
132
|
+
import_framer_motion.motion.section,
|
|
133
|
+
{
|
|
134
|
+
ref,
|
|
135
|
+
"data-slot": "empty-state",
|
|
136
|
+
"aria-live": "polite",
|
|
137
|
+
className: cn(emptyStateVariants({ size, appearance, align }), className),
|
|
138
|
+
initial: animation === "none" ? false : void 0,
|
|
139
|
+
...motionProps,
|
|
140
|
+
...rest,
|
|
141
|
+
children
|
|
142
|
+
}
|
|
143
|
+
) });
|
|
144
|
+
}
|
|
145
|
+
EmptyState.displayName = "EmptyState";
|
|
146
|
+
function EmptyStateIcon({ className, children }) {
|
|
147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { "data-slot": "empty-state-icon", className: cn("text-slate-300", className), children });
|
|
148
|
+
}
|
|
149
|
+
EmptyStateIcon.displayName = "EmptyStateIcon";
|
|
150
|
+
function EmptyStateTitle({ className, children }) {
|
|
151
|
+
const size = useEmptyStateSize();
|
|
152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { "data-slot": "empty-state-title", className: cn(emptyStateTitleVariants({ size }), className), children });
|
|
153
|
+
}
|
|
154
|
+
EmptyStateTitle.displayName = "EmptyStateTitle";
|
|
155
|
+
function EmptyStateDescription({
|
|
156
|
+
className,
|
|
157
|
+
children
|
|
158
|
+
}) {
|
|
159
|
+
const size = useEmptyStateSize();
|
|
160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
161
|
+
"p",
|
|
162
|
+
{
|
|
163
|
+
"data-slot": "empty-state-description",
|
|
164
|
+
className: cn(emptyStateDescriptionVariants({ size }), className),
|
|
165
|
+
children
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
EmptyStateDescription.displayName = "EmptyStateDescription";
|
|
170
|
+
function EmptyStateAction({ className, children }) {
|
|
171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { "data-slot": "empty-state-action", className: cn("mt-2", className), children });
|
|
172
|
+
}
|
|
173
|
+
EmptyStateAction.displayName = "EmptyStateAction";
|
|
174
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
175
|
+
0 && (module.exports = {
|
|
176
|
+
EmptyState,
|
|
177
|
+
EmptyStateAction,
|
|
178
|
+
EmptyStateDescription,
|
|
179
|
+
EmptyStateIcon,
|
|
180
|
+
EmptyStateTitle,
|
|
181
|
+
emptyStateAnimationPresets,
|
|
182
|
+
emptyStateDescriptionVariants,
|
|
183
|
+
emptyStateTitleVariants,
|
|
184
|
+
emptyStateVariants
|
|
185
|
+
});
|
|
186
|
+
//# sourceMappingURL=empty-state.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ui/empty-state/index.ts","../../src/ui/empty-state/empty-state.tsx","../../src/lib/utils.ts","../../src/ui/empty-state/animations.ts","../../src/ui/empty-state/variants.ts"],"sourcesContent":["export {\n EmptyState,\n EmptyStateAction,\n EmptyStateDescription,\n EmptyStateIcon,\n EmptyStateTitle,\n} from \"./empty-state\";\nexport type {\n EmptyStateAnimation,\n EmptyStateProps,\n EmptyStateSectionProps,\n} from \"./types\";\nexport { emptyStateAnimationPresets } from \"./animations\";\nexport {\n emptyStateVariants,\n emptyStateTitleVariants,\n emptyStateDescriptionVariants,\n} from \"./variants\";\n","\"use client\";\n\nimport { createContext, useContext, useMemo } from \"react\";\nimport { motion } from \"framer-motion\";\n\nimport { cn } from \"../../lib/utils\";\n\nimport { emptyStateAnimationPresets } from \"./animations\";\nimport type { EmptyStateProps, EmptyStateSectionProps } from \"./types\";\nimport {\n emptyStateDescriptionVariants,\n emptyStateTitleVariants,\n emptyStateVariants,\n} from \"./variants\";\n\ntype EmptyStateSize = NonNullable<EmptyStateProps[\"size\"]>;\n\nconst EmptyStateSizeContext = createContext<EmptyStateSize>(\"md\");\n\nfunction useEmptyStateSize(): EmptyStateSize {\n return useContext(EmptyStateSizeContext);\n}\n\nexport function EmptyState(props: EmptyStateProps) {\n const {\n className,\n size = \"md\",\n appearance,\n align,\n animation = \"none\",\n children,\n ref,\n ...rest\n } = props;\n const motionProps = emptyStateAnimationPresets[animation];\n const ctx = useMemo(() => size ?? \"md\", [size]);\n\n return (\n <EmptyStateSizeContext.Provider value={ctx}>\n <motion.section\n ref={ref}\n data-slot=\"empty-state\"\n aria-live=\"polite\"\n className={cn(emptyStateVariants({ size, appearance, align }), className)}\n initial={animation === \"none\" ? false : undefined}\n {...motionProps}\n {...rest}\n >\n {children}\n </motion.section>\n </EmptyStateSizeContext.Provider>\n );\n}\n\nEmptyState.displayName = \"EmptyState\";\n\nexport function EmptyStateIcon({ className, children }: EmptyStateSectionProps) {\n return (\n <div data-slot=\"empty-state-icon\" className={cn(\"text-slate-300\", className)}>\n {children}\n </div>\n );\n}\n\nEmptyStateIcon.displayName = \"EmptyStateIcon\";\n\nexport function EmptyStateTitle({ className, children }: EmptyStateSectionProps) {\n const size = useEmptyStateSize();\n return (\n <h2 data-slot=\"empty-state-title\" className={cn(emptyStateTitleVariants({ size }), className)}>\n {children}\n </h2>\n );\n}\n\nEmptyStateTitle.displayName = \"EmptyStateTitle\";\n\nexport function EmptyStateDescription({\n className,\n children,\n}: EmptyStateSectionProps) {\n const size = useEmptyStateSize();\n return (\n <p\n data-slot=\"empty-state-description\"\n className={cn(emptyStateDescriptionVariants({ size }), className)}\n >\n {children}\n </p>\n );\n}\n\nEmptyStateDescription.displayName = \"EmptyStateDescription\";\n\nexport function EmptyStateAction({ className, children }: EmptyStateSectionProps) {\n return (\n <div data-slot=\"empty-state-action\" className={cn(\"mt-2\", className)}>\n {children}\n </div>\n );\n}\n\nEmptyStateAction.displayName = \"EmptyStateAction\";\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 { EmptyStateAnimation } from \"./types\";\n\ntype EmptyStatePresetMotionProps = Pick<\n HTMLMotionProps<\"div\">,\n \"initial\" | \"animate\" | \"transition\" | \"whileHover\"\n>;\n\nexport type EmptyStateAnimationPresets = Record<\n EmptyStateAnimation,\n EmptyStatePresetMotionProps\n>;\n\nexport const emptyStateAnimationPresets: EmptyStateAnimationPresets = {\n none: {},\n float: {\n whileHover: { y: -4 },\n transition: { type: \"spring\", stiffness: 260, damping: 22 },\n },\n fade: {\n initial: { opacity: 0, y: 8 },\n animate: { opacity: 1, y: 0 },\n transition: { duration: 0.25, ease: \"easeOut\" },\n },\n \"slide-up\": {\n initial: { opacity: 0, y: 16 },\n animate: { opacity: 1, y: 0 },\n transition: { type: \"spring\", stiffness: 380, damping: 28 },\n },\n};\n","import { cva } from \"class-variance-authority\";\n\nexport const emptyStateVariants = cva(\"flex w-full flex-col items-center text-center\", {\n variants: {\n size: {\n sm: \"gap-2 p-4 text-sm\",\n md: \"gap-3 p-6 text-sm\",\n lg: \"gap-4 p-8 text-base\",\n },\n appearance: {\n default: \"text-slate-50\",\n ghost: \"text-slate-200\",\n card: \"rounded-2xl border border-white/10 bg-white/5 p-8 text-slate-50 shadow-[0_18px_48px_rgba(15,23,42,0.35)]\",\n },\n align: {\n start: \"items-start text-left\",\n center: \"items-center text-center\",\n end: \"items-end text-right\",\n },\n },\n defaultVariants: {\n size: \"md\",\n appearance: \"default\",\n align: \"center\",\n },\n});\n\nexport const emptyStateTitleVariants = cva(\"font-semibold tracking-tight\", {\n variants: {\n size: {\n sm: \"text-base\",\n md: \"text-lg\",\n lg: \"text-xl\",\n },\n },\n defaultVariants: { size: \"md\" },\n});\n\nexport const emptyStateDescriptionVariants = cva(\"max-w-md text-slate-400\", {\n variants: {\n size: {\n sm: \"text-xs\",\n md: \"text-sm\",\n lg: \"text-base\",\n },\n },\n defaultVariants: { size: \"md\" },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,mBAAmD;AACnD,2BAAuB;;;ACHvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACSO,IAAM,6BAAyD;AAAA,EACpE,MAAM,CAAC;AAAA,EACP,OAAO;AAAA,IACL,YAAY,EAAE,GAAG,GAAG;AAAA,IACpB,YAAY,EAAE,MAAM,UAAU,WAAW,KAAK,SAAS,GAAG;AAAA,EAC5D;AAAA,EACA,MAAM;AAAA,IACJ,SAAS,EAAE,SAAS,GAAG,GAAG,EAAE;AAAA,IAC5B,SAAS,EAAE,SAAS,GAAG,GAAG,EAAE;AAAA,IAC5B,YAAY,EAAE,UAAU,MAAM,MAAM,UAAU;AAAA,EAChD;AAAA,EACA,YAAY;AAAA,IACV,SAAS,EAAE,SAAS,GAAG,GAAG,GAAG;AAAA,IAC7B,SAAS,EAAE,SAAS,GAAG,GAA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AAM,CAAC,IAAI,CAAC;AAE9C,SACE,4CAAC,sBAAsB,UAAtB,EAA+B,OAAO,KACrC;AAAA,IAAC,4BAAO;AAAA,IAAP;AAAA,MACC;AAAA,MACA,aAAU;AAAA,MACV,aAAU;AAAA,MACV,WAAW,GAAG,mBAAmB,EAAE,MAAM,YAAY,MAAM,CAAC,GAAG,SAAS;AAAA,MACxE,SAAS,cAAc,SAAS,QAAQ;AAAA,MACvC,GAAG;AAAA,MACH,GAAG;AAAA,MAEH;AAAA;AAAA,EACH,GACF;AAEJ;AAEA,WAAW,cAAc;AAElB,SAAS,eAAe,EAAE,WAAW,SAAS,GAA2B;AAC9E,SACE,4CAAC,SAAI,aAAU,oBAAmB,WAAW,GAAG,kBAAkB,SAAS,GACxE,UACH;AAEJ;AAEA,eAAe,cAAc;AAEtB,SAAS,gBAAgB,EAAE,WAAW,SAAS,GAA2B;AAC/E,QAAM,OAAO,kBAAkB;AAC/B,SACE,4CAAC,QAAG,aAAU,qBAAoB,WAAW,GAAG,wBAAwB,EAAE,KAAK,CAAC,GAAG,SAAS,GACzF,UACH;AAEJ;AAEA,gBAAgB,cAAc;AAEvB,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA;AACF,GAA2B;AACzB,QAAM,OAAO,kBAAkB;AAC/B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,8BAA8B,EAAE,KAAK,CAAC,GAAG,SAAS;AAAA,MAE/D;AAAA;AAAA,EACH;AAEJ;AAEA,sBAAsB,cAAc;AAE7B,SAAS,iBAAiB,EAAE,WAAW,SAAS,GAA2B;AAChF,SACE,4CAAC,SAAI,aAAU,sBAAqB,WAAW,GAAG,QAAQ,SAAS,GAChE,UACH;AAEJ;AAEA,iBAAiB,cAAc;","names":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
|
+
|
|
7
|
+
declare const emptyStateVariants: (props?: ({
|
|
8
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
9
|
+
appearance?: "default" | "ghost" | "card" | null | undefined;
|
|
10
|
+
align?: "end" | "center" | "start" | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
declare const emptyStateTitleVariants: (props?: ({
|
|
13
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
14
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
|
+
declare const emptyStateDescriptionVariants: (props?: ({
|
|
16
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
17
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
18
|
+
|
|
19
|
+
type EmptyStateAnimation = "none" | "float" | "fade" | "slide-up";
|
|
20
|
+
type EmptyStateVariantProps = VariantProps<typeof emptyStateVariants>;
|
|
21
|
+
type EmptyStateProps = EmptyStateVariantProps & Omit<HTMLMotionProps<"div">, "children"> & {
|
|
22
|
+
animation?: EmptyStateAnimation;
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
};
|
|
25
|
+
type EmptyStateSectionProps = {
|
|
26
|
+
className?: string;
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
declare function EmptyState(props: EmptyStateProps): react_jsx_runtime.JSX.Element;
|
|
31
|
+
declare namespace EmptyState {
|
|
32
|
+
var displayName: string;
|
|
33
|
+
}
|
|
34
|
+
declare function EmptyStateIcon({ className, children }: EmptyStateSectionProps): react_jsx_runtime.JSX.Element;
|
|
35
|
+
declare namespace EmptyStateIcon {
|
|
36
|
+
var displayName: string;
|
|
37
|
+
}
|
|
38
|
+
declare function EmptyStateTitle({ className, children }: EmptyStateSectionProps): react_jsx_runtime.JSX.Element;
|
|
39
|
+
declare namespace EmptyStateTitle {
|
|
40
|
+
var displayName: string;
|
|
41
|
+
}
|
|
42
|
+
declare function EmptyStateDescription({ className, children, }: EmptyStateSectionProps): react_jsx_runtime.JSX.Element;
|
|
43
|
+
declare namespace EmptyStateDescription {
|
|
44
|
+
var displayName: string;
|
|
45
|
+
}
|
|
46
|
+
declare function EmptyStateAction({ className, children }: EmptyStateSectionProps): react_jsx_runtime.JSX.Element;
|
|
47
|
+
declare namespace EmptyStateAction {
|
|
48
|
+
var displayName: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
type EmptyStatePresetMotionProps = Pick<HTMLMotionProps<"div">, "initial" | "animate" | "transition" | "whileHover">;
|
|
52
|
+
type EmptyStateAnimationPresets = Record<EmptyStateAnimation, EmptyStatePresetMotionProps>;
|
|
53
|
+
declare const emptyStateAnimationPresets: EmptyStateAnimationPresets;
|
|
54
|
+
|
|
55
|
+
export { EmptyState, EmptyStateAction, type EmptyStateAnimation, EmptyStateDescription, EmptyStateIcon, type EmptyStateProps, type EmptyStateSectionProps, EmptyStateTitle, emptyStateAnimationPresets, emptyStateDescriptionVariants, emptyStateTitleVariants, emptyStateVariants };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
|
+
|
|
7
|
+
declare const emptyStateVariants: (props?: ({
|
|
8
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
9
|
+
appearance?: "default" | "ghost" | "card" | null | undefined;
|
|
10
|
+
align?: "end" | "center" | "start" | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
declare const emptyStateTitleVariants: (props?: ({
|
|
13
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
14
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
|
+
declare const emptyStateDescriptionVariants: (props?: ({
|
|
16
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
17
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
18
|
+
|
|
19
|
+
type EmptyStateAnimation = "none" | "float" | "fade" | "slide-up";
|
|
20
|
+
type EmptyStateVariantProps = VariantProps<typeof emptyStateVariants>;
|
|
21
|
+
type EmptyStateProps = EmptyStateVariantProps & Omit<HTMLMotionProps<"div">, "children"> & {
|
|
22
|
+
animation?: EmptyStateAnimation;
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
};
|
|
25
|
+
type EmptyStateSectionProps = {
|
|
26
|
+
className?: string;
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
declare function EmptyState(props: EmptyStateProps): react_jsx_runtime.JSX.Element;
|
|
31
|
+
declare namespace EmptyState {
|
|
32
|
+
var displayName: string;
|
|
33
|
+
}
|
|
34
|
+
declare function EmptyStateIcon({ className, children }: EmptyStateSectionProps): react_jsx_runtime.JSX.Element;
|
|
35
|
+
declare namespace EmptyStateIcon {
|
|
36
|
+
var displayName: string;
|
|
37
|
+
}
|
|
38
|
+
declare function EmptyStateTitle({ className, children }: EmptyStateSectionProps): react_jsx_runtime.JSX.Element;
|
|
39
|
+
declare namespace EmptyStateTitle {
|
|
40
|
+
var displayName: string;
|
|
41
|
+
}
|
|
42
|
+
declare function EmptyStateDescription({ className, children, }: EmptyStateSectionProps): react_jsx_runtime.JSX.Element;
|
|
43
|
+
declare namespace EmptyStateDescription {
|
|
44
|
+
var displayName: string;
|
|
45
|
+
}
|
|
46
|
+
declare function EmptyStateAction({ className, children }: EmptyStateSectionProps): react_jsx_runtime.JSX.Element;
|
|
47
|
+
declare namespace EmptyStateAction {
|
|
48
|
+
var displayName: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
type EmptyStatePresetMotionProps = Pick<HTMLMotionProps<"div">, "initial" | "animate" | "transition" | "whileHover">;
|
|
52
|
+
type EmptyStateAnimationPresets = Record<EmptyStateAnimation, EmptyStatePresetMotionProps>;
|
|
53
|
+
declare const emptyStateAnimationPresets: EmptyStateAnimationPresets;
|
|
54
|
+
|
|
55
|
+
export { EmptyState, EmptyStateAction, type EmptyStateAnimation, EmptyStateDescription, EmptyStateIcon, type EmptyStateProps, type EmptyStateSectionProps, EmptyStateTitle, emptyStateAnimationPresets, emptyStateDescriptionVariants, emptyStateTitleVariants, emptyStateVariants };
|