@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
@@ -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
  });
@@ -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))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cascivo/react",
3
- "version": "0.17.1",
3
+ "version": "1.0.0",
4
4
  "private": false,
5
5
  "description": "Prebuilt cascivo design system components — use without copying source. @cascivo/themes installs with it; pair with @cascivo/charts (data-viz) and @cascivo/icons. Docs offline: npx @cascivo/docs",
6
6
  "keywords": [
@@ -51,9 +51,9 @@
51
51
  "provenance": true
52
52
  },
53
53
  "dependencies": {
54
- "@cascivo/core": "^0.17.1",
55
- "@cascivo/i18n": "^0.17.1",
56
- "@cascivo/themes": "^0.4.12"
54
+ "@cascivo/core": "^1.0.0",
55
+ "@cascivo/i18n": "^1.0.0",
56
+ "@cascivo/themes": "^1.0.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@testing-library/jest-dom": "^6.9.1",
package/readme.body.md CHANGED
@@ -42,7 +42,7 @@ grayscale (`ThemeProvider` warns in dev when that happens).
42
42
  In a Server Component file (e.g. `app/layout.tsx`), import the themes once:
43
43
 
44
44
  ```tsx
45
- import '@cascivo/themes/all.css'
45
+ import '@cascivo/themes/light-dark.css'
46
46
  ```
47
47
 
48
48
  Component CSS ships **per component** and is pulled in automatically when you
@@ -85,7 +85,8 @@ RSC without any extra wrapper.
85
85
 
86
86
  ```tsx
87
87
  // once, in your entry file — themes are the only global import
88
- import '@cascivo/themes/all.css' // tokens (once) + base typography + light & dark
88
+ import '@cascivo/themes/light-dark.css' // tokens (once) + base typography + light & dark
89
+ // swap for '@cascivo/themes/all.css' only if you ship a theme picker (all twelve, ~2x)
89
90
 
90
91
  // anywhere — each component brings its own CSS along
91
92
  import { Button, Card, CardContent, Toggle } from '@cascivo/react'
@@ -378,7 +379,7 @@ routing break after adding one of these, check that the import resolves to
378
379
  - **SideNav** — Collapsible sidebar navigation with optional icons and one level of grouping
379
380
  - **SkipNav** — Skip link that jumps keyboard users past the navigation to the main content
380
381
  - **Steps** — Visual progress indicator for multi-step flows with horizontal and vertical orientations
381
- - **Switcher** — App/product switcher listlives inside HeaderPanel, renders links with active indicator and optional dividers
382
+ - **Switcher** — Always-visible app/product switcher LISTevery entry is rendered at once, it does not collapse. Lives inside HeaderPanel; renders links with an active indicator and optional dividers. For a collapsed trigger with a menu, use Dropdown.
382
383
  - **Tabs** — Switch between related panels of content
383
384
  - **Toc** — Table of contents with scroll-spy highlighting of the active section
384
385