elahi-ui 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +156 -0
  2. package/dist/components/Avatar/Avatar.d.ts +25 -0
  3. package/dist/components/Avatar/index.d.ts +2 -0
  4. package/dist/components/Badge/Badge.d.ts +21 -0
  5. package/dist/components/Badge/index.d.ts +2 -0
  6. package/dist/components/Button/Button.d.ts +49 -0
  7. package/dist/components/Button/index.d.ts +2 -0
  8. package/dist/components/Card/Card.d.ts +16 -0
  9. package/dist/components/Card/index.d.ts +2 -0
  10. package/dist/components/Checkbox/Checkbox.d.ts +17 -0
  11. package/dist/components/Checkbox/index.d.ts +2 -0
  12. package/dist/components/Icons/index.d.ts +18 -0
  13. package/dist/components/Input/Input.d.ts +46 -0
  14. package/dist/components/Input/index.d.ts +2 -0
  15. package/dist/components/Modal/Modal.d.ts +27 -0
  16. package/dist/components/Modal/index.d.ts +2 -0
  17. package/dist/components/Select/Select.d.ts +40 -0
  18. package/dist/components/Select/index.d.ts +2 -0
  19. package/dist/components/Switch/Switch.d.ts +21 -0
  20. package/dist/components/Switch/index.d.ts +2 -0
  21. package/dist/components/Table/Table.d.ts +72 -0
  22. package/dist/components/Table/TablePagination.d.ts +15 -0
  23. package/dist/components/Table/index.d.ts +2 -0
  24. package/dist/components/Tabs/Tabs.d.ts +32 -0
  25. package/dist/components/Tabs/index.d.ts +2 -0
  26. package/dist/components/Textarea/Textarea.d.ts +23 -0
  27. package/dist/components/Textarea/index.d.ts +2 -0
  28. package/dist/components/Toast/Toast.d.ts +25 -0
  29. package/dist/components/Toast/index.d.ts +2 -0
  30. package/dist/components/Tooltip/Tooltip.d.ts +18 -0
  31. package/dist/components/Tooltip/index.d.ts +2 -0
  32. package/dist/constants/index.d.ts +16 -0
  33. package/dist/hooks/index.d.ts +13 -0
  34. package/dist/hooks/useClickOutside.d.ts +10 -0
  35. package/dist/hooks/useControllableState.d.ts +20 -0
  36. package/dist/hooks/useDisclosure.d.ts +16 -0
  37. package/dist/hooks/useFocusTrap.d.ts +14 -0
  38. package/dist/hooks/useLockBodyScroll.d.ts +10 -0
  39. package/dist/hooks/useMediaQuery.d.ts +10 -0
  40. package/dist/hooks/useRipple.d.ts +20 -0
  41. package/dist/hooks/useTablePagination.d.ts +19 -0
  42. package/dist/hooks/useTableSort.d.ts +22 -0
  43. package/dist/hooks.cjs +2 -0
  44. package/dist/hooks.cjs.map +1 -0
  45. package/dist/hooks.d.ts +2 -0
  46. package/dist/hooks.js +13 -0
  47. package/dist/hooks.js.map +1 -0
  48. package/dist/index-Bxv2g5GP.js +2487 -0
  49. package/dist/index-Bxv2g5GP.js.map +1 -0
  50. package/dist/index-DwhoHMcS.cjs +2 -0
  51. package/dist/index-DwhoHMcS.cjs.map +1 -0
  52. package/dist/index.cjs +2 -0
  53. package/dist/index.cjs.map +1 -0
  54. package/dist/index.d.ts +35 -0
  55. package/dist/index.js +1714 -0
  56. package/dist/index.js.map +1 -0
  57. package/dist/main.d.ts +0 -0
  58. package/dist/styles/globals.css +118 -0
  59. package/dist/test/setup.d.ts +1 -0
  60. package/dist/useTablePagination-CKuaTNxN.js +236 -0
  61. package/dist/useTablePagination-CKuaTNxN.js.map +1 -0
  62. package/dist/useTablePagination-DS3CDBea.cjs +2 -0
  63. package/dist/useTablePagination-DS3CDBea.cjs.map +1 -0
  64. package/dist/utils/cn.d.ts +10 -0
  65. package/dist/utils/id.d.ts +5 -0
  66. package/dist/utils/index.d.ts +3 -0
  67. package/dist/utils/polymorphic.d.ts +26 -0
  68. package/dist/utils.cjs +2 -0
  69. package/dist/utils.cjs.map +1 -0
  70. package/dist/utils.d.ts +2 -0
  71. package/dist/utils.js +6 -0
  72. package/dist/utils.js.map +1 -0
  73. package/package.json +118 -0
package/dist/index.js ADDED
@@ -0,0 +1,1714 @@
1
+ import { c as clsx, a as cn, g as generateId } from "./index-Bxv2g5GP.js";
2
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
3
+ import { f as useRipple, u as useClickOutside, d as useLockBodyScroll, c as useFocusTrap, K as KEYBOARD_KEYS, A as ANIMATION_DURATION, h as useTableSort, g as useTablePagination } from "./useTablePagination-CKuaTNxN.js";
4
+ import { a, b, e } from "./useTablePagination-CKuaTNxN.js";
5
+ import React, { forwardRef, useState, useMemo, useRef, useEffect, useCallback, useContext, createContext } from "react";
6
+ const falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
7
+ const cx = clsx;
8
+ const cva = (base, config) => (props) => {
9
+ var _config_compoundVariants;
10
+ if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
11
+ const { variants, defaultVariants } = config;
12
+ const getVariantClassNames = Object.keys(variants).map((variant) => {
13
+ const variantProp = props === null || props === void 0 ? void 0 : props[variant];
14
+ const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
15
+ if (variantProp === null) return null;
16
+ const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
17
+ return variants[variant][variantKey];
18
+ });
19
+ const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
20
+ let [key, value] = param;
21
+ if (value === void 0) {
22
+ return acc;
23
+ }
24
+ acc[key] = value;
25
+ return acc;
26
+ }, {});
27
+ const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
28
+ let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
29
+ return Object.entries(compoundVariantOptions).every((param2) => {
30
+ let [key, value] = param2;
31
+ return Array.isArray(value) ? value.includes({
32
+ ...defaultVariants,
33
+ ...propsWithoutUndefined
34
+ }[key]) : {
35
+ ...defaultVariants,
36
+ ...propsWithoutUndefined
37
+ }[key] === value;
38
+ }) ? [
39
+ ...acc,
40
+ cvClass,
41
+ cvClassName
42
+ ] : acc;
43
+ }, []);
44
+ return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
45
+ };
46
+ const SpinnerIcon = ({ className, ...props }) => /* @__PURE__ */ jsxs(
47
+ "svg",
48
+ {
49
+ className,
50
+ xmlns: "http://www.w3.org/2000/svg",
51
+ fill: "none",
52
+ viewBox: "0 0 24 24",
53
+ ...props,
54
+ children: [
55
+ /* @__PURE__ */ jsx(
56
+ "circle",
57
+ {
58
+ className: "opacity-25",
59
+ cx: "12",
60
+ cy: "12",
61
+ r: "10",
62
+ stroke: "currentColor",
63
+ strokeWidth: "4"
64
+ }
65
+ ),
66
+ /* @__PURE__ */ jsx(
67
+ "path",
68
+ {
69
+ className: "opacity-75",
70
+ fill: "currentColor",
71
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
72
+ }
73
+ )
74
+ ]
75
+ }
76
+ );
77
+ const CloseIcon = ({ className, ...props }) => /* @__PURE__ */ jsxs(
78
+ "svg",
79
+ {
80
+ className,
81
+ xmlns: "http://www.w3.org/2000/svg",
82
+ viewBox: "0 0 24 24",
83
+ fill: "none",
84
+ stroke: "currentColor",
85
+ strokeWidth: "2",
86
+ strokeLinecap: "round",
87
+ strokeLinejoin: "round",
88
+ ...props,
89
+ children: [
90
+ /* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
91
+ /* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
92
+ ]
93
+ }
94
+ );
95
+ const ChevronDownIcon = ({ className, ...props }) => /* @__PURE__ */ jsx(
96
+ "svg",
97
+ {
98
+ className,
99
+ xmlns: "http://www.w3.org/2000/svg",
100
+ viewBox: "0 0 24 24",
101
+ fill: "none",
102
+ stroke: "currentColor",
103
+ strokeWidth: "2",
104
+ strokeLinecap: "round",
105
+ strokeLinejoin: "round",
106
+ ...props,
107
+ children: /* @__PURE__ */ jsx("polyline", { points: "6 9 12 15 18 9" })
108
+ }
109
+ );
110
+ const CheckIcon = ({ className, ...props }) => /* @__PURE__ */ jsx(
111
+ "svg",
112
+ {
113
+ className,
114
+ viewBox: "0 0 24 24",
115
+ fill: "none",
116
+ stroke: "currentColor",
117
+ strokeWidth: "2.5",
118
+ strokeLinecap: "round",
119
+ strokeLinejoin: "round",
120
+ ...props,
121
+ children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" })
122
+ }
123
+ );
124
+ const AlertCircleIcon = ({ className, ...props }) => /* @__PURE__ */ jsxs(
125
+ "svg",
126
+ {
127
+ className,
128
+ viewBox: "0 0 24 24",
129
+ fill: "none",
130
+ stroke: "currentColor",
131
+ strokeWidth: "2.5",
132
+ strokeLinecap: "round",
133
+ strokeLinejoin: "round",
134
+ ...props,
135
+ children: [
136
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
137
+ /* @__PURE__ */ jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
138
+ /* @__PURE__ */ jsx("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
139
+ ]
140
+ }
141
+ );
142
+ const AlertTriangleIcon = ({ className, ...props }) => /* @__PURE__ */ jsxs(
143
+ "svg",
144
+ {
145
+ className,
146
+ viewBox: "0 0 24 24",
147
+ fill: "none",
148
+ stroke: "currentColor",
149
+ strokeWidth: "2.5",
150
+ strokeLinecap: "round",
151
+ strokeLinejoin: "round",
152
+ ...props,
153
+ children: [
154
+ /* @__PURE__ */ jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
155
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
156
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
157
+ ]
158
+ }
159
+ );
160
+ const InfoIcon = ({ className, ...props }) => /* @__PURE__ */ jsxs(
161
+ "svg",
162
+ {
163
+ className,
164
+ viewBox: "0 0 24 24",
165
+ fill: "none",
166
+ stroke: "currentColor",
167
+ strokeWidth: "2.5",
168
+ strokeLinecap: "round",
169
+ strokeLinejoin: "round",
170
+ ...props,
171
+ children: [
172
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
173
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
174
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
175
+ ]
176
+ }
177
+ );
178
+ const SortAscIcon = ({ className, ...props }) => /* @__PURE__ */ jsx(
179
+ "svg",
180
+ {
181
+ className,
182
+ fill: "none",
183
+ viewBox: "0 0 24 24",
184
+ stroke: "currentColor",
185
+ strokeWidth: 2,
186
+ ...props,
187
+ children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 15l7-7 7 7" })
188
+ }
189
+ );
190
+ const SortDescIcon = ({ className, ...props }) => /* @__PURE__ */ jsx(
191
+ "svg",
192
+ {
193
+ className,
194
+ fill: "none",
195
+ viewBox: "0 0 24 24",
196
+ stroke: "currentColor",
197
+ strokeWidth: 2,
198
+ ...props,
199
+ children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" })
200
+ }
201
+ );
202
+ const ChevronRightIcon = ({ className, ...props }) => /* @__PURE__ */ jsx(
203
+ "svg",
204
+ {
205
+ className,
206
+ fill: "none",
207
+ viewBox: "0 0 24 24",
208
+ stroke: "currentColor",
209
+ strokeWidth: 2,
210
+ ...props,
211
+ children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" })
212
+ }
213
+ );
214
+ const buttonVariants = cva(
215
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 relative overflow-hidden",
216
+ {
217
+ variants: {
218
+ variant: {
219
+ primary: "bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-700",
220
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
221
+ outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
222
+ ghost: "hover:bg-accent hover:text-accent-foreground",
223
+ danger: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
224
+ success: "bg-success text-success-foreground hover:bg-success/90",
225
+ warning: "bg-warning text-warning-foreground hover:bg-warning/90",
226
+ link: "text-primary underline-offset-4 hover:underline"
227
+ },
228
+ size: {
229
+ xs: "h-7 px-2 text-xs",
230
+ sm: "h-9 px-3",
231
+ md: "h-10 px-4 py-2",
232
+ lg: "h-11 px-8",
233
+ xl: "h-12 px-10 text-base",
234
+ icon: "h-10 w-10"
235
+ },
236
+ fullWidth: {
237
+ true: "w-full"
238
+ },
239
+ rounded: {
240
+ none: "rounded-none",
241
+ sm: "rounded-sm",
242
+ md: "rounded-md",
243
+ lg: "rounded-lg",
244
+ xl: "rounded-xl",
245
+ full: "rounded-full"
246
+ }
247
+ },
248
+ defaultVariants: {
249
+ variant: "primary",
250
+ size: "md",
251
+ rounded: "md"
252
+ }
253
+ }
254
+ );
255
+ const Button = forwardRef(
256
+ ({
257
+ as,
258
+ variant,
259
+ size,
260
+ fullWidth,
261
+ rounded,
262
+ loading = false,
263
+ leftIcon,
264
+ rightIcon,
265
+ enableRipple = true,
266
+ className,
267
+ children,
268
+ disabled,
269
+ onClick,
270
+ ...props
271
+ }, ref) => {
272
+ const Component = as || "button";
273
+ const { ripples, createRipple } = useRipple();
274
+ const handleClick = (e2) => {
275
+ if (enableRipple && !disabled && !loading) {
276
+ createRipple(e2);
277
+ }
278
+ onClick == null ? void 0 : onClick(e2);
279
+ };
280
+ return /* @__PURE__ */ jsxs(
281
+ Component,
282
+ {
283
+ ref,
284
+ className: cn(
285
+ buttonVariants({ variant, size, fullWidth, rounded }),
286
+ className
287
+ ),
288
+ disabled: disabled || loading,
289
+ onClick: handleClick,
290
+ ...props,
291
+ children: [
292
+ enableRipple && ripples.map((ripple) => /* @__PURE__ */ jsx(
293
+ "span",
294
+ {
295
+ className: "absolute animate-ripple rounded-full bg-white/30",
296
+ style: {
297
+ left: ripple.x,
298
+ top: ripple.y,
299
+ width: 10,
300
+ height: 10,
301
+ transform: "translate(-50%, -50%)"
302
+ }
303
+ },
304
+ ripple.id
305
+ )),
306
+ loading && /* @__PURE__ */ jsx(SpinnerIcon, { className: "h-4 w-4 animate-spin" }),
307
+ !loading && leftIcon && /* @__PURE__ */ jsx("span", { children: leftIcon }),
308
+ children,
309
+ !loading && rightIcon && /* @__PURE__ */ jsx("span", { children: rightIcon })
310
+ ]
311
+ }
312
+ );
313
+ }
314
+ );
315
+ Button.displayName = "Button";
316
+ const inputVariants = cva(
317
+ "flex w-full rounded-md border bg-background text-sm transition-all file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
318
+ {
319
+ variants: {
320
+ variant: {
321
+ outlined: "border-input focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
322
+ filled: "border-transparent bg-muted focus-visible:bg-background",
323
+ underlined: "rounded-none border-x-0 border-t-0 border-b-2 px-0 focus-visible:border-primary"
324
+ },
325
+ inputSize: {
326
+ sm: "h-8 px-3 py-1 text-xs",
327
+ md: "h-10 px-3 py-2",
328
+ lg: "h-12 px-4 py-3 text-base"
329
+ },
330
+ state: {
331
+ default: "",
332
+ error: "border-destructive focus-visible:ring-destructive",
333
+ success: "border-success focus-visible:ring-success"
334
+ }
335
+ },
336
+ defaultVariants: {
337
+ variant: "outlined",
338
+ inputSize: "md",
339
+ state: "default"
340
+ }
341
+ }
342
+ );
343
+ const Input = forwardRef(
344
+ ({
345
+ className,
346
+ wrapperClassName,
347
+ variant,
348
+ inputSize,
349
+ state,
350
+ label,
351
+ helperText,
352
+ error,
353
+ prefix,
354
+ suffix,
355
+ floatingLabel = false,
356
+ showCount = false,
357
+ maxLength,
358
+ value,
359
+ onChange,
360
+ id,
361
+ ...props
362
+ }, ref) => {
363
+ const [isFocused, setIsFocused] = useState(false);
364
+ const [charCount, setCharCount] = useState(
365
+ value ? String(value).length : 0
366
+ );
367
+ const inputId = useMemo(() => id || generateId("input"), [id]);
368
+ const hasValue = value !== void 0 && value !== "";
369
+ const showFloatingLabel = floatingLabel && (isFocused || hasValue);
370
+ const handleChange = (e2) => {
371
+ setCharCount(e2.target.value.length);
372
+ onChange == null ? void 0 : onChange(e2);
373
+ };
374
+ const finalState = error ? "error" : state;
375
+ return /* @__PURE__ */ jsxs("div", { className: cn("w-full", wrapperClassName), children: [
376
+ label && !floatingLabel && /* @__PURE__ */ jsx(
377
+ "label",
378
+ {
379
+ htmlFor: inputId,
380
+ className: "mb-2 block text-sm font-medium text-foreground",
381
+ children: label
382
+ }
383
+ ),
384
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
385
+ floatingLabel && label && /* @__PURE__ */ jsx(
386
+ "label",
387
+ {
388
+ htmlFor: inputId,
389
+ className: cn(
390
+ "pointer-events-none absolute left-3 transition-all duration-200",
391
+ showFloatingLabel ? "top-0 -translate-y-1/2 bg-background px-1 text-xs font-medium text-primary" : "top-1/2 -translate-y-1/2 text-sm text-muted-foreground"
392
+ ),
393
+ children: label
394
+ }
395
+ ),
396
+ prefix && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: prefix }),
397
+ /* @__PURE__ */ jsx(
398
+ "input",
399
+ {
400
+ ref,
401
+ id: inputId,
402
+ value,
403
+ onChange: handleChange,
404
+ onFocus: () => setIsFocused(true),
405
+ onBlur: () => setIsFocused(false),
406
+ maxLength,
407
+ className: cn(
408
+ inputVariants({ variant, inputSize, state: finalState }),
409
+ prefix && "pl-10",
410
+ suffix && "pr-10",
411
+ floatingLabel && "pt-3",
412
+ className
413
+ ),
414
+ ...props
415
+ }
416
+ ),
417
+ suffix && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: suffix })
418
+ ] }),
419
+ /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-center justify-between", children: [
420
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
421
+ error && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", role: "alert", children: error }),
422
+ !error && helperText && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: helperText })
423
+ ] }),
424
+ showCount && maxLength && /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
425
+ charCount,
426
+ "/",
427
+ maxLength
428
+ ] })
429
+ ] })
430
+ ] });
431
+ }
432
+ );
433
+ Input.displayName = "Input";
434
+ const Textarea = forwardRef(
435
+ ({
436
+ className,
437
+ wrapperClassName,
438
+ label,
439
+ helperText,
440
+ error,
441
+ autoResize = false,
442
+ showCount = false,
443
+ maxLength,
444
+ value,
445
+ onChange,
446
+ id,
447
+ ...props
448
+ }, ref) => {
449
+ const textareaRef = useRef(null);
450
+ const textareaId = id || `textarea-${Math.random().toString(36).substr(2, 9)}`;
451
+ const charCount = value ? String(value).length : 0;
452
+ useEffect(() => {
453
+ if (autoResize && textareaRef.current) {
454
+ textareaRef.current.style.height = "auto";
455
+ textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;
456
+ }
457
+ }, [value, autoResize]);
458
+ const handleRef = (node) => {
459
+ textareaRef.current = node;
460
+ if (typeof ref === "function") {
461
+ ref(node);
462
+ } else if (ref) {
463
+ ref.current = node;
464
+ }
465
+ };
466
+ return /* @__PURE__ */ jsxs("div", { className: cn("w-full", wrapperClassName), children: [
467
+ label && /* @__PURE__ */ jsx(
468
+ "label",
469
+ {
470
+ htmlFor: textareaId,
471
+ className: "mb-2 block text-sm font-medium text-foreground",
472
+ children: label
473
+ }
474
+ ),
475
+ /* @__PURE__ */ jsx(
476
+ "textarea",
477
+ {
478
+ ref: handleRef,
479
+ id: textareaId,
480
+ value,
481
+ onChange,
482
+ maxLength,
483
+ className: cn(
484
+ inputVariants({
485
+ variant: "outlined",
486
+ inputSize: "md",
487
+ state: error ? "error" : "default"
488
+ }),
489
+ "min-h-[80px] resize-none",
490
+ !autoResize && "resize-y",
491
+ className
492
+ ),
493
+ ...props
494
+ }
495
+ ),
496
+ /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-center justify-between", children: [
497
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
498
+ error && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", role: "alert", children: error }),
499
+ !error && helperText && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: helperText })
500
+ ] }),
501
+ showCount && maxLength && /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
502
+ charCount,
503
+ "/",
504
+ maxLength
505
+ ] })
506
+ ] })
507
+ ] });
508
+ }
509
+ );
510
+ Textarea.displayName = "Textarea";
511
+ const Checkbox = forwardRef(
512
+ ({ className, label, helperText, error, id, ...props }, ref) => {
513
+ const checkboxId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
514
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
515
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
516
+ /* @__PURE__ */ jsx(
517
+ "input",
518
+ {
519
+ ref,
520
+ type: "checkbox",
521
+ id: checkboxId,
522
+ className: cn(
523
+ // Base styles
524
+ "peer h-5 w-5 shrink-0 cursor-pointer appearance-none rounded border-2 border-primary/60",
525
+ "transition-all duration-200",
526
+ // Focus styles
527
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/20 focus-visible:ring-offset-2",
528
+ // Hover styles
529
+ "hover:border-primary",
530
+ // Checked state
531
+ "checked:border-primary checked:bg-primary",
532
+ // Checkmark via background SVG
533
+ 'checked:bg-[url("data:image/svg+xml,%3csvg%20viewBox=%270%200%2016%2016%27%20fill=%27white%27%20xmlns=%27http://www.w3.org/2000/svg%27%3e%3cpath%20d=%27M12.207%204.793a1%201%200%20010%201.414l-5%205a1%201%200%2001-1.414%200l-2-2a1%201%200%20011.414-1.414L6.5%209.086l4.293-4.293a1%201%200%20011.414%200z%27/%3e%3c/svg%3e")]',
534
+ "checked:bg-center checked:bg-no-repeat checked:bg-[length:80%]",
535
+ // Disabled state
536
+ "disabled:cursor-not-allowed disabled:opacity-50",
537
+ // Error state
538
+ error && "border-destructive checked:border-destructive checked:bg-destructive",
539
+ className
540
+ ),
541
+ ...props
542
+ }
543
+ ),
544
+ label && /* @__PURE__ */ jsx(
545
+ "label",
546
+ {
547
+ htmlFor: checkboxId,
548
+ className: "cursor-pointer text-sm font-medium leading-none select-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
549
+ children: label
550
+ }
551
+ )
552
+ ] }),
553
+ error && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", role: "alert", children: error }),
554
+ !error && helperText && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: helperText })
555
+ ] });
556
+ }
557
+ );
558
+ Checkbox.displayName = "Checkbox";
559
+ const Switch = forwardRef(
560
+ ({
561
+ className,
562
+ label,
563
+ helperText,
564
+ labelPosition = "right",
565
+ checked: controlledChecked,
566
+ onCheckedChange,
567
+ onChange,
568
+ id,
569
+ ...props
570
+ }, ref) => {
571
+ const [internalChecked, setInternalChecked] = useState(false);
572
+ const isControlled = controlledChecked !== void 0;
573
+ const checked = isControlled ? controlledChecked : internalChecked;
574
+ const switchId = id || `switch-${Math.random().toString(36).substr(2, 9)}`;
575
+ const handleChange = (e2) => {
576
+ const newChecked = e2.target.checked;
577
+ if (!isControlled) {
578
+ setInternalChecked(newChecked);
579
+ }
580
+ onCheckedChange == null ? void 0 : onCheckedChange(newChecked);
581
+ onChange == null ? void 0 : onChange(e2);
582
+ };
583
+ const switchElement = /* @__PURE__ */ jsxs("div", { className: "relative inline-block", children: [
584
+ /* @__PURE__ */ jsx(
585
+ "input",
586
+ {
587
+ ref,
588
+ type: "checkbox",
589
+ id: switchId,
590
+ checked,
591
+ onChange: handleChange,
592
+ role: "switch",
593
+ "aria-checked": checked,
594
+ className: cn("peer sr-only", className),
595
+ ...props
596
+ }
597
+ ),
598
+ /* @__PURE__ */ jsx(
599
+ "label",
600
+ {
601
+ htmlFor: switchId,
602
+ className: cn(
603
+ // Switch track
604
+ "flex h-6 w-11 cursor-pointer items-center rounded-full p-0.5 transition-colors duration-200",
605
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/20 focus-visible:ring-offset-2",
606
+ // Unchecked state
607
+ "bg-input",
608
+ // Checked state (peer-checked = when checkbox is checked)
609
+ "peer-checked:bg-primary",
610
+ // Hover
611
+ "hover:bg-input/80 peer-checked:hover:bg-primary/90",
612
+ // Disabled state
613
+ "peer-disabled:cursor-not-allowed peer-disabled:opacity-50"
614
+ ),
615
+ children: /* @__PURE__ */ jsx(
616
+ "span",
617
+ {
618
+ className: cn(
619
+ "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg transition-transform duration-200",
620
+ // Unchecked position
621
+ "translate-x-0",
622
+ // Checked position
623
+ checked && "translate-x-5"
624
+ )
625
+ }
626
+ )
627
+ }
628
+ )
629
+ ] });
630
+ if (!label) {
631
+ return switchElement;
632
+ }
633
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
634
+ /* @__PURE__ */ jsxs(
635
+ "div",
636
+ {
637
+ className: cn(
638
+ "flex items-center gap-3",
639
+ labelPosition === "left" && "flex-row-reverse justify-end"
640
+ ),
641
+ children: [
642
+ switchElement,
643
+ /* @__PURE__ */ jsx(
644
+ "label",
645
+ {
646
+ htmlFor: switchId,
647
+ className: "cursor-pointer text-sm font-medium leading-none select-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
648
+ children: label
649
+ }
650
+ )
651
+ ]
652
+ }
653
+ ),
654
+ helperText && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: helperText })
655
+ ] });
656
+ }
657
+ );
658
+ Switch.displayName = "Switch";
659
+ const Select = forwardRef(
660
+ ({
661
+ options,
662
+ value,
663
+ onChange,
664
+ placeholder = "Select...",
665
+ label,
666
+ helperText,
667
+ error,
668
+ disabled = false,
669
+ searchable = false,
670
+ className,
671
+ ...props
672
+ }, ref) => {
673
+ const [isOpen, setIsOpen] = useState(false);
674
+ const [searchQuery, setSearchQuery] = useState("");
675
+ const containerRef = useRef(null);
676
+ const searchInputRef = useRef(null);
677
+ useClickOutside(containerRef, () => setIsOpen(false));
678
+ const selectedOption = options.find((opt) => opt.value === value);
679
+ const filteredOptions = searchable ? options.filter(
680
+ (opt) => opt.label.toLowerCase().includes(searchQuery.toLowerCase())
681
+ ) : options;
682
+ const handleSelect = (optionValue) => {
683
+ onChange == null ? void 0 : onChange(optionValue);
684
+ setIsOpen(false);
685
+ setSearchQuery("");
686
+ };
687
+ const handleKeyDown = (e2) => {
688
+ if (e2.key === "Escape") {
689
+ setIsOpen(false);
690
+ } else if (e2.key === "ArrowDown" && !isOpen) {
691
+ setIsOpen(true);
692
+ }
693
+ };
694
+ useEffect(() => {
695
+ if (isOpen && searchable && searchInputRef.current) {
696
+ searchInputRef.current.focus();
697
+ }
698
+ }, [isOpen, searchable]);
699
+ return /* @__PURE__ */ jsxs("div", { ref, className: cn("w-full", className), ...props, children: [
700
+ label && /* @__PURE__ */ jsx("label", { className: "mb-2 block text-sm font-medium text-foreground", children: label }),
701
+ /* @__PURE__ */ jsxs("div", { ref: containerRef, className: "relative", children: [
702
+ /* @__PURE__ */ jsxs(
703
+ "button",
704
+ {
705
+ type: "button",
706
+ onClick: () => !disabled && setIsOpen(!isOpen),
707
+ onKeyDown: handleKeyDown,
708
+ disabled,
709
+ className: cn(
710
+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm",
711
+ "ring-offset-background transition-colors",
712
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
713
+ "disabled:cursor-not-allowed disabled:opacity-50",
714
+ error && "border-destructive",
715
+ isOpen && "ring-2 ring-ring ring-offset-2"
716
+ ),
717
+ children: [
718
+ /* @__PURE__ */ jsx("span", { className: selectedOption ? "text-foreground" : "text-muted-foreground", children: (selectedOption == null ? void 0 : selectedOption.label) || placeholder }),
719
+ /* @__PURE__ */ jsx(
720
+ "svg",
721
+ {
722
+ className: cn(
723
+ "h-4 w-4 transition-transform",
724
+ isOpen && "rotate-180"
725
+ ),
726
+ xmlns: "http://www.w3.org/2000/svg",
727
+ viewBox: "0 0 24 24",
728
+ fill: "none",
729
+ stroke: "currentColor",
730
+ strokeWidth: "2",
731
+ strokeLinecap: "round",
732
+ strokeLinejoin: "round",
733
+ children: /* @__PURE__ */ jsx("polyline", { points: "6 9 12 15 18 9" })
734
+ }
735
+ )
736
+ ]
737
+ }
738
+ ),
739
+ isOpen && /* @__PURE__ */ jsxs("div", { className: "absolute z-50 mt-1 w-full rounded-md border border-input bg-popover shadow-lg animate-scale-in", children: [
740
+ searchable && /* @__PURE__ */ jsx("div", { className: "border-b border-border p-2", children: /* @__PURE__ */ jsx(
741
+ "input",
742
+ {
743
+ ref: searchInputRef,
744
+ type: "text",
745
+ value: searchQuery,
746
+ onChange: (e2) => setSearchQuery(e2.target.value),
747
+ placeholder: "Search...",
748
+ className: "w-full rounded-md border border-input bg-background px-3 py-1.5 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
749
+ }
750
+ ) }),
751
+ /* @__PURE__ */ jsx("div", { className: "max-h-60 overflow-y-auto p-1", children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "px-3 py-2 text-sm text-muted-foreground", children: "No options found" }) : filteredOptions.map((option) => /* @__PURE__ */ jsxs(
752
+ "button",
753
+ {
754
+ type: "button",
755
+ onClick: () => !option.disabled && handleSelect(option.value),
756
+ disabled: option.disabled,
757
+ className: cn(
758
+ "flex w-full items-center rounded-sm px-3 py-2 text-left text-sm transition-colors",
759
+ "hover:bg-accent hover:text-accent-foreground",
760
+ "focus-visible:bg-accent focus-visible:outline-none",
761
+ "disabled:pointer-events-none disabled:opacity-50",
762
+ option.value === value && "bg-accent font-medium"
763
+ ),
764
+ children: [
765
+ option.label,
766
+ option.value === value && /* @__PURE__ */ jsx(
767
+ "svg",
768
+ {
769
+ className: "ml-auto h-4 w-4",
770
+ xmlns: "http://www.w3.org/2000/svg",
771
+ viewBox: "0 0 24 24",
772
+ fill: "none",
773
+ stroke: "currentColor",
774
+ strokeWidth: "2",
775
+ strokeLinecap: "round",
776
+ strokeLinejoin: "round",
777
+ children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" })
778
+ }
779
+ )
780
+ ]
781
+ },
782
+ option.value
783
+ )) })
784
+ ] })
785
+ ] }),
786
+ error && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-destructive", role: "alert", children: error }),
787
+ !error && helperText && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: helperText })
788
+ ] });
789
+ }
790
+ );
791
+ Select.displayName = "Select";
792
+ const Modal = forwardRef(
793
+ ({
794
+ open,
795
+ onClose,
796
+ size = "md",
797
+ showClose = true,
798
+ preventClose = false,
799
+ className,
800
+ children,
801
+ ...props
802
+ }, ref) => {
803
+ const modalRef = useRef(null);
804
+ useLockBodyScroll(open);
805
+ useFocusTrap(modalRef, open, true);
806
+ useEffect(() => {
807
+ if (!open) return;
808
+ const handleEsc = (e2) => {
809
+ if (e2.key === KEYBOARD_KEYS.ESCAPE && !preventClose) {
810
+ onClose();
811
+ }
812
+ };
813
+ document.addEventListener("keydown", handleEsc);
814
+ return () => document.removeEventListener("keydown", handleEsc);
815
+ }, [open, onClose, preventClose]);
816
+ if (!open) return null;
817
+ const sizeClasses = {
818
+ sm: "max-w-sm",
819
+ md: "max-w-md",
820
+ lg: "max-w-lg",
821
+ xl: "max-w-xl",
822
+ full: "max-w-full mx-4"
823
+ };
824
+ return /* @__PURE__ */ jsxs(
825
+ "div",
826
+ {
827
+ className: "fixed inset-0 z-50 flex items-center justify-center",
828
+ role: "dialog",
829
+ "aria-modal": "true",
830
+ children: [
831
+ /* @__PURE__ */ jsx(
832
+ "div",
833
+ {
834
+ className: "absolute inset-0 bg-black/50 animate-fade-in",
835
+ onClick: () => !preventClose && onClose()
836
+ }
837
+ ),
838
+ /* @__PURE__ */ jsxs(
839
+ "div",
840
+ {
841
+ ref: (node) => {
842
+ if (typeof ref === "function") {
843
+ ref(node);
844
+ } else if (ref) {
845
+ ref.current = node;
846
+ }
847
+ if (modalRef.current !== node) {
848
+ modalRef.current = node;
849
+ }
850
+ },
851
+ className: cn(
852
+ "relative z-10 w-full rounded-lg bg-popover border border-border p-6 shadow-xl animate-scale-in",
853
+ sizeClasses[size],
854
+ className
855
+ ),
856
+ onClick: (e2) => e2.stopPropagation(),
857
+ ...props,
858
+ children: [
859
+ showClose && /* @__PURE__ */ jsxs(
860
+ "button",
861
+ {
862
+ onClick: onClose,
863
+ className: "absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
864
+ "aria-label": "Close modal",
865
+ children: [
866
+ /* @__PURE__ */ jsx(CloseIcon, { className: "h-4 w-4" }),
867
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
868
+ ]
869
+ }
870
+ ),
871
+ children
872
+ ]
873
+ }
874
+ )
875
+ ]
876
+ }
877
+ );
878
+ }
879
+ );
880
+ Modal.displayName = "Modal";
881
+ const ModalHeader = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4 space-y-2", className), ...props }));
882
+ ModalHeader.displayName = "ModalHeader";
883
+ const ModalTitle = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
884
+ "h2",
885
+ {
886
+ ref,
887
+ className: cn("text-xl font-semibold text-foreground leading-none", className),
888
+ ...props
889
+ }
890
+ ));
891
+ ModalTitle.displayName = "ModalTitle";
892
+ const ModalDescription = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
893
+ "p",
894
+ {
895
+ ref,
896
+ className: cn("text-sm text-muted-foreground leading-relaxed", className),
897
+ ...props
898
+ }
899
+ ));
900
+ ModalDescription.displayName = "ModalDescription";
901
+ const ModalFooter = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
902
+ "div",
903
+ {
904
+ ref,
905
+ className: cn("mt-6 flex items-center justify-end gap-3", className),
906
+ ...props
907
+ }
908
+ ));
909
+ ModalFooter.displayName = "ModalFooter";
910
+ const ToastContext = createContext(void 0);
911
+ const useToast = () => {
912
+ const context = useContext(ToastContext);
913
+ if (!context) {
914
+ throw new Error("useToast must be used within ToastProvider");
915
+ }
916
+ return context;
917
+ };
918
+ const ToastProvider = ({
919
+ children
920
+ }) => {
921
+ const [toasts, setToasts] = useState([]);
922
+ const removeToast = useCallback((id) => {
923
+ setToasts((prev) => prev.filter((toast2) => toast2.id !== id));
924
+ }, []);
925
+ const addToast = useCallback((toast2) => {
926
+ const id = generateId("toast");
927
+ const newToast = { ...toast2, id };
928
+ setToasts((prev) => [...prev, newToast]);
929
+ const duration = toast2.duration ?? ANIMATION_DURATION.TOAST_DEFAULT;
930
+ if (duration > 0) {
931
+ setTimeout(() => {
932
+ removeToast(id);
933
+ }, duration);
934
+ }
935
+ }, [removeToast]);
936
+ useEffect(() => {
937
+ const handleToastEvent = (e2) => {
938
+ const customEvent = e2;
939
+ addToast(customEvent.detail);
940
+ };
941
+ window.addEventListener("toast", handleToastEvent);
942
+ return () => window.removeEventListener("toast", handleToastEvent);
943
+ }, [addToast]);
944
+ return /* @__PURE__ */ jsxs(ToastContext.Provider, { value: { toasts, addToast, removeToast }, children: [
945
+ children,
946
+ /* @__PURE__ */ jsx(ToastContainer, {})
947
+ ] });
948
+ };
949
+ const ToastContainer = () => {
950
+ const { toasts, removeToast } = useToast();
951
+ return /* @__PURE__ */ jsx("div", { className: "fixed bottom-4 right-4 z-50 flex flex-col gap-2 w-full max-w-sm pointer-events-none", children: toasts.map((toast2) => /* @__PURE__ */ jsx(ToastItem, { toast: toast2, onClose: () => removeToast(toast2.id) }, toast2.id)) });
952
+ };
953
+ const ToastItem = ({ toast: toast2, onClose }) => {
954
+ const variantStyles = {
955
+ default: "bg-popover border-border backdrop-blur-sm shadow-xl",
956
+ success: "bg-popover border-green-300 dark:border-green-700 backdrop-blur-sm shadow-xl",
957
+ error: "bg-popover border-red-300 dark:border-red-700 backdrop-blur-sm shadow-xl",
958
+ warning: "bg-popover border-amber-300 dark:border-amber-700 backdrop-blur-sm shadow-xl",
959
+ info: "bg-popover border-blue-300 dark:border-blue-700 backdrop-blur-sm shadow-xl"
960
+ };
961
+ const iconContainerStyles = {
962
+ success: "bg-green-100 dark:bg-green-900/30 text-green-600 dark:text-green-400",
963
+ error: "bg-red-100 dark:bg-red-900/30 text-red-600 dark:text-red-400",
964
+ warning: "bg-amber-100 dark:bg-amber-900/30 text-amber-600 dark:text-amber-400",
965
+ info: "bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400"
966
+ };
967
+ const variantIcons = {
968
+ success: /* @__PURE__ */ jsx(CheckIcon, { className: "h-4 w-4" }),
969
+ error: /* @__PURE__ */ jsx(AlertCircleIcon, { className: "h-4 w-4" }),
970
+ warning: /* @__PURE__ */ jsx(AlertTriangleIcon, { className: "h-4 w-4" }),
971
+ info: /* @__PURE__ */ jsx(InfoIcon, { className: "h-4 w-4" })
972
+ };
973
+ const variant = toast2.variant || "default";
974
+ return /* @__PURE__ */ jsxs(
975
+ "div",
976
+ {
977
+ className: cn(
978
+ "pointer-events-auto flex items-start gap-3 rounded-xl border p-4 shadow-lg shadow-black/5 animate-slide-in-from-bottom",
979
+ variantStyles[variant]
980
+ ),
981
+ children: [
982
+ variant !== "default" && iconContainerStyles[variant] && /* @__PURE__ */ jsx("div", { className: cn(
983
+ "shrink-0 rounded-lg p-1.5",
984
+ iconContainerStyles[variant]
985
+ ), children: variantIcons[variant] }),
986
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 pt-0.5", children: [
987
+ toast2.title && /* @__PURE__ */ jsx("div", { className: "font-medium text-sm text-foreground leading-none", children: toast2.title }),
988
+ toast2.description && /* @__PURE__ */ jsx("div", { className: "mt-1.5 text-sm text-muted-foreground leading-snug", children: toast2.description })
989
+ ] }),
990
+ /* @__PURE__ */ jsxs(
991
+ "button",
992
+ {
993
+ onClick: onClose,
994
+ className: "shrink-0 rounded-md p-1 text-foreground/40 transition-colors hover:text-foreground/60 hover:bg-accent focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1",
995
+ "aria-label": "Close notification",
996
+ children: [
997
+ /* @__PURE__ */ jsx(CloseIcon, { className: "h-4 w-4" }),
998
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
999
+ ]
1000
+ }
1001
+ )
1002
+ ]
1003
+ }
1004
+ );
1005
+ };
1006
+ const toast = {
1007
+ success: (title, description) => {
1008
+ const event = new CustomEvent("toast", {
1009
+ detail: { title, description, variant: "success" }
1010
+ });
1011
+ window.dispatchEvent(event);
1012
+ },
1013
+ error: (title, description) => {
1014
+ const event = new CustomEvent("toast", {
1015
+ detail: { title, description, variant: "error" }
1016
+ });
1017
+ window.dispatchEvent(event);
1018
+ },
1019
+ warning: (title, description) => {
1020
+ const event = new CustomEvent("toast", {
1021
+ detail: { title, description, variant: "warning" }
1022
+ });
1023
+ window.dispatchEvent(event);
1024
+ },
1025
+ info: (title, description) => {
1026
+ const event = new CustomEvent("toast", {
1027
+ detail: { title, description, variant: "info" }
1028
+ });
1029
+ window.dispatchEvent(event);
1030
+ },
1031
+ message: (title, description) => {
1032
+ const event = new CustomEvent("toast", {
1033
+ detail: { title, description, variant: "default" }
1034
+ });
1035
+ window.dispatchEvent(event);
1036
+ }
1037
+ };
1038
+ const TabsContext = createContext(void 0);
1039
+ const useTabsContext = () => {
1040
+ const context = useContext(TabsContext);
1041
+ if (!context) {
1042
+ throw new Error("Tabs compound components must be used within Tabs");
1043
+ }
1044
+ return context;
1045
+ };
1046
+ const Tabs = forwardRef(
1047
+ ({ defaultValue, value: controlledValue, onValueChange, className, children, ...props }, ref) => {
1048
+ const [internalValue, setInternalValue] = useState(defaultValue);
1049
+ const isControlled = controlledValue !== void 0;
1050
+ const activeTab = isControlled ? controlledValue : internalValue;
1051
+ const setActiveTab = (newValue) => {
1052
+ if (!isControlled) {
1053
+ setInternalValue(newValue);
1054
+ }
1055
+ onValueChange == null ? void 0 : onValueChange(newValue);
1056
+ };
1057
+ return /* @__PURE__ */ jsx(TabsContext.Provider, { value: { activeTab, setActiveTab }, children: /* @__PURE__ */ jsx("div", { ref, className: cn("w-full", className), ...props, children }) });
1058
+ }
1059
+ );
1060
+ Tabs.displayName = "Tabs";
1061
+ const TabsList = forwardRef(
1062
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1063
+ "div",
1064
+ {
1065
+ ref,
1066
+ className: cn(
1067
+ "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
1068
+ className
1069
+ ),
1070
+ role: "tablist",
1071
+ ...props
1072
+ }
1073
+ )
1074
+ );
1075
+ TabsList.displayName = "TabsList";
1076
+ const TabsTrigger = forwardRef(
1077
+ ({ value, className, ...props }, ref) => {
1078
+ const { activeTab, setActiveTab } = useTabsContext();
1079
+ const isActive = activeTab === value;
1080
+ return /* @__PURE__ */ jsx(
1081
+ "button",
1082
+ {
1083
+ ref,
1084
+ type: "button",
1085
+ role: "tab",
1086
+ "aria-selected": isActive,
1087
+ onClick: () => setActiveTab(value),
1088
+ className: cn(
1089
+ "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium",
1090
+ "ring-offset-background transition-all",
1091
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
1092
+ "disabled:pointer-events-none disabled:opacity-50",
1093
+ isActive ? "bg-background text-foreground shadow-sm" : "hover:bg-background/50 hover:text-foreground",
1094
+ className
1095
+ ),
1096
+ ...props
1097
+ }
1098
+ );
1099
+ }
1100
+ );
1101
+ TabsTrigger.displayName = "TabsTrigger";
1102
+ const TabsContent = forwardRef(
1103
+ ({ value, className, ...props }, ref) => {
1104
+ const { activeTab } = useTabsContext();
1105
+ const isActive = activeTab === value;
1106
+ if (!isActive) return null;
1107
+ return /* @__PURE__ */ jsx(
1108
+ "div",
1109
+ {
1110
+ ref,
1111
+ role: "tabpanel",
1112
+ className: cn("mt-4 ring-offset-background", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", className),
1113
+ ...props
1114
+ }
1115
+ );
1116
+ }
1117
+ );
1118
+ TabsContent.displayName = "TabsContent";
1119
+ const Tooltip = forwardRef(
1120
+ ({ content, position = "top", delay = 200, className, children, ...props }, ref) => {
1121
+ const [isVisible, setIsVisible] = useState(false);
1122
+ const [coords, setCoords] = useState({ x: 0, y: 0 });
1123
+ const timeoutRef = useRef();
1124
+ const triggerRef = useRef(null);
1125
+ const showTooltip = () => {
1126
+ timeoutRef.current = setTimeout(() => {
1127
+ setIsVisible(true);
1128
+ updatePosition();
1129
+ }, delay);
1130
+ };
1131
+ const hideTooltip = () => {
1132
+ if (timeoutRef.current) {
1133
+ clearTimeout(timeoutRef.current);
1134
+ }
1135
+ setIsVisible(false);
1136
+ };
1137
+ const updatePosition = () => {
1138
+ if (!triggerRef.current) return;
1139
+ const rect = triggerRef.current.getBoundingClientRect();
1140
+ const offset = 8;
1141
+ const positions = {
1142
+ top: {
1143
+ x: rect.left + rect.width / 2,
1144
+ y: rect.top - offset
1145
+ },
1146
+ bottom: {
1147
+ x: rect.left + rect.width / 2,
1148
+ y: rect.bottom + offset
1149
+ },
1150
+ left: {
1151
+ x: rect.left - offset,
1152
+ y: rect.top + rect.height / 2
1153
+ },
1154
+ right: {
1155
+ x: rect.right + offset,
1156
+ y: rect.top + rect.height / 2
1157
+ }
1158
+ };
1159
+ setCoords(positions[position]);
1160
+ };
1161
+ useEffect(() => {
1162
+ return () => {
1163
+ if (timeoutRef.current) {
1164
+ clearTimeout(timeoutRef.current);
1165
+ }
1166
+ };
1167
+ }, []);
1168
+ const positionClasses = {
1169
+ top: "-translate-x-1/2 -translate-y-full",
1170
+ bottom: "-translate-x-1/2",
1171
+ left: "-translate-x-full -translate-y-1/2",
1172
+ right: "-translate-y-1/2"
1173
+ };
1174
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1175
+ /* @__PURE__ */ jsx(
1176
+ "div",
1177
+ {
1178
+ ref: triggerRef,
1179
+ onMouseEnter: showTooltip,
1180
+ onMouseLeave: hideTooltip,
1181
+ onFocus: showTooltip,
1182
+ onBlur: hideTooltip,
1183
+ className: "inline-block",
1184
+ children
1185
+ }
1186
+ ),
1187
+ isVisible && /* @__PURE__ */ jsxs(
1188
+ "div",
1189
+ {
1190
+ ref,
1191
+ role: "tooltip",
1192
+ style: {
1193
+ position: "fixed",
1194
+ left: `${coords.x}px`,
1195
+ top: `${coords.y}px`
1196
+ },
1197
+ className: cn(
1198
+ "z-50 rounded-md bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md border border-border",
1199
+ "pointer-events-none animate-fade-in",
1200
+ positionClasses[position],
1201
+ className
1202
+ ),
1203
+ ...props,
1204
+ children: [
1205
+ content,
1206
+ /* @__PURE__ */ jsx(
1207
+ "div",
1208
+ {
1209
+ className: cn(
1210
+ "absolute h-2 w-2 rotate-45 bg-popover",
1211
+ position === "top" && "bottom-[-4px] left-1/2 -translate-x-1/2",
1212
+ position === "bottom" && "top-[-4px] left-1/2 -translate-x-1/2",
1213
+ position === "left" && "right-[-4px] top-1/2 -translate-y-1/2",
1214
+ position === "right" && "left-[-4px] top-1/2 -translate-y-1/2"
1215
+ )
1216
+ }
1217
+ )
1218
+ ]
1219
+ }
1220
+ )
1221
+ ] });
1222
+ }
1223
+ );
1224
+ Tooltip.displayName = "Tooltip";
1225
+ const cardVariants = cva(
1226
+ "rounded-lg border bg-card text-card-foreground shadow-sm transition-all",
1227
+ {
1228
+ variants: {
1229
+ variant: {
1230
+ default: "",
1231
+ outline: "border-2",
1232
+ elevated: "shadow-lg",
1233
+ ghost: "border-transparent shadow-none"
1234
+ },
1235
+ hoverable: {
1236
+ true: "hover:shadow-md cursor-pointer"
1237
+ },
1238
+ padding: {
1239
+ none: "",
1240
+ sm: "p-4",
1241
+ md: "p-6",
1242
+ lg: "p-8"
1243
+ }
1244
+ },
1245
+ defaultVariants: {
1246
+ variant: "default",
1247
+ padding: "md"
1248
+ }
1249
+ }
1250
+ );
1251
+ const Card = forwardRef(
1252
+ ({ className, variant, hoverable, padding, ...props }, ref) => {
1253
+ return /* @__PURE__ */ jsx(
1254
+ "div",
1255
+ {
1256
+ ref,
1257
+ className: cn(cardVariants({ variant, hoverable, padding }), className),
1258
+ ...props
1259
+ }
1260
+ );
1261
+ }
1262
+ );
1263
+ Card.displayName = "Card";
1264
+ const CardHeader = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1265
+ "div",
1266
+ {
1267
+ ref,
1268
+ className: cn("flex flex-col space-y-1.5 pb-4", className),
1269
+ ...props
1270
+ }
1271
+ ));
1272
+ CardHeader.displayName = "CardHeader";
1273
+ const CardTitle = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1274
+ "h3",
1275
+ {
1276
+ ref,
1277
+ className: cn("text-2xl font-semibold leading-none tracking-tight", className),
1278
+ ...props
1279
+ }
1280
+ ));
1281
+ CardTitle.displayName = "CardTitle";
1282
+ const CardDescription = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1283
+ "p",
1284
+ {
1285
+ ref,
1286
+ className: cn("text-sm text-muted-foreground", className),
1287
+ ...props
1288
+ }
1289
+ ));
1290
+ CardDescription.displayName = "CardDescription";
1291
+ const CardContent = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("py-4 first:pt-0", className), ...props }));
1292
+ CardContent.displayName = "CardContent";
1293
+ const CardFooter = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1294
+ "div",
1295
+ {
1296
+ ref,
1297
+ className: cn("flex items-center pt-4", className),
1298
+ ...props
1299
+ }
1300
+ ));
1301
+ CardFooter.displayName = "CardFooter";
1302
+ const badgeVariants = cva(
1303
+ "inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
1304
+ {
1305
+ variants: {
1306
+ variant: {
1307
+ default: "border-transparent bg-primary text-primary-foreground",
1308
+ secondary: "border-transparent bg-secondary text-secondary-foreground",
1309
+ destructive: "border-transparent bg-destructive text-destructive-foreground",
1310
+ success: "border-transparent bg-success text-success-foreground",
1311
+ warning: "border-transparent bg-warning text-warning-foreground",
1312
+ outline: "border-border text-foreground"
1313
+ },
1314
+ size: {
1315
+ sm: "px-2 py-0.5 text-xs",
1316
+ md: "px-2.5 py-0.5 text-sm",
1317
+ lg: "px-3 py-1 text-base"
1318
+ },
1319
+ dot: {
1320
+ true: "gap-1.5"
1321
+ }
1322
+ },
1323
+ defaultVariants: {
1324
+ variant: "default",
1325
+ size: "md"
1326
+ }
1327
+ }
1328
+ );
1329
+ const Badge = forwardRef(
1330
+ ({ className, variant, size, showDot, children, ...props }, ref) => {
1331
+ return /* @__PURE__ */ jsxs(
1332
+ "div",
1333
+ {
1334
+ ref,
1335
+ className: cn(badgeVariants({ variant, size, dot: showDot }), className),
1336
+ ...props,
1337
+ children: [
1338
+ showDot && /* @__PURE__ */ jsx("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-pulse" }),
1339
+ children
1340
+ ]
1341
+ }
1342
+ );
1343
+ }
1344
+ );
1345
+ Badge.displayName = "Badge";
1346
+ const avatarVariants = cva(
1347
+ "relative inline-flex shrink-0 items-center justify-center overflow-hidden bg-muted font-medium text-muted-foreground",
1348
+ {
1349
+ variants: {
1350
+ size: {
1351
+ sm: "h-8 w-8 text-xs",
1352
+ md: "h-10 w-10 text-sm",
1353
+ lg: "h-12 w-12 text-base",
1354
+ xl: "h-16 w-16 text-lg",
1355
+ "2xl": "h-20 w-20 text-xl"
1356
+ },
1357
+ shape: {
1358
+ circle: "rounded-full",
1359
+ square: "rounded-md"
1360
+ }
1361
+ },
1362
+ defaultVariants: {
1363
+ size: "md",
1364
+ shape: "circle"
1365
+ }
1366
+ }
1367
+ );
1368
+ const Avatar = forwardRef(
1369
+ ({ className, size, shape, src, alt, fallback, status, ...props }, ref) => {
1370
+ const [imageError, setImageError] = useState(false);
1371
+ const [imageLoaded, setImageLoaded] = useState(false);
1372
+ const statusColors = {
1373
+ online: "bg-success",
1374
+ offline: "bg-muted-foreground",
1375
+ away: "bg-warning",
1376
+ busy: "bg-destructive"
1377
+ };
1378
+ const shouldShowImage = src && !imageError;
1379
+ const shouldShowFallback = !shouldShowImage || !imageLoaded;
1380
+ const initials = fallback || (alt == null ? void 0 : alt.split(" ").map((word) => word[0]).join("").toUpperCase().slice(0, 2)) || "?";
1381
+ return /* @__PURE__ */ jsxs("div", { className: "relative inline-block", children: [
1382
+ /* @__PURE__ */ jsxs(
1383
+ "div",
1384
+ {
1385
+ ref,
1386
+ className: cn(avatarVariants({ size, shape }), className),
1387
+ ...props,
1388
+ children: [
1389
+ shouldShowImage && /* @__PURE__ */ jsx(
1390
+ "img",
1391
+ {
1392
+ src,
1393
+ alt,
1394
+ onError: () => setImageError(true),
1395
+ onLoad: () => setImageLoaded(true),
1396
+ className: cn(
1397
+ "aspect-square h-full w-full object-cover",
1398
+ !imageLoaded && "hidden"
1399
+ )
1400
+ }
1401
+ ),
1402
+ shouldShowFallback && /* @__PURE__ */ jsx("span", { children: initials })
1403
+ ]
1404
+ }
1405
+ ),
1406
+ status && /* @__PURE__ */ jsx(
1407
+ "span",
1408
+ {
1409
+ className: cn(
1410
+ "absolute bottom-0 right-0 block rounded-full border-2 border-background",
1411
+ statusColors[status],
1412
+ size === "sm" && "h-2 w-2",
1413
+ size === "md" && "h-2.5 w-2.5",
1414
+ size === "lg" && "h-3 w-3",
1415
+ size === "xl" && "h-4 w-4",
1416
+ size === "2xl" && "h-5 w-5"
1417
+ ),
1418
+ "aria-label": `Status: ${status}`
1419
+ }
1420
+ )
1421
+ ] });
1422
+ }
1423
+ );
1424
+ Avatar.displayName = "Avatar";
1425
+ const TablePagination = ({
1426
+ currentPage,
1427
+ totalPages,
1428
+ pageSize,
1429
+ totalItems,
1430
+ onPageChange,
1431
+ canGoNext,
1432
+ canGoPrevious
1433
+ }) => {
1434
+ const startItem = (currentPage - 1) * pageSize + 1;
1435
+ const endItem = Math.min(currentPage * pageSize, totalItems);
1436
+ return /* @__PURE__ */ jsxs("div", { className: "mt-4 flex items-center justify-between", children: [
1437
+ /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
1438
+ "Showing ",
1439
+ startItem,
1440
+ " to ",
1441
+ endItem,
1442
+ " of ",
1443
+ totalItems,
1444
+ " results"
1445
+ ] }),
1446
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1447
+ /* @__PURE__ */ jsx(
1448
+ "button",
1449
+ {
1450
+ onClick: () => onPageChange(currentPage - 1),
1451
+ disabled: !canGoPrevious,
1452
+ className: cn(
1453
+ "rounded-md border border-border px-3 py-1 text-sm transition-colors",
1454
+ !canGoPrevious ? "cursor-not-allowed opacity-50" : "hover:bg-muted"
1455
+ ),
1456
+ "aria-label": "Previous page",
1457
+ children: "Previous"
1458
+ }
1459
+ ),
1460
+ /* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground", children: [
1461
+ "Page ",
1462
+ currentPage,
1463
+ " of ",
1464
+ totalPages
1465
+ ] }),
1466
+ /* @__PURE__ */ jsx(
1467
+ "button",
1468
+ {
1469
+ onClick: () => onPageChange(currentPage + 1),
1470
+ disabled: !canGoNext,
1471
+ className: cn(
1472
+ "rounded-md border border-border px-3 py-1 text-sm transition-colors",
1473
+ !canGoNext ? "cursor-not-allowed opacity-50" : "hover:bg-muted"
1474
+ ),
1475
+ "aria-label": "Next page",
1476
+ children: "Next"
1477
+ }
1478
+ )
1479
+ ] })
1480
+ ] });
1481
+ };
1482
+ const Table = forwardRef(
1483
+ ({
1484
+ columns,
1485
+ data,
1486
+ striped = false,
1487
+ hoverable = true,
1488
+ size = "md",
1489
+ sortable = false,
1490
+ defaultSortKey,
1491
+ defaultSortDirection = "asc",
1492
+ onSortChange,
1493
+ expandable = false,
1494
+ renderExpanded,
1495
+ pagination = false,
1496
+ pageSize = 10,
1497
+ currentPage,
1498
+ onPageChange,
1499
+ loading = false,
1500
+ emptyMessage = "No data available",
1501
+ className,
1502
+ ...props
1503
+ }, ref) => {
1504
+ const [expandedRows, setExpandedRows] = useState(/* @__PURE__ */ new Set());
1505
+ const { sortedData, sortKey, sortDirection, handleSort } = useTableSort({
1506
+ data,
1507
+ columns,
1508
+ defaultSortKey,
1509
+ defaultSortDirection,
1510
+ onSortChange
1511
+ });
1512
+ const {
1513
+ paginatedData,
1514
+ currentPage: page,
1515
+ totalPages,
1516
+ handlePageChange,
1517
+ canGoNext,
1518
+ canGoPrevious
1519
+ } = useTablePagination({
1520
+ data: sortedData,
1521
+ pageSize,
1522
+ currentPage,
1523
+ onPageChange
1524
+ });
1525
+ const toggleExpanded = (index) => {
1526
+ const newExpanded = new Set(expandedRows);
1527
+ if (newExpanded.has(index)) {
1528
+ newExpanded.delete(index);
1529
+ } else {
1530
+ newExpanded.add(index);
1531
+ }
1532
+ setExpandedRows(newExpanded);
1533
+ };
1534
+ const sizeClasses = {
1535
+ sm: "text-xs",
1536
+ md: "text-sm",
1537
+ lg: "text-base"
1538
+ };
1539
+ const cellPadding = {
1540
+ sm: "px-3 py-2",
1541
+ md: "px-4 py-3",
1542
+ lg: "px-6 py-4"
1543
+ };
1544
+ const displayData = pagination ? paginatedData : sortedData;
1545
+ return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
1546
+ /* @__PURE__ */ jsx("div", { className: "overflow-x-auto rounded-lg border border-border", children: /* @__PURE__ */ jsxs(
1547
+ "table",
1548
+ {
1549
+ ref,
1550
+ className: cn("w-full border-collapse", sizeClasses[size], className),
1551
+ ...props,
1552
+ children: [
1553
+ /* @__PURE__ */ jsx("thead", { className: "bg-muted/50", children: /* @__PURE__ */ jsxs("tr", { children: [
1554
+ expandable && /* @__PURE__ */ jsx("th", { className: cn("w-12", cellPadding[size]) }),
1555
+ columns.map((column) => /* @__PURE__ */ jsx(
1556
+ "th",
1557
+ {
1558
+ className: cn(
1559
+ cellPadding[size],
1560
+ "text-left font-semibold text-foreground",
1561
+ column.align === "center" && "text-center",
1562
+ column.align === "right" && "text-right",
1563
+ sortable && column.sortable !== false && "cursor-pointer select-none hover:bg-muted",
1564
+ column.width && `w-[${column.width}]`
1565
+ ),
1566
+ onClick: () => sortable && column.sortable !== false && handleSort(column.key),
1567
+ style: { width: column.width },
1568
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1569
+ column.header,
1570
+ sortable && column.sortable !== false && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: sortKey === column.key ? sortDirection === "asc" ? /* @__PURE__ */ jsx(SortAscIcon, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(SortDescIcon, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx("div", { className: "h-4 w-4" }) })
1571
+ ] })
1572
+ },
1573
+ column.key
1574
+ ))
1575
+ ] }) }),
1576
+ /* @__PURE__ */ jsx("tbody", { children: loading ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
1577
+ "td",
1578
+ {
1579
+ colSpan: columns.length + (expandable ? 1 : 0),
1580
+ className: cn(cellPadding[size], "text-center text-muted-foreground"),
1581
+ children: "Loading..."
1582
+ }
1583
+ ) }) : displayData.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
1584
+ "td",
1585
+ {
1586
+ colSpan: columns.length + (expandable ? 1 : 0),
1587
+ className: cn(cellPadding[size], "text-center text-muted-foreground"),
1588
+ children: emptyMessage
1589
+ }
1590
+ ) }) : displayData.map((row, rowIndex) => {
1591
+ const isExpanded = expandedRows.has(rowIndex);
1592
+ return /* @__PURE__ */ jsxs(React.Fragment, { children: [
1593
+ /* @__PURE__ */ jsxs(
1594
+ "tr",
1595
+ {
1596
+ className: cn(
1597
+ "border-t border-border",
1598
+ striped && rowIndex % 2 === 1 && "bg-muted/30",
1599
+ hoverable && "hover:bg-muted/50 transition-colors",
1600
+ expandable && "cursor-pointer"
1601
+ ),
1602
+ onClick: expandable ? () => toggleExpanded(rowIndex) : void 0,
1603
+ children: [
1604
+ expandable && /* @__PURE__ */ jsx("td", { className: cellPadding[size], children: /* @__PURE__ */ jsx(
1605
+ "div",
1606
+ {
1607
+ className: "flex items-center justify-center text-muted-foreground hover:text-foreground transition-all",
1608
+ "aria-label": isExpanded ? "Collapse row" : "Expand row",
1609
+ children: /* @__PURE__ */ jsx(
1610
+ ChevronRightIcon,
1611
+ {
1612
+ className: cn(
1613
+ "h-4 w-4 transition-transform duration-200",
1614
+ isExpanded && "rotate-90"
1615
+ )
1616
+ }
1617
+ )
1618
+ }
1619
+ ) }),
1620
+ columns.map((column) => {
1621
+ const value = column.accessor ? column.accessor(row) : row[column.key];
1622
+ return /* @__PURE__ */ jsx(
1623
+ "td",
1624
+ {
1625
+ className: cn(
1626
+ cellPadding[size],
1627
+ "text-foreground",
1628
+ column.align === "center" && "text-center",
1629
+ column.align === "right" && "text-right"
1630
+ ),
1631
+ children: value
1632
+ },
1633
+ column.key
1634
+ );
1635
+ })
1636
+ ]
1637
+ }
1638
+ ),
1639
+ expandable && isExpanded && renderExpanded && /* @__PURE__ */ jsx("tr", { className: "border-t border-border bg-muted/20", children: /* @__PURE__ */ jsx("td", { colSpan: columns.length + 1, className: cellPadding[size], children: renderExpanded(row, rowIndex) }) })
1640
+ ] }, rowIndex);
1641
+ }) })
1642
+ ]
1643
+ }
1644
+ ) }),
1645
+ pagination && !loading && displayData.length > 0 && /* @__PURE__ */ jsx(
1646
+ TablePagination,
1647
+ {
1648
+ currentPage: page,
1649
+ totalPages,
1650
+ pageSize,
1651
+ totalItems: sortedData.length,
1652
+ onPageChange: handlePageChange,
1653
+ canGoNext,
1654
+ canGoPrevious
1655
+ }
1656
+ )
1657
+ ] });
1658
+ }
1659
+ );
1660
+ Table.displayName = "Table";
1661
+ export {
1662
+ ANIMATION_DURATION,
1663
+ AlertCircleIcon,
1664
+ AlertTriangleIcon,
1665
+ Avatar,
1666
+ Badge,
1667
+ Button,
1668
+ Card,
1669
+ CardContent,
1670
+ CardDescription,
1671
+ CardFooter,
1672
+ CardHeader,
1673
+ CardTitle,
1674
+ CheckIcon,
1675
+ Checkbox,
1676
+ ChevronDownIcon,
1677
+ CloseIcon,
1678
+ InfoIcon,
1679
+ Input,
1680
+ KEYBOARD_KEYS,
1681
+ Modal,
1682
+ ModalDescription,
1683
+ ModalFooter,
1684
+ ModalHeader,
1685
+ ModalTitle,
1686
+ Select,
1687
+ SpinnerIcon,
1688
+ Switch,
1689
+ Table,
1690
+ Tabs,
1691
+ TabsContent,
1692
+ TabsList,
1693
+ TabsTrigger,
1694
+ Textarea,
1695
+ ToastProvider,
1696
+ Tooltip,
1697
+ avatarVariants,
1698
+ badgeVariants,
1699
+ buttonVariants,
1700
+ cardVariants,
1701
+ cn,
1702
+ generateId,
1703
+ inputVariants,
1704
+ toast,
1705
+ useClickOutside,
1706
+ a as useControllableState,
1707
+ b as useDisclosure,
1708
+ useFocusTrap,
1709
+ useLockBodyScroll,
1710
+ e as useMediaQuery,
1711
+ useRipple,
1712
+ useToast
1713
+ };
1714
+ //# sourceMappingURL=index.js.map