@cascivo/react 0.18.0 → 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,57 +5,57 @@ import { useId as t, useRef as n } from "react";
5
5
  import { DismissableLayer as r, Presence as i, cn as a, focusElement as o, useControllableSignal as s, useRovingFocus as c, useSignalEffect as l, useSignals as u } from "@cascivo/core";
6
6
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
7
7
  //#region ../components/src/fab/fab.tsx
8
- function p({ children: p, label: m, onClick: h, actions: g, position: _ = "bottom-end", open: v, defaultOpen: y, onOpenChange: b, className: x }) {
8
+ function p({ children: p, ariaLabel: m, label: h, onClick: g, actions: _, position: v = "bottom-end", open: y, defaultOpen: b, onOpenChange: x, className: S }) {
9
9
  u();
10
- let S = g != null && g.length > 0, [C, w] = s({
11
- value: v,
12
- defaultValue: y ?? !1,
13
- onChange: b
14
- }), T = c({
10
+ let C = _ != null && _.length > 0, [w, T] = s({
11
+ value: y,
12
+ defaultValue: b ?? !1,
13
+ onChange: x
14
+ }), E = c({
15
15
  orientation: "vertical",
16
16
  loop: !0
17
- }), E = n(null), D = n(null), O = t(), k = n(!1);
17
+ }), D = n(null), O = n(null), k = t(), A = n(!1);
18
18
  l(() => {
19
- let e = S && C.value;
20
- e && !k.current ? D.current?.querySelector("[role=\"menuitem\"]:not([aria-disabled=\"true\"])")?.focus() : !e && k.current && o(E.current), k.current = e;
19
+ let e = C && w.value;
20
+ e && !A.current ? O.current?.querySelector("[role=\"menuitem\"]:not([aria-disabled=\"true\"])")?.focus() : !e && A.current && o(D.current), A.current = e;
21
21
  });
22
- let A = (e) => {
23
- e.disabled || (e.onSelect(), w(!1));
24
- }, j = /* @__PURE__ */ d("button", {
25
- ref: E,
22
+ let j = (e) => {
23
+ e.disabled || (e.onSelect(), T(!1));
24
+ }, M = /* @__PURE__ */ d("button", {
25
+ ref: D,
26
26
  type: "button",
27
- "aria-label": m,
27
+ "aria-label": h ?? m,
28
28
  className: e.fab,
29
- ...S ? {
29
+ ...C ? {
30
30
  "aria-haspopup": "menu",
31
- "aria-expanded": C.value,
32
- "aria-controls": O,
33
- "data-state": C.value ? "open" : "closed",
34
- onClick: () => w(!C.value)
35
- } : { onClick: h },
31
+ "aria-expanded": w.value,
32
+ "aria-controls": k,
33
+ "data-state": w.value ? "open" : "closed",
34
+ onClick: () => T(!w.value)
35
+ } : { onClick: g },
36
36
  children: /* @__PURE__ */ d("span", {
37
37
  className: e.icon,
38
38
  "aria-hidden": "true",
39
39
  children: p
40
40
  })
41
41
  });
42
- return S ? /* @__PURE__ */ d(r, {
43
- onDismiss: () => w(!1),
44
- escapeDismisses: C.value,
45
- disableOutsidePointer: !C.value,
42
+ return C ? /* @__PURE__ */ d(r, {
43
+ onDismiss: () => T(!1),
44
+ escapeDismisses: w.value,
45
+ disableOutsidePointer: !w.value,
46
46
  children: /* @__PURE__ */ f("div", {
47
- className: a(e.root, x),
48
- "data-position": _,
47
+ className: a(e.root, S),
48
+ "data-position": v,
49
49
  children: [/* @__PURE__ */ d(i, {
50
- present: C,
50
+ present: w,
51
51
  children: /* @__PURE__ */ d("menu", {
52
- ref: D,
53
- id: O,
52
+ ref: O,
53
+ id: k,
54
54
  role: "menu",
55
- "aria-label": m,
55
+ "aria-label": h ?? m,
56
56
  className: e.dial,
57
- children: g.map((t, n) => {
58
- let r = T.getItemProps(n);
57
+ children: _.map((t, n) => {
58
+ let r = E.getItemProps(n);
59
59
  return /* @__PURE__ */ d("li", {
60
60
  role: "presentation",
61
61
  className: e.dialItem,
@@ -68,7 +68,7 @@ function p({ children: p, label: m, onClick: h, actions: g, position: _ = "botto
68
68
  className: e.action,
69
69
  onKeyDown: r.onKeyDown,
70
70
  onFocus: r.onFocus,
71
- onClick: () => A(t),
71
+ onClick: () => j(t),
72
72
  children: [/* @__PURE__ */ d("span", {
73
73
  className: e.actionLabel,
74
74
  children: t.label
@@ -81,12 +81,12 @@ function p({ children: p, label: m, onClick: h, actions: g, position: _ = "botto
81
81
  }, t.id ?? n);
82
82
  })
83
83
  })
84
- }), j]
84
+ }), M]
85
85
  })
86
86
  }) : /* @__PURE__ */ d("div", {
87
- className: a(e.root, x),
88
- "data-position": _,
89
- children: j
87
+ className: a(e.root, S),
88
+ "data-position": v,
89
+ children: M
90
90
  });
91
91
  }
92
92
  //#endregion
@@ -13,34 +13,41 @@ function d(e, t) {
13
13
  let n = String(e);
14
14
  l.has(n) || (l.add(n), console.warn(`cascivo Field: both the Field and its child control define a \`label\` (${n}). Omit the child's \`label\` inside a Field — it renders a second <label> for the same control. The Field owns the label.`));
15
15
  }
16
- function f({ label: l, description: u, error: f, required: p = !1, disabled: m = !1, id: h, children: g, className: _ }) {
17
- let v = r("cascade-field"), y = h ?? v, b = `${y}-description`, x = `${y}-error`, S = [u ? b : null, f ? x : null].filter(Boolean).join(" ") || void 0, C = { id: y };
18
- S && (C["aria-describedby"] = S), f && (C["aria-invalid"] = !0), (m || g.props.disabled) && (C.disabled = !0), o(g) && d(l, g);
19
- let w = o(g) ? a(i.only(g), C) : g;
16
+ var f = /* @__PURE__ */ new Set();
17
+ function p(e, t) {
18
+ if (!u() || e == null || t.props.hint == null) return;
19
+ let n = String(e);
20
+ f.has(n) || (f.add(n), console.warn(`cascivo Field: both the Field and its child control define supporting text (${n}). Omit the child's \`hint\` inside a Field — the Field owns it, and only the Field's is wired into aria-describedby.`));
21
+ }
22
+ function m({ label: l, description: u, hint: f, error: m, required: h = !1, disabled: g = !1, id: _, children: v, className: y }) {
23
+ let b = u ?? f, x = r("cascade-field"), S = _ ?? x, C = `${S}-description`, w = `${S}-error`, T = `${S}-label`, E = [b ? C : null, m ? w : null].filter(Boolean).join(" ") || void 0, D = { id: S };
24
+ l != null && (D["aria-labelledby"] = T), E && (D["aria-describedby"] = E), m && (D["aria-invalid"] = !0), (g || v.props.disabled) && (D.disabled = !0), o(v) && (d(l, v), p(b, v));
25
+ let O = o(v) ? a(i.only(v), D) : v;
20
26
  return /* @__PURE__ */ c("div", {
21
- className: n(t.field, _),
22
- "data-disabled": m ? "" : void 0,
27
+ className: n(t.field, y),
28
+ "data-disabled": g ? "" : void 0,
23
29
  children: [
24
30
  l && /* @__PURE__ */ s(e, {
25
- htmlFor: y,
26
- required: p,
27
- disabled: m,
31
+ id: T,
32
+ htmlFor: S,
33
+ required: h,
34
+ disabled: g,
28
35
  children: l
29
36
  }),
30
- w,
31
- u && /* @__PURE__ */ s("p", {
32
- id: b,
37
+ O,
38
+ b && /* @__PURE__ */ s("p", {
39
+ id: C,
33
40
  className: t.description,
34
- children: u
41
+ children: b
35
42
  }),
36
- f && /* @__PURE__ */ s("p", {
37
- id: x,
43
+ m && /* @__PURE__ */ s("p", {
44
+ id: w,
38
45
  role: "alert",
39
46
  className: t.error,
40
- children: f
47
+ children: m
41
48
  })
42
49
  ]
43
50
  });
44
51
  }
45
52
  //#endregion
46
- export { f as Field };
53
+ export { m as Field };
@@ -14,58 +14,59 @@ function u(e, t) {
14
14
  function d(e) {
15
15
  return e >= 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(1)} MB` : e >= 1024 ? `${(e / 1024).toFixed(1)} KB` : `${e} B`;
16
16
  }
17
- function f({ files: f = [], onFilesAdded: p, onRemove: m, multiple: h = !1, accept: g, maxSize: _, onRejected: v, label: y, hint: b, labels: x, disabled: S = !1, className: C }) {
17
+ function f({ files: f = [], onFilesAdded: p, onRemove: m, multiple: h = !1, accept: g, maxSize: _, onRejected: v, label: y, ariaLabel: b, hint: x, labels: S, disabled: C = !1, className: w }) {
18
18
  a();
19
- let w = n(null), T = i(!1), E = y ?? x?.label ?? s(o.fileUploader.label), D = x?.drop ?? s(o.fileUploader.drop), O = x?.uploading ?? s(o.fileUploader.uploading), k = x?.complete ?? s(o.fileUploader.complete), A = x?.error ?? s(o.fileUploader.error), j = (e) => x?.remove ? x.remove.replace("{name}", e) : s(o.fileUploader.remove, { name: e }), M = `cascade-uploader-${E.toLowerCase().replace(/\s+/g, "-")}`, N = `${M}-label`, P = `${M}-hint`, F = (e) => {
19
+ let T = n(null), E = i(!1), D = y ?? S?.label ?? s(o.fileUploader.label), O = S?.drop ?? s(o.fileUploader.drop), k = S?.uploading ?? s(o.fileUploader.uploading), A = S?.complete ?? s(o.fileUploader.complete), j = S?.error ?? s(o.fileUploader.error), M = (e) => S?.remove ? S.remove.replace("{name}", e) : s(o.fileUploader.remove, { name: e }), N = `cascade-uploader-${D.toLowerCase().replace(/\s+/g, "-")}`, P = `${N}-label`, F = `${N}-hint`, I = (e) => {
20
20
  if (!e || e.length === 0) return;
21
21
  let t = h ? Array.from(e) : Array.from(e).slice(0, 1), n = [], r = [], i = [];
22
22
  for (let e of t) g && !u(e, g) ? r.push(e) : _ !== void 0 && e.size > _ ? i.push(e) : n.push(e);
23
23
  r.length > 0 && v?.(r, "type"), i.length > 0 && v?.(i, "size"), n.length > 0 && p?.(n);
24
24
  };
25
25
  return /* @__PURE__ */ l("div", {
26
- className: r(t.uploader, C),
26
+ className: r(t.uploader, w),
27
27
  children: [
28
28
  /* @__PURE__ */ c("span", {
29
- id: N,
29
+ id: P,
30
30
  className: t.label,
31
- children: E
31
+ children: D
32
32
  }),
33
33
  /* @__PURE__ */ c("input", {
34
- ref: w,
34
+ ref: T,
35
35
  type: "file",
36
36
  className: t.input,
37
37
  tabIndex: -1,
38
38
  "aria-hidden": "true",
39
39
  multiple: h,
40
40
  accept: g,
41
- disabled: S,
41
+ disabled: C,
42
42
  onChange: (e) => {
43
- F(e.target.files), e.target.value = "";
43
+ I(e.target.files), e.target.value = "";
44
44
  }
45
45
  }),
46
46
  /* @__PURE__ */ c("button", {
47
47
  type: "button",
48
48
  className: t.zone,
49
- "data-state": T.value ? "dragover" : "idle",
50
- disabled: S,
51
- "aria-describedby": b ? `${N} ${P}` : N,
52
- onClick: () => w.current?.click(),
49
+ "data-state": E.value ? "dragover" : "idle",
50
+ disabled: C,
51
+ "aria-label": b,
52
+ "aria-describedby": x ? `${P} ${F}` : P,
53
+ onClick: () => T.current?.click(),
53
54
  onDragEnter: (e) => {
54
- e.preventDefault(), S || (T.value = !0);
55
+ e.preventDefault(), C || (E.value = !0);
55
56
  },
56
57
  onDragOver: (e) => e.preventDefault(),
57
58
  onDragLeave: () => {
58
- T.value = !1;
59
+ E.value = !1;
59
60
  },
60
61
  onDrop: (e) => {
61
- e.preventDefault(), T.value = !1, !S && F(e.dataTransfer.files);
62
+ e.preventDefault(), E.value = !1, !C && I(e.dataTransfer.files);
62
63
  },
63
- children: D
64
+ children: O
64
65
  }),
65
- b && /* @__PURE__ */ c("span", {
66
- id: P,
66
+ x && /* @__PURE__ */ c("span", {
67
+ id: F,
67
68
  className: t.hint,
68
- children: b
69
+ children: x
69
70
  }),
70
71
  f.length > 0 && /* @__PURE__ */ c("ul", {
71
72
  className: t.list,
@@ -79,16 +80,16 @@ function f({ files: f = [], onFilesAdded: p, onRemove: m, multiple: h = !1, acce
79
80
  children: [
80
81
  n.status === "uploading" && /* @__PURE__ */ c(e, {
81
82
  size: "sm",
82
- label: O
83
+ label: k
83
84
  }),
84
85
  n.status === "complete" && /* @__PURE__ */ c("span", {
85
86
  className: t["glyph-complete"],
86
- "aria-label": k,
87
+ "aria-label": A,
87
88
  children: "✓"
88
89
  }),
89
90
  n.status === "error" && /* @__PURE__ */ c("span", {
90
91
  className: t["glyph-error"],
91
- "aria-label": A,
92
+ "aria-label": j,
92
93
  children: "✕"
93
94
  })
94
95
  ]
@@ -104,7 +105,7 @@ function f({ files: f = [], onFilesAdded: p, onRemove: m, multiple: h = !1, acce
104
105
  /* @__PURE__ */ c("button", {
105
106
  type: "button",
106
107
  className: t.remove,
107
- "aria-label": j(n.name),
108
+ "aria-label": M(n.name),
108
109
  onClick: () => m?.(n.id),
109
110
  children: "✕"
110
111
  }),
@@ -4,29 +4,29 @@ import e from "./filter.module.js";
4
4
  import { useControllableSignal as t, useSignals as n } from "@cascivo/core";
5
5
  import { jsx as r } from "react/jsx-runtime";
6
6
  //#region ../components/src/filter/filter.tsx
7
- function i({ options: i, value: a, defaultValue: o = [], onValueChange: s, onChange: c, multi: l = !1, variant: u = "pill", className: d, ariaLabel: f, ...p }) {
7
+ function i({ options: i, value: a, defaultValue: o = [], onValueChange: s, multi: c = !1, multiple: l, variant: u = "pill", className: d, ariaLabel: f, label: p, ...m }) {
8
8
  n();
9
- let [m, h] = t({
9
+ let h = l ?? c, [g, _] = t({
10
10
  value: a,
11
11
  defaultValue: o,
12
- onChange: s ?? c
12
+ onChange: s
13
13
  });
14
- function g(e) {
15
- let t = m.value, n;
16
- n = l ? t.includes(e) ? t.filter((t) => t !== e) : [...t, e] : t.includes(e) ? [] : [e], h(n);
14
+ function v(e) {
15
+ let t = g.value, n;
16
+ n = h ? t.includes(e) ? t.filter((t) => t !== e) : [...t, e] : t.includes(e) ? [] : [e], _(n);
17
17
  }
18
18
  return /* @__PURE__ */ r("div", {
19
19
  role: "group",
20
20
  className: [e.filter, d].filter(Boolean).join(" "),
21
21
  "data-variant": u,
22
- "aria-label": p["aria-label"] ?? f,
23
- ...p,
22
+ "aria-label": m["aria-label"] ?? f ?? p,
23
+ ...m,
24
24
  children: i.map((t) => /* @__PURE__ */ r("button", {
25
25
  type: "button",
26
26
  className: e.item,
27
- "data-selected": m.value.includes(t.value) || void 0,
28
- onClick: () => g(t.value),
29
- "aria-pressed": m.value.includes(t.value),
27
+ "data-selected": g.value.includes(t.value) || void 0,
28
+ onClick: () => v(t.value),
29
+ "aria-pressed": g.value.includes(t.value),
30
30
  children: t.label
31
31
  }, t.value))
32
32
  });
@@ -11,40 +11,41 @@ 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, size: l = "md", className: u, id: d, onFocus: f, onBlur: p, ...m }, h) {
15
- let [g, _] = i(s), v = d ?? (t ? `cascade-input-${t.toLowerCase().replace(/\s+/g, "-")}` : void 0);
14
+ }), c = t(function({ label: t, hint: r, error: c, size: l = "md", ariaLabel: u, className: d, id: f, onFocus: p, onBlur: m, ...h }, g) {
15
+ let [_, v] = i(s), y = f ?? (t ? `cascade-input-${t.toLowerCase().replace(/\s+/g, "-")}` : void 0);
16
16
  return /* @__PURE__ */ o("div", {
17
- className: n(e.wrapper, u),
18
- "data-state": c ? "error" : g.value,
17
+ className: n(e.wrapper, d),
18
+ "data-state": c ? "error" : _.value,
19
19
  "data-size": l,
20
20
  children: [
21
21
  t && /* @__PURE__ */ a("label", {
22
22
  className: e.label,
23
- htmlFor: v,
23
+ htmlFor: y,
24
24
  children: t
25
25
  }),
26
26
  /* @__PURE__ */ a("input", {
27
- ref: h,
28
- id: v,
27
+ ref: g,
28
+ id: y,
29
29
  className: e.input,
30
30
  "aria-invalid": c ? !0 : void 0,
31
- "aria-describedby": c ? `${v}-error` : r ? `${v}-hint` : void 0,
31
+ "aria-describedby": c ? `${y}-error` : r ? `${y}-hint` : void 0,
32
32
  onFocus: (e) => {
33
- _("FOCUS"), f?.(e);
33
+ v("FOCUS"), p?.(e);
34
34
  },
35
35
  onBlur: (e) => {
36
- _("BLUR"), p?.(e);
36
+ v("BLUR"), m?.(e);
37
37
  },
38
- ...m
38
+ ...h,
39
+ "aria-label": h["aria-label"] ?? u
39
40
  }),
40
41
  c && /* @__PURE__ */ a("span", {
41
- id: `${v}-error`,
42
+ id: `${y}-error`,
42
43
  className: e.error,
43
44
  role: "alert",
44
45
  children: c
45
46
  }),
46
47
  !c && r && /* @__PURE__ */ a("span", {
47
- id: `${v}-hint`,
48
+ id: `${y}-hint`,
48
49
  className: e.hint,
49
50
  children: r
50
51
  })
@@ -5,24 +5,24 @@ import { useId as t, useRef as n } from "react";
5
5
  import { DismissableLayer as r, Presence as i, cn as a, focusElement as o, getLinkComponent as s, useAnchorPosition as c, useRovingFocus as l, useSignal as u, useSignals as d } from "@cascivo/core";
6
6
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
7
7
  //#region ../components/src/navigation-menu/navigation-menu.tsx
8
- function m({ items: n, "aria-label": r, ariaLabel: i, orientation: o = "horizontal", className: s }) {
8
+ function m({ items: n, "aria-label": r, ariaLabel: i, label: o, orientation: s = "horizontal", className: c }) {
9
9
  d();
10
- let c = t(), p = u(null), m = l({
11
- orientation: o,
10
+ let p = t(), m = u(null), g = l({
11
+ orientation: s,
12
12
  loop: !0
13
13
  });
14
14
  return /* @__PURE__ */ f("nav", {
15
- "aria-label": i ?? r,
16
- className: a(e.nav, s),
17
- "data-orientation": o,
15
+ "aria-label": i ?? r ?? o,
16
+ className: a(e.nav, c),
17
+ "data-orientation": s,
18
18
  children: /* @__PURE__ */ f("ul", {
19
19
  role: "list",
20
20
  className: e.list,
21
21
  children: n.map((e, t) => /* @__PURE__ */ f(h, {
22
22
  item: e,
23
- baseId: c,
24
- openId: p,
25
- itemProps: m.getItemProps(t)
23
+ baseId: p,
24
+ openId: m,
25
+ itemProps: g.getItemProps(t)
26
26
  }, e.id))
27
27
  })
28
28
  });
@@ -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
  }