@vellira-ui/react 2.22.1 → 2.22.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,21 +3,21 @@ import l from "clsx";
3
3
  import { createPortal as u } from "react-dom";
4
4
  import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
5
5
  import { FloatingPortal as m, arrow as h, autoUpdate as g, flip as _, offset as v, shift as y, size as b, useFloating as x, useFocus as S, useHover as C, useInteractions as w } from "@floating-ui/react";
6
- import { useControllableState as T, useKeyboardNavigation as E, useTabsKeyboard as D } from "@vellira-ui/core";
7
- import { Check as O, ChevronDown as k, Close as A } from "@vellira-ui/icons";
8
- import j from "focus-trap-react";
6
+ import { useControllableState as T, useKeyboardNavigation as ee, useTabsKeyboard as E } from "@vellira-ui/core";
7
+ import { Check as D, ChevronDown as O, Close as k } from "@vellira-ui/icons";
8
+ import A from "focus-trap-react";
9
9
  //#region src/utils/cn.ts
10
- var M = (...e) => l(e), N = ({ children: e }) => {
10
+ var j = (...e) => l(e), M = ({ children: e }) => {
11
11
  let [t, n] = c(!1);
12
12
  if (i(() => {
13
13
  n(!0);
14
14
  }, []), !t) return null;
15
15
  let r = document.getElementById("overlay-root") ?? document.body;
16
16
  return r ? u(e, r) : null;
17
- }, P = {
17
+ }, N = {
18
18
  dropdown: "_dropdown_6pgxt_1",
19
19
  dropdownIn: "_dropdownIn_6pgxt_1"
20
- }, ee = t(({ children: e, floatingStyles: t, menuId: n, labelledById: r, label: i, activeDescendantId: a, onKeyDown: o, className: s }, c) => /* @__PURE__ */ f(N, { children: /* @__PURE__ */ f("ul", {
20
+ }, P = t(({ children: e, floatingStyles: t, menuId: n, labelledById: r, label: i, activeDescendantId: a, onKeyDown: o, className: s }, c) => /* @__PURE__ */ f(M, { children: /* @__PURE__ */ f("ul", {
21
21
  ref: c,
22
22
  id: n,
23
23
  role: "menu",
@@ -27,10 +27,10 @@ var M = (...e) => l(e), N = ({ children: e }) => {
27
27
  "aria-activedescendant": a,
28
28
  onKeyDown: o,
29
29
  style: t,
30
- className: M(P.dropdown, s),
30
+ className: j(N.dropdown, s),
31
31
  children: e
32
32
  }) }));
33
- ee.displayName = "DropdownContent";
33
+ P.displayName = "DropdownContent";
34
34
  //#endregion
35
35
  //#region src/hooks/useFloatingPosition.ts
36
36
  var F = (e) => {
@@ -42,7 +42,7 @@ var F = (e) => {
42
42
  t.removeEventListener("change", r);
43
43
  };
44
44
  }, [e]), t;
45
- }, I = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r = "fixed", matchTriggerWidth: a = !1, mobileSheetBreakpoint: s, middleware: c = [] } = {}) => {
45
+ }, te = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r = "fixed", matchTriggerWidth: a = !1, mobileSheetBreakpoint: s, middleware: c = [] } = {}) => {
46
46
  let l = F(s), { refs: u, floatingStyles: d, update: f, context: p, middlewareData: m, placement: h } = x({
47
47
  open: e,
48
48
  onOpenChange: t,
@@ -76,7 +76,7 @@ var F = (e) => {
76
76
  setFloatingRef: u.setFloating,
77
77
  updatePosition: f
78
78
  };
79
- }, L = (e, t, n = !0) => {
79
+ }, I = (e, t, n = !0) => {
80
80
  let r = s(e);
81
81
  r.current = e;
82
82
  let a = s(t);
@@ -88,11 +88,11 @@ var F = (e) => {
88
88
  };
89
89
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
90
90
  }, [n]);
91
- }, R = { group: "_group_1yomt_1" }, z = ({ label: e }) => /* @__PURE__ */ f("li", {
91
+ }, L = { group: "_group_1yomt_1" }, R = ({ label: e }) => /* @__PURE__ */ f("li", {
92
92
  role: "presentation",
93
- className: R.group,
93
+ className: L.group,
94
94
  children: e
95
- }), B = {
95
+ }), z = {
96
96
  item: "_item_t87eq_1",
97
97
  disabled: "_disabled_t87eq_18",
98
98
  active: "_active_t87eq_28",
@@ -103,7 +103,7 @@ var F = (e) => {
103
103
  "itemText--truncate": "_itemText--truncate_t87eq_74",
104
104
  "itemText--wrap": "_itemText--wrap_t87eq_79",
105
105
  "itemText--nowrap": "_itemText--nowrap_t87eq_83"
106
- }, V = ({ id: e, children: t, label: n, icon: r, danger: i, disabled: a, active: o, onClick: s, onMouseEnter: c, shortcut: l, textWrap: u = "truncate", className: d }) => {
106
+ }, B = ({ id: e, children: t, label: n, icon: r, danger: i, disabled: a, active: o, onClick: s, onMouseEnter: c, shortcut: l, textWrap: u = "truncate", className: d }) => {
107
107
  let m = t || n;
108
108
  return /* @__PURE__ */ p("li", {
109
109
  id: e,
@@ -114,47 +114,47 @@ var F = (e) => {
114
114
  "data-danger": i || void 0,
115
115
  onClick: a ? void 0 : s,
116
116
  onMouseEnter: a ? void 0 : c,
117
- className: M(B.item, {
118
- [B.active]: o,
119
- [B.disabled]: a,
120
- [B.danger]: i
117
+ className: j(z.item, {
118
+ [z.active]: o,
119
+ [z.disabled]: a,
120
+ [z.danger]: i
121
121
  }, d),
122
122
  children: [
123
123
  r && /* @__PURE__ */ f("span", {
124
124
  "aria-hidden": "true",
125
- className: B.itemIcon,
125
+ className: z.itemIcon,
126
126
  children: r
127
127
  }),
128
128
  m && /* @__PURE__ */ f("span", {
129
- className: M(B.itemText, B[`itemText--${u}`]),
129
+ className: j(z.itemText, z[`itemText--${u}`]),
130
130
  children: m
131
131
  }),
132
132
  l && /* @__PURE__ */ f("span", {
133
- className: B.itemShortcut,
133
+ className: z.itemShortcut,
134
134
  children: l
135
135
  })
136
136
  ]
137
137
  });
138
- }, H = { group: "_group_ts4nb_1" }, U = () => /* @__PURE__ */ f("li", {
138
+ }, V = { group: "_group_ts4nb_1" }, H = () => /* @__PURE__ */ f("li", {
139
139
  role: "separator",
140
- className: H.separator,
140
+ className: V.separator,
141
141
  "aria-hidden": "true"
142
- }), W = {
142
+ }), U = {
143
143
  button: "_button_ii6sx_1",
144
144
  disabled: "_disabled_ii6sx_16",
145
145
  iconLeft: "_iconLeft_ii6sx_27",
146
146
  arrow: "_arrow_ii6sx_39",
147
147
  iconOnly: "_iconOnly_ii6sx_42",
148
148
  open: "_open_ii6sx_75"
149
- }, te = t(({ children: e, isOpen: t, icon: n, arrowIcon: r, showArrow: i = !0, rotateAngle: a = 90, label: o, className: s, ...c }, l) => {
150
- let u = !!n, d = !!e, m = u && !d, h = i && d, g = r ?? /* @__PURE__ */ f(k, {}), _ = m ? o ?? "Open menu" : void 0;
149
+ }, ne = t(({ children: e, isOpen: t, icon: n, arrowIcon: r, showArrow: i = !0, rotateAngle: a = 90, label: o, className: s, ...c }, l) => {
150
+ let u = !!n, d = !!e, m = u && !d, h = i && d, g = r ?? /* @__PURE__ */ f(O, {}), _ = m ? o ?? "Open menu" : void 0;
151
151
  return /* @__PURE__ */ p("button", {
152
152
  ...c,
153
153
  ref: l,
154
154
  type: "button",
155
- className: M(W.button, {
156
- [W.disabled]: c.disabled,
157
- [W.iconOnly]: m
155
+ className: j(U.button, {
156
+ [U.disabled]: c.disabled,
157
+ [U.iconOnly]: m
158
158
  }, s),
159
159
  "aria-label": _,
160
160
  "aria-expanded": t,
@@ -163,57 +163,57 @@ var F = (e) => {
163
163
  children: [
164
164
  u && /* @__PURE__ */ f("span", {
165
165
  "aria-hidden": "true",
166
- className: W.iconLeft,
166
+ className: U.iconLeft,
167
167
  children: n
168
168
  }),
169
169
  e,
170
170
  h && /* @__PURE__ */ f("span", {
171
171
  "aria-hidden": "true",
172
- className: M(W.arrow, { [W.open]: t }),
172
+ className: j(U.arrow, { [U.open]: t }),
173
173
  children: g
174
174
  })
175
175
  ]
176
176
  });
177
177
  });
178
- te.displayName = "DropdownTrigger";
178
+ ne.displayName = "DropdownTrigger";
179
179
  //#endregion
180
180
  //#region src/components/Dropdown/types.ts
181
- var ne = (e) => e.type !== "group" && e.type !== "separator", G = (e) => e.type === "group", re = (e) => e.type === "separator", ie = { wrapper: "_wrapper_14ue8_1" }, ae = ({ label: e, icon: t, trigger: n, items: r = [], onSelect: i, className: o, disabled: l, rotateAngle: u = 90, placement: d, matchTriggerWidth: m, textWrap: h, showArrow: g = !0, arrowIcon: _ }) => {
182
- let [v, y] = c(!1), [b, x] = c(-1), S = s(null), C = s(null), w = a(), T = `${w}-trigger`, { floatingStyles: D, setRef: O, setFloatingRef: k } = I({
181
+ var re = (e) => e.type !== "group" && e.type !== "separator", W = (e) => e.type === "group", ie = (e) => e.type === "separator", ae = { wrapper: "_wrapper_14ue8_1" }, oe = ({ label: e, icon: t, trigger: n, items: r = [], onSelect: i, className: o, disabled: l, rotateAngle: u = 90, placement: d, matchTriggerWidth: m, textWrap: h, showArrow: g = !0, arrowIcon: _ }) => {
182
+ let [v, y] = c(!1), [b, x] = c(-1), S = s(null), C = s(null), w = a(), T = `${w}-trigger`, { floatingStyles: E, setRef: D, setFloatingRef: O } = te({
183
183
  placement: d,
184
184
  matchTriggerWidth: m,
185
185
  mobileSheetBreakpoint: 640
186
- }), A = r.filter(ne), j = v && b >= 0 ? `${w}-item-${b}` : void 0, N = () => A.findIndex((e) => !e.disabled), P = () => {
186
+ }), k = r.filter(re), A = v && b >= 0 ? `${w}-item-${b}` : void 0, M = () => k.findIndex((e) => !e.disabled), N = () => {
187
187
  l || y((e) => {
188
188
  let t = !e;
189
- return x(t ? N() : -1), t;
189
+ return x(t ? M() : -1), t;
190
190
  });
191
191
  }, F = () => {
192
192
  y(!1), x(-1);
193
- }, R = () => {
193
+ }, L = () => {
194
194
  F(), S.current?.focus();
195
- }, { onKeyDown: B } = E({
195
+ }, { onKeyDown: z } = ee({
196
196
  activeIndex: b,
197
197
  setActiveIndex: x,
198
- items: A,
198
+ items: k,
199
199
  isOpen: v,
200
- onOpen: P,
200
+ onOpen: N,
201
201
  onSelect: () => {
202
- let e = A[b];
203
- !e || e.disabled || (i?.(e.value), R());
202
+ let e = k[b];
203
+ !e || e.disabled || (i?.(e.value), L());
204
204
  },
205
- onClose: R
205
+ onClose: L
206
206
  });
207
- L([S, C], () => F(), v);
208
- let H = (e) => {
209
- S.current = e, O(e);
210
- }, W = (e) => {
211
- C.current = e, k(e), e?.focus();
207
+ I([S, C], () => F(), v);
208
+ let V = (e) => {
209
+ S.current = e, D(e);
210
+ }, U = (e) => {
211
+ C.current = e, O(e), e?.focus();
212
212
  };
213
213
  return /* @__PURE__ */ p("div", {
214
- className: M(ie.wrapper, o),
215
- children: [/* @__PURE__ */ f(te, {
216
- ref: H,
214
+ className: j(ae.wrapper, o),
215
+ children: [/* @__PURE__ */ f(ne, {
216
+ ref: V,
217
217
  id: T,
218
218
  isOpen: v,
219
219
  disabled: l,
@@ -222,32 +222,32 @@ var ne = (e) => e.type !== "group" && e.type !== "separator", G = (e) => e.type
222
222
  showArrow: g,
223
223
  arrowIcon: _,
224
224
  rotateAngle: u,
225
- onClick: P,
226
- onKeyDown: B,
225
+ onClick: N,
226
+ onKeyDown: z,
227
227
  "aria-expanded": v,
228
228
  "aria-haspopup": "menu",
229
229
  ...v && { "aria-controls": w },
230
230
  children: n
231
- }), v && /* @__PURE__ */ f(ee, {
232
- ref: W,
233
- floatingStyles: D,
231
+ }), v && /* @__PURE__ */ f(P, {
232
+ ref: U,
233
+ floatingStyles: E,
234
234
  menuId: w,
235
235
  labelledById: n ? T : void 0,
236
236
  label: n ? void 0 : e,
237
- activeDescendantId: j,
238
- onKeyDown: B,
237
+ activeDescendantId: A,
238
+ onKeyDown: z,
239
239
  children: r.map((e, t) => {
240
- if (G(e)) return /* @__PURE__ */ f(z, { label: e.label }, `group-${e.label}`);
241
- if (re(e)) return /* @__PURE__ */ f(U, {}, `separator-${t}`);
242
- if (ne(e)) {
243
- let t = A.findIndex((t) => t === e);
244
- return /* @__PURE__ */ f(V, {
240
+ if (W(e)) return /* @__PURE__ */ f(R, { label: e.label }, `group-${e.label}`);
241
+ if (ie(e)) return /* @__PURE__ */ f(H, {}, `separator-${t}`);
242
+ if (re(e)) {
243
+ let t = k.findIndex((t) => t === e);
244
+ return /* @__PURE__ */ f(B, {
245
245
  id: `${w}-item-${t}`,
246
246
  ...e,
247
247
  active: b === t,
248
248
  textWrap: e.textWrap || h,
249
249
  onClick: () => {
250
- e.disabled || (i?.(e.value), R());
250
+ e.disabled || (i?.(e.value), L());
251
251
  },
252
252
  onMouseEnter: () => {
253
253
  t < 0 || e.disabled || x(t);
@@ -258,14 +258,14 @@ var ne = (e) => e.type !== "group" && e.type !== "separator", G = (e) => e.type
258
258
  })
259
259
  })]
260
260
  });
261
- }, oe = e(void 0), se = () => {
262
- let e = r(oe);
261
+ }, se = e(void 0), G = () => {
262
+ let e = r(se);
263
263
  if (e === void 0) throw Error("Modal compound components must be used inside Modal");
264
264
  return e;
265
265
  };
266
- oe.displayName = "ModalContext";
266
+ se.displayName = "ModalContext";
267
267
  var ce = { modalBody: "_modalBody_iv33a_1" }, le = ({ children: e }) => {
268
- let { descriptionId: t } = se();
268
+ let { descriptionId: t } = G();
269
269
  return /* @__PURE__ */ f("div", {
270
270
  id: t,
271
271
  className: ce.modalBody,
@@ -288,7 +288,7 @@ var me = {
288
288
  modalHeaderTitle: "_modalHeaderTitle_155d7_8",
289
289
  modalHeaderCloseButton: "_modalHeaderCloseButton_155d7_15"
290
290
  }, he = ({ children: e }) => {
291
- let { onClose: t, titleId: n } = se();
291
+ let { onClose: t, titleId: n } = G();
292
292
  return /* @__PURE__ */ p("div", {
293
293
  className: me.modalHeader,
294
294
  children: [/* @__PURE__ */ f("h2", {
@@ -300,7 +300,7 @@ var me = {
300
300
  className: me.modalHeaderCloseButton,
301
301
  onClick: t,
302
302
  "aria-label": "Close modal",
303
- children: /* @__PURE__ */ f(A, { size: 16 })
303
+ children: /* @__PURE__ */ f(k, { size: 16 })
304
304
  })]
305
305
  });
306
306
  };
@@ -318,7 +318,7 @@ var ge = ({ isOpen: e, onClose: t }) => {
318
318
  "overlay--animated": "_overlay--animated_1xotg_17",
319
319
  modal: "_modal_1xotg_21"
320
320
  }, K = 0, ve = "", ye = ({ children: e, onClose: t, isOpen: r, className: a, closeOnBackdrop: o, closeOnClick: c, closeOnEsc: l = !0, zIndex: u = 1e3, animated: d = !0 }) => {
321
- let p = o ?? c ?? !0, m = s(null), { titleId: h, descriptionId: g } = se(), _ = n((e) => {
321
+ let p = o ?? c ?? !0, m = s(null), { titleId: h, descriptionId: g } = G(), _ = n((e) => {
322
322
  p && e.target === e.currentTarget && t?.();
323
323
  }, [p, t]);
324
324
  return ge({
@@ -328,14 +328,14 @@ var ge = ({ isOpen: e, onClose: t }) => {
328
328
  if (r) return K === 0 && (ve = document.body.style.overflow), K += 1, document.body.style.overflow = "hidden", () => {
329
329
  K = Math.max(0, K - 1), K === 0 && (document.body.style.overflow = ve);
330
330
  };
331
- }, [r]), !r && !d ? null : /* @__PURE__ */ f(N, { children: /* @__PURE__ */ f("div", {
332
- className: M(_e.overlay, r && _e["overlay--open"], d && _e["overlay--animated"], a),
331
+ }, [r]), !r && !d ? null : /* @__PURE__ */ f(M, { children: /* @__PURE__ */ f("div", {
332
+ className: j(_e.overlay, r && _e["overlay--open"], d && _e["overlay--animated"], a),
333
333
  onClick: _,
334
334
  tabIndex: -1,
335
335
  role: "presentation",
336
336
  "aria-hidden": !r,
337
337
  style: { zIndex: u },
338
- children: /* @__PURE__ */ f(j, {
338
+ children: /* @__PURE__ */ f(A, {
339
339
  active: r,
340
340
  focusTrapOptions: {
341
341
  fallbackFocus: () => m.current,
@@ -360,7 +360,7 @@ ye.displayName = "ModalOverlay";
360
360
  //#region src/components/Modal/Modal.tsx
361
361
  var be = ({ isOpen: e, children: t, onClose: n, closeOnBackdrop: r, closeOnClick: i, closeOnEsc: o = !0 }) => {
362
362
  let s = a(), c = a();
363
- return e ? /* @__PURE__ */ f(oe.Provider, {
363
+ return e ? /* @__PURE__ */ f(se.Provider, {
364
364
  value: {
365
365
  onClose: n,
366
366
  titleId: s,
@@ -394,7 +394,7 @@ var xe = Object.assign(be, {
394
394
  }, Se = ({ id: e, label: t, description: n, error: r, required: i = !1, disabled: o = !1, children: s, className: c }) => {
395
395
  let l = a(), u = e ?? l, d = n ? `${u}-description` : void 0, m = r ? `${u}-error` : void 0;
396
396
  return /* @__PURE__ */ p("div", {
397
- className: M(q.wrapper, { [q.disabled]: o }, c),
397
+ className: j(q.wrapper, { [q.disabled]: o }, c),
398
398
  "data-disabled": o || void 0,
399
399
  "data-invalid": !!r || void 0,
400
400
  children: [
@@ -425,50 +425,60 @@ var xe = Object.assign(be, {
425
425
  ]
426
426
  });
427
427
  }, J = {
428
- group: "_group_rncsx_1",
429
- vertical: "_vertical_rncsx_7",
430
- horizontal: "_horizontal_rncsx_11",
431
- option: "_option_rncsx_16",
432
- disabled: "_disabled_rncsx_27",
433
- customRadio: "_customRadio_rncsx_30",
434
- input: "_input_rncsx_35",
435
- label: "_label_rncsx_86"
428
+ group: "_group_10xq8_1",
429
+ groupLabel: "_groupLabel_10xq8_7",
430
+ required: "_required_10xq8_17",
431
+ vertical: "_vertical_10xq8_21",
432
+ horizontal: "_horizontal_10xq8_25",
433
+ option: "_option_10xq8_30",
434
+ disabled: "_disabled_10xq8_41",
435
+ customRadio: "_customRadio_10xq8_44",
436
+ input: "_input_10xq8_49",
437
+ label: "_label_10xq8_100"
436
438
  }, Ce = ({ label: e, description: t, value: n, defaultValue: r, onChange: i, options: o, name: s, required: c = !1, disabled: l = !1, error: u, className: d, orientation: m = "vertical" }) => {
437
- let h = a(), g = `${h}-group`, _ = [t ? `${h}-description` : void 0, u ? `${h}-error` : void 0].filter(Boolean).join(" ") || void 0, [v, y] = T({
439
+ let h = a(), g = `${h}-group`, _ = e ? `${h}-label` : void 0, v = [t ? `${h}-description` : void 0, u ? `${h}-error` : void 0].filter(Boolean).join(" ") || void 0, [y, b] = T({
438
440
  value: n,
439
441
  defaultValue: r ?? "",
440
442
  onChange: i
441
443
  });
442
- return /* @__PURE__ */ f(Se, {
444
+ return /* @__PURE__ */ p(Se, {
443
445
  id: h,
444
- label: e,
445
446
  description: t,
446
447
  required: c,
447
448
  disabled: l,
448
449
  error: u,
449
- children: /* @__PURE__ */ f("div", {
450
+ children: [e && /* @__PURE__ */ p("span", {
451
+ id: _,
452
+ className: J.groupLabel,
453
+ children: [e, c && /* @__PURE__ */ f("span", {
454
+ className: J.required,
455
+ "aria-hidden": "true",
456
+ children: "*"
457
+ })]
458
+ }), /* @__PURE__ */ f("div", {
450
459
  id: g,
451
- className: M(J.group, J[m], d),
460
+ className: j(J.group, J[m], d),
452
461
  role: "radiogroup",
462
+ "aria-labelledby": _,
453
463
  "aria-required": c || void 0,
454
464
  "aria-invalid": !!u || void 0,
455
- "aria-describedby": _,
465
+ "aria-describedby": v,
456
466
  children: o.map((e) => {
457
467
  let t = `${h}-${e.value}`, n = l || e.disabled;
458
468
  return /* @__PURE__ */ p("label", {
459
469
  htmlFor: t,
460
- className: M(J.option, { [J.disabled]: n }),
470
+ className: j(J.option, { [J.disabled]: n }),
461
471
  children: [
462
472
  /* @__PURE__ */ f("input", {
463
473
  id: t,
464
474
  type: "radio",
465
475
  name: s,
466
476
  value: e.value,
467
- checked: v === e.value,
477
+ checked: y === e.value,
468
478
  required: c,
469
479
  disabled: n,
470
480
  onChange: () => {
471
- n || y(e.value);
481
+ n || b(e.value);
472
482
  },
473
483
  className: J.input
474
484
  }),
@@ -483,7 +493,7 @@ var xe = Object.assign(be, {
483
493
  ]
484
494
  }, e.value);
485
495
  })
486
- })
496
+ })]
487
497
  });
488
498
  };
489
499
  Ce.displayName = "RadioGroup";
@@ -499,7 +509,7 @@ var we = {
499
509
  role: "option",
500
510
  "aria-selected": t,
501
511
  "aria-disabled": o || void 0,
502
- className: M(we.option, {
512
+ className: j(we.option, {
503
513
  [we.selected]: t,
504
514
  [we.active]: n,
505
515
  [we.disabled]: o
@@ -517,7 +527,7 @@ Te.displayName = "SelectOption";
517
527
  var Ee = {
518
528
  dropdown: "_dropdown_1vrjb_1",
519
529
  dropdownIn: "_dropdownIn_1vrjb_1"
520
- }, De = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style: i, options: a, selectedValue: o, activeIndex: s, onSelect: c, onMouseEnter: l }) => e ? /* @__PURE__ */ f(N, { children: /* @__PURE__ */ f("ul", {
530
+ }, De = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style: i, options: a, selectedValue: o, activeIndex: s, onSelect: c, onMouseEnter: l }) => e ? /* @__PURE__ */ f(M, { children: /* @__PURE__ */ f("ul", {
521
531
  ref: r,
522
532
  id: t,
523
533
  role: "listbox",
@@ -556,73 +566,73 @@ var Y = {
556
566
  "aria-controls": n ? a : void 0,
557
567
  "aria-describedby": t,
558
568
  "aria-activedescendant": n && o >= 0 ? `${a}-option-${o}` : void 0,
559
- className: M(Y.control, {
569
+ className: j(Y.control, {
560
570
  [Y.error]: !!c,
561
571
  [Y.disabled]: r
562
572
  }),
563
573
  onClick: m,
564
574
  onKeyDown: h,
565
575
  children: [/* @__PURE__ */ f("span", {
566
- className: M(Y.value, { [Y.placeholder]: u }),
576
+ className: j(Y.value, { [Y.placeholder]: u }),
567
577
  children: l
568
578
  }), /* @__PURE__ */ f("span", {
569
- className: M(Y.arrow, { [Y.open]: n }),
579
+ className: j(Y.arrow, { [Y.open]: n }),
570
580
  "aria-hidden": "true",
571
- children: /* @__PURE__ */ f(k, {})
581
+ children: /* @__PURE__ */ f(O, {})
572
582
  })]
573
583
  });
574
584
  Oe.displayName = "SelectTrigger";
575
585
  //#endregion
576
586
  //#region src/components/Select/Select.tsx
577
587
  var ke = ({ label: e, description: t, id: r, name: i, value: l, defaultValue: u, onChange: d, options: m, placeholder: h = "Select...", required: g = !1, disabled: _ = !1, error: v, className: y }) => {
578
- let b = a(), x = r ?? b, S = `${x}-listbox`, C = v ? `${x}-error` : void 0, w = s(null), D = s(null), [O, k] = T({
588
+ let b = a(), x = r ?? b, S = `${x}-listbox`, C = v ? `${x}-error` : void 0, w = s(null), E = s(null), [D, O] = T({
579
589
  value: l,
580
590
  defaultValue: u ?? "",
581
591
  onChange: d
582
- }), [A, j] = c(!1), [M, N] = c(-1), P = o(() => m.find((e) => e.value === O), [m, O]), ee = !!P, { floatingStyles: F, setRef: R, setFloatingRef: z } = I({
583
- open: A,
592
+ }), [k, A] = c(!1), [j, M] = c(-1), N = o(() => m.find((e) => e.value === D), [m, D]), P = !!N, { floatingStyles: F, setRef: L, setFloatingRef: R } = te({
593
+ open: k,
584
594
  matchTriggerWidth: !0,
585
595
  mobileSheetBreakpoint: 640
586
- }), B = n(() => {
587
- let e = m.findIndex((e) => e.value === O && !e.disabled);
596
+ }), z = n(() => {
597
+ let e = m.findIndex((e) => e.value === D && !e.disabled);
588
598
  return e >= 0 ? e : m.findIndex((e) => !e.disabled);
589
- }, [m, O]), V = n(() => {
590
- _ || (N(B()), j(!0));
591
- }, [_, B]), H = n(() => {
592
- j(!1);
593
- }, []), U = n(() => {
599
+ }, [m, D]), B = n(() => {
600
+ _ || (M(z()), A(!0));
601
+ }, [_, z]), V = n(() => {
602
+ A(!1);
603
+ }, []), H = n(() => {
594
604
  if (!_) {
595
- if (A) {
596
- H();
605
+ if (k) {
606
+ V();
597
607
  return;
598
608
  }
599
- V();
609
+ B();
600
610
  }
601
611
  }, [
602
- H,
612
+ V,
603
613
  _,
604
- A,
605
- V
606
- ]), W = n((e) => {
607
- k(e), H(), w.current?.focus();
608
- }, [H, k]), { onKeyDown: te } = E({
609
- activeIndex: M,
610
- setActiveIndex: N,
614
+ k,
615
+ B
616
+ ]), U = n((e) => {
617
+ O(e), V(), w.current?.focus();
618
+ }, [V, O]), { onKeyDown: ne } = ee({
619
+ activeIndex: j,
620
+ setActiveIndex: M,
611
621
  items: m,
612
- isOpen: A,
613
- onOpen: V,
614
- onClose: H,
622
+ isOpen: k,
623
+ onOpen: B,
624
+ onClose: V,
615
625
  onSelect: () => {
616
- let e = m[M];
617
- !e || e.disabled || W(e.value);
626
+ let e = m[j];
627
+ !e || e.disabled || U(e.value);
618
628
  }
619
629
  });
620
- L([w, D], H, A);
621
- let ne = n((e) => {
622
- w.current = e, R(e);
623
- }, [R]), G = n((e) => {
624
- D.current = e, z(e);
625
- }, [z]);
630
+ I([w, E], V, k);
631
+ let re = n((e) => {
632
+ w.current = e, L(e);
633
+ }, [L]), W = n((e) => {
634
+ E.current = e, R(e);
635
+ }, [R]);
626
636
  return /* @__PURE__ */ p(Se, {
627
637
  id: x,
628
638
  label: e,
@@ -635,36 +645,36 @@ var ke = ({ label: e, description: t, id: r, name: i, value: l, defaultValue: u,
635
645
  /* @__PURE__ */ f(Oe, {
636
646
  id: x,
637
647
  errorId: C,
638
- isOpen: A,
648
+ isOpen: k,
639
649
  disabled: _,
640
650
  required: g,
641
651
  listboxId: S,
642
- activeIndex: M,
643
- ariaLabel: e ? void 0 : P?.label || h,
652
+ activeIndex: j,
653
+ ariaLabel: e ? void 0 : N?.label || h,
644
654
  error: v,
645
- displayText: P?.label ?? h,
646
- isPlaceholder: !ee,
647
- buttonRef: ne,
648
- onClick: U,
649
- onKeyDown: te
655
+ displayText: N?.label ?? h,
656
+ isPlaceholder: !P,
657
+ buttonRef: re,
658
+ onClick: H,
659
+ onKeyDown: ne
650
660
  }),
651
661
  i && /* @__PURE__ */ f("input", {
652
662
  type: "hidden",
653
663
  name: i,
654
- value: O,
664
+ value: D,
655
665
  disabled: _
656
666
  }),
657
667
  /* @__PURE__ */ f(De, {
658
- isOpen: A,
668
+ isOpen: k,
659
669
  listboxId: S,
660
670
  labelledById: x,
661
671
  style: F,
662
672
  options: m,
663
- selectedValue: O,
664
- activeIndex: M,
665
- setDropdownRef: G,
666
- onSelect: W,
667
- onMouseEnter: N
673
+ selectedValue: D,
674
+ activeIndex: j,
675
+ setDropdownRef: W,
676
+ onSelect: U,
677
+ onMouseEnter: M
668
678
  })
669
679
  ]
670
680
  });
@@ -685,7 +695,7 @@ var Ae = e(null), je = () => {
685
695
  ...n,
686
696
  role: "tablist",
687
697
  "aria-orientation": r,
688
- className: M(Me.list, r === "vertical" && Me.vertical, i === "underline" && Me.underline, i === "pills" && Me.pills, t),
698
+ className: j(Me.list, r === "vertical" && Me.vertical, i === "underline" && Me.underline, i === "pills" && Me.pills, t),
689
699
  children: e
690
700
  });
691
701
  };
@@ -709,7 +719,7 @@ var Pe = {
709
719
  "aria-labelledby": `tab-${e}`,
710
720
  hidden: !l,
711
721
  tabIndex: 0,
712
- className: M(Pe.panel, o && Pe.visible, a === "vertical" && Pe.vertical, n),
722
+ className: j(Pe.panel, o && Pe.visible, a === "vertical" && Pe.vertical, n),
713
723
  children: t
714
724
  });
715
725
  };
@@ -740,7 +750,7 @@ var X = {
740
750
  id: `tab-${e}`,
741
751
  disabled: i,
742
752
  tabIndex: v ? 0 : -1,
743
- className: M(X.tab, X[h], m === "vertical" && X.vertical, y && X.withIcon, b && X.iconOnly, r),
753
+ className: j(X.tab, X[h], m === "vertical" && X.vertical, y && X.withIcon, b && X.iconOnly, r),
744
754
  onClick: (t) => {
745
755
  i || (d(e), o?.(t));
746
756
  },
@@ -767,7 +777,7 @@ var Le = {
767
777
  p || d(e), i?.(e);
768
778
  }, [p, i]), g = s([]), _ = n((e, t) => {
769
779
  g.current[e] = t;
770
- }, []), { onKeyDown: v } = D({
780
+ }, []), { onKeyDown: v } = E({
771
781
  activeIndex: m,
772
782
  setActiveIndex: h,
773
783
  tabRefs: g,
@@ -783,7 +793,7 @@ var Le = {
783
793
  return /* @__PURE__ */ f(Ae.Provider, {
784
794
  value: y,
785
795
  children: /* @__PURE__ */ f("div", {
786
- className: M(Le.tabs, a === "vertical" && Le.vertical, l),
796
+ className: j(Le.tabs, a === "vertical" && Le.vertical, l),
787
797
  children: e
788
798
  })
789
799
  });
@@ -813,7 +823,7 @@ var ze = Object.assign(Re, {
813
823
  };
814
824
  return /* @__PURE__ */ p("div", {
815
825
  ref: c,
816
- className: M(Be.tooltip, a),
826
+ className: j(Be.tooltip, a),
817
827
  "data-placement": t,
818
828
  "data-state": "open",
819
829
  style: o,
@@ -832,38 +842,38 @@ var He = ({ children: e, placement: t = "top", content: n, disabled: r = !1, del
832
842
  open: 300,
833
843
  close: 100
834
844
  }, maxWidth: o = 250, className: l, onOpenChange: u }) => {
835
- let [g, _] = c(!1), v = s(null), y = a(), { context: b, floatingStyles: x, middlewareData: T, setRef: E, setFloatingRef: D, placement: O } = I({
845
+ let [g, _] = c(!1), v = s(null), y = a(), { context: b, floatingStyles: x, middlewareData: T, setRef: ee, setFloatingRef: E, placement: D } = te({
836
846
  open: g,
837
847
  onOpenChange: (e) => {
838
848
  r || (_(e), u?.(e));
839
849
  },
840
850
  placement: t,
841
851
  middleware: [h({ element: v })]
842
- }), k = T.arrow?.x, A = T.arrow?.y, { getReferenceProps: j, getFloatingProps: M } = w([C(b, { delay: {
852
+ }), O = T.arrow?.x, k = T.arrow?.y, { getReferenceProps: A, getFloatingProps: j } = w([C(b, { delay: {
843
853
  open: i.open,
844
854
  close: i.close
845
855
  } }), S(b)]);
846
856
  return /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("div", {
847
- ref: E,
857
+ ref: ee,
848
858
  style: { display: "inline-flex" },
849
859
  "aria-describedby": g ? y : void 0,
850
- ...j(),
860
+ ...A(),
851
861
  children: e
852
862
  }), /* @__PURE__ */ f(m, { children: g && n && /* @__PURE__ */ f(Ve, {
853
863
  id: y,
854
- ref: D,
864
+ ref: E,
855
865
  content: n,
856
866
  arrowRef: v,
857
- arrowX: k,
858
- arrowY: A,
867
+ arrowX: O,
868
+ arrowY: k,
859
869
  role: "tooltip",
860
870
  style: {
861
871
  ...x,
862
872
  maxWidth: typeof o == "number" ? `${o}px` : o
863
873
  },
864
- placement: O,
874
+ placement: D,
865
875
  className: l,
866
- ...M()
876
+ ...j()
867
877
  }) })] });
868
878
  };
869
879
  He.displayName = "Tooltip";
@@ -872,24 +882,24 @@ He.displayName = "Tooltip";
872
882
  var Ue = (e, t) => {
873
883
  process.env.NODE_ENV !== "production" && !e && console.warn(t);
874
884
  }, Z = {
875
- button: "_button_g2sgv_1",
876
- loading: "_loading_g2sgv_21",
877
- solid: "_solid_g2sgv_32",
878
- primary: "_primary_g2sgv_32",
879
- secondary: "_secondary_g2sgv_51",
880
- danger: "_danger_g2sgv_70",
881
- close: "_close_g2sgv_89",
882
- outline: "_outline_g2sgv_108",
883
- ghost: "_ghost_g2sgv_184",
884
- sm: "_sm_g2sgv_269",
885
- md: "_md_g2sgv_275",
886
- lg: "_lg_g2sgv_281",
887
- fullWidth: "_fullWidth_g2sgv_287",
888
- iconOnly: "_iconOnly_g2sgv_291",
889
- label: "_label_g2sgv_295",
890
- icon: "_icon_g2sgv_291",
891
- spinner: "_spinner_g2sgv_317",
892
- "button-spin": "_button-spin_g2sgv_1"
885
+ button: "_button_s76yk_1",
886
+ loading: "_loading_s76yk_21",
887
+ solid: "_solid_s76yk_32",
888
+ primary: "_primary_s76yk_32",
889
+ secondary: "_secondary_s76yk_52",
890
+ danger: "_danger_s76yk_72",
891
+ close: "_close_s76yk_92",
892
+ outline: "_outline_s76yk_112",
893
+ ghost: "_ghost_s76yk_192",
894
+ sm: "_sm_s76yk_281",
895
+ md: "_md_s76yk_287",
896
+ lg: "_lg_s76yk_293",
897
+ fullWidth: "_fullWidth_s76yk_299",
898
+ iconOnly: "_iconOnly_s76yk_303",
899
+ label: "_label_s76yk_307",
900
+ icon: "_icon_s76yk_303",
901
+ spinner: "_spinner_s76yk_329",
902
+ "button-spin": "_button-spin_s76yk_1"
893
903
  }, We = t(({ children: e, color: t = "primary", variant: n = "solid", size: r = "md", type: i = "button", disabled: a = !1, loading: o = !1, loadingText: s, leftIcon: c, rightIcon: l, fullWidth: u = !1, iconOnly: d = !1, className: m, onClick: h, "aria-label": g, ..._ }, v) => {
894
904
  let y = d || !e && !!(c || l), b = a || o, x = o && s ? s : e;
895
905
  return Ue(!y || !!g, "Button: icon-only buttons must provide aria-label."), /* @__PURE__ */ p("button", {
@@ -900,7 +910,7 @@ var Ue = (e, t) => {
900
910
  onClick: b ? void 0 : h,
901
911
  "aria-label": g || void 0,
902
912
  "aria-busy": o || void 0,
903
- className: M(Z.button, Z[t], Z[n], Z[r], m, {
913
+ className: j(Z.button, Z[t], Z[n], Z[r], m, {
904
914
  [Z.disabled]: b,
905
915
  [Z.loading]: o,
906
916
  [Z.fullWidth]: u,
@@ -915,7 +925,7 @@ var Ue = (e, t) => {
915
925
  className: Z.icon,
916
926
  children: c
917
927
  }),
918
- x && /* @__PURE__ */ f("span", {
928
+ x && !y && /* @__PURE__ */ f("span", {
919
929
  className: Z.label,
920
930
  children: x
921
931
  }),
@@ -947,7 +957,7 @@ var Q = {
947
957
  className: Q.container,
948
958
  children: [/* @__PURE__ */ p("label", {
949
959
  htmlFor: l,
950
- className: M(Q.wrapper, r && Q.disabled, i),
960
+ className: j(Q.wrapper, r && Q.disabled, i),
951
961
  children: [
952
962
  /* @__PURE__ */ f("input", {
953
963
  ref: c,
@@ -964,11 +974,11 @@ var Q = {
964
974
  "aria-label": e ? void 0 : "Checkbox"
965
975
  }),
966
976
  /* @__PURE__ */ f("span", {
967
- className: M(Q.customCheckbox, u && Q.error),
977
+ className: j(Q.customCheckbox, u && Q.error),
968
978
  "aria-hidden": "true",
969
979
  children: d && /* @__PURE__ */ f("span", {
970
980
  className: Q.checkmark,
971
- children: /* @__PURE__ */ f(O, {})
981
+ children: /* @__PURE__ */ f(D, {})
972
982
  })
973
983
  }),
974
984
  e && /* @__PURE__ */ f("span", {
@@ -1021,70 +1031,71 @@ var $ = {
1021
1031
  case "search": return "off";
1022
1032
  default: return;
1023
1033
  }
1024
- }, Je = t(({ id: e, label: t, name: r, description: i, placeholder: o, value: l, defaultValue: u, onChange: d, type: m = "text", size: h = "md", error: g, disabled: _ = !1, required: v = !1, className: y, autoComplete: b, readOnly: x = !1, clearable: S = !1, onClear: C, leftAdornment: w, rightAdornment: T, clearIcon: E, leftAdornmentTone: D = "default", rightAdornmentTone: O = "default", clearIconTone: k = "danger", autoFocus: A, maxLength: j, onMouseEnter: N, onMouseLeave: P, "aria-describedby": ee, "aria-invalid": F, ...I }, L) => {
1025
- let R = a(), z = e ?? R, B = s(null), [V, H] = c(u ?? ""), U = l !== void 0, W = U ? l : V, te = W !== "", ne = qe(m, b), G = S && te && !_ && !x, re = [
1026
- ee,
1027
- i ? `${z}-description` : void 0,
1028
- g ? `${z}-error` : void 0
1029
- ].filter(Boolean).join(" "), ie = E ?? "×", ae = n((e) => {
1030
- if (B.current = e, typeof L == "function") {
1031
- L(e);
1034
+ }, Je = t(({ id: e, label: t, name: r, description: i, placeholder: o, value: l, defaultValue: u, onChange: d, type: m = "text", size: h = "md", error: g, disabled: _ = !1, required: v = !1, className: y, autoComplete: b, readOnly: x = !1, clearable: S = !1, onClear: C, leftAdornment: w, rightAdornment: T, clearIcon: ee, leftAdornmentTone: E = "default", rightAdornmentTone: D = "default", clearIconTone: O = "danger", autoFocus: k, maxLength: A, onMouseEnter: M, onMouseLeave: N, "aria-describedby": P, "aria-invalid": F, ...te }, I) => {
1035
+ let L = a(), R = e ?? L, z = s(null), [B, V] = c(u ?? ""), H = l !== void 0, U = H ? l : B, ne = U !== "", re = qe(m, b), W = S && ne && !_ && !x, ie = [
1036
+ P,
1037
+ i ? `${R}-description` : void 0,
1038
+ g ? `${R}-error` : void 0
1039
+ ].filter(Boolean).join(" "), ae = ee ?? "×", oe = n((e) => {
1040
+ if (z.current = e, typeof I == "function") {
1041
+ I(e);
1032
1042
  return;
1033
1043
  }
1034
- L && (L.current = e);
1035
- }, [L]), oe = n((e) => {
1044
+ I && (I.current = e);
1045
+ }, [I]), se = n((e) => {
1036
1046
  let t = e.target.value;
1037
- U || H(t), d?.(e);
1038
- }, [U, d]), se = n(() => {
1039
- U || H(""), C?.(), B.current?.focus();
1040
- }, [U, C]), ce = !G && !!T;
1047
+ H || V(t), d?.(e);
1048
+ }, [H, d]), G = n(() => {
1049
+ H || V(""), C?.(), z.current?.focus();
1050
+ }, [H, C]), ce = !W && !!T;
1041
1051
  return /* @__PURE__ */ f(Se, {
1042
- id: z,
1052
+ id: R,
1043
1053
  label: t,
1044
1054
  description: i,
1045
1055
  error: g,
1046
1056
  required: v,
1047
1057
  disabled: _,
1048
1058
  children: /* @__PURE__ */ p("div", {
1049
- className: M($.inputWrapper, {
1059
+ className: j($.inputWrapper, {
1050
1060
  [$.hasLeftAdornment]: !!w,
1051
- [$.hasRightAdornment]: !!T || G
1061
+ [$.hasRightAdornment]: !!T || W
1052
1062
  }),
1053
1063
  children: [
1054
1064
  w && /* @__PURE__ */ f("span", {
1055
- className: M($.leftAdornment, Ke[D]),
1065
+ "aria-hidden": "true",
1066
+ className: j($.leftAdornment, Ke[E]),
1056
1067
  children: w
1057
1068
  }),
1058
1069
  /* @__PURE__ */ f("input", {
1059
- ...I,
1060
- ref: ae,
1061
- id: z,
1070
+ ...te,
1071
+ ref: oe,
1072
+ id: R,
1062
1073
  name: r,
1063
1074
  type: m,
1064
- autoComplete: ne,
1065
- className: M($.input, $[h], { [$.error]: !!g }, y),
1066
- value: W,
1067
- onChange: oe,
1075
+ autoComplete: re,
1076
+ className: j($.input, $[h], { [$.error]: !!g }, y),
1077
+ value: U,
1078
+ onChange: se,
1068
1079
  placeholder: o,
1069
1080
  disabled: _,
1070
1081
  readOnly: x,
1071
1082
  required: v,
1072
- autoFocus: A,
1073
- maxLength: j,
1083
+ autoFocus: k,
1084
+ maxLength: A,
1074
1085
  "aria-invalid": g ? !0 : F,
1075
- "aria-describedby": re || void 0,
1076
- onMouseEnter: N,
1077
- onMouseLeave: P
1086
+ "aria-describedby": ie || void 0,
1087
+ onMouseEnter: M,
1088
+ onMouseLeave: N
1078
1089
  }),
1079
- G && /* @__PURE__ */ f("button", {
1090
+ W && /* @__PURE__ */ f("button", {
1080
1091
  type: "button",
1081
- className: M($.clearButton, Ke[k]),
1082
- onClick: se,
1092
+ className: j($.clearButton, Ke[O]),
1093
+ onClick: G,
1083
1094
  "aria-label": "Clear input",
1084
- children: ie
1095
+ children: ae
1085
1096
  }),
1086
1097
  ce && /* @__PURE__ */ f("div", {
1087
- className: M($.rightAdornment, Ke[O]),
1098
+ className: j($.rightAdornment, Ke[D]),
1088
1099
  children: T
1089
1100
  })
1090
1101
  ]
@@ -1132,4 +1143,4 @@ function Qe() {
1132
1143
  return e;
1133
1144
  }
1134
1145
  //#endregion
1135
- export { We as Button, Ge as Checkbox, ae as Dropdown, Se as FormField, Je as Input, xe as Modal, Ce as RadioGroup, ke as Select, ze as Tabs, Ze as ThemeProvider, He as Tooltip, Qe as useTheme };
1146
+ export { We as Button, Ge as Checkbox, oe as Dropdown, Se as FormField, Je as Input, xe as Modal, Ce as RadioGroup, ke as Select, ze as Tabs, Ze as ThemeProvider, He as Tooltip, Qe as useTheme };