@andreagiugni/tailwind-dashboard-ui 0.1.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 (66) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +282 -0
  3. package/dist/Editor-uOYxR3HX.d.cts +53 -0
  4. package/dist/Editor-uOYxR3HX.d.ts +53 -0
  5. package/dist/chunk-4OETC46A.js +353 -0
  6. package/dist/chunk-4OETC46A.js.map +1 -0
  7. package/dist/chunk-7OWZKV75.js +420 -0
  8. package/dist/chunk-7OWZKV75.js.map +1 -0
  9. package/dist/chunk-BGA7AECV.cjs +152 -0
  10. package/dist/chunk-BGA7AECV.cjs.map +1 -0
  11. package/dist/chunk-HT7SQXRF.cjs +85 -0
  12. package/dist/chunk-HT7SQXRF.cjs.map +1 -0
  13. package/dist/chunk-HZQZC5CK.js +124 -0
  14. package/dist/chunk-HZQZC5CK.js.map +1 -0
  15. package/dist/chunk-MEU4PMP5.js +146 -0
  16. package/dist/chunk-MEU4PMP5.js.map +1 -0
  17. package/dist/chunk-MYOOZFHK.cjs +430 -0
  18. package/dist/chunk-MYOOZFHK.cjs.map +1 -0
  19. package/dist/chunk-OSIOO5AE.cjs +130 -0
  20. package/dist/chunk-OSIOO5AE.cjs.map +1 -0
  21. package/dist/chunk-R66LONPQ.js +83 -0
  22. package/dist/chunk-R66LONPQ.js.map +1 -0
  23. package/dist/chunk-W7SNEBD7.cjs +362 -0
  24. package/dist/chunk-W7SNEBD7.cjs.map +1 -0
  25. package/dist/chunk-YERNSNT4.cjs +13 -0
  26. package/dist/chunk-YERNSNT4.cjs.map +1 -0
  27. package/dist/chunk-ZLIYUUA4.js +11 -0
  28. package/dist/chunk-ZLIYUUA4.js.map +1 -0
  29. package/dist/components/Calendar/Calendar.cjs +14 -0
  30. package/dist/components/Calendar/Calendar.cjs.map +1 -0
  31. package/dist/components/Calendar/Calendar.d.cts +12 -0
  32. package/dist/components/Calendar/Calendar.d.ts +12 -0
  33. package/dist/components/Calendar/Calendar.js +5 -0
  34. package/dist/components/Calendar/Calendar.js.map +1 -0
  35. package/dist/components/Charts/BarChart.cjs +13 -0
  36. package/dist/components/Charts/BarChart.cjs.map +1 -0
  37. package/dist/components/Charts/BarChart.d.cts +13 -0
  38. package/dist/components/Charts/BarChart.d.ts +13 -0
  39. package/dist/components/Charts/BarChart.js +4 -0
  40. package/dist/components/Charts/BarChart.js.map +1 -0
  41. package/dist/components/Charts/LineChart.cjs +13 -0
  42. package/dist/components/Charts/LineChart.cjs.map +1 -0
  43. package/dist/components/Charts/LineChart.d.cts +13 -0
  44. package/dist/components/Charts/LineChart.d.ts +13 -0
  45. package/dist/components/Charts/LineChart.js +4 -0
  46. package/dist/components/Charts/LineChart.js.map +1 -0
  47. package/dist/components/Editor/Editor.cjs +14 -0
  48. package/dist/components/Editor/Editor.cjs.map +1 -0
  49. package/dist/components/Editor/Editor.d.cts +3 -0
  50. package/dist/components/Editor/Editor.d.ts +3 -0
  51. package/dist/components/Editor/Editor.js +5 -0
  52. package/dist/components/Editor/Editor.js.map +1 -0
  53. package/dist/components/Map/CountryMap.cjs +13 -0
  54. package/dist/components/Map/CountryMap.cjs.map +1 -0
  55. package/dist/components/Map/CountryMap.d.cts +13 -0
  56. package/dist/components/Map/CountryMap.d.ts +13 -0
  57. package/dist/components/Map/CountryMap.js +4 -0
  58. package/dist/components/Map/CountryMap.js.map +1 -0
  59. package/dist/index.cjs +2896 -0
  60. package/dist/index.cjs.map +1 -0
  61. package/dist/index.d.cts +573 -0
  62. package/dist/index.d.ts +573 -0
  63. package/dist/index.js +2816 -0
  64. package/dist/index.js.map +1 -0
  65. package/package.json +134 -0
  66. package/src/theme.css +784 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,2896 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var chunkOSIOO5AE_cjs = require('./chunk-OSIOO5AE.cjs');
5
+ var chunkBGA7AECV_cjs = require('./chunk-BGA7AECV.cjs');
6
+ var chunkMYOOZFHK_cjs = require('./chunk-MYOOZFHK.cjs');
7
+ var chunkHT7SQXRF_cjs = require('./chunk-HT7SQXRF.cjs');
8
+ var chunkW7SNEBD7_cjs = require('./chunk-W7SNEBD7.cjs');
9
+ var chunkYERNSNT4_cjs = require('./chunk-YERNSNT4.cjs');
10
+ var jsxRuntime = require('react/jsx-runtime');
11
+ var React5 = require('react');
12
+ var flatpickr = require('flatpickr');
13
+ require('flatpickr/dist/flatpickr.css');
14
+
15
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
16
+
17
+ var React5__default = /*#__PURE__*/_interopDefault(React5);
18
+ var flatpickr__default = /*#__PURE__*/_interopDefault(flatpickr);
19
+
20
+ // src/lib/styleOverride.ts
21
+ function styleOverride({
22
+ bgColor,
23
+ textColor,
24
+ borderColor
25
+ }) {
26
+ const style = {};
27
+ if (bgColor !== void 0) style.backgroundColor = bgColor;
28
+ if (textColor !== void 0) style.color = textColor;
29
+ if (borderColor !== void 0) style.borderColor = borderColor;
30
+ return style;
31
+ }
32
+ var sizeClasses = {
33
+ sm: "px-4 py-3 text-sm",
34
+ md: "px-5 py-3.5 text-sm"
35
+ };
36
+ var variantClasses = {
37
+ primary: "bg-brand-500 text-white shadow-theme-xs hover:bg-brand-600 disabled:bg-brand-300",
38
+ outline: "bg-white text-gray-700 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 dark:bg-gray-800 dark:text-gray-400 dark:ring-gray-700 dark:hover:bg-white/[0.03] dark:hover:text-gray-300"
39
+ };
40
+ var Button = ({
41
+ children,
42
+ size = "md",
43
+ variant = "primary",
44
+ startIcon,
45
+ endIcon,
46
+ className,
47
+ disabled = false,
48
+ bgColor,
49
+ textColor,
50
+ borderColor,
51
+ style,
52
+ ...rest
53
+ }) => {
54
+ return /* @__PURE__ */ jsxRuntime.jsxs(
55
+ "button",
56
+ {
57
+ className: chunkYERNSNT4_cjs.cn(
58
+ "inline-flex items-center justify-center font-medium gap-2 rounded-lg transition",
59
+ sizeClasses[size],
60
+ variantClasses[variant],
61
+ disabled && "cursor-not-allowed opacity-50",
62
+ className
63
+ ),
64
+ disabled,
65
+ style: { ...styleOverride({ bgColor, textColor, borderColor }), ...style },
66
+ ...rest,
67
+ children: [
68
+ startIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center", children: startIcon }),
69
+ children,
70
+ endIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center", children: endIcon })
71
+ ]
72
+ }
73
+ );
74
+ };
75
+ var sizeStyles = {
76
+ sm: "text-theme-xs",
77
+ md: "text-sm"
78
+ };
79
+ var variants = {
80
+ light: {
81
+ primary: "bg-brand-50 text-brand-500 dark:bg-brand-500/15 dark:text-brand-400",
82
+ success: "bg-success-50 text-success-600 dark:bg-success-500/15 dark:text-success-500",
83
+ error: "bg-error-50 text-error-600 dark:bg-error-500/15 dark:text-error-500",
84
+ warning: "bg-warning-50 text-warning-600 dark:bg-warning-500/15 dark:text-orange-400",
85
+ info: "bg-blue-light-50 text-blue-light-500 dark:bg-blue-light-500/15 dark:text-blue-light-500",
86
+ light: "bg-gray-100 text-gray-700 dark:bg-white/5 dark:text-white/80",
87
+ dark: "bg-gray-500 text-white dark:bg-white/5 dark:text-white"
88
+ },
89
+ solid: {
90
+ primary: "bg-brand-500 text-white dark:text-white",
91
+ success: "bg-success-500 text-white dark:text-white",
92
+ error: "bg-error-500 text-white dark:text-white",
93
+ warning: "bg-warning-500 text-white dark:text-white",
94
+ info: "bg-blue-light-500 text-white dark:text-white",
95
+ light: "bg-gray-400 dark:bg-white/5 text-white dark:text-white/80",
96
+ dark: "bg-gray-700 text-white dark:text-white"
97
+ }
98
+ };
99
+ var Badge = ({
100
+ variant = "light",
101
+ color = "primary",
102
+ size = "md",
103
+ startIcon,
104
+ endIcon,
105
+ children,
106
+ className,
107
+ bgColor,
108
+ textColor,
109
+ borderColor,
110
+ style,
111
+ ...rest
112
+ }) => {
113
+ return /* @__PURE__ */ jsxRuntime.jsxs(
114
+ "span",
115
+ {
116
+ className: chunkYERNSNT4_cjs.cn(
117
+ "inline-flex items-center px-2.5 py-0.5 justify-center gap-1 rounded-full font-medium",
118
+ sizeStyles[size],
119
+ variants[variant][color],
120
+ className
121
+ ),
122
+ style: { ...styleOverride({ bgColor, textColor, borderColor }), ...style },
123
+ ...rest,
124
+ children: [
125
+ startIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center", children: startIcon }),
126
+ children,
127
+ endIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center", children: endIcon })
128
+ ]
129
+ }
130
+ );
131
+ };
132
+ var colorClasses = {
133
+ primary: "bg-brand-500 text-white",
134
+ success: "bg-success-500 text-white",
135
+ error: "bg-error-500 text-white",
136
+ warning: "bg-warning-500 text-white",
137
+ info: "bg-blue-light-500 text-white",
138
+ dark: "bg-gray-800 text-white dark:bg-gray-700"
139
+ };
140
+ var cornerClasses = {
141
+ "top-left": "left-[-36px] top-[16px] w-[130px] -rotate-45",
142
+ "top-right": "right-[-36px] top-[16px] w-[130px] rotate-45",
143
+ "bottom-left": "bottom-[16px] left-[-36px] w-[130px] rotate-45",
144
+ "bottom-right": "bottom-[16px] right-[-36px] w-[130px] -rotate-45"
145
+ };
146
+ var roundedClasses = {
147
+ "top-left": "left-0 top-0 rounded-tl-xl rounded-br-lg",
148
+ "top-right": "right-0 top-0 rounded-tr-xl rounded-bl-lg",
149
+ "bottom-left": "bottom-0 left-0 rounded-bl-xl rounded-tr-lg",
150
+ "bottom-right": "bottom-0 right-0 rounded-br-xl rounded-tl-lg"
151
+ };
152
+ var flagClasses = {
153
+ "top-left": "left-0 top-4 rounded-r-sm pl-3 pr-5",
154
+ "bottom-left": "bottom-4 left-0 rounded-r-sm pl-3 pr-5",
155
+ "top-right": "right-0 top-4 rounded-l-sm pl-5 pr-3",
156
+ "bottom-right": "bottom-4 right-0 rounded-l-sm pl-5 pr-3"
157
+ };
158
+ var flagClipPath = {
159
+ "top-left": "polygon(0 0, 100% 0, calc(100% - 9px) 50%, 100% 100%, 0 100%)",
160
+ "bottom-left": "polygon(0 0, 100% 0, calc(100% - 9px) 50%, 100% 100%, 0 100%)",
161
+ "top-right": "polygon(0 0, 100% 0, 100% 100%, 0 100%, 9px 50%)",
162
+ "bottom-right": "polygon(0 0, 100% 0, 100% 100%, 0 100%, 9px 50%)"
163
+ };
164
+ var Ribbon = ({
165
+ variant = "corner",
166
+ color = "primary",
167
+ position = "top-right",
168
+ children,
169
+ className,
170
+ bgColor,
171
+ textColor,
172
+ borderColor,
173
+ style,
174
+ ...rest
175
+ }) => {
176
+ const variantClass = variant === "corner" ? cornerClasses[position] : variant === "rounded" ? roundedClasses[position] : flagClasses[position];
177
+ return /* @__PURE__ */ jsxRuntime.jsx(
178
+ "span",
179
+ {
180
+ className: chunkYERNSNT4_cjs.cn(
181
+ "absolute z-10 inline-flex items-center justify-center whitespace-nowrap py-1 text-center text-theme-xs font-semibold shadow-theme-xs",
182
+ variant === "corner" && "px-10",
183
+ variant === "rounded" && "px-3",
184
+ colorClasses[color],
185
+ variantClass,
186
+ className
187
+ ),
188
+ style: {
189
+ ...variant === "flag" ? { clipPath: flagClipPath[position] } : void 0,
190
+ ...styleOverride({ bgColor, textColor, borderColor }),
191
+ ...style
192
+ },
193
+ ...rest,
194
+ children
195
+ }
196
+ );
197
+ };
198
+ var alertIcons = {
199
+ success: /* @__PURE__ */ jsxRuntime.jsx(
200
+ "svg",
201
+ {
202
+ className: "fill-current",
203
+ width: "24",
204
+ height: "24",
205
+ viewBox: "0 0 24 24",
206
+ xmlns: "http://www.w3.org/2000/svg",
207
+ children: /* @__PURE__ */ jsxRuntime.jsx(
208
+ "path",
209
+ {
210
+ fillRule: "evenodd",
211
+ clipRule: "evenodd",
212
+ d: "M3.70186 12.0001C3.70186 7.41711 7.41711 3.70186 12.0001 3.70186C16.5831 3.70186 20.2984 7.41711 20.2984 12.0001C20.2984 16.5831 16.5831 20.2984 12.0001 20.2984C7.41711 20.2984 3.70186 16.5831 3.70186 12.0001ZM12.0001 1.90186C6.423 1.90186 1.90186 6.423 1.90186 12.0001C1.90186 17.5772 6.423 22.0984 12.0001 22.0984C17.5772 22.0984 22.0984 17.5772 22.0984 12.0001C22.0984 6.423 17.5772 1.90186 12.0001 1.90186ZM15.6197 10.7395C15.9712 10.388 15.9712 9.81819 15.6197 9.46672C15.2683 9.11525 14.6984 9.11525 14.347 9.46672L11.1894 12.6243L9.6533 11.0883C9.30183 10.7368 8.73198 10.7368 8.38051 11.0883C8.02904 11.4397 8.02904 12.0096 8.38051 12.3611L10.553 14.5335C10.7217 14.7023 10.9507 14.7971 11.1894 14.7971C11.428 14.7971 11.657 14.7023 11.8257 14.5335L15.6197 10.7395Z"
213
+ }
214
+ )
215
+ }
216
+ ),
217
+ error: /* @__PURE__ */ jsxRuntime.jsx(
218
+ "svg",
219
+ {
220
+ className: "fill-current",
221
+ width: "24",
222
+ height: "24",
223
+ viewBox: "0 0 24 24",
224
+ fill: "none",
225
+ xmlns: "http://www.w3.org/2000/svg",
226
+ children: /* @__PURE__ */ jsxRuntime.jsx(
227
+ "path",
228
+ {
229
+ fillRule: "evenodd",
230
+ clipRule: "evenodd",
231
+ d: "M20.3499 12.0004C20.3499 16.612 16.6115 20.3504 11.9999 20.3504C7.38832 20.3504 3.6499 16.612 3.6499 12.0004C3.6499 7.38881 7.38833 3.65039 11.9999 3.65039C16.6115 3.65039 20.3499 7.38881 20.3499 12.0004ZM11.9999 22.1504C17.6056 22.1504 22.1499 17.6061 22.1499 12.0004C22.1499 6.3947 17.6056 1.85039 11.9999 1.85039C6.39421 1.85039 1.8499 6.3947 1.8499 12.0004C1.8499 17.6061 6.39421 22.1504 11.9999 22.1504ZM13.0008 16.4753C13.0008 15.923 12.5531 15.4753 12.0008 15.4753L11.9998 15.4753C11.4475 15.4753 10.9998 15.923 10.9998 16.4753C10.9998 17.0276 11.4475 17.4753 11.9998 17.4753L12.0008 17.4753C12.5531 17.4753 13.0008 17.0276 13.0008 16.4753ZM11.9998 6.62898C12.414 6.62898 12.7498 6.96476 12.7498 7.37898L12.7498 13.0555C12.7498 13.4697 12.414 13.8055 11.9998 13.8055C11.5856 13.8055 11.2498 13.4697 11.2498 13.0555L11.2498 7.37898C11.2498 6.96476 11.5856 6.62898 11.9998 6.62898Z",
232
+ fill: "#F04438"
233
+ }
234
+ )
235
+ }
236
+ ),
237
+ warning: /* @__PURE__ */ jsxRuntime.jsx(
238
+ "svg",
239
+ {
240
+ className: "fill-current",
241
+ width: "24",
242
+ height: "24",
243
+ viewBox: "0 0 24 24",
244
+ fill: "none",
245
+ xmlns: "http://www.w3.org/2000/svg",
246
+ children: /* @__PURE__ */ jsxRuntime.jsx(
247
+ "path",
248
+ {
249
+ fillRule: "evenodd",
250
+ clipRule: "evenodd",
251
+ d: "M3.6501 12.0001C3.6501 7.38852 7.38852 3.6501 12.0001 3.6501C16.6117 3.6501 20.3501 7.38852 20.3501 12.0001C20.3501 16.6117 16.6117 20.3501 12.0001 20.3501C7.38852 20.3501 3.6501 16.6117 3.6501 12.0001ZM12.0001 1.8501C6.39441 1.8501 1.8501 6.39441 1.8501 12.0001C1.8501 17.6058 6.39441 22.1501 12.0001 22.1501C17.6058 22.1501 22.1501 17.6058 22.1501 12.0001C22.1501 6.39441 17.6058 1.8501 12.0001 1.8501ZM10.9992 7.52517C10.9992 8.07746 11.4469 8.52517 11.9992 8.52517H12.0002C12.5525 8.52517 13.0002 8.07746 13.0002 7.52517C13.0002 6.97289 12.5525 6.52517 12.0002 6.52517H11.9992C11.4469 6.52517 10.9992 6.97289 10.9992 7.52517ZM12.0002 17.3715C11.586 17.3715 11.2502 17.0357 11.2502 16.6215V10.945C11.2502 10.5308 11.586 10.195 12.0002 10.195C12.4144 10.195 12.7502 10.5308 12.7502 10.945V16.6215C12.7502 17.0357 12.4144 17.3715 12.0002 17.3715Z",
252
+ fill: ""
253
+ }
254
+ )
255
+ }
256
+ ),
257
+ info: /* @__PURE__ */ jsxRuntime.jsx(
258
+ "svg",
259
+ {
260
+ className: "fill-current",
261
+ width: "24",
262
+ height: "24",
263
+ viewBox: "0 0 24 24",
264
+ fill: "none",
265
+ xmlns: "http://www.w3.org/2000/svg",
266
+ children: /* @__PURE__ */ jsxRuntime.jsx(
267
+ "path",
268
+ {
269
+ fillRule: "evenodd",
270
+ clipRule: "evenodd",
271
+ d: "M3.6501 11.9996C3.6501 7.38803 7.38852 3.64961 12.0001 3.64961C16.6117 3.64961 20.3501 7.38803 20.3501 11.9996C20.3501 16.6112 16.6117 20.3496 12.0001 20.3496C7.38852 20.3496 3.6501 16.6112 3.6501 11.9996ZM12.0001 1.84961C6.39441 1.84961 1.8501 6.39392 1.8501 11.9996C1.8501 17.6053 6.39441 22.1496 12.0001 22.1496C17.6058 22.1496 22.1501 17.6053 22.1501 11.9996C22.1501 6.39392 17.6058 1.84961 12.0001 1.84961ZM10.9992 7.52468C10.9992 8.07697 11.4469 8.52468 11.9992 8.52468H12.0002C12.5525 8.52468 13.0002 8.07697 13.0002 7.52468C13.0002 6.9724 12.5525 6.52468 12.0002 6.52468H11.9992C11.4469 6.52468 10.9992 6.9724 10.9992 7.52468ZM12.0002 17.371C11.586 17.371 11.2502 17.0352 11.2502 16.621V10.9445C11.2502 10.5303 11.586 10.1945 12.0002 10.1945C12.4144 10.1945 12.7502 10.5303 12.7502 10.9445V16.621C12.7502 17.0352 12.4144 17.371 12.0002 17.371Z",
272
+ fill: ""
273
+ }
274
+ )
275
+ }
276
+ )
277
+ };
278
+ var variantClasses2 = {
279
+ success: {
280
+ container: "border-success-500 bg-success-50 dark:border-success-500/30 dark:bg-success-500/15",
281
+ icon: "text-success-500"
282
+ },
283
+ error: {
284
+ container: "border-error-500 bg-error-50 dark:border-error-500/30 dark:bg-error-500/15",
285
+ icon: "text-error-500"
286
+ },
287
+ warning: {
288
+ container: "border-warning-500 bg-warning-50 dark:border-warning-500/30 dark:bg-warning-500/15",
289
+ icon: "text-warning-500"
290
+ },
291
+ info: {
292
+ container: "border-blue-light-500 bg-blue-light-50 dark:border-blue-light-500/30 dark:bg-blue-light-500/15",
293
+ icon: "text-blue-light-500"
294
+ }
295
+ };
296
+ var Alert = ({
297
+ variant,
298
+ title,
299
+ message,
300
+ showLink = false,
301
+ linkHref = "#",
302
+ linkText = "Learn more",
303
+ icon,
304
+ className,
305
+ ...rest
306
+ }) => {
307
+ return /* @__PURE__ */ jsxRuntime.jsx(
308
+ "div",
309
+ {
310
+ className: chunkYERNSNT4_cjs.cn("rounded-xl border p-4", variantClasses2[variant].container, className),
311
+ ...rest,
312
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
313
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkYERNSNT4_cjs.cn("-mt-0.5", variantClasses2[variant].icon), children: icon ?? alertIcons[variant] }),
314
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
315
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "mb-1 text-sm font-semibold text-gray-800 dark:text-white/90", children: title }),
316
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: message }),
317
+ showLink && /* @__PURE__ */ jsxRuntime.jsx(
318
+ "a",
319
+ {
320
+ href: linkHref,
321
+ className: "inline-block mt-3 text-sm font-medium text-gray-500 underline dark:text-gray-400",
322
+ children: linkText
323
+ }
324
+ )
325
+ ] })
326
+ ] })
327
+ }
328
+ );
329
+ };
330
+ var sizeClasses2 = {
331
+ xsmall: "h-6 w-6 max-w-6",
332
+ small: "h-8 w-8 max-w-8",
333
+ medium: "h-10 w-10 max-w-10",
334
+ large: "h-12 w-12 max-w-12",
335
+ xlarge: "h-14 w-14 max-w-14",
336
+ xxlarge: "h-16 w-16 max-w-16"
337
+ };
338
+ var statusSizeClasses = {
339
+ xsmall: "h-1.5 w-1.5 max-w-1.5",
340
+ small: "h-2 w-2 max-w-2",
341
+ medium: "h-2.5 w-2.5 max-w-2.5",
342
+ large: "h-3 w-3 max-w-3",
343
+ xlarge: "h-3.5 w-3.5 max-w-3.5",
344
+ xxlarge: "h-4 w-4 max-w-4"
345
+ };
346
+ var statusColorClasses = {
347
+ online: "bg-success-500",
348
+ offline: "bg-error-400",
349
+ busy: "bg-warning-500"
350
+ };
351
+ var Avatar = ({
352
+ src,
353
+ alt = "User Avatar",
354
+ size = "medium",
355
+ status = "none",
356
+ statusColor,
357
+ className,
358
+ ...rest
359
+ }) => {
360
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkYERNSNT4_cjs.cn("relative rounded-full", sizeClasses2[size], className), children: [
361
+ /* @__PURE__ */ jsxRuntime.jsx(
362
+ "img",
363
+ {
364
+ src,
365
+ alt,
366
+ className: "object-cover w-full rounded-full",
367
+ ...rest
368
+ }
369
+ ),
370
+ status !== "none" && /* @__PURE__ */ jsxRuntime.jsx(
371
+ "span",
372
+ {
373
+ className: chunkYERNSNT4_cjs.cn(
374
+ "absolute bottom-0 right-0 rounded-full border-[1.5px] border-white dark:border-gray-900",
375
+ statusSizeClasses[size],
376
+ !statusColor && statusColorClasses[status]
377
+ ),
378
+ style: statusColor ? { backgroundColor: statusColor } : void 0
379
+ }
380
+ )
381
+ ] });
382
+ };
383
+ var AvatarText = ({
384
+ name,
385
+ className,
386
+ ...rest
387
+ }) => {
388
+ const initials = name.split(" ").map((word) => word[0]).join("").toUpperCase().slice(0, 2);
389
+ const getColorClass = (name2) => {
390
+ const colors = [
391
+ "bg-brand-100 text-brand-600",
392
+ "bg-pink-100 text-pink-600",
393
+ "bg-cyan-100 text-cyan-600",
394
+ "bg-orange-100 text-orange-600",
395
+ "bg-green-100 text-green-600",
396
+ "bg-purple-100 text-purple-600",
397
+ "bg-yellow-100 text-yellow-600",
398
+ "bg-error-100 text-error-600"
399
+ ];
400
+ const index = name2.split("").reduce((acc, char) => acc + char.charCodeAt(0), 0);
401
+ return colors[index % colors.length];
402
+ };
403
+ return /* @__PURE__ */ jsxRuntime.jsx(
404
+ "div",
405
+ {
406
+ className: chunkYERNSNT4_cjs.cn(
407
+ "flex h-10 w-10 items-center justify-center rounded-full",
408
+ getColorClass(name),
409
+ className
410
+ ),
411
+ ...rest,
412
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium", children: initials })
413
+ }
414
+ );
415
+ };
416
+ var Dropdown = ({
417
+ isOpen,
418
+ onClose,
419
+ children,
420
+ className,
421
+ ...rest
422
+ }) => {
423
+ const dropdownRef = React5.useRef(null);
424
+ React5.useEffect(() => {
425
+ const handleClickOutside = (event) => {
426
+ if (dropdownRef.current && !dropdownRef.current.contains(event.target) && !event.target.closest(".dropdown-toggle")) {
427
+ onClose();
428
+ }
429
+ };
430
+ document.addEventListener("mousedown", handleClickOutside);
431
+ return () => {
432
+ document.removeEventListener("mousedown", handleClickOutside);
433
+ };
434
+ }, [onClose]);
435
+ if (!isOpen) return null;
436
+ return /* @__PURE__ */ jsxRuntime.jsx(
437
+ "div",
438
+ {
439
+ ref: dropdownRef,
440
+ className: chunkYERNSNT4_cjs.cn(
441
+ "absolute z-40 right-0 mt-2 rounded-xl border border-gray-200 bg-white shadow-theme-lg dark:border-gray-800 dark:bg-gray-dark",
442
+ className
443
+ ),
444
+ ...rest,
445
+ children
446
+ }
447
+ );
448
+ };
449
+ var variantBase = "flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm font-medium transition";
450
+ var variantClasses3 = {
451
+ default: "text-gray-700 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-white/5 dark:hover:text-white",
452
+ primary: "bg-brand-500 text-white shadow-theme-xs hover:bg-brand-600",
453
+ outline: "text-gray-700 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 dark:text-gray-400 dark:ring-gray-700 dark:hover:bg-white/[0.03] dark:hover:text-gray-300"
454
+ };
455
+ var DropdownItem = ({
456
+ tag = "button",
457
+ href,
458
+ onClick,
459
+ onItemClick,
460
+ variant = "default",
461
+ baseClassName,
462
+ className,
463
+ bgColor,
464
+ textColor,
465
+ borderColor,
466
+ children
467
+ }) => {
468
+ const combinedClasses = baseClassName != null ? chunkYERNSNT4_cjs.cn(baseClassName, className) : chunkYERNSNT4_cjs.cn(variantBase, variantClasses3[variant], className);
469
+ const style = styleOverride({ bgColor, textColor, borderColor });
470
+ const handleClick = (event) => {
471
+ if (tag === "button") {
472
+ event.preventDefault();
473
+ }
474
+ if (onClick) onClick();
475
+ if (onItemClick) onItemClick();
476
+ };
477
+ if (tag === "a" && href) {
478
+ return /* @__PURE__ */ jsxRuntime.jsx("a", { href, className: combinedClasses, style, onClick: handleClick, children });
479
+ }
480
+ return /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: handleClick, className: combinedClasses, style, children });
481
+ };
482
+ var Dropzone = ({
483
+ onDrop,
484
+ accept,
485
+ multiple = true,
486
+ title,
487
+ description = "Drag and drop your PNG, JPG, WebP, SVG images here or browse",
488
+ browseLabel = "Browse File",
489
+ className
490
+ }) => {
491
+ const inputRef = React5.useRef(null);
492
+ const [isDragActive, setIsDragActive] = React5.useState(false);
493
+ const handleFiles = (list) => {
494
+ if (list && list.length) onDrop?.(Array.from(list));
495
+ };
496
+ return /* @__PURE__ */ jsxRuntime.jsx(
497
+ "div",
498
+ {
499
+ className: chunkYERNSNT4_cjs.cn(
500
+ "cursor-pointer rounded-xl border border-dashed border-gray-300 transition hover:border-brand-500 dark:border-gray-700 dark:hover:border-brand-500",
501
+ className
502
+ ),
503
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
504
+ "div",
505
+ {
506
+ onClick: () => inputRef.current?.click(),
507
+ onDragOver: (e) => {
508
+ e.preventDefault();
509
+ setIsDragActive(true);
510
+ },
511
+ onDragLeave: (e) => {
512
+ e.preventDefault();
513
+ setIsDragActive(false);
514
+ },
515
+ onDrop: (e) => {
516
+ e.preventDefault();
517
+ setIsDragActive(false);
518
+ handleFiles(e.dataTransfer.files);
519
+ },
520
+ className: chunkYERNSNT4_cjs.cn(
521
+ "rounded-xl border-dashed p-7 lg:p-10",
522
+ isDragActive ? "border-brand-500 bg-gray-100 dark:bg-gray-800" : "border-gray-300 bg-gray-50 dark:border-gray-700 dark:bg-gray-900"
523
+ ),
524
+ children: [
525
+ /* @__PURE__ */ jsxRuntime.jsx(
526
+ "input",
527
+ {
528
+ ref: inputRef,
529
+ type: "file",
530
+ accept,
531
+ multiple,
532
+ className: "hidden",
533
+ onChange: (e) => handleFiles(e.target.files)
534
+ }
535
+ ),
536
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
537
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-[22px] flex justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-[68px] w-[68px] items-center justify-center rounded-full bg-gray-200 text-gray-700 dark:bg-gray-800 dark:text-gray-400", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "fill-current", width: "29", height: "28", viewBox: "0 0 29 28", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx(
538
+ "path",
539
+ {
540
+ fillRule: "evenodd",
541
+ clipRule: "evenodd",
542
+ d: "M14.5019 3.91699C14.2852 3.91699 14.0899 4.00891 13.953 4.15589L8.57363 9.53186C8.28065 9.82466 8.2805 10.2995 8.5733 10.5925C8.8661 10.8855 9.34097 10.8857 9.63396 10.5929L13.7519 6.47752V18.667C13.7519 19.0812 14.0877 19.417 14.5019 19.417C14.9161 19.417 15.2519 19.0812 15.2519 18.667V6.48234L19.3653 10.5929C19.6583 10.8857 20.1332 10.8855 20.426 10.5925C20.7188 10.2995 20.7186 9.82463 20.4256 9.53184L15.0838 4.19378C14.9463 4.02488 14.7367 3.91699 14.5019 3.91699ZM5.91626 18.667C5.91626 18.2528 5.58047 17.917 5.16626 17.917C4.75205 17.917 4.41626 18.2528 4.41626 18.667V21.8337C4.41626 23.0763 5.42362 24.0837 6.66626 24.0837H22.3339C23.5766 24.0837 24.5839 23.0763 24.5839 21.8337V18.667C24.5839 18.2528 24.2482 17.917 23.8339 17.917C23.4197 17.917 23.0839 18.2528 23.0839 18.667V21.8337C23.0839 22.2479 22.7482 22.5837 22.3339 22.5837H6.66626C6.25205 22.5837 5.91626 22.2479 5.91626 21.8337V18.667Z"
543
+ }
544
+ ) }) }) }),
545
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "mb-3 text-theme-xl font-semibold text-gray-800 dark:text-white/90", children: title ?? (isDragActive ? "Drop Files Here" : "Drag & Drop Files Here") }),
546
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mb-5 block w-full max-w-[290px] text-center text-sm text-gray-700 dark:text-gray-400", children: description }),
547
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-theme-sm font-medium text-brand-500 underline", children: browseLabel })
548
+ ] })
549
+ ]
550
+ }
551
+ )
552
+ }
553
+ );
554
+ };
555
+ var Table = ({ children, className, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("table", { className: chunkYERNSNT4_cjs.cn("min-w-full", className), ...rest, children });
556
+ var TableHeader = ({ children, className, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("thead", { className, ...rest, children });
557
+ var TableBody = ({ children, className, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("tbody", { className, ...rest, children });
558
+ var TableRow = ({ children, className, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("tr", { className, ...rest, children });
559
+ var TableCell = ({
560
+ children,
561
+ isHeader = false,
562
+ className,
563
+ ...rest
564
+ }) => {
565
+ const Tag = isHeader ? "th" : "td";
566
+ return /* @__PURE__ */ jsxRuntime.jsx(Tag, { className, ...rest, children });
567
+ };
568
+ var Pagination = ({
569
+ currentPage,
570
+ totalPages,
571
+ onPageChange
572
+ }) => {
573
+ const pagesAroundCurrent = Array.from(
574
+ { length: Math.min(3, totalPages) },
575
+ (_, i) => i + Math.max(currentPage - 1, 1)
576
+ );
577
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center ", children: [
578
+ /* @__PURE__ */ jsxRuntime.jsx(
579
+ "button",
580
+ {
581
+ onClick: () => onPageChange(currentPage - 1),
582
+ disabled: currentPage === 1,
583
+ "aria-label": "Previous",
584
+ className: chunkYERNSNT4_cjs.cn(
585
+ "mr-2.5 flex items-center h-10 justify-center rounded-lg border border-gray-300 bg-white px-3.5 py-2.5 text-gray-700 shadow-theme-xs hover:bg-gray-50 disabled:opacity-50 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-white/[0.03] text-sm"
586
+ ),
587
+ children: "Previous"
588
+ }
589
+ ),
590
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
591
+ currentPage > 3 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-2", children: "..." }),
592
+ pagesAroundCurrent.map((page) => /* @__PURE__ */ jsxRuntime.jsx(
593
+ "button",
594
+ {
595
+ onClick: () => onPageChange(page),
596
+ "aria-current": currentPage === page ? "page" : void 0,
597
+ className: chunkYERNSNT4_cjs.cn(
598
+ "flex w-10 items-center justify-center h-10 rounded-lg text-sm font-medium",
599
+ currentPage === page ? (
600
+ // active page keeps its color on hover (no hover restyle)
601
+ "bg-brand-500 text-white"
602
+ ) : (
603
+ // hover effect applies only to non-active page indices
604
+ "text-gray-700 hover:bg-blue-500/[0.08] hover:text-brand-500 dark:text-gray-400 dark:hover:text-brand-500"
605
+ )
606
+ ),
607
+ children: page
608
+ },
609
+ page
610
+ )),
611
+ currentPage < totalPages - 2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-2", children: "..." })
612
+ ] }),
613
+ /* @__PURE__ */ jsxRuntime.jsx(
614
+ "button",
615
+ {
616
+ onClick: () => onPageChange(currentPage + 1),
617
+ disabled: currentPage === totalPages,
618
+ "aria-label": "Next",
619
+ className: chunkYERNSNT4_cjs.cn(
620
+ "ml-2.5 flex items-center justify-center rounded-lg border border-gray-300 bg-white px-3.5 py-2.5 text-gray-700 shadow-theme-xs text-sm hover:bg-gray-50 h-10 disabled:opacity-50 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-white/[0.03]"
621
+ ),
622
+ children: "Next"
623
+ }
624
+ )
625
+ ] });
626
+ };
627
+ var Input = ({
628
+ className,
629
+ disabled = false,
630
+ success = false,
631
+ error = false,
632
+ hint,
633
+ bgColor,
634
+ textColor,
635
+ borderColor,
636
+ style,
637
+ ...rest
638
+ }) => {
639
+ const stateClass = disabled ? "text-gray-500 border-gray-300 cursor-not-allowed dark:bg-gray-800 dark:text-gray-400 dark:border-gray-700" : error ? "text-error-800 border-error-500 focus:ring-3 focus:ring-error-500/10 dark:text-error-400 dark:border-error-500" : success ? "text-success-500 border-success-400 focus:ring-success-500/10 focus:border-success-300 dark:text-success-400 dark:border-success-500" : "bg-transparent text-gray-800 border-gray-300 focus:border-brand-300 focus:ring-3 focus:ring-brand-500/10 dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:focus:border-brand-800";
640
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
641
+ /* @__PURE__ */ jsxRuntime.jsx(
642
+ "input",
643
+ {
644
+ disabled,
645
+ className: chunkYERNSNT4_cjs.cn(
646
+ "h-11 w-full rounded-lg border appearance-none px-4 py-2.5 text-sm shadow-theme-xs placeholder:text-gray-400 focus:outline-hidden focus:ring-3 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30 dark:focus:border-brand-800",
647
+ stateClass,
648
+ className
649
+ ),
650
+ style: { ...styleOverride({ bgColor, textColor, borderColor }), ...style },
651
+ ...rest
652
+ }
653
+ ),
654
+ hint && /* @__PURE__ */ jsxRuntime.jsx("p", { className: chunkYERNSNT4_cjs.cn("mt-1.5 text-xs", error ? "text-error-500" : success ? "text-success-500" : "text-gray-500"), children: hint })
655
+ ] });
656
+ };
657
+ var alignClass = {
658
+ left: "text-left",
659
+ center: "text-center",
660
+ right: "text-right"
661
+ };
662
+ function SortIcon({
663
+ active,
664
+ direction
665
+ }) {
666
+ const on = "text-brand-500";
667
+ const off = "text-gray-400 dark:text-gray-600";
668
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex flex-col leading-none", children: [
669
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "10", height: "6", viewBox: "0 0 10 6", fill: "currentColor", "aria-hidden": "true", className: active && direction === "asc" ? on : off, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 0 9 5H1z" }) }),
670
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "10", height: "6", viewBox: "0 0 10 6", fill: "currentColor", "aria-hidden": "true", className: active && direction === "desc" ? on : off, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 6 1 1h8z" }) })
671
+ ] });
672
+ }
673
+ function DataTable({
674
+ data,
675
+ columns,
676
+ rowsPerPage = 10,
677
+ rowsPerPageOptions = [5, 10, 25, 50],
678
+ pagination = true,
679
+ showSizeSelector = true,
680
+ searchable = true,
681
+ searchPlaceholder = "Search...",
682
+ searchKeys,
683
+ defaultSortKey,
684
+ defaultSortDirection = "asc",
685
+ getRowId,
686
+ onRowClick,
687
+ emptyContent = "No matching records",
688
+ className
689
+ }) {
690
+ const [search, setSearch] = React5.useState("");
691
+ const [pageSize, setPageSize] = React5.useState(rowsPerPage);
692
+ const [sortKey, setSortKey] = React5.useState(defaultSortKey);
693
+ const [sortDir, setSortDir] = React5.useState(defaultSortDirection);
694
+ const [page, setPage] = React5.useState(1);
695
+ const filtered = React5.useMemo(() => {
696
+ const keys = searchKeys ?? columns.map((c) => c.key);
697
+ const q = search.trim().toLowerCase();
698
+ let rows = data;
699
+ if (searchable && q) {
700
+ rows = rows.filter(
701
+ (row) => keys.some((k) => String(row[k] ?? "").toLowerCase().includes(q))
702
+ );
703
+ }
704
+ if (sortKey) {
705
+ rows = [...rows].sort((a, b) => {
706
+ const av = a[sortKey];
707
+ const bv = b[sortKey];
708
+ const cmp = typeof av === "number" && typeof bv === "number" ? av - bv : String(av ?? "").localeCompare(String(bv ?? ""));
709
+ return sortDir === "asc" ? cmp : -cmp;
710
+ });
711
+ }
712
+ return rows;
713
+ }, [data, columns, search, searchable, searchKeys, sortKey, sortDir]);
714
+ const total = filtered.length;
715
+ const totalPages = pagination ? Math.max(1, Math.ceil(total / pageSize)) : 1;
716
+ const current = Math.min(page, totalPages);
717
+ const start = pagination ? (current - 1) * pageSize : 0;
718
+ const pageRows = pagination ? filtered.slice(start, start + pageSize) : filtered;
719
+ const toggleSort = (col) => {
720
+ if (!col.sortable) return;
721
+ if (sortKey === col.key) setSortDir((d) => d === "asc" ? "desc" : "asc");
722
+ else {
723
+ setSortKey(col.key);
724
+ setSortDir("asc");
725
+ }
726
+ setPage(1);
727
+ };
728
+ const sizeOptions = rowsPerPageOptions.length ? rowsPerPageOptions : [];
729
+ const showSelector = pagination && showSizeSelector && sizeOptions.length > 1;
730
+ const showControls = searchable || showSelector;
731
+ return /* @__PURE__ */ jsxRuntime.jsxs(
732
+ "div",
733
+ {
734
+ className: chunkYERNSNT4_cjs.cn(
735
+ "rounded-xl border border-gray-200 bg-white dark:border-white/[0.05] dark:bg-white/[0.03]",
736
+ className
737
+ ),
738
+ children: [
739
+ showControls && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3 p-4", children: [
740
+ showSelector ? /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400", children: [
741
+ "Show",
742
+ /* @__PURE__ */ jsxRuntime.jsx(
743
+ "select",
744
+ {
745
+ "aria-label": "Rows per page",
746
+ value: pageSize,
747
+ onChange: (e) => {
748
+ setPageSize(Number(e.target.value));
749
+ setPage(1);
750
+ },
751
+ className: "rounded-lg border border-gray-200 bg-transparent px-2 py-1.5 text-sm text-gray-700 dark:border-white/[0.08] dark:text-white/90",
752
+ children: sizeOptions.map((n) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: n, children: n }, n))
753
+ }
754
+ ),
755
+ "entries"
756
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", {}),
757
+ searchable && /* @__PURE__ */ jsxRuntime.jsx(
758
+ Input,
759
+ {
760
+ type: "search",
761
+ "aria-label": "Search",
762
+ placeholder: searchPlaceholder,
763
+ value: search,
764
+ onChange: (e) => {
765
+ setSearch(e.target.value);
766
+ setPage(1);
767
+ },
768
+ className: "max-w-[220px]"
769
+ }
770
+ )
771
+ ] }),
772
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto border-y border-gray-100 dark:border-white/[0.05]", children: /* @__PURE__ */ jsxRuntime.jsxs(Table, { children: [
773
+ /* @__PURE__ */ jsxRuntime.jsx(TableHeader, { className: "border-b border-gray-100 bg-gray-50 dark:border-white/[0.05] dark:bg-white/[0.06]", children: /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: columns.map((col) => {
774
+ const isActive = sortKey === col.key;
775
+ return /* @__PURE__ */ jsxRuntime.jsx(
776
+ TableCell,
777
+ {
778
+ isHeader: true,
779
+ className: chunkYERNSNT4_cjs.cn(
780
+ "whitespace-nowrap px-5 py-3 text-xs font-semibold text-gray-700 dark:text-gray-300",
781
+ alignClass[col.align ?? "left"],
782
+ col.className
783
+ ),
784
+ children: col.sortable ? /* @__PURE__ */ jsxRuntime.jsxs(
785
+ "button",
786
+ {
787
+ type: "button",
788
+ onClick: () => toggleSort(col),
789
+ "aria-label": `Sort by ${typeof col.header === "string" ? col.header : col.key}`,
790
+ className: "inline-flex select-none items-center gap-1.5 hover:text-gray-900 dark:hover:text-white",
791
+ children: [
792
+ col.header,
793
+ /* @__PURE__ */ jsxRuntime.jsx(SortIcon, { active: isActive, direction: isActive ? sortDir : "asc" })
794
+ ]
795
+ }
796
+ ) : col.header
797
+ },
798
+ col.key
799
+ );
800
+ }) }) }),
801
+ /* @__PURE__ */ jsxRuntime.jsxs(TableBody, { className: "divide-y divide-gray-100 dark:divide-white/[0.05]", children: [
802
+ pageRows.map((row, i) => {
803
+ const index = start + i;
804
+ const id = getRowId ? getRowId(row, index) : index;
805
+ return /* @__PURE__ */ jsxRuntime.jsx(
806
+ TableRow,
807
+ {
808
+ onClick: onRowClick ? () => onRowClick(row, index) : void 0,
809
+ className: chunkYERNSNT4_cjs.cn(onRowClick && "cursor-pointer hover:bg-gray-50 dark:hover:bg-white/[0.03]"),
810
+ children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx(
811
+ TableCell,
812
+ {
813
+ className: chunkYERNSNT4_cjs.cn(
814
+ "whitespace-nowrap px-5 py-3.5 text-sm text-gray-700 dark:text-gray-300",
815
+ alignClass[col.align ?? "left"],
816
+ col.className
817
+ ),
818
+ children: col.render ? col.render(row, index) : String(row[col.key] ?? "")
819
+ },
820
+ col.key
821
+ ))
822
+ },
823
+ id
824
+ );
825
+ }),
826
+ pageRows.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntime.jsx(TableCell, { colSpan: columns.length, className: "px-5 py-6 text-center text-sm text-gray-400", children: emptyContent }) })
827
+ ] })
828
+ ] }) }),
829
+ pagination && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3 p-4", children: [
830
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: total === 0 ? "Showing 0 entries" : `Showing ${start + 1} to ${Math.min(start + pageSize, total)} of ${total} entries` }),
831
+ totalPages > 1 && /* @__PURE__ */ jsxRuntime.jsx(Pagination, { currentPage: current, totalPages, onPageChange: setPage })
832
+ ] })
833
+ ]
834
+ }
835
+ );
836
+ }
837
+ var ChevronIcon = () => /* @__PURE__ */ jsxRuntime.jsx(
838
+ "svg",
839
+ {
840
+ className: "stroke-current",
841
+ width: "17",
842
+ height: "16",
843
+ viewBox: "0 0 17 16",
844
+ fill: "none",
845
+ xmlns: "http://www.w3.org/2000/svg",
846
+ children: /* @__PURE__ */ jsxRuntime.jsx(
847
+ "path",
848
+ {
849
+ d: "M6.0765 12.667L10.2432 8.50033L6.0765 4.33366",
850
+ stroke: "",
851
+ strokeWidth: "1.2",
852
+ strokeLinecap: "round",
853
+ strokeLinejoin: "round"
854
+ }
855
+ )
856
+ }
857
+ );
858
+ var Breadcrumb = ({ pageTitle, items }) => {
859
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3 mb-6", children: [
860
+ /* @__PURE__ */ jsxRuntime.jsx(
861
+ "h2",
862
+ {
863
+ className: "text-xl font-semibold text-gray-800 dark:text-white/90",
864
+ "x-text": "pageName",
865
+ children: pageTitle
866
+ }
867
+ ),
868
+ /* @__PURE__ */ jsxRuntime.jsx("nav", { children: /* @__PURE__ */ jsxRuntime.jsxs("ol", { className: "flex items-center gap-1.5", children: [
869
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
870
+ "a",
871
+ {
872
+ className: "inline-flex items-center gap-1.5 text-sm text-gray-500 dark:text-gray-400",
873
+ href: "/",
874
+ children: [
875
+ "Home",
876
+ /* @__PURE__ */ jsxRuntime.jsx(ChevronIcon, {})
877
+ ]
878
+ }
879
+ ) }),
880
+ items?.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: item.href ? /* @__PURE__ */ jsxRuntime.jsxs(
881
+ "a",
882
+ {
883
+ className: "inline-flex items-center gap-1.5 text-sm text-gray-500 dark:text-gray-400",
884
+ href: item.href,
885
+ children: [
886
+ item.label,
887
+ /* @__PURE__ */ jsxRuntime.jsx(ChevronIcon, {})
888
+ ]
889
+ }
890
+ ) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1.5 text-sm text-gray-500 dark:text-gray-400", children: [
891
+ item.label,
892
+ /* @__PURE__ */ jsxRuntime.jsx(ChevronIcon, {})
893
+ ] }) }, index)),
894
+ /* @__PURE__ */ jsxRuntime.jsx("li", { className: "text-sm text-gray-800 dark:text-white/90", children: pageTitle })
895
+ ] }) })
896
+ ] });
897
+ };
898
+ var ThemeToggleButton = ({
899
+ theme,
900
+ onToggle,
901
+ className,
902
+ onClick,
903
+ ...rest
904
+ }) => {
905
+ const [internalTheme, setInternalTheme] = React5.useState("light");
906
+ const isControlled = theme !== void 0;
907
+ const currentTheme = isControlled ? theme : internalTheme;
908
+ const handleClick = (e) => {
909
+ if (onToggle) {
910
+ onToggle();
911
+ } else if (!isControlled) {
912
+ setInternalTheme((prev) => prev === "light" ? "dark" : "light");
913
+ }
914
+ onClick?.(e);
915
+ };
916
+ return /* @__PURE__ */ jsxRuntime.jsxs(
917
+ "button",
918
+ {
919
+ onClick: handleClick,
920
+ "data-theme": currentTheme,
921
+ className: chunkYERNSNT4_cjs.cn(
922
+ "relative flex items-center justify-center text-gray-500 transition-colors bg-white border border-gray-200 rounded-full hover:text-dark-900 h-11 w-11 hover:bg-gray-100 hover:text-gray-700 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",
923
+ className
924
+ ),
925
+ ...rest,
926
+ children: [
927
+ /* @__PURE__ */ jsxRuntime.jsx(
928
+ "svg",
929
+ {
930
+ className: "hidden dark:block",
931
+ width: "20",
932
+ height: "20",
933
+ viewBox: "0 0 20 20",
934
+ fill: "none",
935
+ xmlns: "http://www.w3.org/2000/svg",
936
+ children: /* @__PURE__ */ jsxRuntime.jsx(
937
+ "path",
938
+ {
939
+ fillRule: "evenodd",
940
+ clipRule: "evenodd",
941
+ d: "M9.99998 1.5415C10.4142 1.5415 10.75 1.87729 10.75 2.2915V3.5415C10.75 3.95572 10.4142 4.2915 9.99998 4.2915C9.58577 4.2915 9.24998 3.95572 9.24998 3.5415V2.2915C9.24998 1.87729 9.58577 1.5415 9.99998 1.5415ZM10.0009 6.79327C8.22978 6.79327 6.79402 8.22904 6.79402 10.0001C6.79402 11.7712 8.22978 13.207 10.0009 13.207C11.772 13.207 13.2078 11.7712 13.2078 10.0001C13.2078 8.22904 11.772 6.79327 10.0009 6.79327ZM5.29402 10.0001C5.29402 7.40061 7.40135 5.29327 10.0009 5.29327C12.6004 5.29327 14.7078 7.40061 14.7078 10.0001C14.7078 12.5997 12.6004 14.707 10.0009 14.707C7.40135 14.707 5.29402 12.5997 5.29402 10.0001ZM15.9813 5.08035C16.2742 4.78746 16.2742 4.31258 15.9813 4.01969C15.6884 3.7268 15.2135 3.7268 14.9207 4.01969L14.0368 4.90357C13.7439 5.19647 13.7439 5.67134 14.0368 5.96423C14.3297 6.25713 14.8045 6.25713 15.0974 5.96423L15.9813 5.08035ZM18.4577 10.0001C18.4577 10.4143 18.1219 10.7501 17.7077 10.7501H16.4577C16.0435 10.7501 15.7077 10.4143 15.7077 10.0001C15.7077 9.58592 16.0435 9.25013 16.4577 9.25013H17.7077C18.1219 9.25013 18.4577 9.58592 18.4577 10.0001ZM14.9207 15.9806C15.2135 16.2735 15.6884 16.2735 15.9813 15.9806C16.2742 15.6877 16.2742 15.2128 15.9813 14.9199L15.0974 14.036C14.8045 13.7431 14.3297 13.7431 14.0368 14.036C13.7439 14.3289 13.7439 14.8038 14.0368 15.0967L14.9207 15.9806ZM9.99998 15.7088C10.4142 15.7088 10.75 16.0445 10.75 16.4588V17.7088C10.75 18.123 10.4142 18.4588 9.99998 18.4588C9.58577 18.4588 9.24998 18.123 9.24998 17.7088V16.4588C9.24998 16.0445 9.58577 15.7088 9.99998 15.7088ZM5.96356 15.0972C6.25646 14.8043 6.25646 14.3295 5.96356 14.0366C5.67067 13.7437 5.1958 13.7437 4.9029 14.0366L4.01902 14.9204C3.72613 15.2133 3.72613 15.6882 4.01902 15.9811C4.31191 16.274 4.78679 16.274 5.07968 15.9811L5.96356 15.0972ZM4.29224 10.0001C4.29224 10.4143 3.95645 10.7501 3.54224 10.7501H2.29224C1.87802 10.7501 1.54224 10.4143 1.54224 10.0001C1.54224 9.58592 1.87802 9.25013 2.29224 9.25013H3.54224C3.95645 9.25013 4.29224 9.58592 4.29224 10.0001ZM4.9029 5.9637C5.1958 6.25659 5.67067 6.25659 5.96356 5.9637C6.25646 5.6708 6.25646 5.19593 5.96356 4.90303L5.07968 4.01915C4.78679 3.72626 4.31191 3.72626 4.01902 4.01915C3.72613 4.31204 3.72613 4.78692 4.01902 5.07981L4.9029 5.9637Z",
942
+ fill: "currentColor"
943
+ }
944
+ )
945
+ }
946
+ ),
947
+ /* @__PURE__ */ jsxRuntime.jsx(
948
+ "svg",
949
+ {
950
+ className: "dark:hidden",
951
+ width: "20",
952
+ height: "20",
953
+ viewBox: "0 0 20 20",
954
+ fill: "none",
955
+ xmlns: "http://www.w3.org/2000/svg",
956
+ children: /* @__PURE__ */ jsxRuntime.jsx(
957
+ "path",
958
+ {
959
+ d: "M17.4547 11.97L18.1799 12.1611C18.265 11.8383 18.1265 11.4982 17.8401 11.3266C17.5538 11.1551 17.1885 11.1934 16.944 11.4207L17.4547 11.97ZM8.0306 2.5459L8.57989 3.05657C8.80718 2.81209 8.84554 2.44682 8.67398 2.16046C8.50243 1.8741 8.16227 1.73559 7.83948 1.82066L8.0306 2.5459ZM12.9154 13.0035C9.64678 13.0035 6.99707 10.3538 6.99707 7.08524H5.49707C5.49707 11.1823 8.81835 14.5035 12.9154 14.5035V13.0035ZM16.944 11.4207C15.8869 12.4035 14.4721 13.0035 12.9154 13.0035V14.5035C14.8657 14.5035 16.6418 13.7499 17.9654 12.5193L16.944 11.4207ZM16.7295 11.7789C15.9437 14.7607 13.2277 16.9586 10.0003 16.9586V18.4586C13.9257 18.4586 17.2249 15.7853 18.1799 12.1611L16.7295 11.7789ZM10.0003 16.9586C6.15734 16.9586 3.04199 13.8433 3.04199 10.0003H1.54199C1.54199 14.6717 5.32892 18.4586 10.0003 18.4586V16.9586ZM3.04199 10.0003C3.04199 6.77289 5.23988 4.05695 8.22173 3.27114L7.83948 1.82066C4.21532 2.77574 1.54199 6.07486 1.54199 10.0003H3.04199ZM6.99707 7.08524C6.99707 5.52854 7.5971 4.11366 8.57989 3.05657L7.48132 2.03522C6.25073 3.35885 5.49707 5.13487 5.49707 7.08524H6.99707Z",
960
+ fill: "currentColor"
961
+ }
962
+ )
963
+ }
964
+ )
965
+ ]
966
+ }
967
+ );
968
+ };
969
+ var AccordionContext = React5__default.default.createContext(null);
970
+ var ChevronIcon2 = ({ open }) => /* @__PURE__ */ jsxRuntime.jsx(
971
+ "svg",
972
+ {
973
+ className: chunkYERNSNT4_cjs.cn(
974
+ "h-5 w-5 shrink-0 text-gray-500 transition-transform duration-200 dark:text-gray-400",
975
+ open && "rotate-180"
976
+ ),
977
+ viewBox: "0 0 20 20",
978
+ fill: "none",
979
+ "aria-hidden": "true",
980
+ children: /* @__PURE__ */ jsxRuntime.jsx(
981
+ "path",
982
+ {
983
+ d: "M5 7.5L10 12.5L15 7.5",
984
+ stroke: "currentColor",
985
+ strokeWidth: "1.5",
986
+ strokeLinecap: "round",
987
+ strokeLinejoin: "round"
988
+ }
989
+ )
990
+ }
991
+ );
992
+ var AccordionItem = ({
993
+ itemKey,
994
+ title,
995
+ startContent,
996
+ disabled = false,
997
+ children,
998
+ className,
999
+ ...rest
1000
+ }) => {
1001
+ const ctx = React5__default.default.useContext(AccordionContext);
1002
+ if (!ctx) {
1003
+ throw new Error("AccordionItem must be used within an Accordion");
1004
+ }
1005
+ const open = ctx.expanded.includes(itemKey);
1006
+ const panelId = `accordion-panel-${itemKey}`;
1007
+ const buttonId = `accordion-button-${itemKey}`;
1008
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1009
+ "div",
1010
+ {
1011
+ className: chunkYERNSNT4_cjs.cn(
1012
+ "border-b border-gray-200 last:border-b-0 dark:border-gray-800",
1013
+ className
1014
+ ),
1015
+ ...rest,
1016
+ children: [
1017
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { children: /* @__PURE__ */ jsxRuntime.jsxs(
1018
+ "button",
1019
+ {
1020
+ type: "button",
1021
+ id: buttonId,
1022
+ "aria-expanded": open,
1023
+ "aria-controls": panelId,
1024
+ disabled,
1025
+ onClick: () => !disabled && ctx.toggle(itemKey),
1026
+ className: chunkYERNSNT4_cjs.cn(
1027
+ "flex w-full items-center gap-3 px-4 py-4 text-left text-sm font-medium text-gray-800 transition dark:text-white/90",
1028
+ disabled ? "cursor-not-allowed opacity-50" : "hover:bg-gray-50 dark:hover:bg-white/[0.03]"
1029
+ ),
1030
+ children: [
1031
+ startContent && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center", children: startContent }),
1032
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1", children: title }),
1033
+ /* @__PURE__ */ jsxRuntime.jsx(ChevronIcon2, { open })
1034
+ ]
1035
+ }
1036
+ ) }),
1037
+ /* @__PURE__ */ jsxRuntime.jsx(
1038
+ "div",
1039
+ {
1040
+ id: panelId,
1041
+ role: "region",
1042
+ "aria-labelledby": buttonId,
1043
+ hidden: !open,
1044
+ className: chunkYERNSNT4_cjs.cn(
1045
+ "grid transition-all duration-200 ease-in-out",
1046
+ open ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"
1047
+ ),
1048
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 pb-4 text-sm text-gray-500 dark:text-gray-400", children }) })
1049
+ }
1050
+ )
1051
+ ]
1052
+ }
1053
+ );
1054
+ };
1055
+ var Accordion = ({
1056
+ selectionMode = "single",
1057
+ defaultExpandedKeys = [],
1058
+ expandedKeys,
1059
+ onExpandedChange,
1060
+ children,
1061
+ className,
1062
+ ...rest
1063
+ }) => {
1064
+ const isControlled = expandedKeys !== void 0;
1065
+ const [internal, setInternal] = React5.useState(defaultExpandedKeys);
1066
+ const expanded = isControlled ? expandedKeys : internal;
1067
+ const toggle = React5.useCallback(
1068
+ (key) => {
1069
+ const isOpen = expanded.includes(key);
1070
+ let next;
1071
+ if (selectionMode === "single") {
1072
+ next = isOpen ? [] : [key];
1073
+ } else {
1074
+ next = isOpen ? expanded.filter((k) => k !== key) : [...expanded, key];
1075
+ }
1076
+ if (!isControlled) setInternal(next);
1077
+ onExpandedChange?.(next);
1078
+ },
1079
+ [expanded, selectionMode, isControlled, onExpandedChange]
1080
+ );
1081
+ return /* @__PURE__ */ jsxRuntime.jsx(AccordionContext.Provider, { value: { expanded, toggle }, children: /* @__PURE__ */ jsxRuntime.jsx(
1082
+ "div",
1083
+ {
1084
+ className: chunkYERNSNT4_cjs.cn(
1085
+ "divide-y divide-gray-200 overflow-hidden rounded-xl border border-gray-200 bg-white dark:divide-gray-800 dark:border-gray-800 dark:bg-white/[0.03]",
1086
+ className
1087
+ ),
1088
+ ...rest,
1089
+ children
1090
+ }
1091
+ ) });
1092
+ };
1093
+ var Tab = ({
1094
+ children,
1095
+ tabKey,
1096
+ title,
1097
+ disabled,
1098
+ ...rest
1099
+ }) => {
1100
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...rest, children });
1101
+ };
1102
+ var Tabs = ({
1103
+ variant = "underline",
1104
+ selectedKey,
1105
+ defaultSelectedKey,
1106
+ onSelectionChange,
1107
+ color,
1108
+ children,
1109
+ className,
1110
+ ...rest
1111
+ }) => {
1112
+ const tabs = React5__default.default.Children.toArray(children).filter(
1113
+ React5__default.default.isValidElement
1114
+ );
1115
+ const firstKey = tabs[0]?.props.tabKey;
1116
+ const isControlled = selectedKey !== void 0;
1117
+ const [internal, setInternal] = React5.useState(
1118
+ defaultSelectedKey ?? firstKey
1119
+ );
1120
+ const active = isControlled ? selectedKey : internal;
1121
+ const tabRefs = React5.useRef({});
1122
+ const select = (key) => {
1123
+ if (!isControlled) setInternal(key);
1124
+ onSelectionChange?.(key);
1125
+ };
1126
+ const onKeyDown = (e, index) => {
1127
+ if (e.key !== "ArrowRight" && e.key !== "ArrowLeft") return;
1128
+ e.preventDefault();
1129
+ const dir = e.key === "ArrowRight" ? 1 : -1;
1130
+ const count = tabs.length;
1131
+ let next = index;
1132
+ for (let i = 0; i < count; i++) {
1133
+ next = (next + dir + count) % count;
1134
+ if (!tabs[next].props.disabled) break;
1135
+ }
1136
+ const nextKey = tabs[next].props.tabKey;
1137
+ tabRefs.current[nextKey]?.focus();
1138
+ select(nextKey);
1139
+ };
1140
+ const listClasses = {
1141
+ underline: "flex gap-2 border-b border-gray-200 dark:border-gray-800",
1142
+ solid: "inline-flex gap-1 rounded-lg bg-gray-100 p-1 dark:bg-white/[0.03]",
1143
+ pill: "inline-flex gap-2"
1144
+ };
1145
+ const tabClasses = (isActive) => {
1146
+ const base = "inline-flex items-center gap-2 text-sm font-medium transition focus:outline-hidden disabled:cursor-not-allowed disabled:opacity-50";
1147
+ switch (variant) {
1148
+ case "solid":
1149
+ return chunkYERNSNT4_cjs.cn(
1150
+ base,
1151
+ "rounded-md px-4 py-2",
1152
+ isActive ? "bg-white text-gray-900 shadow-theme-xs dark:bg-gray-800 dark:text-white/90" : "text-gray-500 hover:text-gray-800 dark:text-gray-400 dark:hover:text-white/90"
1153
+ );
1154
+ case "pill":
1155
+ return chunkYERNSNT4_cjs.cn(
1156
+ base,
1157
+ "rounded-full px-4 py-2",
1158
+ isActive ? "bg-brand-500 text-white" : "bg-gray-100 text-gray-600 hover:bg-gray-200 dark:bg-white/[0.03] dark:text-gray-400 dark:hover:bg-white/[0.06]"
1159
+ );
1160
+ case "underline":
1161
+ default:
1162
+ return chunkYERNSNT4_cjs.cn(
1163
+ base,
1164
+ "border-b-2 px-4 py-3",
1165
+ isActive ? "border-brand-500 text-brand-500" : "border-transparent text-gray-500 hover:text-gray-800 dark:text-gray-400 dark:hover:text-white/90"
1166
+ );
1167
+ }
1168
+ };
1169
+ const activeColorStyle = (isActive) => {
1170
+ if (!color || !isActive) return {};
1171
+ if (variant === "underline") return { borderColor: color, color };
1172
+ if (variant === "pill") return { backgroundColor: color };
1173
+ return { color };
1174
+ };
1175
+ const activePanel = tabs.find((t) => t.props.tabKey === active);
1176
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkYERNSNT4_cjs.cn("w-full", className), ...rest, children: [
1177
+ /* @__PURE__ */ jsxRuntime.jsx("div", { role: "tablist", className: listClasses[variant], children: tabs.map((tab, index) => {
1178
+ const { tabKey, title, disabled = false } = tab.props;
1179
+ const isActive = tabKey === active;
1180
+ return /* @__PURE__ */ jsxRuntime.jsx(
1181
+ "button",
1182
+ {
1183
+ ref: (el) => {
1184
+ tabRefs.current[tabKey] = el;
1185
+ },
1186
+ role: "tab",
1187
+ type: "button",
1188
+ id: `tab-${tabKey}`,
1189
+ "aria-selected": isActive,
1190
+ "aria-controls": `tabpanel-${tabKey}`,
1191
+ tabIndex: isActive ? 0 : -1,
1192
+ disabled,
1193
+ onClick: () => !disabled && select(tabKey),
1194
+ onKeyDown: (e) => onKeyDown(e, index),
1195
+ className: tabClasses(isActive),
1196
+ style: activeColorStyle(isActive),
1197
+ children: title
1198
+ },
1199
+ tabKey
1200
+ );
1201
+ }) }),
1202
+ activePanel && /* @__PURE__ */ jsxRuntime.jsx(
1203
+ "div",
1204
+ {
1205
+ role: "tabpanel",
1206
+ id: `tabpanel-${active}`,
1207
+ "aria-labelledby": `tab-${active}`,
1208
+ className: "pt-4 text-sm text-gray-600 dark:text-gray-300",
1209
+ children: activePanel.props.children
1210
+ }
1211
+ )
1212
+ ] });
1213
+ };
1214
+ var placementClasses = {
1215
+ top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
1216
+ right: "left-full top-1/2 -translate-y-1/2 ml-2",
1217
+ bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
1218
+ left: "right-full top-1/2 -translate-y-1/2 mr-2"
1219
+ };
1220
+ var arrowClasses = {
1221
+ top: "top-full left-1/2 -translate-x-1/2 -mt-1",
1222
+ right: "right-full top-1/2 -translate-y-1/2 -mr-1",
1223
+ bottom: "bottom-full left-1/2 -translate-x-1/2 -mb-1",
1224
+ left: "left-full top-1/2 -translate-y-1/2 -ml-1"
1225
+ };
1226
+ var Tooltip = ({
1227
+ content,
1228
+ placement = "top",
1229
+ delay = 0,
1230
+ disabled = false,
1231
+ children,
1232
+ className,
1233
+ bgColor,
1234
+ textColor,
1235
+ borderColor,
1236
+ style,
1237
+ ...rest
1238
+ }) => {
1239
+ const [visible, setVisible] = React5.useState(false);
1240
+ const tooltipId = React5.useId();
1241
+ const timeoutRef = React5.useRef(null);
1242
+ const show = () => {
1243
+ if (disabled) return;
1244
+ if (delay > 0) {
1245
+ timeoutRef.current = setTimeout(() => setVisible(true), delay);
1246
+ } else {
1247
+ setVisible(true);
1248
+ }
1249
+ };
1250
+ const hide = () => {
1251
+ if (timeoutRef.current) {
1252
+ clearTimeout(timeoutRef.current);
1253
+ timeoutRef.current = null;
1254
+ }
1255
+ setVisible(false);
1256
+ };
1257
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1258
+ "span",
1259
+ {
1260
+ className: chunkYERNSNT4_cjs.cn("relative inline-flex", className),
1261
+ onMouseEnter: show,
1262
+ onMouseLeave: hide,
1263
+ onFocus: show,
1264
+ onBlur: hide,
1265
+ "aria-describedby": visible ? tooltipId : void 0,
1266
+ ...rest,
1267
+ children: [
1268
+ children,
1269
+ !disabled && visible && /* @__PURE__ */ jsxRuntime.jsxs(
1270
+ "span",
1271
+ {
1272
+ id: tooltipId,
1273
+ role: "tooltip",
1274
+ className: chunkYERNSNT4_cjs.cn(
1275
+ "pointer-events-none absolute z-50 whitespace-nowrap rounded-lg bg-gray-900 px-3 py-2 text-xs font-medium text-white shadow-theme-lg dark:bg-gray-700 dark:text-white/90",
1276
+ placementClasses[placement]
1277
+ ),
1278
+ style: {
1279
+ ...styleOverride({ bgColor, textColor, borderColor }),
1280
+ ...style
1281
+ },
1282
+ children: [
1283
+ content,
1284
+ /* @__PURE__ */ jsxRuntime.jsx(
1285
+ "span",
1286
+ {
1287
+ className: chunkYERNSNT4_cjs.cn(
1288
+ "absolute h-2 w-2 rotate-45 bg-gray-900 dark:bg-gray-700",
1289
+ arrowClasses[placement]
1290
+ ),
1291
+ style: bgColor ? { backgroundColor: bgColor } : void 0,
1292
+ "aria-hidden": "true"
1293
+ }
1294
+ )
1295
+ ]
1296
+ }
1297
+ )
1298
+ ]
1299
+ }
1300
+ );
1301
+ };
1302
+ var placementClasses2 = {
1303
+ top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
1304
+ right: "left-full top-1/2 -translate-y-1/2 ml-2",
1305
+ bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
1306
+ left: "right-full top-1/2 -translate-y-1/2 mr-2"
1307
+ };
1308
+ var Popover = ({
1309
+ trigger,
1310
+ placement = "bottom",
1311
+ isOpen: controlledOpen,
1312
+ onOpenChange,
1313
+ defaultOpen = false,
1314
+ closeOnOutsideClick = true,
1315
+ closeOnEsc = true,
1316
+ children,
1317
+ className,
1318
+ ...rest
1319
+ }) => {
1320
+ const [uncontrolledOpen, setUncontrolledOpen] = React5.useState(defaultOpen);
1321
+ const isControlled = controlledOpen !== void 0;
1322
+ const open = isControlled ? controlledOpen : uncontrolledOpen;
1323
+ const wrapperRef = React5.useRef(null);
1324
+ const setOpen = (next) => {
1325
+ if (!isControlled) setUncontrolledOpen(next);
1326
+ onOpenChange?.(next);
1327
+ };
1328
+ React5.useEffect(() => {
1329
+ if (!open) return;
1330
+ const handleClickOutside = (event) => {
1331
+ if (closeOnOutsideClick && wrapperRef.current && !wrapperRef.current.contains(event.target)) {
1332
+ setOpen(false);
1333
+ }
1334
+ };
1335
+ const handleEscape = (event) => {
1336
+ if (closeOnEsc && event.key === "Escape") {
1337
+ setOpen(false);
1338
+ }
1339
+ };
1340
+ document.addEventListener("mousedown", handleClickOutside);
1341
+ document.addEventListener("keydown", handleEscape);
1342
+ return () => {
1343
+ document.removeEventListener("mousedown", handleClickOutside);
1344
+ document.removeEventListener("keydown", handleEscape);
1345
+ };
1346
+ }, [open, closeOnOutsideClick, closeOnEsc]);
1347
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: wrapperRef, className: "relative inline-block", children: [
1348
+ /* @__PURE__ */ jsxRuntime.jsx(
1349
+ "span",
1350
+ {
1351
+ className: "inline-flex cursor-pointer",
1352
+ "aria-haspopup": "dialog",
1353
+ "aria-expanded": open,
1354
+ onClick: () => setOpen(!open),
1355
+ children: trigger
1356
+ }
1357
+ ),
1358
+ open && /* @__PURE__ */ jsxRuntime.jsx(
1359
+ "div",
1360
+ {
1361
+ role: "dialog",
1362
+ className: chunkYERNSNT4_cjs.cn(
1363
+ "absolute z-50 min-w-[12rem] rounded-xl border border-gray-200 bg-white p-4 shadow-theme-lg dark:border-gray-700 dark:bg-gray-900 dark:text-white/90",
1364
+ placementClasses2[placement],
1365
+ className
1366
+ ),
1367
+ ...rest,
1368
+ children
1369
+ }
1370
+ )
1371
+ ] });
1372
+ };
1373
+ var panelBaseByPlacement = {
1374
+ left: "top-0 left-0 h-full",
1375
+ right: "top-0 right-0 h-full",
1376
+ top: "top-0 left-0 w-full",
1377
+ bottom: "bottom-0 left-0 w-full"
1378
+ };
1379
+ var openTransform = {
1380
+ left: "translate-x-0",
1381
+ right: "translate-x-0",
1382
+ top: "translate-y-0",
1383
+ bottom: "translate-y-0"
1384
+ };
1385
+ var closedTransform = {
1386
+ left: "-translate-x-full",
1387
+ right: "translate-x-full",
1388
+ top: "-translate-y-full",
1389
+ bottom: "translate-y-full"
1390
+ };
1391
+ var defaultSize = {
1392
+ left: "w-80 max-w-full",
1393
+ right: "w-80 max-w-full",
1394
+ top: "h-80 max-h-full",
1395
+ bottom: "h-80 max-h-full"
1396
+ };
1397
+ var Drawer = ({
1398
+ isOpen,
1399
+ onClose,
1400
+ children,
1401
+ className,
1402
+ placement = "right",
1403
+ showCloseButton = true,
1404
+ closeOnBackdrop = true,
1405
+ closeOnEsc = true,
1406
+ size,
1407
+ ...rest
1408
+ }) => {
1409
+ React5.useEffect(() => {
1410
+ const handleEscape = (event) => {
1411
+ if (event.key === "Escape") {
1412
+ onClose();
1413
+ }
1414
+ };
1415
+ if (isOpen && closeOnEsc) {
1416
+ document.addEventListener("keydown", handleEscape);
1417
+ }
1418
+ return () => {
1419
+ document.removeEventListener("keydown", handleEscape);
1420
+ };
1421
+ }, [isOpen, onClose, closeOnEsc]);
1422
+ React5.useEffect(() => {
1423
+ if (isOpen) {
1424
+ document.body.style.overflow = "hidden";
1425
+ } else {
1426
+ document.body.style.overflow = "unset";
1427
+ }
1428
+ return () => {
1429
+ document.body.style.overflow = "unset";
1430
+ };
1431
+ }, [isOpen]);
1432
+ if (!isOpen) return null;
1433
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "fixed inset-0 z-99999 drawer", children: [
1434
+ /* @__PURE__ */ jsxRuntime.jsx(
1435
+ "div",
1436
+ {
1437
+ className: "fixed inset-0 h-full w-full bg-black/50 backdrop-blur-sm",
1438
+ onClick: closeOnBackdrop ? onClose : void 0
1439
+ }
1440
+ ),
1441
+ /* @__PURE__ */ jsxRuntime.jsxs(
1442
+ "div",
1443
+ {
1444
+ role: "dialog",
1445
+ "aria-modal": "true",
1446
+ className: chunkYERNSNT4_cjs.cn(
1447
+ "fixed flex flex-col overflow-y-auto bg-white shadow-theme-lg transition-transform duration-300 ease-in-out dark:bg-gray-900 dark:text-white/90",
1448
+ panelBaseByPlacement[placement],
1449
+ size ?? defaultSize[placement],
1450
+ isOpen ? openTransform[placement] : closedTransform[placement],
1451
+ className
1452
+ ),
1453
+ onClick: (e) => e.stopPropagation(),
1454
+ ...rest,
1455
+ children: [
1456
+ showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(
1457
+ "button",
1458
+ {
1459
+ onClick: onClose,
1460
+ "aria-label": "Close drawer",
1461
+ className: "absolute right-3 top-3 z-999 flex h-9.5 w-9.5 items-center justify-center rounded-full bg-gray-100 text-gray-400 transition-colors hover:bg-gray-200 hover:text-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white",
1462
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1463
+ "svg",
1464
+ {
1465
+ width: "24",
1466
+ height: "24",
1467
+ viewBox: "0 0 24 24",
1468
+ fill: "none",
1469
+ xmlns: "http://www.w3.org/2000/svg",
1470
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1471
+ "path",
1472
+ {
1473
+ fillRule: "evenodd",
1474
+ clipRule: "evenodd",
1475
+ d: "M6.04289 16.5413C5.65237 16.9318 5.65237 17.565 6.04289 17.9555C6.43342 18.346 7.06658 18.346 7.45711 17.9555L11.9987 13.4139L16.5408 17.956C16.9313 18.3466 17.5645 18.3466 17.955 17.956C18.3455 17.5655 18.3455 16.9323 17.955 16.5418L13.4129 11.9997L17.955 7.4576C18.3455 7.06707 18.3455 6.43391 17.955 6.04338C17.5645 5.65286 16.9313 5.65286 16.5408 6.04338L11.9987 10.5855L7.45711 6.0439C7.06658 5.65338 6.43342 5.65338 6.04289 6.0439C5.65237 6.43442 5.65237 7.06759 6.04289 7.45811L10.5845 11.9997L6.04289 16.5413Z",
1476
+ fill: "currentColor"
1477
+ }
1478
+ )
1479
+ }
1480
+ )
1481
+ }
1482
+ ),
1483
+ children
1484
+ ]
1485
+ }
1486
+ )
1487
+ ] });
1488
+ };
1489
+ var sizeStyles2 = {
1490
+ sm: "text-theme-xs",
1491
+ md: "text-sm"
1492
+ };
1493
+ var variants2 = {
1494
+ light: {
1495
+ primary: "bg-brand-50 text-brand-500 dark:bg-brand-500/15 dark:text-brand-400",
1496
+ success: "bg-success-50 text-success-600 dark:bg-success-500/15 dark:text-success-500",
1497
+ error: "bg-error-50 text-error-600 dark:bg-error-500/15 dark:text-error-500",
1498
+ warning: "bg-warning-50 text-warning-600 dark:bg-warning-500/15 dark:text-orange-400",
1499
+ info: "bg-blue-light-50 text-blue-light-500 dark:bg-blue-light-500/15 dark:text-blue-light-500",
1500
+ light: "bg-gray-100 text-gray-700 dark:bg-white/5 dark:text-white/80",
1501
+ dark: "bg-gray-500 text-white dark:bg-white/5 dark:text-white"
1502
+ },
1503
+ solid: {
1504
+ primary: "bg-brand-500 text-white dark:text-white",
1505
+ success: "bg-success-500 text-white dark:text-white",
1506
+ error: "bg-error-500 text-white dark:text-white",
1507
+ warning: "bg-warning-500 text-white dark:text-white",
1508
+ info: "bg-blue-light-500 text-white dark:text-white",
1509
+ light: "bg-gray-400 dark:bg-white/5 text-white dark:text-white/80",
1510
+ dark: "bg-gray-700 text-white dark:text-white"
1511
+ }
1512
+ };
1513
+ var Chip = ({
1514
+ variant = "light",
1515
+ color = "primary",
1516
+ size = "md",
1517
+ startIcon,
1518
+ endIcon,
1519
+ avatar,
1520
+ onClose,
1521
+ children,
1522
+ className,
1523
+ bgColor,
1524
+ textColor,
1525
+ borderColor,
1526
+ style,
1527
+ ...rest
1528
+ }) => {
1529
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1530
+ "span",
1531
+ {
1532
+ className: chunkYERNSNT4_cjs.cn(
1533
+ "inline-flex items-center justify-center gap-1 rounded-full font-medium",
1534
+ avatar ? "py-0.5 pl-0.5 pr-2.5" : "px-2.5 py-0.5",
1535
+ sizeStyles2[size],
1536
+ variants2[variant][color],
1537
+ className
1538
+ ),
1539
+ style: { ...styleOverride({ bgColor, textColor, borderColor }), ...style },
1540
+ ...rest,
1541
+ children: [
1542
+ avatar && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center", children: avatar }),
1543
+ startIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center", children: startIcon }),
1544
+ children,
1545
+ endIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center", children: endIcon }),
1546
+ onClose && /* @__PURE__ */ jsxRuntime.jsx(
1547
+ "button",
1548
+ {
1549
+ type: "button",
1550
+ "aria-label": "Remove",
1551
+ onClick: onClose,
1552
+ className: "ml-0.5 flex h-4 w-4 items-center justify-center rounded-full text-current opacity-70 transition hover:opacity-100 focus:outline-none",
1553
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1554
+ "svg",
1555
+ {
1556
+ width: "12",
1557
+ height: "12",
1558
+ viewBox: "0 0 12 12",
1559
+ fill: "none",
1560
+ xmlns: "http://www.w3.org/2000/svg",
1561
+ "aria-hidden": "true",
1562
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1563
+ "path",
1564
+ {
1565
+ d: "M9 3L3 9M3 3L9 9",
1566
+ stroke: "currentColor",
1567
+ strokeWidth: "1.5",
1568
+ strokeLinecap: "round",
1569
+ strokeLinejoin: "round"
1570
+ }
1571
+ )
1572
+ }
1573
+ )
1574
+ }
1575
+ )
1576
+ ]
1577
+ }
1578
+ );
1579
+ };
1580
+ var sizeStyles3 = {
1581
+ sm: "h-1.5",
1582
+ md: "h-2.5",
1583
+ lg: "h-4"
1584
+ };
1585
+ var fillColors = {
1586
+ primary: "bg-brand-500",
1587
+ success: "bg-success-500",
1588
+ error: "bg-error-500",
1589
+ warning: "bg-warning-500",
1590
+ info: "bg-blue-light-500",
1591
+ light: "bg-gray-400",
1592
+ dark: "bg-gray-700 dark:bg-gray-300"
1593
+ };
1594
+ var indeterminateKeyframes = `@keyframes tdui-progress-indeterminate {
1595
+ 0% { left: -40%; width: 40%; }
1596
+ 50% { left: 30%; width: 60%; }
1597
+ 100% { left: 100%; width: 40%; }
1598
+ }`;
1599
+ var Progress = ({
1600
+ value = 0,
1601
+ maxValue = 100,
1602
+ color = "primary",
1603
+ size = "md",
1604
+ label,
1605
+ showValueLabel = false,
1606
+ isIndeterminate = false,
1607
+ className,
1608
+ bgColor,
1609
+ textColor,
1610
+ borderColor,
1611
+ style,
1612
+ ...rest
1613
+ }) => {
1614
+ const safeMax = maxValue <= 0 ? 100 : maxValue;
1615
+ const clamped = Math.min(Math.max(value, 0), safeMax);
1616
+ const percent = Math.round(clamped / safeMax * 100);
1617
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkYERNSNT4_cjs.cn("w-full", className), ...rest, children: [
1618
+ (label || showValueLabel) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-1.5 flex items-center justify-between", children: [
1619
+ label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-400", children: label }),
1620
+ showValueLabel && !isIndeterminate && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-400", children: [
1621
+ percent,
1622
+ "%"
1623
+ ] })
1624
+ ] }),
1625
+ /* @__PURE__ */ jsxRuntime.jsx(
1626
+ "div",
1627
+ {
1628
+ role: "progressbar",
1629
+ "aria-valuemin": 0,
1630
+ "aria-valuemax": safeMax,
1631
+ "aria-valuenow": isIndeterminate ? void 0 : clamped,
1632
+ className: chunkYERNSNT4_cjs.cn(
1633
+ "relative w-full overflow-hidden rounded-full bg-gray-200 dark:bg-gray-800",
1634
+ sizeStyles3[size]
1635
+ ),
1636
+ style: styleOverride({ bgColor, borderColor }),
1637
+ children: isIndeterminate ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1638
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: indeterminateKeyframes }),
1639
+ /* @__PURE__ */ jsxRuntime.jsx(
1640
+ "div",
1641
+ {
1642
+ className: chunkYERNSNT4_cjs.cn("absolute top-0 h-full rounded-full", fillColors[color]),
1643
+ style: {
1644
+ animation: "tdui-progress-indeterminate 1.5s ease-in-out infinite",
1645
+ ...textColor ? { backgroundColor: textColor } : {},
1646
+ ...style
1647
+ }
1648
+ }
1649
+ )
1650
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(
1651
+ "div",
1652
+ {
1653
+ className: chunkYERNSNT4_cjs.cn(
1654
+ "h-full rounded-full transition-all duration-300",
1655
+ fillColors[color]
1656
+ ),
1657
+ style: {
1658
+ width: `${percent}%`,
1659
+ ...textColor ? { backgroundColor: textColor } : {},
1660
+ ...style
1661
+ }
1662
+ }
1663
+ )
1664
+ }
1665
+ )
1666
+ ] });
1667
+ };
1668
+ var sizeStyles4 = {
1669
+ sm: "h-4 w-4 border-2",
1670
+ md: "h-6 w-6 border-2",
1671
+ lg: "h-8 w-8 border-[3px]"
1672
+ };
1673
+ var colorStyles = {
1674
+ primary: "text-brand-500",
1675
+ success: "text-success-500",
1676
+ error: "text-error-500",
1677
+ warning: "text-warning-500",
1678
+ info: "text-blue-light-500",
1679
+ light: "text-gray-400",
1680
+ dark: "text-gray-700 dark:text-gray-300"
1681
+ };
1682
+ var Spinner = ({
1683
+ size = "md",
1684
+ color = "primary",
1685
+ label,
1686
+ className,
1687
+ bgColor,
1688
+ textColor,
1689
+ borderColor,
1690
+ style,
1691
+ ...rest
1692
+ }) => {
1693
+ const accessibleLabel = typeof label === "string" ? label : "Loading";
1694
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1695
+ "span",
1696
+ {
1697
+ role: "status",
1698
+ "aria-label": accessibleLabel,
1699
+ className: chunkYERNSNT4_cjs.cn("inline-flex items-center gap-2", className),
1700
+ style: { ...styleOverride({ bgColor, borderColor }), ...style },
1701
+ ...rest,
1702
+ children: [
1703
+ /* @__PURE__ */ jsxRuntime.jsx(
1704
+ "span",
1705
+ {
1706
+ "aria-hidden": "true",
1707
+ className: chunkYERNSNT4_cjs.cn(
1708
+ "inline-block animate-spin rounded-full border-current border-t-transparent",
1709
+ sizeStyles4[size],
1710
+ !textColor && colorStyles[color]
1711
+ ),
1712
+ style: textColor ? { color: textColor } : void 0
1713
+ }
1714
+ ),
1715
+ label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: label })
1716
+ ]
1717
+ }
1718
+ );
1719
+ };
1720
+ var Skeleton = ({
1721
+ isLoaded = false,
1722
+ width,
1723
+ height,
1724
+ className,
1725
+ children,
1726
+ style,
1727
+ ...rest
1728
+ }) => {
1729
+ if (isLoaded) {
1730
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
1731
+ }
1732
+ return /* @__PURE__ */ jsxRuntime.jsx(
1733
+ "div",
1734
+ {
1735
+ "aria-hidden": "true",
1736
+ className: chunkYERNSNT4_cjs.cn(
1737
+ "animate-pulse rounded-lg bg-gray-200 dark:bg-gray-800",
1738
+ className
1739
+ ),
1740
+ style: { width, height, ...style },
1741
+ ...rest,
1742
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "invisible", children })
1743
+ }
1744
+ );
1745
+ };
1746
+ var sizeClasses3 = {
1747
+ sm: "text-xs px-1 py-0.5",
1748
+ md: "text-sm px-1.5 py-0.5"
1749
+ };
1750
+ var colorClasses2 = {
1751
+ primary: "bg-brand-50 text-brand-600 dark:bg-brand-500/15 dark:text-brand-400",
1752
+ success: "bg-success-50 text-success-600 dark:bg-success-500/15 dark:text-success-500",
1753
+ error: "bg-error-50 text-error-600 dark:bg-error-500/15 dark:text-error-500",
1754
+ warning: "bg-warning-50 text-warning-600 dark:bg-warning-500/15 dark:text-orange-400",
1755
+ info: "bg-blue-light-50 text-blue-light-500 dark:bg-blue-light-500/15 dark:text-blue-light-500",
1756
+ default: "bg-gray-100 text-gray-700 dark:bg-white/5 dark:text-white/80"
1757
+ };
1758
+ var Code = ({
1759
+ color = "default",
1760
+ size = "md",
1761
+ className,
1762
+ children,
1763
+ bgColor,
1764
+ textColor,
1765
+ borderColor,
1766
+ style,
1767
+ ...rest
1768
+ }) => {
1769
+ return /* @__PURE__ */ jsxRuntime.jsx(
1770
+ "code",
1771
+ {
1772
+ className: chunkYERNSNT4_cjs.cn(
1773
+ "inline-flex items-center rounded-md font-mono font-normal",
1774
+ sizeClasses3[size],
1775
+ colorClasses2[color],
1776
+ className
1777
+ ),
1778
+ style: { ...styleOverride({ bgColor, textColor, borderColor }), ...style },
1779
+ ...rest,
1780
+ children
1781
+ }
1782
+ );
1783
+ };
1784
+ var sizeClasses4 = {
1785
+ sm: "text-xs p-3",
1786
+ md: "text-sm p-4"
1787
+ };
1788
+ var CopyIcon = () => /* @__PURE__ */ jsxRuntime.jsxs(
1789
+ "svg",
1790
+ {
1791
+ width: "16",
1792
+ height: "16",
1793
+ viewBox: "0 0 24 24",
1794
+ fill: "none",
1795
+ stroke: "currentColor",
1796
+ strokeWidth: "2",
1797
+ strokeLinecap: "round",
1798
+ strokeLinejoin: "round",
1799
+ "aria-hidden": "true",
1800
+ children: [
1801
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
1802
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
1803
+ ]
1804
+ }
1805
+ );
1806
+ var CheckIcon = () => /* @__PURE__ */ jsxRuntime.jsx(
1807
+ "svg",
1808
+ {
1809
+ width: "16",
1810
+ height: "16",
1811
+ viewBox: "0 0 24 24",
1812
+ fill: "none",
1813
+ stroke: "currentColor",
1814
+ strokeWidth: "2",
1815
+ strokeLinecap: "round",
1816
+ strokeLinejoin: "round",
1817
+ "aria-hidden": "true",
1818
+ children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "20 6 9 17 4 12" })
1819
+ }
1820
+ );
1821
+ var Snippet = ({
1822
+ code,
1823
+ children,
1824
+ symbol = "",
1825
+ hideCopyButton = false,
1826
+ hideSymbol = false,
1827
+ size = "md",
1828
+ className,
1829
+ bgColor,
1830
+ textColor,
1831
+ borderColor,
1832
+ style,
1833
+ ...rest
1834
+ }) => {
1835
+ const [copied, setCopied] = React5.useState(false);
1836
+ const raw = code ?? children ?? "";
1837
+ const lines = Array.isArray(raw) ? raw : raw.split("\n");
1838
+ const text = lines.join("\n");
1839
+ const handleCopy = async () => {
1840
+ try {
1841
+ await navigator.clipboard.writeText(text);
1842
+ setCopied(true);
1843
+ setTimeout(() => setCopied(false), 1500);
1844
+ } catch {
1845
+ }
1846
+ };
1847
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1848
+ "div",
1849
+ {
1850
+ className: chunkYERNSNT4_cjs.cn(
1851
+ "relative rounded-xl border border-gray-200 bg-gray-50 font-mono text-gray-800 dark:border-gray-800 dark:bg-white/[0.03] dark:text-white/90",
1852
+ sizeClasses4[size],
1853
+ className
1854
+ ),
1855
+ style: { ...styleOverride({ bgColor, textColor, borderColor }), ...style },
1856
+ ...rest,
1857
+ children: [
1858
+ /* @__PURE__ */ jsxRuntime.jsx("pre", { className: chunkYERNSNT4_cjs.cn("overflow-x-auto", !hideCopyButton && "pr-8"), children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: lines.map((line, i) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "block whitespace-pre", children: [
1859
+ !hideSymbol && symbol && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "select-none text-gray-400 dark:text-gray-500", children: symbol }),
1860
+ line
1861
+ ] }, i)) }) }),
1862
+ !hideCopyButton && /* @__PURE__ */ jsxRuntime.jsx(
1863
+ "button",
1864
+ {
1865
+ type: "button",
1866
+ onClick: handleCopy,
1867
+ "aria-label": copied ? "Copied" : "Copy to clipboard",
1868
+ className: chunkYERNSNT4_cjs.cn(
1869
+ "absolute right-2 top-2 inline-flex h-7 w-7 items-center justify-center rounded-lg text-gray-500 transition hover:bg-gray-200 hover:text-gray-700 focus:outline-hidden focus:ring-3 focus:ring-brand-500/10 dark:text-gray-400 dark:hover:bg-white/10 dark:hover:text-white/90",
1870
+ copied && "text-success-500 dark:text-success-500"
1871
+ ),
1872
+ children: copied ? /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, {}) : /* @__PURE__ */ jsxRuntime.jsx(CopyIcon, {})
1873
+ }
1874
+ )
1875
+ ]
1876
+ }
1877
+ );
1878
+ };
1879
+ var Label = ({ children, className, ...rest }) => {
1880
+ return /* @__PURE__ */ jsxRuntime.jsx(
1881
+ "label",
1882
+ {
1883
+ className: chunkYERNSNT4_cjs.cn(
1884
+ "mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400",
1885
+ className
1886
+ ),
1887
+ ...rest,
1888
+ children
1889
+ }
1890
+ );
1891
+ };
1892
+ var TextArea = ({
1893
+ placeholder = "Enter your message",
1894
+ rows = 3,
1895
+ value = "",
1896
+ onChange,
1897
+ className,
1898
+ disabled = false,
1899
+ error = false,
1900
+ hint = ""
1901
+ }) => {
1902
+ const handleChange = (e) => {
1903
+ if (onChange) {
1904
+ onChange(e.target.value);
1905
+ }
1906
+ };
1907
+ const stateClass = disabled ? "bg-gray-100 opacity-50 text-gray-500 border-gray-300 cursor-not-allowed dark:bg-gray-800 dark:text-gray-400 dark:border-gray-700" : error ? "bg-transparent text-gray-400 border-gray-300 focus:border-error-300 focus:ring-3 focus:ring-error-500/10 dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:focus:border-error-800" : "bg-transparent text-gray-400 border-gray-300 focus:border-brand-300 focus:ring-3 focus:ring-brand-500/10 dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:focus:border-brand-800";
1908
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
1909
+ /* @__PURE__ */ jsxRuntime.jsx(
1910
+ "textarea",
1911
+ {
1912
+ placeholder,
1913
+ rows,
1914
+ value,
1915
+ onChange: handleChange,
1916
+ disabled,
1917
+ className: chunkYERNSNT4_cjs.cn(
1918
+ "w-full rounded-lg border px-4 py-2.5 text-sm shadow-theme-xs focus:outline-hidden",
1919
+ stateClass,
1920
+ className
1921
+ )
1922
+ }
1923
+ ),
1924
+ hint && /* @__PURE__ */ jsxRuntime.jsx(
1925
+ "p",
1926
+ {
1927
+ className: chunkYERNSNT4_cjs.cn(
1928
+ "mt-2 text-sm",
1929
+ error ? "text-error-500" : "text-gray-500 dark:text-gray-400"
1930
+ ),
1931
+ children: hint
1932
+ }
1933
+ )
1934
+ ] });
1935
+ };
1936
+ var Checkbox = ({
1937
+ label,
1938
+ checked,
1939
+ id,
1940
+ onChange,
1941
+ className,
1942
+ disabled = false,
1943
+ checkedColor
1944
+ }) => {
1945
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1946
+ "label",
1947
+ {
1948
+ className: chunkYERNSNT4_cjs.cn(
1949
+ "flex items-center space-x-3 group cursor-pointer",
1950
+ disabled && "cursor-not-allowed opacity-60"
1951
+ ),
1952
+ children: [
1953
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-5 h-5", children: [
1954
+ /* @__PURE__ */ jsxRuntime.jsx(
1955
+ "input",
1956
+ {
1957
+ id,
1958
+ type: "checkbox",
1959
+ className: chunkYERNSNT4_cjs.cn(
1960
+ "w-5 h-5 appearance-none cursor-pointer dark:border-gray-700 border border-gray-300 checked:border-transparent rounded-md checked:bg-brand-500 disabled:opacity-60",
1961
+ className
1962
+ ),
1963
+ checked,
1964
+ onChange: (e) => onChange(e.target.checked),
1965
+ disabled,
1966
+ style: checkedColor ? { accentColor: checkedColor } : void 0
1967
+ }
1968
+ ),
1969
+ checked && /* @__PURE__ */ jsxRuntime.jsx(
1970
+ "svg",
1971
+ {
1972
+ className: "absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 pointer-events-none",
1973
+ xmlns: "http://www.w3.org/2000/svg",
1974
+ width: "14",
1975
+ height: "14",
1976
+ viewBox: "0 0 14 14",
1977
+ fill: "none",
1978
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1979
+ "path",
1980
+ {
1981
+ d: "M11.6666 3.5L5.24992 9.91667L2.33325 7",
1982
+ stroke: "white",
1983
+ strokeWidth: "1.94437",
1984
+ strokeLinecap: "round",
1985
+ strokeLinejoin: "round"
1986
+ }
1987
+ )
1988
+ }
1989
+ ),
1990
+ disabled && /* @__PURE__ */ jsxRuntime.jsx(
1991
+ "svg",
1992
+ {
1993
+ className: "absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 pointer-events-none",
1994
+ xmlns: "http://www.w3.org/2000/svg",
1995
+ width: "14",
1996
+ height: "14",
1997
+ viewBox: "0 0 14 14",
1998
+ fill: "none",
1999
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2000
+ "path",
2001
+ {
2002
+ d: "M11.6666 3.5L5.24992 9.91667L2.33325 7",
2003
+ stroke: "#E4E7EC",
2004
+ strokeWidth: "2.33333",
2005
+ strokeLinecap: "round",
2006
+ strokeLinejoin: "round"
2007
+ }
2008
+ )
2009
+ }
2010
+ )
2011
+ ] }),
2012
+ label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-gray-800 dark:text-gray-200", children: label })
2013
+ ]
2014
+ }
2015
+ );
2016
+ };
2017
+ var Radio = ({
2018
+ id,
2019
+ name,
2020
+ value,
2021
+ checked,
2022
+ label,
2023
+ onChange,
2024
+ className,
2025
+ disabled = false
2026
+ }) => {
2027
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2028
+ "label",
2029
+ {
2030
+ htmlFor: id,
2031
+ className: chunkYERNSNT4_cjs.cn(
2032
+ "relative flex cursor-pointer select-none items-center gap-3 text-sm font-medium",
2033
+ disabled ? "text-gray-300 dark:text-gray-600 cursor-not-allowed" : "text-gray-700 dark:text-gray-400",
2034
+ className
2035
+ ),
2036
+ children: [
2037
+ /* @__PURE__ */ jsxRuntime.jsx(
2038
+ "input",
2039
+ {
2040
+ id,
2041
+ name,
2042
+ type: "radio",
2043
+ value,
2044
+ checked,
2045
+ onChange: () => !disabled && onChange(value),
2046
+ className: "sr-only",
2047
+ disabled
2048
+ }
2049
+ ),
2050
+ /* @__PURE__ */ jsxRuntime.jsx(
2051
+ "span",
2052
+ {
2053
+ className: chunkYERNSNT4_cjs.cn(
2054
+ "flex h-5 w-5 items-center justify-center rounded-full border-[1.25px]",
2055
+ checked ? "border-brand-500 bg-brand-500" : "bg-transparent border-gray-300 dark:border-gray-700",
2056
+ disabled && "bg-gray-100 dark:bg-gray-700 border-gray-200 dark:border-gray-700"
2057
+ ),
2058
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2059
+ "span",
2060
+ {
2061
+ className: chunkYERNSNT4_cjs.cn(
2062
+ "h-2 w-2 rounded-full bg-white",
2063
+ checked ? "block" : "hidden"
2064
+ )
2065
+ }
2066
+ )
2067
+ }
2068
+ ),
2069
+ label
2070
+ ]
2071
+ }
2072
+ );
2073
+ };
2074
+ var RadioSm = ({
2075
+ id,
2076
+ name,
2077
+ value,
2078
+ checked,
2079
+ label,
2080
+ onChange,
2081
+ className
2082
+ }) => {
2083
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2084
+ "label",
2085
+ {
2086
+ htmlFor: id,
2087
+ className: chunkYERNSNT4_cjs.cn(
2088
+ "flex cursor-pointer select-none items-center text-sm text-gray-500 dark:text-gray-400",
2089
+ className
2090
+ ),
2091
+ children: [
2092
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative", children: [
2093
+ /* @__PURE__ */ jsxRuntime.jsx(
2094
+ "input",
2095
+ {
2096
+ type: "radio",
2097
+ id,
2098
+ name,
2099
+ value,
2100
+ checked,
2101
+ onChange: () => onChange(value),
2102
+ className: "sr-only"
2103
+ }
2104
+ ),
2105
+ /* @__PURE__ */ jsxRuntime.jsx(
2106
+ "span",
2107
+ {
2108
+ className: chunkYERNSNT4_cjs.cn(
2109
+ "mr-2 flex h-4 w-4 items-center justify-center rounded-full border",
2110
+ checked ? "border-brand-500 bg-brand-500" : "bg-transparent border-gray-300 dark:border-gray-700"
2111
+ ),
2112
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2113
+ "span",
2114
+ {
2115
+ className: chunkYERNSNT4_cjs.cn(
2116
+ "h-1.5 w-1.5 rounded-full",
2117
+ checked ? "bg-white" : "bg-white dark:bg-[#1e2636]"
2118
+ )
2119
+ }
2120
+ )
2121
+ }
2122
+ )
2123
+ ] }),
2124
+ label
2125
+ ]
2126
+ }
2127
+ );
2128
+ };
2129
+ var Switch = ({
2130
+ label,
2131
+ checked,
2132
+ defaultChecked = false,
2133
+ disabled = false,
2134
+ onChange,
2135
+ color = "blue"
2136
+ }) => {
2137
+ const isControlled = checked !== void 0;
2138
+ const [internalChecked, setInternalChecked] = React5.useState(defaultChecked);
2139
+ const isChecked = isControlled ? checked : internalChecked;
2140
+ const handleToggle = () => {
2141
+ if (disabled) return;
2142
+ const newCheckedState = !isChecked;
2143
+ if (!isControlled) {
2144
+ setInternalChecked(newCheckedState);
2145
+ }
2146
+ if (onChange) {
2147
+ onChange(newCheckedState);
2148
+ }
2149
+ };
2150
+ const switchColors = color === "blue" ? {
2151
+ background: isChecked ? "bg-brand-500 " : "bg-gray-200 dark:bg-white/10",
2152
+ // Blue version
2153
+ knob: isChecked ? "translate-x-full bg-white" : "translate-x-0 bg-white"
2154
+ } : {
2155
+ background: isChecked ? "bg-gray-800 dark:bg-white/10" : "bg-gray-200 dark:bg-white/10",
2156
+ // Gray version
2157
+ knob: isChecked ? "translate-x-full bg-white" : "translate-x-0 bg-white"
2158
+ };
2159
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2160
+ "label",
2161
+ {
2162
+ className: chunkYERNSNT4_cjs.cn(
2163
+ "flex cursor-pointer select-none items-center gap-3 text-sm font-medium",
2164
+ disabled ? "text-gray-400" : "text-gray-700 dark:text-gray-400"
2165
+ ),
2166
+ onClick: handleToggle,
2167
+ children: [
2168
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
2169
+ /* @__PURE__ */ jsxRuntime.jsx(
2170
+ "div",
2171
+ {
2172
+ className: chunkYERNSNT4_cjs.cn(
2173
+ "block transition duration-150 ease-linear h-6 w-11 rounded-full",
2174
+ disabled ? "bg-gray-100 pointer-events-none dark:bg-gray-800" : switchColors.background
2175
+ )
2176
+ }
2177
+ ),
2178
+ /* @__PURE__ */ jsxRuntime.jsx(
2179
+ "div",
2180
+ {
2181
+ className: chunkYERNSNT4_cjs.cn(
2182
+ "absolute left-0.5 top-0.5 h-5 w-5 rounded-full shadow-theme-sm duration-150 ease-linear transform",
2183
+ switchColors.knob
2184
+ )
2185
+ }
2186
+ )
2187
+ ] }),
2188
+ label
2189
+ ]
2190
+ }
2191
+ );
2192
+ };
2193
+ var Select = ({
2194
+ options,
2195
+ placeholder = "Select an option",
2196
+ onChange,
2197
+ className,
2198
+ defaultValue = "",
2199
+ disabled = false
2200
+ }) => {
2201
+ const [selectedValue, setSelectedValue] = React5.useState(defaultValue);
2202
+ const [isOpen, setIsOpen] = React5.useState(false);
2203
+ const rootRef = React5.useRef(null);
2204
+ React5.useEffect(() => {
2205
+ if (!isOpen) return;
2206
+ const onPointerDown = (e) => {
2207
+ if (rootRef.current && !rootRef.current.contains(e.target)) {
2208
+ setIsOpen(false);
2209
+ }
2210
+ };
2211
+ const onKeyDown = (e) => {
2212
+ if (e.key === "Escape") setIsOpen(false);
2213
+ };
2214
+ document.addEventListener("mousedown", onPointerDown);
2215
+ document.addEventListener("keydown", onKeyDown);
2216
+ return () => {
2217
+ document.removeEventListener("mousedown", onPointerDown);
2218
+ document.removeEventListener("keydown", onKeyDown);
2219
+ };
2220
+ }, [isOpen]);
2221
+ const toggleOpen = () => {
2222
+ if (!disabled) setIsOpen((prev) => !prev);
2223
+ };
2224
+ const handleSelect = (value) => {
2225
+ setSelectedValue(value);
2226
+ onChange(value);
2227
+ setIsOpen(false);
2228
+ };
2229
+ const selectedLabel = options.find((o) => o.value === selectedValue)?.label;
2230
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: rootRef, className: chunkYERNSNT4_cjs.cn("relative w-full", className), children: [
2231
+ /* @__PURE__ */ jsxRuntime.jsxs(
2232
+ "button",
2233
+ {
2234
+ type: "button",
2235
+ onClick: toggleOpen,
2236
+ disabled,
2237
+ "aria-haspopup": "listbox",
2238
+ "aria-expanded": isOpen,
2239
+ className: chunkYERNSNT4_cjs.cn(
2240
+ "flex h-11 w-full items-center justify-between rounded-lg border border-gray-300 px-4 py-2.5 text-left text-sm shadow-theme-xs transition focus:border-brand-300 focus:outline-hidden focus:ring-3 focus:ring-brand-500/10 dark:border-gray-700 dark:bg-gray-900 dark:focus:border-brand-800",
2241
+ disabled && "cursor-not-allowed opacity-50",
2242
+ selectedLabel ? "text-gray-800 dark:text-white/90" : "text-gray-400 dark:text-gray-400"
2243
+ ),
2244
+ children: [
2245
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: selectedLabel ?? placeholder }),
2246
+ /* @__PURE__ */ jsxRuntime.jsx(
2247
+ "svg",
2248
+ {
2249
+ className: chunkYERNSNT4_cjs.cn(
2250
+ "ml-2 h-5 w-5 shrink-0 stroke-current text-gray-500 transition-transform dark:text-gray-400",
2251
+ isOpen && "rotate-180"
2252
+ ),
2253
+ width: "20",
2254
+ height: "20",
2255
+ viewBox: "0 0 20 20",
2256
+ fill: "none",
2257
+ xmlns: "http://www.w3.org/2000/svg",
2258
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2259
+ "path",
2260
+ {
2261
+ d: "M4.79175 7.39551L10.0001 12.6038L15.2084 7.39551",
2262
+ stroke: "currentColor",
2263
+ strokeWidth: "1.5",
2264
+ strokeLinecap: "round",
2265
+ strokeLinejoin: "round"
2266
+ }
2267
+ )
2268
+ }
2269
+ )
2270
+ ]
2271
+ }
2272
+ ),
2273
+ isOpen && /* @__PURE__ */ jsxRuntime.jsx(
2274
+ "ul",
2275
+ {
2276
+ role: "listbox",
2277
+ className: "absolute left-0 top-full z-40 mt-1.5 max-h-60 w-full overflow-y-auto rounded-lg border border-gray-200 bg-white py-1 shadow-theme-lg dark:border-gray-800 dark:bg-gray-900",
2278
+ children: options.map((option) => {
2279
+ const isSelected = option.value === selectedValue;
2280
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2281
+ "li",
2282
+ {
2283
+ role: "option",
2284
+ "aria-selected": isSelected,
2285
+ onClick: () => handleSelect(option.value),
2286
+ className: chunkYERNSNT4_cjs.cn(
2287
+ "flex cursor-pointer items-center justify-between px-4 py-2 text-sm transition hover:bg-gray-50 dark:hover:bg-white/5",
2288
+ isSelected ? "bg-brand-50 font-medium text-brand-600 dark:bg-brand-500/15 dark:text-brand-400" : "text-gray-700 dark:text-gray-300"
2289
+ ),
2290
+ children: [
2291
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: option.label }),
2292
+ isSelected && /* @__PURE__ */ jsxRuntime.jsx(
2293
+ "svg",
2294
+ {
2295
+ className: "ml-2 h-4 w-4 shrink-0 stroke-current",
2296
+ width: "16",
2297
+ height: "16",
2298
+ viewBox: "0 0 16 16",
2299
+ fill: "none",
2300
+ xmlns: "http://www.w3.org/2000/svg",
2301
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2302
+ "path",
2303
+ {
2304
+ d: "M13.3334 4L6.00008 11.3333L2.66675 8",
2305
+ stroke: "currentColor",
2306
+ strokeWidth: "1.6",
2307
+ strokeLinecap: "round",
2308
+ strokeLinejoin: "round"
2309
+ }
2310
+ )
2311
+ }
2312
+ )
2313
+ ]
2314
+ },
2315
+ option.value
2316
+ );
2317
+ })
2318
+ }
2319
+ )
2320
+ ] });
2321
+ };
2322
+ var MultiSelect = ({
2323
+ label,
2324
+ options,
2325
+ defaultSelected = [],
2326
+ onChange,
2327
+ disabled = false
2328
+ }) => {
2329
+ const [selectedOptions, setSelectedOptions] = React5.useState(defaultSelected);
2330
+ const [isOpen, setIsOpen] = React5.useState(false);
2331
+ const toggleDropdown = () => {
2332
+ if (disabled) return;
2333
+ setIsOpen((prev) => !prev);
2334
+ };
2335
+ const handleSelect = (optionValue) => {
2336
+ const newSelectedOptions = selectedOptions.includes(optionValue) ? selectedOptions.filter((value) => value !== optionValue) : [...selectedOptions, optionValue];
2337
+ setSelectedOptions(newSelectedOptions);
2338
+ if (onChange) onChange(newSelectedOptions);
2339
+ };
2340
+ const removeOption = (_index, value) => {
2341
+ const newSelectedOptions = selectedOptions.filter((opt) => opt !== value);
2342
+ setSelectedOptions(newSelectedOptions);
2343
+ if (onChange) onChange(newSelectedOptions);
2344
+ };
2345
+ const selectedValuesText = selectedOptions.map(
2346
+ (value) => options.find((option) => option.value === value)?.text || ""
2347
+ );
2348
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full", children: [
2349
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400", children: label }),
2350
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative z-20 inline-block w-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex flex-col items-center", children: [
2351
+ /* @__PURE__ */ jsxRuntime.jsx("div", { onClick: toggleDropdown, className: "w-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2 flex h-11 rounded-lg border border-gray-300 py-1.5 px-4 shadow-theme-xs outline-hidden transition focus:border-brand-300 focus:shadow-focus-ring dark:border-gray-700 dark:bg-gray-900 dark:focus:border-brand-300", children: [
2352
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap flex-auto gap-2", children: selectedValuesText.length > 0 ? selectedValuesText.map((text, index) => /* @__PURE__ */ jsxRuntime.jsxs(
2353
+ "div",
2354
+ {
2355
+ className: "group flex items-center justify-center rounded-full border-[0.7px] border-transparent bg-gray-100 py-1 pl-2.5 pr-2 text-sm text-gray-800 hover:border-gray-200 dark:bg-gray-800 dark:text-white/90 dark:hover:border-gray-800",
2356
+ children: [
2357
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-initial max-w-full", children: text }),
2358
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row-reverse flex-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
2359
+ "div",
2360
+ {
2361
+ onClick: () => removeOption(index, selectedOptions[index]),
2362
+ className: "pl-2 text-gray-500 cursor-pointer group-hover:text-gray-400 dark:text-gray-400",
2363
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2364
+ "svg",
2365
+ {
2366
+ className: "fill-current",
2367
+ role: "button",
2368
+ width: "14",
2369
+ height: "14",
2370
+ viewBox: "0 0 14 14",
2371
+ xmlns: "http://www.w3.org/2000/svg",
2372
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2373
+ "path",
2374
+ {
2375
+ fillRule: "evenodd",
2376
+ clipRule: "evenodd",
2377
+ d: "M3.40717 4.46881C3.11428 4.17591 3.11428 3.70104 3.40717 3.40815C3.70006 3.11525 4.17494 3.11525 4.46783 3.40815L6.99943 5.93975L9.53095 3.40822C9.82385 3.11533 10.2987 3.11533 10.5916 3.40822C10.8845 3.70112 10.8845 4.17599 10.5916 4.46888L8.06009 7.00041L10.5916 9.53193C10.8845 9.82482 10.8845 10.2997 10.5916 10.5926C10.2987 10.8855 9.82385 10.8855 9.53095 10.5926L6.99943 8.06107L4.46783 10.5927C4.17494 10.8856 3.70006 10.8856 3.40717 10.5927C3.11428 10.2998 3.11428 9.8249 3.40717 9.53201L5.93877 7.00041L3.40717 4.46881Z"
2378
+ }
2379
+ )
2380
+ }
2381
+ )
2382
+ }
2383
+ ) })
2384
+ ]
2385
+ },
2386
+ index
2387
+ )) : /* @__PURE__ */ jsxRuntime.jsx(
2388
+ "input",
2389
+ {
2390
+ placeholder: "Select option",
2391
+ className: "w-full h-full p-1 pr-2 text-sm bg-transparent border-0 outline-hidden appearance-none placeholder:text-gray-800 focus:border-0 focus:outline-hidden focus:ring-0 dark:placeholder:text-white/90",
2392
+ readOnly: true,
2393
+ value: "Select option"
2394
+ }
2395
+ ) }),
2396
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center py-1 pl-1 pr-1 w-7", children: /* @__PURE__ */ jsxRuntime.jsx(
2397
+ "button",
2398
+ {
2399
+ type: "button",
2400
+ onClick: toggleDropdown,
2401
+ className: "w-5 h-5 text-gray-700 outline-hidden cursor-pointer focus:outline-hidden dark:text-gray-400",
2402
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2403
+ "svg",
2404
+ {
2405
+ className: `stroke-current ${isOpen ? "rotate-180" : ""}`,
2406
+ width: "20",
2407
+ height: "20",
2408
+ viewBox: "0 0 20 20",
2409
+ fill: "none",
2410
+ xmlns: "http://www.w3.org/2000/svg",
2411
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2412
+ "path",
2413
+ {
2414
+ d: "M4.79175 7.39551L10.0001 12.6038L15.2084 7.39551",
2415
+ stroke: "currentColor",
2416
+ strokeWidth: "1.5",
2417
+ strokeLinecap: "round",
2418
+ strokeLinejoin: "round"
2419
+ }
2420
+ )
2421
+ }
2422
+ )
2423
+ }
2424
+ ) })
2425
+ ] }) }),
2426
+ isOpen && /* @__PURE__ */ jsxRuntime.jsx(
2427
+ "div",
2428
+ {
2429
+ className: "absolute left-0 z-40 w-full overflow-y-auto bg-white rounded-lg shadow-sm top-full max-h-select dark:bg-gray-900",
2430
+ onClick: (e) => e.stopPropagation(),
2431
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col", children: options.map((option, index) => {
2432
+ const isSelected = selectedOptions.includes(option.value);
2433
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
2434
+ "div",
2435
+ {
2436
+ className: `w-full cursor-pointer rounded-t border-b border-gray-200 hover:bg-brand-500/5 dark:border-gray-800`,
2437
+ onClick: () => handleSelect(option.value),
2438
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
2439
+ "div",
2440
+ {
2441
+ className: `relative flex w-full items-center justify-between p-2 pl-2 ${isSelected ? "bg-brand-500/10" : ""}`,
2442
+ children: [
2443
+ /* @__PURE__ */ jsxRuntime.jsx(
2444
+ "div",
2445
+ {
2446
+ className: `mx-2 leading-6 ${isSelected ? "font-medium text-brand-600 dark:text-brand-400" : "text-gray-800 dark:text-white/90"}`,
2447
+ children: option.text
2448
+ }
2449
+ ),
2450
+ isSelected && /* @__PURE__ */ jsxRuntime.jsx(
2451
+ "svg",
2452
+ {
2453
+ className: "mr-2 h-4 w-4 shrink-0 stroke-current text-brand-500",
2454
+ width: "16",
2455
+ height: "16",
2456
+ viewBox: "0 0 16 16",
2457
+ fill: "none",
2458
+ xmlns: "http://www.w3.org/2000/svg",
2459
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2460
+ "path",
2461
+ {
2462
+ d: "M13.3334 4L6.00008 11.3333L2.66675 8",
2463
+ stroke: "currentColor",
2464
+ strokeWidth: "1.6",
2465
+ strokeLinecap: "round",
2466
+ strokeLinejoin: "round"
2467
+ }
2468
+ )
2469
+ }
2470
+ )
2471
+ ]
2472
+ }
2473
+ )
2474
+ }
2475
+ ) }, index);
2476
+ }) })
2477
+ }
2478
+ )
2479
+ ] }) })
2480
+ ] });
2481
+ };
2482
+ var FileInput = ({ className, ...rest }) => {
2483
+ return /* @__PURE__ */ jsxRuntime.jsx(
2484
+ "input",
2485
+ {
2486
+ type: "file",
2487
+ className: chunkYERNSNT4_cjs.cn(
2488
+ "focus:border-ring-brand-300 h-11 w-full overflow-hidden rounded-lg border border-gray-300 bg-transparent text-sm text-gray-500 shadow-theme-xs transition-colors file:mr-5 file:border-collapse file:cursor-pointer file:rounded-l-lg file:border-0 file:border-r file:border-solid file:border-gray-200 file:bg-gray-50 file:py-3 file:pl-3.5 file:pr-3 file:text-sm file:text-gray-700 placeholder:text-gray-400 hover:file:bg-gray-100 focus:outline-hidden focus:file:ring-brand-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-400 dark:text-white/90 dark:file:border-gray-800 dark:file:bg-white/[0.03] dark:file:text-gray-400 dark:placeholder:text-gray-400",
2489
+ className
2490
+ ),
2491
+ ...rest
2492
+ }
2493
+ );
2494
+ };
2495
+ var DatePicker = ({
2496
+ id,
2497
+ mode,
2498
+ onChange,
2499
+ label,
2500
+ defaultDate,
2501
+ placeholder
2502
+ }) => {
2503
+ React5.useEffect(() => {
2504
+ const flatPickr = flatpickr__default.default(`#${id}`, {
2505
+ mode: mode || "single",
2506
+ static: true,
2507
+ monthSelectorType: "static",
2508
+ dateFormat: "Y-m-d",
2509
+ defaultDate,
2510
+ onChange
2511
+ });
2512
+ return () => {
2513
+ if (!Array.isArray(flatPickr)) {
2514
+ flatPickr.destroy();
2515
+ }
2516
+ };
2517
+ }, [mode, onChange, id, defaultDate]);
2518
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2519
+ label && /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: id, children: label }),
2520
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
2521
+ /* @__PURE__ */ jsxRuntime.jsx(
2522
+ "input",
2523
+ {
2524
+ id,
2525
+ placeholder,
2526
+ className: "h-11 w-full rounded-lg border appearance-none pl-4 pr-11 py-2.5 text-sm shadow-theme-xs placeholder:text-gray-400 focus:outline-hidden focus:ring-3 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30 bg-transparent text-gray-800 border-gray-300 focus:border-brand-300 focus:ring-brand-500/20 dark:border-gray-700 dark:focus:border-brand-800"
2527
+ }
2528
+ ),
2529
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute text-gray-500 -translate-y-1/2 pointer-events-none right-3 top-1/2 dark:text-gray-400", children: /* @__PURE__ */ jsxRuntime.jsx(
2530
+ "svg",
2531
+ {
2532
+ className: "size-6",
2533
+ width: "24",
2534
+ height: "24",
2535
+ viewBox: "0 0 24 24",
2536
+ fill: "none",
2537
+ xmlns: "http://www.w3.org/2000/svg",
2538
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2539
+ "path",
2540
+ {
2541
+ fillRule: "evenodd",
2542
+ clipRule: "evenodd",
2543
+ d: "M8 2C8.41421 2 8.75 2.33579 8.75 2.75V3.75H15.25V2.75C15.25 2.33579 15.5858 2 16 2C16.4142 2 16.75 2.33579 16.75 2.75V3.75H18.5C19.7426 3.75 20.75 4.75736 20.75 6V9V19C20.75 20.2426 19.7426 21.25 18.5 21.25H5.5C4.25736 21.25 3.25 20.2426 3.25 19V9V6C3.25 4.75736 4.25736 3.75 5.5 3.75H7.25V2.75C7.25 2.33579 7.58579 2 8 2ZM8 5.25H5.5C5.08579 5.25 4.75 5.58579 4.75 6V8.25H19.25V6C19.25 5.58579 18.9142 5.25 18.5 5.25H16H8ZM19.25 9.75H4.75V19C4.75 19.4142 5.08579 19.75 5.5 19.75H18.5C18.9142 19.75 19.25 19.4142 19.25 19V9.75Z",
2544
+ fill: "currentColor"
2545
+ }
2546
+ )
2547
+ }
2548
+ ) })
2549
+ ] })
2550
+ ] });
2551
+ };
2552
+ var clampNum = (raw, max) => {
2553
+ const digits = raw.replace(/\D/g, "").slice(0, 2);
2554
+ if (digits === "") return "";
2555
+ return String(Math.min(parseInt(digits, 10), max));
2556
+ };
2557
+ var DateTimePicker = ({
2558
+ id,
2559
+ label,
2560
+ placeholder,
2561
+ defaultDate,
2562
+ defaultTime = "",
2563
+ onChange
2564
+ }) => {
2565
+ const dateRef = React5.useRef(void 0);
2566
+ const [hh, setHh] = React5.useState(defaultTime.split(":")[0] ?? "");
2567
+ const [mm, setMm] = React5.useState(defaultTime.split(":")[1] ?? "");
2568
+ const hhRef = React5.useRef(hh);
2569
+ const mmRef = React5.useRef(mm);
2570
+ hhRef.current = hh;
2571
+ mmRef.current = mm;
2572
+ const emit = () => {
2573
+ onChange?.({
2574
+ date: dateRef.current,
2575
+ time: `${(hhRef.current || "0").padStart(2, "0")}:${(mmRef.current || "0").padStart(2, "0")}`
2576
+ });
2577
+ };
2578
+ React5.useEffect(() => {
2579
+ const flatPickr = flatpickr__default.default(`#${id}-date`, {
2580
+ mode: "single",
2581
+ static: true,
2582
+ monthSelectorType: "static",
2583
+ dateFormat: "Y-m-d",
2584
+ defaultDate,
2585
+ onChange: (dates) => {
2586
+ dateRef.current = dates[0];
2587
+ emit();
2588
+ }
2589
+ });
2590
+ return () => {
2591
+ if (!Array.isArray(flatPickr)) {
2592
+ flatPickr.destroy();
2593
+ }
2594
+ };
2595
+ }, [id, defaultDate]);
2596
+ const handleHh = (e) => {
2597
+ const v = clampNum(e.target.value, 23);
2598
+ setHh(v);
2599
+ hhRef.current = v;
2600
+ emit();
2601
+ };
2602
+ const handleMm = (e) => {
2603
+ const v = clampNum(e.target.value, 59);
2604
+ setMm(v);
2605
+ mmRef.current = v;
2606
+ emit();
2607
+ };
2608
+ const padOnBlur = (value, setter) => () => {
2609
+ if (value !== "") setter(value.padStart(2, "0"));
2610
+ };
2611
+ const timeFieldClass = "w-7 bg-transparent text-center tabular-nums placeholder:text-gray-400 focus:outline-hidden dark:placeholder:text-white/30";
2612
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2613
+ label && /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: `${id}-date`, children: label }),
2614
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
2615
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1", children: [
2616
+ /* @__PURE__ */ jsxRuntime.jsx(
2617
+ "input",
2618
+ {
2619
+ id: `${id}-date`,
2620
+ placeholder,
2621
+ className: "h-11 w-full appearance-none rounded-lg border border-gray-300 bg-transparent py-2.5 pl-4 pr-11 text-sm text-gray-800 shadow-theme-xs placeholder:text-gray-400 focus:border-brand-300 focus:outline-hidden focus:ring-3 focus:ring-brand-500/20 dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30 dark:focus:border-brand-800"
2622
+ }
2623
+ ),
2624
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 dark:text-gray-400", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "size-6", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx(
2625
+ "path",
2626
+ {
2627
+ fillRule: "evenodd",
2628
+ clipRule: "evenodd",
2629
+ d: "M8 2C8.41421 2 8.75 2.33579 8.75 2.75V3.75H15.25V2.75C15.25 2.33579 15.5858 2 16 2C16.4142 2 16.75 2.33579 16.75 2.75V3.75H18.5C19.7426 3.75 20.75 4.75736 20.75 6V9V19C20.75 20.2426 19.7426 21.25 18.5 21.25H5.5C4.25736 21.25 3.25 20.2426 3.25 19V9V6C3.25 4.75736 4.25736 3.75 5.5 3.75H7.25V2.75C7.25 2.33579 7.58579 2 8 2ZM8 5.25H5.5C5.08579 5.25 4.75 5.58579 4.75 6V8.25H19.25V6C19.25 5.58579 18.9142 5.25 18.5 5.25H16H8ZM19.25 9.75H4.75V19C4.75 19.4142 5.08579 19.75 5.5 19.75H18.5C18.9142 19.75 19.25 19.4142 19.25 19V9.75Z",
2630
+ fill: "currentColor"
2631
+ }
2632
+ ) }) })
2633
+ ] }),
2634
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-11 items-center rounded-lg border border-gray-300 bg-transparent px-3 text-sm text-gray-800 shadow-theme-xs focus-within:border-brand-300 focus-within:ring-3 focus-within:ring-brand-500/20 dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:focus-within:border-brand-800", children: [
2635
+ /* @__PURE__ */ jsxRuntime.jsx(
2636
+ "input",
2637
+ {
2638
+ "aria-label": "Hours",
2639
+ inputMode: "numeric",
2640
+ placeholder: "00",
2641
+ maxLength: 2,
2642
+ value: hh,
2643
+ onChange: handleHh,
2644
+ onBlur: padOnBlur(hh, (v) => setHh(v)),
2645
+ className: timeFieldClass
2646
+ }
2647
+ ),
2648
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-0.5 text-gray-400 dark:text-gray-500", children: ":" }),
2649
+ /* @__PURE__ */ jsxRuntime.jsx(
2650
+ "input",
2651
+ {
2652
+ "aria-label": "Minutes",
2653
+ inputMode: "numeric",
2654
+ placeholder: "00",
2655
+ maxLength: 2,
2656
+ value: mm,
2657
+ onChange: handleMm,
2658
+ onBlur: padOnBlur(mm, (v) => setMm(v)),
2659
+ className: timeFieldClass
2660
+ }
2661
+ ),
2662
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 text-gray-500 dark:text-gray-400", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx(
2663
+ "path",
2664
+ {
2665
+ fillRule: "evenodd",
2666
+ clipRule: "evenodd",
2667
+ d: "M3.04175 9.99984C3.04175 6.15686 6.1571 3.0415 10.0001 3.0415C13.8431 3.0415 16.9584 6.15686 16.9584 9.99984C16.9584 13.8428 13.8431 16.9582 10.0001 16.9582C6.1571 16.9582 3.04175 13.8428 3.04175 9.99984ZM10.0001 1.5415C5.32867 1.5415 1.54175 5.32843 1.54175 9.99984C1.54175 14.6712 5.32867 18.4582 10.0001 18.4582C14.6715 18.4582 18.4584 14.6712 18.4584 9.99984C18.4584 5.32843 14.6715 1.5415 10.0001 1.5415ZM9.99998 10.7498C9.58577 10.7498 9.24998 10.4141 9.24998 9.99984V5.4165C9.24998 5.00229 9.58577 4.6665 9.99998 4.6665C10.4142 4.6665 10.75 5.00229 10.75 5.4165V9.24984H13.3334C13.7476 9.24984 14.0834 9.58562 14.0834 9.99984C14.0834 10.4141 13.7476 10.7498 13.3334 10.7498H10.0001H9.99998Z",
2668
+ fill: "currentColor"
2669
+ }
2670
+ ) }) })
2671
+ ] })
2672
+ ] })
2673
+ ] });
2674
+ };
2675
+ var PasswordInput = ({
2676
+ className,
2677
+ ...rest
2678
+ }) => {
2679
+ const [show, setShow] = React5.useState(false);
2680
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
2681
+ /* @__PURE__ */ jsxRuntime.jsx(
2682
+ "input",
2683
+ {
2684
+ type: show ? "text" : "password",
2685
+ className: chunkYERNSNT4_cjs.cn(
2686
+ "h-11 w-full appearance-none rounded-lg border border-gray-300 bg-transparent py-2.5 pl-4 pr-11 text-sm text-gray-800 shadow-theme-xs placeholder:text-gray-400 focus:border-brand-300 focus:outline-hidden focus:ring-3 focus:ring-brand-500/10 dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30 dark:focus:border-brand-800",
2687
+ className
2688
+ ),
2689
+ ...rest
2690
+ }
2691
+ ),
2692
+ /* @__PURE__ */ jsxRuntime.jsx(
2693
+ "button",
2694
+ {
2695
+ type: "button",
2696
+ onClick: () => setShow((s) => !s),
2697
+ "aria-label": show ? "Hide password" : "Show password",
2698
+ className: "absolute right-4 top-1/2 z-30 -translate-y-1/2 cursor-pointer text-gray-500 dark:text-gray-400",
2699
+ children: show ? /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx(
2700
+ "path",
2701
+ {
2702
+ fillRule: "evenodd",
2703
+ clipRule: "evenodd",
2704
+ d: "M10.0002 13.8619C7.23361 13.8619 4.86803 12.1372 3.92328 9.70241C4.86804 7.26761 7.23361 5.54297 10.0002 5.54297C12.7667 5.54297 15.1323 7.26762 16.0771 9.70243C15.1323 12.1372 12.7667 13.8619 10.0002 13.8619ZM10.0002 4.04297C6.48191 4.04297 3.49489 6.30917 2.4155 9.4593C2.3615 9.61687 2.3615 9.78794 2.41549 9.94552C3.49488 13.0957 6.48191 15.3619 10.0002 15.3619C13.5184 15.3619 16.5055 13.0957 17.5849 9.94555C17.6389 9.78797 17.6389 9.6169 17.5849 9.45932C16.5055 6.30919 13.5184 4.04297 10.0002 4.04297ZM9.99151 7.84413C8.96527 7.84413 8.13333 8.67606 8.13333 9.70231C8.13333 10.7286 8.96527 11.5605 9.99151 11.5605H10.0064C11.0326 11.5605 11.8646 10.7286 11.8646 9.70231C11.8646 8.67606 11.0326 7.84413 10.0064 7.84413H9.99151Z"
2705
+ }
2706
+ ) }) : /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx(
2707
+ "path",
2708
+ {
2709
+ fillRule: "evenodd",
2710
+ clipRule: "evenodd",
2711
+ d: "M4.63803 3.57709C4.34513 3.2842 3.87026 3.2842 3.57737 3.57709C3.28447 3.86999 3.28447 4.34486 3.57737 4.63775L4.85323 5.91362C3.74609 6.84199 2.89363 8.06395 2.4155 9.45936C2.3615 9.61694 2.3615 9.78801 2.41549 9.94558C3.49488 13.0957 6.48191 15.3619 10.0002 15.3619C11.255 15.3619 12.4422 15.0737 13.4994 14.5598L15.3625 16.4229C15.6554 16.7158 16.1302 16.7158 16.4231 16.4229C16.716 16.13 16.716 15.6551 16.4231 15.3622L4.63803 3.57709ZM12.3608 13.4212L10.4475 11.5079C10.3061 11.5423 10.1584 11.5606 10.0064 11.5606H9.99151C8.96527 11.5606 8.13333 10.7286 8.13333 9.70237C8.13333 9.5461 8.15262 9.39434 8.18895 9.24933L5.91885 6.97923C5.03505 7.69015 4.34057 8.62704 3.92328 9.70247C4.86803 12.1373 7.23361 13.8619 10.0002 13.8619C10.8326 13.8619 11.6287 13.7058 12.3608 13.4212ZM16.0771 9.70249C15.7843 10.4569 15.3552 11.1432 14.8199 11.7311L15.8813 12.7925C16.6329 11.9813 17.2187 11.0143 17.5849 9.94561C17.6389 9.78803 17.6389 9.61696 17.5849 9.45938C16.5055 6.30925 13.5184 4.04303 10.0002 4.04303C9.13525 4.04303 8.30244 4.17999 7.52218 4.43338L8.75139 5.66259C9.1556 5.58413 9.57311 5.54303 10.0002 5.54303C12.7667 5.54303 15.1323 7.26768 16.0771 9.70249Z"
2712
+ }
2713
+ ) })
2714
+ }
2715
+ )
2716
+ ] });
2717
+ };
2718
+ var Form = ({
2719
+ onSubmit,
2720
+ children,
2721
+ className,
2722
+ ...rest
2723
+ }) => {
2724
+ return /* @__PURE__ */ jsxRuntime.jsx(
2725
+ "form",
2726
+ {
2727
+ onSubmit: (event) => {
2728
+ event.preventDefault();
2729
+ onSubmit?.(event);
2730
+ },
2731
+ className: chunkYERNSNT4_cjs.cn(className),
2732
+ ...rest,
2733
+ children
2734
+ }
2735
+ );
2736
+ };
2737
+ var accentClasses = {
2738
+ brand: "accent-brand-500",
2739
+ primary: "accent-brand-500",
2740
+ success: "accent-success-500",
2741
+ error: "accent-error-500",
2742
+ warning: "accent-warning-500",
2743
+ info: "accent-blue-light-500"
2744
+ };
2745
+ var fillColors2 = {
2746
+ brand: "#465fff",
2747
+ primary: "#465fff",
2748
+ success: "#12b76a",
2749
+ error: "#f04438",
2750
+ warning: "#f79009",
2751
+ info: "#0ba5ec"
2752
+ };
2753
+ var Slider = ({
2754
+ value,
2755
+ defaultValue = 0,
2756
+ onChange,
2757
+ min = 0,
2758
+ max = 100,
2759
+ step = 1,
2760
+ disabled = false,
2761
+ color = "brand",
2762
+ label,
2763
+ showValue = false,
2764
+ className,
2765
+ bgColor,
2766
+ textColor,
2767
+ borderColor,
2768
+ style,
2769
+ ...rest
2770
+ }) => {
2771
+ const isControlled = value !== void 0;
2772
+ const [internalValue, setInternalValue] = React5.useState(defaultValue);
2773
+ const currentValue = isControlled ? value : internalValue;
2774
+ const handleChange = (e) => {
2775
+ const next = Number(e.target.value);
2776
+ if (!isControlled) {
2777
+ setInternalValue(next);
2778
+ }
2779
+ onChange?.(next);
2780
+ };
2781
+ const percent = max === min ? 0 : (currentValue - min) / (max - min) * 100;
2782
+ const fill = fillColors2[color];
2783
+ const trackBg = `linear-gradient(to right, ${fill} 0%, ${fill} ${percent}%, var(--slider-track, #e4e7ec) ${percent}%, var(--slider-track, #e4e7ec) 100%)`;
2784
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkYERNSNT4_cjs.cn("w-full", disabled && "opacity-50"), children: [
2785
+ (label || showValue) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-1.5 flex items-center justify-between text-sm font-medium text-gray-700 dark:text-gray-400", children: [
2786
+ label && /* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
2787
+ showValue && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500 dark:text-gray-400", children: currentValue })
2788
+ ] }),
2789
+ /* @__PURE__ */ jsxRuntime.jsx(
2790
+ "input",
2791
+ {
2792
+ type: "range",
2793
+ role: "slider",
2794
+ min,
2795
+ max,
2796
+ step,
2797
+ value: currentValue,
2798
+ disabled,
2799
+ onChange: handleChange,
2800
+ "aria-valuemin": min,
2801
+ "aria-valuemax": max,
2802
+ "aria-valuenow": currentValue,
2803
+ className: chunkYERNSNT4_cjs.cn(
2804
+ "h-2 w-full cursor-pointer appearance-none rounded-lg focus:outline-hidden focus:ring-3 focus:ring-brand-500/10",
2805
+ accentClasses[color],
2806
+ disabled && "cursor-not-allowed",
2807
+ className
2808
+ ),
2809
+ style: {
2810
+ background: trackBg,
2811
+ ...styleOverride({ bgColor, textColor, borderColor }),
2812
+ ...style
2813
+ },
2814
+ ...rest
2815
+ }
2816
+ )
2817
+ ] });
2818
+ };
2819
+
2820
+ Object.defineProperty(exports, "BarChart", {
2821
+ enumerable: true,
2822
+ get: function () { return chunkOSIOO5AE_cjs.BarChart; }
2823
+ });
2824
+ Object.defineProperty(exports, "LineChart", {
2825
+ enumerable: true,
2826
+ get: function () { return chunkBGA7AECV_cjs.LineChart; }
2827
+ });
2828
+ Object.defineProperty(exports, "Calendar", {
2829
+ enumerable: true,
2830
+ get: function () { return chunkMYOOZFHK_cjs.Calendar; }
2831
+ });
2832
+ Object.defineProperty(exports, "Modal", {
2833
+ enumerable: true,
2834
+ get: function () { return chunkMYOOZFHK_cjs.Modal; }
2835
+ });
2836
+ Object.defineProperty(exports, "CountryMap", {
2837
+ enumerable: true,
2838
+ get: function () { return chunkHT7SQXRF_cjs.CountryMap; }
2839
+ });
2840
+ Object.defineProperty(exports, "Editor", {
2841
+ enumerable: true,
2842
+ get: function () { return chunkW7SNEBD7_cjs.Editor; }
2843
+ });
2844
+ Object.defineProperty(exports, "cn", {
2845
+ enumerable: true,
2846
+ get: function () { return chunkYERNSNT4_cjs.cn; }
2847
+ });
2848
+ exports.Accordion = Accordion;
2849
+ exports.AccordionItem = AccordionItem;
2850
+ exports.Alert = Alert;
2851
+ exports.Avatar = Avatar;
2852
+ exports.AvatarText = AvatarText;
2853
+ exports.Badge = Badge;
2854
+ exports.Breadcrumb = Breadcrumb;
2855
+ exports.Button = Button;
2856
+ exports.Checkbox = Checkbox;
2857
+ exports.Chip = Chip;
2858
+ exports.Code = Code;
2859
+ exports.DataTable = DataTable;
2860
+ exports.DatePicker = DatePicker;
2861
+ exports.DateTimePicker = DateTimePicker;
2862
+ exports.Drawer = Drawer;
2863
+ exports.Dropdown = Dropdown;
2864
+ exports.DropdownItem = DropdownItem;
2865
+ exports.Dropzone = Dropzone;
2866
+ exports.FileInput = FileInput;
2867
+ exports.Form = Form;
2868
+ exports.Input = Input;
2869
+ exports.Label = Label;
2870
+ exports.MultiSelect = MultiSelect;
2871
+ exports.Pagination = Pagination;
2872
+ exports.PasswordInput = PasswordInput;
2873
+ exports.Popover = Popover;
2874
+ exports.Progress = Progress;
2875
+ exports.Radio = Radio;
2876
+ exports.RadioSm = RadioSm;
2877
+ exports.Ribbon = Ribbon;
2878
+ exports.Select = Select;
2879
+ exports.Skeleton = Skeleton;
2880
+ exports.Slider = Slider;
2881
+ exports.Snippet = Snippet;
2882
+ exports.Spinner = Spinner;
2883
+ exports.Switch = Switch;
2884
+ exports.Tab = Tab;
2885
+ exports.Table = Table;
2886
+ exports.TableBody = TableBody;
2887
+ exports.TableCell = TableCell;
2888
+ exports.TableHeader = TableHeader;
2889
+ exports.TableRow = TableRow;
2890
+ exports.Tabs = Tabs;
2891
+ exports.TextArea = TextArea;
2892
+ exports.ThemeToggleButton = ThemeToggleButton;
2893
+ exports.Tooltip = Tooltip;
2894
+ exports.styleOverride = styleOverride;
2895
+ //# sourceMappingURL=index.cjs.map
2896
+ //# sourceMappingURL=index.cjs.map