@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
@@ -5,7 +5,7 @@ import { forwardRef as t } from "react";
5
5
  import { cn as n, createMachine as r, useMachine as i, useSignals as a } from "@cascivo/core";
6
6
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
7
  //#region ../components/src/toggle/toggle.tsx
8
- var c = t(function({ checked: t, defaultChecked: c = !1, onValueChange: l, onChange: u, label: d, size: f = "md", className: p, disabled: m, ...h }, g) {
8
+ var c = t(function({ checked: t, defaultChecked: c = !1, onValueChange: l, label: u, size: d = "md", className: f, disabled: p, ariaLabel: m, ...h }, g) {
9
9
  a();
10
10
  let [_, v] = i(r({
11
11
  initial: c ? "on" : "off",
@@ -19,21 +19,22 @@ var c = t(function({ checked: t, defaultChecked: c = !1, onValueChange: l, onCha
19
19
  role: "switch",
20
20
  "aria-checked": b,
21
21
  "data-state": b ? "on" : "off",
22
- "data-size": f,
23
- disabled: m,
24
- className: n(e.toggle, p),
22
+ "data-size": d,
23
+ disabled: p,
24
+ className: n(e.toggle, f),
25
25
  onClick: () => {
26
- y || v("TOGGLE"), (l ?? u)?.(!b);
26
+ y || v("TOGGLE"), l?.(!b);
27
27
  },
28
28
  ref: g,
29
29
  ...h,
30
+ "aria-label": h["aria-label"] ?? m,
30
31
  children: [/* @__PURE__ */ o("span", {
31
32
  className: e.track,
32
33
  "aria-hidden": "true",
33
34
  children: /* @__PURE__ */ o("span", { className: e.thumb })
34
- }), d && /* @__PURE__ */ o("span", {
35
+ }), u && /* @__PURE__ */ o("span", {
35
36
  className: e.label,
36
- children: d
37
+ children: u
37
38
  })]
38
39
  });
39
40
  });
@@ -24,88 +24,88 @@ function u(e, t) {
24
24
  function d(e) {
25
25
  return e === void 0 ? [] : Array.isArray(e) ? e : e === "" ? [] : [e];
26
26
  }
27
- function f({ items: o, selectionMode: s = "single", selected: l, defaultSelected: f, onSelectChange: h, expanded: g, defaultExpanded: _, onExpandedChange: v, className: y, "aria-label": b, ariaLabel: x }) {
27
+ function f({ items: o, selectionMode: s = "single", selected: l, defaultSelected: f, onSelectChange: h, expanded: g, defaultExpanded: _, onExpandedChange: v, className: y, "aria-label": b, ariaLabel: x, label: S }) {
28
28
  a();
29
- let [S, C] = r({
29
+ let [C, w] = r({
30
30
  value: g,
31
31
  defaultValue: _ ?? [],
32
32
  onChange: v
33
- }), [w, T] = r({
33
+ }), [T, E] = r({
34
34
  value: l,
35
35
  defaultValue: f ?? (s === "multi" ? [] : ""),
36
36
  onChange: h
37
- }), E = i(null), D = t(/* @__PURE__ */ new Map()), O = new Set(S.value), k = u(o, O), A = new Map(k.map((e, t) => [e.id, t])), j = d(w.value), M = new Set(j), N = E.value ?? j[0] ?? k[0]?.id ?? null, P = (e) => C([...e]), F = (e) => {
38
- if (O.has(e)) return;
39
- let t = new Set(O);
40
- t.add(e), P(t);
41
- }, I = (e) => {
42
- if (!O.has(e)) return;
43
- let t = new Set(O);
44
- t.delete(e), P(t);
37
+ }), D = i(null), O = t(/* @__PURE__ */ new Map()), k = new Set(C.value), A = u(o, k), j = new Map(A.map((e, t) => [e.id, t])), M = d(T.value), N = new Set(M), P = D.value ?? M[0] ?? A[0]?.id ?? null, F = (e) => w([...e]), I = (e) => {
38
+ if (k.has(e)) return;
39
+ let t = new Set(k);
40
+ t.add(e), F(t);
45
41
  }, L = (e) => {
46
- E.value = e, D.current.get(e)?.focus();
42
+ if (!k.has(e)) return;
43
+ let t = new Set(k);
44
+ t.delete(e), F(t);
47
45
  }, R = (e) => {
46
+ D.value = e, O.current.get(e)?.focus();
47
+ }, z = (e) => {
48
48
  if (s === "multi") {
49
- let t = new Set(M);
50
- t.has(e) ? t.delete(e) : t.add(e), T([...t]);
51
- } else T(e);
52
- }, z = t({
49
+ let t = new Set(N);
50
+ t.has(e) ? t.delete(e) : t.add(e), E([...t]);
51
+ } else E(e);
52
+ }, B = t({
53
53
  buffer: "",
54
54
  at: 0
55
- }), B = (e, t) => {
56
- let n = A.get(t.id);
55
+ }), V = (e, t) => {
56
+ let n = j.get(t.id);
57
57
  if (n === void 0) return;
58
- let { hasChildren: r, level: i, parentId: a, expanded: s } = k[n];
58
+ let { hasChildren: r, level: i, parentId: a, expanded: s } = A[n];
59
59
  switch (e.key) {
60
60
  case "ArrowDown": {
61
61
  e.preventDefault();
62
- let t = k[n + 1];
63
- t && L(t.id);
62
+ let t = A[n + 1];
63
+ t && R(t.id);
64
64
  break;
65
65
  }
66
66
  case "ArrowUp": {
67
67
  e.preventDefault();
68
- let t = k[n - 1];
69
- t && L(t.id);
68
+ let t = A[n - 1];
69
+ t && R(t.id);
70
70
  break;
71
71
  }
72
72
  case "ArrowRight":
73
- if (e.preventDefault(), r && !s) F(t.id);
73
+ if (e.preventDefault(), r && !s) I(t.id);
74
74
  else if (r && s) {
75
- let e = k[n + 1];
76
- e && e.level > i && L(e.id);
75
+ let e = A[n + 1];
76
+ e && e.level > i && R(e.id);
77
77
  }
78
78
  break;
79
79
  case "ArrowLeft":
80
- e.preventDefault(), r && s ? I(t.id) : a && L(a);
80
+ e.preventDefault(), r && s ? L(t.id) : a && R(a);
81
81
  break;
82
82
  case "Home":
83
- e.preventDefault(), k[0] && L(k[0].id);
83
+ e.preventDefault(), A[0] && R(A[0].id);
84
84
  break;
85
85
  case "End": {
86
86
  e.preventDefault();
87
- let t = k[k.length - 1];
88
- t && L(t.id);
87
+ let t = A[A.length - 1];
88
+ t && R(t.id);
89
89
  break;
90
90
  }
91
91
  case "Enter":
92
92
  case " ":
93
- e.preventDefault(), R(t.id);
93
+ e.preventDefault(), z(t.id);
94
94
  break;
95
95
  default:
96
96
  if (e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey) {
97
- let t = z.current, r = Date.now();
97
+ let t = B.current, r = Date.now();
98
98
  t.buffer = r - t.at > 500 ? e.key : t.buffer + e.key, t.at = r;
99
- let i = t.buffer.toLowerCase(), a = (e) => typeof e.label == "string" && e.label.toLowerCase().startsWith(i), s = p(o, O), c = [...k.slice(n + 1), ...k.slice(0, n + 1)].find((e) => {
99
+ let i = t.buffer.toLowerCase(), a = (e) => typeof e.label == "string" && e.label.toLowerCase().startsWith(i), s = p(o, k), c = [...A.slice(n + 1), ...A.slice(0, n + 1)].find((e) => {
100
100
  let t = s.get(e.id);
101
101
  return t ? a(t) : !1;
102
102
  });
103
- c && L(c.id);
103
+ c && R(c.id);
104
104
  }
105
105
  break;
106
106
  }
107
- }, V = (e, t, n, r) => {
108
- let i = !!e.children && e.children.length > 0, a = O.has(e.id), o = M.has(e.id), s = N === e.id, l = e.children?.length ?? 0;
107
+ }, H = (e, t, n, r) => {
108
+ let i = !!e.children && e.children.length > 0, a = k.has(e.id), o = N.has(e.id), s = P === e.id, l = e.children?.length ?? 0;
109
109
  return /* @__PURE__ */ c(m, {
110
110
  node: e,
111
111
  level: t,
@@ -115,20 +115,20 @@ function f({ items: o, selectionMode: s = "single", selected: l, defaultSelected
115
115
  isExpanded: a,
116
116
  isSelected: o,
117
117
  isTabbable: s,
118
- itemRefs: D,
119
- onFocusNode: () => E.value = e.id,
120
- onKeyDown: (t) => B(t, e),
118
+ itemRefs: O,
119
+ onFocusNode: () => D.value = e.id,
120
+ onKeyDown: (t) => V(t, e),
121
121
  onActivate: () => {
122
- L(e.id), i && (a ? I : F)(e.id), R(e.id);
122
+ R(e.id), i && (a ? L : I)(e.id), z(e.id);
123
123
  },
124
- children: i && e.children.map((e, n) => V(e, t + 1, n + 1, l))
124
+ children: i && e.children.map((e, n) => H(e, t + 1, n + 1, l))
125
125
  }, e.id);
126
126
  };
127
127
  return /* @__PURE__ */ c("ul", {
128
128
  role: "tree",
129
- "aria-label": x ?? b,
129
+ "aria-label": x ?? b ?? S,
130
130
  className: n(e.tree, y),
131
- children: o.map((e, t) => V(e, 1, t + 1, o.length))
131
+ children: o.map((e, t) => H(e, 1, t + 1, o.length))
132
132
  });
133
133
  }
134
134
  function p(e, t) {
@@ -4,23 +4,23 @@ import e from "./virtual-list.module.js";
4
4
  import { cn as t, useSignal as n, useSignals as r } from "@cascivo/core";
5
5
  import { jsx as i } from "react/jsx-runtime";
6
6
  //#region ../components/src/virtual-list/virtual-list.tsx
7
- function a({ items: a, itemHeight: o, height: s, renderItem: c, overscan: l = 3, ariaLabel: u, className: d }) {
7
+ function a({ items: a, itemHeight: o, height: s, renderItem: c, overscan: l = 3, ariaLabel: u, label: d, className: f }) {
8
8
  r();
9
- let f = n(0), p = Math.ceil(s / o), m = Math.floor(f.value / o), h = Math.max(0, m - l), g = Math.min(a.length, m + p + l), _ = a.slice(h, g), v = (e) => {
10
- f.value = e.currentTarget.scrollTop;
11
- }, y = { blockSize: `${s}px` };
9
+ let p = n(0), m = Math.ceil(s / o), h = Math.floor(p.value / o), g = Math.max(0, h - l), _ = Math.min(a.length, h + m + l), v = a.slice(g, _), y = (e) => {
10
+ p.value = e.currentTarget.scrollTop;
11
+ }, b = { blockSize: `${s}px` };
12
12
  return /* @__PURE__ */ i("div", {
13
- className: t(e.viewport, d),
14
- style: y,
15
- onScroll: v,
13
+ className: t(e.viewport, f),
14
+ style: b,
15
+ onScroll: y,
16
16
  role: "list",
17
- "aria-label": u,
17
+ "aria-label": u ?? d,
18
18
  tabIndex: 0,
19
19
  children: /* @__PURE__ */ i("div", {
20
20
  className: e.canvas,
21
21
  style: { blockSize: `${a.length * o}px` },
22
- children: _.map((t, n) => {
23
- let r = h + n;
22
+ children: v.map((t, n) => {
23
+ let r = g + n;
24
24
  return /* @__PURE__ */ i("div", {
25
25
  role: "listitem",
26
26
  "aria-setsize": a.length,
@@ -6,71 +6,71 @@ import { cn as n, useEffectPropSignal as r, useId as i, useSignalEffect as a } f
6
6
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
7
  //#region ../components/src/wheel-picker/wheel-picker.tsx
8
8
  var c = 120;
9
- function l({ options: l, value: u, onValueChange: d, visibleCount: f = 5, itemHeight: p = 36, ariaLabel: m, className: h }) {
10
- let g = t(null), _ = i(), v = Math.max(0, l.findIndex((e) => e.value === u)), y = t(l);
11
- y.current = l;
12
- let b = t(d);
13
- b.current = d;
14
- let x = t(p);
15
- x.current = p;
16
- let S = t(u);
17
- S.current = u;
18
- let C = (e, t) => {
19
- let n = g.current;
9
+ function l({ options: l, value: u, onValueChange: d, visibleCount: f = 5, itemHeight: p = 36, ariaLabel: m, label: h, className: g }) {
10
+ let _ = t(null), v = i(), y = Math.max(0, l.findIndex((e) => e.value === u)), b = t(l);
11
+ b.current = l;
12
+ let x = t(d);
13
+ x.current = d;
14
+ let S = t(p);
15
+ S.current = p;
16
+ let C = t(u);
17
+ C.current = u;
18
+ let w = (e, t) => {
19
+ let n = _.current;
20
20
  n && n.scrollTo({
21
- top: e * x.current,
21
+ top: e * S.current,
22
22
  behavior: t ? "smooth" : "instant"
23
23
  });
24
- }, w = r(u);
24
+ }, T = r(u);
25
25
  a(() => {
26
- let e = w.value, t = y.current.findIndex((t) => t.value === e);
27
- t >= 0 && C(t, !1);
26
+ let e = T.value, t = b.current.findIndex((t) => t.value === e);
27
+ t >= 0 && w(t, !1);
28
28
  }), a(() => {
29
- let e = g.current;
29
+ let e = _.current;
30
30
  if (!e) return;
31
31
  let t, n = () => {
32
32
  clearTimeout(t), t = setTimeout(() => {
33
- let t = Math.round(e.scrollTop / x.current), n = y.current[t];
34
- n && n.value !== S.current && b.current(n.value);
33
+ let t = Math.round(e.scrollTop / S.current), n = b.current[t];
34
+ n && n.value !== C.current && x.current(n.value);
35
35
  }, c);
36
36
  };
37
37
  return e.addEventListener("scroll", n, { passive: !0 }), () => {
38
38
  clearTimeout(t), e.removeEventListener("scroll", n);
39
39
  };
40
40
  });
41
- let T = (e) => {
41
+ let E = (e) => {
42
42
  let t = Math.max(0, Math.min(l.length - 1, e)), n = l[t];
43
- !n || n.value === u || (d(n.value), C(t, !0));
44
- }, E = (e) => {
43
+ !n || n.value === u || (d(n.value), w(t, !0));
44
+ }, D = (e) => {
45
45
  let t = {
46
- ArrowDown: v + 1,
47
- ArrowUp: v - 1,
46
+ ArrowDown: y + 1,
47
+ ArrowUp: y - 1,
48
48
  Home: 0,
49
49
  End: l.length - 1,
50
- PageDown: v + f,
51
- PageUp: v - f
50
+ PageDown: y + f,
51
+ PageUp: y - f
52
52
  }[e.key];
53
- t !== void 0 && (e.preventDefault(), T(t));
54
- }, D = (f - 1) / 2 * p, O = {
53
+ t !== void 0 && (e.preventDefault(), E(t));
54
+ }, O = (f - 1) / 2 * p, k = {
55
55
  "--_item-height": `${p}px`,
56
- "--_pad": `${D}px`,
56
+ "--_pad": `${O}px`,
57
57
  "--_column-height": `${f * p}px`
58
58
  };
59
59
  return /* @__PURE__ */ s("div", {
60
- className: n(e.root, h),
61
- style: O,
60
+ className: n(e.root, g),
61
+ style: k,
62
62
  children: [/* @__PURE__ */ o("div", {
63
- ref: g,
63
+ ref: _,
64
64
  role: "listbox",
65
65
  tabIndex: 0,
66
- "aria-label": m,
67
- "aria-activedescendant": `${_}-${v}`,
66
+ "aria-label": m ?? h,
67
+ "aria-activedescendant": `${v}-${y}`,
68
68
  className: e.column,
69
- onKeyDown: E,
69
+ onKeyDown: D,
70
70
  children: l.map((t, n) => /* @__PURE__ */ o("div", {
71
- id: `${_}-${n}`,
71
+ id: `${v}-${n}`,
72
72
  role: "option",
73
- "aria-selected": n === v,
73
+ "aria-selected": n === y,
74
74
  className: e.option,
75
75
  children: t.label
76
76
  }, t.value))
@@ -31,26 +31,26 @@ function h(e) {
31
31
  let n = Number(t);
32
32
  return Number.isFinite(n) ? n : null;
33
33
  }
34
- var g = t(function({ value: t, defaultValue: r, onValueChange: g, onChange: _, min: v, max: y, step: b = 1, precision: x, formatOptions: S, label: C, hint: w, error: T, size: E = "md", disabled: D, incrementLabel: O, decrementLabel: k, className: A, id: j, onFocus: M, onBlur: N, onKeyDown: P, ...F }, I) {
34
+ var g = t(function({ value: t, defaultValue: r, onValueChange: g, min: _, max: v, step: y = 1, precision: b, formatOptions: x, label: S, hint: C, error: w, size: T = "md", disabled: E, incrementLabel: D, decrementLabel: O, className: k, id: A, onFocus: j, onBlur: M, onKeyDown: N, ariaLabel: P, ...F }, I) {
35
35
  o();
36
- let L = O ?? c(s.numberInput.increment), R = k ?? c(s.numberInput.decrement), [z, B] = i(d), V = t !== void 0, H = a(r ?? null), U = a(""), W = V ? t : H.value, G = j ?? (C ? `cascade-number-input-${C.toLowerCase().replace(/\s+/g, "-")}` : void 0), K = (e) => {
37
- V || (H.value = e), U.value = e == null ? "" : String(e), e !== W && (g ?? _)?.(e);
36
+ let L = D ?? c(s.numberInput.increment), R = O ?? c(s.numberInput.decrement), [z, B] = i(d), V = t !== void 0, H = a(r ?? null), U = a(""), W = V ? t : H.value, G = A ?? (S ? `cascade-number-input-${S.toLowerCase().replace(/\s+/g, "-")}` : void 0), K = (e) => {
37
+ V || (H.value = e), U.value = e == null ? "" : String(e), e !== W && g?.(e);
38
38
  }, q = () => {
39
39
  let e = h(U.value);
40
- e != null && (e = f(e, v, y), x !== void 0 && (e = m(e, x))), K(e);
40
+ e != null && (e = f(e, _, v), b !== void 0 && (e = m(e, b))), K(e);
41
41
  }, J = (e) => {
42
- let t = (z.value === "focused" ? h(U.value) : W) ?? 0, n = x ?? Math.max(p(b), p(t));
43
- K(f(m(t + e * b, n), v, y));
44
- }, Y = z.value === "focused" ? U.value : ((e) => e == null ? "" : S ? new Intl.NumberFormat(void 0, S).format(e) : String(e))(W), X = W != null && y !== void 0 && W >= y, Z = W != null && v !== void 0 && W <= v;
42
+ let t = (z.value === "focused" ? h(U.value) : W) ?? 0, n = b ?? Math.max(p(y), p(t));
43
+ K(f(m(t + e * y, n), _, v));
44
+ }, Y = z.value === "focused" ? U.value : ((e) => e == null ? "" : x ? new Intl.NumberFormat(void 0, x).format(e) : String(e))(W), X = W != null && v !== void 0 && W >= v, Z = W != null && _ !== void 0 && W <= _;
45
45
  return /* @__PURE__ */ u("div", {
46
- className: n(e.wrapper, A),
47
- "data-state": T ? "error" : z.value,
48
- "data-size": E,
46
+ className: n(e.wrapper, k),
47
+ "data-state": w ? "error" : z.value,
48
+ "data-size": T,
49
49
  children: [
50
- C && /* @__PURE__ */ l("label", {
50
+ S && /* @__PURE__ */ l("label", {
51
51
  className: e.label,
52
52
  htmlFor: G,
53
- children: C
53
+ children: S
54
54
  }),
55
55
  /* @__PURE__ */ u("div", {
56
56
  className: e.field,
@@ -62,26 +62,27 @@ var g = t(function({ value: t, defaultValue: r, onValueChange: g, onChange: _, m
62
62
  role: "spinbutton",
63
63
  className: e.input,
64
64
  value: Y,
65
- disabled: D,
65
+ disabled: E,
66
66
  "aria-valuenow": W ?? void 0,
67
- "aria-valuemin": v,
68
- "aria-valuemax": y,
69
- "aria-invalid": T ? !0 : void 0,
70
- "aria-describedby": T ? `${G}-error` : w ? `${G}-hint` : void 0,
67
+ "aria-valuemin": _,
68
+ "aria-valuemax": v,
69
+ "aria-invalid": w ? !0 : void 0,
70
+ "aria-describedby": w ? `${G}-error` : C ? `${G}-hint` : void 0,
71
71
  onChange: (e) => {
72
72
  U.value = e.target.value;
73
73
  },
74
74
  onFocus: (e) => {
75
- U.value = W == null ? "" : String(W), B("FOCUS"), M?.(e);
75
+ U.value = W == null ? "" : String(W), B("FOCUS"), j?.(e);
76
76
  },
77
77
  onBlur: (e) => {
78
- q(), B("BLUR"), N?.(e);
78
+ q(), B("BLUR"), M?.(e);
79
79
  },
80
80
  onKeyDown: (e) => {
81
- e.key === "ArrowUp" ? (e.preventDefault(), J(1)) : e.key === "ArrowDown" ? (e.preventDefault(), J(-1)) : e.key === "Enter" && q(), P?.(e);
81
+ e.key === "ArrowUp" ? (e.preventDefault(), J(1)) : e.key === "ArrowDown" ? (e.preventDefault(), J(-1)) : e.key === "Enter" && q(), N?.(e);
82
82
  },
83
83
  ref: I,
84
- ...F
84
+ ...F,
85
+ "aria-label": F["aria-label"] ?? P
85
86
  }), /* @__PURE__ */ u("div", {
86
87
  className: e.steppers,
87
88
  children: [/* @__PURE__ */ l("button", {
@@ -89,7 +90,7 @@ var g = t(function({ value: t, defaultValue: r, onValueChange: g, onChange: _, m
89
90
  className: e.stepper,
90
91
  "aria-label": L,
91
92
  tabIndex: -1,
92
- disabled: D || X,
93
+ disabled: E || X,
93
94
  onMouseDown: (e) => e.preventDefault(),
94
95
  onClick: () => J(1),
95
96
  children: /* @__PURE__ */ l("svg", {
@@ -110,7 +111,7 @@ var g = t(function({ value: t, defaultValue: r, onValueChange: g, onChange: _, m
110
111
  className: e.stepper,
111
112
  "aria-label": R,
112
113
  tabIndex: -1,
113
- disabled: D || Z,
114
+ disabled: E || Z,
114
115
  onMouseDown: (e) => e.preventDefault(),
115
116
  onClick: () => J(-1),
116
117
  children: /* @__PURE__ */ l("svg", {
@@ -129,16 +130,16 @@ var g = t(function({ value: t, defaultValue: r, onValueChange: g, onChange: _, m
129
130
  })]
130
131
  })]
131
132
  }),
132
- T && /* @__PURE__ */ l("span", {
133
+ w && /* @__PURE__ */ l("span", {
133
134
  id: `${G}-error`,
134
135
  className: e.error,
135
136
  role: "alert",
136
- children: T
137
+ children: w
137
138
  }),
138
- !T && w && /* @__PURE__ */ l("span", {
139
+ !w && C && /* @__PURE__ */ l("span", {
139
140
  id: `${G}-hint`,
140
141
  className: e.hint,
141
- children: w
142
+ children: C
142
143
  })
143
144
  ]
144
145
  });
@@ -37,9 +37,9 @@ function u() {
37
37
  ]
38
38
  });
39
39
  }
40
- function d({ items: d, onSelect: f, placement: p = "bottom-end", ariaLabel: m, size: h = "md", disabled: g = !1, className: _ }) {
40
+ function d({ items: d, onSelect: f, placement: p = "bottom-end", ariaLabel: m, label: h, size: g = "md", disabled: _ = !1, className: v }) {
41
41
  r();
42
- let v = m ?? a(i.overflowMenu.trigger), y = d.map((e) => {
42
+ let y = m ?? h ?? a(i.overflowMenu.trigger), b = d.map((e) => {
43
43
  let n = {
44
44
  label: e.label,
45
45
  value: l(e)
@@ -50,17 +50,17 @@ function d({ items: d, onSelect: f, placement: p = "bottom-end", ariaLabel: m, s
50
50
  })] }) : e.icon !== void 0 && (n.icon = e.icon), n;
51
51
  });
52
52
  return /* @__PURE__ */ s("div", {
53
- className: n(t.root, _),
53
+ className: n(t.root, v),
54
54
  children: /* @__PURE__ */ s(e, {
55
- items: y,
55
+ items: b,
56
56
  onSelect: (e) => f?.(e),
57
57
  placement: p,
58
58
  trigger: /* @__PURE__ */ s("button", {
59
59
  type: "button",
60
60
  className: t.trigger,
61
- "data-size": h,
62
- disabled: g,
63
- "aria-label": v,
61
+ "data-size": g,
62
+ disabled: _,
63
+ "aria-label": y,
64
64
  children: /* @__PURE__ */ s(u, {})
65
65
  })
66
66
  })
@@ -1,15 +1,15 @@
1
1
  import e from "./progress.module.js";
2
2
  import { jsx as t } from "react/jsx-runtime";
3
3
  //#region ../components/src/progress/progress.tsx
4
- function n({ value: n, variant: r = "primary", size: i = "md", className: a, ariaLabel: o, ...s }) {
4
+ function n({ value: n, variant: r = "primary", size: i = "md", className: a, ariaLabel: o, label: s, ...c }) {
5
5
  return /* @__PURE__ */ t("progress", {
6
- "aria-label": s["aria-label"] ?? o,
6
+ "aria-label": c["aria-label"] ?? o ?? s,
7
7
  className: [e.progress, a].filter(Boolean).join(" "),
8
8
  "data-variant": r,
9
9
  "data-size": i,
10
10
  value: n,
11
11
  max: n === void 0 ? void 0 : 100,
12
- ...s
12
+ ...c
13
13
  });
14
14
  }
15
15
  //#endregion
@@ -3,17 +3,17 @@ import { cn as t } from "@cascivo/core/pure";
3
3
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
4
  //#region ../components/src/progress-circle/progress-circle.tsx
5
5
  var i = 20, a = 2 * Math.PI * i;
6
- function o({ value: o, max: s = 100, size: c = "md", showValue: l = !1, label: u, className: d, ...f }) {
7
- let p = Math.min(Math.max(o, 0), s), m = s > 0 ? p / s * 100 : 0, h = a * (1 - m / 100);
6
+ function o({ value: o, max: s = 100, size: c = "md", showValue: l = !1, label: u, ariaLabel: d, className: f, ...p }) {
7
+ let m = Math.min(Math.max(o, 0), s), h = s > 0 ? m / s * 100 : 0, g = a * (1 - h / 100);
8
8
  return /* @__PURE__ */ r("div", {
9
9
  role: "progressbar",
10
10
  "aria-valuemin": 0,
11
11
  "aria-valuemax": s,
12
- "aria-valuenow": p,
13
- "aria-label": u,
12
+ "aria-valuenow": m,
13
+ "aria-label": d ?? u,
14
14
  "data-size": c,
15
- className: t(e.progressCircle, d),
16
- ...f,
15
+ className: t(e.progressCircle, f),
16
+ ...p,
17
17
  children: [/* @__PURE__ */ r("svg", {
18
18
  viewBox: "0 0 48 48",
19
19
  "aria-hidden": "true",
@@ -34,11 +34,11 @@ function o({ value: o, max: s = 100, size: c = "md", showValue: l = !1, label: u
34
34
  strokeWidth: "4",
35
35
  strokeLinecap: "round",
36
36
  strokeDasharray: a,
37
- strokeDashoffset: h
37
+ strokeDashoffset: g
38
38
  })]
39
39
  }), l && /* @__PURE__ */ r("span", {
40
40
  className: e.value,
41
- children: [Math.round(m), "%"]
41
+ children: [Math.round(h), "%"]
42
42
  })]
43
43
  });
44
44
  }
@@ -26,7 +26,7 @@ function i({ steps: i, currentIndex: a, vertical: o = !1, className: s }) {
26
26
  children: t.description
27
27
  })]
28
28
  })]
29
- }, i);
29
+ }, t.id ?? i);
30
30
  })
31
31
  });
32
32
  }
@@ -7,31 +7,31 @@ import { builtin as i, t as a } from "@cascivo/i18n";
7
7
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
8
  //#region ../components/src/qr-code/qr-code.tsx
9
9
  var c = 4;
10
- function l({ value: l, size: u = 128, errorCorrection: d = "M", radius: f, fill: p = "currentColor", background: m = "transparent", label: h, className: g, style: _, ...v }) {
10
+ function l({ value: l, size: u = 128, errorCorrection: d = "M", radius: f, fill: p = "currentColor", background: m = "transparent", label: h, ariaLabel: g, className: _, style: v, ...y }) {
11
11
  if (r(), !l) return null;
12
- let y = e(l, d), b = y.length + c * 2, x = "";
13
- for (let e = 0; e < y.length; e++) for (let t = 0; t < y.length; t++) y[e][t] && (x += `M${t + c},${e + c}h1v1h-1z`);
12
+ let b = e(l, d), x = b.length + c * 2, S = "";
13
+ for (let e = 0; e < b.length; e++) for (let t = 0; t < b.length; t++) b[e][t] && (S += `M${t + c},${e + c}h1v1h-1z`);
14
14
  return /* @__PURE__ */ o("div", {
15
- className: n(t.qrCode, g),
15
+ className: n(t.qrCode, _),
16
16
  style: {
17
17
  inlineSize: u,
18
18
  blockSize: u,
19
19
  borderRadius: f,
20
- ..._
20
+ ...v
21
21
  },
22
- ...v,
22
+ ...y,
23
23
  children: /* @__PURE__ */ s("svg", {
24
24
  className: t.svg,
25
25
  role: "img",
26
- "aria-label": h ?? a(i.qrCode.label),
27
- viewBox: `0 0 ${b} ${b}`,
26
+ "aria-label": g ?? h ?? a(i.qrCode.label),
27
+ viewBox: `0 0 ${x} ${x}`,
28
28
  shapeRendering: "crispEdges",
29
29
  children: [/* @__PURE__ */ o("rect", {
30
- width: b,
31
- height: b,
30
+ width: x,
31
+ height: x,
32
32
  fill: m
33
33
  }), /* @__PURE__ */ o("path", {
34
- d: x,
34
+ d: S,
35
35
  fill: p
36
36
  })]
37
37
  })
@@ -2,24 +2,24 @@ import e from "./radial-progress.module.js";
2
2
  import { useId as t } from "react";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
4
  //#region ../components/src/radial-progress/radial-progress.tsx
5
- function r({ value: r, size: i = "md", variant: a = "primary", children: o, className: s, ariaLabel: c, ...l }) {
6
- let u = Math.min(100, Math.max(0, r)), d = t();
5
+ function r({ value: r, size: i = "md", variant: a = "primary", children: o, className: s, ariaLabel: c, label: l, ...u }) {
6
+ let d = Math.min(100, Math.max(0, r)), f = t(), p = c ?? l;
7
7
  return /* @__PURE__ */ n("div", {
8
8
  role: "progressbar",
9
- "aria-valuenow": u,
9
+ "aria-valuenow": d,
10
10
  "aria-valuemin": 0,
11
11
  "aria-valuemax": 100,
12
- "aria-labelledby": c ?? l["aria-label"] ? void 0 : d,
12
+ "aria-labelledby": p ?? u["aria-label"] ? void 0 : f,
13
13
  className: [e.radialProgress, s].filter(Boolean).join(" "),
14
14
  "data-size": i,
15
15
  "data-variant": a,
16
- style: { "--cascivo-radial-progress": u },
17
- ...l,
18
- ...c === void 0 ? {} : { "aria-label": c },
16
+ style: { "--cascivo-radial-progress": d },
17
+ ...u,
18
+ ...p === void 0 ? {} : { "aria-label": p },
19
19
  children: /* @__PURE__ */ n("span", {
20
- id: d,
20
+ id: f,
21
21
  className: e.label,
22
- children: o ?? `${u}%`
22
+ children: o ?? `${d}%`
23
23
  })
24
24
  });
25
25
  }