@cascivo/react 0.13.0 → 0.13.1

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 (160) hide show
  1. package/dist/accordion/accordion.js +46 -44
  2. package/dist/action-sheet/action-sheet.js +16 -16
  3. package/dist/alert-dialog/alert-dialog.js +34 -34
  4. package/dist/app-shell/app-shell.css +1 -1
  5. package/dist/app-shell/app-shell.js +14 -12
  6. package/dist/app-shell/app-shell.module.js +8 -8
  7. package/dist/avatar-group/avatar-group.js +6 -6
  8. package/dist/bottom-sheet/bottom-sheet.js +18 -18
  9. package/dist/button/button.js +15 -12
  10. package/dist/button-group/button-group.js +8 -8
  11. package/dist/carousel/carousel.js +20 -20
  12. package/dist/checkbox/checkbox.js +21 -21
  13. package/dist/checkbox-card/checkbox-card.js +15 -13
  14. package/dist/collapsible/collapsible.js +7 -7
  15. package/dist/color-picker/color-picker.js +26 -26
  16. package/dist/combobox/combobox.js +86 -86
  17. package/dist/command-menu/command-menu.js +111 -111
  18. package/dist/comparison/comparison.js +10 -10
  19. package/dist/context-menu/context-menu.js +9 -9
  20. package/dist/copy-button/copy-button.js +18 -16
  21. package/dist/data-table/data-table.js +1 -1
  22. package/dist/date-picker/date-picker.js +25 -25
  23. package/dist/date-range-picker/date-range-picker.js +26 -26
  24. package/dist/drawer/drawer.css +1 -1
  25. package/dist/drawer/drawer.js +18 -17
  26. package/dist/drawer/drawer.module.js +9 -9
  27. package/dist/dropdown/dropdown.js +48 -48
  28. package/dist/editable/editable.js +11 -11
  29. package/dist/fab/fab.js +53 -53
  30. package/dist/field/field.js +8 -8
  31. package/dist/file-uploader/file-uploader.js +19 -19
  32. package/dist/header-panel/header-panel.js +31 -31
  33. package/dist/hover-card/hover-card.js +21 -21
  34. package/dist/icon-button/icon-button.js +5 -5
  35. package/dist/index.d.ts +202 -194
  36. package/dist/input/input.js +22 -21
  37. package/dist/link/link.js +8 -6
  38. package/dist/log-viewer/log-viewer.js +26 -26
  39. package/dist/menu/menu.js +20 -20
  40. package/dist/menu-button/menu-button.js +48 -48
  41. package/dist/menubar/menubar.js +42 -42
  42. package/dist/modal/modal.css +1 -1
  43. package/dist/modal/modal.js +41 -35
  44. package/dist/modal/modal.module.js +8 -7
  45. package/dist/multi-select/multi-select.css +1 -1
  46. package/dist/multi-select/multi-select.js +57 -57
  47. package/dist/multi-select/multi-select.module.js +11 -11
  48. package/dist/native-select/native-select.js +13 -11
  49. package/dist/navigation-menu/navigation-menu.js +46 -46
  50. package/dist/node/accordion/accordion.js +46 -44
  51. package/dist/node/action-sheet/action-sheet.js +16 -16
  52. package/dist/node/alert-dialog/alert-dialog.js +34 -34
  53. package/dist/node/app-shell/app-shell.js +14 -12
  54. package/dist/node/app-shell/app-shell.module.js +8 -8
  55. package/dist/node/avatar-group/avatar-group.js +6 -6
  56. package/dist/node/bottom-sheet/bottom-sheet.js +18 -18
  57. package/dist/node/button/button.js +15 -12
  58. package/dist/node/button-group/button-group.js +8 -8
  59. package/dist/node/carousel/carousel.js +20 -20
  60. package/dist/node/checkbox/checkbox.js +21 -21
  61. package/dist/node/checkbox-card/checkbox-card.js +15 -13
  62. package/dist/node/collapsible/collapsible.js +7 -7
  63. package/dist/node/color-picker/color-picker.js +26 -26
  64. package/dist/node/combobox/combobox.js +86 -86
  65. package/dist/node/command-menu/command-menu.js +111 -111
  66. package/dist/node/comparison/comparison.js +10 -10
  67. package/dist/node/context-menu/context-menu.js +9 -9
  68. package/dist/node/copy-button/copy-button.js +18 -16
  69. package/dist/node/data-table/data-table.js +1 -1
  70. package/dist/node/date-picker/date-picker.js +25 -25
  71. package/dist/node/date-range-picker/date-range-picker.js +26 -26
  72. package/dist/node/drawer/drawer.js +18 -17
  73. package/dist/node/drawer/drawer.module.js +9 -9
  74. package/dist/node/dropdown/dropdown.js +48 -48
  75. package/dist/node/editable/editable.js +11 -11
  76. package/dist/node/fab/fab.js +53 -53
  77. package/dist/node/field/field.js +8 -8
  78. package/dist/node/file-uploader/file-uploader.js +19 -19
  79. package/dist/node/header-panel/header-panel.js +31 -31
  80. package/dist/node/hover-card/hover-card.js +21 -21
  81. package/dist/node/icon-button/icon-button.js +5 -5
  82. package/dist/node/input/input.js +22 -21
  83. package/dist/node/link/link.js +8 -6
  84. package/dist/node/log-viewer/log-viewer.js +26 -26
  85. package/dist/node/menu/menu.js +20 -20
  86. package/dist/node/menu-button/menu-button.js +48 -48
  87. package/dist/node/menubar/menubar.js +42 -42
  88. package/dist/node/modal/modal.js +41 -35
  89. package/dist/node/modal/modal.module.js +8 -7
  90. package/dist/node/multi-select/multi-select.js +57 -57
  91. package/dist/node/multi-select/multi-select.module.js +11 -11
  92. package/dist/node/native-select/native-select.js +13 -11
  93. package/dist/node/navigation-menu/navigation-menu.js +46 -46
  94. package/dist/node/notification/notification.js +26 -26
  95. package/dist/node/number-input/number-input.js +52 -50
  96. package/dist/node/otp-input/otp-input.js +8 -8
  97. package/dist/node/password-input/password-input.js +28 -27
  98. package/dist/node/popover/popover.js +26 -24
  99. package/dist/node/pull-to-refresh/pull-to-refresh.js +13 -13
  100. package/dist/node/radial-progress/radial-progress.js +5 -5
  101. package/dist/node/radio/radio.js +23 -22
  102. package/dist/node/radio-card/radio-card.js +27 -26
  103. package/dist/node/react/src/index.js +3 -3
  104. package/dist/node/react/src/theme.js +30 -19
  105. package/dist/node/resizable/resizable.js +11 -11
  106. package/dist/node/scroll-area/scroll-area.js +4 -4
  107. package/dist/node/search/search.js +49 -49
  108. package/dist/node/select/select.js +27 -26
  109. package/dist/node/sheet/sheet.js +11 -10
  110. package/dist/node/sheet/sheet.module.js +5 -5
  111. package/dist/node/side-nav/side-nav.js +91 -91
  112. package/dist/node/skip-nav/skip-nav.js +12 -12
  113. package/dist/node/slider/slider.js +13 -11
  114. package/dist/node/structured-list/structured-list.js +23 -23
  115. package/dist/node/tabs/tabs.js +49 -47
  116. package/dist/node/tags-input/tags-input.js +35 -35
  117. package/dist/node/textarea/textarea.js +22 -21
  118. package/dist/node/time-picker/time-picker.js +22 -21
  119. package/dist/node/toast/toast.js +15 -15
  120. package/dist/node/toc/toc.js +8 -8
  121. package/dist/node/toggle/toggle.js +15 -13
  122. package/dist/node/toggle-group/toggle-group.js +10 -10
  123. package/dist/node/toggletip/toggletip.js +9 -9
  124. package/dist/node/tooltip/tooltip.js +5 -5
  125. package/dist/node/tree-view/tree-view.js +32 -32
  126. package/dist/notification/notification.js +26 -26
  127. package/dist/number-input/number-input.js +52 -50
  128. package/dist/otp-input/otp-input.js +8 -8
  129. package/dist/password-input/password-input.js +28 -27
  130. package/dist/popover/popover.js +26 -24
  131. package/dist/pull-to-refresh/pull-to-refresh.js +13 -13
  132. package/dist/radial-progress/radial-progress.js +5 -5
  133. package/dist/radio/radio.js +23 -22
  134. package/dist/radio-card/radio-card.js +27 -26
  135. package/dist/react/src/index.js +3 -3
  136. package/dist/react/src/theme.js +30 -19
  137. package/dist/resizable/resizable.js +11 -11
  138. package/dist/scroll-area/scroll-area.js +4 -4
  139. package/dist/search/search.js +49 -49
  140. package/dist/select/select.js +27 -26
  141. package/dist/sheet/sheet.css +1 -1
  142. package/dist/sheet/sheet.js +11 -10
  143. package/dist/sheet/sheet.module.js +5 -5
  144. package/dist/side-nav/side-nav.js +91 -91
  145. package/dist/skip-nav/skip-nav.js +12 -12
  146. package/dist/slider/slider.js +13 -11
  147. package/dist/structured-list/structured-list.js +23 -23
  148. package/dist/styles.css +55 -5
  149. package/dist/tabs/tabs.js +49 -47
  150. package/dist/tags-input/tags-input.js +35 -35
  151. package/dist/textarea/textarea.js +22 -21
  152. package/dist/time-picker/time-picker.js +22 -21
  153. package/dist/toast/toast.js +15 -15
  154. package/dist/toc/toc.js +8 -8
  155. package/dist/toggle/toggle.js +15 -13
  156. package/dist/toggle-group/toggle-group.js +10 -10
  157. package/dist/toggletip/toggletip.js +9 -9
  158. package/dist/tooltip/tooltip.js +5 -5
  159. package/dist/tree-view/tree-view.js +32 -32
  160. package/package.json +10 -4
@@ -2,94 +2,96 @@
2
2
 
3
3
  import e from "./tabs.module.js";
4
4
  import { cn as t, useSignal as n, useSignals as r } from "@cascivo/core";
5
- import { jsx as i } from "react/jsx-runtime";
6
- import { createContext as a, useId as o, useRef as s } from "react";
5
+ import { createContext as i, forwardRef as a, useId as o, useRef as s } from "react";
6
+ import { jsx as c } from "react/jsx-runtime";
7
7
  //#region ../components/src/tabs/tabs.tsx
8
- var c = a(null);
9
- function l({ defaultValue: r, value: a, onValueChange: s, className: l, children: u }) {
10
- let d = o(), f = n(a ?? r ?? "");
11
- a !== void 0 && (f.value = a);
8
+ var l = i(null);
9
+ function u({ defaultValue: r, value: i, onValueChange: a, className: s, children: u }) {
10
+ let d = o(), f = n(i ?? r ?? "");
11
+ i !== void 0 && (f.value = i);
12
12
  let p = {
13
13
  active: f,
14
14
  baseId: d,
15
15
  setValue: (e) => {
16
- a === void 0 && (f.value = e), s?.(e);
16
+ i === void 0 && (f.value = e), a?.(e);
17
17
  }
18
18
  };
19
- return /* @__PURE__ */ i(c.Provider, {
19
+ return /* @__PURE__ */ c(l.Provider, {
20
20
  value: p,
21
- children: /* @__PURE__ */ i("div", {
22
- className: t(e.tabs, l),
21
+ children: /* @__PURE__ */ c("div", {
22
+ className: t(e.tabs, s),
23
23
  children: u
24
24
  })
25
25
  });
26
26
  }
27
- function u({ className: n, children: r, ...a }) {
28
- let o = s(null);
29
- return /* @__PURE__ */ i(c.Consumer, { children: (s) => /* @__PURE__ */ i("div", {
30
- ref: o,
27
+ function d({ className: n, children: r, ...i }) {
28
+ let a = s(null);
29
+ return /* @__PURE__ */ c(l.Consumer, { children: (o) => /* @__PURE__ */ c("div", {
30
+ ref: a,
31
31
  role: "tablist",
32
32
  className: t(e.list, n),
33
33
  onKeyDown: (e) => {
34
- if (!s || ![
34
+ if (!o || ![
35
35
  "ArrowRight",
36
36
  "ArrowLeft",
37
37
  "Home",
38
38
  "End"
39
39
  ].includes(e.key)) return;
40
- let t = Array.from(o.current?.querySelectorAll("[role=\"tab\"]:not([disabled])") ?? []);
40
+ let t = Array.from(a.current?.querySelectorAll("[role=\"tab\"]:not([disabled])") ?? []);
41
41
  if (t.length === 0) return;
42
42
  e.preventDefault();
43
- let n = t.findIndex((e) => e.dataset.value === s.active.value), r = n;
43
+ let n = t.findIndex((e) => e.dataset.value === o.active.value), r = n;
44
44
  e.key === "ArrowRight" ? r = (n + 1) % t.length : e.key === "ArrowLeft" ? r = (n - 1 + t.length) % t.length : e.key === "Home" ? r = 0 : e.key === "End" && (r = t.length - 1);
45
45
  let i = t[r];
46
- i?.focus(), i?.dataset.value && s.setValue(i.dataset.value);
46
+ i?.focus(), i?.dataset.value && o.setValue(i.dataset.value);
47
47
  },
48
- ...a,
48
+ ...i,
49
49
  children: r
50
50
  }) });
51
51
  }
52
- function d(e) {
53
- return /* @__PURE__ */ i(c.Consumer, { children: (t) => t ? /* @__PURE__ */ i(f, {
54
- store: t,
52
+ var f = a(function(e, t) {
53
+ return /* @__PURE__ */ c(l.Consumer, { children: (n) => n ? /* @__PURE__ */ c(p, {
54
+ store: n,
55
+ buttonRef: t,
55
56
  ...e
56
57
  }) : null });
57
- }
58
- function f({ store: n, value: a, className: o, children: s, disabled: c, ...l }) {
58
+ });
59
+ function p({ store: n, value: i, className: a, children: o, disabled: s, buttonRef: l, ...u }) {
59
60
  r();
60
- let u = n.active.value === a;
61
- return /* @__PURE__ */ i("button", {
61
+ let d = n.active.value === i;
62
+ return /* @__PURE__ */ c("button", {
62
63
  type: "button",
63
64
  role: "tab",
64
- id: `${n.baseId}-trigger-${a}`,
65
- "aria-selected": u,
66
- "aria-controls": `${n.baseId}-content-${a}`,
67
- tabIndex: u ? 0 : -1,
68
- "data-state": u ? "active" : "inactive",
69
- "data-value": a,
70
- disabled: c,
71
- className: t(e.trigger, o),
72
- onClick: () => n.setValue(a),
73
- ...l,
74
- children: s
65
+ id: `${n.baseId}-trigger-${i}`,
66
+ "aria-selected": d,
67
+ "aria-controls": `${n.baseId}-content-${i}`,
68
+ tabIndex: d ? 0 : -1,
69
+ "data-state": d ? "active" : "inactive",
70
+ "data-value": i,
71
+ disabled: s,
72
+ className: t(e.trigger, a),
73
+ onClick: () => n.setValue(i),
74
+ ref: l,
75
+ ...u,
76
+ children: o
75
77
  });
76
78
  }
77
- function p(e) {
78
- return /* @__PURE__ */ i(c.Consumer, { children: (t) => t ? /* @__PURE__ */ i(m, {
79
+ function m(e) {
80
+ return /* @__PURE__ */ c(l.Consumer, { children: (t) => t ? /* @__PURE__ */ c(h, {
79
81
  store: t,
80
82
  ...e
81
83
  }) : null });
82
84
  }
83
- function m({ store: n, value: a, className: o, children: s, ...c }) {
84
- return r(), n.active.value === a ? /* @__PURE__ */ i("div", {
85
+ function h({ store: n, value: i, className: a, children: o, ...s }) {
86
+ return r(), n.active.value === i ? /* @__PURE__ */ c("div", {
85
87
  role: "tabpanel",
86
- id: `${n.baseId}-content-${a}`,
87
- "aria-labelledby": `${n.baseId}-trigger-${a}`,
88
+ id: `${n.baseId}-content-${i}`,
89
+ "aria-labelledby": `${n.baseId}-trigger-${i}`,
88
90
  tabIndex: 0,
89
- className: t(e.content, o),
90
- ...c,
91
- children: s
91
+ className: t(e.content, a),
92
+ ...s,
93
+ children: o
92
94
  }) : null;
93
95
  }
94
96
  //#endregion
95
- export { l as Tabs, p as TabsContent, u as TabsList, d as TabsTrigger };
97
+ export { u as Tabs, m as TabsContent, d as TabsList, f as TabsTrigger };
@@ -1,64 +1,64 @@
1
1
  "use client";
2
2
 
3
3
  import e from "./tags-input.module.js";
4
- import { cn as t, useSignal as n, useSignals as r } from "@cascivo/core";
5
- import { builtin as i, t as a } from "@cascivo/i18n";
6
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
- import { useRef as c } from "react";
4
+ import { cn as t, focusElement as n, useSignal as r, useSignals as i } from "@cascivo/core";
5
+ import { useRef as a } from "react";
6
+ import { builtin as o, t as s } from "@cascivo/i18n";
7
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
8
  //#region ../components/src/tags-input/tags-input.tsx
9
- function l({ value: l, onValueChange: u, placeholder: d, validate: f, max: p, disabled: m = !1, className: h, ...g }) {
10
- r();
11
- let _ = n(""), v = c(null);
12
- function y(e) {
9
+ function u({ value: u, onValueChange: d, placeholder: f, validate: p, max: m, disabled: h = !1, className: g, ..._ }) {
10
+ i();
11
+ let v = r(""), y = a(null);
12
+ function b(e) {
13
13
  let t = e.trim();
14
- t && (p !== void 0 && l.length >= p || l.includes(t) || f && !f(t) || (u([...l, t]), _.value = ""));
14
+ t && (m !== void 0 && u.length >= m || u.includes(t) || p && !p(t) || (d([...u, t]), v.value = ""));
15
15
  }
16
- function b(e) {
17
- u(l.filter((t, n) => n !== e));
16
+ function x(e) {
17
+ d(u.filter((t, n) => n !== e));
18
18
  }
19
- let x = d ?? a(i.tagsInput.placeholder);
20
- return /* @__PURE__ */ s("div", {
21
- className: t(e.wrapper, h),
22
- "data-disabled": m ? "" : void 0,
23
- onClick: () => v.current?.focus(),
24
- ...g,
25
- children: [l.map((t, n) => {
26
- let r = f ? !f(t) : !1;
27
- return /* @__PURE__ */ s("span", {
19
+ let S = f ?? s(o.tagsInput.placeholder);
20
+ return /* @__PURE__ */ l("div", {
21
+ className: t(e.wrapper, g),
22
+ "data-disabled": h ? "" : void 0,
23
+ onClick: () => n(y.current),
24
+ ..._,
25
+ children: [u.map((t, n) => {
26
+ let r = p ? !p(t) : !1;
27
+ return /* @__PURE__ */ l("span", {
28
28
  className: e.tag,
29
29
  "data-state": r ? "invalid" : void 0,
30
- children: [t, /* @__PURE__ */ o("button", {
30
+ children: [t, /* @__PURE__ */ c("button", {
31
31
  type: "button",
32
32
  className: e.dismiss,
33
- "aria-label": a(i.tagsInput.remove, { tag: t }),
34
- disabled: m,
33
+ "aria-label": s(o.tagsInput.remove, { tag: t }),
34
+ disabled: h,
35
35
  onClick: (e) => {
36
- e.stopPropagation(), b(n);
36
+ e.stopPropagation(), x(n);
37
37
  },
38
- children: /* @__PURE__ */ o("span", {
38
+ children: /* @__PURE__ */ c("span", {
39
39
  "aria-hidden": "true",
40
40
  children: "×"
41
41
  })
42
42
  })]
43
43
  }, n);
44
- }), /* @__PURE__ */ o("input", {
45
- ref: v,
44
+ }), /* @__PURE__ */ c("input", {
45
+ ref: y,
46
46
  className: e.input,
47
- value: _.value,
48
- "aria-label": a(i.tagsInput.label),
49
- placeholder: l.length === 0 ? x : void 0,
50
- disabled: m,
47
+ value: v.value,
48
+ "aria-label": s(o.tagsInput.label),
49
+ placeholder: u.length === 0 ? S : void 0,
50
+ disabled: h,
51
51
  onChange: (e) => {
52
- _.value = e.currentTarget.value;
52
+ v.value = e.currentTarget.value;
53
53
  },
54
54
  onKeyDown: (e) => {
55
- e.key === "Enter" || e.key === "," ? (e.preventDefault(), y(_.value)) : e.key === "Backspace" && !_.value && b(l.length - 1);
55
+ e.key === "Enter" || e.key === "," ? (e.preventDefault(), b(v.value)) : e.key === "Backspace" && !v.value && x(u.length - 1);
56
56
  },
57
57
  onBlur: () => {
58
- _.value && y(_.value);
58
+ v.value && b(v.value);
59
59
  }
60
60
  })]
61
61
  });
62
62
  }
63
63
  //#endregion
64
- export { l as TagsInput };
64
+ export { u as TagsInput };
@@ -2,55 +2,56 @@
2
2
 
3
3
  import e from "./textarea.module.js";
4
4
  import { cn as t, createMachine as n, useMachine as r } from "@cascivo/core";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ import { forwardRef as i } from "react";
6
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
7
  //#region ../components/src/textarea/textarea.tsx
7
- var o = n({
8
+ var s = n({
8
9
  initial: "idle",
9
10
  states: {
10
11
  idle: { on: { FOCUS: "focused" } },
11
12
  focused: { on: { BLUR: "idle" } }
12
13
  }
13
- });
14
- function s({ label: n, hint: s, error: c, resize: l = "vertical", rows: u = 4, className: d, id: f, onFocus: p, onBlur: m, ...h }) {
15
- let [g, _] = r(o), v = f ?? (n ? `cascade-textarea-${n.toLowerCase().replace(/\s+/g, "-")}` : void 0);
16
- return /* @__PURE__ */ a("div", {
14
+ }), c = i(function({ label: n, hint: i, error: c, resize: l = "vertical", rows: u = 4, className: d, id: f, onFocus: p, onBlur: m, ...h }, g) {
15
+ let [_, v] = r(s), y = f ?? (n ? `cascade-textarea-${n.toLowerCase().replace(/\s+/g, "-")}` : void 0);
16
+ return /* @__PURE__ */ o("div", {
17
17
  className: t(e.wrapper, d),
18
- "data-state": c ? "error" : g.value,
18
+ "data-state": c ? "error" : _.value,
19
19
  "data-resize": l,
20
20
  children: [
21
- n && /* @__PURE__ */ i("label", {
21
+ n && /* @__PURE__ */ a("label", {
22
22
  className: e.label,
23
- htmlFor: v,
23
+ htmlFor: y,
24
24
  children: n
25
25
  }),
26
- /* @__PURE__ */ i("textarea", {
27
- id: v,
26
+ /* @__PURE__ */ a("textarea", {
27
+ ref: g,
28
+ id: y,
28
29
  rows: u,
29
30
  "aria-multiline": "true",
30
31
  className: e.textarea,
31
32
  "aria-invalid": c ? !0 : void 0,
32
- "aria-describedby": c ? `${v}-error` : s ? `${v}-hint` : void 0,
33
+ "aria-describedby": c ? `${y}-error` : i ? `${y}-hint` : void 0,
33
34
  onFocus: (e) => {
34
- _("FOCUS"), p?.(e);
35
+ v("FOCUS"), p?.(e);
35
36
  },
36
37
  onBlur: (e) => {
37
- _("BLUR"), m?.(e);
38
+ v("BLUR"), m?.(e);
38
39
  },
39
40
  ...h
40
41
  }),
41
- c && /* @__PURE__ */ i("span", {
42
- id: `${v}-error`,
42
+ c && /* @__PURE__ */ a("span", {
43
+ id: `${y}-error`,
43
44
  className: e.error,
44
45
  role: "alert",
45
46
  children: c
46
47
  }),
47
- !c && s && /* @__PURE__ */ i("span", {
48
- id: `${v}-hint`,
48
+ !c && i && /* @__PURE__ */ a("span", {
49
+ id: `${y}-hint`,
49
50
  className: e.hint,
50
- children: s
51
+ children: i
51
52
  })
52
53
  ]
53
54
  });
54
- }
55
+ });
55
56
  //#endregion
56
- export { s as Textarea };
57
+ export { c as Textarea };
@@ -2,61 +2,62 @@
2
2
 
3
3
  import e from "./time-picker.module.js";
4
4
  import { cn as t, createMachine as n, useMachine as r, useSignals as i } from "@cascivo/core";
5
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ import { forwardRef as a } from "react";
6
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
7
  //#region ../components/src/time-picker/time-picker.tsx
7
- var s = n({
8
+ var c = n({
8
9
  initial: "idle",
9
10
  states: {
10
11
  idle: { on: { FOCUS: "focused" } },
11
12
  focused: { on: { BLUR: "idle" } }
12
13
  }
13
- });
14
- function c({ value: n, defaultValue: c, 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 }) {
14
+ }), l = a(function({ value: n, defaultValue: a, 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) {
15
15
  i();
16
- let [C, w] = r(s), T = y ?? (m ? `cascade-time-picker-${m.toLowerCase().replace(/\s+/g, "-")}` : void 0);
17
- return /* @__PURE__ */ o("div", {
16
+ let [w, T] = r(c), E = y ?? (m ? `cascade-time-picker-${m.toLowerCase().replace(/\s+/g, "-")}` : void 0);
17
+ return /* @__PURE__ */ s("div", {
18
18
  className: t(e.wrapper, v),
19
- "data-state": g ? "error" : C.value,
19
+ "data-state": g ? "error" : w.value,
20
20
  "data-size": _,
21
21
  children: [
22
- m && /* @__PURE__ */ a("label", {
22
+ m && /* @__PURE__ */ o("label", {
23
23
  className: e.label,
24
- htmlFor: T,
24
+ htmlFor: E,
25
25
  children: m
26
26
  }),
27
- /* @__PURE__ */ a("input", {
28
- id: T,
27
+ /* @__PURE__ */ o("input", {
28
+ id: E,
29
29
  type: "time",
30
30
  className: e.input,
31
31
  value: n,
32
- defaultValue: c,
32
+ defaultValue: a,
33
33
  min: d,
34
34
  max: f,
35
35
  step: p,
36
36
  "aria-invalid": g ? !0 : void 0,
37
- "aria-describedby": g ? `${T}-error` : h ? `${T}-hint` : void 0,
37
+ "aria-describedby": g ? `${E}-error` : h ? `${E}-hint` : void 0,
38
38
  onChange: (e) => (l ?? u)?.(e.target.value),
39
39
  onFocus: (e) => {
40
- w("FOCUS"), b?.(e);
40
+ T("FOCUS"), b?.(e);
41
41
  },
42
42
  onBlur: (e) => {
43
- w("BLUR"), x?.(e);
43
+ T("BLUR"), x?.(e);
44
44
  },
45
+ ref: C,
45
46
  ...S
46
47
  }),
47
- g && /* @__PURE__ */ a("span", {
48
- id: `${T}-error`,
48
+ g && /* @__PURE__ */ o("span", {
49
+ id: `${E}-error`,
49
50
  className: e.error,
50
51
  role: "alert",
51
52
  children: g
52
53
  }),
53
- !g && h && /* @__PURE__ */ a("span", {
54
- id: `${T}-hint`,
54
+ !g && h && /* @__PURE__ */ o("span", {
55
+ id: `${E}-hint`,
55
56
  className: e.hint,
56
57
  children: h
57
58
  })
58
59
  ]
59
60
  });
60
- }
61
+ });
61
62
  //#endregion
62
- export { c as TimePicker };
63
+ export { l as TimePicker };
@@ -2,9 +2,9 @@
2
2
 
3
3
  import e from "./toast.module.js";
4
4
  import { createMachine as t, signal as n, useMachine as r, useSignalEffect as i, useSignals as a } from "@cascivo/core";
5
- import { builtin as o, t as s } from "@cascivo/i18n";
6
- import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
7
- import { useRef as d } from "react";
5
+ import { useRef as o } from "react";
6
+ import { builtin as s, t as c } from "@cascivo/i18n";
7
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
8
8
  //#region ../components/src/toast/toast.tsx
9
9
  var f = 5e3, p = 160, m = 0, h = n([]);
10
10
  function g(e) {
@@ -19,11 +19,11 @@ function _(e) {
19
19
  function v({ children: t }) {
20
20
  a();
21
21
  let n = h.value.slice(-3);
22
- return /* @__PURE__ */ u(c, { children: [t, /* @__PURE__ */ l("div", {
22
+ return /* @__PURE__ */ d(l, { children: [t, /* @__PURE__ */ u("div", {
23
23
  className: e.viewport,
24
24
  role: "region",
25
- "aria-label": s(o.toast.region),
26
- children: n.map((e) => /* @__PURE__ */ l(b, {
25
+ "aria-label": c(s.toast.region),
26
+ children: n.map((e) => /* @__PURE__ */ u(b, {
27
27
  toast: e,
28
28
  onDismiss: () => _(e.id)
29
29
  }, e.id))
@@ -38,11 +38,11 @@ var y = t({
38
38
  });
39
39
  function b({ toast: t, onDismiss: n }) {
40
40
  a();
41
- let [c, m] = r(y), h = d(n);
41
+ let [l, m] = r(y), h = o(n);
42
42
  h.current = n;
43
43
  let g = t.duration ?? f, _ = t.variant === "destructive";
44
44
  return i(() => {
45
- let e = c.value;
45
+ let e = l.value;
46
46
  if (e === "visible") {
47
47
  let e = setTimeout(() => m("DISMISS"), g);
48
48
  return () => clearTimeout(e);
@@ -51,25 +51,25 @@ function b({ toast: t, onDismiss: n }) {
51
51
  let e = setTimeout(() => h.current(), p);
52
52
  return () => clearTimeout(e);
53
53
  }
54
- }), /* @__PURE__ */ u("div", {
54
+ }), /* @__PURE__ */ d("div", {
55
55
  role: _ ? "alert" : "status",
56
56
  "aria-live": _ ? "assertive" : "polite",
57
57
  "data-variant": t.variant ?? "default",
58
- "data-state": c.value,
58
+ "data-state": l.value,
59
59
  className: e.toast,
60
- children: [/* @__PURE__ */ u("div", {
60
+ children: [/* @__PURE__ */ d("div", {
61
61
  className: e.body,
62
- children: [/* @__PURE__ */ l("div", {
62
+ children: [/* @__PURE__ */ u("div", {
63
63
  className: e.title,
64
64
  children: t.title
65
- }), t.description && /* @__PURE__ */ l("div", {
65
+ }), t.description && /* @__PURE__ */ u("div", {
66
66
  className: e.description,
67
67
  children: t.description
68
68
  })]
69
- }), /* @__PURE__ */ l("button", {
69
+ }), /* @__PURE__ */ u("button", {
70
70
  type: "button",
71
71
  className: e.close,
72
- "aria-label": s(o.toast.dismiss),
72
+ "aria-label": c(s.toast.dismiss),
73
73
  onClick: () => m("DISMISS"),
74
74
  children: "✕"
75
75
  })]
@@ -2,15 +2,15 @@
2
2
 
3
3
  import e from "./toc.module.js";
4
4
  import { cn as t, useSignal as n, useSignalEffect as r, useSignals as i } from "@cascivo/core";
5
- import { builtin as a, t as o } from "@cascivo/i18n";
6
- import { jsx as s } from "react/jsx-runtime";
7
- import { useRef as c } from "react";
5
+ import { useRef as a } from "react";
6
+ import { builtin as o, t as s } from "@cascivo/i18n";
7
+ import { jsx as c } from "react/jsx-runtime";
8
8
  //#region ../components/src/toc/toc.tsx
9
9
  function l({ items: l, activeId: u, onActiveChange: d, labels: f, className: p }) {
10
10
  i();
11
11
  let m = u !== void 0, h = n(u ?? l[0]?.id ?? "");
12
12
  m && (h.value = u);
13
- let g = c(d);
13
+ let g = a(d);
14
14
  return g.current = d, r(() => {
15
15
  if (m || typeof document > "u" || typeof IntersectionObserver > "u") return;
16
16
  let e = l.map((e) => document.getElementById(e.id)).filter((e) => e !== null);
@@ -25,12 +25,12 @@ function l({ items: l, activeId: u, onActiveChange: d, labels: f, className: p }
25
25
  });
26
26
  for (let t of e) n.observe(t);
27
27
  return () => n.disconnect();
28
- }), /* @__PURE__ */ s("nav", {
29
- "aria-label": f?.nav ?? o(a.toc.nav),
28
+ }), /* @__PURE__ */ c("nav", {
29
+ "aria-label": f?.nav ?? s(o.toc.nav),
30
30
  className: t(e.toc, p),
31
- children: /* @__PURE__ */ s("ol", { children: l.map((e) => /* @__PURE__ */ s("li", {
31
+ children: /* @__PURE__ */ c("ol", { children: l.map((e) => /* @__PURE__ */ c("li", {
32
32
  style: { "--toc-level": e.level ?? 2 },
33
- children: /* @__PURE__ */ s("a", {
33
+ children: /* @__PURE__ */ c("a", {
34
34
  href: `#${e.id}`,
35
35
  "aria-current": e.id === h.value ? "location" : void 0,
36
36
  children: e.label
@@ -2,38 +2,40 @@
2
2
 
3
3
  import e from "./toggle.module.js";
4
4
  import { cn as t, createMachine as n, useMachine as r, useSignals as i } from "@cascivo/core";
5
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ import { forwardRef as a } from "react";
6
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
7
  //#region ../components/src/toggle/toggle.tsx
7
- function s({ checked: s, defaultChecked: c = !1, onValueChange: l, onChange: u, label: d, size: f = "md", className: p, disabled: m, ...h }) {
8
+ var c = a(function({ checked: a, defaultChecked: c = !1, onValueChange: l, onChange: u, label: d, size: f = "md", className: p, disabled: m, ...h }, g) {
8
9
  i();
9
- let [g, _] = r(n({
10
+ let [_, v] = r(n({
10
11
  initial: c ? "on" : "off",
11
12
  states: {
12
13
  off: { on: { TOGGLE: "on" } },
13
14
  on: { on: { TOGGLE: "off" } }
14
15
  }
15
- })), v = s !== void 0, y = v ? s : g.value === "on";
16
- return /* @__PURE__ */ o("button", {
16
+ })), y = a !== void 0, b = y ? a : _.value === "on";
17
+ return /* @__PURE__ */ s("button", {
17
18
  type: "button",
18
19
  role: "switch",
19
- "aria-checked": y,
20
- "data-state": y ? "on" : "off",
20
+ "aria-checked": b,
21
+ "data-state": b ? "on" : "off",
21
22
  "data-size": f,
22
23
  disabled: m,
23
24
  className: t(e.toggle, p),
24
25
  onClick: () => {
25
- v || _("TOGGLE"), (l ?? u)?.(!y);
26
+ y || v("TOGGLE"), (l ?? u)?.(!b);
26
27
  },
28
+ ref: g,
27
29
  ...h,
28
- children: [/* @__PURE__ */ a("span", {
30
+ children: [/* @__PURE__ */ o("span", {
29
31
  className: e.track,
30
32
  "aria-hidden": "true",
31
- children: /* @__PURE__ */ a("span", { className: e.thumb })
32
- }), d && /* @__PURE__ */ a("span", {
33
+ children: /* @__PURE__ */ o("span", { className: e.thumb })
34
+ }), d && /* @__PURE__ */ o("span", {
33
35
  className: e.label,
34
36
  children: d
35
37
  })]
36
38
  });
37
- }
39
+ });
38
40
  //#endregion
39
- export { s as Toggle };
41
+ export { c as Toggle };
@@ -2,30 +2,30 @@
2
2
 
3
3
  import e from "./toggle-group.module.js";
4
4
  import { cn as t, useControllableSignal as n, useRovingFocus as r, useSignals as i } from "@cascivo/core";
5
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
- import { forwardRef as s } from "react";
5
+ import { forwardRef as a } from "react";
6
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
7
  //#region ../components/src/toggle-group/toggle-group.tsx
8
8
  function c(e, t) {
9
9
  return Array.isArray(e) ? e.includes(t) : e === t;
10
10
  }
11
- var l = s(function({ type: s, value: l, defaultValue: u, onValueChange: d, items: f, orientation: p = "horizontal", size: m = "md", disabled: h = !1, className: g, ..._ }, v) {
11
+ var l = a(function({ type: a, value: l, defaultValue: u, onValueChange: d, items: f, orientation: p = "horizontal", size: m = "md", disabled: h = !1, className: g, ..._ }, v) {
12
12
  i();
13
13
  let [y, b] = n({
14
14
  value: l,
15
- defaultValue: u ?? (s === "multiple" ? [] : ""),
15
+ defaultValue: u ?? (a === "multiple" ? [] : ""),
16
16
  onChange: d
17
17
  }), x = r({
18
18
  orientation: p,
19
19
  loop: !0
20
20
  }), S = (e) => {
21
21
  let t = y.value;
22
- if (s === "multiple") {
22
+ if (a === "multiple") {
23
23
  let n = Array.isArray(t) ? t : [];
24
24
  b(n.includes(e) ? n.filter((t) => t !== e) : [...n, e]);
25
25
  } else b(t === e ? "" : e);
26
26
  };
27
- return /* @__PURE__ */ a("div", {
28
- role: s === "single" ? "radiogroup" : "group",
27
+ return /* @__PURE__ */ o("div", {
28
+ role: a === "single" ? "radiogroup" : "group",
29
29
  "data-orientation": p,
30
30
  "data-size": m,
31
31
  className: t(e.toggleGroup, g),
@@ -33,9 +33,9 @@ var l = s(function({ type: s, value: l, defaultValue: u, onValueChange: d, items
33
33
  ..._,
34
34
  children: f.map((t, n) => {
35
35
  let r = c(y.value, t.value), i = h || t.disabled, { ref: l, ...u } = x.getItemProps(n);
36
- return /* @__PURE__ */ o("button", {
36
+ return /* @__PURE__ */ s("button", {
37
37
  type: "button",
38
- ...s === "single" ? {
38
+ ...a === "single" ? {
39
39
  role: "radio",
40
40
  "aria-checked": r
41
41
  } : { "aria-pressed": r },
@@ -46,7 +46,7 @@ var l = s(function({ type: s, value: l, defaultValue: u, onValueChange: d, items
46
46
  "aria-label": t.icon && !t.label ? t.value : void 0,
47
47
  className: e.item,
48
48
  onClick: () => S(t.value),
49
- children: [t.icon, t.label && /* @__PURE__ */ a("span", { children: t.label })]
49
+ children: [t.icon, t.label && /* @__PURE__ */ o("span", { children: t.label })]
50
50
  }, t.value);
51
51
  })
52
52
  });