@cascivo/react 0.17.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +4 -3
  2. package/dist/action-sheet/action-sheet.js +1 -1
  3. package/dist/breadcrumb/breadcrumb.js +7 -7
  4. package/dist/checkbox/checkbox.js +11 -10
  5. package/dist/color-picker/color-picker.js +81 -77
  6. package/dist/combobox/combobox.js +81 -76
  7. package/dist/command-menu/command-menu.js +104 -104
  8. package/dist/comparison/comparison.js +18 -18
  9. package/dist/data-table/data-table.css +1 -1
  10. package/dist/data-table/data-table.js +148 -121
  11. package/dist/data-table/data-table.module.js +29 -29
  12. package/dist/date-picker/date-picker.js +98 -93
  13. package/dist/date-range-picker/date-range-picker.js +1 -1
  14. package/dist/dock/dock.js +2 -2
  15. package/dist/dropdown/dropdown.js +43 -40
  16. package/dist/editable/editable.js +29 -20
  17. package/dist/fab/fab.js +37 -37
  18. package/dist/field/field.js +24 -17
  19. package/dist/file-uploader/file-uploader.js +24 -23
  20. package/dist/filter/filter.js +11 -11
  21. package/dist/index.d.ts +1302 -85
  22. package/dist/input/input.js +14 -13
  23. package/dist/navigation-menu/navigation-menu.js +9 -9
  24. package/dist/node/action-sheet/action-sheet.js +1 -1
  25. package/dist/node/breadcrumb/breadcrumb.js +7 -7
  26. package/dist/node/checkbox/checkbox.js +11 -10
  27. package/dist/node/color-picker/color-picker.js +81 -77
  28. package/dist/node/combobox/combobox.js +81 -76
  29. package/dist/node/command-menu/command-menu.js +104 -104
  30. package/dist/node/comparison/comparison.js +18 -18
  31. package/dist/node/data-table/data-table.js +148 -121
  32. package/dist/node/data-table/data-table.module.js +29 -29
  33. package/dist/node/date-picker/date-picker.js +98 -93
  34. package/dist/node/date-range-picker/date-range-picker.js +1 -1
  35. package/dist/node/dock/dock.js +2 -2
  36. package/dist/node/dropdown/dropdown.js +43 -40
  37. package/dist/node/editable/editable.js +29 -20
  38. package/dist/node/fab/fab.js +37 -37
  39. package/dist/node/field/field.js +24 -17
  40. package/dist/node/file-uploader/file-uploader.js +24 -23
  41. package/dist/node/filter/filter.js +11 -11
  42. package/dist/node/input/input.js +14 -13
  43. package/dist/node/navigation-menu/navigation-menu.js +9 -9
  44. package/dist/node/number-input/number-input.js +28 -27
  45. package/dist/node/overflow-menu/overflow-menu.js +7 -7
  46. package/dist/node/progress/progress.js +3 -3
  47. package/dist/node/progress-circle/progress-circle.js +8 -8
  48. package/dist/node/progress-indicator/progress-indicator.js +1 -1
  49. package/dist/node/qr-code/qr-code.js +11 -11
  50. package/dist/node/radial-progress/radial-progress.js +9 -9
  51. package/dist/node/radio/radio.js +10 -9
  52. package/dist/node/react/src/index.js +93 -93
  53. package/dist/node/resizable/resizable.js +24 -24
  54. package/dist/node/search/search.js +35 -31
  55. package/dist/node/select/select.js +15 -14
  56. package/dist/node/side-nav/side-nav.js +35 -35
  57. package/dist/node/side-nav/side-nav.module.js +27 -27
  58. package/dist/node/slider/slider.js +13 -12
  59. package/dist/node/spinner/spinner.js +4 -4
  60. package/dist/node/steps/steps.js +10 -10
  61. package/dist/node/structured-list/structured-list.js +14 -14
  62. package/dist/node/swap/swap.js +5 -5
  63. package/dist/node/switcher/switcher.js +5 -5
  64. package/dist/node/tags-input/tags-input.js +20 -16
  65. package/dist/node/textarea/textarea.js +14 -13
  66. package/dist/node/time-picker/time-picker.js +21 -20
  67. package/dist/node/toggle/toggle.js +8 -7
  68. package/dist/node/tree-view/tree-view.js +43 -43
  69. package/dist/node/virtual-list/virtual-list.js +10 -10
  70. package/dist/node/wheel-picker/wheel-picker.js +36 -36
  71. package/dist/number-input/number-input.js +28 -27
  72. package/dist/overflow-menu/overflow-menu.js +7 -7
  73. package/dist/progress/progress.js +3 -3
  74. package/dist/progress-circle/progress-circle.js +8 -8
  75. package/dist/progress-indicator/progress-indicator.js +1 -1
  76. package/dist/qr-code/qr-code.js +11 -11
  77. package/dist/radial-progress/radial-progress.js +9 -9
  78. package/dist/radio/radio.js +10 -9
  79. package/dist/react/src/index.js +93 -93
  80. package/dist/resizable/resizable.js +24 -24
  81. package/dist/search/search.js +35 -31
  82. package/dist/select/select.js +15 -14
  83. package/dist/side-nav/side-nav.css +1 -1
  84. package/dist/side-nav/side-nav.js +35 -35
  85. package/dist/side-nav/side-nav.module.js +27 -27
  86. package/dist/slider/slider.js +13 -12
  87. package/dist/spinner/spinner.js +4 -4
  88. package/dist/steps/steps.js +10 -10
  89. package/dist/structured-list/structured-list.js +14 -14
  90. package/dist/styles.css +2 -2
  91. package/dist/swap/swap.js +5 -5
  92. package/dist/switcher/switcher.js +5 -5
  93. package/dist/tags-input/tags-input.js +20 -16
  94. package/dist/textarea/textarea.js +14 -13
  95. package/dist/time-picker/time-picker.js +21 -20
  96. package/dist/toggle/toggle.js +8 -7
  97. package/dist/tree-view/tree-view.js +43 -43
  98. package/dist/virtual-list/virtual-list.js +10 -10
  99. package/dist/wheel-picker/wheel-picker.js +36 -36
  100. package/package.json +4 -4
  101. package/readme.body.md +4 -3
@@ -141,31 +141,31 @@ function b({ item: e }) {
141
141
  }, t))]
142
142
  })] });
143
143
  }
144
- function x({ items: t, groups: r, collapsed: o, defaultCollapsed: _ = !1, onCollapsedChange: x, ariaLabel: S, collapseLabel: C, expandLabel: w, expandOnHover: T = !1, showCollapseToggle: E = !0, header: D, footer: O, className: k }) {
144
+ function x({ items: t, groups: r, collapsed: o, defaultCollapsed: _ = !1, onCollapsedChange: x, ariaLabel: S, label: C, collapseLabel: w, expandLabel: T, expandOnHover: E = !1, showCollapseToggle: D = !0, header: O, footer: k, className: A }) {
145
145
  u();
146
- let A = S ?? f(d.sideNav.nav), j = C ?? f(d.sideNav.collapse), M = w ?? f(d.sideNav.expand), N = i(), [P] = c({
146
+ let j = S ?? C ?? f(d.sideNav.nav), M = w ?? f(d.sideNav.collapse), N = T ?? f(d.sideNav.expand), P = i(), [F] = c({
147
147
  value: o,
148
148
  defaultValue: _
149
- }), F = r ?? (t ? [{ items: t }] : [{ items: [] }]), I = l(F.flatMap((e) => e.items).filter((e) => e.items?.some((e) => g(e) && e.active)).map((e) => e.label)), L = (e) => {
150
- let t = I.value;
151
- I.value = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
152
- }, R = () => {
153
- let e = !P.value;
154
- o === void 0 && (P.value = e), x?.(e);
155
- }, z = P.value;
149
+ }), I = r ?? (t ? [{ items: t }] : [{ items: [] }]), L = l(I.flatMap((e) => e.items).filter((e) => e.items?.some((e) => g(e) && e.active)).map((e) => e.label)), R = (e) => {
150
+ let t = L.value;
151
+ L.value = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
152
+ }, z = () => {
153
+ let e = !F.value;
154
+ o === void 0 && (F.value = e), x?.(e);
155
+ }, B = F.value;
156
156
  return /* @__PURE__ */ h("nav", {
157
- "aria-label": A,
158
- "data-state": z ? "collapsed" : "expanded",
159
- "data-expand-on-hover": z && T ? "" : void 0,
160
- className: a(n.sideNav, k),
157
+ "aria-label": j,
158
+ "data-state": B ? "collapsed" : "expanded",
159
+ "data-expand-on-hover": B && E ? "" : void 0,
160
+ className: a(n.sideNav, A),
161
161
  children: [
162
- D && /* @__PURE__ */ m("div", {
162
+ O && /* @__PURE__ */ m("div", {
163
163
  className: n.header,
164
- children: D
164
+ children: O
165
165
  }),
166
166
  /* @__PURE__ */ m("ul", {
167
167
  className: n.list,
168
- children: F.map((t, r) => /* @__PURE__ */ h("li", {
168
+ children: I.map((t, r) => /* @__PURE__ */ h("li", {
169
169
  className: n.group,
170
170
  children: [t.label && /* @__PURE__ */ m("h3", {
171
171
  className: n.groupLabel,
@@ -175,22 +175,22 @@ function x({ items: t, groups: r, collapsed: o, defaultCollapsed: _ = !1, onColl
175
175
  children: t.items.map((t, i) => {
176
176
  let a = `${r}-${i}`;
177
177
  if (t.items) {
178
- if (z && !T) return /* @__PURE__ */ m("li", { children: /* @__PURE__ */ m(b, { item: t }) }, t.id ?? a);
179
- let e = I.value.includes(t.label), r = `${N}-group-${a}`;
178
+ if (B && !E) return /* @__PURE__ */ m("li", { children: /* @__PURE__ */ m(b, { item: t }) }, t.id ?? a);
179
+ let e = L.value.includes(t.label), r = `${P}-group-${a}`;
180
180
  return /* @__PURE__ */ h("li", { children: [/* @__PURE__ */ h("button", {
181
181
  type: "button",
182
182
  "aria-expanded": e,
183
183
  "aria-controls": r,
184
- "aria-label": z ? t.label : void 0,
184
+ "aria-label": B ? t.label : void 0,
185
185
  "data-state": e ? "open" : "closed",
186
186
  className: n.groupTrigger,
187
- onClick: () => L(t.label),
187
+ onClick: () => R(t.label),
188
188
  children: [
189
189
  t.icon ? /* @__PURE__ */ m("span", {
190
190
  className: n.icon,
191
191
  "aria-hidden": "true",
192
192
  children: t.icon
193
- }) : z ? /* @__PURE__ */ m("span", {
193
+ }) : B ? /* @__PURE__ */ m("span", {
194
194
  className: n.fallbackIcon,
195
195
  "data-fallback-icon": !0,
196
196
  "aria-hidden": "true",
@@ -198,7 +198,7 @@ function x({ items: t, groups: r, collapsed: o, defaultCollapsed: _ = !1, onColl
198
198
  }) : null,
199
199
  /* @__PURE__ */ m("span", {
200
200
  className: n.label,
201
- "data-rail-hidden": z || void 0,
201
+ "data-rail-hidden": B || void 0,
202
202
  children: t.label
203
203
  }),
204
204
  /* @__PURE__ */ m("svg", {
@@ -238,7 +238,7 @@ function x({ items: t, groups: r, collapsed: o, defaultCollapsed: _ = !1, onColl
238
238
  className: n.icon,
239
239
  "aria-hidden": "true",
240
240
  children: t.icon
241
- }) : z ? /* @__PURE__ */ m("span", {
241
+ }) : B ? /* @__PURE__ */ m("span", {
242
242
  className: n.fallbackIcon,
243
243
  "data-fallback-icon": !0,
244
244
  "aria-hidden": "true",
@@ -246,18 +246,18 @@ function x({ items: t, groups: r, collapsed: o, defaultCollapsed: _ = !1, onColl
246
246
  }) : null,
247
247
  /* @__PURE__ */ m("span", {
248
248
  className: n.label,
249
- "data-rail-hidden": z || void 0,
249
+ "data-rail-hidden": B || void 0,
250
250
  children: t.label
251
251
  }),
252
252
  t.trailing == null ? null : /* @__PURE__ */ m("span", {
253
253
  className: n.trailing,
254
- "data-rail-hidden": z || void 0,
254
+ "data-rail-hidden": B || void 0,
255
255
  children: t.trailing
256
256
  })
257
257
  ] }), c = t.tone && t.tone !== "default" ? t.tone : void 0, l = {
258
258
  href: t.disabled ? void 0 : t.href,
259
259
  "aria-current": t.active ? "page" : void 0,
260
- "aria-label": z ? t.label : void 0,
260
+ "aria-label": B ? t.label : void 0,
261
261
  "aria-disabled": t.disabled || void 0,
262
262
  tabIndex: t.disabled ? -1 : void 0,
263
263
  "data-state": t.active ? "active" : void 0,
@@ -274,7 +274,7 @@ function x({ items: t, groups: r, collapsed: o, defaultCollapsed: _ = !1, onColl
274
274
  if (t.render) return /* @__PURE__ */ m("li", {
275
275
  className: n.customItem,
276
276
  children: t.render({
277
- collapsed: z,
277
+ collapsed: B,
278
278
  children: o,
279
279
  linkProps: l
280
280
  })
@@ -282,7 +282,7 @@ function x({ items: t, groups: r, collapsed: o, defaultCollapsed: _ = !1, onColl
282
282
  let u = s(), d = t.onClick && !t.href ? /* @__PURE__ */ m("button", {
283
283
  type: "button",
284
284
  "aria-current": t.active ? "page" : void 0,
285
- "aria-label": z ? t.label : void 0,
285
+ "aria-label": B ? t.label : void 0,
286
286
  "data-state": t.active ? "active" : void 0,
287
287
  "data-tone": c,
288
288
  className: n.link,
@@ -293,24 +293,24 @@ function x({ items: t, groups: r, collapsed: o, defaultCollapsed: _ = !1, onColl
293
293
  ...l,
294
294
  children: o
295
295
  });
296
- return /* @__PURE__ */ m("li", { children: z && !T ? /* @__PURE__ */ m(e, {
296
+ return /* @__PURE__ */ m("li", { children: B && !E ? /* @__PURE__ */ m(e, {
297
297
  content: t.label,
298
298
  placement: "right",
299
299
  children: d
300
300
  }) : d }, t.id ?? a);
301
301
  })
302
302
  })]
303
- }, r))
303
+ }, t.id ?? r))
304
304
  }),
305
- O && /* @__PURE__ */ m("div", {
305
+ k && /* @__PURE__ */ m("div", {
306
306
  className: n.footer,
307
- children: O
307
+ children: k
308
308
  }),
309
- E && /* @__PURE__ */ m("button", {
309
+ D && /* @__PURE__ */ m("button", {
310
310
  type: "button",
311
- "aria-label": z ? M : j,
311
+ "aria-label": B ? N : M,
312
312
  className: n.collapseToggle,
313
- onClick: R,
313
+ onClick: z,
314
314
  children: /* @__PURE__ */ m("svg", {
315
315
  viewBox: "0 0 16 16",
316
316
  width: "14",
@@ -1,31 +1,31 @@
1
1
  var e = {
2
- sideNav: "_sideNav_1v53b_2",
3
- label: "_label_1v53b_24",
4
- trailing: "_trailing_1v53b_25",
5
- groupIndicator: "_groupIndicator_1v53b_29",
6
- link: "_link_1v53b_50",
7
- groupTrigger: "_groupTrigger_1v53b_51",
8
- fallbackIcon: "_fallbackIcon_1v53b_60",
9
- list: "_list_1v53b_67",
10
- sublistInner: "_sublistInner_1v53b_68",
11
- groupItems: "_groupItems_1v53b_69",
12
- group: "_group_1v53b_29",
13
- groupLabel: "_groupLabel_1v53b_84",
14
- checkMark: "_checkMark_1v53b_185",
15
- icon: "_icon_1v53b_191",
16
- sublist: "_sublist_1v53b_68",
17
- sublink: "_sublink_1v53b_251",
18
- subSeparator: "_subSeparator_1v53b_263",
19
- subGroupLabel: "_subGroupLabel_1v53b_270",
20
- header: "_header_1v53b_282",
21
- footer: "_footer_1v53b_289",
22
- customItem: "_customItem_1v53b_296",
23
- collapseToggle: "_collapseToggle_1v53b_301",
24
- collapseIcon: "_collapseIcon_1v53b_327",
25
- railFlyout: "_railFlyout_1v53b_336",
26
- railFlyoutCaption: "_railFlyoutCaption_1v53b_368",
27
- flyoutItem: "_flyoutItem_1v53b_378",
28
- flyoutSeparator: "_flyoutSeparator_1v53b_383"
2
+ sideNav: "_sideNav_uayvm_2",
3
+ label: "_label_uayvm_24",
4
+ trailing: "_trailing_uayvm_25",
5
+ groupIndicator: "_groupIndicator_uayvm_29",
6
+ link: "_link_uayvm_50",
7
+ groupTrigger: "_groupTrigger_uayvm_51",
8
+ fallbackIcon: "_fallbackIcon_uayvm_60",
9
+ list: "_list_uayvm_67",
10
+ sublistInner: "_sublistInner_uayvm_68",
11
+ groupItems: "_groupItems_uayvm_69",
12
+ group: "_group_uayvm_29",
13
+ groupLabel: "_groupLabel_uayvm_84",
14
+ checkMark: "_checkMark_uayvm_185",
15
+ icon: "_icon_uayvm_191",
16
+ sublist: "_sublist_uayvm_68",
17
+ sublink: "_sublink_uayvm_251",
18
+ subSeparator: "_subSeparator_uayvm_263",
19
+ subGroupLabel: "_subGroupLabel_uayvm_270",
20
+ header: "_header_uayvm_282",
21
+ footer: "_footer_uayvm_289",
22
+ customItem: "_customItem_uayvm_297",
23
+ collapseToggle: "_collapseToggle_uayvm_302",
24
+ collapseIcon: "_collapseIcon_uayvm_328",
25
+ railFlyout: "_railFlyout_uayvm_337",
26
+ railFlyoutCaption: "_railFlyoutCaption_uayvm_369",
27
+ flyoutItem: "_flyoutItem_uayvm_379",
28
+ flyoutSeparator: "_flyoutSeparator_uayvm_384"
29
29
  };
30
30
  //#endregion
31
31
  export { e as default };
@@ -3,25 +3,26 @@ import { cn as t } from "@cascivo/core/pure";
3
3
  import { forwardRef as n } from "react";
4
4
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
5
  //#region ../components/src/slider/slider.tsx
6
- var a = n(function({ label: n, className: a, id: o, min: s = 0, max: c = 100, step: l = 1, disabled: u, ...d }, f) {
7
- let p = o ?? (n ? `cascade-slider-${n.toLowerCase().replace(/\s+/g, "-")}` : void 0);
6
+ var a = n(function({ label: n, ariaLabel: a, className: o, id: s, min: c = 0, max: l = 100, step: u = 1, disabled: d, ...f }, p) {
7
+ let m = s ?? (n ? `cascade-slider-${n.toLowerCase().replace(/\s+/g, "-")}` : void 0);
8
8
  return /* @__PURE__ */ i("div", {
9
- className: t(e.wrapper, a),
10
- "data-disabled": u || void 0,
9
+ className: t(e.wrapper, o),
10
+ "data-disabled": d || void 0,
11
11
  children: [n && /* @__PURE__ */ r("label", {
12
12
  className: e.label,
13
- htmlFor: p,
13
+ htmlFor: m,
14
14
  children: n
15
15
  }), /* @__PURE__ */ r("input", {
16
- id: p,
16
+ id: m,
17
17
  type: "range",
18
- min: s,
19
- max: c,
20
- step: l,
21
- disabled: u,
18
+ min: c,
19
+ max: l,
20
+ step: u,
21
+ disabled: d,
22
22
  className: e.slider,
23
- ref: f,
24
- ...d
23
+ ref: p,
24
+ ...f,
25
+ "aria-label": f["aria-label"] ?? a
25
26
  })]
26
27
  });
27
28
  });
@@ -5,13 +5,13 @@ import { cn as t, useSignals as n } from "@cascivo/core";
5
5
  import { builtin as r, t as i } from "@cascivo/i18n";
6
6
  import { jsx as a } from "react/jsx-runtime";
7
7
  //#region ../components/src/spinner/spinner.tsx
8
- function o({ size: o = "md", label: s, className: c, ...l }) {
8
+ function o({ size: o = "md", label: s, ariaLabel: c, className: l, ...u }) {
9
9
  return n(), /* @__PURE__ */ a("span", {
10
10
  role: "status",
11
- "aria-label": s ?? i(r.spinner.label),
11
+ "aria-label": c ?? s ?? i(r.spinner.label),
12
12
  "data-size": o,
13
- className: t(e.spinner, c),
14
- ...l
13
+ className: t(e.spinner, l),
14
+ ...u
15
15
  });
16
16
  }
17
17
  //#endregion
@@ -5,17 +5,17 @@ import { normalizeProgress as t, useSignal as n, useSignals as r } from "@casciv
5
5
  import { builtin as i, t as a } from "@cascivo/i18n";
6
6
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
7
  //#region ../components/src/steps/steps.tsx
8
- function c({ steps: c, activeStep: l, orientation: u = "horizontal", className: d, ariaLabel: f }) {
8
+ function c({ steps: c, items: l, activeStep: u, orientation: d = "horizontal", className: f, ariaLabel: p, label: m }) {
9
9
  r();
10
- let p = n(l ?? 0);
11
- p.value = l ?? p.value;
12
- let m = f ?? a(i.steps.label);
10
+ let h = l ?? c ?? [], g = n(u ?? 0);
11
+ g.value = u ?? g.value;
12
+ let _ = p ?? m ?? a(i.steps.label);
13
13
  return /* @__PURE__ */ o("ol", {
14
- className: [e.steps, d].filter(Boolean).join(" "),
15
- "data-orientation": u,
16
- "aria-label": m,
17
- children: c.map((n, r) => {
18
- let i = n.state ? t(n.state) : r < p.value ? "complete" : r === p.value ? "active" : "pending";
14
+ className: [e.steps, f].filter(Boolean).join(" "),
15
+ "data-orientation": d,
16
+ "aria-label": _,
17
+ children: h.map((n, r) => {
18
+ let i = n.state ? t(n.state) : r < g.value ? "complete" : r === g.value ? "active" : "pending";
19
19
  return /* @__PURE__ */ s("li", {
20
20
  className: e.step,
21
21
  "data-state": i,
@@ -27,7 +27,7 @@ function c({ steps: c, activeStep: l, orientation: u = "horizontal", className:
27
27
  className: e.label,
28
28
  children: n.label
29
29
  })]
30
- }, r);
30
+ }, n.id ?? r);
31
31
  })
32
32
  });
33
33
  }
@@ -6,10 +6,10 @@ import { cn as n, useControllableSignal as r, useRovingFocus as i, useSignals as
6
6
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
7
  //#region ../components/src/structured-list/structured-list.tsx
8
8
  function c(t) {
9
- let { items: r, headers: i, selectable: a = !1, className: c, ariaLabel: u, "aria-label": d } = t;
9
+ let { items: r, headers: i, selectable: a = !1, className: c, ariaLabel: u, label: d, "aria-label": f } = t;
10
10
  return a ? /* @__PURE__ */ o(l, { ...t }) : /* @__PURE__ */ s("div", {
11
11
  role: "table",
12
- "aria-label": d ?? u,
12
+ "aria-label": f ?? u ?? d,
13
13
  className: n(e.list, c),
14
14
  children: [i && /* @__PURE__ */ o("div", {
15
15
  role: "row",
@@ -34,22 +34,22 @@ function c(t) {
34
34
  })]
35
35
  });
36
36
  }
37
- function l({ items: c, headers: l, value: u, defaultValue: d, onSelect: f, className: p, ariaLabel: m, "aria-label": h }) {
38
- let g = h ?? m;
37
+ function l({ items: c, headers: l, value: u, defaultValue: d, onSelect: f, className: p, ariaLabel: m, "aria-label": h, label: g }) {
38
+ let _ = h ?? m ?? g;
39
39
  a();
40
- let _ = t(), [v, y] = r({
40
+ let v = t(), [y, b] = r({
41
41
  value: u,
42
42
  defaultValue: d ?? c.find((e) => e.selected)?.id ?? "",
43
43
  onChange: f
44
- }), b = i({
44
+ }), x = i({
45
45
  orientation: "vertical",
46
46
  loop: !1
47
- }), x = (e) => {
48
- y(e);
47
+ }), S = (e) => {
48
+ b(e);
49
49
  };
50
50
  return /* @__PURE__ */ s("div", {
51
51
  role: "radiogroup",
52
- "aria-label": g,
52
+ "aria-label": _,
53
53
  className: n(e.list, e.selectable, p),
54
54
  children: [l && /* @__PURE__ */ s("div", {
55
55
  className: e.headerRow,
@@ -63,18 +63,18 @@ function l({ items: c, headers: l, value: u, defaultValue: d, onSelect: f, class
63
63
  }), /* @__PURE__ */ o("div", {
64
64
  className: e.body,
65
65
  children: c.map((t, n) => {
66
- let r = v.value === t.id, { ref: i, ...a } = b.getItemProps(n);
66
+ let r = y.value === t.id, { ref: i, ...a } = x.getItemProps(n);
67
67
  return /* @__PURE__ */ s("div", {
68
68
  role: "radio",
69
69
  "aria-checked": r,
70
- "aria-labelledby": `${_}-${t.id}-label`,
70
+ "aria-labelledby": `${v}-${t.id}-label`,
71
71
  "data-selected": r || void 0,
72
72
  className: e.row,
73
73
  ref: i,
74
74
  ...a,
75
- onClick: () => x(t.id),
75
+ onClick: () => S(t.id),
76
76
  onKeyDown: (e) => {
77
- a.onKeyDown(e), (e.key === "Enter" || e.key === " ") && (e.preventDefault(), x(t.id));
77
+ a.onKeyDown(e), (e.key === "Enter" || e.key === " ") && (e.preventDefault(), S(t.id));
78
78
  },
79
79
  children: [
80
80
  /* @__PURE__ */ o("div", {
@@ -84,7 +84,7 @@ function l({ items: c, headers: l, value: u, defaultValue: d, onSelect: f, class
84
84
  }),
85
85
  /* @__PURE__ */ o("div", {
86
86
  className: e.cell,
87
- id: `${_}-${t.id}-label`,
87
+ id: `${v}-${t.id}-label`,
88
88
  children: t.cells[0]
89
89
  }),
90
90
  t.cells.slice(1).map((t, n) => /* @__PURE__ */ o("div", {
@@ -4,23 +4,23 @@ import e from "./swap.module.js";
4
4
  import { useControllableSignal as t, useSignals as n } from "@cascivo/core";
5
5
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
6
  //#region ../components/src/swap/swap.tsx
7
- function a({ on: a, off: o, checked: s = !1, onValueChange: c, onChange: l, mode: u = "rotate", className: d, ariaLabel: f, ...p }) {
7
+ function a({ on: a, off: o, checked: s = !1, onValueChange: c, mode: l = "rotate", className: u, ariaLabel: d, label: f, ...p }) {
8
8
  n();
9
9
  let [m] = t({ value: s });
10
10
  function h() {
11
11
  let e = !m.value;
12
- (c ?? l)?.(e);
12
+ c?.(e);
13
13
  }
14
14
  return /* @__PURE__ */ i("button", {
15
15
  type: "button",
16
16
  role: "switch",
17
17
  "aria-checked": m.value,
18
- className: [e.swap, d].filter(Boolean).join(" "),
18
+ className: [e.swap, u].filter(Boolean).join(" "),
19
19
  "data-checked": m.value || void 0,
20
- "data-mode": u,
20
+ "data-mode": l,
21
21
  onClick: h,
22
22
  ...p,
23
- ...f === void 0 ? {} : { "aria-label": f },
23
+ ...(d ?? f) === void 0 ? {} : { "aria-label": d ?? f },
24
24
  children: [/* @__PURE__ */ r("span", {
25
25
  className: e.on,
26
26
  "aria-hidden": "true",
@@ -5,17 +5,17 @@ import { cn as t, getLinkComponent as n, useSignals as r } from "@cascivo/core";
5
5
  import { builtin as i, t as a } from "@cascivo/i18n";
6
6
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
7
  //#region ../components/src/switcher/switcher.tsx
8
- function c({ items: c, label: l, className: u }) {
8
+ function c({ items: c, label: l, ariaLabel: u, className: d }) {
9
9
  r();
10
- let d = n();
10
+ let f = n();
11
11
  return /* @__PURE__ */ o("ul", {
12
- "aria-label": l ?? a(i.switcher.label),
13
- className: t(e.switcher, u),
12
+ "aria-label": u ?? l ?? a(i.switcher.label),
13
+ className: t(e.switcher, d),
14
14
  children: c.map((t, n) => "divider" in t ? /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o("span", {
15
15
  role: "separator",
16
16
  "aria-orientation": "horizontal",
17
17
  className: e.divider
18
- }) }, `divider-${n}`) : /* @__PURE__ */ o("li", { children: /* @__PURE__ */ s(d, {
18
+ }) }, `divider-${n}`) : /* @__PURE__ */ o("li", { children: /* @__PURE__ */ s(f, {
19
19
  href: t.href,
20
20
  "aria-current": t.active ? "page" : void 0,
21
21
  "data-state": t.active ? "active" : void 0,
@@ -6,22 +6,22 @@ import { cn as n, focusElement as r, useSignal as i, useSignals as a } from "@ca
6
6
  import { builtin as o, t as s } from "@cascivo/i18n";
7
7
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
8
  //#region ../components/src/tags-input/tags-input.tsx
9
- function u({ value: u, onValueChange: d, placeholder: f, validate: p, max: m, disabled: h = !1, className: g, ..._ }) {
9
+ function u({ value: u, onValueChange: d, placeholder: f, validate: p, max: m, disabled: h = !1, className: g, id: _, ariaLabel: v, label: y, "aria-labelledby": b, "aria-describedby": x, "aria-invalid": S, ...C }) {
10
10
  a();
11
- let v = i(""), y = t(null);
12
- function b(e) {
11
+ let w = i(""), T = t(null), E = v ?? y ?? (b === void 0 ? s(o.tagsInput.label) : void 0);
12
+ function D(e) {
13
13
  let t = e.trim();
14
- t && (m !== void 0 && u.length >= m || u.includes(t) || p && !p(t) || (d([...u, t]), v.value = ""));
14
+ t && (m !== void 0 && u.length >= m || u.includes(t) || p && !p(t) || (d([...u, t]), w.value = ""));
15
15
  }
16
- function x(e) {
16
+ function O(e) {
17
17
  d(u.filter((t, n) => n !== e));
18
18
  }
19
- let S = f ?? s(o.tagsInput.placeholder);
19
+ let k = f ?? s(o.tagsInput.placeholder);
20
20
  return /* @__PURE__ */ l("div", {
21
21
  className: n(e.wrapper, g),
22
22
  "data-disabled": h ? "" : void 0,
23
- onClick: () => r(y.current),
24
- ..._,
23
+ onClick: () => r(T.current),
24
+ ...C,
25
25
  children: [u.map((t, n) => {
26
26
  let r = p ? !p(t) : !1;
27
27
  return /* @__PURE__ */ l("span", {
@@ -33,7 +33,7 @@ function u({ value: u, onValueChange: d, placeholder: f, validate: p, max: m, di
33
33
  "aria-label": s(o.tagsInput.remove, { tag: t }),
34
34
  disabled: h,
35
35
  onClick: (e) => {
36
- e.stopPropagation(), x(n);
36
+ e.stopPropagation(), O(n);
37
37
  },
38
38
  children: /* @__PURE__ */ c("span", {
39
39
  "aria-hidden": "true",
@@ -42,20 +42,24 @@ function u({ value: u, onValueChange: d, placeholder: f, validate: p, max: m, di
42
42
  })]
43
43
  }, n);
44
44
  }), /* @__PURE__ */ c("input", {
45
- ref: y,
45
+ ref: T,
46
46
  className: e.input,
47
- value: v.value,
48
- "aria-label": s(o.tagsInput.label),
49
- placeholder: u.length === 0 ? S : void 0,
47
+ value: w.value,
48
+ id: _,
49
+ "aria-labelledby": b,
50
+ "aria-describedby": x,
51
+ "aria-invalid": S,
52
+ "aria-label": E,
53
+ placeholder: u.length === 0 ? k : void 0,
50
54
  disabled: h,
51
55
  onChange: (e) => {
52
- v.value = e.currentTarget.value;
56
+ w.value = e.currentTarget.value;
53
57
  },
54
58
  onKeyDown: (e) => {
55
- e.key === "Enter" || e.key === "," ? (e.preventDefault(), b(v.value)) : e.key === "Backspace" && !v.value && x(u.length - 1);
59
+ e.key === "Enter" || e.key === "," ? (e.preventDefault(), D(w.value)) : e.key === "Backspace" && !w.value && O(u.length - 1);
56
60
  },
57
61
  onBlur: () => {
58
- v.value && b(v.value);
62
+ w.value && D(w.value);
59
63
  }
60
64
  })]
61
65
  });
@@ -11,42 +11,43 @@ var s = r({
11
11
  idle: { on: { FOCUS: "focused" } },
12
12
  focused: { on: { BLUR: "idle" } }
13
13
  }
14
- }), c = t(function({ label: t, hint: r, error: c, resize: l = "vertical", rows: u = 4, className: d, id: f, onFocus: p, onBlur: m, ...h }, g) {
15
- let [_, v] = i(s), y = f ?? (t ? `cascade-textarea-${t.toLowerCase().replace(/\s+/g, "-")}` : void 0);
14
+ }), c = t(function({ label: t, hint: r, error: c, resize: l = "vertical", rows: u = 4, ariaLabel: d, className: f, id: p, onFocus: m, onBlur: h, ...g }, _) {
15
+ let [v, y] = i(s), b = p ?? (t ? `cascade-textarea-${t.toLowerCase().replace(/\s+/g, "-")}` : void 0);
16
16
  return /* @__PURE__ */ o("div", {
17
- className: n(e.wrapper, d),
18
- "data-state": c ? "error" : _.value,
17
+ className: n(e.wrapper, f),
18
+ "data-state": c ? "error" : v.value,
19
19
  "data-resize": l,
20
20
  children: [
21
21
  t && /* @__PURE__ */ a("label", {
22
22
  className: e.label,
23
- htmlFor: y,
23
+ htmlFor: b,
24
24
  children: t
25
25
  }),
26
26
  /* @__PURE__ */ a("textarea", {
27
- ref: g,
28
- id: y,
27
+ ref: _,
28
+ id: b,
29
29
  rows: u,
30
30
  "aria-multiline": "true",
31
31
  className: e.textarea,
32
32
  "aria-invalid": c ? !0 : void 0,
33
- "aria-describedby": c ? `${y}-error` : r ? `${y}-hint` : void 0,
33
+ "aria-describedby": c ? `${b}-error` : r ? `${b}-hint` : void 0,
34
34
  onFocus: (e) => {
35
- v("FOCUS"), p?.(e);
35
+ y("FOCUS"), m?.(e);
36
36
  },
37
37
  onBlur: (e) => {
38
- v("BLUR"), m?.(e);
38
+ y("BLUR"), h?.(e);
39
39
  },
40
- ...h
40
+ ...g,
41
+ "aria-label": g["aria-label"] ?? d
41
42
  }),
42
43
  c && /* @__PURE__ */ a("span", {
43
- id: `${y}-error`,
44
+ id: `${b}-error`,
44
45
  className: e.error,
45
46
  role: "alert",
46
47
  children: c
47
48
  }),
48
49
  !c && r && /* @__PURE__ */ a("span", {
49
- id: `${y}-hint`,
50
+ id: `${b}-hint`,
50
51
  className: e.hint,
51
52
  children: r
52
53
  })
@@ -11,18 +11,18 @@ var c = r({
11
11
  idle: { on: { FOCUS: "focused" } },
12
12
  focused: { on: { BLUR: "idle" } }
13
13
  }
14
- }), l = t(function({ value: t, defaultValue: r, onValueChange: l, onChange: u, min: d, max: f, step: p, label: m, hint: h, error: g, size: _ = "md", className: v, id: y, onFocus: b, onBlur: x, ...S }, C) {
14
+ }), l = t(function({ value: t, defaultValue: r, onValueChange: l, min: u, max: d, step: f, label: p, hint: m, error: h, size: g = "md", className: _, id: v, onFocus: y, onBlur: b, ariaLabel: x, ...S }, C) {
15
15
  a();
16
- let [w, T] = i(c), E = y ?? (m ? `cascade-time-picker-${m.toLowerCase().replace(/\s+/g, "-")}` : void 0);
16
+ let [w, T] = i(c), E = v ?? (p ? `cascade-time-picker-${p.toLowerCase().replace(/\s+/g, "-")}` : void 0);
17
17
  return /* @__PURE__ */ s("div", {
18
- className: n(e.wrapper, v),
19
- "data-state": g ? "error" : w.value,
20
- "data-size": _,
18
+ className: n(e.wrapper, _),
19
+ "data-state": h ? "error" : w.value,
20
+ "data-size": g,
21
21
  children: [
22
- m && /* @__PURE__ */ o("label", {
22
+ p && /* @__PURE__ */ o("label", {
23
23
  className: e.label,
24
24
  htmlFor: E,
25
- children: m
25
+ children: p
26
26
  }),
27
27
  /* @__PURE__ */ o("input", {
28
28
  id: E,
@@ -30,31 +30,32 @@ var c = r({
30
30
  className: e.input,
31
31
  value: t,
32
32
  defaultValue: r,
33
- min: d,
34
- max: f,
35
- step: p,
36
- "aria-invalid": g ? !0 : void 0,
37
- "aria-describedby": g ? `${E}-error` : h ? `${E}-hint` : void 0,
38
- onChange: (e) => (l ?? u)?.(e.target.value),
33
+ min: u,
34
+ max: d,
35
+ step: f,
36
+ "aria-invalid": h ? !0 : void 0,
37
+ "aria-describedby": h ? `${E}-error` : m ? `${E}-hint` : void 0,
38
+ onChange: (e) => l?.(e.target.value),
39
39
  onFocus: (e) => {
40
- T("FOCUS"), b?.(e);
40
+ T("FOCUS"), y?.(e);
41
41
  },
42
42
  onBlur: (e) => {
43
- T("BLUR"), x?.(e);
43
+ T("BLUR"), b?.(e);
44
44
  },
45
45
  ref: C,
46
- ...S
46
+ ...S,
47
+ "aria-label": S["aria-label"] ?? x
47
48
  }),
48
- g && /* @__PURE__ */ o("span", {
49
+ h && /* @__PURE__ */ o("span", {
49
50
  id: `${E}-error`,
50
51
  className: e.error,
51
52
  role: "alert",
52
- children: g
53
+ children: h
53
54
  }),
54
- !g && h && /* @__PURE__ */ o("span", {
55
+ !h && m && /* @__PURE__ */ o("span", {
55
56
  id: `${E}-hint`,
56
57
  className: e.hint,
57
- children: h
58
+ children: m
58
59
  })
59
60
  ]
60
61
  });