@moondreamsdev/dreamer-ui 1.7.7-test.3 → 1.7.7-test.5

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.
@@ -1,97 +1,97 @@
1
- import { jsxs as E, jsx as u, 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";
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 H } from "./Toast-vensJgtx.js";
6
- import { A as tt, T as rt } from "./Toast-vensJgtx.js";
7
- import { E as ie, X as le } from "./X-CIoyLewf.js";
8
- import { createPortal as M } from "react-dom";
1
+ import { jsxs as E, jsx as c, Fragment as W } from "react/jsx-runtime";
2
+ import D, { useId as $, useState as x, createElement as Y, useEffect as A, useCallback as I, useMemo as U, useRef as R, isValidElement as ee, cloneElement as te } from "react";
3
+ import { join as y } from "./utils.esm.js";
4
+ import { b as re, C as ne, a as oe, c as ae, E as se, Q as ie } from "./QuestionMarkCircled-BVBF3skB.js";
5
+ import { n as k } from "./Toast-C84BREWE.js";
6
+ import { A as at, T as st } from "./Toast-C84BREWE.js";
7
+ import { E as le, X as P } from "./X-CIoyLewf.js";
8
+ import { createPortal as _ } from "react-dom";
9
9
  function q({
10
10
  id: o,
11
11
  title: a,
12
- content: e,
13
- children: n,
14
- className: t = "",
15
- disabled: r = !1,
12
+ content: t,
13
+ children: r,
14
+ className: e = "",
15
+ disabled: n = !1,
16
16
  isOpen: s = !1,
17
- onToggle: d,
18
- triggerClassName: c = "",
19
- bodyClassName: l = ""
17
+ onToggle: l,
18
+ triggerClassName: u = "",
19
+ bodyClassName: d = ""
20
20
  }) {
21
- const b = I(), i = o || `accordion-item-${b}`, v = `${i}-header`, f = `${i}-panel`, m = () => {
22
- !r && d && d();
21
+ const b = $(), i = o || `accordion-item-${b}`, v = `${i}-header`, f = `${i}-panel`, m = () => {
22
+ !n && l && l();
23
23
  }, g = (h) => {
24
24
  (h.key === "Enter" || h.key === " ") && (h.preventDefault(), m());
25
25
  };
26
- return /* @__PURE__ */ E("div", { className: w("border-b border-gray-200", r && "opacity-60 cursor-not-allowed", t), children: [
26
+ return /* @__PURE__ */ E("div", { className: y("border-b border-gray-200", n && "opacity-60 cursor-not-allowed", e), children: [
27
27
  /* @__PURE__ */ E(
28
28
  "button",
29
29
  {
30
30
  id: v,
31
31
  type: "button",
32
- className: w(
32
+ className: y(
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
- c
34
+ n ? "cursor-not-allowed" : "hover:bg-gray-50/10 cursor-pointer",
35
+ u
36
36
  ),
37
37
  "aria-expanded": s,
38
38
  "aria-controls": f,
39
- disabled: r,
39
+ disabled: n,
40
40
  onClick: m,
41
41
  onKeyDown: g,
42
42
  children: [
43
- /* @__PURE__ */ u("span", { children: a }),
44
- /* @__PURE__ */ u(
43
+ /* @__PURE__ */ c("span", { children: a }),
44
+ /* @__PURE__ */ c(
45
45
  "span",
46
46
  {
47
- className: w(
47
+ className: y(
48
48
  "transform transition-transform duration-300 ease-linear",
49
49
  s ? "rotate-180" : "rotate-0"
50
50
  ),
51
51
  "aria-hidden": "true",
52
- children: /* @__PURE__ */ u(te, { size: 18 })
52
+ children: /* @__PURE__ */ c(re, { size: 18 })
53
53
  }
54
54
  )
55
55
  ]
56
56
  }
57
57
  ),
58
- /* @__PURE__ */ u(
58
+ /* @__PURE__ */ c(
59
59
  "div",
60
60
  {
61
61
  id: f,
62
62
  role: "region",
63
63
  "aria-labelledby": v,
64
- className: w(
64
+ className: y(
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
+ d
68
68
  ),
69
- children: s && (n || e)
69
+ children: s && (r || t)
70
70
  }
71
71
  )
72
72
  ] });
73
73
  }
74
- function Ke({
74
+ function Ue({
75
75
  id: o,
76
76
  items: a = [],
77
- children: e,
78
- className: n = "",
79
- itemClassName: t = "",
80
- allowMultiple: r = !1,
77
+ children: t,
78
+ className: r = "",
79
+ itemClassName: e = "",
80
+ allowMultiple: n = !1,
81
81
  defaultOpenItems: s = [],
82
- triggersClassName: d = "",
83
- bodiesClassName: c = ""
82
+ triggersClassName: l = "",
83
+ bodiesClassName: u = ""
84
84
  }) {
85
- const l = I(), b = o || `accordion-group-${l}`, [i, v] = x(new Set(s)), f = (h) => {
86
- v((y) => {
87
- const p = new Set(y);
88
- return p.has(h) ? p.delete(h) : (r || p.clear(), p.add(h)), p;
85
+ const d = $(), b = o || `accordion-group-${d}`, [i, v] = x(new Set(s)), f = (h) => {
86
+ v((w) => {
87
+ const p = new Set(w);
88
+ return p.has(h) ? p.delete(h) : (n || p.clear(), p.add(h)), p;
89
89
  });
90
- }, m = (h) => `${l}-item-${h}`, g = (h) => i.has(h);
91
- return /* @__PURE__ */ E("div", { id: b, className: n, children: [
92
- a.length > 0 && a.map((h, y) => {
93
- const p = h.id || m(y);
94
- return /* @__PURE__ */ u(
90
+ }, m = (h) => `${d}-item-${h}`, g = (h) => i.has(h);
91
+ return /* @__PURE__ */ E("div", { id: b, className: r, children: [
92
+ a.length > 0 && a.map((h, w) => {
93
+ const p = h.id || m(w);
94
+ return /* @__PURE__ */ c(
95
95
  q,
96
96
  {
97
97
  id: p,
@@ -100,27 +100,27 @@ function Ke({
100
100
  disabled: h.disabled,
101
101
  isOpen: g(p),
102
102
  onToggle: () => f(p),
103
- className: t,
104
- triggerClassName: d,
105
- bodyClassName: c
103
+ className: e,
104
+ triggerClassName: l,
105
+ bodyClassName: u
106
106
  },
107
107
  p
108
108
  );
109
109
  }),
110
- a.length === 0 && e && z.Children.map(e, (h, y) => {
111
- if (z.isValidElement(h) && h.type === q) {
112
- const p = h.props.id || m(y);
110
+ a.length === 0 && t && D.Children.map(t, (h, w) => {
111
+ if (D.isValidElement(h) && h.type === q) {
112
+ const p = h.props.id || m(w);
113
113
  return /* @__PURE__ */ Y(
114
114
  q,
115
115
  {
116
116
  ...h.props,
117
117
  key: p,
118
118
  id: p,
119
- className: w(t, h.props.className),
119
+ className: y(e, h.props.className),
120
120
  isOpen: g(p),
121
121
  onToggle: () => f(p),
122
- triggerClassName: w(d, h.props.triggerClassName),
123
- bodyClassName: w(c, h.props.bodyClassName)
122
+ triggerClassName: y(l, h.props.triggerClassName),
123
+ bodyClassName: y(u, h.props.bodyClassName)
124
124
  }
125
125
  );
126
126
  }
@@ -128,25 +128,25 @@ function Ke({
128
128
  })
129
129
  ] });
130
130
  }
131
- function de() {
131
+ function ce() {
132
132
  const [o, a] = x(0);
133
- return C(() => {
134
- const e = setInterval(() => {
135
- a((n) => (n + 1) % 3);
133
+ return A(() => {
134
+ const t = setInterval(() => {
135
+ a((r) => (r + 1) % 3);
136
136
  }, 500);
137
- return () => clearInterval(e);
138
- }, []), /* @__PURE__ */ u("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((e) => /* @__PURE__ */ u(
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
- className: w(
141
+ className: y(
142
142
  "rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",
143
- o === e && "transform -translate-y-1"
143
+ o === t && "transform -translate-y-1"
144
144
  )
145
145
  },
146
- e
146
+ t
147
147
  )) });
148
148
  }
149
- const ce = {
149
+ const de = {
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",
@@ -176,46 +176,46 @@ const ce = {
176
176
  function me({
177
177
  variant: o = K.variant,
178
178
  size: a,
179
- rounded: e = K.rounded,
180
- loading: n,
181
- linkTo: t,
182
- linkProps: r,
179
+ rounded: t = K.rounded,
180
+ loading: r,
181
+ linkTo: e,
182
+ linkProps: n,
183
183
  type: s = "button",
184
- className: d,
185
- ...c
184
+ className: l,
185
+ ...u
186
186
  }) {
187
- let l;
188
- o === "link" && !a ? l = "fitted" : l = a || K.size;
189
- const i = w(
187
+ let d;
188
+ o === "link" && !a ? d = "fitted" : d = a || K.size;
189
+ const i = y(
190
190
  "appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
191
- ce[o],
192
- ue[l],
193
- fe[e],
194
- n && "relative pointer-events-none",
195
- t && "relative",
196
- d
191
+ de[o],
192
+ ue[d],
193
+ fe[t],
194
+ r && "relative pointer-events-none",
195
+ e && "relative",
196
+ l
197
197
  );
198
198
  return /* @__PURE__ */ E(
199
199
  "button",
200
200
  {
201
- ...c,
202
- role: t ? "link" : c.role,
203
- "aria-label": c["aria-label"] || (r == null ? void 0 : r["aria-label"]),
204
- "aria-description": c["aria-description"] || (r == null ? void 0 : r["aria-description"]),
205
- "aria-disabled": c.disabled || n,
206
- "aria-busy": n,
201
+ ...u,
202
+ role: e ? "link" : u.role,
203
+ "aria-label": u["aria-label"] || (n == null ? void 0 : n["aria-label"]),
204
+ "aria-description": u["aria-description"] || (n == null ? void 0 : n["aria-description"]),
205
+ "aria-disabled": u.disabled || r,
206
+ "aria-busy": r,
207
207
  type: s,
208
208
  className: i,
209
209
  children: [
210
- n && /* @__PURE__ */ u(de, {}),
211
- /* @__PURE__ */ u("span", { className: w(n && "invisible"), children: c.children }),
212
- t && !c.disabled && /* @__PURE__ */ u(
210
+ r && /* @__PURE__ */ c(ce, {}),
211
+ /* @__PURE__ */ c("span", { className: y(r && "invisible"), children: u.children }),
212
+ e && !u.disabled && /* @__PURE__ */ c(
213
213
  "a",
214
214
  {
215
- ...r,
215
+ ...n,
216
216
  "aria-hidden": !0,
217
- href: t,
218
- rel: (r == null ? void 0 : r.rel) || "noreferrer",
217
+ href: e,
218
+ rel: (n == null ? void 0 : n.rel) || "noreferrer",
219
219
  className: "absolute inset-0"
220
220
  }
221
221
  )
@@ -224,51 +224,51 @@ function me({
224
224
  );
225
225
  }
226
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;
227
+ const [a, t] = x(""), r = I((e) => {
228
+ let n = e, s = "";
229
+ for (; n && !s; ) {
230
+ const l = window.getComputedStyle(n).backgroundColor;
231
+ l && l !== "transparent" && l !== "rgba(0, 0, 0, 0)" && (s = l), n = n.parentElement;
232
232
  }
233
233
  return s || "transparent";
234
234
  }, []);
235
- return C(() => {
236
- const t = document.getElementById(o);
237
- if (t) {
238
- const r = n(t.parentElement);
239
- e(r);
235
+ return A(() => {
236
+ const e = document.getElementById(o);
237
+ if (e) {
238
+ const n = r(e.parentElement);
239
+ t(n);
240
240
  }
241
- }, [o, n]), a;
241
+ }, [o, r]), a;
242
242
  }
243
- function Ge({
243
+ function _e({
244
244
  ref: o,
245
245
  id: a,
246
- size: e = 20,
247
- color: n,
248
- filled: t = !1,
249
- rounded: r = !0,
246
+ size: t = 20,
247
+ color: r,
248
+ filled: e = !1,
249
+ rounded: n = !0,
250
250
  checked: s = !1,
251
- onCheckedChange: d,
252
- disabled: c,
253
- className: l = "",
251
+ onCheckedChange: l,
252
+ disabled: u,
253
+ className: d = "",
254
254
  ...b
255
255
  }) {
256
- const i = I(), v = W(() => a || `checkbox-${i}`, [a, i]), f = be(v), [m, g] = x(s);
257
- C(() => {
256
+ const i = $(), v = U(() => a || `checkbox-${i}`, [a, i]), f = be(v), [m, g] = x(s);
257
+ A(() => {
258
258
  g(s);
259
259
  }, [s]);
260
260
  const h = () => {
261
- c || (g(!m), d == null || d(!m));
262
- }, y = (N) => {
261
+ u || (g(!m), l == null || l(!m));
262
+ }, w = (N) => {
263
263
  N.key === " " && (N.preventDefault(), h());
264
- }, p = w(
264
+ }, p = y(
265
265
  "flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2",
266
- r && "rounded",
267
- c && "opacity-40 cursor-not-allowed",
268
- !c && "cursor-pointer",
269
- l
266
+ n && "rounded",
267
+ u && "opacity-40 cursor-not-allowed",
268
+ !u && "cursor-pointer",
269
+ d
270
270
  );
271
- return /* @__PURE__ */ u(
271
+ return /* @__PURE__ */ c(
272
272
  "button",
273
273
  {
274
274
  id: v,
@@ -278,79 +278,79 @@ function Ge({
278
278
  role: "checkbox",
279
279
  onClick: h,
280
280
  "aria-checked": m,
281
- "aria-disabled": c,
282
- onKeyDownCapture: y,
281
+ "aria-disabled": u,
282
+ onKeyDownCapture: w,
283
283
  style: {
284
- width: e,
285
- height: e,
286
- color: n,
287
- backgroundColor: m && t ? "currentcolor" : "transparent"
284
+ width: t,
285
+ height: t,
286
+ color: r,
287
+ backgroundColor: m && e ? "currentcolor" : "transparent"
288
288
  },
289
289
  className: p,
290
290
  ...b,
291
- children: m && /* @__PURE__ */ u(re, { size: e, color: t ? f : void 0 })
291
+ children: m && /* @__PURE__ */ c(ne, { size: t, color: e ? f : void 0 })
292
292
  }
293
293
  );
294
294
  }
295
- function We({
295
+ function Qe({
296
296
  children: o,
297
297
  className: a,
298
- linkTo: e,
299
- linkProps: n,
300
- onButtonClick: t,
301
- buttonProps: r,
298
+ linkTo: t,
299
+ linkProps: r,
300
+ onButtonClick: e,
301
+ buttonProps: n,
302
302
  ...s
303
303
  }) {
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: [
304
+ return t && e && console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'), /* @__PURE__ */ E("div", { className: y("relative w-fit", a), ...s, children: [
305
305
  o,
306
- e && /* @__PURE__ */ u(
306
+ t && /* @__PURE__ */ c(
307
307
  "a",
308
308
  {
309
- ...n,
310
- rel: (n == null ? void 0 : n.rel) || "noreferrer",
311
- href: e,
312
- className: w("absolute inset-0", n == null ? void 0 : n.className)
309
+ ...r,
310
+ rel: (r == null ? void 0 : r.rel) || "noreferrer",
311
+ href: t,
312
+ className: y("absolute inset-0", r == null ? void 0 : r.className)
313
313
  }
314
314
  ),
315
- !e && t && /* @__PURE__ */ u(
315
+ !t && e && /* @__PURE__ */ c(
316
316
  "button",
317
317
  {
318
- ...r,
318
+ ...n,
319
319
  type: "button",
320
- onClick: t,
321
- className: w("absolute inset-0 cursor-pointer", r == null ? void 0 : r.className)
320
+ onClick: e,
321
+ className: y("absolute inset-0 cursor-pointer", n == null ? void 0 : n.className)
322
322
  }
323
323
  )
324
324
  ] });
325
325
  }
326
- function S({ elementId: o, type: a, message: e }) {
327
- return C(() => {
328
- const n = document.getElementById(o);
329
- if (n) {
330
- if (!e && a === "error") {
331
- n.removeAttribute("data-error");
326
+ function V({ elementId: o, type: a, message: t }) {
327
+ return A(() => {
328
+ const r = document.getElementById(o);
329
+ if (r) {
330
+ if (!t && a === "error") {
331
+ r.removeAttribute("data-error");
332
332
  return;
333
333
  }
334
- if (!e && a === "success") {
335
- n.removeAttribute("data-success");
334
+ if (!t && a === "success") {
335
+ r.removeAttribute("data-success");
336
336
  return;
337
337
  }
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"), () => {
339
- n.removeAttribute("aria-describedby"), n.removeAttribute("aria-invalid"), n.removeAttribute("data-error"), n.removeAttribute("data-success");
338
+ return r.setAttribute("aria-describedby", `${o}-${a}-message`), r.setAttribute("aria-invalid", a === "error" ? "true" : "false"), a === "error" && r.setAttribute("data-error", "true"), a === "success" && r.setAttribute("data-success", "true"), () => {
339
+ r.removeAttribute("aria-describedby"), r.removeAttribute("aria-invalid"), r.removeAttribute("data-error"), r.removeAttribute("data-success");
340
340
  };
341
341
  }
342
- }, [o, a, e]), e ? /* @__PURE__ */ E(
342
+ }, [o, a, t]), t ? /* @__PURE__ */ E(
343
343
  "small",
344
344
  {
345
- className: w(
345
+ className: y(
346
346
  "mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start",
347
347
  a === "error" && "text-destructive",
348
348
  a === "success" && "text-success"
349
349
  ),
350
350
  role: "status",
351
351
  children: [
352
- a === "error" ? /* @__PURE__ */ u(ie, {}) : /* @__PURE__ */ u(ne, {}),
353
- /* @__PURE__ */ u("span", { id: `${o}-${a}-message`, children: e })
352
+ a === "error" ? /* @__PURE__ */ c(le, {}) : /* @__PURE__ */ c(oe, {}),
353
+ /* @__PURE__ */ c("span", { id: `${o}-${a}-message`, children: t })
354
354
  ]
355
355
  }
356
356
  ) : null;
@@ -366,202 +366,202 @@ const he = {
366
366
  md: "rounded-md",
367
367
  lg: "rounded-lg",
368
368
  full: "px-3 rounded-full"
369
- }, Q = {
369
+ }, X = {
370
370
  variant: "default",
371
371
  rounded: "none"
372
372
  };
373
- function Ue({
374
- variant: o = Q.variant,
373
+ function Me({
374
+ variant: o = X.variant,
375
375
  rounded: a,
376
- displayOnlyMode: e = !1,
377
- errorMessage: n,
378
- successMessage: t,
379
- type: r = "text",
376
+ displayOnlyMode: t = !1,
377
+ errorMessage: r,
378
+ successMessage: e,
379
+ type: n = "text",
380
380
  className: s,
381
- ...d
381
+ ...l
382
382
  }) {
383
- const c = I(), [l, b] = x(!1);
383
+ const u = $(), [d, b] = x(!1);
384
384
  let i = a;
385
- o === "outline" && !a && (i = "md"), i = i || Q.rounded;
386
- const m = w(
385
+ o === "outline" && !a && (i = "md"), i = i || X.rounded;
386
+ const m = y(
387
387
  "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
388
  "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 && pe[i],
391
- r === "password" && "pr-10",
392
- !e && "px-2 py-1",
393
- e && "pointer-events-none",
389
+ !t && he[o],
390
+ !t && pe[i],
391
+ n === "password" && "pr-10",
392
+ !t && "px-2 py-1",
393
+ t && "pointer-events-none",
394
394
  s
395
395
  );
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__ */ u(
396
+ return /* @__PURE__ */ E("div", { className: y(t && "cursor-text"), style: { height: l.height, width: l.width }, children: [
397
+ /* @__PURE__ */ E("div", { className: y(n === "password" && "relative"), children: [
398
+ /* @__PURE__ */ c(
399
399
  "input",
400
400
  {
401
- ...d,
402
- id: c,
403
- type: r === "password" && l ? "text" : r,
404
- "aria-disabled": d.disabled,
405
- readOnly: e,
406
- "aria-readonly": e || d["aria-readonly"],
407
- "data-error": n ? !0 : void 0,
408
- "data-success": t ? !0 : void 0,
401
+ ...l,
402
+ id: u,
403
+ type: n === "password" && d ? "text" : n,
404
+ "aria-disabled": l.disabled,
405
+ readOnly: t,
406
+ "aria-readonly": t || l["aria-readonly"],
407
+ "data-error": r ? !0 : void 0,
408
+ "data-success": e ? !0 : void 0,
409
409
  className: m
410
410
  }
411
411
  ),
412
- r === "password" && /* @__PURE__ */ u(
412
+ n === "password" && /* @__PURE__ */ c(
413
413
  "button",
414
414
  {
415
- onClick: () => b(!l),
415
+ onClick: () => b(!d),
416
416
  className: "absolute inset-y-0 right-0 px-2 hover:cursor-pointer",
417
417
  "aria-label": "Toggle password visibility",
418
- "data-state": l ? "visible" : "hidden",
419
- children: l ? /* @__PURE__ */ u(oe, { size: 20 }) : /* @__PURE__ */ u(ae, { size: 20 })
418
+ "data-state": d ? "visible" : "hidden",
419
+ children: d ? /* @__PURE__ */ c(ae, { size: 20 }) : /* @__PURE__ */ c(se, { size: 20 })
420
420
  }
421
421
  )
422
422
  ] }),
423
- !e && /* @__PURE__ */ u(S, { elementId: c, type: "error", message: n }),
424
- !e && /* @__PURE__ */ u(S, { elementId: c, type: "success", message: t })
423
+ !t && /* @__PURE__ */ c(V, { elementId: u, type: "error", message: r }),
424
+ !t && /* @__PURE__ */ c(V, { elementId: u, type: "success", message: e })
425
425
  ] });
426
426
  }
427
- function _e({
427
+ function Xe({
428
428
  display: o = "inline",
429
429
  width: a = "fit-content",
430
- className: e = "",
431
- required: n,
432
- helpMessage: t,
433
- suffix: r,
430
+ className: t = "",
431
+ required: r,
432
+ helpMessage: e,
433
+ suffix: n,
434
434
  htmlFor: s,
435
- children: d,
436
- ...c
435
+ children: l,
436
+ ...u
437
437
  }) {
438
- const l = I(), b = w("font-medium", o, e), i = t ? `${s ?? l}-help` : void 0;
438
+ const d = $(), b = y("font-medium", o, t), i = e ? `${s ?? d}-help` : void 0;
439
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, ...c, children: [
441
- d,
442
- n && /* @__PURE__ */ u("span", { className: "text-red-500 font-medium ml-1", "aria-label": "required", children: "*" })
440
+ /* @__PURE__ */ E("label", { className: b, htmlFor: s, ...u, children: [
441
+ l,
442
+ r && /* @__PURE__ */ c("span", { className: "text-red-500 font-medium ml-1", "aria-label": "required", children: "*" })
443
443
  ] }),
444
- t && /* @__PURE__ */ u(
444
+ e && /* @__PURE__ */ c(
445
445
  "span",
446
446
  {
447
447
  className: "text-gray-500 ml-1 size-fit -translate-y-1/3",
448
448
  "aria-describedby": i,
449
449
  "aria-label": "Help information",
450
- title: t,
451
- children: /* @__PURE__ */ u(se, {})
450
+ title: e,
451
+ children: /* @__PURE__ */ c(ie, {})
452
452
  }
453
453
  ),
454
- t && /* @__PURE__ */ u("div", { id: i, className: "sr-only", children: t }),
455
- r && /* @__PURE__ */ u("span", { className: "ml-1", children: r })
454
+ e && /* @__PURE__ */ c("div", { id: i, className: "sr-only", children: e }),
455
+ n && /* @__PURE__ */ c("span", { className: "ml-1", children: n })
456
456
  ] });
457
457
  }
458
458
  function ge(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 };
459
+ const [a, t] = x(!1), [r, e] = x(!1);
460
+ return A(() => {
461
+ o ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 150));
462
+ }, [o]), { show: a, shouldRender: r };
463
463
  }
464
464
  function ve(o, a) {
465
- C(() => {
466
- const e = (n) => {
467
- n.key === "Escape" && o && a();
465
+ A(() => {
466
+ const t = (r) => {
467
+ r.key === "Escape" && o && a();
468
468
  };
469
- return document.addEventListener("keydown", e), o && (document.body.style.overflow = "hidden"), () => {
470
- document.removeEventListener("keydown", e), document.body.style.overflow = "auto";
469
+ return document.addEventListener("keydown", t), o && (document.body.style.overflow = "hidden"), () => {
470
+ document.removeEventListener("keydown", t), document.body.style.overflow = "auto";
471
471
  };
472
472
  }, [o, a]);
473
473
  }
474
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();
475
+ const t = R(null), r = I(() => {
476
+ const e = document.getElementById(o);
477
+ if (!e) return;
478
+ const n = e.querySelectorAll('[data-modal-action="true"]');
479
+ if (n.length > 0) {
480
+ n[0].focus();
481
481
  return;
482
482
  }
483
- const s = t.querySelectorAll(
483
+ const s = e.querySelectorAll(
484
484
  'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
485
485
  );
486
486
  if (s.length > 0) {
487
- const d = Array.from(s).filter((c) => !(c instanceof HTMLButtonElement && c.getAttribute("data-modal-close-button") === "true"));
488
- if (d.length > 0) {
489
- d[0].focus();
487
+ const l = Array.from(s).filter((u) => !(u instanceof HTMLButtonElement && u.getAttribute("data-modal-close-button") === "true"));
488
+ if (l.length > 0) {
489
+ l[0].focus();
490
490
  return;
491
491
  }
492
492
  s[0].focus();
493
493
  return;
494
494
  }
495
- t.focus();
495
+ e.focus();
496
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]);
497
+ A(() => (a && (t.current = document.activeElement, r()), () => {
498
+ document.body.style.overflow = "auto", t.current instanceof HTMLElement && t.current.focus();
499
+ }), [a, r]);
500
500
  }
501
- function Qe({
501
+ function Ze({
502
502
  id: o,
503
503
  isOpen: a,
504
- onClose: e,
505
- title: n,
506
- children: t,
507
- contentOnly: r = !1,
504
+ onClose: t,
505
+ title: r,
506
+ children: e,
507
+ contentOnly: n = !1,
508
508
  className: s,
509
- overlayClassName: d,
510
- hideCloseButton: c = !1,
511
- actions: l = [],
509
+ overlayClassName: l,
510
+ hideCloseButton: u = !1,
511
+ actions: d = [],
512
512
  disableCloseOnOverlayClick: b = !1,
513
513
  ariaLabelledBy: i,
514
514
  ariaDescribedBy: v
515
515
  }) {
516
- const f = I(), m = o || `modal-${f}`, g = o ? `${o}-title` : `modal-title-${f}`, { show: h, shouldRender: y } = ge(a);
517
- if (we(m, y), ve(y, e), !y) return null;
518
- const p = () => n ? z.isValidElement(n) ? /* @__PURE__ */ u("div", { className: "mb-4", children: n }) : /* @__PURE__ */ u("h2", { className: "mb-4 text-xl font-semibold", id: g, children: n }) : null, N = () => l.length === 0 ? null : /* @__PURE__ */ u("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: k, ...L } = D;
520
- return /* @__PURE__ */ u(me, { className: k, type: "button", ...L, "data-modal-action": "true", children: F }, $);
516
+ const f = $(), m = o || `modal-${f}`, g = o ? `${o}-title` : `modal-title-${f}`, { show: h, shouldRender: w } = ge(a);
517
+ if (we(m, w), ve(w, t), !w) return null;
518
+ const p = () => r ? D.isValidElement(r) ? /* @__PURE__ */ c("div", { className: "mb-4", children: r }) : /* @__PURE__ */ c("h2", { className: "mb-4 text-xl font-semibold", id: g, children: r }) : null, N = () => d.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: d.map((z, C) => {
519
+ const { label: L, className: B, ...S } = z;
520
+ return /* @__PURE__ */ c(me, { className: B, type: "button", ...S, "data-modal-action": "true", children: L }, C);
521
521
  }) });
522
- return /* @__PURE__ */ u(J, { children: M(
523
- /* @__PURE__ */ u(
522
+ return /* @__PURE__ */ c(W, { children: _(
523
+ /* @__PURE__ */ c(
524
524
  "div",
525
525
  {
526
- "aria-labelledby": i ?? n ? g : void 0,
526
+ "aria-labelledby": i ?? r ? g : void 0,
527
527
  "aria-describedby": v,
528
528
  role: "dialog",
529
529
  "aria-modal": "true",
530
530
  className: "fixed inset-0 z-[100] overflow-y-auto",
531
531
  children: /* @__PURE__ */ E("div", { className: "flex min-h-screen items-center justify-center p-4", children: [
532
- /* @__PURE__ */ u(
532
+ /* @__PURE__ */ c(
533
533
  "div",
534
534
  {
535
- className: H("fixed inset-0 bg-black/20 transition-all", d),
535
+ className: k("fixed inset-0 bg-black/20 transition-all", l),
536
536
  onClick: () => {
537
- b || e();
537
+ b || t();
538
538
  }
539
539
  }
540
540
  ),
541
- r && /* @__PURE__ */ u("div", { className: H("relative w-fit", s), children: t }),
542
- !r && /* @__PURE__ */ E(
541
+ n && /* @__PURE__ */ c("div", { className: k("relative w-fit", s), children: e }),
542
+ !n && /* @__PURE__ */ E(
543
543
  "div",
544
544
  {
545
545
  id: m,
546
546
  tabIndex: -1,
547
- className: H(
548
- "relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:ring ease-in duration-75",
547
+ className: k(
548
+ "relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75",
549
549
  h ? "opacity-100 scale-100" : "opacity-0 scale-90",
550
550
  s
551
551
  ),
552
552
  children: [
553
- !c && /* @__PURE__ */ u(
553
+ !u && /* @__PURE__ */ c(
554
554
  "button",
555
555
  {
556
556
  type: "button",
557
- onClick: e,
557
+ onClick: t,
558
558
  "data-modal-close-button": "true",
559
559
  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__ */ u(le, { size: 18 })
560
+ children: /* @__PURE__ */ c(P, { size: 18 })
561
561
  }
562
562
  ),
563
563
  p(),
564
- t,
564
+ e,
565
565
  N()
566
566
  ]
567
567
  }
@@ -572,38 +572,180 @@ function Qe({
572
572
  document.body
573
573
  ) });
574
574
  }
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
- }, c = w(
575
+ function ye(o) {
576
+ const [a, t] = x(!1), [r, e] = x(!1);
577
+ return A(() => {
578
+ o ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 300));
579
+ }, [o]), { show: a, shouldRender: r };
580
+ }
581
+ function xe(o, a) {
582
+ A(() => {
583
+ const t = (r) => {
584
+ r.key === "Escape" && o && a();
585
+ };
586
+ return document.addEventListener("keydown", t), o && (document.body.style.overflow = "hidden"), () => {
587
+ document.removeEventListener("keydown", t), document.body.style.overflow = "auto";
588
+ };
589
+ }, [o, a]);
590
+ }
591
+ function Ee(o, a) {
592
+ const t = R(null), r = I(() => {
593
+ const e = document.getElementById(o);
594
+ if (!e) return;
595
+ const n = e.querySelectorAll('[data-panel-action="true"]');
596
+ if (n.length > 0) {
597
+ n[0].focus();
598
+ return;
599
+ }
600
+ const s = e.querySelectorAll(
601
+ 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
602
+ );
603
+ if (s.length > 0) {
604
+ const l = Array.from(s).filter((u) => !(u instanceof HTMLButtonElement && u.getAttribute("data-panel-close-button") === "true"));
605
+ if (l.length > 0) {
606
+ l[0].focus();
607
+ return;
608
+ }
609
+ s[0].focus();
610
+ return;
611
+ }
612
+ e.focus();
613
+ }, [o]);
614
+ A(() => (a && (t.current = document.activeElement, r()), () => {
615
+ document.body.style.overflow = "auto", t.current instanceof HTMLElement && t.current.focus();
616
+ }), [a, r]);
617
+ }
618
+ const Ne = {
619
+ size: {
620
+ sm: "max-w-sm",
621
+ md: "max-w-md",
622
+ lg: "max-w-lg",
623
+ xl: "max-w-xl",
624
+ "2xl": "max-w-2xl",
625
+ full: "w-full",
626
+ screen: "w-screen"
627
+ }
628
+ };
629
+ function Je({
630
+ ref: o,
631
+ id: a,
632
+ isOpen: t,
633
+ onClose: r,
634
+ title: e,
635
+ children: n,
636
+ footer: s,
637
+ size: l = "md",
638
+ className: u,
639
+ overlayClassName: d,
640
+ hideCloseButton: b = !1,
641
+ disableCloseOnOverlayClick: i = !1,
642
+ ariaLabelledBy: v,
643
+ ariaDescribedBy: f
644
+ }) {
645
+ const m = $(), g = a || `panel-${m}`, h = a ? `${a}-title` : `panel-title-${m}`, { show: w, shouldRender: p } = ye(t);
646
+ if (Ee(g, p), xe(p, r), !p) return null;
647
+ const N = () => e ? D.isValidElement(e) ? /* @__PURE__ */ c("div", { children: e }) : /* @__PURE__ */ c("h2", { className: "text-2xl font-semibold", id: h, children: e }) : null, z = () => {
648
+ if (!s) return null;
649
+ if (D.isValidElement(s)) {
650
+ const C = s, L = C.props.className || "";
651
+ return D.cloneElement(C, { className: k("px-6 py-4", L) });
652
+ }
653
+ return /* @__PURE__ */ c("div", { className: "px-6 py-4", children: s });
654
+ };
655
+ return /* @__PURE__ */ c(W, { children: _(
656
+ /* @__PURE__ */ E(
657
+ "div",
658
+ {
659
+ "aria-labelledby": v ?? e ? h : void 0,
660
+ "aria-describedby": f,
661
+ role: "dialog",
662
+ "aria-modal": "true",
663
+ className: "fixed inset-0 z-[100] overflow-hidden",
664
+ "data-panel-open": t,
665
+ children: [
666
+ /* @__PURE__ */ c(
667
+ "div",
668
+ {
669
+ className: k(
670
+ "fixed inset-0 bg-black/40 transition-opacity duration-300",
671
+ w ? "opacity-100" : "opacity-0",
672
+ d
673
+ ),
674
+ onClick: () => {
675
+ i || r();
676
+ }
677
+ }
678
+ ),
679
+ /* @__PURE__ */ c("div", { className: "fixed inset-y-0 right-0 flex max-w-full", children: /* @__PURE__ */ c(
680
+ "div",
681
+ {
682
+ id: g,
683
+ ref: o,
684
+ tabIndex: -1,
685
+ className: k(
686
+ "relative h-full transform shadow-xl bg-popover transition-transform duration-300 ease-in-out",
687
+ l !== "screen" && "border-l border-border",
688
+ Ne.size[l],
689
+ w ? "translate-x-0" : "translate-x-full",
690
+ u
691
+ ),
692
+ "data-panel-size": l,
693
+ children: /* @__PURE__ */ E("div", { className: "flex h-full flex-col", children: [
694
+ e && /* @__PURE__ */ c("div", { className: "px-6 pt-6", children: N() }),
695
+ !b && /* @__PURE__ */ c(
696
+ "button",
697
+ {
698
+ type: "button",
699
+ onClick: r,
700
+ "data-panel-close-button": "true",
701
+ "aria-label": "Close panel",
702
+ 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",
703
+ children: /* @__PURE__ */ c(P, { size: 18 })
704
+ }
705
+ ),
706
+ /* @__PURE__ */ c("div", { className: k("flex-1 overflow-y-auto px-6 pb-6", e ? "pt-6" : "pt-10"), children: n }),
707
+ z()
708
+ ] })
709
+ }
710
+ ) })
711
+ ]
712
+ }
713
+ ),
714
+ document.body
715
+ ) });
716
+ }
717
+ function Ae({ itemId: o, checked: a, onChange: t, name: r, disabled: e = !1, className: n = "" }) {
718
+ const s = "relative inline-flex items-center justify-center rounded-full", l = () => {
719
+ e || t();
720
+ }, u = y(
579
721
  s,
580
722
  !a && "hover:border-current/60",
581
- !t && "border-current cursor-pointer",
582
- t && "border-muted/60 cursor-not-allowed",
583
- r
723
+ !e && "border-current cursor-pointer",
724
+ e && "border-muted/60 cursor-not-allowed",
725
+ n
584
726
  );
585
- return /* @__PURE__ */ u(
727
+ return /* @__PURE__ */ c(
586
728
  "div",
587
729
  {
588
730
  id: o,
589
731
  role: "radio",
590
732
  tabIndex: -1,
591
733
  "aria-checked": a,
592
- "aria-disabled": t,
593
- "aria-description": `Radio button for ${n}`,
734
+ "aria-disabled": e,
735
+ "aria-description": `Radio button for ${r}`,
594
736
  "aria-labelledby": `${o}-label`,
595
- onClick: d,
596
- className: c,
737
+ onClick: l,
738
+ className: u,
597
739
  style: {
598
740
  width: "1em",
599
741
  height: "1em",
600
742
  padding: "0.1em",
601
743
  borderWidth: "0.06em"
602
744
  },
603
- children: a && /* @__PURE__ */ u(
745
+ children: a && /* @__PURE__ */ c(
604
746
  "div",
605
747
  {
606
- className: w("size-full aspect-square rounded-full", t && "bg-muted/60", !t && "bg-current")
748
+ className: y("size-full aspect-square rounded-full", e && "bg-muted/60", !e && "bg-current")
607
749
  }
608
750
  )
609
751
  }
@@ -612,63 +754,63 @@ function ye({ itemId: o, checked: a, onChange: e, name: n, disabled: t = !1, cla
612
754
  function G({
613
755
  value: o,
614
756
  children: a,
615
- className: e = "",
616
- isSelected: n = !1,
617
- onChange: t,
618
- disabled: r = !1,
757
+ className: t = "",
758
+ isSelected: r = !1,
759
+ onChange: e,
760
+ disabled: n = !1,
619
761
  hideInput: s = !1,
620
- description: d,
621
- name: c
762
+ description: l,
763
+ name: u
622
764
  }) {
623
- const b = `radio-${I()}-${o}`, i = () => {
624
- r || t == null || t(o);
765
+ const b = `radio-${$()}-${o}`, i = () => {
766
+ n || e == null || e(o);
625
767
  };
626
768
  return /* @__PURE__ */ E(
627
769
  "div",
628
770
  {
629
- title: d,
630
- className: w(
771
+ title: l,
772
+ className: y(
631
773
  "relative flex items-center",
632
- e,
774
+ t,
633
775
  // 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"}`,
636
- s && n && "border-border",
637
- r && "opacity-60 cursor-not-allowed"
776
+ s && `p-2 border-2 focus-within:border-dashed focus-within:${n ? "border-current/50" : "border-current/80"}`,
777
+ s && !r && `border-transparent ${n ? "" : "not-focus-within:hover:border-border/60"}`,
778
+ s && r && "border-border",
779
+ n && "opacity-60 cursor-not-allowed"
638
780
  ),
639
781
  style: {
640
782
  gap: "0.5em"
641
783
  },
642
784
  children: [
643
- !s && /* @__PURE__ */ u(
644
- ye,
785
+ !s && /* @__PURE__ */ c(
786
+ Ae,
645
787
  {
646
788
  itemId: b,
647
- name: c || "",
648
- checked: n,
789
+ name: u || "",
790
+ checked: r,
649
791
  onChange: i,
650
- disabled: r,
651
- className: w(s && "")
792
+ disabled: n,
793
+ className: y(s && "")
652
794
  }
653
795
  ),
654
- /* @__PURE__ */ u(
796
+ /* @__PURE__ */ c(
655
797
  "div",
656
798
  {
657
799
  id: s ? b : void 0,
658
800
  tabIndex: s ? -1 : void 0,
659
801
  role: s ? "radio" : void 0,
660
802
  onClick: s ? i : void 0,
661
- "aria-checked": s ? n ? "true" : "false" : void 0,
662
- "aria-disabled": s ? r : void 0,
663
- "aria-description": s ? d || `Radio button for ${c}` : void 0,
803
+ "aria-checked": s ? r ? "true" : "false" : void 0,
804
+ "aria-disabled": s ? n : void 0,
805
+ "aria-description": s ? l || `Radio button for ${u}` : void 0,
664
806
  "aria-labelledby": s ? `${b}-label` : void 0,
665
- className: w(s && "size-full", typeof a == "object" && "grow focus:outline-none"),
666
- children: /* @__PURE__ */ u(
807
+ className: y(s && "size-full", typeof a == "object" && "grow focus:outline-none"),
808
+ children: /* @__PURE__ */ c(
667
809
  "label",
668
810
  {
669
811
  id: `${b}-label`,
670
812
  onClick: s ? void 0 : i,
671
- className: w(r && "cursor-not-allowed", !r && "cursor-pointer"),
813
+ className: y(n && "cursor-not-allowed", !n && "cursor-pointer"),
672
814
  children: a
673
815
  }
674
816
  )
@@ -678,22 +820,22 @@ function G({
678
820
  }
679
821
  );
680
822
  }
681
- function xe(o, a) {
682
- const [e, n] = x(a), [t, r] = x(-1), [s, d] = x(!1), c = A((f, m) => {
683
- var y;
823
+ function Ce(o, a) {
824
+ const [t, r] = x(a), [e, n] = x(-1), [s, l] = x(!1), u = I((f, m) => {
825
+ var w;
684
826
  const g = f[m];
685
- g.hasAttribute("disabled") || g.getAttribute("aria-disabled") === "true" || ((y = f[m]) == null || y.click(), r(m));
686
- }, []), l = A(
827
+ g.hasAttribute("disabled") || g.getAttribute("aria-disabled") === "true" || ((w = f[m]) == null || w.click(), n(m));
828
+ }, []), d = I(
687
829
  (f, m) => {
688
830
  var h;
689
831
  if (f.preventDefault(), s || !m.length) return;
690
832
  const g = a !== -1 ? a : 0;
691
- (h = m[g]) == null || h.focus(), n(g), a !== -1 && c(m, g);
833
+ (h = m[g]) == null || h.focus(), r(g), a !== -1 && u(m, g);
692
834
  },
693
- [a, s, c]
694
- ), b = A(
835
+ [a, s, u]
836
+ ), b = I(
695
837
  (f) => {
696
- var y;
838
+ var w;
697
839
  if (!f.shiftKey)
698
840
  return;
699
841
  f.preventDefault();
@@ -702,29 +844,29 @@ function xe(o, a) {
702
844
  'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
703
845
  )
704
846
  ).filter((p) => !p.hasAttribute("disabled") && p.tabIndex >= 0), g = m.findIndex((p) => p.id === o), h = g > 0 ? g - 1 : m.length - 1;
705
- (y = m[h]) == null || y.focus();
847
+ (w = m[h]) == null || w.focus();
706
848
  },
707
849
  [o]
708
- ), i = A(
850
+ ), i = I(
709
851
  (f, m) => {
710
852
  var N;
711
853
  if (!m.length) return;
712
854
  const g = f.target;
713
- if (!m.some((D) => D.id === g.id)) return;
714
- const y = e !== -1 ? e : 0;
715
- let p = y;
855
+ if (!m.some((z) => z.id === g.id)) return;
856
+ const w = t !== -1 ? t : 0;
857
+ let p = w;
716
858
  switch (f.key) {
717
859
  case "ArrowUp":
718
860
  case "ArrowLeft":
719
- f.preventDefault(), p = y > 0 ? y - 1 : m.length - 1;
861
+ f.preventDefault(), p = w > 0 ? w - 1 : m.length - 1;
720
862
  break;
721
863
  case "ArrowDown":
722
864
  case "ArrowRight":
723
- f.preventDefault(), p = (y + 1) % m.length;
865
+ f.preventDefault(), p = (w + 1) % m.length;
724
866
  break;
725
867
  // Select the option when the space key is pressed
726
868
  case " ":
727
- f.preventDefault(), c(m, y);
869
+ f.preventDefault(), u(m, w);
728
870
  return;
729
871
  case "Tab":
730
872
  b(f);
@@ -732,69 +874,69 @@ function xe(o, a) {
732
874
  default:
733
875
  return;
734
876
  }
735
- (N = m[p]) == null || N.focus(), n(p), t !== -1 && c(m, p);
877
+ (N = m[p]) == null || N.focus(), r(p), e !== -1 && u(m, p);
736
878
  },
737
- [e, t, b, c]
738
- ), v = A(() => {
879
+ [t, e, b, u]
880
+ ), v = I(() => {
739
881
  const f = document.querySelector(`[id="${o}"][role="radiogroup"]`);
740
882
  return f ? Array.from(f.querySelectorAll('[role="radio"]')) : [];
741
883
  }, [o]);
742
- C(() => {
884
+ A(() => {
743
885
  const f = document.querySelector(`[id="${o}"][role="radiogroup"]`);
744
886
  if (!f) return;
745
- const m = v(), g = (N) => l(N, m), h = (N) => i(N, m), y = () => d(!0), p = () => d(!1);
746
- return document.addEventListener("keydown", h), f.addEventListener("focus", g), f.addEventListener("mousedown", y), document.addEventListener("mouseup", p), () => {
747
- document.removeEventListener("keydown", h), f.removeEventListener("focus", g), f.removeEventListener("mousedown", y), document.removeEventListener("mouseup", p);
887
+ const m = v(), g = (N) => d(N, m), h = (N) => i(N, m), w = () => l(!0), p = () => l(!1);
888
+ return document.addEventListener("keydown", h), f.addEventListener("focus", g), f.addEventListener("mousedown", w), document.addEventListener("mouseup", p), () => {
889
+ document.removeEventListener("keydown", h), f.removeEventListener("focus", g), f.removeEventListener("mousedown", w), document.removeEventListener("mouseup", p);
748
890
  };
749
- }, [o, v, l, i]);
891
+ }, [o, v, d, i]);
750
892
  }
751
- function Xe({
893
+ function Ye({
752
894
  options: o = [],
753
895
  value: a,
754
- onChange: e,
755
- id: n,
756
- children: t,
757
- className: r = "",
896
+ onChange: t,
897
+ id: r,
898
+ children: e,
899
+ className: n = "",
758
900
  childrenClassName: s = "",
759
- hideInputs: d = !1
901
+ hideInputs: l = !1
760
902
  }) {
761
- const c = I(), l = n || `radio-group-${c}`;
762
- xe(
763
- l,
903
+ const u = $(), d = r || `radio-group-${u}`;
904
+ Ce(
905
+ d,
764
906
  o.findIndex((i) => i === a)
765
907
  );
766
- const b = W(() => o.reduce((i, v) => (typeof v == "string" ? i.some((f) => f.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__ */ u(
908
+ const b = U(() => o.reduce((i, v) => (typeof v == "string" ? i.some((f) => f.value === v) || i.push({ label: v, value: v }) : i.push(v), i), []), [o]);
909
+ return /* @__PURE__ */ E("div", { id: d, role: "radiogroup", tabIndex: 0, className: y(n, "focus:outline-none"), children: [
910
+ b.length > 0 && b.map((i, v) => /* @__PURE__ */ c(
769
911
  G,
770
912
  {
771
913
  value: i.value,
772
914
  isSelected: a === i.value,
773
- onChange: e,
774
- name: l,
915
+ onChange: t,
916
+ name: d,
775
917
  disabled: i.disabled,
776
918
  description: i.description,
777
- hideInput: d,
919
+ hideInput: l,
778
920
  className: s,
779
921
  children: i.label
780
922
  },
781
923
  `${i.value}-${v}`
782
924
  )),
783
- b.length === 0 && t && z.Children.map(t, (i) => z.isValidElement(i) && i.type === G ? /* @__PURE__ */ u(
925
+ b.length === 0 && e && D.Children.map(e, (i) => D.isValidElement(i) && i.type === G ? /* @__PURE__ */ c(
784
926
  G,
785
927
  {
786
928
  ...i.props,
787
- className: w(s, i.props.className),
788
- hideInput: i.props.hideInput || d,
929
+ className: y(s, i.props.className),
930
+ hideInput: i.props.hideInput || l,
789
931
  isSelected: a === i.props.value,
790
- onChange: e,
791
- name: l,
932
+ onChange: t,
933
+ name: d,
792
934
  children: i.props.children
793
935
  }
794
936
  ) : null)
795
937
  ] });
796
938
  }
797
- const Ee = {
939
+ const Ie = {
798
940
  thin: {
799
941
  horizontal: "h-px",
800
942
  vertical: "w-px"
@@ -811,81 +953,74 @@ const Ee = {
811
953
  horizontal: "h-2",
812
954
  vertical: "w-2"
813
955
  }
814
- }, Ne = {
815
- default: "bg-border",
816
- muted: "bg-muted",
817
- accent: "bg-accent"
818
- }, Ce = {
956
+ }, $e = {
819
957
  horizontal: "w-full",
820
958
  vertical: "min-h-4 h-full"
821
959
  };
822
- function Ze({
960
+ function Pe({
823
961
  orientation: o = "horizontal",
824
962
  decorative: a = !1,
825
- thickness: e = "thin",
826
- variant: n = "default",
827
- className: t,
828
- ...r
963
+ thickness: t = "thin",
964
+ className: r,
965
+ ...e
829
966
  }) {
830
- const s = w(
831
- "shrink-0",
832
- Ce[o],
833
- Ee[e][o],
834
- Ne[n],
835
- t
967
+ const n = y(
968
+ "shrink-0 bg-border",
969
+ $e[o],
970
+ Ie[t][o],
971
+ r
836
972
  );
837
- return /* @__PURE__ */ u(
973
+ return /* @__PURE__ */ c(
838
974
  "div",
839
975
  {
840
- ...r,
841
- className: s,
976
+ ...e,
977
+ className: n,
842
978
  role: a ? "presentation" : "separator",
843
979
  "aria-orientation": a ? void 0 : o,
844
980
  "aria-hidden": a,
845
981
  "data-orientation": o,
846
- "data-thickness": e,
847
- "data-variant": n
982
+ "data-thickness": t
848
983
  }
849
984
  );
850
985
  }
851
- function Je({ children: o, ref: a, ...e }) {
852
- if (P(o)) {
853
- let n = { ...e };
854
- return o.props && (n = { ...n, ...o.props }), ee(o, {
855
- ...n,
856
- ref: (t) => {
857
- typeof a == "function" ? a(t) : a && (a.current = t);
986
+ function Oe({ children: o, ref: a, ...t }) {
987
+ if (ee(o)) {
988
+ let r = { ...t };
989
+ return o.props && (r = { ...r, ...o.props }), te(o, {
990
+ ...r,
991
+ ref: (e) => {
992
+ typeof a == "function" ? a(e) : a && (a.current = e);
858
993
  }
859
994
  });
860
995
  }
861
- return Y("div", { ...e, ref: a }, o);
996
+ return Y("div", { ...t, ref: a }, o);
862
997
  }
863
- function Ae({ elementId: o, maxLength: a }) {
864
- const [e, n] = x(0);
865
- return C(() => {
866
- const t = document.getElementById(o);
867
- if (!t)
998
+ function Te({ elementId: o, maxLength: a }) {
999
+ const [t, r] = x(0);
1000
+ return A(() => {
1001
+ const e = document.getElementById(o);
1002
+ if (!e)
868
1003
  return;
869
- const r = () => {
870
- const s = t.value.length;
871
- n(s);
872
- const d = s >= a;
873
- t.setAttribute("aria-describedby", `${o}-character-count`), t.setAttribute("aria-invalid", d ? "true" : "false"), d ? t.setAttribute("data-error", "true") : t.removeAttribute("data-error");
1004
+ const n = () => {
1005
+ const s = e.value.length;
1006
+ r(s);
1007
+ const l = s >= a;
1008
+ e.setAttribute("aria-describedby", `${o}-character-count`), e.setAttribute("aria-invalid", l ? "true" : "false"), l ? e.setAttribute("data-error", "true") : e.removeAttribute("data-error");
874
1009
  };
875
- return r(), t.addEventListener("input", r), t.setAttribute("maxlength", String(a)), () => {
876
- t.removeEventListener("input", r), t.removeAttribute("maxlength"), t.removeAttribute("aria-describedby"), t.removeAttribute("aria-invalid"), t.removeAttribute("data-error");
1010
+ return n(), e.addEventListener("input", n), e.setAttribute("maxlength", String(a)), () => {
1011
+ e.removeEventListener("input", n), e.removeAttribute("maxlength"), e.removeAttribute("aria-describedby"), e.removeAttribute("aria-invalid"), e.removeAttribute("data-error");
877
1012
  };
878
- }, [o, a]), /* @__PURE__ */ u(
1013
+ }, [o, a]), /* @__PURE__ */ c(
879
1014
  "small",
880
1015
  {
881
- className: w(
1016
+ className: y(
882
1017
  "mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",
883
- e >= a && "text-destructive",
884
- e < a && "text-current"
1018
+ t >= a && "text-destructive",
1019
+ t < a && "text-current"
885
1020
  ),
886
1021
  role: "status",
887
1022
  children: /* @__PURE__ */ E("span", { id: `${o}-character-count`, children: [
888
- e,
1023
+ t,
889
1024
  " / ",
890
1025
  a,
891
1026
  " characters"
@@ -893,85 +1028,85 @@ function Ae({ elementId: o, maxLength: a }) {
893
1028
  }
894
1029
  );
895
1030
  }
896
- function Ie(o, a) {
897
- C(() => {
898
- const e = document.getElementById(o);
899
- if (!e)
1031
+ function ze(o, a) {
1032
+ A(() => {
1033
+ const t = document.getElementById(o);
1034
+ if (!t)
900
1035
  return;
901
1036
  if (!a) {
902
- e.style.height = "auto";
1037
+ t.style.height = "auto";
903
1038
  return;
904
1039
  }
905
- const n = () => {
906
- e.style.height = "auto", e.style.height = `${e.scrollHeight}px`;
1040
+ const r = () => {
1041
+ t.style.height = "auto", t.style.height = `${t.scrollHeight}px`;
907
1042
  };
908
- return n(), e.addEventListener("input", n), e.addEventListener("resize", n), window.addEventListener("resize", n), () => {
909
- e.removeEventListener("input", n), e.removeEventListener("resize", n), window.removeEventListener("resize", n);
1043
+ return r(), t.addEventListener("input", r), t.addEventListener("resize", r), window.addEventListener("resize", r), () => {
1044
+ t.removeEventListener("input", r), t.removeEventListener("resize", r), window.removeEventListener("resize", r);
910
1045
  };
911
1046
  }, [o, a]);
912
1047
  }
913
- const $e = {
1048
+ const De = {
914
1049
  base: "",
915
1050
  "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",
916
1051
  outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"
917
- }, Te = {
1052
+ }, ke = {
918
1053
  none: "rounded-none",
919
1054
  sm: "rounded-sm",
920
1055
  md: "rounded-md",
921
1056
  lg: "rounded-lg",
922
1057
  full: "px-3 rounded-full"
923
- }, X = {
1058
+ }, Z = {
924
1059
  variant: "outline",
925
1060
  rounded: "none"
926
1061
  };
927
- function Ye({
928
- variant: o = X.variant,
1062
+ function et({
1063
+ variant: o = Z.variant,
929
1064
  rounded: a,
930
- displayOnlyMode: e = !1,
931
- errorMessage: n,
932
- successMessage: t,
933
- hideResizeHandle: r = !1,
1065
+ displayOnlyMode: t = !1,
1066
+ errorMessage: r,
1067
+ successMessage: e,
1068
+ hideResizeHandle: n = !1,
934
1069
  autoExpand: s = !1,
935
- characterLimit: d = 0,
936
- className: c,
937
- ...l
1070
+ characterLimit: l = 0,
1071
+ className: u,
1072
+ ...d
938
1073
  }) {
939
- const b = I();
940
- Ie(b, s || e);
1074
+ const b = $();
1075
+ ze(b, s || t);
941
1076
  let i = a;
942
- o === "outline" && !a && (i = "md"), i = i || X.rounded;
943
- let v = r;
944
- (e || o === "left-line" && !r) && (v = !0);
945
- const m = w(
1077
+ o === "outline" && !a && (i = "md"), i = i || Z.rounded;
1078
+ let v = n;
1079
+ (t || o === "left-line" && !n) && (v = !0);
1080
+ const m = y(
946
1081
  "appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",
947
- !e && $e[o],
948
- !e && Te[i],
949
- !e && "px-2 py-1",
950
- e && "pointer-events-none",
1082
+ !t && De[o],
1083
+ !t && ke[i],
1084
+ !t && "px-2 py-1",
1085
+ t && "pointer-events-none",
951
1086
  v && "no-resize-handle",
952
- c
1087
+ u
953
1088
  );
954
- return /* @__PURE__ */ E("div", { className: w("-space-y-1.5", e && "cursor-text"), children: [
955
- /* @__PURE__ */ u(
1089
+ return /* @__PURE__ */ E("div", { className: y("-space-y-1.5", t && "cursor-text"), children: [
1090
+ /* @__PURE__ */ c(
956
1091
  "textarea",
957
1092
  {
958
- ...l,
1093
+ ...d,
959
1094
  id: b,
960
- "aria-disabled": l.disabled,
961
- readOnly: e,
962
- "aria-readonly": e || l["aria-readonly"],
1095
+ "aria-disabled": d.disabled,
1096
+ readOnly: t,
1097
+ "aria-readonly": t || d["aria-readonly"],
963
1098
  style: {
964
1099
  resize: s ? "none" : void 0
965
1100
  },
966
1101
  className: m
967
1102
  }
968
1103
  ),
969
- d > 0 && /* @__PURE__ */ u(Ae, { elementId: b, maxLength: d }),
970
- !e && /* @__PURE__ */ u(S, { elementId: b, type: "error", message: n }),
971
- !e && /* @__PURE__ */ u(S, { elementId: b, type: "success", message: t })
1104
+ l > 0 && /* @__PURE__ */ c(Te, { elementId: b, maxLength: l }),
1105
+ !t && /* @__PURE__ */ c(V, { elementId: b, type: "error", message: r }),
1106
+ !t && /* @__PURE__ */ c(V, { elementId: b, type: "success", message: e })
972
1107
  ] });
973
1108
  }
974
- const De = {
1109
+ const Le = {
975
1110
  sm: {
976
1111
  container: "h-5 min-w-9 w-9",
977
1112
  thumb: "h-4 w-4",
@@ -987,7 +1122,7 @@ const De = {
987
1122
  thumb: "h-6 w-6",
988
1123
  translate: "translate-x-6"
989
1124
  }
990
- }, ze = {
1125
+ }, Re = {
991
1126
  default: {
992
1127
  unchecked: "bg-muted",
993
1128
  checked: "bg-primary"
@@ -1000,54 +1135,54 @@ const De = {
1000
1135
  unchecked: "bg-muted",
1001
1136
  checked: "bg-destructive"
1002
1137
  }
1003
- }, Z = {
1138
+ }, J = {
1004
1139
  variant: "default",
1005
1140
  size: "md"
1006
1141
  };
1007
- function Me({
1142
+ function tt({
1008
1143
  ref: o,
1009
1144
  id: a,
1010
- size: e = Z.size,
1011
- variant: n = Z.variant,
1012
- checked: t,
1013
- onCheckedChange: r,
1145
+ size: t = J.size,
1146
+ variant: r = J.variant,
1147
+ checked: e,
1148
+ onCheckedChange: n,
1014
1149
  disabled: s = !1,
1015
- className: d,
1016
- thumbClassName: c,
1017
- backgroundClassNames: l,
1150
+ className: l,
1151
+ thumbClassName: u,
1152
+ backgroundClassNames: d,
1018
1153
  ...b
1019
1154
  }) {
1020
- const i = I(), v = W(() => a || `toggle-${i}`, [a, i]), [f, m] = x(t);
1021
- C(() => {
1022
- m(t);
1023
- }, [t]);
1155
+ const i = $(), v = U(() => a || `toggle-${i}`, [a, i]), [f, m] = x(e);
1156
+ A(() => {
1157
+ m(e);
1158
+ }, [e]);
1024
1159
  const g = () => {
1025
1160
  if (!s) {
1026
- const $ = !f;
1027
- t === void 0 && m($), r == null || r($);
1161
+ const C = !f;
1162
+ e === void 0 && m(C), n == null || n(C);
1028
1163
  }
1029
- }, h = ($) => {
1030
- ($.key === " " || $.key === "Enter") && ($.preventDefault(), g());
1031
- }, y = De[e], p = ze[n], N = w(
1164
+ }, h = (C) => {
1165
+ (C.key === " " || C.key === "Enter") && (C.preventDefault(), g());
1166
+ }, w = Le[t], p = Re[r], N = y(
1032
1167
  // Base styles
1033
1168
  "relative inline-flex items-center rounded-full transition-all duration-200 ease-in-out",
1034
1169
  "focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
1035
1170
  // Size
1036
- y.container,
1171
+ w.container,
1037
1172
  // Variant and state
1038
- f ? (l == null ? void 0 : l.checked) || p.checked : (l == null ? void 0 : l.unchecked) || p.unchecked,
1173
+ f ? (d == null ? void 0 : d.checked) || p.checked : (d == null ? void 0 : d.unchecked) || p.unchecked,
1039
1174
  // Disabled state
1040
1175
  s && "opacity-50 cursor-not-allowed",
1041
1176
  !s && "cursor-pointer",
1042
- d
1043
- ), D = w(
1177
+ l
1178
+ ), z = y(
1044
1179
  // Base thumb styles
1045
1180
  "absolute left-0.5 top-1/2 -translate-y-1/2 rounded-full bg-white shadow-sm transition-transform duration-200 ease-in-out",
1046
1181
  // Size
1047
- y.thumb,
1182
+ w.thumb,
1048
1183
  // Position based on state
1049
- f && y.translate,
1050
- c
1184
+ f && w.translate,
1185
+ u
1051
1186
  );
1052
1187
  return /* @__PURE__ */ E(
1053
1188
  "button",
@@ -1065,210 +1200,210 @@ function Me({
1065
1200
  className: N,
1066
1201
  ...b,
1067
1202
  children: [
1068
- /* @__PURE__ */ u("span", { className: D }),
1069
- /* @__PURE__ */ u("span", { className: "sr-only", children: f ? "Enabled" : "Disabled" })
1203
+ /* @__PURE__ */ c("span", { className: z }),
1204
+ /* @__PURE__ */ c("span", { className: "sr-only", children: f ? "Enabled" : "Disabled" })
1070
1205
  ]
1071
1206
  }
1072
1207
  );
1073
1208
  }
1074
- const R = 8, B = 4, T = 6;
1075
- function ke(o) {
1076
- return { calculatePosition: A(
1077
- (e, n) => {
1078
- const t = e.getBoundingClientRect(), r = n.getBoundingClientRect(), s = {
1209
+ const j = 8, F = 4, T = 6;
1210
+ function Be(o) {
1211
+ return { calculatePosition: I(
1212
+ (t, r) => {
1213
+ const e = t.getBoundingClientRect(), n = r.getBoundingClientRect(), s = {
1079
1214
  width: window.innerWidth,
1080
1215
  height: window.innerHeight
1081
- }, d = (v, f, m, g) => v < 0 || f < 0 || v + m > s.width || f + g > s.height, c = {
1216
+ }, l = (v, f, m, g) => v < 0 || f < 0 || v + m > s.width || f + g > s.height, u = {
1082
1217
  top: {
1083
- x: t.left + t.width / 2 - r.width / 2,
1084
- y: t.top - r.height - B,
1218
+ x: e.left + e.width / 2 - n.width / 2,
1219
+ y: e.top - n.height - F,
1085
1220
  arrow: {
1086
- x: r.width / 2 - T,
1087
- y: r.height
1221
+ x: n.width / 2 - T,
1222
+ y: n.height
1088
1223
  }
1089
1224
  },
1090
1225
  bottom: {
1091
- x: t.left + t.width / 2 - r.width / 2,
1092
- y: t.bottom + B,
1226
+ x: e.left + e.width / 2 - n.width / 2,
1227
+ y: e.bottom + F,
1093
1228
  arrow: {
1094
- x: r.width / 2 - T,
1229
+ x: n.width / 2 - T,
1095
1230
  y: -6
1096
1231
  }
1097
1232
  },
1098
1233
  left: {
1099
- x: t.left - r.width - B,
1100
- y: t.top + t.height / 2 - r.height / 2,
1234
+ x: e.left - n.width - F,
1235
+ y: e.top + e.height / 2 - n.height / 2,
1101
1236
  arrow: {
1102
- x: r.width,
1103
- y: r.height / 2 - T
1237
+ x: n.width,
1238
+ y: n.height / 2 - T
1104
1239
  }
1105
1240
  },
1106
1241
  right: {
1107
- x: t.right + B,
1108
- y: t.top + t.height / 2 - r.height / 2,
1242
+ x: e.right + F,
1243
+ y: e.top + e.height / 2 - n.height / 2,
1109
1244
  arrow: {
1110
1245
  x: -6,
1111
- y: r.height / 2 - T
1246
+ y: n.height / 2 - T
1112
1247
  }
1113
1248
  }
1114
1249
  };
1115
- let l = o, b = c[o];
1116
- if (d(b.x, b.y, r.width, r.height)) {
1250
+ let d = o, b = u[o];
1251
+ if (l(b.x, b.y, n.width, n.height)) {
1117
1252
  const v = {
1118
1253
  top: "bottom",
1119
1254
  bottom: "top",
1120
1255
  left: "right",
1121
1256
  right: "left"
1122
- }, f = c[v[o]];
1123
- if (!d(f.x, f.y, r.width, r.height))
1124
- l = v[o], b = f;
1257
+ }, f = u[v[o]];
1258
+ if (!l(f.x, f.y, n.width, n.height))
1259
+ d = v[o], b = f;
1125
1260
  else {
1126
1261
  const m = ["top", "bottom", "left", "right"].filter(
1127
1262
  (g) => g !== o && g !== v[o]
1128
1263
  );
1129
1264
  for (const g of m) {
1130
- const h = c[g];
1131
- if (!d(h.x, h.y, r.width, r.height)) {
1132
- l = g, b = h;
1265
+ const h = u[g];
1266
+ if (!l(h.x, h.y, n.width, n.height)) {
1267
+ d = g, b = h;
1133
1268
  break;
1134
1269
  }
1135
1270
  }
1136
1271
  }
1137
1272
  }
1138
1273
  b.x = Math.max(
1139
- R,
1140
- Math.min(b.x, s.width - r.width - R)
1274
+ j,
1275
+ Math.min(b.x, s.width - n.width - j)
1141
1276
  ), b.y = Math.max(
1142
- R,
1143
- Math.min(b.y, s.height - r.height - R)
1277
+ j,
1278
+ Math.min(b.y, s.height - n.height - j)
1144
1279
  );
1145
1280
  const i = {
1146
- x: t.left + t.width / 2,
1147
- y: t.top + t.height / 2
1281
+ x: e.left + e.width / 2,
1282
+ y: e.top + e.height / 2
1148
1283
  };
1149
- return l === "top" || l === "bottom" ? b.arrow.x = Math.max(
1284
+ return d === "top" || d === "bottom" ? b.arrow.x = Math.max(
1150
1285
  T,
1151
- Math.min(i.x - b.x - T, r.width - T * 2)
1286
+ Math.min(i.x - b.x - T, n.width - T * 2)
1152
1287
  ) : b.arrow.y = Math.max(
1153
1288
  T,
1154
- Math.min(i.y - b.y - T, r.height - T * 2)
1289
+ Math.min(i.y - b.y - T, n.height - T * 2)
1155
1290
  ), {
1156
1291
  ...b,
1157
- placement: l
1292
+ placement: d
1158
1293
  };
1159
1294
  },
1160
1295
  [o]
1161
1296
  ) };
1162
1297
  }
1163
- function Le(o, a, e) {
1164
- const n = j(null), t = j(null), r = A(() => {
1165
- if (!n.current || !t.current) return;
1166
- const s = o(n.current, t.current);
1167
- e(s);
1168
- }, [o, e]);
1169
- return C(() => {
1298
+ function Se(o, a, t) {
1299
+ const r = R(null), e = R(null), n = I(() => {
1300
+ if (!r.current || !e.current) return;
1301
+ const s = o(r.current, e.current);
1302
+ t(s);
1303
+ }, [o, t]);
1304
+ return A(() => {
1170
1305
  if (!a) return;
1171
- const s = () => r();
1306
+ const s = () => n();
1172
1307
  return window.addEventListener("resize", s), () => {
1173
1308
  window.removeEventListener("resize", s);
1174
1309
  };
1175
- }, [a, r]), {
1176
- triggerRef: n,
1177
- tooltipRef: t,
1178
- updatePosition: r
1310
+ }, [a, n]), {
1311
+ triggerRef: r,
1312
+ tooltipRef: e,
1313
+ updatePosition: n
1179
1314
  };
1180
1315
  }
1181
- function Re(o, a, e, n, t, r, s, d, c) {
1182
- const l = j(null), b = A(() => {
1183
- o || (l.current && clearTimeout(l.current), l.current = window.setTimeout(() => {
1184
- e(!0), requestAnimationFrame(() => {
1185
- t(), n(!0);
1316
+ function je(o, a, t, r, e, n, s, l, u) {
1317
+ const d = R(null), b = I(() => {
1318
+ o || (d.current && clearTimeout(d.current), d.current = window.setTimeout(() => {
1319
+ t(!0), requestAnimationFrame(() => {
1320
+ e(), r(!0);
1186
1321
  });
1187
1322
  }, a));
1188
- }, [o, a, e, t, n]), i = A(
1323
+ }, [o, a, t, e, r]), i = I(
1189
1324
  (v = !1) => {
1190
- if (l.current && clearTimeout(l.current), v) {
1191
- n(!1), setTimeout(() => e(!1), 150);
1325
+ if (d.current && clearTimeout(d.current), v) {
1326
+ r(!1), setTimeout(() => t(!1), 150);
1192
1327
  return;
1193
1328
  }
1194
- l.current = window.setTimeout(() => {
1195
- n(!1), setTimeout(() => e(!1), 150);
1329
+ d.current = window.setTimeout(() => {
1330
+ r(!1), setTimeout(() => t(!1), 150);
1196
1331
  }, 100);
1197
1332
  },
1198
- [n, e]
1333
+ [r, t]
1199
1334
  );
1200
- return C(() => {
1201
- !r && !s && !d && c && i();
1202
- }, [r, s, d, c, i]), C(() => () => {
1203
- l.current && clearTimeout(l.current);
1335
+ return A(() => {
1336
+ !n && !s && !l && u && i();
1337
+ }, [n, s, l, u, i]), A(() => () => {
1338
+ d.current && clearTimeout(d.current);
1204
1339
  }, []), {
1205
1340
  showTooltip: b,
1206
1341
  hideTooltip: i,
1207
- timeoutRef: l
1342
+ timeoutRef: d
1208
1343
  };
1209
1344
  }
1210
- function Oe({
1345
+ function rt({
1211
1346
  id: o,
1212
1347
  children: a,
1213
- message: e,
1214
- placement: n = "top",
1215
- disabled: t = !1,
1216
- delay: r = 200,
1348
+ message: t,
1349
+ placement: r = "top",
1350
+ disabled: e = !1,
1351
+ delay: n = 200,
1217
1352
  className: s
1218
1353
  }) {
1219
- const [d, c] = x(!1), [l, b] = x(!1), [i, v] = x(null), [f, m] = x(!1), [g, h] = x(!1), [y, p] = x(!1), { calculatePosition: N } = ke(n), { triggerRef: D, tooltipRef: $, updatePosition: F } = Le(N, l, v), { showTooltip: k, hideTooltip: L, timeoutRef: U } = Re(
1220
- t,
1221
- r,
1354
+ const [l, u] = x(!1), [d, b] = x(!1), [i, v] = x(null), [f, m] = x(!1), [g, h] = x(!1), [w, p] = x(!1), { calculatePosition: N } = Be(r), { triggerRef: z, tooltipRef: C, updatePosition: L } = Se(N, d, v), { showTooltip: B, hideTooltip: S, timeoutRef: Q } = je(
1355
+ e,
1356
+ n,
1222
1357
  b,
1223
- c,
1224
- F,
1358
+ u,
1359
+ L,
1225
1360
  f,
1226
1361
  g,
1227
- y,
1228
- d
1229
- ), O = I(), _ = o ?? O;
1230
- return /* @__PURE__ */ E(J, { children: [
1231
- z.cloneElement(a, {
1232
- ref: (V) => {
1233
- D.current = V;
1362
+ w,
1363
+ l
1364
+ ), O = $(), M = o ?? O;
1365
+ return /* @__PURE__ */ E(W, { children: [
1366
+ D.cloneElement(a, {
1367
+ ref: (H) => {
1368
+ z.current = H;
1234
1369
  },
1235
1370
  onMouseEnter: () => {
1236
- m(!0), k();
1371
+ m(!0), B();
1237
1372
  },
1238
1373
  onMouseLeave: () => {
1239
1374
  m(!1);
1240
1375
  },
1241
1376
  onFocus: () => {
1242
- p(!0), k();
1377
+ p(!0), B();
1243
1378
  },
1244
1379
  onBlur: () => {
1245
- p(!1), L(!0);
1380
+ p(!1), S(!0);
1246
1381
  },
1247
- onKeyDown: (V) => {
1248
- V.key === "Escape" && L(!0);
1382
+ onKeyDown: (H) => {
1383
+ H.key === "Escape" && S(!0);
1249
1384
  },
1250
- "aria-describedby": t ? void 0 : _
1385
+ "aria-describedby": e ? void 0 : M
1251
1386
  }),
1252
- l && M(
1253
- /* @__PURE__ */ u(
1387
+ d && _(
1388
+ /* @__PURE__ */ c(
1254
1389
  "div",
1255
1390
  {
1256
- ref: $,
1257
- id: _,
1391
+ ref: C,
1392
+ id: M,
1258
1393
  role: "tooltip",
1259
- className: w(
1260
- "fixed z-50 px-2 py-1 text-sm rounded shadow-lg pointer-events-auto transition-all duration-150 ease-out",
1261
- d ? "opacity-100" : "opacity-0",
1394
+ className: y(
1395
+ "fixed z-50 px-2 py-1 text-sm rounded shadow-lg bg-popover pointer-events-auto transition-all duration-150 ease-out",
1396
+ l ? "opacity-100" : "opacity-0",
1262
1397
  s
1263
1398
  ),
1264
1399
  style: i ? { left: i.x, top: i.y } : { opacity: 0 },
1265
1400
  onMouseEnter: () => {
1266
- h(!0), U.current && clearTimeout(U.current);
1401
+ h(!0), Q.current && clearTimeout(Q.current);
1267
1402
  },
1268
1403
  onMouseLeave: () => {
1269
1404
  h(!1);
1270
1405
  },
1271
- children: e
1406
+ children: t
1272
1407
  }
1273
1408
  ),
1274
1409
  document.body
@@ -1276,24 +1411,25 @@ function Oe({
1276
1411
  ] });
1277
1412
  }
1278
1413
  export {
1279
- Ke as Accordion,
1414
+ Ue as Accordion,
1280
1415
  q as AccordionItem,
1281
- tt as ActionModal,
1416
+ at as ActionModal,
1282
1417
  me as Button,
1283
- de as ButtonLoadingDots,
1284
- Ge as Checkbox,
1285
- We as Clickable,
1286
- Ue as Input,
1287
- _e as Label,
1288
- Qe as Modal,
1289
- Xe as RadioGroup,
1418
+ ce as ButtonLoadingDots,
1419
+ _e as Checkbox,
1420
+ Qe as Clickable,
1421
+ Me as Input,
1422
+ Xe as Label,
1423
+ Ze as Modal,
1424
+ Je as Panel,
1425
+ Ye as RadioGroup,
1290
1426
  G as RadioGroupItem,
1291
- ye as RadioInput,
1292
- Ze as Separator,
1293
- Je as Slot,
1294
- Ye as Textarea,
1295
- rt as Toast,
1296
- Me as Toggle,
1297
- Oe as Tooltip
1427
+ Ae as RadioInput,
1428
+ Pe as Separator,
1429
+ Oe as Slot,
1430
+ et as Textarea,
1431
+ st as Toast,
1432
+ tt as Toggle,
1433
+ rt as Tooltip
1298
1434
  };
1299
1435
  //# sourceMappingURL=components.esm.js.map