@moondreamsdev/dreamer-ui 1.7.7-test.2 → 1.7.7-test.21

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 (75) hide show
  1. package/README.md +13 -0
  2. package/dist/QuestionMarkCircled-BaSE7iv0.cjs +2 -0
  3. package/dist/QuestionMarkCircled-BaSE7iv0.cjs.map +1 -0
  4. package/dist/{QuestionMarkCircled-BVBF3skB.js → QuestionMarkCircled-CY81euqP.js} +119 -7
  5. package/dist/QuestionMarkCircled-CY81euqP.js.map +1 -0
  6. package/dist/Toast-B-Zu6Kp_.cjs +2 -0
  7. package/dist/Toast-B-Zu6Kp_.cjs.map +1 -0
  8. package/dist/{Toast-C5BwqBkw.js → Toast-BFQrI1bB.js} +129 -100
  9. package/dist/Toast-BFQrI1bB.js.map +1 -0
  10. package/dist/components.cjs.js +1 -1
  11. package/dist/components.cjs.js.map +1 -1
  12. package/dist/components.esm.js +2117 -684
  13. package/dist/components.esm.js.map +1 -1
  14. package/dist/providers.cjs.js +1 -1
  15. package/dist/providers.esm.js +1 -1
  16. package/dist/src/components/accordion/AccordionItem.d.ts +0 -1
  17. package/dist/src/components/carousel/Carousel.d.ts +46 -0
  18. package/dist/src/components/carousel/hooks.d.ts +20 -0
  19. package/dist/src/components/carousel/index.d.ts +2 -0
  20. package/dist/src/components/carousel/useScreenSize.d.ts +15 -0
  21. package/dist/src/components/carousel/variants.d.ts +36 -0
  22. package/dist/src/components/clickable/Clickable.d.ts +0 -1
  23. package/dist/src/components/index.d.ts +9 -0
  24. package/dist/src/components/label/Label.d.ts +2 -1
  25. package/dist/src/components/pagination/Pagination.d.ts +24 -0
  26. package/dist/src/components/pagination/index.d.ts +1 -0
  27. package/dist/src/components/pagination/variants.d.ts +15 -0
  28. package/dist/src/components/panel/Panel.d.ts +36 -0
  29. package/dist/src/components/panel/hooks.d.ts +6 -0
  30. package/dist/src/components/panel/index.d.ts +3 -0
  31. package/dist/src/components/panel/variants.d.ts +12 -0
  32. package/dist/src/components/radiogroup/RadioGroupItem.d.ts +0 -1
  33. package/dist/src/components/scroll-area/ScrollArea.d.ts +20 -0
  34. package/dist/src/components/scroll-area/hooks.d.ts +12 -0
  35. package/dist/src/components/scroll-area/index.d.ts +2 -0
  36. package/dist/src/components/select/Select.d.ts +22 -0
  37. package/dist/src/components/select/hooks.d.ts +35 -0
  38. package/dist/src/components/select/index.d.ts +2 -0
  39. package/dist/src/components/select/variants.d.ts +15 -0
  40. package/dist/src/components/separator/Separator.d.ts +15 -0
  41. package/dist/src/components/separator/index.d.ts +2 -0
  42. package/dist/src/components/separator/variants.d.ts +7 -0
  43. package/dist/src/components/skeleton/Skeleton.d.ts +13 -0
  44. package/dist/src/components/skeleton/index.d.ts +1 -0
  45. package/dist/src/components/skeleton/variants.d.ts +18 -0
  46. package/dist/src/components/slider/Slider.d.ts +33 -0
  47. package/dist/src/components/slider/hooks.d.ts +30 -0
  48. package/dist/src/components/slider/index.d.ts +2 -0
  49. package/dist/src/components/slider/variants.d.ts +49 -0
  50. package/dist/src/components/tabs/Tabs.d.ts +26 -0
  51. package/dist/src/components/tabs/TabsContent.d.ts +10 -0
  52. package/dist/src/components/tabs/TabsContext.d.ts +11 -0
  53. package/dist/src/components/tabs/TabsList.d.ts +7 -0
  54. package/dist/src/components/tabs/TabsTrigger.d.ts +15 -0
  55. package/dist/src/components/tabs/hooks.d.ts +9 -0
  56. package/dist/src/components/tabs/index.d.ts +4 -0
  57. package/dist/src/components/tabs/variants.d.ts +18 -0
  58. package/dist/src/components/tooltip/hooks.d.ts +0 -1
  59. package/dist/src/hooks/useActionModal.d.ts +0 -1
  60. package/dist/src/hooks/useToast.d.ts +0 -1
  61. package/dist/src/symbols/ChevronDoubleLeft.d.ts +2 -0
  62. package/dist/src/symbols/ChevronDoubleRight.d.ts +2 -0
  63. package/dist/src/symbols/ChevronLeft.d.ts +2 -0
  64. package/dist/src/symbols/ChevronRight.d.ts +2 -0
  65. package/dist/src/symbols/index.d.ts +4 -1
  66. package/dist/symbols.cjs.js +1 -1
  67. package/dist/symbols.esm.js +14 -10
  68. package/dist/theme.css +4 -0
  69. package/package.json +3 -3
  70. package/dist/QuestionMarkCircled-BVBF3skB.js.map +0 -1
  71. package/dist/QuestionMarkCircled-D5cHmQp1.cjs +0 -2
  72. package/dist/QuestionMarkCircled-D5cHmQp1.cjs.map +0 -1
  73. package/dist/Toast-C5BwqBkw.js.map +0 -1
  74. package/dist/Toast-FzI16Fnl.cjs +0 -2
  75. package/dist/Toast-FzI16Fnl.cjs.map +0 -1
@@ -1,47 +1,47 @@
1
- import { jsxs as E, jsx as f, Fragment as J } from "react/jsx-runtime";
2
- import z, { useId as I, useState as x, createElement as Y, useEffect as C, useCallback as A, useMemo as W, useRef as j, isValidElement as P, cloneElement as ee } from "react";
1
+ import { jsxs as k, jsx as c, Fragment as ne } from "react/jsx-runtime";
2
+ import G, { useId as P, useState as A, createElement as Te, useEffect as z, useRef as B, useCallback as C, useMemo as J, isValidElement as De, cloneElement as Re } from "react";
3
3
  import { join as w } from "./utils.esm.js";
4
- import { b as te, C as re, a as ne, c as oe, E as ae, Q as se } from "./QuestionMarkCircled-BVBF3skB.js";
5
- import { n as q } from "./Toast-C5BwqBkw.js";
6
- import { A as Me, T as Oe } from "./Toast-C5BwqBkw.js";
7
- import { E as ie, X as le } from "./X-CIoyLewf.js";
8
- import { createPortal as M } from "react-dom";
9
- function K({
10
- id: o,
11
- title: a,
12
- content: e,
4
+ import { d as Ae, e as Ie, f as Ce, C as ze, a as Se, g as Le, E as Ve, Q as We, b as Be, c as He } from "./QuestionMarkCircled-CY81euqP.js";
5
+ import { n as V, a as je, u as he } from "./Toast-BFQrI1bB.js";
6
+ import { A as nr, T as ar } from "./Toast-BFQrI1bB.js";
7
+ import { E as Fe, X as ve } from "./X-CIoyLewf.js";
8
+ import { createPortal as pe } from "react-dom";
9
+ function fe({
10
+ id: r,
11
+ title: o,
12
+ content: t,
13
13
  children: n,
14
- className: t = "",
15
- disabled: r = !1,
14
+ className: e = "",
15
+ disabled: a = !1,
16
16
  isOpen: s = !1,
17
- onToggle: d,
18
- triggerClassName: u = "",
19
- bodyClassName: l = ""
17
+ onToggle: i,
18
+ triggerClassName: d = "",
19
+ bodyClassName: f = ""
20
20
  }) {
21
- const b = I(), i = o || `accordion-item-${b}`, v = `${i}-header`, c = `${i}-panel`, m = () => {
22
- !r && d && d();
23
- }, p = (h) => {
24
- (h.key === "Enter" || h.key === " ") && (h.preventDefault(), m());
21
+ const m = P(), l = r || `accordion-item-${m}`, b = `${l}-header`, u = `${l}-panel`, h = () => {
22
+ !a && i && i();
23
+ }, v = (p) => {
24
+ (p.key === "Enter" || p.key === " ") && (p.preventDefault(), h());
25
25
  };
26
- return /* @__PURE__ */ E("div", { className: w("border-b border-gray-200", r && "opacity-60 cursor-not-allowed", t), children: [
27
- /* @__PURE__ */ E(
26
+ return /* @__PURE__ */ k("div", { className: w("border-b border-gray-200", a && "opacity-60 cursor-not-allowed", e), children: [
27
+ /* @__PURE__ */ k(
28
28
  "button",
29
29
  {
30
- id: v,
30
+ id: b,
31
31
  type: "button",
32
32
  className: w(
33
33
  "w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary",
34
- r ? "cursor-not-allowed" : "hover:bg-gray-50/10 cursor-pointer",
35
- u
34
+ a ? "cursor-not-allowed" : "hover:bg-gray-50/10 cursor-pointer",
35
+ d
36
36
  ),
37
37
  "aria-expanded": s,
38
- "aria-controls": c,
39
- disabled: r,
40
- onClick: m,
41
- onKeyDown: p,
38
+ "aria-controls": u,
39
+ disabled: a,
40
+ onClick: h,
41
+ onKeyDown: v,
42
42
  children: [
43
- /* @__PURE__ */ f("span", { children: a }),
44
- /* @__PURE__ */ f(
43
+ /* @__PURE__ */ c("span", { children: o }),
44
+ /* @__PURE__ */ c(
45
45
  "span",
46
46
  {
47
47
  className: w(
@@ -49,78 +49,78 @@ function K({
49
49
  s ? "rotate-180" : "rotate-0"
50
50
  ),
51
51
  "aria-hidden": "true",
52
- children: /* @__PURE__ */ f(te, { size: 18 })
52
+ children: /* @__PURE__ */ c(Ae, { size: 18 })
53
53
  }
54
54
  )
55
55
  ]
56
56
  }
57
57
  ),
58
- /* @__PURE__ */ f(
58
+ /* @__PURE__ */ c(
59
59
  "div",
60
60
  {
61
- id: c,
61
+ id: u,
62
62
  role: "region",
63
- "aria-labelledby": v,
63
+ "aria-labelledby": b,
64
64
  className: w(
65
65
  "transition-all duration-300 ease-linear px-4",
66
66
  s ? "max-h-96 opacity-100 overflow-auto py-3" : "max-h-0 opacity-0 overflow-hidden",
67
- l
67
+ f
68
68
  ),
69
- children: s && (n || e)
69
+ children: s && (n || t)
70
70
  }
71
71
  )
72
72
  ] });
73
73
  }
74
- function He({
75
- id: o,
76
- items: a = [],
77
- children: e,
74
+ function Rt({
75
+ id: r,
76
+ items: o = [],
77
+ children: t,
78
78
  className: n = "",
79
- itemClassName: t = "",
80
- allowMultiple: r = !1,
79
+ itemClassName: e = "",
80
+ allowMultiple: a = !1,
81
81
  defaultOpenItems: s = [],
82
- triggersClassName: d = "",
83
- bodiesClassName: u = ""
82
+ triggersClassName: i = "",
83
+ bodiesClassName: d = ""
84
84
  }) {
85
- const l = I(), b = o || `accordion-group-${l}`, [i, v] = x(new Set(s)), c = (h) => {
86
- v((y) => {
85
+ const f = P(), m = r || `accordion-group-${f}`, [l, b] = A(new Set(s)), u = (p) => {
86
+ b((y) => {
87
87
  const g = new Set(y);
88
- return g.has(h) ? g.delete(h) : (r || g.clear(), g.add(h)), g;
88
+ return g.has(p) ? g.delete(p) : (a || g.clear(), g.add(p)), g;
89
89
  });
90
- }, m = (h) => `${l}-item-${h}`, p = (h) => i.has(h);
91
- return /* @__PURE__ */ E("div", { id: b, className: n, children: [
92
- a.length > 0 && a.map((h, y) => {
93
- const g = h.id || m(y);
94
- return /* @__PURE__ */ f(
95
- K,
90
+ }, h = (p) => `${f}-item-${p}`, v = (p) => l.has(p);
91
+ return /* @__PURE__ */ k("div", { id: m, className: n, children: [
92
+ o.length > 0 && o.map((p, y) => {
93
+ const g = p.id || h(y);
94
+ return /* @__PURE__ */ c(
95
+ fe,
96
96
  {
97
97
  id: g,
98
- title: h.title,
99
- content: h.content,
100
- disabled: h.disabled,
101
- isOpen: p(g),
102
- onToggle: () => c(g),
103
- className: t,
104
- triggerClassName: d,
105
- bodyClassName: u
98
+ title: p.title,
99
+ content: p.content,
100
+ disabled: p.disabled,
101
+ isOpen: v(g),
102
+ onToggle: () => u(g),
103
+ className: e,
104
+ triggerClassName: i,
105
+ bodyClassName: d
106
106
  },
107
107
  g
108
108
  );
109
109
  }),
110
- a.length === 0 && e && z.Children.map(e, (h, y) => {
111
- if (z.isValidElement(h) && h.type === K) {
112
- const g = h.props.id || m(y);
113
- return /* @__PURE__ */ Y(
114
- K,
110
+ o.length === 0 && t && G.Children.map(t, (p, y) => {
111
+ if (G.isValidElement(p) && p.type === fe) {
112
+ const g = p.props.id || h(y);
113
+ return /* @__PURE__ */ Te(
114
+ fe,
115
115
  {
116
- ...h.props,
116
+ ...p.props,
117
117
  key: g,
118
118
  id: g,
119
- className: w(t, h.props.className),
120
- isOpen: p(g),
121
- onToggle: () => c(g),
122
- triggerClassName: w(d, h.props.triggerClassName),
123
- bodyClassName: w(u, h.props.bodyClassName)
119
+ className: w(e, p.props.className),
120
+ isOpen: v(g),
121
+ onToggle: () => u(g),
122
+ triggerClassName: w(i, p.props.triggerClassName),
123
+ bodyClassName: w(d, p.props.bodyClassName)
124
124
  }
125
125
  );
126
126
  }
@@ -128,25 +128,25 @@ function He({
128
128
  })
129
129
  ] });
130
130
  }
131
- function de() {
132
- const [o, a] = x(0);
133
- return C(() => {
134
- const e = setInterval(() => {
135
- a((n) => (n + 1) % 3);
131
+ function Me() {
132
+ const [r, o] = A(0);
133
+ return z(() => {
134
+ const t = setInterval(() => {
135
+ o((n) => (n + 1) % 3);
136
136
  }, 500);
137
- return () => clearInterval(e);
138
- }, []), /* @__PURE__ */ f("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((e) => /* @__PURE__ */ f(
137
+ return () => clearInterval(t);
138
+ }, []), /* @__PURE__ */ c("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((t) => /* @__PURE__ */ c(
139
139
  "div",
140
140
  {
141
141
  className: w(
142
142
  "rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",
143
- o === e && "transform -translate-y-1"
143
+ r === t && "transform -translate-y-1"
144
144
  )
145
145
  },
146
- e
146
+ t
147
147
  )) });
148
148
  }
149
- const ue = {
149
+ const Ge = {
150
150
  base: "",
151
151
  primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
152
152
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
@@ -154,7 +154,7 @@ const ue = {
154
154
  outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
155
155
  link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
156
156
  destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
157
- }, ce = {
157
+ }, Pe = {
158
158
  stripped: "",
159
159
  fitted: "size-fit",
160
160
  sm: "px-2 py-1 text-sm",
@@ -162,60 +162,60 @@ const ue = {
162
162
  lg: "px-6 py-3 text-lg",
163
163
  icon: "p-1 w-fit aspect-square",
164
164
  full: "p-2 w-full"
165
- }, fe = {
165
+ }, Ke = {
166
166
  none: "rounded-none",
167
167
  sm: "rounded-sm",
168
168
  md: "rounded-md",
169
169
  lg: "rounded-lg",
170
170
  full: "rounded-full"
171
- }, V = {
171
+ }, me = {
172
172
  variant: "primary",
173
173
  size: "md",
174
174
  rounded: "md"
175
175
  };
176
- function me({
177
- variant: o = V.variant,
178
- size: a,
179
- rounded: e = V.rounded,
176
+ function qe({
177
+ variant: r = me.variant,
178
+ size: o,
179
+ rounded: t = me.rounded,
180
180
  loading: n,
181
- linkTo: t,
182
- linkProps: r,
181
+ linkTo: e,
182
+ linkProps: a,
183
183
  type: s = "button",
184
- className: d,
185
- ...u
184
+ className: i,
185
+ ...d
186
186
  }) {
187
- let l;
188
- o === "link" && !a ? l = "fitted" : l = a || V.size;
189
- const i = w(
187
+ let f;
188
+ r === "link" && !o ? f = "fitted" : f = o || me.size;
189
+ const l = w(
190
190
  "appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
191
- ue[o],
192
- ce[l],
193
- fe[e],
191
+ Ge[r],
192
+ Pe[f],
193
+ Ke[t],
194
194
  n && "relative pointer-events-none",
195
- t && "relative",
196
- d
195
+ e && "relative",
196
+ i
197
197
  );
198
- return /* @__PURE__ */ E(
198
+ return /* @__PURE__ */ k(
199
199
  "button",
200
200
  {
201
- ...u,
202
- role: t ? "link" : u.role,
203
- "aria-label": u["aria-label"] || (r == null ? void 0 : r["aria-label"]),
204
- "aria-description": u["aria-description"] || (r == null ? void 0 : r["aria-description"]),
205
- "aria-disabled": u.disabled || n,
201
+ ...d,
202
+ role: e ? "link" : d.role,
203
+ "aria-label": d["aria-label"] || (a == null ? void 0 : a["aria-label"]),
204
+ "aria-description": d["aria-description"] || (a == null ? void 0 : a["aria-description"]),
205
+ "aria-disabled": d.disabled || n,
206
206
  "aria-busy": n,
207
207
  type: s,
208
- className: i,
208
+ className: l,
209
209
  children: [
210
- n && /* @__PURE__ */ f(de, {}),
211
- /* @__PURE__ */ f("span", { className: w(n && "invisible"), children: u.children }),
212
- t && !u.disabled && /* @__PURE__ */ f(
210
+ n && /* @__PURE__ */ c(Me, {}),
211
+ /* @__PURE__ */ c("span", { className: w(n && "invisible"), children: d.children }),
212
+ e && !d.disabled && /* @__PURE__ */ c(
213
213
  "a",
214
214
  {
215
- ...r,
215
+ ...a,
216
216
  "aria-hidden": !0,
217
- href: t,
218
- rel: (r == null ? void 0 : r.rel) || "noreferrer",
217
+ href: e,
218
+ rel: (a == null ? void 0 : a.rel) || "noreferrer",
219
219
  className: "absolute inset-0"
220
220
  }
221
221
  )
@@ -223,346 +223,661 @@ function me({
223
223
  }
224
224
  );
225
225
  }
226
- function be(o) {
227
- const [a, e] = x(""), n = A((t) => {
228
- let r = t, s = "";
229
- for (; r && !s; ) {
230
- const d = window.getComputedStyle(r).backgroundColor;
231
- d && d !== "transparent" && d !== "rgba(0, 0, 0, 0)" && (s = d), r = r.parentElement;
226
+ function Ue({
227
+ totalItems: r,
228
+ itemsToShow: o,
229
+ infinite: t,
230
+ autoScroll: n,
231
+ scrollInterval: e,
232
+ pauseScrollOnHover: a,
233
+ currentIndex: s,
234
+ onIndexChange: i
235
+ }) {
236
+ const [d, f] = A(s || 0), [m, l] = A(!1), b = B(null), u = Math.ceil(r / o), h = t || d > 0, v = t || d < u - 1, p = C(
237
+ (x) => {
238
+ const N = Math.max(0, Math.min(x, u - 1));
239
+ f(N), i == null || i(N);
240
+ },
241
+ [u, i]
242
+ ), y = C(() => {
243
+ if (h) {
244
+ const x = d === 0 && t ? u - 1 : d - 1;
245
+ p(x);
246
+ }
247
+ }, [d, h, t, u, p]), g = C(() => {
248
+ if (v) {
249
+ const x = d === u - 1 && t ? 0 : d + 1;
250
+ p(x);
251
+ }
252
+ }, [d, v, t, u, p]);
253
+ return z(() => {
254
+ s !== void 0 && s !== d && f(s);
255
+ }, [s, d]), z(() => {
256
+ if (!n) return;
257
+ const x = () => {
258
+ b.current = setInterval(() => {
259
+ a && m || g();
260
+ }, e);
261
+ }, N = () => {
262
+ b.current && (clearInterval(b.current), b.current = null);
263
+ };
264
+ return !m || !a ? x() : N(), N;
265
+ }, [n, e, a, m, g]), z(() => {
266
+ f(0);
267
+ }, [o]), {
268
+ currentSlide: d,
269
+ canGoPrev: h,
270
+ canGoNext: v,
271
+ goToPrev: y,
272
+ goToNext: g,
273
+ goToSlide: p,
274
+ isHovered: m,
275
+ setIsHovered: l
276
+ };
277
+ }
278
+ const ee = {
279
+ xs: 0,
280
+ // Smaller than `sm`
281
+ sm: 640,
282
+ // Tailwind's `sm` breakpoint: `@media (min-width: 640px)`
283
+ md: 768,
284
+ // Tailwind's `md` breakpoint: `@media (min-width: 768px)`
285
+ lg: 1024,
286
+ // Tailwind's `lg` breakpoint: `@media (min-width: 1024px)`
287
+ xl: 1280,
288
+ // Tailwind's `xl` breakpoint: `@media (min-width: 1280px)`
289
+ "2xl": 1536
290
+ // Tailwind's `2xl` breakpoint: `@media (min-width: 1536px)`
291
+ };
292
+ function _e() {
293
+ const [r, o] = A(), [t, n] = A(0), e = (a) => ee[a];
294
+ return z(() => {
295
+ const a = (i) => i >= ee["2xl"] ? "2xl" : i >= ee.xl ? "xl" : i >= ee.lg ? "lg" : i >= ee.md ? "md" : i >= ee.sm ? "sm" : "xs";
296
+ o(a(window.innerWidth)), n(window.innerWidth);
297
+ const s = () => {
298
+ o(a(window.innerWidth)), n(window.innerWidth);
299
+ };
300
+ return window.addEventListener("resize", s), () => {
301
+ window.removeEventListener("resize", s);
302
+ };
303
+ }, []), { screenSize: r, screenWidth: t, getBreakpoint: e };
304
+ }
305
+ const ae = {
306
+ sm: {
307
+ button: "h-6 w-6 text-xs",
308
+ icon: "size-3"
309
+ },
310
+ md: {
311
+ button: "h-8 w-8 text-sm",
312
+ icon: "size-4"
313
+ },
314
+ lg: {
315
+ button: "h-10 w-10 text-lg",
316
+ icon: "size-5"
317
+ }
318
+ }, ge = {
319
+ default: "bg-accent text-accent-foreground hover:bg-accent-foreground hover:text-accent",
320
+ outline: "border border-border bg-background hover:bg-accent hover:text-accent-foreground hover:border-accent",
321
+ ghost: "hover:text-accent"
322
+ }, oe = {
323
+ aligned: {
324
+ prev: "absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",
325
+ next: "absolute right-0 top-1/2 translate-x-1/2 -translate-y-1/2 z-10"
326
+ },
327
+ exterior: {
328
+ prev: "absolute -left-10 top-1/2 -translate-y-1/2 z-10",
329
+ next: "absolute -right-10 top-1/2 -translate-y-1/2 z-10"
330
+ },
331
+ interior: {
332
+ prev: "absolute left-2 top-1/2 -translate-y-1/2 z-10",
333
+ next: "absolute right-2 top-1/2 -translate-y-1/2 z-10"
334
+ }
335
+ };
336
+ function St({
337
+ children: r,
338
+ id: o,
339
+ ref: t,
340
+ className: n,
341
+ autoScroll: e = !1,
342
+ scrollInterval: a = 3e3,
343
+ pauseScrollOnHover: s = !0,
344
+ currentIndex: i,
345
+ onIndexChange: d,
346
+ hidePrevNext: f = !1,
347
+ hideDots: m = !1,
348
+ itemsToShow: l = 1,
349
+ buttonSize: b = "md",
350
+ buttonVariant: u = "default",
351
+ buttonPosition: h = "exterior",
352
+ infinite: v = !0,
353
+ prevButton: p,
354
+ nextButton: y,
355
+ itemsClassName: g,
356
+ containerClassName: x,
357
+ dotsClassName: N,
358
+ gap: E = 8
359
+ }) {
360
+ var W, te;
361
+ const S = B(null), I = G.Children.toArray(r).filter(G.isValidElement), $ = I.length, { screenSize: M } = _e(), L = J(() => {
362
+ if (typeof l == "number")
363
+ return l;
364
+ if (typeof l == "object" && l && M) {
365
+ const Z = ["2xl", "xl", "lg", "md", "sm", "xs"], F = Z.indexOf(M);
366
+ for (let O = F; O < Z.length; O++) {
367
+ const re = Z[O];
368
+ if (l[re] !== void 0)
369
+ return l[re];
370
+ }
371
+ }
372
+ return 1;
373
+ }, [l, M]), { currentSlide: U, canGoPrev: j, canGoNext: D, goToPrev: R, goToNext: H, goToSlide: K, setIsHovered: _ } = Ue({
374
+ totalItems: $,
375
+ itemsToShow: L,
376
+ infinite: v,
377
+ autoScroll: e,
378
+ scrollInterval: a,
379
+ pauseScrollOnHover: s,
380
+ currentIndex: i,
381
+ onIndexChange: d
382
+ }), Q = C(
383
+ (Z) => {
384
+ if (L === 1)
385
+ return { leftWidth: 0, rightWidth: 0, widthReduction: 0 };
386
+ const F = E * (L - 1) / L;
387
+ return Z % L === 0 ? { leftWidth: 0, rightWidth: E / 2, widthReduction: F } : Z % L === L - 1 ? { leftWidth: E / 2, rightWidth: 0, widthReduction: F } : { leftWidth: E / 2, rightWidth: E / 2, widthReduction: F };
388
+ },
389
+ [L, E]
390
+ ), q = () => {
391
+ R();
392
+ }, Y = () => {
393
+ H();
394
+ }, ce = () => {
395
+ s && _(!0);
396
+ }, de = () => {
397
+ s && _(!1);
398
+ }, ue = -(U * (100 / $) * L), T = w(
399
+ "inline-flex items-center justify-center rounded-md font-medium transition-all focus-visible:outline-none focus-visible:ring focus-visible:ring-ring disabled:pointer-events-none",
400
+ h === "aligned" ? "disabled:opacity-90" : "disabled:opacity-50"
401
+ );
402
+ return /* @__PURE__ */ k("div", { className: w("relative", n), "data-carousel-wrapper": "true", children: [
403
+ !f && /* @__PURE__ */ c(ne, { children: p ? G.cloneElement(
404
+ p,
405
+ {
406
+ onClick: q,
407
+ disabled: !j,
408
+ className: w(
409
+ ((W = p.props) == null ? void 0 : W.className) || "",
410
+ oe[h].prev
411
+ ),
412
+ role: "button",
413
+ "aria-disabled": !j,
414
+ "aria-label": "Previous slide",
415
+ "data-carousel-prev": "true"
416
+ }
417
+ ) : /* @__PURE__ */ c(
418
+ "button",
419
+ {
420
+ type: "button",
421
+ onClick: q,
422
+ disabled: !j,
423
+ className: w(
424
+ T,
425
+ ae[b].button,
426
+ ge[u],
427
+ oe[h].prev
428
+ ),
429
+ "aria-disabled": !j,
430
+ "aria-label": "Previous slide",
431
+ "data-carousel-prev": "true",
432
+ children: /* @__PURE__ */ c(Ie, { className: ae[b].icon })
433
+ }
434
+ ) }),
435
+ /* @__PURE__ */ k(
436
+ "div",
437
+ {
438
+ id: o,
439
+ ref: t,
440
+ className: w("relative overflow-hidden", x),
441
+ onMouseEnter: ce,
442
+ onMouseLeave: de,
443
+ "data-carousel": "true",
444
+ "data-current-index": U,
445
+ "data-items-to-show": L,
446
+ "data-auto-scroll": e,
447
+ "data-button-position": h,
448
+ children: [
449
+ /* @__PURE__ */ c(
450
+ "div",
451
+ {
452
+ ref: S,
453
+ className: "flex transition-transform duration-300 ease-in-out",
454
+ style: {
455
+ transform: `translateX(${ue}%)`,
456
+ width: `${$ / L * 100}%`
457
+ },
458
+ children: I.map((Z, F) => {
459
+ const { leftWidth: O, rightWidth: re, widthReduction: $e } = Q(F);
460
+ return /* @__PURE__ */ c(
461
+ "div",
462
+ {
463
+ className: w("flex-shrink-0", g),
464
+ style: {
465
+ width: `calc(${100 / $}% - ${$e}px)`,
466
+ marginRight: re > 0 ? `${re}px` : void 0,
467
+ marginLeft: O > 0 ? `${O}px` : void 0
468
+ },
469
+ "data-slide-index": F,
470
+ children: Z
471
+ },
472
+ F
473
+ );
474
+ })
475
+ }
476
+ ),
477
+ !m && /* @__PURE__ */ c("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 flex space-x-2", children: Array.from({ length: Math.ceil($ / L) }).map((Z, F) => /* @__PURE__ */ c(
478
+ "button",
479
+ {
480
+ type: "button",
481
+ onClick: () => K(F),
482
+ className: w(
483
+ "w-2 h-2 rounded-full transition-colors duration-200",
484
+ F === U ? "bg-accent" : "bg-muted hover:bg-muted-foreground/50",
485
+ N
486
+ ),
487
+ "aria-label": `Go to slide ${F + 1}`,
488
+ "data-carousel-dot": F
489
+ },
490
+ F
491
+ )) })
492
+ ]
493
+ }
494
+ ),
495
+ !f && /* @__PURE__ */ c(ne, { children: y ? G.cloneElement(
496
+ y,
497
+ {
498
+ onClick: Y,
499
+ disabled: !D,
500
+ className: w(
501
+ ((te = y.props) == null ? void 0 : te.className) || "",
502
+ oe[h].next
503
+ ),
504
+ role: "button",
505
+ "aria-disabled": !D,
506
+ "aria-label": "Next slide",
507
+ "data-carousel-next": "true"
508
+ }
509
+ ) : /* @__PURE__ */ c(
510
+ "button",
511
+ {
512
+ type: "button",
513
+ onClick: Y,
514
+ disabled: !D,
515
+ className: w(
516
+ T,
517
+ ae[b].button,
518
+ ge[u],
519
+ oe[h].next
520
+ ),
521
+ "aria-disabled": !D,
522
+ "aria-label": "Next slide",
523
+ "data-carousel-next": "true",
524
+ children: /* @__PURE__ */ c(Ce, { className: ae[b].icon })
525
+ }
526
+ ) })
527
+ ] });
528
+ }
529
+ function Xe(r) {
530
+ const [o, t] = A(""), n = C((e) => {
531
+ let a = e, s = "";
532
+ for (; a && !s; ) {
533
+ const i = window.getComputedStyle(a).backgroundColor;
534
+ i && i !== "transparent" && i !== "rgba(0, 0, 0, 0)" && (s = i), a = a.parentElement;
232
535
  }
233
536
  return s || "transparent";
234
537
  }, []);
235
- return C(() => {
236
- const t = document.getElementById(o);
237
- if (t) {
238
- const r = n(t.parentElement);
239
- e(r);
538
+ return z(() => {
539
+ const e = document.getElementById(r);
540
+ if (e) {
541
+ const a = n(e.parentElement);
542
+ t(a);
240
543
  }
241
- }, [o, n]), a;
544
+ }, [r, n]), o;
242
545
  }
243
- function qe({
244
- ref: o,
245
- id: a,
246
- size: e = 20,
546
+ function Lt({
547
+ ref: r,
548
+ id: o,
549
+ size: t = 20,
247
550
  color: n,
248
- filled: t = !1,
249
- rounded: r = !0,
551
+ filled: e = !1,
552
+ rounded: a = !0,
250
553
  checked: s = !1,
251
- onCheckedChange: d,
252
- disabled: u,
253
- className: l = "",
254
- ...b
554
+ onCheckedChange: i,
555
+ disabled: d,
556
+ className: f = "",
557
+ ...m
255
558
  }) {
256
- const i = I(), v = W(() => a || `checkbox-${i}`, [a, i]), c = be(v), [m, p] = x(s);
257
- C(() => {
258
- p(s);
559
+ const l = P(), b = J(() => o || `checkbox-${l}`, [o, l]), u = Xe(b), [h, v] = A(s);
560
+ z(() => {
561
+ v(s);
259
562
  }, [s]);
260
- const h = () => {
261
- u || (p(!m), d == null || d(!m));
262
- }, y = (N) => {
263
- N.key === " " && (N.preventDefault(), h());
563
+ const p = () => {
564
+ d || (v(!h), i == null || i(!h));
565
+ }, y = (x) => {
566
+ x.key === " " && (x.preventDefault(), p());
264
567
  }, g = w(
265
568
  "flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2",
266
- r && "rounded",
267
- u && "opacity-40 cursor-not-allowed",
268
- !u && "cursor-pointer",
269
- l
569
+ a && "rounded",
570
+ d && "opacity-40 cursor-not-allowed",
571
+ !d && "cursor-pointer",
572
+ f
270
573
  );
271
- return /* @__PURE__ */ f(
574
+ return /* @__PURE__ */ c(
272
575
  "button",
273
576
  {
274
- id: v,
577
+ id: b,
275
578
  type: "button",
276
- ref: o,
579
+ ref: r,
277
580
  tabIndex: 0,
278
581
  role: "checkbox",
279
- onClick: h,
280
- "aria-checked": m,
281
- "aria-disabled": u,
582
+ onClick: p,
583
+ "aria-checked": h,
584
+ "aria-disabled": d,
282
585
  onKeyDownCapture: y,
283
586
  style: {
284
- width: e,
285
- height: e,
587
+ width: t,
588
+ height: t,
286
589
  color: n,
287
- backgroundColor: m && t ? "currentcolor" : "transparent"
590
+ backgroundColor: h && e ? "currentcolor" : "transparent"
288
591
  },
289
592
  className: g,
290
- ...b,
291
- children: m && /* @__PURE__ */ f(re, { size: e, color: t ? c : void 0 })
593
+ ...m,
594
+ children: h && /* @__PURE__ */ c(ze, { size: t, color: e ? u : void 0 })
292
595
  }
293
596
  );
294
597
  }
295
- function Ke({
296
- children: o,
297
- className: a,
298
- linkTo: e,
598
+ function Vt({
599
+ children: r,
600
+ className: o,
601
+ linkTo: t,
299
602
  linkProps: n,
300
- onButtonClick: t,
301
- buttonProps: r,
603
+ onButtonClick: e,
604
+ buttonProps: a,
302
605
  ...s
303
606
  }) {
304
- return e && t && console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'), /* @__PURE__ */ E("div", { className: w("relative w-fit", a), ...s, children: [
305
- o,
306
- e && /* @__PURE__ */ f(
607
+ return t && e && console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'), /* @__PURE__ */ k("div", { className: w("relative w-fit", o), ...s, children: [
608
+ r,
609
+ t && /* @__PURE__ */ c(
307
610
  "a",
308
611
  {
309
612
  ...n,
310
613
  rel: (n == null ? void 0 : n.rel) || "noreferrer",
311
- href: e,
614
+ href: t,
312
615
  className: w("absolute inset-0", n == null ? void 0 : n.className)
313
616
  }
314
617
  ),
315
- !e && t && /* @__PURE__ */ f(
618
+ !t && e && /* @__PURE__ */ c(
316
619
  "button",
317
620
  {
318
- ...r,
621
+ ...a,
319
622
  type: "button",
320
- onClick: t,
321
- className: w("absolute inset-0 cursor-pointer", r == null ? void 0 : r.className)
623
+ onClick: e,
624
+ className: w("absolute inset-0 cursor-pointer", a == null ? void 0 : a.className)
322
625
  }
323
626
  )
324
627
  ] });
325
628
  }
326
- function S({ elementId: o, type: a, message: e }) {
327
- return C(() => {
328
- const n = document.getElementById(o);
629
+ function le({ elementId: r, type: o, message: t }) {
630
+ return z(() => {
631
+ const n = document.getElementById(r);
329
632
  if (n) {
330
- if (!e && a === "error") {
633
+ if (!t && o === "error") {
331
634
  n.removeAttribute("data-error");
332
635
  return;
333
636
  }
334
- if (!e && a === "success") {
637
+ if (!t && o === "success") {
335
638
  n.removeAttribute("data-success");
336
639
  return;
337
640
  }
338
- return n.setAttribute("aria-describedby", `${o}-${a}-message`), n.setAttribute("aria-invalid", a === "error" ? "true" : "false"), a === "error" && n.setAttribute("data-error", "true"), a === "success" && n.setAttribute("data-success", "true"), () => {
641
+ return n.setAttribute("aria-describedby", `${r}-${o}-message`), n.setAttribute("aria-invalid", o === "error" ? "true" : "false"), o === "error" && n.setAttribute("data-error", "true"), o === "success" && n.setAttribute("data-success", "true"), () => {
339
642
  n.removeAttribute("aria-describedby"), n.removeAttribute("aria-invalid"), n.removeAttribute("data-error"), n.removeAttribute("data-success");
340
643
  };
341
644
  }
342
- }, [o, a, e]), e ? /* @__PURE__ */ E(
645
+ }, [r, o, t]), t ? /* @__PURE__ */ k(
343
646
  "small",
344
647
  {
345
648
  className: w(
346
649
  "mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start",
347
- a === "error" && "text-destructive",
348
- a === "success" && "text-success"
650
+ o === "error" && "text-destructive",
651
+ o === "success" && "text-success"
349
652
  ),
350
653
  role: "status",
351
654
  children: [
352
- a === "error" ? /* @__PURE__ */ f(ie, {}) : /* @__PURE__ */ f(ne, {}),
353
- /* @__PURE__ */ f("span", { id: `${o}-${a}-message`, children: e })
655
+ o === "error" ? /* @__PURE__ */ c(Fe, {}) : /* @__PURE__ */ c(Se, {}),
656
+ /* @__PURE__ */ c("span", { id: `${r}-${o}-message`, children: t })
354
657
  ]
355
658
  }
356
659
  ) : null;
357
660
  }
358
- const he = {
661
+ const Qe = {
359
662
  base: "",
360
663
  default: "ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success",
361
664
  underline: "border-b border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",
362
665
  outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"
363
- }, ge = {
666
+ }, Ze = {
364
667
  none: "rounded-none",
365
668
  sm: "rounded-sm",
366
669
  md: "rounded-md",
367
670
  lg: "rounded-lg",
368
671
  full: "px-3 rounded-full"
369
- }, Q = {
672
+ }, xe = {
370
673
  variant: "default",
371
674
  rounded: "none"
372
675
  };
373
- function Ve({
374
- variant: o = Q.variant,
375
- rounded: a,
376
- displayOnlyMode: e = !1,
676
+ function Wt({
677
+ variant: r = xe.variant,
678
+ rounded: o,
679
+ displayOnlyMode: t = !1,
377
680
  errorMessage: n,
378
- successMessage: t,
379
- type: r = "text",
681
+ successMessage: e,
682
+ type: a = "text",
380
683
  className: s,
381
- ...d
684
+ ...i
382
685
  }) {
383
- const u = I(), [l, b] = x(!1);
384
- let i = a;
385
- o === "outline" && !a && (i = "md"), i = i || Q.rounded;
386
- const m = w(
686
+ const d = P(), [f, m] = A(!1);
687
+ let l = o;
688
+ r === "outline" && !o && (l = "md"), l = l || xe.rounded;
689
+ const h = w(
387
690
  "appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",
388
691
  "file:mr-2 file:border-0 file:rounded-md file:px-1.5 file:py-1 file:bg-primary hover:file:bg-primary/85 file:text-sm file:font-medium file:text-foreground file:transition-colors",
389
- !e && he[o],
390
- !e && ge[i],
391
- r === "password" && "pr-10",
392
- !e && "px-2 py-1",
393
- e && "pointer-events-none",
692
+ !t && Qe[r],
693
+ !t && Ze[l],
694
+ a === "password" && "pr-10",
695
+ !t && "px-2 py-1",
696
+ t && "pointer-events-none",
394
697
  s
395
698
  );
396
- return /* @__PURE__ */ E("div", { className: w(e && "cursor-text"), style: { height: d.height, width: d.width }, children: [
397
- /* @__PURE__ */ E("div", { className: w(r === "password" && "relative"), children: [
398
- /* @__PURE__ */ f(
699
+ return /* @__PURE__ */ k("div", { className: w(t && "cursor-text"), style: { height: i.height, width: i.width }, children: [
700
+ /* @__PURE__ */ k("div", { className: w(a === "password" && "relative"), children: [
701
+ /* @__PURE__ */ c(
399
702
  "input",
400
703
  {
401
- ...d,
402
- id: u,
403
- type: r === "password" && l ? "text" : r,
404
- "aria-disabled": d.disabled,
405
- readOnly: e,
406
- "aria-readonly": e || d["aria-readonly"],
704
+ ...i,
705
+ id: d,
706
+ type: a === "password" && f ? "text" : a,
707
+ "aria-disabled": i.disabled,
708
+ readOnly: t,
709
+ "aria-readonly": t || i["aria-readonly"],
407
710
  "data-error": n ? !0 : void 0,
408
- "data-success": t ? !0 : void 0,
409
- className: m
711
+ "data-success": e ? !0 : void 0,
712
+ className: h
410
713
  }
411
714
  ),
412
- r === "password" && /* @__PURE__ */ f(
715
+ a === "password" && /* @__PURE__ */ c(
413
716
  "button",
414
717
  {
415
- onClick: () => b(!l),
718
+ onClick: () => m(!f),
416
719
  className: "absolute inset-y-0 right-0 px-2 hover:cursor-pointer",
417
720
  "aria-label": "Toggle password visibility",
418
- "data-state": l ? "visible" : "hidden",
419
- children: l ? /* @__PURE__ */ f(oe, { size: 20 }) : /* @__PURE__ */ f(ae, { size: 20 })
721
+ "data-state": f ? "visible" : "hidden",
722
+ children: f ? /* @__PURE__ */ c(Le, { size: 20 }) : /* @__PURE__ */ c(Ve, { size: 20 })
420
723
  }
421
724
  )
422
725
  ] }),
423
- !e && /* @__PURE__ */ f(S, { elementId: u, type: "error", message: n }),
424
- !e && /* @__PURE__ */ f(S, { elementId: u, type: "success", message: t })
726
+ !t && /* @__PURE__ */ c(le, { elementId: d, type: "error", message: n }),
727
+ !t && /* @__PURE__ */ c(le, { elementId: d, type: "success", message: e })
425
728
  ] });
426
729
  }
427
- function Ge({
428
- display: o = "inline",
429
- width: a = "fit-content",
430
- className: e = "",
730
+ function Bt({
731
+ display: r = "inline",
732
+ width: o = "fit-content",
733
+ className: t = "",
431
734
  required: n,
432
- helpMessage: t,
433
- suffix: r,
735
+ helpMessage: e,
736
+ suffix: a,
434
737
  htmlFor: s,
435
- children: d,
436
- ...u
738
+ children: i,
739
+ description: d,
740
+ ...f
437
741
  }) {
438
- const l = I(), b = w("font-medium", o, e), i = t ? `${s ?? l}-help` : void 0;
439
- return /* @__PURE__ */ E("div", { style: { display: o === "inline" ? "inline-flex" : "flex", width: a }, className: "relative", children: [
440
- /* @__PURE__ */ E("label", { className: b, htmlFor: s, ...u, children: [
441
- d,
442
- n && /* @__PURE__ */ f("span", { className: "text-red-500 font-medium ml-1", "aria-label": "required", children: "*" })
443
- ] }),
444
- t && /* @__PURE__ */ f(
445
- "span",
446
- {
447
- className: "text-gray-500 ml-1 size-fit -translate-y-1/3",
448
- "aria-describedby": i,
449
- "aria-label": "Help information",
450
- title: t,
451
- children: /* @__PURE__ */ f(se, {})
452
- }
453
- ),
454
- t && /* @__PURE__ */ f("div", { id: i, className: "sr-only", children: t }),
455
- r && /* @__PURE__ */ f("span", { className: "ml-1", children: r })
456
- ] });
742
+ var v, p;
743
+ const m = P(), l = (((v = e == null ? void 0 : e.trim()) == null ? void 0 : v.length) || 0) > 0, b = (((p = d == null ? void 0 : d.trim()) == null ? void 0 : p.length) || 0) > 0, u = l ? `${s ?? m}-help` : void 0, h = b ? `${s ?? m}-description` : void 0;
744
+ return /* @__PURE__ */ k(
745
+ "div",
746
+ {
747
+ style: { display: r === "inline" ? "inline-block" : "block", width: o },
748
+ className: w("mb-0.5", t),
749
+ children: [
750
+ /* @__PURE__ */ k("div", { className: "relative flex", children: [
751
+ /* @__PURE__ */ k("label", { className: "font-medium", htmlFor: s, ...f, children: [
752
+ i,
753
+ n && /* @__PURE__ */ c("span", { className: "text-red-500 font-medium ml-1", "aria-label": "required", children: "*" })
754
+ ] }),
755
+ l && /* @__PURE__ */ c(
756
+ "span",
757
+ {
758
+ className: "text-gray-500 ml-1 size-fit -translate-y-1/3",
759
+ "aria-describedby": u,
760
+ "aria-label": "Help information",
761
+ title: e,
762
+ children: /* @__PURE__ */ c(We, {})
763
+ }
764
+ ),
765
+ l && /* @__PURE__ */ c("div", { id: u, className: "sr-only", children: e }),
766
+ a && /* @__PURE__ */ c("span", { className: "ml-1", children: a })
767
+ ] }),
768
+ b && /* @__PURE__ */ c("small", { id: h, className: "block opacity-80 mt-0.5", role: "note", children: d })
769
+ ]
770
+ }
771
+ );
457
772
  }
458
- function pe(o) {
459
- const [a, e] = x(!1), [n, t] = x(!1);
460
- return C(() => {
461
- o ? (t(!0), setTimeout(() => e(!0), 10)) : (e(!1), setTimeout(() => t(!1), 150));
462
- }, [o]), { show: a, shouldRender: n };
773
+ function Je(r) {
774
+ const [o, t] = A(!1), [n, e] = A(!1);
775
+ return z(() => {
776
+ r ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 150));
777
+ }, [r]), { show: o, shouldRender: n };
463
778
  }
464
- function ve(o, a) {
465
- C(() => {
466
- const e = (n) => {
467
- n.key === "Escape" && o && a();
779
+ function Ye(r, o) {
780
+ z(() => {
781
+ const t = (n) => {
782
+ n.key === "Escape" && r && o();
468
783
  };
469
- return document.addEventListener("keydown", e), o && (document.body.style.overflow = "hidden"), () => {
470
- document.removeEventListener("keydown", e), document.body.style.overflow = "auto";
784
+ return document.addEventListener("keydown", t), r && (document.body.style.overflow = "hidden"), () => {
785
+ document.removeEventListener("keydown", t), document.body.style.overflow = "auto";
471
786
  };
472
- }, [o, a]);
787
+ }, [r, o]);
473
788
  }
474
- function we(o, a) {
475
- const e = j(null), n = A(() => {
476
- const t = document.getElementById(o);
477
- if (!t) return;
478
- const r = t.querySelectorAll('[data-modal-action="true"]');
479
- if (r.length > 0) {
480
- r[0].focus();
789
+ function Oe(r, o) {
790
+ const t = B(null), n = C(() => {
791
+ const e = document.getElementById(r);
792
+ if (!e) return;
793
+ const a = e.querySelectorAll('[data-modal-action="true"]');
794
+ if (a.length > 0) {
795
+ a[0].focus();
481
796
  return;
482
797
  }
483
- const s = t.querySelectorAll(
798
+ const s = e.querySelectorAll(
484
799
  'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
485
800
  );
486
801
  if (s.length > 0) {
487
- const d = Array.from(s).filter((u) => !(u instanceof HTMLButtonElement && u.getAttribute("data-modal-close-button") === "true"));
488
- if (d.length > 0) {
489
- d[0].focus();
802
+ const i = Array.from(s).filter((d) => !(d instanceof HTMLButtonElement && d.getAttribute("data-modal-close-button") === "true"));
803
+ if (i.length > 0) {
804
+ i[0].focus();
490
805
  return;
491
806
  }
492
807
  s[0].focus();
493
808
  return;
494
809
  }
495
- t.focus();
496
- }, [o]);
497
- C(() => (a && (e.current = document.activeElement, n()), () => {
498
- document.body.style.overflow = "auto", e.current instanceof HTMLElement && e.current.focus();
499
- }), [a, n]);
810
+ e.focus();
811
+ }, [r]);
812
+ z(() => (o && (t.current = document.activeElement, n()), () => {
813
+ document.body.style.overflow = "auto", t.current instanceof HTMLElement && t.current.focus();
814
+ }), [o, n]);
500
815
  }
501
- function We({
502
- id: o,
503
- isOpen: a,
504
- onClose: e,
816
+ function Ht({
817
+ id: r,
818
+ isOpen: o,
819
+ onClose: t,
505
820
  title: n,
506
- children: t,
507
- contentOnly: r = !1,
821
+ children: e,
822
+ contentOnly: a = !1,
508
823
  className: s,
509
- overlayClassName: d,
510
- hideCloseButton: u = !1,
511
- actions: l = [],
512
- disableCloseOnOverlayClick: b = !1,
513
- ariaLabelledBy: i,
514
- ariaDescribedBy: v
824
+ overlayClassName: i,
825
+ hideCloseButton: d = !1,
826
+ actions: f = [],
827
+ disableCloseOnOverlayClick: m = !1,
828
+ ariaLabelledBy: l,
829
+ ariaDescribedBy: b
515
830
  }) {
516
- const c = I(), m = o || `modal-${c}`, p = o ? `${o}-title` : `modal-title-${c}`, { show: h, shouldRender: y } = pe(a);
517
- if (we(m, y), ve(y, e), !y) return null;
518
- const g = () => n ? z.isValidElement(n) ? /* @__PURE__ */ f("div", { className: "mb-4", children: n }) : /* @__PURE__ */ f("h2", { className: "mb-4 text-xl font-semibold", id: p, children: n }) : null, N = () => l.length === 0 ? null : /* @__PURE__ */ f("div", { className: "mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3", children: l.map((D, $) => {
519
- const { label: F, className: L, ...R } = D;
520
- return /* @__PURE__ */ f(me, { className: L, type: "button", ...R, "data-modal-action": "true", children: F }, $);
831
+ const u = P(), h = r || `modal-${u}`, v = r ? `${r}-title` : `modal-title-${u}`, { show: p, shouldRender: y } = Je(o);
832
+ if (Oe(h, y), Ye(y, t), !y) return null;
833
+ const g = () => n ? G.isValidElement(n) ? /* @__PURE__ */ c("div", { className: "mb-4", children: n }) : /* @__PURE__ */ c("h2", { className: "mb-4 text-xl font-semibold", id: v, children: n }) : null, x = () => f.length === 0 ? null : /* @__PURE__ */ c("div", { className: "mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3", children: f.map((N, E) => {
834
+ const { label: S, className: I, ...$ } = N;
835
+ return /* @__PURE__ */ c(qe, { className: I, type: "button", ...$, "data-modal-action": "true", children: S }, E);
521
836
  }) });
522
- return /* @__PURE__ */ f(J, { children: M(
523
- /* @__PURE__ */ f(
837
+ return /* @__PURE__ */ c(ne, { children: pe(
838
+ /* @__PURE__ */ c(
524
839
  "div",
525
840
  {
526
- "aria-labelledby": i ?? n ? p : void 0,
527
- "aria-describedby": v,
841
+ "aria-labelledby": l ?? n ? v : void 0,
842
+ "aria-describedby": b,
528
843
  role: "dialog",
529
844
  "aria-modal": "true",
530
845
  className: "fixed inset-0 z-[100] overflow-y-auto",
531
- children: /* @__PURE__ */ E("div", { className: "flex min-h-screen items-center justify-center p-4", children: [
532
- /* @__PURE__ */ f(
846
+ children: /* @__PURE__ */ k("div", { className: "flex min-h-screen items-center justify-center p-4", children: [
847
+ /* @__PURE__ */ c(
533
848
  "div",
534
849
  {
535
- className: q("fixed inset-0 bg-black/20 transition-all", d),
850
+ className: V("fixed inset-0 bg-black/20 transition-all", i),
536
851
  onClick: () => {
537
- b || e();
852
+ m || t();
538
853
  }
539
854
  }
540
855
  ),
541
- r && /* @__PURE__ */ f("div", { className: q("relative w-fit", s), children: t }),
542
- !r && /* @__PURE__ */ E(
856
+ a && /* @__PURE__ */ c("div", { className: V("relative w-fit", s), children: e }),
857
+ !a && /* @__PURE__ */ k(
543
858
  "div",
544
859
  {
545
- id: m,
860
+ id: h,
546
861
  tabIndex: -1,
547
- className: q(
548
- "relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:ring ease-in duration-75",
549
- h ? "opacity-100 scale-100" : "opacity-0 scale-90",
862
+ className: V(
863
+ "relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75",
864
+ p ? "opacity-100 scale-100" : "opacity-0 scale-90",
550
865
  s
551
866
  ),
552
867
  children: [
553
- !u && /* @__PURE__ */ f(
868
+ !d && /* @__PURE__ */ c(
554
869
  "button",
555
870
  {
556
871
  type: "button",
557
- onClick: e,
872
+ onClick: t,
558
873
  "data-modal-close-button": "true",
559
874
  className: "rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",
560
- children: /* @__PURE__ */ f(le, { size: 18 })
875
+ children: /* @__PURE__ */ c(ve, { size: 18 })
561
876
  }
562
877
  ),
563
878
  g(),
564
- t,
565
- N()
879
+ e,
880
+ x()
566
881
  ]
567
882
  }
568
883
  )
@@ -572,104 +887,364 @@ function We({
572
887
  document.body
573
888
  ) });
574
889
  }
575
- function ye({ itemId: o, checked: a, onChange: e, name: n, disabled: t = !1, className: r = "" }) {
576
- const s = "relative inline-flex items-center justify-center rounded-full", d = () => {
577
- t || e();
578
- }, u = w(
890
+ const et = {
891
+ link: "text-primary hover:text-primary-foreground hover:bg-primary/10 aria-current:text-primary-foreground aria-current:bg-primary",
892
+ outline: "border border-primary text-primary hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground aria-current:border-primary",
893
+ filled: "bg-secondary text-secondary-foreground hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground"
894
+ }, tt = {
895
+ sm: "px-2 py-1 text-sm min-w-[32px] min-h-8",
896
+ md: "px-2 py-1 text-base min-w-[40px] min-h-10"
897
+ };
898
+ function jt({
899
+ page: r,
900
+ pageCount: o = 5,
901
+ maxVisiblePages: t = 5,
902
+ showFirstLast: n = !0,
903
+ onPageChange: e,
904
+ size: a = "md",
905
+ variant: s = "link",
906
+ className: i,
907
+ ref: d,
908
+ buttonsClassName: f,
909
+ ...m
910
+ }) {
911
+ const l = o === 1 / 0, u = C(() => {
912
+ if (l) return [];
913
+ const N = o, E = Math.min(t, N);
914
+ if (N <= E)
915
+ return Array.from({ length: N }, (M, L) => L + 1);
916
+ const S = Math.floor(E / 2);
917
+ let I = Math.max(1, r - S), $ = Math.min(N, I + E - 1);
918
+ return $ - I + 1 < E && (I = Math.max(1, $ - E + 1), $ = Math.min(N, I + E - 1)), Array.from({ length: $ - I + 1 }, (M, L) => I + L);
919
+ }, [l, t, r, o])(), h = r > 1, v = l || r < o, p = n && !l, y = n && !l, g = (N) => {
920
+ N >= 1 && (l || N <= o) && e(N);
921
+ }, x = C(() => {
922
+ const N = V(
923
+ "flex items-center justify-center min-w-fit",
924
+ "disabled:opacity-50 disabled:cursor-not-allowed",
925
+ tt[a],
926
+ "rounded-md"
927
+ );
928
+ return V(N, et[s], f);
929
+ }, [s, a, f]);
930
+ return /* @__PURE__ */ k(
931
+ "nav",
932
+ {
933
+ ref: d,
934
+ className: V("flex items-center justify-center gap-1", i),
935
+ role: "navigation",
936
+ "aria-label": "Pagination",
937
+ "data-page": r,
938
+ "data-page-count": l ? "infinite" : o,
939
+ ...m,
940
+ children: [
941
+ p && /* @__PURE__ */ k(
942
+ "button",
943
+ {
944
+ onClick: () => g(1),
945
+ className: x(),
946
+ disabled: r === 1,
947
+ "aria-label": "Go to first page",
948
+ children: [
949
+ /* @__PURE__ */ c(Be, { size: a === "sm" ? 12 : 15 }),
950
+ /* @__PURE__ */ c("span", { className: "ml-1", children: "First" })
951
+ ]
952
+ }
953
+ ),
954
+ /* @__PURE__ */ k(
955
+ "button",
956
+ {
957
+ onClick: () => g(r - 1),
958
+ className: x(),
959
+ disabled: !h,
960
+ "aria-label": "Go to previous page",
961
+ children: [
962
+ /* @__PURE__ */ c(Ie, { size: a === "sm" ? 12 : 15 }),
963
+ /* @__PURE__ */ c("span", { className: "ml-1", children: "Previous" })
964
+ ]
965
+ }
966
+ ),
967
+ !l && u.map((N) => /* @__PURE__ */ c(
968
+ "button",
969
+ {
970
+ onClick: () => g(N),
971
+ className: V(x(), "aspect-square"),
972
+ "aria-label": `Go to page ${N}`,
973
+ "aria-current": N === r ? !0 : void 0,
974
+ children: N
975
+ },
976
+ N
977
+ )),
978
+ /* @__PURE__ */ k(
979
+ "button",
980
+ {
981
+ onClick: () => g(r + 1),
982
+ className: x(),
983
+ disabled: !v,
984
+ "aria-label": "Go to next page",
985
+ children: [
986
+ /* @__PURE__ */ c("span", { className: "mr-1", children: "Next" }),
987
+ /* @__PURE__ */ c(Ce, { size: a === "sm" ? 12 : 15 })
988
+ ]
989
+ }
990
+ ),
991
+ y && /* @__PURE__ */ k(
992
+ "button",
993
+ {
994
+ onClick: () => g(o),
995
+ className: x(),
996
+ disabled: r === o,
997
+ "aria-label": "Go to last page",
998
+ children: [
999
+ /* @__PURE__ */ c("span", { className: "mr-1", children: "Last" }),
1000
+ /* @__PURE__ */ c(He, { size: a === "sm" ? 12 : 15 })
1001
+ ]
1002
+ }
1003
+ )
1004
+ ]
1005
+ }
1006
+ );
1007
+ }
1008
+ function rt(r) {
1009
+ const [o, t] = A(!1), [n, e] = A(!1);
1010
+ return z(() => {
1011
+ r ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 300));
1012
+ }, [r]), { show: o, shouldRender: n };
1013
+ }
1014
+ function nt(r, o) {
1015
+ z(() => {
1016
+ const t = (n) => {
1017
+ n.key === "Escape" && r && o();
1018
+ };
1019
+ return document.addEventListener("keydown", t), r && (document.body.style.overflow = "hidden"), () => {
1020
+ document.removeEventListener("keydown", t), document.body.style.overflow = "auto";
1021
+ };
1022
+ }, [r, o]);
1023
+ }
1024
+ function at(r, o) {
1025
+ const t = B(null), n = C(() => {
1026
+ const e = document.getElementById(r);
1027
+ if (!e) return;
1028
+ const a = e.querySelectorAll('[data-panel-action="true"]');
1029
+ if (a.length > 0) {
1030
+ a[0].focus();
1031
+ return;
1032
+ }
1033
+ const s = e.querySelectorAll(
1034
+ 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
1035
+ );
1036
+ if (s.length > 0) {
1037
+ const i = Array.from(s).filter((d) => !(d instanceof HTMLButtonElement && d.getAttribute("data-panel-close-button") === "true"));
1038
+ if (i.length > 0) {
1039
+ i[0].focus();
1040
+ return;
1041
+ }
1042
+ s[0].focus();
1043
+ return;
1044
+ }
1045
+ e.focus();
1046
+ }, [r]);
1047
+ z(() => (o && (t.current = document.activeElement, n()), () => {
1048
+ document.body.style.overflow = "auto", t.current instanceof HTMLElement && t.current.focus();
1049
+ }), [o, n]);
1050
+ }
1051
+ const ot = {
1052
+ size: {
1053
+ sm: "max-w-sm",
1054
+ md: "max-w-md",
1055
+ lg: "max-w-lg",
1056
+ xl: "max-w-xl",
1057
+ "2xl": "max-w-2xl",
1058
+ full: "w-full",
1059
+ screen: "w-screen"
1060
+ }
1061
+ };
1062
+ function Ft({
1063
+ ref: r,
1064
+ id: o,
1065
+ isOpen: t,
1066
+ onClose: n,
1067
+ title: e,
1068
+ children: a,
1069
+ footer: s,
1070
+ size: i = "md",
1071
+ className: d,
1072
+ overlayClassName: f,
1073
+ hideCloseButton: m = !1,
1074
+ disableCloseOnOverlayClick: l = !1,
1075
+ ariaLabelledBy: b,
1076
+ ariaDescribedBy: u
1077
+ }) {
1078
+ const h = P(), v = o || `panel-${h}`, p = o ? `${o}-title` : `panel-title-${h}`, { show: y, shouldRender: g } = rt(t);
1079
+ if (at(v, g), nt(g, n), !g) return null;
1080
+ const x = () => e ? G.isValidElement(e) ? /* @__PURE__ */ c("div", { children: e }) : /* @__PURE__ */ c("h2", { className: "text-2xl font-semibold", id: p, children: e }) : null, N = () => {
1081
+ if (!s) return null;
1082
+ if (G.isValidElement(s)) {
1083
+ const E = s, S = E.props.className || "";
1084
+ return G.cloneElement(E, { className: V("px-6 py-4", S) });
1085
+ }
1086
+ return /* @__PURE__ */ c("div", { className: "px-6 py-4", children: s });
1087
+ };
1088
+ return /* @__PURE__ */ c(ne, { children: pe(
1089
+ /* @__PURE__ */ k(
1090
+ "div",
1091
+ {
1092
+ "aria-labelledby": b ?? e ? p : void 0,
1093
+ "aria-describedby": u,
1094
+ role: "dialog",
1095
+ "aria-modal": "true",
1096
+ className: "fixed inset-0 z-[100] overflow-hidden",
1097
+ "data-panel-open": t,
1098
+ children: [
1099
+ /* @__PURE__ */ c(
1100
+ "div",
1101
+ {
1102
+ className: V(
1103
+ "fixed inset-0 bg-black/40 transition-opacity duration-300",
1104
+ y ? "opacity-100" : "opacity-0",
1105
+ f
1106
+ ),
1107
+ onClick: () => {
1108
+ l || n();
1109
+ }
1110
+ }
1111
+ ),
1112
+ /* @__PURE__ */ c("div", { className: "fixed inset-y-0 right-0 flex max-w-full", children: /* @__PURE__ */ c(
1113
+ "div",
1114
+ {
1115
+ id: v,
1116
+ ref: r,
1117
+ tabIndex: -1,
1118
+ className: V(
1119
+ "relative h-full transform shadow-xl bg-popover transition-transform duration-300 ease-in-out",
1120
+ i !== "screen" && "border-l border-border",
1121
+ ot.size[i],
1122
+ y ? "translate-x-0" : "translate-x-full",
1123
+ d
1124
+ ),
1125
+ "data-panel-size": i,
1126
+ children: /* @__PURE__ */ k("div", { className: "flex h-full flex-col", children: [
1127
+ e && /* @__PURE__ */ c("div", { className: "px-6 pt-6", children: x() }),
1128
+ !m && /* @__PURE__ */ c(
1129
+ "button",
1130
+ {
1131
+ type: "button",
1132
+ onClick: n,
1133
+ "data-panel-close-button": "true",
1134
+ "aria-label": "Close panel",
1135
+ className: "rounded-md p-0.5 top-3 right-3 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",
1136
+ children: /* @__PURE__ */ c(ve, { size: 18 })
1137
+ }
1138
+ ),
1139
+ /* @__PURE__ */ c("div", { className: V("flex-1 overflow-y-auto px-6 pb-6", e ? "pt-6" : "pt-10"), children: a }),
1140
+ N()
1141
+ ] })
1142
+ }
1143
+ ) })
1144
+ ]
1145
+ }
1146
+ ),
1147
+ document.body
1148
+ ) });
1149
+ }
1150
+ function st({ itemId: r, checked: o, onChange: t, name: n, disabled: e = !1, className: a = "" }) {
1151
+ const s = "relative inline-flex items-center justify-center rounded-full", i = () => {
1152
+ e || t();
1153
+ }, d = w(
579
1154
  s,
580
- !a && "hover:border-current/60",
581
- !t && "border-current cursor-pointer",
582
- t && "border-muted/60 cursor-not-allowed",
583
- r
1155
+ !o && "hover:border-current/60",
1156
+ !e && "border-current cursor-pointer",
1157
+ e && "border-muted/60 cursor-not-allowed",
1158
+ a
584
1159
  );
585
- return /* @__PURE__ */ f(
1160
+ return /* @__PURE__ */ c(
586
1161
  "div",
587
1162
  {
588
- id: o,
1163
+ id: r,
589
1164
  role: "radio",
590
1165
  tabIndex: -1,
591
- "aria-checked": a,
592
- "aria-disabled": t,
1166
+ "aria-checked": o,
1167
+ "aria-disabled": e,
593
1168
  "aria-description": `Radio button for ${n}`,
594
- "aria-labelledby": `${o}-label`,
595
- onClick: d,
596
- className: u,
1169
+ "aria-labelledby": `${r}-label`,
1170
+ onClick: i,
1171
+ className: d,
597
1172
  style: {
598
1173
  width: "1em",
599
1174
  height: "1em",
600
1175
  padding: "0.1em",
601
1176
  borderWidth: "0.06em"
602
1177
  },
603
- children: a && /* @__PURE__ */ f(
1178
+ children: o && /* @__PURE__ */ c(
604
1179
  "div",
605
1180
  {
606
- className: w("size-full aspect-square rounded-full", t && "bg-muted/60", !t && "bg-current")
1181
+ className: w("size-full aspect-square rounded-full", e && "bg-muted/60", !e && "bg-current")
607
1182
  }
608
1183
  )
609
1184
  }
610
1185
  );
611
1186
  }
612
- function G({
613
- value: o,
614
- children: a,
615
- className: e = "",
1187
+ function be({
1188
+ value: r,
1189
+ children: o,
1190
+ className: t = "",
616
1191
  isSelected: n = !1,
617
- onChange: t,
618
- disabled: r = !1,
1192
+ onChange: e,
1193
+ disabled: a = !1,
619
1194
  hideInput: s = !1,
620
- description: d,
621
- name: u
1195
+ description: i,
1196
+ name: d
622
1197
  }) {
623
- const b = `radio-${I()}-${o}`, i = () => {
624
- r || t == null || t(o);
1198
+ const m = `radio-${P()}-${r}`, l = () => {
1199
+ a || e == null || e(r);
625
1200
  };
626
- return /* @__PURE__ */ E(
1201
+ return /* @__PURE__ */ k(
627
1202
  "div",
628
1203
  {
629
- title: d,
1204
+ title: i,
630
1205
  className: w(
631
1206
  "relative flex items-center",
632
- e,
1207
+ t,
633
1208
  // Uses text color for borders
634
- s && `p-2 border-2 focus-within:border-dashed focus-within:${r ? "border-current/50" : "border-current/80"}`,
635
- s && !n && `border-transparent ${r ? "" : "not-focus-within:hover:border-border/60"}`,
1209
+ s && `p-2 border-2 focus-within:border-dashed focus-within:${a ? "border-current/50" : "border-current/80"}`,
1210
+ s && !n && `border-transparent ${a ? "" : "not-focus-within:hover:border-border/60"}`,
636
1211
  s && n && "border-border",
637
- r && "opacity-60 cursor-not-allowed"
1212
+ a && "opacity-60 cursor-not-allowed"
638
1213
  ),
639
1214
  style: {
640
1215
  gap: "0.5em"
641
1216
  },
642
1217
  children: [
643
- !s && /* @__PURE__ */ f(
644
- ye,
1218
+ !s && /* @__PURE__ */ c(
1219
+ st,
645
1220
  {
646
- itemId: b,
647
- name: u || "",
1221
+ itemId: m,
1222
+ name: d || "",
648
1223
  checked: n,
649
- onChange: i,
650
- disabled: r,
1224
+ onChange: l,
1225
+ disabled: a,
651
1226
  className: w(s && "")
652
1227
  }
653
1228
  ),
654
- /* @__PURE__ */ f(
1229
+ /* @__PURE__ */ c(
655
1230
  "div",
656
1231
  {
657
- id: s ? b : void 0,
1232
+ id: s ? m : void 0,
658
1233
  tabIndex: s ? -1 : void 0,
659
1234
  role: s ? "radio" : void 0,
660
- onClick: s ? i : void 0,
1235
+ onClick: s ? l : void 0,
661
1236
  "aria-checked": s ? n ? "true" : "false" : void 0,
662
- "aria-disabled": s ? r : void 0,
663
- "aria-description": s ? d || `Radio button for ${u}` : void 0,
664
- "aria-labelledby": s ? `${b}-label` : void 0,
665
- className: w(s && "size-full", typeof a == "object" && "grow focus:outline-none"),
666
- children: /* @__PURE__ */ f(
1237
+ "aria-disabled": s ? a : void 0,
1238
+ "aria-description": s ? i || `Radio button for ${d}` : void 0,
1239
+ "aria-labelledby": s ? `${m}-label` : void 0,
1240
+ className: w(s && "size-full", typeof o == "object" && "grow focus:outline-none"),
1241
+ children: /* @__PURE__ */ c(
667
1242
  "label",
668
1243
  {
669
- id: `${b}-label`,
670
- onClick: s ? void 0 : i,
671
- className: w(r && "cursor-not-allowed", !r && "cursor-pointer"),
672
- children: a
1244
+ id: `${m}-label`,
1245
+ onClick: s ? void 0 : l,
1246
+ className: w(a && "cursor-not-allowed", !a && "cursor-pointer"),
1247
+ children: o
673
1248
  }
674
1249
  )
675
1250
  }
@@ -678,246 +1253,1092 @@ function G({
678
1253
  }
679
1254
  );
680
1255
  }
681
- function xe(o, a) {
682
- const [e, n] = x(a), [t, r] = x(-1), [s, d] = x(!1), u = A((c, m) => {
1256
+ function it(r, o) {
1257
+ const [t, n] = A(o), [e, a] = A(-1), [s, i] = A(!1), d = C((u, h) => {
683
1258
  var y;
684
- const p = c[m];
685
- p.hasAttribute("disabled") || p.getAttribute("aria-disabled") === "true" || ((y = c[m]) == null || y.click(), r(m));
686
- }, []), l = A(
687
- (c, m) => {
688
- var h;
689
- if (c.preventDefault(), s || !m.length) return;
690
- const p = a !== -1 ? a : 0;
691
- (h = m[p]) == null || h.focus(), n(p), a !== -1 && u(m, p);
1259
+ const v = u[h];
1260
+ v.hasAttribute("disabled") || v.getAttribute("aria-disabled") === "true" || ((y = u[h]) == null || y.click(), a(h));
1261
+ }, []), f = C(
1262
+ (u, h) => {
1263
+ var p;
1264
+ if (u.preventDefault(), s || !h.length) return;
1265
+ const v = o !== -1 ? o : 0;
1266
+ (p = h[v]) == null || p.focus(), n(v), o !== -1 && d(h, v);
692
1267
  },
693
- [a, s, u]
694
- ), b = A(
695
- (c) => {
1268
+ [o, s, d]
1269
+ ), m = C(
1270
+ (u) => {
696
1271
  var y;
697
- if (!c.shiftKey)
1272
+ if (!u.shiftKey)
698
1273
  return;
699
- c.preventDefault();
700
- const m = Array.from(
1274
+ u.preventDefault();
1275
+ const h = Array.from(
701
1276
  document.querySelectorAll(
702
1277
  'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
703
1278
  )
704
- ).filter((g) => !g.hasAttribute("disabled") && g.tabIndex >= 0), p = m.findIndex((g) => g.id === o), h = p > 0 ? p - 1 : m.length - 1;
705
- (y = m[h]) == null || y.focus();
1279
+ ).filter((g) => !g.hasAttribute("disabled") && g.tabIndex >= 0), v = h.findIndex((g) => g.id === r), p = v > 0 ? v - 1 : h.length - 1;
1280
+ (y = h[p]) == null || y.focus();
706
1281
  },
707
- [o]
708
- ), i = A(
709
- (c, m) => {
710
- var N;
711
- if (!m.length) return;
712
- const p = c.target;
713
- if (!m.some((D) => D.id === p.id)) return;
714
- const y = e !== -1 ? e : 0;
1282
+ [r]
1283
+ ), l = C(
1284
+ (u, h) => {
1285
+ var x;
1286
+ if (!h.length) return;
1287
+ const v = u.target;
1288
+ if (!h.some((N) => N.id === v.id)) return;
1289
+ const y = t !== -1 ? t : 0;
715
1290
  let g = y;
716
- switch (c.key) {
1291
+ switch (u.key) {
717
1292
  case "ArrowUp":
718
1293
  case "ArrowLeft":
719
- c.preventDefault(), g = y > 0 ? y - 1 : m.length - 1;
1294
+ u.preventDefault(), g = y > 0 ? y - 1 : h.length - 1;
720
1295
  break;
721
1296
  case "ArrowDown":
722
1297
  case "ArrowRight":
723
- c.preventDefault(), g = (y + 1) % m.length;
1298
+ u.preventDefault(), g = (y + 1) % h.length;
724
1299
  break;
725
1300
  // Select the option when the space key is pressed
726
1301
  case " ":
727
- c.preventDefault(), u(m, y);
1302
+ u.preventDefault(), d(h, y);
728
1303
  return;
729
1304
  case "Tab":
730
- b(c);
1305
+ m(u);
731
1306
  return;
732
1307
  default:
733
1308
  return;
734
1309
  }
735
- (N = m[g]) == null || N.focus(), n(g), t !== -1 && u(m, g);
1310
+ (x = h[g]) == null || x.focus(), n(g), e !== -1 && d(h, g);
736
1311
  },
737
- [e, t, b, u]
738
- ), v = A(() => {
739
- const c = document.querySelector(`[id="${o}"][role="radiogroup"]`);
740
- return c ? Array.from(c.querySelectorAll('[role="radio"]')) : [];
741
- }, [o]);
742
- C(() => {
743
- const c = document.querySelector(`[id="${o}"][role="radiogroup"]`);
744
- if (!c) return;
745
- const m = v(), p = (N) => l(N, m), h = (N) => i(N, m), y = () => d(!0), g = () => d(!1);
746
- return document.addEventListener("keydown", h), c.addEventListener("focus", p), c.addEventListener("mousedown", y), document.addEventListener("mouseup", g), () => {
747
- document.removeEventListener("keydown", h), c.removeEventListener("focus", p), c.removeEventListener("mousedown", y), document.removeEventListener("mouseup", g);
1312
+ [t, e, m, d]
1313
+ ), b = C(() => {
1314
+ const u = document.querySelector(`[id="${r}"][role="radiogroup"]`);
1315
+ return u ? Array.from(u.querySelectorAll('[role="radio"]')) : [];
1316
+ }, [r]);
1317
+ z(() => {
1318
+ const u = document.querySelector(`[id="${r}"][role="radiogroup"]`);
1319
+ if (!u) return;
1320
+ const h = b(), v = (x) => f(x, h), p = (x) => l(x, h), y = () => i(!0), g = () => i(!1);
1321
+ return document.addEventListener("keydown", p), u.addEventListener("focus", v), u.addEventListener("mousedown", y), document.addEventListener("mouseup", g), () => {
1322
+ document.removeEventListener("keydown", p), u.removeEventListener("focus", v), u.removeEventListener("mousedown", y), document.removeEventListener("mouseup", g);
748
1323
  };
749
- }, [o, v, l, i]);
1324
+ }, [r, b, f, l]);
750
1325
  }
751
- function Ue({
752
- options: o = [],
753
- value: a,
754
- onChange: e,
1326
+ function Mt({
1327
+ options: r = [],
1328
+ value: o,
1329
+ onChange: t,
755
1330
  id: n,
756
- children: t,
757
- className: r = "",
1331
+ children: e,
1332
+ className: a = "",
758
1333
  childrenClassName: s = "",
759
- hideInputs: d = !1
1334
+ hideInputs: i = !1
760
1335
  }) {
761
- const u = I(), l = n || `radio-group-${u}`;
762
- xe(
763
- l,
764
- o.findIndex((i) => i === a)
1336
+ const d = P(), f = n || `radio-group-${d}`;
1337
+ it(
1338
+ f,
1339
+ r.findIndex((l) => l === o)
765
1340
  );
766
- const b = W(() => o.reduce((i, v) => (typeof v == "string" ? i.some((c) => c.value === v) || i.push({ label: v, value: v }) : i.push(v), i), []), [o]);
767
- return /* @__PURE__ */ E("div", { id: l, role: "radiogroup", tabIndex: 0, className: w(r, "focus:outline-none"), children: [
768
- b.length > 0 && b.map((i, v) => /* @__PURE__ */ f(
769
- G,
1341
+ const m = J(() => r.reduce((l, b) => (typeof b == "string" ? l.some((u) => u.value === b) || l.push({ label: b, value: b }) : l.push(b), l), []), [r]);
1342
+ return /* @__PURE__ */ k("div", { id: f, role: "radiogroup", tabIndex: 0, className: w(a, "focus:outline-none"), children: [
1343
+ m.length > 0 && m.map((l, b) => /* @__PURE__ */ c(
1344
+ be,
770
1345
  {
771
- value: i.value,
772
- isSelected: a === i.value,
773
- onChange: e,
774
- name: l,
775
- disabled: i.disabled,
776
- description: i.description,
777
- hideInput: d,
1346
+ value: l.value,
1347
+ isSelected: o === l.value,
1348
+ onChange: t,
1349
+ name: f,
1350
+ disabled: l.disabled,
1351
+ description: l.description,
1352
+ hideInput: i,
778
1353
  className: s,
779
- children: i.label
1354
+ children: l.label
780
1355
  },
781
- `${i.value}-${v}`
1356
+ `${l.value}-${b}`
782
1357
  )),
783
- b.length === 0 && t && z.Children.map(t, (i) => z.isValidElement(i) && i.type === G ? /* @__PURE__ */ f(
784
- G,
1358
+ m.length === 0 && e && G.Children.map(e, (l) => G.isValidElement(l) && l.type === be ? /* @__PURE__ */ c(
1359
+ be,
785
1360
  {
786
- ...i.props,
787
- className: w(s, i.props.className),
788
- hideInput: i.props.hideInput || d,
789
- isSelected: a === i.props.value,
790
- onChange: e,
791
- name: l,
792
- children: i.props.children
1361
+ ...l.props,
1362
+ className: w(s, l.props.className),
1363
+ hideInput: l.props.hideInput || i,
1364
+ isSelected: o === l.props.value,
1365
+ onChange: t,
1366
+ name: f,
1367
+ children: l.props.children
793
1368
  }
794
1369
  ) : null)
795
1370
  ] });
796
1371
  }
797
- function _e({ children: o, ref: a, ...e }) {
798
- if (P(o)) {
799
- let n = { ...e };
800
- return o.props && (n = { ...n, ...o.props }), ee(o, {
1372
+ function lt(r) {
1373
+ const o = B(null), t = B(null), n = B(null), [e, a] = A(!1), [s, i] = A(!1), [d, f] = A({
1374
+ vertical: !1,
1375
+ horizontal: !1
1376
+ }), m = B(null), l = B(null), b = C(() => {
1377
+ const v = o.current;
1378
+ if (!v) return;
1379
+ const p = v.scrollHeight > v.clientHeight, y = v.scrollWidth > v.clientWidth;
1380
+ f({
1381
+ vertical: p,
1382
+ horizontal: y
1383
+ });
1384
+ }, []), u = C(() => {
1385
+ const v = o.current, p = t.current, y = n.current;
1386
+ if (v) {
1387
+ if (p && d.vertical) {
1388
+ const x = (d.horizontal ? v.clientHeight - r : v.clientHeight) / v.scrollHeight, N = Math.max(x * 100, 10), E = v.scrollHeight - v.clientHeight, S = E > 0 ? v.scrollTop / E : 0, I = 100 - N, $ = S * I;
1389
+ p.style.height = `${N}%`, p.style.top = `${$}%`, p.style.transform = "none";
1390
+ }
1391
+ if (y && d.horizontal) {
1392
+ const x = (d.vertical ? v.clientWidth - r : v.clientWidth) / v.scrollWidth, N = Math.max(x * 100, 10), E = v.scrollWidth - v.clientWidth, S = E > 0 ? v.scrollLeft / E : 0, I = 100 - N, $ = S * I;
1393
+ y.style.width = `${N}%`, y.style.left = `${$}%`, y.style.transform = "none";
1394
+ }
1395
+ }
1396
+ }, [d, r]), h = C(() => {
1397
+ m.current && clearTimeout(m.current), l.current && clearTimeout(l.current), a(!0), i(!1), u(), m.current = setTimeout(() => {
1398
+ i(!0), l.current = setTimeout(() => {
1399
+ a(!1), i(!1);
1400
+ }, 300);
1401
+ }, 1e3);
1402
+ }, [u]);
1403
+ return z(() => {
1404
+ const v = o.current;
1405
+ if (!v) return;
1406
+ b();
1407
+ const p = new ResizeObserver(b);
1408
+ p.observe(v);
1409
+ const y = new MutationObserver(b);
1410
+ return y.observe(v, {
1411
+ childList: !0,
1412
+ subtree: !0,
1413
+ attributes: !0
1414
+ }), () => {
1415
+ p.disconnect(), y.disconnect();
1416
+ };
1417
+ }, [b]), z(() => {
1418
+ u();
1419
+ }, [d, u]), z(() => () => {
1420
+ m.current && clearTimeout(m.current), l.current && clearTimeout(l.current);
1421
+ }, []), {
1422
+ viewportRef: o,
1423
+ verticalThumbRef: t,
1424
+ horizontalThumbRef: n,
1425
+ isScrolling: e,
1426
+ isFadingOut: s,
1427
+ scrollbarVisible: d,
1428
+ handleScroll: h
1429
+ };
1430
+ }
1431
+ function Gt({
1432
+ className: r,
1433
+ thumbClassName: o,
1434
+ viewportClassName: t,
1435
+ scrollbarClassName: n,
1436
+ scrollbarThickness: e = 10,
1437
+ children: a,
1438
+ id: s,
1439
+ ref: i,
1440
+ ...d
1441
+ }) {
1442
+ const { viewportRef: f, verticalThumbRef: m, horizontalThumbRef: l, isScrolling: b, isFadingOut: u, scrollbarVisible: h, handleScroll: v } = lt(e), p = V(
1443
+ "relative flex-1 rounded-full bg-slate-400/60 hover:bg-slate-400/80 active:bg-slate-400",
1444
+ o
1445
+ );
1446
+ return /* @__PURE__ */ k("div", { ref: i, id: s, className: V("relative overflow-hidden", r), "data-scroll-area-root": "", ...d, children: [
1447
+ /* @__PURE__ */ c(
1448
+ "div",
1449
+ {
1450
+ ref: f,
1451
+ className: V(
1452
+ "h-full w-full overflow-auto rounded-[inherit] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
1453
+ t
1454
+ ),
1455
+ onScroll: v,
1456
+ "data-scroll-area-viewport": "",
1457
+ children: a
1458
+ }
1459
+ ),
1460
+ h.vertical && (b || u) && /* @__PURE__ */ c(
1461
+ "div",
1462
+ {
1463
+ className: V(
1464
+ "touch-none select-none transition-all duration-300",
1465
+ "p-[1px]",
1466
+ "absolute right-0 top-0",
1467
+ u ? "opacity-0" : "opacity-100",
1468
+ n
1469
+ ),
1470
+ "data-scroll-area-scrollbar": "vertical",
1471
+ "data-state": b ? "visible" : "hidden",
1472
+ style: {
1473
+ width: `${e}px`,
1474
+ height: h.horizontal ? `calc(100% - ${e}px)` : "100%"
1475
+ },
1476
+ children: /* @__PURE__ */ c(
1477
+ "div",
1478
+ {
1479
+ ref: m,
1480
+ className: V("absolute rounded-full", p),
1481
+ "data-scroll-area-thumb": "",
1482
+ style: { height: "20%", top: "0%", width: "100%" }
1483
+ }
1484
+ )
1485
+ }
1486
+ ),
1487
+ h.horizontal && (b || u) && /* @__PURE__ */ c(
1488
+ "div",
1489
+ {
1490
+ className: V(
1491
+ "touch-none select-none transition-all duration-300",
1492
+ "p-[1px]",
1493
+ "absolute bottom-0 left-0",
1494
+ u ? "opacity-0" : "opacity-100",
1495
+ n
1496
+ ),
1497
+ "data-scroll-area-scrollbar": "horizontal",
1498
+ "data-state": b ? "visible" : "hidden",
1499
+ style: {
1500
+ height: `${e}px`,
1501
+ width: h.vertical ? `calc(100% - ${e}px)` : "100%"
1502
+ },
1503
+ children: /* @__PURE__ */ c(
1504
+ "div",
1505
+ {
1506
+ ref: l,
1507
+ className: V("absolute rounded-full", p),
1508
+ "data-scroll-area-thumb": "",
1509
+ style: { width: "20%", left: "0%", height: "100%" }
1510
+ }
1511
+ )
1512
+ }
1513
+ ),
1514
+ h.vertical && h.horizontal && /* @__PURE__ */ c(
1515
+ "div",
1516
+ {
1517
+ className: V("bg-transparent", "absolute bottom-0 right-0"),
1518
+ "data-scroll-area-corner": "",
1519
+ style: {
1520
+ height: `${e}px`,
1521
+ width: `${e}px`
1522
+ }
1523
+ }
1524
+ )
1525
+ ] });
1526
+ }
1527
+ function ct(r) {
1528
+ const [o, t] = A(!1), [n, e] = A(!1);
1529
+ return z(() => {
1530
+ r ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 150));
1531
+ }, [r]), { show: o, shouldRender: n };
1532
+ }
1533
+ function dt({
1534
+ isOpen: r,
1535
+ setIsOpen: o,
1536
+ filteredOptions: t,
1537
+ highlightedIndex: n,
1538
+ setHighlightedIndex: e,
1539
+ onSelect: a,
1540
+ triggerRef: s
1541
+ }) {
1542
+ return { handleKeyDown: C(
1543
+ (d) => {
1544
+ var f;
1545
+ switch (d.key) {
1546
+ case "ArrowDown":
1547
+ if (d.preventDefault(), !r)
1548
+ o(!0);
1549
+ else {
1550
+ const m = n < t.length - 1 ? n + 1 : 0;
1551
+ let l = m;
1552
+ for (let b = 0; b < t.length; b++) {
1553
+ const u = (m + b) % t.length;
1554
+ if (!t[u].disabled) {
1555
+ l = u;
1556
+ break;
1557
+ }
1558
+ }
1559
+ e(l);
1560
+ }
1561
+ break;
1562
+ case "ArrowUp":
1563
+ if (d.preventDefault(), !r)
1564
+ o(!0);
1565
+ else {
1566
+ const m = n > 0 ? n - 1 : t.length - 1;
1567
+ let l = m;
1568
+ for (let b = 0; b < t.length; b++) {
1569
+ const u = (m - b + t.length) % t.length;
1570
+ if (!t[u].disabled) {
1571
+ l = u;
1572
+ break;
1573
+ }
1574
+ }
1575
+ e(l);
1576
+ }
1577
+ break;
1578
+ case "Enter":
1579
+ case " ":
1580
+ if (d.preventDefault(), !r)
1581
+ o(!0);
1582
+ else if (n >= 0 && n < t.length) {
1583
+ const m = t[n];
1584
+ m.disabled || a(m);
1585
+ }
1586
+ break;
1587
+ case "Escape":
1588
+ d.preventDefault(), r && (o(!1), (f = s.current) == null || f.focus());
1589
+ break;
1590
+ case "Tab":
1591
+ r && o(!1);
1592
+ break;
1593
+ }
1594
+ },
1595
+ [r, o, t, n, e, a, s]
1596
+ ) };
1597
+ }
1598
+ function ut({
1599
+ isOpen: r,
1600
+ filteredOptions: o,
1601
+ selectedOption: t,
1602
+ shouldRender: n,
1603
+ optionsContainerRef: e
1604
+ }) {
1605
+ const [a, s] = A(-1), i = J(() => t ? o.findIndex((d) => d.value === t.value) : -1, [o, t]);
1606
+ return z(() => {
1607
+ r && o.length > 0 ? s(t && i >= 0 ? i : 0) : s(-1);
1608
+ }, [o, r, t, i]), z(() => {
1609
+ if (a >= 0 && e.current && n) {
1610
+ const d = () => {
1611
+ const f = e.current, m = f == null ? void 0 : f.querySelector(`[data-option-index="${a}"]`);
1612
+ if (m) {
1613
+ const l = r && t && a === i ? "auto" : "smooth";
1614
+ m.scrollIntoView({
1615
+ behavior: l,
1616
+ block: "nearest"
1617
+ });
1618
+ }
1619
+ };
1620
+ r && n && t ? setTimeout(d, 10) : d();
1621
+ }
1622
+ }, [a, n, r, t, o, e, i]), { highlightedIndex: a, setHighlightedIndex: s };
1623
+ }
1624
+ const ye = {
1625
+ sm: {
1626
+ trigger: "px-2 py-1 text-sm",
1627
+ options: "px-2 py-2 text-xs"
1628
+ },
1629
+ md: {
1630
+ trigger: "px-3 py-2 text-base",
1631
+ options: "px-3 py-2.5 text-sm"
1632
+ },
1633
+ lg: {
1634
+ trigger: "px-4 py-3 text-lg",
1635
+ options: "px-4 py-3 text-base"
1636
+ }
1637
+ };
1638
+ function Pt({
1639
+ options: r,
1640
+ value: o,
1641
+ placeholder: t = "Select an option...",
1642
+ searchable: n = !1,
1643
+ disabled: e = !1,
1644
+ clearable: a = !1,
1645
+ size: s = "md",
1646
+ className: i,
1647
+ triggerClassName: d,
1648
+ dropdownClassName: f,
1649
+ id: m,
1650
+ ref: l,
1651
+ onChange: b,
1652
+ onSearch: u,
1653
+ searchPlaceholder: h = "Search options..."
1654
+ }) {
1655
+ const v = P(), y = `${m ?? v}-listbox`, g = (T) => `${y}-option-${T}`, [x, N] = A(!1), [E, S] = A(""), I = B(null), $ = B(null), M = B(null), L = B(null), { show: U, shouldRender: j } = ct(x), D = J(() => !n || !E ? r : r.filter(
1656
+ (T) => {
1657
+ var W;
1658
+ return T.text.toLowerCase().includes(E.toLowerCase()) || ((W = T.description) == null ? void 0 : W.toLowerCase().includes(E.toLowerCase()));
1659
+ }
1660
+ ), [r, n, E]), R = J(() => r.find((T) => T.value === o), [r, o]), { highlightedIndex: H, setHighlightedIndex: K } = ut({
1661
+ isOpen: x,
1662
+ filteredOptions: D,
1663
+ selectedOption: R,
1664
+ shouldRender: j,
1665
+ optionsContainerRef: L
1666
+ }), _ = H >= 0 ? g(H) : void 0;
1667
+ z(() => {
1668
+ x && j && n && $.current && $.current.focus();
1669
+ }, [x, n, j]);
1670
+ const Q = C(
1671
+ (T) => {
1672
+ var W;
1673
+ T.disabled || (b == null || b(T.value), N(!1), S(""), (W = I.current) == null || W.focus());
1674
+ },
1675
+ [b]
1676
+ ), { handleKeyDown: q } = dt({
1677
+ isOpen: x,
1678
+ setIsOpen: N,
1679
+ filteredOptions: D,
1680
+ highlightedIndex: H,
1681
+ setHighlightedIndex: K,
1682
+ onSelect: Q,
1683
+ triggerRef: I
1684
+ });
1685
+ z(() => {
1686
+ if (!x)
1687
+ return;
1688
+ const T = (W) => {
1689
+ var te;
1690
+ M.current && !M.current.contains(W.target) && !((te = I.current) != null && te.contains(W.target)) && (N(!1), S(""));
1691
+ };
1692
+ return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
1693
+ }, [x]);
1694
+ const Y = () => {
1695
+ e || (N(!x), x || (S(""), K(-1)));
1696
+ }, ce = (T) => {
1697
+ T.disabled || (b == null || b(T.value), N(!1), S(""));
1698
+ }, de = (T) => {
1699
+ const W = T.target.value;
1700
+ S(W), u == null || u(W), K(-1);
1701
+ }, ue = (T) => {
1702
+ T.preventDefault(), T.stopPropagation(), b == null || b("");
1703
+ };
1704
+ return /* @__PURE__ */ k(
1705
+ "div",
1706
+ {
1707
+ className: w("relative", i),
1708
+ id: m,
1709
+ ref: l,
1710
+ "data-select": "true",
1711
+ "data-value": o,
1712
+ "data-searchable": n,
1713
+ "data-disabled": e,
1714
+ "data-clearable": a,
1715
+ children: [
1716
+ /* @__PURE__ */ k("div", { className: "relative", children: [
1717
+ /* @__PURE__ */ k(
1718
+ "button",
1719
+ {
1720
+ ref: I,
1721
+ type: "button",
1722
+ className: w(
1723
+ "flex items-center justify-between w-full text-left bg-inherit border border-border rounded-md transition-colors",
1724
+ "hover:border-primary focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary",
1725
+ e && "opacity-50 cursor-not-allowed hover:border-border",
1726
+ x && "border-primary ring-1 ring-primary",
1727
+ ye[s].trigger,
1728
+ d
1729
+ ),
1730
+ onClick: Y,
1731
+ onKeyDown: q,
1732
+ disabled: e,
1733
+ "aria-disabled": e,
1734
+ "aria-haspopup": "listbox",
1735
+ "aria-expanded": x,
1736
+ "aria-controls": x ? y : void 0,
1737
+ "aria-activedescendant": x && !n ? _ : void 0,
1738
+ "aria-label": R ? R.text : t,
1739
+ "data-select-trigger": "true",
1740
+ children: [
1741
+ /* @__PURE__ */ c("span", { className: w("block truncate", !R && "opacity-70"), children: R ? R.text : t }),
1742
+ /* @__PURE__ */ c("div", { className: "flex items-center ml-2", children: /* @__PURE__ */ c(Ae, { size: 16, className: w("transition-transform duration-200", x && "rotate-180") }) })
1743
+ ]
1744
+ }
1745
+ ),
1746
+ a && R && /* @__PURE__ */ c(
1747
+ "button",
1748
+ {
1749
+ type: "button",
1750
+ onClick: ue,
1751
+ className: "absolute right-8 top-1/2 -translate-y-1/2 p-0.5 rounded hover:bg-accent/20 transition-colors group z-10",
1752
+ "aria-label": "Clear selection",
1753
+ "data-select-clear": "true",
1754
+ children: /* @__PURE__ */ c(ve, { size: 14, className: "opacity-70 group-hover:opacity-100 transition-opacity" })
1755
+ }
1756
+ )
1757
+ ] }),
1758
+ j && /* @__PURE__ */ k(
1759
+ "div",
1760
+ {
1761
+ ref: M,
1762
+ className: w(
1763
+ "absolute z-50 w-full mt-1 bg-popover border border-border rounded-md shadow-lg transition-all duration-150",
1764
+ U ? "opacity-100 translate-y-0" : "opacity-0 -translate-y-2",
1765
+ f
1766
+ ),
1767
+ id: y,
1768
+ role: "listbox",
1769
+ "data-select-content": "true",
1770
+ children: [
1771
+ n && /* @__PURE__ */ c("div", { className: "border-b border-border", children: /* @__PURE__ */ c(
1772
+ "input",
1773
+ {
1774
+ ref: $,
1775
+ type: "text",
1776
+ value: E,
1777
+ onChange: de,
1778
+ onKeyDown: q,
1779
+ placeholder: h,
1780
+ className: "w-full px-2 py-2 text-inherit focus:outline-none",
1781
+ "aria-autocomplete": "list",
1782
+ "aria-controls": y,
1783
+ "aria-activedescendant": _,
1784
+ "data-select-search": "true"
1785
+ }
1786
+ ) }),
1787
+ /* @__PURE__ */ c("div", { ref: L, className: "max-h-60 overflow-auto", children: D.length > 0 ? D.map((T, W) => /* @__PURE__ */ k(
1788
+ "div",
1789
+ {
1790
+ id: g(W),
1791
+ className: w(
1792
+ "flex items-center cursor-pointer transition-colors",
1793
+ "hover:bg-accent/10 focus:bg-accent/10",
1794
+ ye[s].options,
1795
+ T.disabled && "opacity-50 cursor-not-allowed",
1796
+ W === H && "bg-accent/20",
1797
+ o === T.value && "bg-accent/30"
1798
+ ),
1799
+ onClick: () => ce(T),
1800
+ role: "option",
1801
+ "aria-selected": o === T.value,
1802
+ "aria-disabled": T.disabled,
1803
+ "data-select-option": "true",
1804
+ "data-value": T.value,
1805
+ "data-highlighted": W === H,
1806
+ "data-option-index": W,
1807
+ children: [
1808
+ /* @__PURE__ */ k("div", { className: "flex-1 min-w-0", children: [
1809
+ /* @__PURE__ */ c("div", { className: "font-medium", children: T.text }),
1810
+ T.description && /* @__PURE__ */ c("div", { className: "text-xs opacity-70 mt-0.5", children: T.description })
1811
+ ] }),
1812
+ o === T.value && /* @__PURE__ */ c(ze, { size: 16, className: "ml-2 text-primary flex-shrink-0" })
1813
+ ]
1814
+ },
1815
+ T.value
1816
+ )) : /* @__PURE__ */ c("div", { className: "px-3 py-2 text-sm opacity-70 text-center", children: n && E ? "No results found" : "No options available" }) })
1817
+ ]
1818
+ }
1819
+ )
1820
+ ]
1821
+ }
1822
+ );
1823
+ }
1824
+ const ft = {
1825
+ thin: {
1826
+ horizontal: "h-px",
1827
+ vertical: "w-px"
1828
+ },
1829
+ medium: {
1830
+ horizontal: "h-0.5",
1831
+ vertical: "w-0.5"
1832
+ },
1833
+ thick: {
1834
+ horizontal: "h-1",
1835
+ vertical: "w-1"
1836
+ },
1837
+ "extra-thick": {
1838
+ horizontal: "h-2",
1839
+ vertical: "w-2"
1840
+ }
1841
+ }, mt = {
1842
+ horizontal: "w-full",
1843
+ vertical: "min-h-4 h-full"
1844
+ };
1845
+ function Kt({
1846
+ orientation: r = "horizontal",
1847
+ decorative: o = !1,
1848
+ thickness: t = "thin",
1849
+ className: n,
1850
+ ...e
1851
+ }) {
1852
+ const a = w(
1853
+ "shrink-0 bg-border",
1854
+ mt[r],
1855
+ ft[t][r],
1856
+ n
1857
+ );
1858
+ return /* @__PURE__ */ c(
1859
+ "div",
1860
+ {
1861
+ ...e,
1862
+ className: a,
1863
+ role: o ? "presentation" : "separator",
1864
+ "aria-orientation": o ? void 0 : r,
1865
+ "aria-hidden": o,
1866
+ "data-orientation": r,
1867
+ "data-thickness": t
1868
+ }
1869
+ );
1870
+ }
1871
+ const we = {
1872
+ shape: {
1873
+ rectangle: "rounded-md min-h-1",
1874
+ circle: "rounded-full aspect-square min-h-1",
1875
+ text: "rounded-sm min-h-1 h-4"
1876
+ },
1877
+ lineSpacing: {
1878
+ xs: "space-y-1",
1879
+ sm: "space-y-2",
1880
+ md: "space-y-3",
1881
+ lg: "space-y-4",
1882
+ xl: "space-y-6"
1883
+ }
1884
+ };
1885
+ function qt({
1886
+ shape: r = "rectangle",
1887
+ lineSpacing: o = "sm",
1888
+ className: t,
1889
+ lines: n = 1,
1890
+ animate: e = !0,
1891
+ ref: a,
1892
+ ...s
1893
+ }) {
1894
+ const i = w("bg-muted/70", e && "animate-pulse", we.shape[r], t);
1895
+ return n > 1 ? /* @__PURE__ */ c(
1896
+ "div",
1897
+ {
1898
+ ref: a,
1899
+ className: we.lineSpacing[o],
1900
+ role: "presentation",
1901
+ "aria-hidden": "true",
1902
+ "data-testid": "skeleton-container",
1903
+ "data-lines": n,
1904
+ "data-shape": r,
1905
+ "data-animate": e,
1906
+ ...s,
1907
+ children: Array.from({ length: n }, (d, f) => /* @__PURE__ */ c(
1908
+ "div",
1909
+ {
1910
+ className: w(
1911
+ i,
1912
+ // Make last line shorter for a more natural text appearance
1913
+ f === n - 1 && "w-3/4"
1914
+ ),
1915
+ role: "presentation",
1916
+ "aria-hidden": "true",
1917
+ "data-testid": "skeleton-line",
1918
+ "data-line-index": f
1919
+ },
1920
+ f
1921
+ ))
1922
+ }
1923
+ ) : /* @__PURE__ */ c(
1924
+ "div",
1925
+ {
1926
+ ref: a,
1927
+ className: i,
1928
+ role: "presentation",
1929
+ "aria-hidden": "true",
1930
+ "data-testid": "skeleton",
1931
+ "data-shape": r,
1932
+ "data-animate": e,
1933
+ ...s
1934
+ }
1935
+ );
1936
+ }
1937
+ function Ut({
1938
+ id: r,
1939
+ value: o,
1940
+ defaultValue: t = 0,
1941
+ onValueChange: n,
1942
+ min: e = 0,
1943
+ max: a = 100,
1944
+ step: s = 1,
1945
+ disabled: i = !1,
1946
+ trackClassName: d,
1947
+ rangeClassName: f,
1948
+ thumbClassName: m,
1949
+ className: l,
1950
+ ref: b,
1951
+ ariaLabel: u,
1952
+ ariaLabelledBy: h,
1953
+ ...v
1954
+ }) {
1955
+ const [p, y] = A(t), g = o !== void 0, x = g ? o : p, N = B(null), E = B(!1), S = B(0), I = C(
1956
+ (D) => {
1957
+ const R = Math.max(e, Math.min(a, D)), H = Math.round(R / s) * s;
1958
+ g || y(H), n == null || n(H);
1959
+ },
1960
+ [e, a, s, g, n]
1961
+ ), $ = C(
1962
+ (D, R = !1) => {
1963
+ var Q;
1964
+ const H = (Q = N.current) == null ? void 0 : Q.getBoundingClientRect();
1965
+ if (!H) return x;
1966
+ let K = D.clientX;
1967
+ R && (K = K - S.current);
1968
+ const _ = Math.max(0, Math.min(1, (K - H.left) / H.width));
1969
+ return e + (a - e) * _;
1970
+ },
1971
+ [e, a, x]
1972
+ ), M = C(
1973
+ (D) => {
1974
+ if (i || D.target !== D.currentTarget) return;
1975
+ const R = $(D);
1976
+ I(R);
1977
+ },
1978
+ [i, $, I]
1979
+ ), L = C(
1980
+ (D) => {
1981
+ var Q;
1982
+ if (i) return;
1983
+ D.stopPropagation(), E.current = !0;
1984
+ const R = (Q = N.current) == null ? void 0 : Q.getBoundingClientRect(), H = D.currentTarget.getBoundingClientRect();
1985
+ if (R && H) {
1986
+ const q = H.left + H.width / 2;
1987
+ S.current = D.clientX - q;
1988
+ }
1989
+ D.currentTarget.setPointerCapture(D.pointerId);
1990
+ const K = (q) => {
1991
+ if (!E.current) return;
1992
+ const Y = $(q, !0);
1993
+ I(Y);
1994
+ }, _ = (q) => {
1995
+ if (q.pointerId === D.pointerId) {
1996
+ E.current = !1, S.current = 0;
1997
+ try {
1998
+ D.currentTarget.releasePointerCapture(q.pointerId);
1999
+ } catch {
2000
+ }
2001
+ document.removeEventListener("pointermove", K), document.removeEventListener("pointerup", _);
2002
+ }
2003
+ };
2004
+ document.addEventListener("pointermove", K), document.addEventListener("pointerup", _);
2005
+ },
2006
+ [i, $, I]
2007
+ ), U = C(
2008
+ (D) => {
2009
+ if (i) return;
2010
+ let R = x;
2011
+ switch (D.key) {
2012
+ case "ArrowRight":
2013
+ case "ArrowUp":
2014
+ R = x + s;
2015
+ break;
2016
+ case "ArrowLeft":
2017
+ case "ArrowDown":
2018
+ R = x - s;
2019
+ break;
2020
+ case "Home":
2021
+ R = e;
2022
+ break;
2023
+ case "End":
2024
+ R = a;
2025
+ break;
2026
+ case "PageUp":
2027
+ R = x + s * 10;
2028
+ break;
2029
+ case "PageDown":
2030
+ R = x - s * 10;
2031
+ break;
2032
+ default:
2033
+ return;
2034
+ }
2035
+ D.preventDefault(), I(R);
2036
+ },
2037
+ [i, x, s, e, a, I]
2038
+ ), j = a === e ? 0 : (x - e) / (a - e) * 100;
2039
+ return /* @__PURE__ */ c(
2040
+ "div",
2041
+ {
2042
+ id: r,
2043
+ ref: b,
2044
+ className: V(
2045
+ "relative flex items-center w-full touch-none select-none",
2046
+ i && "opacity-50 cursor-not-allowed",
2047
+ l
2048
+ ),
2049
+ "data-disabled": i,
2050
+ "data-value": x,
2051
+ "data-min": e,
2052
+ "data-max": a,
2053
+ "data-step": s,
2054
+ ...v,
2055
+ children: /* @__PURE__ */ k(
2056
+ "div",
2057
+ {
2058
+ ref: N,
2059
+ className: V(
2060
+ "relative h-1.5 w-full rounded-full bg-muted cursor-pointer",
2061
+ i && "cursor-not-allowed",
2062
+ d
2063
+ ),
2064
+ onPointerDown: M,
2065
+ children: [
2066
+ /* @__PURE__ */ c(
2067
+ "div",
2068
+ {
2069
+ className: V(
2070
+ "absolute h-full rounded-full pointer-events-none",
2071
+ // pointer-events are disabled so that user interactions are handled by the track element, enabling correct slider behavior
2072
+ !E.current && "transition-all",
2073
+ f
2074
+ ),
2075
+ style: { width: `${j}%` }
2076
+ }
2077
+ ),
2078
+ /* @__PURE__ */ c(
2079
+ "div",
2080
+ {
2081
+ className: V(
2082
+ "absolute size-5 -top-2 rounded-full shadow-md cursor-grab",
2083
+ i && "cursor-not-allowed",
2084
+ !i && "cursor-grab focus:outline-none focus:ring-2",
2085
+ E.current ? "cursor-grabbing scale-110" : "transition-all",
2086
+ m
2087
+ ),
2088
+ style: { left: `calc(${j}% - 10px)` },
2089
+ tabIndex: i ? -1 : 0,
2090
+ role: "slider",
2091
+ "aria-valuemin": e,
2092
+ "aria-valuemax": a,
2093
+ "aria-valuenow": x,
2094
+ "aria-label": u,
2095
+ "aria-labelledby": h,
2096
+ "aria-disabled": i,
2097
+ onKeyDown: U,
2098
+ onPointerDown: L
2099
+ }
2100
+ )
2101
+ ]
2102
+ }
2103
+ )
2104
+ }
2105
+ );
2106
+ }
2107
+ function _t({ children: r, ref: o, ...t }) {
2108
+ if (De(r)) {
2109
+ let n = { ...t };
2110
+ return r.props && (n = { ...n, ...r.props }), Re(r, {
801
2111
  ...n,
802
- ref: (t) => {
803
- typeof a == "function" ? a(t) : a && (a.current = t);
2112
+ ref: (e) => {
2113
+ typeof o == "function" ? o(e) : o && (o.current = e);
804
2114
  }
805
2115
  });
806
2116
  }
807
- return Y("div", { ...e, ref: a }, o);
2117
+ return Te("div", { ...t, ref: o }, r);
808
2118
  }
809
- function Ee({ elementId: o, maxLength: a }) {
810
- const [e, n] = x(0);
811
- return C(() => {
812
- const t = document.getElementById(o);
813
- if (!t)
2119
+ const bt = ({ defaultValue: r, value: o, onValueChange: t } = {}) => {
2120
+ const [n, e] = A(r || ""), a = o !== void 0, s = a ? o : n, i = C((d) => {
2121
+ a || e(d), t == null || t(d);
2122
+ }, [a, t]);
2123
+ return {
2124
+ value: s,
2125
+ onValueChange: i
2126
+ };
2127
+ };
2128
+ function Xt({
2129
+ defaultValue: r,
2130
+ value: o,
2131
+ onValueChange: t,
2132
+ tabsWidth: n = "fit",
2133
+ variant: e = "underline",
2134
+ className: a,
2135
+ children: s,
2136
+ ref: i,
2137
+ id: d,
2138
+ triggersClassName: f,
2139
+ contentClassName: m
2140
+ }) {
2141
+ const { value: l, onValueChange: b } = bt({
2142
+ defaultValue: r,
2143
+ value: o,
2144
+ onValueChange: t
2145
+ }), u = {
2146
+ selectedValue: l,
2147
+ onValueChange: b,
2148
+ tabsWidth: n,
2149
+ variant: e,
2150
+ triggersClassName: f,
2151
+ contentClassName: m
2152
+ };
2153
+ return /* @__PURE__ */ c(je.Provider, { value: u, children: /* @__PURE__ */ c("div", { id: d, ref: i, className: a, "data-tabs-width": n, "data-variant": e, children: s }) });
2154
+ }
2155
+ function Qt({ value: r, className: o, children: t, ref: n }) {
2156
+ const { selectedValue: e, contentClassName: a } = he(), s = e === r;
2157
+ return s ? /* @__PURE__ */ c(
2158
+ "div",
2159
+ {
2160
+ ref: n,
2161
+ role: "tabpanel",
2162
+ id: `tabs-content-${r}`,
2163
+ "aria-labelledby": `tabs-trigger-${r}`,
2164
+ "data-state": s ? "active" : "inactive",
2165
+ "data-value": r,
2166
+ className: w("mt-4 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2", a, o),
2167
+ tabIndex: 0,
2168
+ children: t
2169
+ }
2170
+ ) : null;
2171
+ }
2172
+ const Ne = {
2173
+ width: {
2174
+ fit: "w-fit",
2175
+ full: "w-full *:flex-1"
2176
+ },
2177
+ variant: {
2178
+ underline: "border-b border-border",
2179
+ pills: "",
2180
+ bordered: "border border-border rounded-lg p-1"
2181
+ }
2182
+ }, ht = {
2183
+ underline: "border-b-2 border-transparent data-[state=active]:border-accent data-[state=active]:text-accent hover:text-accent-foreground",
2184
+ pills: "rounded-md data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30",
2185
+ bordered: "rounded data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30"
2186
+ };
2187
+ function Zt({ children: r, className: o, id: t, ref: n }) {
2188
+ const { tabsWidth: e, variant: a } = he();
2189
+ return /* @__PURE__ */ c(
2190
+ "div",
2191
+ {
2192
+ id: t,
2193
+ ref: n,
2194
+ role: "tablist",
2195
+ className: w("flex", Ne.width[e], Ne.variant[a], o),
2196
+ "data-tabs-width": e,
2197
+ "data-variant": a,
2198
+ children: r
2199
+ }
2200
+ );
2201
+ }
2202
+ function Jt({ value: r, disabled: o = !1, className: t, children: n, onClick: e, id: a, ref: s }) {
2203
+ const { selectedValue: i, onValueChange: d, variant: f, triggersClassName: m } = he(), l = i === r, b = (h) => {
2204
+ o || d(r), e == null || e(h);
2205
+ };
2206
+ return /* @__PURE__ */ c(
2207
+ "button",
2208
+ {
2209
+ id: a,
2210
+ ref: s,
2211
+ role: "tab",
2212
+ type: "button",
2213
+ "aria-selected": l,
2214
+ "aria-controls": `tabs-content-${r}`,
2215
+ "data-state": l ? "active" : "inactive",
2216
+ "data-value": r,
2217
+ disabled: o,
2218
+ className: w(
2219
+ "inline-flex items-center justify-center whitespace-nowrap px-3 py-2 text-sm ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
2220
+ l ? "font-medium" : "font-light",
2221
+ ht[f],
2222
+ m,
2223
+ t
2224
+ ),
2225
+ onClick: b,
2226
+ children: n
2227
+ }
2228
+ );
2229
+ }
2230
+ function vt({ elementId: r, maxLength: o }) {
2231
+ const [t, n] = A(0);
2232
+ return z(() => {
2233
+ const e = document.getElementById(r);
2234
+ if (!e)
814
2235
  return;
815
- const r = () => {
816
- const s = t.value.length;
2236
+ const a = () => {
2237
+ const s = e.value.length;
817
2238
  n(s);
818
- const d = s >= a;
819
- t.setAttribute("aria-describedby", `${o}-character-count`), t.setAttribute("aria-invalid", d ? "true" : "false"), d ? t.setAttribute("data-error", "true") : t.removeAttribute("data-error");
2239
+ const i = s >= o;
2240
+ e.setAttribute("aria-describedby", `${r}-character-count`), e.setAttribute("aria-invalid", i ? "true" : "false"), i ? e.setAttribute("data-error", "true") : e.removeAttribute("data-error");
820
2241
  };
821
- return r(), t.addEventListener("input", r), t.setAttribute("maxlength", String(a)), () => {
822
- t.removeEventListener("input", r), t.removeAttribute("maxlength"), t.removeAttribute("aria-describedby"), t.removeAttribute("aria-invalid"), t.removeAttribute("data-error");
2242
+ return a(), e.addEventListener("input", a), e.setAttribute("maxlength", String(o)), () => {
2243
+ e.removeEventListener("input", a), e.removeAttribute("maxlength"), e.removeAttribute("aria-describedby"), e.removeAttribute("aria-invalid"), e.removeAttribute("data-error");
823
2244
  };
824
- }, [o, a]), /* @__PURE__ */ f(
2245
+ }, [r, o]), /* @__PURE__ */ c(
825
2246
  "small",
826
2247
  {
827
2248
  className: w(
828
2249
  "mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",
829
- e >= a && "text-destructive",
830
- e < a && "text-current"
2250
+ t >= o && "text-destructive",
2251
+ t < o && "text-current"
831
2252
  ),
832
2253
  role: "status",
833
- children: /* @__PURE__ */ E("span", { id: `${o}-character-count`, children: [
834
- e,
2254
+ children: /* @__PURE__ */ k("span", { id: `${r}-character-count`, children: [
2255
+ t,
835
2256
  " / ",
836
- a,
2257
+ o,
837
2258
  " characters"
838
2259
  ] })
839
2260
  }
840
2261
  );
841
2262
  }
842
- function Ne(o, a) {
843
- C(() => {
844
- const e = document.getElementById(o);
845
- if (!e)
2263
+ function pt(r, o) {
2264
+ z(() => {
2265
+ const t = document.getElementById(r);
2266
+ if (!t)
846
2267
  return;
847
- if (!a) {
848
- e.style.height = "auto";
2268
+ if (!o) {
2269
+ t.style.height = "auto";
849
2270
  return;
850
2271
  }
851
2272
  const n = () => {
852
- e.style.height = "auto", e.style.height = `${e.scrollHeight}px`;
2273
+ t.style.height = "auto", t.style.height = `${t.scrollHeight}px`;
853
2274
  };
854
- return n(), e.addEventListener("input", n), e.addEventListener("resize", n), window.addEventListener("resize", n), () => {
855
- e.removeEventListener("input", n), e.removeEventListener("resize", n), window.removeEventListener("resize", n);
2275
+ return n(), t.addEventListener("input", n), t.addEventListener("resize", n), window.addEventListener("resize", n), () => {
2276
+ t.removeEventListener("input", n), t.removeEventListener("resize", n), window.removeEventListener("resize", n);
856
2277
  };
857
- }, [o, a]);
2278
+ }, [r, o]);
858
2279
  }
859
- const Ce = {
2280
+ const gt = {
860
2281
  base: "",
861
2282
  "left-line": "border-l border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",
862
2283
  outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"
863
- }, Ae = {
2284
+ }, xt = {
864
2285
  none: "rounded-none",
865
2286
  sm: "rounded-sm",
866
2287
  md: "rounded-md",
867
2288
  lg: "rounded-lg",
868
2289
  full: "px-3 rounded-full"
869
- }, X = {
2290
+ }, Ee = {
870
2291
  variant: "outline",
871
2292
  rounded: "none"
872
2293
  };
873
- function Qe({
874
- variant: o = X.variant,
875
- rounded: a,
876
- displayOnlyMode: e = !1,
2294
+ function Yt({
2295
+ variant: r = Ee.variant,
2296
+ rounded: o,
2297
+ displayOnlyMode: t = !1,
877
2298
  errorMessage: n,
878
- successMessage: t,
879
- hideResizeHandle: r = !1,
2299
+ successMessage: e,
2300
+ hideResizeHandle: a = !1,
880
2301
  autoExpand: s = !1,
881
- characterLimit: d = 0,
882
- className: u,
883
- ...l
2302
+ characterLimit: i = 0,
2303
+ className: d,
2304
+ ...f
884
2305
  }) {
885
- const b = I();
886
- Ne(b, s || e);
887
- let i = a;
888
- o === "outline" && !a && (i = "md"), i = i || X.rounded;
889
- let v = r;
890
- (e || o === "left-line" && !r) && (v = !0);
891
- const m = w(
2306
+ const m = P();
2307
+ pt(m, s || t);
2308
+ let l = o;
2309
+ r === "outline" && !o && (l = "md"), l = l || Ee.rounded;
2310
+ let b = a;
2311
+ (t || r === "left-line" && !a) && (b = !0);
2312
+ const h = w(
892
2313
  "appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",
893
- !e && Ce[o],
894
- !e && Ae[i],
895
- !e && "px-2 py-1",
896
- e && "pointer-events-none",
897
- v && "no-resize-handle",
898
- u
2314
+ !t && gt[r],
2315
+ !t && xt[l],
2316
+ !t && "px-2 py-1",
2317
+ t && "pointer-events-none",
2318
+ b && "no-resize-handle",
2319
+ d
899
2320
  );
900
- return /* @__PURE__ */ E("div", { className: w("-space-y-1.5", e && "cursor-text"), children: [
901
- /* @__PURE__ */ f(
2321
+ return /* @__PURE__ */ k("div", { className: w("-space-y-1.5", t && "cursor-text"), children: [
2322
+ /* @__PURE__ */ c(
902
2323
  "textarea",
903
2324
  {
904
- ...l,
905
- id: b,
906
- "aria-disabled": l.disabled,
907
- readOnly: e,
908
- "aria-readonly": e || l["aria-readonly"],
2325
+ ...f,
2326
+ id: m,
2327
+ "aria-disabled": f.disabled,
2328
+ readOnly: t,
2329
+ "aria-readonly": t || f["aria-readonly"],
909
2330
  style: {
910
2331
  resize: s ? "none" : void 0
911
2332
  },
912
- className: m
2333
+ className: h
913
2334
  }
914
2335
  ),
915
- d > 0 && /* @__PURE__ */ f(Ee, { elementId: b, maxLength: d }),
916
- !e && /* @__PURE__ */ f(S, { elementId: b, type: "error", message: n }),
917
- !e && /* @__PURE__ */ f(S, { elementId: b, type: "success", message: t })
2336
+ i > 0 && /* @__PURE__ */ c(vt, { elementId: m, maxLength: i }),
2337
+ !t && /* @__PURE__ */ c(le, { elementId: m, type: "error", message: n }),
2338
+ !t && /* @__PURE__ */ c(le, { elementId: m, type: "success", message: e })
918
2339
  ] });
919
2340
  }
920
- const Ie = {
2341
+ const yt = {
921
2342
  sm: {
922
2343
  container: "h-5 min-w-9 w-9",
923
2344
  thumb: "h-4 w-4",
@@ -933,7 +2354,7 @@ const Ie = {
933
2354
  thumb: "h-6 w-6",
934
2355
  translate: "translate-x-6"
935
2356
  }
936
- }, $e = {
2357
+ }, wt = {
937
2358
  default: {
938
2359
  unchecked: "bg-muted",
939
2360
  checked: "bg-primary"
@@ -946,275 +2367,275 @@ const Ie = {
946
2367
  unchecked: "bg-muted",
947
2368
  checked: "bg-destructive"
948
2369
  }
949
- }, Z = {
2370
+ }, ke = {
950
2371
  variant: "default",
951
2372
  size: "md"
952
2373
  };
953
- function Xe({
954
- ref: o,
955
- id: a,
956
- size: e = Z.size,
957
- variant: n = Z.variant,
958
- checked: t,
959
- onCheckedChange: r,
2374
+ function Ot({
2375
+ ref: r,
2376
+ id: o,
2377
+ size: t = ke.size,
2378
+ variant: n = ke.variant,
2379
+ checked: e,
2380
+ onCheckedChange: a,
960
2381
  disabled: s = !1,
961
- className: d,
962
- thumbClassName: u,
963
- backgroundClassNames: l,
964
- ...b
2382
+ className: i,
2383
+ thumbClassName: d,
2384
+ backgroundClassNames: f,
2385
+ ...m
965
2386
  }) {
966
- const i = I(), v = W(() => a || `toggle-${i}`, [a, i]), [c, m] = x(t);
967
- C(() => {
968
- m(t);
969
- }, [t]);
970
- const p = () => {
2387
+ const l = P(), b = J(() => o || `toggle-${l}`, [o, l]), [u, h] = A(e);
2388
+ z(() => {
2389
+ h(e);
2390
+ }, [e]);
2391
+ const v = () => {
971
2392
  if (!s) {
972
- const $ = !c;
973
- t === void 0 && m($), r == null || r($);
2393
+ const E = !u;
2394
+ e === void 0 && h(E), a == null || a(E);
974
2395
  }
975
- }, h = ($) => {
976
- ($.key === " " || $.key === "Enter") && ($.preventDefault(), p());
977
- }, y = Ie[e], g = $e[n], N = w(
2396
+ }, p = (E) => {
2397
+ (E.key === " " || E.key === "Enter") && (E.preventDefault(), v());
2398
+ }, y = yt[t], g = wt[n], x = w(
978
2399
  // Base styles
979
2400
  "relative inline-flex items-center rounded-full transition-all duration-200 ease-in-out",
980
2401
  "focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
981
2402
  // Size
982
2403
  y.container,
983
2404
  // Variant and state
984
- c ? (l == null ? void 0 : l.checked) || g.checked : (l == null ? void 0 : l.unchecked) || g.unchecked,
2405
+ u ? (f == null ? void 0 : f.checked) || g.checked : (f == null ? void 0 : f.unchecked) || g.unchecked,
985
2406
  // Disabled state
986
2407
  s && "opacity-50 cursor-not-allowed",
987
2408
  !s && "cursor-pointer",
988
- d
989
- ), D = w(
2409
+ i
2410
+ ), N = w(
990
2411
  // Base thumb styles
991
2412
  "absolute left-0.5 top-1/2 -translate-y-1/2 rounded-full bg-white shadow-sm transition-transform duration-200 ease-in-out",
992
2413
  // Size
993
2414
  y.thumb,
994
2415
  // Position based on state
995
- c && y.translate,
996
- u
2416
+ u && y.translate,
2417
+ d
997
2418
  );
998
- return /* @__PURE__ */ E(
2419
+ return /* @__PURE__ */ k(
999
2420
  "button",
1000
2421
  {
1001
- ref: o,
1002
- id: v,
2422
+ ref: r,
2423
+ id: b,
1003
2424
  type: "button",
1004
2425
  role: "switch",
1005
2426
  tabIndex: 0,
1006
- "aria-checked": c,
2427
+ "aria-checked": u,
1007
2428
  "aria-disabled": s,
1008
2429
  disabled: s,
1009
- onClick: p,
1010
- onKeyDown: h,
1011
- className: N,
1012
- ...b,
2430
+ onClick: v,
2431
+ onKeyDown: p,
2432
+ className: x,
2433
+ ...m,
1013
2434
  children: [
1014
- /* @__PURE__ */ f("span", { className: D }),
1015
- /* @__PURE__ */ f("span", { className: "sr-only", children: c ? "Enabled" : "Disabled" })
2435
+ /* @__PURE__ */ c("span", { className: N }),
2436
+ /* @__PURE__ */ c("span", { className: "sr-only", children: u ? "Enabled" : "Disabled" })
1016
2437
  ]
1017
2438
  }
1018
2439
  );
1019
2440
  }
1020
- const k = 8, B = 4, T = 6;
1021
- function Te(o) {
1022
- return { calculatePosition: A(
1023
- (e, n) => {
1024
- const t = e.getBoundingClientRect(), r = n.getBoundingClientRect(), s = {
2441
+ const se = 8, ie = 4, X = 6;
2442
+ function Nt(r) {
2443
+ return { calculatePosition: C(
2444
+ (t, n) => {
2445
+ const e = t.getBoundingClientRect(), a = n.getBoundingClientRect(), s = {
1025
2446
  width: window.innerWidth,
1026
2447
  height: window.innerHeight
1027
- }, d = (v, c, m, p) => v < 0 || c < 0 || v + m > s.width || c + p > s.height, u = {
2448
+ }, i = (b, u, h, v) => b < 0 || u < 0 || b + h > s.width || u + v > s.height, d = {
1028
2449
  top: {
1029
- x: t.left + t.width / 2 - r.width / 2,
1030
- y: t.top - r.height - B,
2450
+ x: e.left + e.width / 2 - a.width / 2,
2451
+ y: e.top - a.height - ie,
1031
2452
  arrow: {
1032
- x: r.width / 2 - T,
1033
- y: r.height
2453
+ x: a.width / 2 - X,
2454
+ y: a.height
1034
2455
  }
1035
2456
  },
1036
2457
  bottom: {
1037
- x: t.left + t.width / 2 - r.width / 2,
1038
- y: t.bottom + B,
2458
+ x: e.left + e.width / 2 - a.width / 2,
2459
+ y: e.bottom + ie,
1039
2460
  arrow: {
1040
- x: r.width / 2 - T,
2461
+ x: a.width / 2 - X,
1041
2462
  y: -6
1042
2463
  }
1043
2464
  },
1044
2465
  left: {
1045
- x: t.left - r.width - B,
1046
- y: t.top + t.height / 2 - r.height / 2,
2466
+ x: e.left - a.width - ie,
2467
+ y: e.top + e.height / 2 - a.height / 2,
1047
2468
  arrow: {
1048
- x: r.width,
1049
- y: r.height / 2 - T
2469
+ x: a.width,
2470
+ y: a.height / 2 - X
1050
2471
  }
1051
2472
  },
1052
2473
  right: {
1053
- x: t.right + B,
1054
- y: t.top + t.height / 2 - r.height / 2,
2474
+ x: e.right + ie,
2475
+ y: e.top + e.height / 2 - a.height / 2,
1055
2476
  arrow: {
1056
2477
  x: -6,
1057
- y: r.height / 2 - T
2478
+ y: a.height / 2 - X
1058
2479
  }
1059
2480
  }
1060
2481
  };
1061
- let l = o, b = u[o];
1062
- if (d(b.x, b.y, r.width, r.height)) {
1063
- const v = {
2482
+ let f = r, m = d[r];
2483
+ if (i(m.x, m.y, a.width, a.height)) {
2484
+ const b = {
1064
2485
  top: "bottom",
1065
2486
  bottom: "top",
1066
2487
  left: "right",
1067
2488
  right: "left"
1068
- }, c = u[v[o]];
1069
- if (!d(c.x, c.y, r.width, r.height))
1070
- l = v[o], b = c;
2489
+ }, u = d[b[r]];
2490
+ if (!i(u.x, u.y, a.width, a.height))
2491
+ f = b[r], m = u;
1071
2492
  else {
1072
- const m = ["top", "bottom", "left", "right"].filter(
1073
- (p) => p !== o && p !== v[o]
2493
+ const h = ["top", "bottom", "left", "right"].filter(
2494
+ (v) => v !== r && v !== b[r]
1074
2495
  );
1075
- for (const p of m) {
1076
- const h = u[p];
1077
- if (!d(h.x, h.y, r.width, r.height)) {
1078
- l = p, b = h;
2496
+ for (const v of h) {
2497
+ const p = d[v];
2498
+ if (!i(p.x, p.y, a.width, a.height)) {
2499
+ f = v, m = p;
1079
2500
  break;
1080
2501
  }
1081
2502
  }
1082
2503
  }
1083
2504
  }
1084
- b.x = Math.max(
1085
- k,
1086
- Math.min(b.x, s.width - r.width - k)
1087
- ), b.y = Math.max(
1088
- k,
1089
- Math.min(b.y, s.height - r.height - k)
2505
+ m.x = Math.max(
2506
+ se,
2507
+ Math.min(m.x, s.width - a.width - se)
2508
+ ), m.y = Math.max(
2509
+ se,
2510
+ Math.min(m.y, s.height - a.height - se)
1090
2511
  );
1091
- const i = {
1092
- x: t.left + t.width / 2,
1093
- y: t.top + t.height / 2
2512
+ const l = {
2513
+ x: e.left + e.width / 2,
2514
+ y: e.top + e.height / 2
1094
2515
  };
1095
- return l === "top" || l === "bottom" ? b.arrow.x = Math.max(
1096
- T,
1097
- Math.min(i.x - b.x - T, r.width - T * 2)
1098
- ) : b.arrow.y = Math.max(
1099
- T,
1100
- Math.min(i.y - b.y - T, r.height - T * 2)
2516
+ return f === "top" || f === "bottom" ? m.arrow.x = Math.max(
2517
+ X,
2518
+ Math.min(l.x - m.x - X, a.width - X * 2)
2519
+ ) : m.arrow.y = Math.max(
2520
+ X,
2521
+ Math.min(l.y - m.y - X, a.height - X * 2)
1101
2522
  ), {
1102
- ...b,
1103
- placement: l
2523
+ ...m,
2524
+ placement: f
1104
2525
  };
1105
2526
  },
1106
- [o]
2527
+ [r]
1107
2528
  ) };
1108
2529
  }
1109
- function De(o, a, e) {
1110
- const n = j(null), t = j(null), r = A(() => {
1111
- if (!n.current || !t.current) return;
1112
- const s = o(n.current, t.current);
1113
- e(s);
1114
- }, [o, e]);
1115
- return C(() => {
1116
- if (!a) return;
1117
- const s = () => r();
2530
+ function Et(r, o, t) {
2531
+ const n = B(null), e = B(null), a = C(() => {
2532
+ if (!n.current || !e.current) return;
2533
+ const s = r(n.current, e.current);
2534
+ t(s);
2535
+ }, [r, t]);
2536
+ return z(() => {
2537
+ if (!o) return;
2538
+ const s = () => a();
1118
2539
  return window.addEventListener("resize", s), () => {
1119
2540
  window.removeEventListener("resize", s);
1120
2541
  };
1121
- }, [a, r]), {
2542
+ }, [o, a]), {
1122
2543
  triggerRef: n,
1123
- tooltipRef: t,
1124
- updatePosition: r
2544
+ tooltipRef: e,
2545
+ updatePosition: a
1125
2546
  };
1126
2547
  }
1127
- function ze(o, a, e, n, t, r, s, d, u) {
1128
- const l = j(null), b = A(() => {
1129
- o || (l.current && clearTimeout(l.current), l.current = window.setTimeout(() => {
1130
- e(!0), requestAnimationFrame(() => {
1131
- t(), n(!0);
2548
+ function kt(r, o, t, n, e, a, s, i, d) {
2549
+ const f = B(null), m = C(() => {
2550
+ r || (f.current && clearTimeout(f.current), f.current = window.setTimeout(() => {
2551
+ t(!0), requestAnimationFrame(() => {
2552
+ e(), n(!0);
1132
2553
  });
1133
- }, a));
1134
- }, [o, a, e, t, n]), i = A(
1135
- (v = !1) => {
1136
- if (l.current && clearTimeout(l.current), v) {
1137
- n(!1), setTimeout(() => e(!1), 150);
2554
+ }, o));
2555
+ }, [r, o, t, e, n]), l = C(
2556
+ (b = !1) => {
2557
+ if (f.current && clearTimeout(f.current), b) {
2558
+ n(!1), setTimeout(() => t(!1), 150);
1138
2559
  return;
1139
2560
  }
1140
- l.current = window.setTimeout(() => {
1141
- n(!1), setTimeout(() => e(!1), 150);
2561
+ f.current = window.setTimeout(() => {
2562
+ n(!1), setTimeout(() => t(!1), 150);
1142
2563
  }, 100);
1143
2564
  },
1144
- [n, e]
2565
+ [n, t]
1145
2566
  );
1146
- return C(() => {
1147
- !r && !s && !d && u && i();
1148
- }, [r, s, d, u, i]), C(() => () => {
1149
- l.current && clearTimeout(l.current);
2567
+ return z(() => {
2568
+ !a && !s && !i && d && l();
2569
+ }, [a, s, i, d, l]), z(() => () => {
2570
+ f.current && clearTimeout(f.current);
1150
2571
  }, []), {
1151
- showTooltip: b,
1152
- hideTooltip: i,
1153
- timeoutRef: l
2572
+ showTooltip: m,
2573
+ hideTooltip: l,
2574
+ timeoutRef: f
1154
2575
  };
1155
2576
  }
1156
- function Ze({
1157
- id: o,
1158
- children: a,
1159
- message: e,
2577
+ function er({
2578
+ id: r,
2579
+ children: o,
2580
+ message: t,
1160
2581
  placement: n = "top",
1161
- disabled: t = !1,
1162
- delay: r = 200,
2582
+ disabled: e = !1,
2583
+ delay: a = 200,
1163
2584
  className: s
1164
2585
  }) {
1165
- const [d, u] = x(!1), [l, b] = x(!1), [i, v] = x(null), [c, m] = x(!1), [p, h] = x(!1), [y, g] = x(!1), { calculatePosition: N } = Te(n), { triggerRef: D, tooltipRef: $, updatePosition: F } = De(N, l, v), { showTooltip: L, hideTooltip: R, timeoutRef: U } = ze(
1166
- t,
1167
- r,
1168
- b,
2586
+ const [i, d] = A(!1), [f, m] = A(!1), [l, b] = A(null), [u, h] = A(!1), [v, p] = A(!1), [y, g] = A(!1), { calculatePosition: x } = Nt(n), { triggerRef: N, tooltipRef: E, updatePosition: S } = Et(x, f, b), { showTooltip: I, hideTooltip: $, timeoutRef: M } = kt(
2587
+ e,
2588
+ a,
2589
+ m,
2590
+ d,
2591
+ S,
1169
2592
  u,
1170
- F,
1171
- c,
1172
- p,
2593
+ v,
1173
2594
  y,
1174
- d
1175
- ), O = I(), _ = o ?? O;
1176
- return /* @__PURE__ */ E(J, { children: [
1177
- z.cloneElement(a, {
1178
- ref: (H) => {
1179
- D.current = H;
2595
+ i
2596
+ ), L = P(), U = r ?? L;
2597
+ return /* @__PURE__ */ k(ne, { children: [
2598
+ G.cloneElement(o, {
2599
+ ref: (j) => {
2600
+ N.current = j;
1180
2601
  },
1181
2602
  onMouseEnter: () => {
1182
- m(!0), L();
2603
+ h(!0), I();
1183
2604
  },
1184
2605
  onMouseLeave: () => {
1185
- m(!1);
2606
+ h(!1);
1186
2607
  },
1187
2608
  onFocus: () => {
1188
- g(!0), L();
2609
+ g(!0), I();
1189
2610
  },
1190
2611
  onBlur: () => {
1191
- g(!1), R(!0);
2612
+ g(!1), $(!0);
1192
2613
  },
1193
- onKeyDown: (H) => {
1194
- H.key === "Escape" && R(!0);
2614
+ onKeyDown: (j) => {
2615
+ j.key === "Escape" && $(!0);
1195
2616
  },
1196
- "aria-describedby": t ? void 0 : _
2617
+ "aria-describedby": e ? void 0 : U
1197
2618
  }),
1198
- l && M(
1199
- /* @__PURE__ */ f(
2619
+ f && pe(
2620
+ /* @__PURE__ */ c(
1200
2621
  "div",
1201
2622
  {
1202
- ref: $,
1203
- id: _,
2623
+ ref: E,
2624
+ id: U,
1204
2625
  role: "tooltip",
1205
2626
  className: w(
1206
- "fixed z-50 px-2 py-1 text-sm rounded shadow-lg pointer-events-auto transition-all duration-150 ease-out",
1207
- d ? "opacity-100" : "opacity-0",
2627
+ "fixed z-50 px-2 py-1 text-sm rounded shadow-lg bg-popover pointer-events-auto transition-all duration-150 ease-out",
2628
+ i ? "opacity-100" : "opacity-0",
1208
2629
  s
1209
2630
  ),
1210
- style: i ? { left: i.x, top: i.y } : { opacity: 0 },
2631
+ style: l ? { left: l.x, top: l.y } : { opacity: 0 },
1211
2632
  onMouseEnter: () => {
1212
- h(!0), U.current && clearTimeout(U.current);
2633
+ p(!0), M.current && clearTimeout(M.current);
1213
2634
  },
1214
2635
  onMouseLeave: () => {
1215
- h(!1);
2636
+ p(!1);
1216
2637
  },
1217
- children: e
2638
+ children: t
1218
2639
  }
1219
2640
  ),
1220
2641
  document.body
@@ -1222,23 +2643,35 @@ function Ze({
1222
2643
  ] });
1223
2644
  }
1224
2645
  export {
1225
- He as Accordion,
1226
- K as AccordionItem,
1227
- Me as ActionModal,
1228
- me as Button,
1229
- de as ButtonLoadingDots,
1230
- qe as Checkbox,
1231
- Ke as Clickable,
1232
- Ve as Input,
1233
- Ge as Label,
1234
- We as Modal,
1235
- Ue as RadioGroup,
1236
- G as RadioGroupItem,
1237
- ye as RadioInput,
1238
- _e as Slot,
1239
- Qe as Textarea,
1240
- Oe as Toast,
1241
- Xe as Toggle,
1242
- Ze as Tooltip
2646
+ Rt as Accordion,
2647
+ fe as AccordionItem,
2648
+ nr as ActionModal,
2649
+ qe as Button,
2650
+ Me as ButtonLoadingDots,
2651
+ St as Carousel,
2652
+ Lt as Checkbox,
2653
+ Vt as Clickable,
2654
+ Wt as Input,
2655
+ Bt as Label,
2656
+ Ht as Modal,
2657
+ jt as Pagination,
2658
+ Ft as Panel,
2659
+ Mt as RadioGroup,
2660
+ be as RadioGroupItem,
2661
+ st as RadioInput,
2662
+ Gt as ScrollArea,
2663
+ Pt as Select,
2664
+ Kt as Separator,
2665
+ qt as Skeleton,
2666
+ Ut as Slider,
2667
+ _t as Slot,
2668
+ Xt as Tabs,
2669
+ Qt as TabsContent,
2670
+ Zt as TabsList,
2671
+ Jt as TabsTrigger,
2672
+ Yt as Textarea,
2673
+ ar as Toast,
2674
+ Ot as Toggle,
2675
+ er as Tooltip
1243
2676
  };
1244
2677
  //# sourceMappingURL=components.esm.js.map