@moondreamsdev/dreamer-ui 1.7.4-test.1 → 1.7.4-test.2

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,122 +1,123 @@
1
- import { jsxs as w, jsx as l } from "react/jsx-runtime";
2
- import I, { useId as E, useState as N, createElement as B, useEffect as A, useCallback as $, useMemo as R, isValidElement as F, cloneElement as q } from "react";
3
- import { join as v } from "./utils.esm.js";
4
- import { b as K, C as G, E as H, a as T, d as Q, c as U, Q as W } from "./QuestionMarkCircled-CIc05alV.js";
5
- function j({
6
- id: o,
1
+ import { jsxs as w, jsx as d, Fragment as G } from "react/jsx-runtime";
2
+ import I, { useId as A, useState as C, createElement as V, useEffect as E, useCallback as $, useMemo as F, useRef as Q, isValidElement as U, cloneElement as W } from "react";
3
+ import { join as p } from "./utils.esm.js";
4
+ import { b as X, C as _, E as J, a as Y, d as Z, c as M, Q as O, X as P } from "./QuestionMarkCircled-JRFAPLtT.js";
5
+ import { createPortal as ee } from "react-dom";
6
+ function L({
7
+ id: n,
7
8
  title: r,
8
9
  content: e,
9
10
  children: t,
10
11
  className: a = "",
11
- disabled: n = !1,
12
+ disabled: o = !1,
12
13
  isOpen: s = !1,
13
- onToggle: i,
14
+ onToggle: l,
14
15
  triggerClassName: u = "",
15
- bodyClassName: g = ""
16
+ bodyClassName: b = ""
16
17
  }) {
17
- const p = E(), d = o || `accordion-item-${p}`, h = `${d}-header`, b = `${d}-panel`, c = () => {
18
- !n && i && i();
19
- }, x = (f) => {
18
+ const v = A(), i = n || `accordion-item-${v}`, x = `${i}-header`, m = `${i}-panel`, c = () => {
19
+ !o && l && l();
20
+ }, y = (f) => {
20
21
  (f.key === "Enter" || f.key === " ") && (f.preventDefault(), c());
21
22
  };
22
- return /* @__PURE__ */ w("div", { className: v("border-b border-gray-200", n && "opacity-60 cursor-not-allowed", a), children: [
23
+ return /* @__PURE__ */ w("div", { className: p("border-b border-gray-200", o && "opacity-60 cursor-not-allowed", a), children: [
23
24
  /* @__PURE__ */ w(
24
25
  "button",
25
26
  {
26
- id: h,
27
+ id: x,
27
28
  type: "button",
28
- className: v(
29
+ className: p(
29
30
  "w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary",
30
- n ? "cursor-not-allowed" : "hover:bg-gray-50/10 cursor-pointer",
31
+ o ? "cursor-not-allowed" : "hover:bg-gray-50/10 cursor-pointer",
31
32
  u
32
33
  ),
33
34
  "aria-expanded": s,
34
- "aria-controls": b,
35
- disabled: n,
35
+ "aria-controls": m,
36
+ disabled: o,
36
37
  onClick: c,
37
- onKeyDown: x,
38
+ onKeyDown: y,
38
39
  children: [
39
- /* @__PURE__ */ l("span", { children: r }),
40
- /* @__PURE__ */ l(
40
+ /* @__PURE__ */ d("span", { children: r }),
41
+ /* @__PURE__ */ d(
41
42
  "span",
42
43
  {
43
- className: v(
44
+ className: p(
44
45
  "transform transition-transform duration-300 ease-linear",
45
46
  s ? "rotate-180" : "rotate-0"
46
47
  ),
47
48
  "aria-hidden": "true",
48
- children: /* @__PURE__ */ l(K, { size: 18 })
49
+ children: /* @__PURE__ */ d(X, { size: 18 })
49
50
  }
50
51
  )
51
52
  ]
52
53
  }
53
54
  ),
54
- /* @__PURE__ */ l(
55
+ /* @__PURE__ */ d(
55
56
  "div",
56
57
  {
57
- id: b,
58
+ id: m,
58
59
  role: "region",
59
- "aria-labelledby": h,
60
- className: v(
60
+ "aria-labelledby": x,
61
+ className: p(
61
62
  "transition-all duration-300 ease-linear px-4",
62
63
  s ? "max-h-96 opacity-100 overflow-auto py-3" : "max-h-0 opacity-0 overflow-hidden",
63
- g
64
+ b
64
65
  ),
65
66
  children: s && (t || e)
66
67
  }
67
68
  )
68
69
  ] });
69
70
  }
70
- function le({
71
- name: o,
71
+ function Ce({
72
+ name: n,
72
73
  items: r = [],
73
74
  children: e,
74
75
  className: t = "",
75
76
  itemClassName: a = "",
76
- allowMultiple: n = !1,
77
+ allowMultiple: o = !1,
77
78
  defaultOpenItems: s = [],
78
- triggersClassName: i = "",
79
+ triggersClassName: l = "",
79
80
  bodiesClassName: u = ""
80
81
  }) {
81
- const g = E(), p = o || `accordion-group-${g}`, [d, h] = N(new Set(s)), b = (f) => {
82
- h((y) => {
83
- const m = new Set(y);
84
- return m.has(f) ? m.delete(f) : (n || m.clear(), m.add(f)), m;
82
+ const b = A(), v = n || `accordion-group-${b}`, [i, x] = C(new Set(s)), m = (f) => {
83
+ x((h) => {
84
+ const g = new Set(h);
85
+ return g.has(f) ? g.delete(f) : (o || g.clear(), g.add(f)), g;
85
86
  });
86
- }, c = (f) => `${g}-item-${f}`, x = (f) => d.has(f);
87
- return /* @__PURE__ */ w("div", { id: p, className: t, children: [
88
- r.length > 0 && r.map((f, y) => {
89
- const m = f.id || c(y);
90
- return /* @__PURE__ */ l(
91
- j,
87
+ }, c = (f) => `${b}-item-${f}`, y = (f) => i.has(f);
88
+ return /* @__PURE__ */ w("div", { id: v, className: t, children: [
89
+ r.length > 0 && r.map((f, h) => {
90
+ const g = f.id || c(h);
91
+ return /* @__PURE__ */ d(
92
+ L,
92
93
  {
93
- id: m,
94
+ id: g,
94
95
  title: f.title,
95
96
  content: f.content,
96
97
  disabled: f.disabled,
97
- isOpen: x(m),
98
- onToggle: () => b(m),
98
+ isOpen: y(g),
99
+ onToggle: () => m(g),
99
100
  className: a,
100
- triggerClassName: i,
101
+ triggerClassName: l,
101
102
  bodyClassName: u
102
103
  },
103
- m
104
+ g
104
105
  );
105
106
  }),
106
- r.length === 0 && e && I.Children.map(e, (f, y) => {
107
- if (I.isValidElement(f) && f.type === j) {
108
- const m = f.props.id || c(y);
109
- return /* @__PURE__ */ B(
110
- j,
107
+ r.length === 0 && e && I.Children.map(e, (f, h) => {
108
+ if (I.isValidElement(f) && f.type === L) {
109
+ const g = f.props.id || c(h);
110
+ return /* @__PURE__ */ V(
111
+ L,
111
112
  {
112
113
  ...f.props,
113
- key: m,
114
- id: m,
115
- className: v(a, f.props.className),
116
- isOpen: x(m),
117
- onToggle: () => b(m),
118
- triggerClassName: v(i, f.props.triggerClassName),
119
- bodyClassName: v(u, f.props.bodyClassName)
114
+ key: g,
115
+ id: g,
116
+ className: p(a, f.props.className),
117
+ isOpen: y(g),
118
+ onToggle: () => m(g),
119
+ triggerClassName: p(l, f.props.triggerClassName),
120
+ bodyClassName: p(u, f.props.bodyClassName)
120
121
  }
121
122
  );
122
123
  }
@@ -124,25 +125,25 @@ function le({
124
125
  })
125
126
  ] });
126
127
  }
127
- function _() {
128
- const [o, r] = N(0);
129
- return A(() => {
128
+ function re() {
129
+ const [n, r] = C(0);
130
+ return E(() => {
130
131
  const e = setInterval(() => {
131
132
  r((t) => (t + 1) % 3);
132
133
  }, 500);
133
134
  return () => clearInterval(e);
134
- }, []), /* @__PURE__ */ l("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((e) => /* @__PURE__ */ l(
135
+ }, []), /* @__PURE__ */ d("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((e) => /* @__PURE__ */ d(
135
136
  "div",
136
137
  {
137
- className: v(
138
+ className: p(
138
139
  "rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",
139
- o === e && "transform -translate-y-1"
140
+ n === e && "transform -translate-y-1"
140
141
  )
141
142
  },
142
143
  e
143
144
  )) });
144
145
  }
145
- const J = {
146
+ const te = {
146
147
  base: "",
147
148
  primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
148
149
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
@@ -150,7 +151,7 @@ const J = {
150
151
  outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
151
152
  link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
152
153
  danger: "bg-danger text-danger-foreground hover:bg-danger/85 disabled:bg-muted disabled:text-muted-foreground"
153
- }, X = {
154
+ }, ne = {
154
155
  stripped: "",
155
156
  fitted: "size-fit",
156
157
  sm: "px-2 py-1 text-sm",
@@ -158,61 +159,61 @@ const J = {
158
159
  lg: "px-6 py-3 text-lg",
159
160
  icon: "p-1 w-fit aspect-square",
160
161
  full: "p-2 w-full"
161
- }, Y = {
162
+ }, ae = {
162
163
  none: "rounded-none",
163
164
  sm: "rounded-sm",
164
165
  md: "rounded-md",
165
166
  lg: "rounded-lg",
166
167
  full: "rounded-full"
167
- }, k = {
168
+ }, j = {
168
169
  variant: "primary",
169
170
  size: "md",
170
171
  rounded: "md"
171
172
  };
172
- function ue({
173
- variant: o = k.variant,
173
+ function oe({
174
+ variant: n = j.variant,
174
175
  size: r,
175
- rounded: e = k.rounded,
176
+ rounded: e = j.rounded,
176
177
  loading: t,
177
178
  linkTo: a,
178
- linkProps: n,
179
+ linkProps: o,
179
180
  type: s = "button",
180
- className: i,
181
+ className: l,
181
182
  ...u
182
183
  }) {
183
- let g;
184
- o === "link" && !r ? g = "fitted" : g = r || k.size;
185
- const d = v(
184
+ let b;
185
+ n === "link" && !r ? b = "fitted" : b = r || j.size;
186
+ const i = p(
186
187
  "appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
187
- J[o],
188
- X[g],
189
- Y[e],
188
+ te[n],
189
+ ne[b],
190
+ ae[e],
190
191
  t && "relative pointer-events-none",
191
192
  a && "relative",
192
- i
193
+ l
193
194
  );
194
195
  return /* @__PURE__ */ w(
195
196
  "button",
196
197
  {
197
198
  ...u,
198
199
  role: a ? "link" : u.role,
199
- "aria-label": u["aria-label"] || (n == null ? void 0 : n["aria-label"]),
200
- "aria-description": u["aria-description"] || (n == null ? void 0 : n["aria-description"]),
200
+ "aria-label": u["aria-label"] || (o == null ? void 0 : o["aria-label"]),
201
+ "aria-description": u["aria-description"] || (o == null ? void 0 : o["aria-description"]),
201
202
  "aria-disabled": u.disabled || t,
202
203
  "aria-busy": t,
203
204
  type: s,
204
- className: d,
205
+ className: i,
205
206
  children: [
206
- t && /* @__PURE__ */ l(_, {}),
207
- /* @__PURE__ */ l("span", { className: v(t && "invisible"), children: u.children }),
208
- a && !u.disabled && /* @__PURE__ */ l(
207
+ t && /* @__PURE__ */ d(re, {}),
208
+ /* @__PURE__ */ d("span", { className: p(t && "invisible"), children: u.children }),
209
+ a && !u.disabled && /* @__PURE__ */ d(
209
210
  "a",
210
211
  {
211
- ...n,
212
+ ...o,
212
213
  "aria-hidden": !0,
213
214
  href: a,
214
- target: (n == null ? void 0 : n.target) || "_blank",
215
- rel: (n == null ? void 0 : n.rel) || "noreferrer",
215
+ target: (o == null ? void 0 : o.target) || "_blank",
216
+ rel: (o == null ? void 0 : o.rel) || "noreferrer",
216
217
  className: "absolute inset-0"
217
218
  }
218
219
  )
@@ -220,108 +221,108 @@ function ue({
220
221
  }
221
222
  );
222
223
  }
223
- function Z(o) {
224
- const [r, e] = N(""), t = $((a) => {
225
- let n = a, s = "";
226
- for (; n && !s; ) {
227
- const i = window.getComputedStyle(n).backgroundColor;
228
- i && i !== "transparent" && i !== "rgba(0, 0, 0, 0)" && (s = i), n = n.parentElement;
224
+ function se(n) {
225
+ const [r, e] = C(""), t = $((a) => {
226
+ let o = a, s = "";
227
+ for (; o && !s; ) {
228
+ const l = window.getComputedStyle(o).backgroundColor;
229
+ l && l !== "transparent" && l !== "rgba(0, 0, 0, 0)" && (s = l), o = o.parentElement;
229
230
  }
230
231
  return s || "transparent";
231
232
  }, []);
232
- return A(() => {
233
- const a = document.getElementById(o);
233
+ return E(() => {
234
+ const a = document.getElementById(n);
234
235
  if (a) {
235
- const n = t(a.parentElement);
236
- e(n);
236
+ const o = t(a.parentElement);
237
+ e(o);
237
238
  }
238
- }, [o, t]), r;
239
+ }, [n, t]), r;
239
240
  }
240
- function ce({
241
- ref: o,
241
+ function Ee({
242
+ ref: n,
242
243
  id: r,
243
244
  size: e = 20,
244
245
  color: t,
245
246
  filled: a = !1,
246
- rounded: n = !0,
247
+ rounded: o = !0,
247
248
  checked: s = !1,
248
- onCheckedChange: i,
249
+ onCheckedChange: l,
249
250
  disabled: u,
250
- className: g = "",
251
- ...p
251
+ className: b = "",
252
+ ...v
252
253
  }) {
253
- const d = E(), h = R(() => r || `checkbox-${d}`, [r, d]), b = Z(h), [c, x] = N(s);
254
- A(() => {
255
- x(s);
254
+ const i = A(), x = F(() => r || `checkbox-${i}`, [r, i]), m = se(x), [c, y] = C(s);
255
+ E(() => {
256
+ y(s);
256
257
  }, [s]);
257
258
  const f = () => {
258
- u || (x(!c), i == null || i(!c));
259
- }, y = (C) => {
260
- C.key === " " && (C.preventDefault(), f());
261
- }, m = v(
259
+ u || (y(!c), l == null || l(!c));
260
+ }, h = (N) => {
261
+ N.key === " " && (N.preventDefault(), f());
262
+ }, g = p(
262
263
  "flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2",
263
- n && "rounded",
264
+ o && "rounded",
264
265
  u && "opacity-40 cursor-not-allowed",
265
266
  !u && "cursor-pointer",
266
- g
267
+ b
267
268
  );
268
- return /* @__PURE__ */ l(
269
+ return /* @__PURE__ */ d(
269
270
  "button",
270
271
  {
271
- id: h,
272
+ id: x,
272
273
  type: "button",
273
- ref: o,
274
+ ref: n,
274
275
  tabIndex: 0,
275
276
  role: "checkbox",
276
277
  onClick: f,
277
278
  "aria-checked": c,
278
279
  "aria-disabled": u,
279
- onKeyDownCapture: y,
280
+ onKeyDownCapture: h,
280
281
  style: {
281
282
  width: e,
282
283
  height: e,
283
284
  color: t,
284
285
  backgroundColor: c && a ? "currentcolor" : "transparent"
285
286
  },
286
- className: m,
287
- ...p,
288
- children: c && /* @__PURE__ */ l(G, { size: e, color: a ? b : void 0 })
287
+ className: g,
288
+ ...v,
289
+ children: c && /* @__PURE__ */ d(_, { size: e, color: a ? m : void 0 })
289
290
  }
290
291
  );
291
292
  }
292
- function fe({
293
- children: o,
293
+ function Ae({
294
+ children: n,
294
295
  className: r,
295
296
  linkTo: e,
296
297
  linkProps: t,
297
298
  onButtonClick: a,
298
- buttonProps: n,
299
+ buttonProps: o,
299
300
  ...s
300
301
  }) {
301
- return e && a && console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'), /* @__PURE__ */ w("div", { className: v("relative w-fit", r), ...s, children: [
302
- o,
303
- e && /* @__PURE__ */ l(
302
+ return e && a && console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'), /* @__PURE__ */ w("div", { className: p("relative w-fit", r), ...s, children: [
303
+ n,
304
+ e && /* @__PURE__ */ d(
304
305
  "a",
305
306
  {
306
307
  ...t,
307
308
  href: e,
308
- className: v("absolute inset-0", t == null ? void 0 : t.className)
309
+ className: p("absolute inset-0", t == null ? void 0 : t.className)
309
310
  }
310
311
  ),
311
- !e && a && /* @__PURE__ */ l(
312
+ !e && a && /* @__PURE__ */ d(
312
313
  "button",
313
314
  {
314
- ...n,
315
+ ...o,
315
316
  type: "button",
316
317
  onClick: a,
317
- className: v("absolute inset-0 cursor-pointer", n == null ? void 0 : n.className)
318
+ className: p("absolute inset-0 cursor-pointer", o == null ? void 0 : o.className)
318
319
  }
319
320
  )
320
321
  ] });
321
322
  }
322
- function D({ elementId: o, type: r, message: e }) {
323
- return A(() => {
324
- const t = document.getElementById(o);
323
+ function D({ elementId: n, type: r, message: e }) {
324
+ return E(() => {
325
+ const t = document.getElementById(n);
325
326
  if (t) {
326
327
  if (!e && r === "error") {
327
328
  t.removeAttribute("data-error");
@@ -331,159 +332,278 @@ function D({ elementId: o, type: r, message: e }) {
331
332
  t.removeAttribute("data-success");
332
333
  return;
333
334
  }
334
- return t.setAttribute("aria-describedby", `${o}-${r}-message`), t.setAttribute("aria-invalid", r === "error" ? "true" : "false"), r === "error" && t.setAttribute("data-error", "true"), r === "success" && t.setAttribute("data-success", "true"), () => {
335
+ return t.setAttribute("aria-describedby", `${n}-${r}-message`), t.setAttribute("aria-invalid", r === "error" ? "true" : "false"), r === "error" && t.setAttribute("data-error", "true"), r === "success" && t.setAttribute("data-success", "true"), () => {
335
336
  t.removeAttribute("aria-describedby"), t.removeAttribute("aria-invalid"), t.removeAttribute("data-error"), t.removeAttribute("data-success");
336
337
  };
337
338
  }
338
- }, [o, r, e]), e ? /* @__PURE__ */ w(
339
+ }, [n, r, e]), e ? /* @__PURE__ */ w(
339
340
  "small",
340
341
  {
341
- className: v(
342
+ className: p(
342
343
  "mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start",
343
344
  r === "error" && "text-danger",
344
345
  r === "success" && "text-success"
345
346
  ),
346
347
  role: "status",
347
348
  children: [
348
- r === "error" ? /* @__PURE__ */ l(H, {}) : /* @__PURE__ */ l(T, {}),
349
- /* @__PURE__ */ l("span", { id: `${o}-${r}-message`, children: e })
349
+ r === "error" ? /* @__PURE__ */ d(J, {}) : /* @__PURE__ */ d(Y, {}),
350
+ /* @__PURE__ */ d("span", { id: `${n}-${r}-message`, children: e })
350
351
  ]
351
352
  }
352
353
  ) : null;
353
354
  }
354
- const O = {
355
+ const ie = {
355
356
  base: "",
356
357
  default: "ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-danger not-disabled:data-success:ring-success",
357
358
  underline: "border-b border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success",
358
359
  outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success"
359
- }, M = {
360
+ }, de = {
360
361
  none: "rounded-none",
361
362
  sm: "rounded-sm",
362
363
  md: "rounded-md",
363
364
  lg: "rounded-lg",
364
365
  full: "px-3 rounded-full"
365
- }, L = {
366
+ }, B = {
366
367
  variant: "default",
367
368
  rounded: "none"
368
369
  };
369
- function be({
370
- variant: o = L.variant,
370
+ function $e({
371
+ variant: n = B.variant,
371
372
  rounded: r,
372
373
  displayOnlyMode: e = !1,
373
374
  errorMessage: t,
374
375
  successMessage: a,
375
- type: n = "text",
376
+ type: o = "text",
376
377
  className: s,
377
- ...i
378
+ ...l
378
379
  }) {
379
- const u = E(), [g, p] = N(!1);
380
- let d = r;
381
- o === "outline" && !r && (d = "md"), d = d || L.rounded;
382
- const c = v(
380
+ const u = A(), [b, v] = C(!1);
381
+ let i = r;
382
+ n === "outline" && !r && (i = "md"), i = i || B.rounded;
383
+ const c = p(
383
384
  "appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",
384
385
  "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",
385
- !e && O[o],
386
- !e && M[d],
387
- n === "password" && "pr-10",
386
+ !e && ie[n],
387
+ !e && de[i],
388
+ o === "password" && "pr-10",
388
389
  !e && "px-2 py-1",
389
390
  e && "pointer-events-none",
390
391
  s
391
392
  );
392
- return /* @__PURE__ */ w("div", { className: v(e && "cursor-text"), style: { height: i.height, width: i.width }, children: [
393
- /* @__PURE__ */ w("div", { className: v(n === "password" && "relative"), children: [
394
- /* @__PURE__ */ l(
393
+ return /* @__PURE__ */ w("div", { className: p(e && "cursor-text"), style: { height: l.height, width: l.width }, children: [
394
+ /* @__PURE__ */ w("div", { className: p(o === "password" && "relative"), children: [
395
+ /* @__PURE__ */ d(
395
396
  "input",
396
397
  {
397
- ...i,
398
+ ...l,
398
399
  id: u,
399
- type: n === "password" && g ? "text" : n,
400
- "aria-disabled": i.disabled,
400
+ type: o === "password" && b ? "text" : o,
401
+ "aria-disabled": l.disabled,
401
402
  readOnly: e,
402
- "aria-readonly": e || i["aria-readonly"],
403
+ "aria-readonly": e || l["aria-readonly"],
403
404
  "data-error": t ? !0 : void 0,
404
405
  "data-success": a ? !0 : void 0,
405
406
  className: c
406
407
  }
407
408
  ),
408
- n === "password" && /* @__PURE__ */ l(
409
+ o === "password" && /* @__PURE__ */ d(
409
410
  "button",
410
411
  {
411
- onClick: () => p(!g),
412
+ onClick: () => v(!b),
412
413
  className: "absolute inset-y-0 right-0 px-2 hover:cursor-pointer",
413
414
  "aria-label": "Toggle password visibility",
414
- "data-state": g ? "visible" : "hidden",
415
- children: g ? /* @__PURE__ */ l(Q, { size: 20 }) : /* @__PURE__ */ l(U, { size: 20 })
415
+ "data-state": b ? "visible" : "hidden",
416
+ children: b ? /* @__PURE__ */ d(Z, { size: 20 }) : /* @__PURE__ */ d(M, { size: 20 })
416
417
  }
417
418
  )
418
419
  ] }),
419
- !e && /* @__PURE__ */ l(D, { elementId: u, type: "error", message: t }),
420
- !e && /* @__PURE__ */ l(D, { elementId: u, type: "success", message: a })
420
+ !e && /* @__PURE__ */ d(D, { elementId: u, type: "error", message: t }),
421
+ !e && /* @__PURE__ */ d(D, { elementId: u, type: "success", message: a })
421
422
  ] });
422
423
  }
423
- function me({
424
- display: o = "inline",
424
+ function Ie({
425
+ display: n = "inline",
425
426
  width: r = "fit-content",
426
427
  className: e = "",
427
428
  required: t,
428
429
  helpMessage: a,
429
- suffix: n,
430
+ suffix: o,
430
431
  htmlFor: s,
431
- children: i,
432
+ children: l,
432
433
  ...u
433
434
  }) {
434
- const g = E(), p = v("font-medium", o, e), d = a ? `${s ?? g}-help` : void 0;
435
- return /* @__PURE__ */ w("div", { style: { display: o === "inline" ? "inline-flex" : "flex", width: r }, className: "relative", children: [
436
- /* @__PURE__ */ w("label", { className: p, htmlFor: s, ...u, children: [
437
- i,
438
- t && /* @__PURE__ */ l("span", { className: "text-red-500 font-medium ml-1", "aria-label": "required", children: "*" })
435
+ const b = A(), v = p("font-medium", n, e), i = a ? `${s ?? b}-help` : void 0;
436
+ return /* @__PURE__ */ w("div", { style: { display: n === "inline" ? "inline-flex" : "flex", width: r }, className: "relative", children: [
437
+ /* @__PURE__ */ w("label", { className: v, htmlFor: s, ...u, children: [
438
+ l,
439
+ t && /* @__PURE__ */ d("span", { className: "text-red-500 font-medium ml-1", "aria-label": "required", children: "*" })
439
440
  ] }),
440
- a && /* @__PURE__ */ l(
441
+ a && /* @__PURE__ */ d(
441
442
  "span",
442
443
  {
443
444
  className: "text-gray-500 ml-1 size-fit -translate-y-1/3",
444
- "aria-describedby": d,
445
+ "aria-describedby": i,
445
446
  "aria-label": "Help information",
446
447
  title: a,
447
- children: /* @__PURE__ */ l(W, {})
448
+ children: /* @__PURE__ */ d(O, {})
448
449
  }
449
450
  ),
450
- a && /* @__PURE__ */ l("div", { id: d, className: "sr-only", children: a }),
451
- n && /* @__PURE__ */ l("span", { className: "ml-1", children: n })
451
+ a && /* @__PURE__ */ d("div", { id: i, className: "sr-only", children: a }),
452
+ o && /* @__PURE__ */ d("span", { className: "ml-1", children: o })
452
453
  ] });
453
454
  }
454
- function ge({ children: o, ref: r, ...e }) {
455
- if (F(o)) {
455
+ function z(...n) {
456
+ return n.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
457
+ }
458
+ function le({ isOpen: n }) {
459
+ const [r, e] = C(!1), [t, a] = C(!1);
460
+ return E(() => {
461
+ n ? (a(!0), setTimeout(() => e(!0), 10)) : (e(!1), setTimeout(() => a(!1), 150));
462
+ }, [n]), { show: r, shouldRender: t };
463
+ }
464
+ function ue({ isOpen: n, onClose: r }) {
465
+ E(() => {
466
+ const e = (t) => {
467
+ t.key === "Escape" && n && r();
468
+ };
469
+ return document.addEventListener("keydown", e), n && (document.body.style.overflow = "hidden"), () => {
470
+ document.removeEventListener("keydown", e), document.body.style.overflow = "auto";
471
+ };
472
+ }, [n, r]);
473
+ }
474
+ function ce({ modalId: n, isOpen: r }) {
475
+ const e = Q(null), t = $(() => {
476
+ const a = document.getElementById(n);
477
+ if (!a) return;
478
+ const o = a.querySelectorAll('[data-modal-action="true"]');
479
+ if (o.length > 0) {
480
+ o[0].focus();
481
+ return;
482
+ }
483
+ const s = a.querySelectorAll(
484
+ 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
485
+ );
486
+ if (s.length > 0) {
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
+ return;
491
+ }
492
+ s[0].focus();
493
+ return;
494
+ }
495
+ a.focus();
496
+ }, [n]);
497
+ E(() => (r && (e.current = document.activeElement, t()), () => {
498
+ document.body.style.overflow = "auto", e.current instanceof HTMLElement && e.current.focus();
499
+ }), [r, t]);
500
+ }
501
+ function De({
502
+ id: n,
503
+ isOpen: r,
504
+ onClose: e,
505
+ title: t,
506
+ children: a,
507
+ contentOnly: o = !1,
508
+ className: s,
509
+ overlayClassName: l,
510
+ hideCloseButton: u = !1,
511
+ actions: b = [],
512
+ disableCloseOnOverlayClick: v = !1,
513
+ ariaLabelledBy: i,
514
+ ariaDescribedBy: x
515
+ }) {
516
+ const m = A(), c = n || `modal-${m}`, y = n ? `${n}-title` : `modal-title-${m}`, { show: f, shouldRender: h } = le({ isOpen: r });
517
+ if (ce({ modalId: c, isOpen: h }), ue({ isOpen: h, onClose: e }), !h) return null;
518
+ const g = () => t ? I.isValidElement(t) ? /* @__PURE__ */ d("div", { className: "mb-4", children: t }) : /* @__PURE__ */ d("h2", { className: "mb-4 text-xl font-semibold", id: y, children: t }) : null, N = () => b.length === 0 ? null : /* @__PURE__ */ d("div", { className: "mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3", children: b.map((k, q) => {
519
+ const { label: T, className: H, ...K } = k;
520
+ return /* @__PURE__ */ d(oe, { className: H, type: "button", ...K, "data-modal-action": "true", children: T }, q);
521
+ }) });
522
+ return /* @__PURE__ */ d(G, { children: ee(
523
+ /* @__PURE__ */ d(
524
+ "div",
525
+ {
526
+ "aria-labelledby": i ?? t ? y : void 0,
527
+ "aria-describedby": x,
528
+ role: "dialog",
529
+ "aria-modal": "true",
530
+ className: "fixed inset-0 z-[100] overflow-y-auto",
531
+ children: /* @__PURE__ */ w("div", { className: "flex min-h-screen items-center justify-center p-4", children: [
532
+ /* @__PURE__ */ d(
533
+ "div",
534
+ {
535
+ className: z("fixed inset-0 bg-black/20 transition-all", l),
536
+ onClick: () => {
537
+ v || e();
538
+ }
539
+ }
540
+ ),
541
+ o && /* @__PURE__ */ d("div", { className: z("relative w-fit", s), children: a }),
542
+ !o && /* @__PURE__ */ w(
543
+ "div",
544
+ {
545
+ id: c,
546
+ tabIndex: -1,
547
+ className: z(
548
+ "relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:border ease-in duration-75",
549
+ f ? "opacity-100 scale-100" : "opacity-0 scale-90",
550
+ s
551
+ ),
552
+ children: [
553
+ !u && /* @__PURE__ */ d(
554
+ "button",
555
+ {
556
+ onClick: e,
557
+ "data-modal-close-button": "true",
558
+ 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",
559
+ children: /* @__PURE__ */ d(P, { size: 18 })
560
+ }
561
+ ),
562
+ g(),
563
+ a,
564
+ N()
565
+ ]
566
+ }
567
+ )
568
+ ] })
569
+ }
570
+ ),
571
+ document.body
572
+ ) });
573
+ }
574
+ function ke({ children: n, ref: r, ...e }) {
575
+ if (U(n)) {
456
576
  let t = { ...e };
457
- return o.props && (t = { ...t, ...o.props }), q(o, {
577
+ return n.props && (t = { ...t, ...n.props }), W(n, {
458
578
  ...t,
459
579
  ref: (a) => {
460
580
  typeof r == "function" ? r(a) : r && (r.current = a);
461
581
  }
462
582
  });
463
583
  }
464
- return B("div", { ...e, ref: r }, o);
584
+ return V("div", { ...e, ref: r }, n);
465
585
  }
466
- function P({ itemId: o, checked: r, onChange: e, name: t, disabled: a = !1, className: n = "" }) {
467
- const s = "relative inline-flex items-center justify-center rounded-full", i = () => {
586
+ function fe({ itemId: n, checked: r, onChange: e, name: t, disabled: a = !1, className: o = "" }) {
587
+ const s = "relative inline-flex items-center justify-center rounded-full", l = () => {
468
588
  a || e();
469
- }, u = v(
589
+ }, u = p(
470
590
  s,
471
591
  !r && "hover:border-current/60",
472
592
  !a && "border-current cursor-pointer",
473
593
  a && "border-muted/60 cursor-not-allowed",
474
- n
594
+ o
475
595
  );
476
- return /* @__PURE__ */ l(
596
+ return /* @__PURE__ */ d(
477
597
  "div",
478
598
  {
479
- id: o,
599
+ id: n,
480
600
  role: "radio",
481
601
  tabIndex: -1,
482
602
  "aria-checked": r,
483
603
  "aria-disabled": a,
484
604
  "aria-description": `Radio button for ${t}`,
485
- "aria-labelledby": `${o}-label`,
486
- onClick: i,
605
+ "aria-labelledby": `${n}-label`,
606
+ onClick: l,
487
607
  className: u,
488
608
  style: {
489
609
  width: "1em",
@@ -491,75 +611,75 @@ function P({ itemId: o, checked: r, onChange: e, name: t, disabled: a = !1, clas
491
611
  padding: "0.1em",
492
612
  borderWidth: "0.06em"
493
613
  },
494
- children: r && /* @__PURE__ */ l(
614
+ children: r && /* @__PURE__ */ d(
495
615
  "div",
496
616
  {
497
- className: v("size-full aspect-square rounded-full", a && "bg-muted/60", !a && "bg-current")
617
+ className: p("size-full aspect-square rounded-full", a && "bg-muted/60", !a && "bg-current")
498
618
  }
499
619
  )
500
620
  }
501
621
  );
502
622
  }
503
- function z({
504
- value: o,
623
+ function S({
624
+ value: n,
505
625
  children: r,
506
626
  className: e = "",
507
627
  isSelected: t = !1,
508
628
  onChange: a,
509
- disabled: n = !1,
629
+ disabled: o = !1,
510
630
  hideInput: s = !1,
511
- description: i,
631
+ description: l,
512
632
  name: u
513
633
  }) {
514
- const p = `radio-${E()}-${o}`, d = () => {
515
- n || a == null || a(o);
634
+ const v = `radio-${A()}-${n}`, i = () => {
635
+ o || a == null || a(n);
516
636
  };
517
637
  return /* @__PURE__ */ w(
518
638
  "div",
519
639
  {
520
- title: i,
521
- className: v(
640
+ title: l,
641
+ className: p(
522
642
  "relative flex items-center",
523
643
  e,
524
644
  // Uses text color for borders
525
- s && `p-2 border-2 focus-within:border-dashed focus-within:${n ? "border-current/50" : "border-current/80"}`,
526
- s && !t && `border-transparent ${n ? "" : "not-focus-within:hover:border-border/60"}`,
645
+ s && `p-2 border-2 focus-within:border-dashed focus-within:${o ? "border-current/50" : "border-current/80"}`,
646
+ s && !t && `border-transparent ${o ? "" : "not-focus-within:hover:border-border/60"}`,
527
647
  s && t && "border-border",
528
- n && "opacity-60 cursor-not-allowed"
648
+ o && "opacity-60 cursor-not-allowed"
529
649
  ),
530
650
  style: {
531
651
  gap: "0.5em"
532
652
  },
533
653
  children: [
534
- !s && /* @__PURE__ */ l(
535
- P,
654
+ !s && /* @__PURE__ */ d(
655
+ fe,
536
656
  {
537
- itemId: p,
657
+ itemId: v,
538
658
  name: u || "",
539
659
  checked: t,
540
- onChange: d,
541
- disabled: n,
542
- className: v(s && "")
660
+ onChange: i,
661
+ disabled: o,
662
+ className: p(s && "")
543
663
  }
544
664
  ),
545
- /* @__PURE__ */ l(
665
+ /* @__PURE__ */ d(
546
666
  "div",
547
667
  {
548
- id: s ? p : void 0,
668
+ id: s ? v : void 0,
549
669
  tabIndex: s ? -1 : void 0,
550
670
  role: s ? "radio" : void 0,
551
- onClick: s ? d : void 0,
671
+ onClick: s ? i : void 0,
552
672
  "aria-checked": s ? t ? "true" : "false" : void 0,
553
- "aria-disabled": s ? n : void 0,
554
- "aria-description": s ? i || `Radio button for ${u}` : void 0,
555
- "aria-labelledby": s ? `${p}-label` : void 0,
556
- className: v(s && "size-full", typeof r == "object" && "grow focus:outline-none"),
557
- children: /* @__PURE__ */ l(
673
+ "aria-disabled": s ? o : void 0,
674
+ "aria-description": s ? l || `Radio button for ${u}` : void 0,
675
+ "aria-labelledby": s ? `${v}-label` : void 0,
676
+ className: p(s && "size-full", typeof r == "object" && "grow focus:outline-none"),
677
+ children: /* @__PURE__ */ d(
558
678
  "label",
559
679
  {
560
- id: `${p}-label`,
561
- onClick: s ? void 0 : d,
562
- className: v(n && "cursor-not-allowed", !n && "cursor-pointer"),
680
+ id: `${v}-label`,
681
+ onClick: s ? void 0 : i,
682
+ className: p(o && "cursor-not-allowed", !o && "cursor-pointer"),
563
683
  children: r
564
684
  }
565
685
  )
@@ -569,147 +689,147 @@ function z({
569
689
  }
570
690
  );
571
691
  }
572
- function ee(o, r) {
573
- const [e, t] = N(r), [a, n] = N(-1), [s, i] = N(!1), u = $((b, c) => {
574
- var y;
575
- const x = b[c];
576
- x.hasAttribute("disabled") || x.getAttribute("aria-disabled") === "true" || ((y = b[c]) == null || y.click(), n(c));
577
- }, []), g = $(
578
- (b, c) => {
692
+ function me(n, r) {
693
+ const [e, t] = C(r), [a, o] = C(-1), [s, l] = C(!1), u = $((m, c) => {
694
+ var h;
695
+ const y = m[c];
696
+ y.hasAttribute("disabled") || y.getAttribute("aria-disabled") === "true" || ((h = m[c]) == null || h.click(), o(c));
697
+ }, []), b = $(
698
+ (m, c) => {
579
699
  var f;
580
- if (b.preventDefault(), s || !c.length) return;
581
- const x = r !== -1 ? r : 0;
582
- (f = c[x]) == null || f.focus(), t(x), r !== -1 && u(c, x);
700
+ if (m.preventDefault(), s || !c.length) return;
701
+ const y = r !== -1 ? r : 0;
702
+ (f = c[y]) == null || f.focus(), t(y), r !== -1 && u(c, y);
583
703
  },
584
704
  [r, s, u]
585
- ), p = $(
586
- (b) => {
587
- var y;
588
- if (!b.shiftKey)
705
+ ), v = $(
706
+ (m) => {
707
+ var h;
708
+ if (!m.shiftKey)
589
709
  return;
590
- b.preventDefault();
710
+ m.preventDefault();
591
711
  const c = Array.from(
592
712
  document.querySelectorAll(
593
713
  'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
594
714
  )
595
- ).filter((m) => !m.hasAttribute("disabled") && m.tabIndex >= 0), x = c.findIndex((m) => m.id === o), f = x > 0 ? x - 1 : c.length - 1;
596
- (y = c[f]) == null || y.focus();
715
+ ).filter((g) => !g.hasAttribute("disabled") && g.tabIndex >= 0), y = c.findIndex((g) => g.id === n), f = y > 0 ? y - 1 : c.length - 1;
716
+ (h = c[f]) == null || h.focus();
597
717
  },
598
- [o]
599
- ), d = $(
600
- (b, c) => {
601
- var C;
718
+ [n]
719
+ ), i = $(
720
+ (m, c) => {
721
+ var N;
602
722
  if (!c.length) return;
603
- const x = b.target;
604
- if (!c.some((V) => V.id === x.id)) return;
605
- const y = e !== -1 ? e : 0;
606
- let m = y;
607
- switch (b.key) {
723
+ const y = m.target;
724
+ if (!c.some((k) => k.id === y.id)) return;
725
+ const h = e !== -1 ? e : 0;
726
+ let g = h;
727
+ switch (m.key) {
608
728
  case "ArrowUp":
609
729
  case "ArrowLeft":
610
- b.preventDefault(), m = y > 0 ? y - 1 : c.length - 1;
730
+ m.preventDefault(), g = h > 0 ? h - 1 : c.length - 1;
611
731
  break;
612
732
  case "ArrowDown":
613
733
  case "ArrowRight":
614
- b.preventDefault(), m = (y + 1) % c.length;
734
+ m.preventDefault(), g = (h + 1) % c.length;
615
735
  break;
616
736
  // Select the option when the space key is pressed
617
737
  case " ":
618
- b.preventDefault(), u(c, y);
738
+ m.preventDefault(), u(c, h);
619
739
  return;
620
740
  case "Tab":
621
- p(b);
741
+ v(m);
622
742
  return;
623
743
  default:
624
744
  return;
625
745
  }
626
- (C = c[m]) == null || C.focus(), t(m), a !== -1 && u(c, m);
746
+ (N = c[g]) == null || N.focus(), t(g), a !== -1 && u(c, g);
627
747
  },
628
- [e, a, p, u]
629
- ), h = $(() => {
630
- const b = document.querySelector(`[id="${o}"][role="radiogroup"]`);
631
- return b ? Array.from(b.querySelectorAll('[role="radio"]')) : [];
632
- }, [o]);
633
- A(() => {
634
- const b = document.querySelector(`[id="${o}"][role="radiogroup"]`);
635
- if (!b) return;
636
- const c = h(), x = (C) => g(C, c), f = (C) => d(C, c), y = () => i(!0), m = () => i(!1);
637
- return document.addEventListener("keydown", f), b.addEventListener("focus", x), b.addEventListener("mousedown", y), document.addEventListener("mouseup", m), () => {
638
- document.removeEventListener("keydown", f), b.removeEventListener("focus", x), b.removeEventListener("mousedown", y), document.removeEventListener("mouseup", m);
748
+ [e, a, v, u]
749
+ ), x = $(() => {
750
+ const m = document.querySelector(`[id="${n}"][role="radiogroup"]`);
751
+ return m ? Array.from(m.querySelectorAll('[role="radio"]')) : [];
752
+ }, [n]);
753
+ E(() => {
754
+ const m = document.querySelector(`[id="${n}"][role="radiogroup"]`);
755
+ if (!m) return;
756
+ const c = x(), y = (N) => b(N, c), f = (N) => i(N, c), h = () => l(!0), g = () => l(!1);
757
+ return document.addEventListener("keydown", f), m.addEventListener("focus", y), m.addEventListener("mousedown", h), document.addEventListener("mouseup", g), () => {
758
+ document.removeEventListener("keydown", f), m.removeEventListener("focus", y), m.removeEventListener("mousedown", h), document.removeEventListener("mouseup", g);
639
759
  };
640
- }, [o, h, g, d]);
760
+ }, [n, x, b, i]);
641
761
  }
642
- function ve({
643
- options: o = [],
762
+ function Le({
763
+ options: n = [],
644
764
  value: r,
645
765
  onChange: e,
646
766
  name: t,
647
767
  children: a,
648
- className: n = "",
768
+ className: o = "",
649
769
  childrenClassName: s = "",
650
- hideInputs: i = !1
770
+ hideInputs: l = !1
651
771
  }) {
652
- const u = E(), g = t || `radio-group-${u}`;
653
- ee(
654
- g,
655
- o.findIndex((d) => d === r)
772
+ const u = A(), b = t || `radio-group-${u}`;
773
+ me(
774
+ b,
775
+ n.findIndex((i) => i === r)
656
776
  );
657
- const p = R(() => o.reduce((d, h) => (typeof h == "string" ? d.some((b) => b.value === h) || d.push({ label: h, value: h }) : d.push(h), d), []), [o]);
658
- return /* @__PURE__ */ w("div", { id: g, role: "radiogroup", tabIndex: 0, className: v(n, "focus:outline-none"), children: [
659
- p.length > 0 && p.map((d, h) => /* @__PURE__ */ l(
660
- z,
777
+ const v = F(() => n.reduce((i, x) => (typeof x == "string" ? i.some((m) => m.value === x) || i.push({ label: x, value: x }) : i.push(x), i), []), [n]);
778
+ return /* @__PURE__ */ w("div", { id: b, role: "radiogroup", tabIndex: 0, className: p(o, "focus:outline-none"), children: [
779
+ v.length > 0 && v.map((i, x) => /* @__PURE__ */ d(
780
+ S,
661
781
  {
662
- value: d.value,
663
- isSelected: r === d.value,
782
+ value: i.value,
783
+ isSelected: r === i.value,
664
784
  onChange: e,
665
- name: g,
666
- disabled: d.disabled,
667
- description: d.description,
668
- hideInput: i,
785
+ name: b,
786
+ disabled: i.disabled,
787
+ description: i.description,
788
+ hideInput: l,
669
789
  className: s,
670
- children: d.label
790
+ children: i.label
671
791
  },
672
- `${d.value}-${h}`
792
+ `${i.value}-${x}`
673
793
  )),
674
- p.length === 0 && a && I.Children.map(a, (d) => I.isValidElement(d) && d.type === z ? /* @__PURE__ */ l(
675
- z,
794
+ v.length === 0 && a && I.Children.map(a, (i) => I.isValidElement(i) && i.type === S ? /* @__PURE__ */ d(
795
+ S,
676
796
  {
677
- ...d.props,
678
- className: v(s, d.props.className),
679
- hideInput: d.props.hideInput || i,
680
- isSelected: r === d.props.value,
797
+ ...i.props,
798
+ className: p(s, i.props.className),
799
+ hideInput: i.props.hideInput || l,
800
+ isSelected: r === i.props.value,
681
801
  onChange: e,
682
- name: g,
683
- children: d.props.children
802
+ name: b,
803
+ children: i.props.children
684
804
  }
685
805
  ) : null)
686
806
  ] });
687
807
  }
688
- function re({ elementId: o, maxLength: r }) {
689
- const [e, t] = N(0);
690
- return A(() => {
691
- const a = document.getElementById(o);
808
+ function be({ elementId: n, maxLength: r }) {
809
+ const [e, t] = C(0);
810
+ return E(() => {
811
+ const a = document.getElementById(n);
692
812
  if (!a)
693
813
  return;
694
- const n = () => {
814
+ const o = () => {
695
815
  const s = a.value.length;
696
816
  t(s);
697
- const i = s >= r;
698
- a.setAttribute("aria-describedby", `${o}-character-count`), a.setAttribute("aria-invalid", i ? "true" : "false"), i ? a.setAttribute("data-error", "true") : a.removeAttribute("data-error");
817
+ const l = s >= r;
818
+ a.setAttribute("aria-describedby", `${n}-character-count`), a.setAttribute("aria-invalid", l ? "true" : "false"), l ? a.setAttribute("data-error", "true") : a.removeAttribute("data-error");
699
819
  };
700
- return n(), a.addEventListener("input", n), a.setAttribute("maxlength", String(r)), () => {
701
- a.removeEventListener("input", n), a.removeAttribute("maxlength"), a.removeAttribute("aria-describedby"), a.removeAttribute("aria-invalid"), a.removeAttribute("data-error");
820
+ return o(), a.addEventListener("input", o), a.setAttribute("maxlength", String(r)), () => {
821
+ a.removeEventListener("input", o), a.removeAttribute("maxlength"), a.removeAttribute("aria-describedby"), a.removeAttribute("aria-invalid"), a.removeAttribute("data-error");
702
822
  };
703
- }, [o, r]), /* @__PURE__ */ l(
823
+ }, [n, r]), /* @__PURE__ */ d(
704
824
  "small",
705
825
  {
706
- className: v(
826
+ className: p(
707
827
  "mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",
708
828
  e >= r && "text-danger",
709
829
  e < r && "text-current"
710
830
  ),
711
831
  role: "status",
712
- children: /* @__PURE__ */ w("span", { id: `${o}-character-count`, children: [
832
+ children: /* @__PURE__ */ w("span", { id: `${n}-character-count`, children: [
713
833
  e,
714
834
  " / ",
715
835
  r,
@@ -718,9 +838,9 @@ function re({ elementId: o, maxLength: r }) {
718
838
  }
719
839
  );
720
840
  }
721
- function te(o, r) {
722
- A(() => {
723
- const e = document.getElementById(o);
841
+ function ge(n, r) {
842
+ E(() => {
843
+ const e = document.getElementById(n);
724
844
  if (!e)
725
845
  return;
726
846
  if (!r) {
@@ -733,82 +853,83 @@ function te(o, r) {
733
853
  return t(), e.addEventListener("input", t), e.addEventListener("resize", t), window.addEventListener("resize", t), () => {
734
854
  e.removeEventListener("input", t), e.removeEventListener("resize", t), window.removeEventListener("resize", t);
735
855
  };
736
- }, [o, r]);
856
+ }, [n, r]);
737
857
  }
738
- const ae = {
858
+ const ve = {
739
859
  base: "",
740
860
  "left-line": "border-l border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success",
741
861
  outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success"
742
- }, ne = {
862
+ }, pe = {
743
863
  none: "rounded-none",
744
864
  sm: "rounded-sm",
745
865
  md: "rounded-md",
746
866
  lg: "rounded-lg",
747
867
  full: "px-3 rounded-full"
748
- }, S = {
868
+ }, R = {
749
869
  variant: "outline",
750
870
  rounded: "none"
751
871
  };
752
- function pe({
753
- variant: o = S.variant,
872
+ function je({
873
+ variant: n = R.variant,
754
874
  rounded: r,
755
875
  displayOnlyMode: e = !1,
756
876
  errorMessage: t,
757
877
  successMessage: a,
758
- hideResizeHandle: n = !1,
878
+ hideResizeHandle: o = !1,
759
879
  autoExpand: s = !1,
760
- characterLimit: i = 0,
880
+ characterLimit: l = 0,
761
881
  className: u,
762
- ...g
882
+ ...b
763
883
  }) {
764
- const p = E();
765
- te(p, s || e);
766
- let d = r;
767
- o === "outline" && !r && (d = "md"), d = d || S.rounded;
768
- let h = n;
769
- (e || o === "left-line" && !n) && (h = !0);
770
- const c = v(
884
+ const v = A();
885
+ ge(v, s || e);
886
+ let i = r;
887
+ n === "outline" && !r && (i = "md"), i = i || R.rounded;
888
+ let x = o;
889
+ (e || n === "left-line" && !o) && (x = !0);
890
+ const c = p(
771
891
  "appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",
772
- !e && ae[o],
773
- !e && ne[d],
892
+ !e && ve[n],
893
+ !e && pe[i],
774
894
  !e && "px-2 py-1",
775
895
  e && "pointer-events-none",
776
- h && "no-resize-handle",
896
+ x && "no-resize-handle",
777
897
  u
778
898
  );
779
- return /* @__PURE__ */ w("div", { className: v("-space-y-1.5", e && "cursor-text"), children: [
780
- /* @__PURE__ */ l(
899
+ return /* @__PURE__ */ w("div", { className: p("-space-y-1.5", e && "cursor-text"), children: [
900
+ /* @__PURE__ */ d(
781
901
  "textarea",
782
902
  {
783
- ...g,
784
- id: p,
785
- "aria-disabled": g.disabled,
903
+ ...b,
904
+ id: v,
905
+ "aria-disabled": b.disabled,
786
906
  readOnly: e,
787
- "aria-readonly": e || g["aria-readonly"],
907
+ "aria-readonly": e || b["aria-readonly"],
788
908
  style: {
789
909
  resize: s ? "none" : void 0
790
910
  },
791
911
  className: c
792
912
  }
793
913
  ),
794
- i > 0 && /* @__PURE__ */ l(re, { elementId: p, maxLength: i }),
795
- !e && /* @__PURE__ */ l(D, { elementId: p, type: "error", message: t }),
796
- !e && /* @__PURE__ */ l(D, { elementId: p, type: "success", message: a })
914
+ l > 0 && /* @__PURE__ */ d(be, { elementId: v, maxLength: l }),
915
+ !e && /* @__PURE__ */ d(D, { elementId: v, type: "error", message: t }),
916
+ !e && /* @__PURE__ */ d(D, { elementId: v, type: "success", message: a })
797
917
  ] });
798
918
  }
799
919
  export {
800
- le as Accordion,
801
- j as AccordionItem,
802
- ue as Button,
803
- _ as ButtonLoadingDots,
804
- ce as Checkbox,
805
- fe as Clickable,
806
- be as Input,
807
- me as Label,
808
- ve as RadioGroup,
809
- z as RadioGroupItem,
810
- P as RadioInput,
811
- ge as Slot,
812
- pe as Textarea
920
+ Ce as Accordion,
921
+ L as AccordionItem,
922
+ oe as Button,
923
+ re as ButtonLoadingDots,
924
+ Ee as Checkbox,
925
+ Ae as Clickable,
926
+ $e as Input,
927
+ Ie as Label,
928
+ De as Modal,
929
+ Le as RadioGroup,
930
+ S as RadioGroupItem,
931
+ fe as RadioInput,
932
+ ke as Slot,
933
+ je as Textarea
813
934
  };
814
935
  //# sourceMappingURL=components.esm.js.map