@moondreamsdev/dreamer-ui 1.7.4-test.0 → 1.7.4-test.10

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,
7
- title: r,
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 g } 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,
8
+ title: t,
8
9
  content: e,
9
- children: t,
10
+ children: r,
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 p = A(), i = n || `accordion-item-${p}`, 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: g("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: g(
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: t }),
41
+ /* @__PURE__ */ d(
41
42
  "span",
42
43
  {
43
- className: v(
44
+ className: g(
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: g(
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
- children: s && (t || e)
66
+ children: s && (r || e)
66
67
  }
67
68
  )
68
69
  ] });
69
70
  }
70
- function le({
71
- name: o,
72
- items: r = [],
71
+ function Ce({
72
+ id: n,
73
+ items: t = [],
73
74
  children: e,
74
- className: t = "",
75
+ className: r = "",
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(), p = n || `accordion-group-${b}`, [i, x] = C(new Set(s)), m = (f) => {
83
+ x((h) => {
84
+ const v = new Set(h);
85
+ return v.has(f) ? v.delete(f) : (o || v.clear(), v.add(f)), v;
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: p, className: r, children: [
89
+ t.length > 0 && t.map((f, h) => {
90
+ const v = f.id || c(h);
91
+ return /* @__PURE__ */ d(
92
+ L,
92
93
  {
93
- id: m,
94
+ id: v,
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(v),
99
+ onToggle: () => m(v),
99
100
  className: a,
100
- triggerClassName: i,
101
+ triggerClassName: l,
101
102
  bodyClassName: u
102
103
  },
103
- m
104
+ v
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
+ t.length === 0 && e && I.Children.map(e, (f, h) => {
108
+ if (I.isValidElement(f) && f.type === L) {
109
+ const v = 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: v,
115
+ id: v,
116
+ className: g(a, f.props.className),
117
+ isOpen: y(v),
118
+ onToggle: () => m(v),
119
+ triggerClassName: g(l, f.props.triggerClassName),
120
+ bodyClassName: g(u, f.props.bodyClassName)
120
121
  }
121
122
  );
122
123
  }
@@ -124,33 +125,33 @@ function le({
124
125
  })
125
126
  ] });
126
127
  }
127
- function _() {
128
- const [o, r] = N(0);
129
- return A(() => {
128
+ function te() {
129
+ const [n, t] = C(0);
130
+ return E(() => {
130
131
  const e = setInterval(() => {
131
- r((t) => (t + 1) % 3);
132
+ t((r) => (r + 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: g(
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 re = {
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",
149
150
  tertiary: "text-primary hover:text-primary-foreground disabled:text-muted",
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
- danger: "bg-danger text-danger-foreground hover:bg-danger/85 disabled:bg-muted disabled:text-muted-foreground"
153
- }, X = {
153
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
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,
174
- size: r,
175
- rounded: e = k.rounded,
176
- loading: t,
173
+ function oe({
174
+ variant: n = j.variant,
175
+ size: t,
176
+ rounded: e = j.rounded,
177
+ loading: r,
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" && !t ? b = "fitted" : b = t || j.size;
186
+ const i = g(
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],
190
- t && "relative pointer-events-none",
188
+ re[n],
189
+ ne[b],
190
+ ae[e],
191
+ r && "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"]),
201
- "aria-disabled": u.disabled || t,
202
- "aria-busy": t,
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"]),
202
+ "aria-disabled": u.disabled || r,
203
+ "aria-busy": r,
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
+ r && /* @__PURE__ */ d(te, {}),
208
+ /* @__PURE__ */ d("span", { className: g(r && "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,270 +221,390 @@ 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 [t, e] = C(""), r = $((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 = r(a.parentElement);
237
+ e(o);
237
238
  }
238
- }, [o, t]), r;
239
+ }, [n, r]), t;
239
240
  }
240
- function ce({
241
- ref: o,
242
- id: r,
241
+ function Ee({
242
+ ref: n,
243
+ id: t,
243
244
  size: e = 20,
244
- color: t,
245
+ color: r,
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
+ className: b = "",
251
252
  ...p
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(() => t || `checkbox-${i}`, [t, 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
+ }, v = g(
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
- color: t,
284
+ color: r,
284
285
  backgroundColor: c && a ? "currentcolor" : "transparent"
285
286
  },
286
- className: m,
287
+ className: v,
287
288
  ...p,
288
- children: c && /* @__PURE__ */ l(G, { size: e, color: a ? b : void 0 })
289
+ children: c && /* @__PURE__ */ d(_, { size: e, color: a ? m : void 0 })
289
290
  }
290
291
  );
291
292
  }
292
- function fe({
293
- children: o,
294
- className: r,
293
+ function Ae({
294
+ children: n,
295
+ className: t,
295
296
  linkTo: e,
296
- linkProps: t,
297
+ linkProps: r,
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: g("relative w-fit", t), ...s, children: [
303
+ n,
304
+ e && /* @__PURE__ */ d(
304
305
  "a",
305
306
  {
306
- ...t,
307
+ ...r,
307
308
  href: e,
308
- className: v("absolute inset-0", t == null ? void 0 : t.className)
309
+ className: g("absolute inset-0", r == null ? void 0 : r.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: g("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);
325
- if (t) {
326
- if (!e && r === "error") {
327
- t.removeAttribute("data-error");
323
+ function D({ elementId: n, type: t, message: e }) {
324
+ return E(() => {
325
+ const r = document.getElementById(n);
326
+ if (r) {
327
+ if (!e && t === "error") {
328
+ r.removeAttribute("data-error");
328
329
  return;
329
330
  }
330
- if (!e && r === "success") {
331
- t.removeAttribute("data-success");
331
+ if (!e && t === "success") {
332
+ r.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
- t.removeAttribute("aria-describedby"), t.removeAttribute("aria-invalid"), t.removeAttribute("data-error"), t.removeAttribute("data-success");
335
+ return r.setAttribute("aria-describedby", `${n}-${t}-message`), r.setAttribute("aria-invalid", t === "error" ? "true" : "false"), t === "error" && r.setAttribute("data-error", "true"), t === "success" && r.setAttribute("data-success", "true"), () => {
336
+ r.removeAttribute("aria-describedby"), r.removeAttribute("aria-invalid"), r.removeAttribute("data-error"), r.removeAttribute("data-success");
336
337
  };
337
338
  }
338
- }, [o, r, e]), e ? /* @__PURE__ */ w(
339
+ }, [n, t, e]), e ? /* @__PURE__ */ w(
339
340
  "small",
340
341
  {
341
- className: v(
342
+ className: g(
342
343
  "mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start",
343
- r === "error" && "text-danger",
344
- r === "success" && "text-success"
344
+ t === "error" && "text-destructive",
345
+ t === "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
+ t === "error" ? /* @__PURE__ */ d(J, {}) : /* @__PURE__ */ d(Y, {}),
350
+ /* @__PURE__ */ d("span", { id: `${n}-${t}-message`, children: e })
350
351
  ]
351
352
  }
352
353
  ) : null;
353
354
  }
354
- const O = {
355
+ const ie = {
355
356
  base: "",
356
- default: "ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-danger not-disabled:data-success:ring-success",
357
- 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
- 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 = {
357
+ default: "ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success",
358
+ underline: "border-b border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",
359
+ outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"
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,
371
- rounded: r,
370
+ function $e({
371
+ variant: n = B.variant,
372
+ rounded: t,
372
373
  displayOnlyMode: e = !1,
373
- errorMessage: t,
374
+ errorMessage: r,
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, p] = C(!1);
381
+ let i = t;
382
+ n === "outline" && !t && (i = "md"), i = i || B.rounded;
383
+ const c = g(
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: g(e && "cursor-text"), style: { height: l.height, width: l.width }, children: [
394
+ /* @__PURE__ */ w("div", { className: g(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
- "data-error": t ? !0 : void 0,
403
+ "aria-readonly": e || l["aria-readonly"],
404
+ "data-error": r ? !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: () => p(!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: r }),
421
+ !e && /* @__PURE__ */ d(D, { elementId: u, type: "success", message: a })
421
422
  ] });
422
423
  }
423
- function me({
424
- display: o = "inline",
425
- width: r = "fit-content",
424
+ function Ie({
425
+ display: n = "inline",
426
+ width: t = "fit-content",
426
427
  className: e = "",
427
- required: t,
428
+ required: r,
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: [
435
+ const b = A(), p = g("font-medium", n, e), i = a ? `${s ?? b}-help` : void 0;
436
+ return /* @__PURE__ */ w("div", { style: { display: n === "inline" ? "inline-flex" : "flex", width: t }, className: "relative", children: [
436
437
  /* @__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: "*" })
438
+ l,
439
+ r && /* @__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)) {
456
- let t = { ...e };
457
- return o.props && (t = { ...t, ...o.props }), q(o, {
458
- ...t,
455
+ function z(...n) {
456
+ return n.filter((t) => typeof t == "string" && t).join(" ").trim() || void 0;
457
+ }
458
+ function le(n) {
459
+ const [t, e] = C(!1), [r, a] = C(!1);
460
+ return E(() => {
461
+ n ? (a(!0), setTimeout(() => e(!0), 10)) : (e(!1), setTimeout(() => a(!1), 150));
462
+ }, [n]), { show: t, shouldRender: r };
463
+ }
464
+ function ue(n, t) {
465
+ E(() => {
466
+ const e = (r) => {
467
+ r.key === "Escape" && n && t();
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, t]);
473
+ }
474
+ function ce(n, t) {
475
+ const e = Q(null), r = $(() => {
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(() => (t && (e.current = document.activeElement, r()), () => {
498
+ document.body.style.overflow = "auto", e.current instanceof HTMLElement && e.current.focus();
499
+ }), [t, r]);
500
+ }
501
+ function De({
502
+ id: n,
503
+ isOpen: t,
504
+ onClose: e,
505
+ title: r,
506
+ children: a,
507
+ contentOnly: o = !1,
508
+ className: s,
509
+ overlayClassName: l,
510
+ hideCloseButton: u = !1,
511
+ actions: b = [],
512
+ disableCloseOnOverlayClick: p = !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(t);
517
+ if (ce(c, h), ue(h, e), !h) return null;
518
+ const v = () => r ? I.isValidElement(r) ? /* @__PURE__ */ d("div", { className: "mb-4", children: r }) : /* @__PURE__ */ d("h2", { className: "mb-4 text-xl font-semibold", id: y, children: r }) : 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 ?? r ? 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
+ p || 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
+ type: "button",
557
+ onClick: e,
558
+ "data-modal-close-button": "true",
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__ */ d(P, { size: 18 })
561
+ }
562
+ ),
563
+ v(),
564
+ a,
565
+ N()
566
+ ]
567
+ }
568
+ )
569
+ ] })
570
+ }
571
+ ),
572
+ document.body
573
+ ) });
574
+ }
575
+ function ke({ children: n, ref: t, ...e }) {
576
+ if (U(n)) {
577
+ let r = { ...e };
578
+ return n.props && (r = { ...r, ...n.props }), W(n, {
579
+ ...r,
459
580
  ref: (a) => {
460
- typeof r == "function" ? r(a) : r && (r.current = a);
581
+ typeof t == "function" ? t(a) : t && (t.current = a);
461
582
  }
462
583
  });
463
584
  }
464
- return B("div", { ...e, ref: r }, o);
585
+ return V("div", { ...e, ref: t }, n);
465
586
  }
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 = () => {
587
+ function fe({ itemId: n, checked: t, onChange: e, name: r, disabled: a = !1, className: o = "" }) {
588
+ const s = "relative inline-flex items-center justify-center rounded-full", l = () => {
468
589
  a || e();
469
- }, u = v(
590
+ }, u = g(
470
591
  s,
471
- !r && "hover:border-current/60",
592
+ !t && "hover:border-current/60",
472
593
  !a && "border-current cursor-pointer",
473
594
  a && "border-muted/60 cursor-not-allowed",
474
- n
595
+ o
475
596
  );
476
- return /* @__PURE__ */ l(
597
+ return /* @__PURE__ */ d(
477
598
  "div",
478
599
  {
479
- id: o,
600
+ id: n,
480
601
  role: "radio",
481
602
  tabIndex: -1,
482
- "aria-checked": r,
603
+ "aria-checked": t,
483
604
  "aria-disabled": a,
484
- "aria-description": `Radio button for ${t}`,
485
- "aria-labelledby": `${o}-label`,
486
- onClick: i,
605
+ "aria-description": `Radio button for ${r}`,
606
+ "aria-labelledby": `${n}-label`,
607
+ onClick: l,
487
608
  className: u,
488
609
  style: {
489
610
  width: "1em",
@@ -491,76 +612,76 @@ function P({ itemId: o, checked: r, onChange: e, name: t, disabled: a = !1, clas
491
612
  padding: "0.1em",
492
613
  borderWidth: "0.06em"
493
614
  },
494
- children: r && /* @__PURE__ */ l(
615
+ children: t && /* @__PURE__ */ d(
495
616
  "div",
496
617
  {
497
- className: v("size-full aspect-square rounded-full", a && "bg-muted/60", !a && "bg-current")
618
+ className: g("size-full aspect-square rounded-full", a && "bg-muted/60", !a && "bg-current")
498
619
  }
499
620
  )
500
621
  }
501
622
  );
502
623
  }
503
- function z({
504
- value: o,
505
- children: r,
624
+ function S({
625
+ value: n,
626
+ children: t,
506
627
  className: e = "",
507
- isSelected: t = !1,
628
+ isSelected: r = !1,
508
629
  onChange: a,
509
- disabled: n = !1,
630
+ disabled: o = !1,
510
631
  hideInput: s = !1,
511
- description: i,
632
+ description: l,
512
633
  name: u
513
634
  }) {
514
- const p = `radio-${E()}-${o}`, d = () => {
515
- n || a == null || a(o);
635
+ const p = `radio-${A()}-${n}`, i = () => {
636
+ o || a == null || a(n);
516
637
  };
517
638
  return /* @__PURE__ */ w(
518
639
  "div",
519
640
  {
520
- title: i,
521
- className: v(
641
+ title: l,
642
+ className: g(
522
643
  "relative flex items-center",
523
644
  e,
524
645
  // 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"}`,
527
- s && t && "border-border",
528
- n && "opacity-60 cursor-not-allowed"
646
+ s && `p-2 border-2 focus-within:border-dashed focus-within:${o ? "border-current/50" : "border-current/80"}`,
647
+ s && !r && `border-transparent ${o ? "" : "not-focus-within:hover:border-border/60"}`,
648
+ s && r && "border-border",
649
+ o && "opacity-60 cursor-not-allowed"
529
650
  ),
530
651
  style: {
531
652
  gap: "0.5em"
532
653
  },
533
654
  children: [
534
- !s && /* @__PURE__ */ l(
535
- P,
655
+ !s && /* @__PURE__ */ d(
656
+ fe,
536
657
  {
537
658
  itemId: p,
538
659
  name: u || "",
539
- checked: t,
540
- onChange: d,
541
- disabled: n,
542
- className: v(s && "")
660
+ checked: r,
661
+ onChange: i,
662
+ disabled: o,
663
+ className: g(s && "")
543
664
  }
544
665
  ),
545
- /* @__PURE__ */ l(
666
+ /* @__PURE__ */ d(
546
667
  "div",
547
668
  {
548
669
  id: s ? p : void 0,
549
670
  tabIndex: s ? -1 : void 0,
550
671
  role: s ? "radio" : void 0,
551
- onClick: s ? d : void 0,
552
- "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,
672
+ onClick: s ? i : void 0,
673
+ "aria-checked": s ? r ? "true" : "false" : void 0,
674
+ "aria-disabled": s ? o : void 0,
675
+ "aria-description": s ? l || `Radio button for ${u}` : void 0,
555
676
  "aria-labelledby": s ? `${p}-label` : void 0,
556
- className: v(s && "size-full", typeof r == "object" && "grow focus:outline-none"),
557
- children: /* @__PURE__ */ l(
677
+ className: g(s && "size-full", typeof t == "object" && "grow focus:outline-none"),
678
+ children: /* @__PURE__ */ d(
558
679
  "label",
559
680
  {
560
681
  id: `${p}-label`,
561
- onClick: s ? void 0 : d,
562
- className: v(n && "cursor-not-allowed", !n && "cursor-pointer"),
563
- children: r
682
+ onClick: s ? void 0 : i,
683
+ className: g(o && "cursor-not-allowed", !o && "cursor-pointer"),
684
+ children: t
564
685
  }
565
686
  )
566
687
  }
@@ -569,246 +690,247 @@ function z({
569
690
  }
570
691
  );
571
692
  }
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) => {
693
+ function me(n, t) {
694
+ const [e, r] = C(t), [a, o] = C(-1), [s, l] = C(!1), u = $((m, c) => {
695
+ var h;
696
+ const y = m[c];
697
+ y.hasAttribute("disabled") || y.getAttribute("aria-disabled") === "true" || ((h = m[c]) == null || h.click(), o(c));
698
+ }, []), b = $(
699
+ (m, c) => {
579
700
  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);
701
+ if (m.preventDefault(), s || !c.length) return;
702
+ const y = t !== -1 ? t : 0;
703
+ (f = c[y]) == null || f.focus(), r(y), t !== -1 && u(c, y);
583
704
  },
584
- [r, s, u]
705
+ [t, s, u]
585
706
  ), p = $(
586
- (b) => {
587
- var y;
588
- if (!b.shiftKey)
707
+ (m) => {
708
+ var h;
709
+ if (!m.shiftKey)
589
710
  return;
590
- b.preventDefault();
711
+ m.preventDefault();
591
712
  const c = Array.from(
592
713
  document.querySelectorAll(
593
714
  'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
594
715
  )
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();
716
+ ).filter((v) => !v.hasAttribute("disabled") && v.tabIndex >= 0), y = c.findIndex((v) => v.id === n), f = y > 0 ? y - 1 : c.length - 1;
717
+ (h = c[f]) == null || h.focus();
597
718
  },
598
- [o]
599
- ), d = $(
600
- (b, c) => {
601
- var C;
719
+ [n]
720
+ ), i = $(
721
+ (m, c) => {
722
+ var N;
602
723
  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) {
724
+ const y = m.target;
725
+ if (!c.some((k) => k.id === y.id)) return;
726
+ const h = e !== -1 ? e : 0;
727
+ let v = h;
728
+ switch (m.key) {
608
729
  case "ArrowUp":
609
730
  case "ArrowLeft":
610
- b.preventDefault(), m = y > 0 ? y - 1 : c.length - 1;
731
+ m.preventDefault(), v = h > 0 ? h - 1 : c.length - 1;
611
732
  break;
612
733
  case "ArrowDown":
613
734
  case "ArrowRight":
614
- b.preventDefault(), m = (y + 1) % c.length;
735
+ m.preventDefault(), v = (h + 1) % c.length;
615
736
  break;
616
737
  // Select the option when the space key is pressed
617
738
  case " ":
618
- b.preventDefault(), u(c, y);
739
+ m.preventDefault(), u(c, h);
619
740
  return;
620
741
  case "Tab":
621
- p(b);
742
+ p(m);
622
743
  return;
623
744
  default:
624
745
  return;
625
746
  }
626
- (C = c[m]) == null || C.focus(), t(m), a !== -1 && u(c, m);
747
+ (N = c[v]) == null || N.focus(), r(v), a !== -1 && u(c, v);
627
748
  },
628
749
  [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);
750
+ ), x = $(() => {
751
+ const m = document.querySelector(`[id="${n}"][role="radiogroup"]`);
752
+ return m ? Array.from(m.querySelectorAll('[role="radio"]')) : [];
753
+ }, [n]);
754
+ E(() => {
755
+ const m = document.querySelector(`[id="${n}"][role="radiogroup"]`);
756
+ if (!m) return;
757
+ const c = x(), y = (N) => b(N, c), f = (N) => i(N, c), h = () => l(!0), v = () => l(!1);
758
+ return document.addEventListener("keydown", f), m.addEventListener("focus", y), m.addEventListener("mousedown", h), document.addEventListener("mouseup", v), () => {
759
+ document.removeEventListener("keydown", f), m.removeEventListener("focus", y), m.removeEventListener("mousedown", h), document.removeEventListener("mouseup", v);
639
760
  };
640
- }, [o, h, g, d]);
761
+ }, [n, x, b, i]);
641
762
  }
642
- function ve({
643
- options: o = [],
644
- value: r,
763
+ function Le({
764
+ options: n = [],
765
+ value: t,
645
766
  onChange: e,
646
- name: t,
767
+ id: r,
647
768
  children: a,
648
- className: n = "",
769
+ className: o = "",
649
770
  childrenClassName: s = "",
650
- hideInputs: i = !1
771
+ hideInputs: l = !1
651
772
  }) {
652
- const u = E(), g = t || `radio-group-${u}`;
653
- ee(
654
- g,
655
- o.findIndex((d) => d === r)
773
+ const u = A(), b = r || `radio-group-${u}`;
774
+ me(
775
+ b,
776
+ n.findIndex((i) => i === t)
656
777
  );
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,
778
+ const p = 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]);
779
+ return /* @__PURE__ */ w("div", { id: b, role: "radiogroup", tabIndex: 0, className: g(o, "focus:outline-none"), children: [
780
+ p.length > 0 && p.map((i, x) => /* @__PURE__ */ d(
781
+ S,
661
782
  {
662
- value: d.value,
663
- isSelected: r === d.value,
783
+ value: i.value,
784
+ isSelected: t === i.value,
664
785
  onChange: e,
665
- name: g,
666
- disabled: d.disabled,
667
- description: d.description,
668
- hideInput: i,
786
+ name: b,
787
+ disabled: i.disabled,
788
+ description: i.description,
789
+ hideInput: l,
669
790
  className: s,
670
- children: d.label
791
+ children: i.label
671
792
  },
672
- `${d.value}-${h}`
793
+ `${i.value}-${x}`
673
794
  )),
674
- p.length === 0 && a && I.Children.map(a, (d) => I.isValidElement(d) && d.type === z ? /* @__PURE__ */ l(
675
- z,
795
+ p.length === 0 && a && I.Children.map(a, (i) => I.isValidElement(i) && i.type === S ? /* @__PURE__ */ d(
796
+ S,
676
797
  {
677
- ...d.props,
678
- className: v(s, d.props.className),
679
- hideInput: d.props.hideInput || i,
680
- isSelected: r === d.props.value,
798
+ ...i.props,
799
+ className: g(s, i.props.className),
800
+ hideInput: i.props.hideInput || l,
801
+ isSelected: t === i.props.value,
681
802
  onChange: e,
682
- name: g,
683
- children: d.props.children
803
+ name: b,
804
+ children: i.props.children
684
805
  }
685
806
  ) : null)
686
807
  ] });
687
808
  }
688
- function re({ elementId: o, maxLength: r }) {
689
- const [e, t] = N(0);
690
- return A(() => {
691
- const a = document.getElementById(o);
809
+ function be({ elementId: n, maxLength: t }) {
810
+ const [e, r] = C(0);
811
+ return E(() => {
812
+ const a = document.getElementById(n);
692
813
  if (!a)
693
814
  return;
694
- const n = () => {
815
+ const o = () => {
695
816
  const s = a.value.length;
696
- 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
+ r(s);
818
+ const l = s >= t;
819
+ 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
820
  };
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");
821
+ return o(), a.addEventListener("input", o), a.setAttribute("maxlength", String(t)), () => {
822
+ a.removeEventListener("input", o), a.removeAttribute("maxlength"), a.removeAttribute("aria-describedby"), a.removeAttribute("aria-invalid"), a.removeAttribute("data-error");
702
823
  };
703
- }, [o, r]), /* @__PURE__ */ l(
824
+ }, [n, t]), /* @__PURE__ */ d(
704
825
  "small",
705
826
  {
706
- className: v(
827
+ className: g(
707
828
  "mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",
708
- e >= r && "text-danger",
709
- e < r && "text-current"
829
+ e >= t && "text-destructive",
830
+ e < t && "text-current"
710
831
  ),
711
832
  role: "status",
712
- children: /* @__PURE__ */ w("span", { id: `${o}-character-count`, children: [
833
+ children: /* @__PURE__ */ w("span", { id: `${n}-character-count`, children: [
713
834
  e,
714
835
  " / ",
715
- r,
836
+ t,
716
837
  " characters"
717
838
  ] })
718
839
  }
719
840
  );
720
841
  }
721
- function te(o, r) {
722
- A(() => {
723
- const e = document.getElementById(o);
842
+ function ve(n, t) {
843
+ E(() => {
844
+ const e = document.getElementById(n);
724
845
  if (!e)
725
846
  return;
726
- if (!r) {
847
+ if (!t) {
727
848
  e.style.height = "auto";
728
849
  return;
729
850
  }
730
- const t = () => {
851
+ const r = () => {
731
852
  e.style.height = "auto", e.style.height = `${e.scrollHeight}px`;
732
853
  };
733
- return t(), e.addEventListener("input", t), e.addEventListener("resize", t), window.addEventListener("resize", t), () => {
734
- e.removeEventListener("input", t), e.removeEventListener("resize", t), window.removeEventListener("resize", t);
854
+ return r(), e.addEventListener("input", r), e.addEventListener("resize", r), window.addEventListener("resize", r), () => {
855
+ e.removeEventListener("input", r), e.removeEventListener("resize", r), window.removeEventListener("resize", r);
735
856
  };
736
- }, [o, r]);
857
+ }, [n, t]);
737
858
  }
738
- const ae = {
859
+ const pe = {
739
860
  base: "",
740
- "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
- 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 = {
861
+ "left-line": "border-l border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",
862
+ outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"
863
+ }, ge = {
743
864
  none: "rounded-none",
744
865
  sm: "rounded-sm",
745
866
  md: "rounded-md",
746
867
  lg: "rounded-lg",
747
868
  full: "px-3 rounded-full"
748
- }, S = {
869
+ }, R = {
749
870
  variant: "outline",
750
871
  rounded: "none"
751
872
  };
752
- function pe({
753
- variant: o = S.variant,
754
- rounded: r,
873
+ function je({
874
+ variant: n = R.variant,
875
+ rounded: t,
755
876
  displayOnlyMode: e = !1,
756
- errorMessage: t,
877
+ errorMessage: r,
757
878
  successMessage: a,
758
- hideResizeHandle: n = !1,
879
+ hideResizeHandle: o = !1,
759
880
  autoExpand: s = !1,
760
- characterLimit: i = 0,
881
+ characterLimit: l = 0,
761
882
  className: u,
762
- ...g
883
+ ...b
763
884
  }) {
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(
885
+ const p = A();
886
+ ve(p, s || e);
887
+ let i = t;
888
+ n === "outline" && !t && (i = "md"), i = i || R.rounded;
889
+ let x = o;
890
+ (e || n === "left-line" && !o) && (x = !0);
891
+ const c = g(
771
892
  "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],
893
+ !e && pe[n],
894
+ !e && ge[i],
774
895
  !e && "px-2 py-1",
775
896
  e && "pointer-events-none",
776
- h && "no-resize-handle",
897
+ x && "no-resize-handle",
777
898
  u
778
899
  );
779
- return /* @__PURE__ */ w("div", { className: v("-space-y-1.5", e && "cursor-text"), children: [
780
- /* @__PURE__ */ l(
900
+ return /* @__PURE__ */ w("div", { className: g("-space-y-1.5", e && "cursor-text"), children: [
901
+ /* @__PURE__ */ d(
781
902
  "textarea",
782
903
  {
783
- ...g,
904
+ ...b,
784
905
  id: p,
785
- "aria-disabled": g.disabled,
906
+ "aria-disabled": b.disabled,
786
907
  readOnly: e,
787
- "aria-readonly": e || g["aria-readonly"],
908
+ "aria-readonly": e || b["aria-readonly"],
788
909
  style: {
789
910
  resize: s ? "none" : void 0
790
911
  },
791
912
  className: c
792
913
  }
793
914
  ),
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 })
915
+ l > 0 && /* @__PURE__ */ d(be, { elementId: p, maxLength: l }),
916
+ !e && /* @__PURE__ */ d(D, { elementId: p, type: "error", message: r }),
917
+ !e && /* @__PURE__ */ d(D, { elementId: p, type: "success", message: a })
797
918
  ] });
798
919
  }
799
920
  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
921
+ Ce as Accordion,
922
+ L as AccordionItem,
923
+ oe as Button,
924
+ te as ButtonLoadingDots,
925
+ Ee as Checkbox,
926
+ Ae as Clickable,
927
+ $e as Input,
928
+ Ie as Label,
929
+ De as Modal,
930
+ Le as RadioGroup,
931
+ S as RadioGroupItem,
932
+ fe as RadioInput,
933
+ ke as Slot,
934
+ je as Textarea
813
935
  };
814
936
  //# sourceMappingURL=components.esm.js.map