@cascivo/react 0.12.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 (237) 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 +36 -33
  6. package/dist/app-shell/app-shell.module.js +8 -8
  7. package/dist/avatar-group/avatar-group.js +6 -6
  8. package/dist/badge/badge.js +17 -10
  9. package/dist/bottom-sheet/bottom-sheet.js +18 -18
  10. package/dist/button/button.css +1 -1
  11. package/dist/button/button.js +15 -12
  12. package/dist/button/button.module.js +1 -1
  13. package/dist/button-group/button-group.js +8 -8
  14. package/dist/card/card.css +1 -1
  15. package/dist/card/card.module.js +8 -8
  16. package/dist/carousel/carousel.js +20 -20
  17. package/dist/checkbox/checkbox.js +21 -21
  18. package/dist/checkbox-card/checkbox-card.js +15 -13
  19. package/dist/collapsible/collapsible.js +7 -7
  20. package/dist/color-picker/color-picker.js +26 -26
  21. package/dist/combobox/combobox.css +1 -1
  22. package/dist/combobox/combobox.js +86 -86
  23. package/dist/combobox/combobox.module.js +15 -15
  24. package/dist/command-menu/command-menu.js +111 -111
  25. package/dist/comparison/comparison.js +10 -10
  26. package/dist/context-menu/context-menu.js +9 -9
  27. package/dist/copy-button/copy-button.js +18 -16
  28. package/dist/data-table/data-table.css +1 -1
  29. package/dist/data-table/data-table.js +8 -2
  30. package/dist/data-table/data-table.module.js +29 -29
  31. package/dist/date-picker/date-picker.css +1 -1
  32. package/dist/date-picker/date-picker.js +25 -25
  33. package/dist/date-picker/date-picker.module.js +19 -19
  34. package/dist/date-range-picker/date-range-picker.js +26 -26
  35. package/dist/drawer/drawer.css +1 -1
  36. package/dist/drawer/drawer.js +18 -17
  37. package/dist/drawer/drawer.module.js +9 -9
  38. package/dist/dropdown/dropdown.js +48 -48
  39. package/dist/editable/editable.js +11 -11
  40. package/dist/fab/fab.js +53 -53
  41. package/dist/field/field.js +8 -8
  42. package/dist/file-uploader/file-uploader.css +1 -1
  43. package/dist/file-uploader/file-uploader.js +19 -19
  44. package/dist/file-uploader/file-uploader.module.js +14 -14
  45. package/dist/filter/filter.js +10 -9
  46. package/dist/header-panel/header-panel.js +31 -31
  47. package/dist/hover-card/hover-card.js +21 -21
  48. package/dist/icon-button/icon-button.css +1 -1
  49. package/dist/icon-button/icon-button.js +5 -5
  50. package/dist/icon-button/icon-button.module.js +1 -1
  51. package/dist/index.d.ts +1475 -251
  52. package/dist/input/input.css +1 -1
  53. package/dist/input/input.js +22 -21
  54. package/dist/input/input.module.js +5 -5
  55. package/dist/item/item.css +1 -1
  56. package/dist/item/item.module.js +6 -6
  57. package/dist/layouts/src/page-header/page-header.css +1 -0
  58. package/dist/layouts/src/page-header/page-header.js +33 -0
  59. package/dist/layouts/src/page-header/page-header.module.js +13 -0
  60. package/dist/link/link.js +14 -12
  61. package/dist/log-viewer/log-viewer.js +26 -26
  62. package/dist/menu/menu.js +20 -20
  63. package/dist/menu-button/menu-button.js +48 -48
  64. package/dist/menubar/menubar.js +42 -42
  65. package/dist/modal/modal.css +1 -1
  66. package/dist/modal/modal.js +41 -35
  67. package/dist/modal/modal.module.js +8 -7
  68. package/dist/multi-select/multi-select.css +1 -1
  69. package/dist/multi-select/multi-select.js +57 -57
  70. package/dist/multi-select/multi-select.module.js +11 -11
  71. package/dist/native-select/native-select.js +13 -11
  72. package/dist/navigation-menu/navigation-menu.js +46 -46
  73. package/dist/node/accordion/accordion.js +46 -44
  74. package/dist/node/action-sheet/action-sheet.js +16 -16
  75. package/dist/node/alert-dialog/alert-dialog.js +34 -34
  76. package/dist/node/app-shell/app-shell.js +36 -33
  77. package/dist/node/app-shell/app-shell.module.js +8 -8
  78. package/dist/node/avatar-group/avatar-group.js +6 -6
  79. package/dist/node/badge/badge.js +17 -10
  80. package/dist/node/bottom-sheet/bottom-sheet.js +18 -18
  81. package/dist/node/button/button.js +15 -12
  82. package/dist/node/button/button.module.js +1 -1
  83. package/dist/node/button-group/button-group.js +8 -8
  84. package/dist/node/card/card.module.js +8 -8
  85. package/dist/node/carousel/carousel.js +20 -20
  86. package/dist/node/checkbox/checkbox.js +21 -21
  87. package/dist/node/checkbox-card/checkbox-card.js +15 -13
  88. package/dist/node/collapsible/collapsible.js +7 -7
  89. package/dist/node/color-picker/color-picker.js +26 -26
  90. package/dist/node/combobox/combobox.js +86 -86
  91. package/dist/node/combobox/combobox.module.js +15 -15
  92. package/dist/node/command-menu/command-menu.js +111 -111
  93. package/dist/node/comparison/comparison.js +10 -10
  94. package/dist/node/context-menu/context-menu.js +9 -9
  95. package/dist/node/copy-button/copy-button.js +18 -16
  96. package/dist/node/data-table/data-table.js +8 -2
  97. package/dist/node/data-table/data-table.module.js +29 -29
  98. package/dist/node/date-picker/date-picker.js +25 -25
  99. package/dist/node/date-picker/date-picker.module.js +19 -19
  100. package/dist/node/date-range-picker/date-range-picker.js +26 -26
  101. package/dist/node/drawer/drawer.js +18 -17
  102. package/dist/node/drawer/drawer.module.js +9 -9
  103. package/dist/node/dropdown/dropdown.js +48 -48
  104. package/dist/node/editable/editable.js +11 -11
  105. package/dist/node/fab/fab.js +53 -53
  106. package/dist/node/field/field.js +8 -8
  107. package/dist/node/file-uploader/file-uploader.js +19 -19
  108. package/dist/node/file-uploader/file-uploader.module.js +14 -14
  109. package/dist/node/filter/filter.js +10 -9
  110. package/dist/node/header-panel/header-panel.js +31 -31
  111. package/dist/node/hover-card/hover-card.js +21 -21
  112. package/dist/node/icon-button/icon-button.js +5 -5
  113. package/dist/node/icon-button/icon-button.module.js +1 -1
  114. package/dist/node/input/input.js +22 -21
  115. package/dist/node/input/input.module.js +5 -5
  116. package/dist/node/item/item.module.js +6 -6
  117. package/dist/node/layouts/src/page-header/page-header.js +33 -0
  118. package/dist/node/layouts/src/page-header/page-header.module.js +12 -0
  119. package/dist/node/link/link.js +14 -12
  120. package/dist/node/log-viewer/log-viewer.js +26 -26
  121. package/dist/node/menu/menu.js +20 -20
  122. package/dist/node/menu-button/menu-button.js +48 -48
  123. package/dist/node/menubar/menubar.js +42 -42
  124. package/dist/node/modal/modal.js +41 -35
  125. package/dist/node/modal/modal.module.js +8 -7
  126. package/dist/node/multi-select/multi-select.js +57 -57
  127. package/dist/node/multi-select/multi-select.module.js +11 -11
  128. package/dist/node/native-select/native-select.js +13 -11
  129. package/dist/node/navigation-menu/navigation-menu.js +46 -46
  130. package/dist/node/notification/notification.js +50 -44
  131. package/dist/node/notification/notification.module.js +7 -7
  132. package/dist/node/number-input/number-input.js +52 -50
  133. package/dist/node/number-input/number-input.module.js +8 -8
  134. package/dist/node/otp-input/otp-input.js +8 -8
  135. package/dist/node/otp-input/otp-input.module.js +2 -2
  136. package/dist/node/overflow-menu/overflow-menu.js +18 -13
  137. package/dist/node/password-input/password-input.js +28 -27
  138. package/dist/node/password-input/password-input.module.js +7 -7
  139. package/dist/node/popover/popover.js +26 -24
  140. package/dist/node/progress/progress.js +3 -2
  141. package/dist/node/pull-to-refresh/pull-to-refresh.js +13 -13
  142. package/dist/node/radial-progress/radial-progress.js +5 -5
  143. package/dist/node/radio/radio.js +23 -22
  144. package/dist/node/radio-card/radio-card.js +27 -26
  145. package/dist/node/react/src/index.js +4 -3
  146. package/dist/node/react/src/theme.js +30 -19
  147. package/dist/node/resizable/resizable.js +11 -11
  148. package/dist/node/scroll-area/scroll-area.js +4 -4
  149. package/dist/node/search/search.js +49 -49
  150. package/dist/node/search/search.module.js +5 -5
  151. package/dist/node/select/select.js +27 -26
  152. package/dist/node/sheet/sheet.js +11 -10
  153. package/dist/node/sheet/sheet.module.js +5 -5
  154. package/dist/node/side-nav/side-nav.js +91 -91
  155. package/dist/node/skip-nav/skip-nav.js +12 -12
  156. package/dist/node/slider/slider.js +13 -11
  157. package/dist/node/stat/stat.js +6 -5
  158. package/dist/node/stat/stat.module.js +7 -7
  159. package/dist/node/status/status.js +18 -11
  160. package/dist/node/steps/steps.js +23 -23
  161. package/dist/node/structured-list/structured-list.js +33 -32
  162. package/dist/node/tabs/tabs.js +49 -47
  163. package/dist/node/tag/tag.js +22 -15
  164. package/dist/node/tags-input/tags-input.js +35 -35
  165. package/dist/node/tags-input/tags-input.module.js +4 -4
  166. package/dist/node/textarea/textarea.js +22 -21
  167. package/dist/node/tile/tile.module.js +3 -3
  168. package/dist/node/time-picker/time-picker.js +22 -21
  169. package/dist/node/time-picker/time-picker.module.js +5 -5
  170. package/dist/node/timeline/timeline.js +22 -16
  171. package/dist/node/toast/toast.js +15 -15
  172. package/dist/node/toc/toc.js +8 -8
  173. package/dist/node/toggle/toggle.js +15 -13
  174. package/dist/node/toggle-group/toggle-group.js +10 -10
  175. package/dist/node/toggletip/toggletip.js +9 -9
  176. package/dist/node/tooltip/tooltip.js +5 -5
  177. package/dist/node/tree-view/tree-view.js +32 -32
  178. package/dist/notification/notification.css +1 -1
  179. package/dist/notification/notification.js +50 -44
  180. package/dist/notification/notification.module.js +7 -7
  181. package/dist/number-input/number-input.css +1 -1
  182. package/dist/number-input/number-input.js +52 -50
  183. package/dist/number-input/number-input.module.js +8 -8
  184. package/dist/otp-input/otp-input.css +1 -1
  185. package/dist/otp-input/otp-input.js +8 -8
  186. package/dist/otp-input/otp-input.module.js +2 -2
  187. package/dist/overflow-menu/overflow-menu.js +18 -13
  188. package/dist/password-input/password-input.css +1 -1
  189. package/dist/password-input/password-input.js +28 -27
  190. package/dist/password-input/password-input.module.js +7 -7
  191. package/dist/popover/popover.js +26 -24
  192. package/dist/progress/progress.js +3 -2
  193. package/dist/pull-to-refresh/pull-to-refresh.js +13 -13
  194. package/dist/radial-progress/radial-progress.js +5 -5
  195. package/dist/radio/radio.js +23 -22
  196. package/dist/radio-card/radio-card.js +27 -26
  197. package/dist/react/src/index.js +4 -3
  198. package/dist/react/src/theme.js +30 -19
  199. package/dist/resizable/resizable.js +11 -11
  200. package/dist/scroll-area/scroll-area.js +4 -4
  201. package/dist/search/search.css +1 -1
  202. package/dist/search/search.js +49 -49
  203. package/dist/search/search.module.js +5 -5
  204. package/dist/select/select.js +27 -26
  205. package/dist/sheet/sheet.css +1 -1
  206. package/dist/sheet/sheet.js +11 -10
  207. package/dist/sheet/sheet.module.js +5 -5
  208. package/dist/side-nav/side-nav.js +91 -91
  209. package/dist/skip-nav/skip-nav.js +12 -12
  210. package/dist/slider/slider.js +13 -11
  211. package/dist/stat/stat.css +1 -1
  212. package/dist/stat/stat.js +6 -5
  213. package/dist/stat/stat.module.js +7 -7
  214. package/dist/status/status.js +18 -11
  215. package/dist/steps/steps.js +23 -23
  216. package/dist/structured-list/structured-list.js +33 -32
  217. package/dist/styles.css +87 -23
  218. package/dist/tabs/tabs.js +49 -47
  219. package/dist/tag/tag.js +22 -15
  220. package/dist/tags-input/tags-input.css +1 -1
  221. package/dist/tags-input/tags-input.js +35 -35
  222. package/dist/tags-input/tags-input.module.js +4 -4
  223. package/dist/textarea/textarea.js +22 -21
  224. package/dist/tile/tile.css +1 -1
  225. package/dist/tile/tile.module.js +3 -3
  226. package/dist/time-picker/time-picker.css +1 -1
  227. package/dist/time-picker/time-picker.js +22 -21
  228. package/dist/time-picker/time-picker.module.js +5 -5
  229. package/dist/timeline/timeline.js +22 -16
  230. package/dist/toast/toast.js +15 -15
  231. package/dist/toc/toc.js +8 -8
  232. package/dist/toggle/toggle.js +15 -13
  233. package/dist/toggle-group/toggle-group.js +10 -10
  234. package/dist/toggletip/toggletip.js +9 -9
  235. package/dist/tooltip/tooltip.js +5 -5
  236. package/dist/tree-view/tree-view.js +32 -32
  237. package/package.json +10 -4
@@ -2,36 +2,38 @@
2
2
 
3
3
  import e from "./native-select.module.js";
4
4
  import { cn as t } from "@cascivo/core";
5
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
+ import { forwardRef as n } from "react";
6
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
7
  //#region ../components/src/native-select/native-select.tsx
7
- function i({ options: i, children: a, size: o = "md", invalid: s, disabled: c, placeholder: l, value: u, defaultValue: d, className: f, ...p }) {
8
- let m = u !== void 0, h = l !== void 0;
9
- return /* @__PURE__ */ r("div", {
8
+ var a = n(function({ options: n, children: a, size: o = "md", invalid: s, disabled: c, placeholder: l, value: u, defaultValue: d, className: f, ...p }, m) {
9
+ let h = u !== void 0, g = l !== void 0;
10
+ return /* @__PURE__ */ i("div", {
10
11
  className: t(e.root, f),
11
12
  "data-size": o,
12
13
  "data-invalid": s || void 0,
13
- children: [/* @__PURE__ */ r("select", {
14
+ children: [/* @__PURE__ */ i("select", {
15
+ ref: m,
14
16
  className: e.select,
15
17
  disabled: c,
16
18
  "aria-invalid": s || void 0,
17
19
  value: u,
18
- defaultValue: !m && h ? d ?? "" : d,
20
+ defaultValue: !h && g ? d ?? "" : d,
19
21
  ...p,
20
- children: [h && /* @__PURE__ */ n("option", {
22
+ children: [g && /* @__PURE__ */ r("option", {
21
23
  value: "",
22
24
  disabled: !0,
23
25
  hidden: !0,
24
26
  children: l
25
- }), i ? i.map((e) => /* @__PURE__ */ n("option", {
27
+ }), n ? n.map((e) => /* @__PURE__ */ r("option", {
26
28
  value: e.value,
27
29
  disabled: e.disabled,
28
30
  children: e.label
29
31
  }, e.value)) : a]
30
- }), /* @__PURE__ */ n("span", {
32
+ }), /* @__PURE__ */ r("span", {
31
33
  className: e.chevron,
32
34
  "aria-hidden": "true"
33
35
  })]
34
36
  });
35
- }
37
+ });
36
38
  //#endregion
37
- export { i as NativeSelect };
39
+ export { a as NativeSelect };
@@ -1,92 +1,92 @@
1
1
  "use client";
2
2
 
3
3
  import e from "./navigation-menu.module.js";
4
- import { DismissableLayer as t, Presence as n, cn as r, getLinkComponent as i, useAnchorPosition as a, useRovingFocus as o, useSignal as s, useSignals as c } from "@cascivo/core";
5
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
- import { useId as d, useRef as f } from "react";
4
+ import { DismissableLayer as t, Presence as n, cn as r, focusElement as i, getLinkComponent as a, useAnchorPosition as o, useRovingFocus as s, useSignal as c, useSignals as l } from "@cascivo/core";
5
+ import { useId as u, useRef as d } from "react";
6
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
7
7
  //#region ../components/src/navigation-menu/navigation-menu.tsx
8
- function p({ items: t, "aria-label": n, orientation: i = "horizontal", className: a }) {
9
- c();
10
- let u = d(), f = s(null), p = o({
8
+ function m({ items: t, "aria-label": n, orientation: i = "horizontal", className: a }) {
9
+ l();
10
+ let o = u(), d = c(null), p = s({
11
11
  orientation: i,
12
12
  loop: !0
13
13
  });
14
- return /* @__PURE__ */ l("nav", {
14
+ return /* @__PURE__ */ f("nav", {
15
15
  "aria-label": n,
16
16
  className: r(e.nav, a),
17
17
  "data-orientation": i,
18
- children: /* @__PURE__ */ l("ul", {
18
+ children: /* @__PURE__ */ f("ul", {
19
19
  role: "list",
20
20
  className: e.list,
21
- children: t.map((e, t) => /* @__PURE__ */ l(m, {
21
+ children: t.map((e, t) => /* @__PURE__ */ f(h, {
22
22
  item: e,
23
- baseId: u,
24
- openId: f,
23
+ baseId: o,
24
+ openId: d,
25
25
  itemProps: p.getItemProps(t)
26
26
  }, e.id))
27
27
  })
28
28
  });
29
29
  }
30
- function m({ item: t, baseId: r, openId: o, itemProps: s }) {
31
- c();
32
- let d = f(null), p = f(null), m = t.content != null, g = o.value === t.id, _ = `${r}-panel-${t.id}`, { anchorStyle: v, floatingStyle: y } = a({
33
- anchorRef: d,
34
- floatingRef: p,
30
+ function h({ item: t, baseId: r, openId: s, itemProps: c }) {
31
+ l();
32
+ let u = d(null), m = d(null), h = t.content != null, _ = s.value === t.id, v = `${r}-panel-${t.id}`, { anchorStyle: y, floatingStyle: b } = o({
33
+ anchorRef: u,
34
+ floatingRef: m,
35
35
  placement: "bottom-start",
36
- enabled: g
37
- }), { ref: b, onKeyDown: x, ...S } = s;
38
- if (!m) {
39
- let n = i();
40
- return /* @__PURE__ */ l("li", {
36
+ enabled: _
37
+ }), { ref: x, onKeyDown: S, ...C } = c;
38
+ if (!h) {
39
+ let n = a();
40
+ return /* @__PURE__ */ f("li", {
41
41
  className: e.item,
42
- children: /* @__PURE__ */ l(n, {
43
- ref: (e) => b(e),
42
+ children: /* @__PURE__ */ f(n, {
43
+ ref: (e) => x(e),
44
44
  href: t.href,
45
45
  className: e.link,
46
- onKeyDown: x,
47
- ...S,
46
+ onKeyDown: S,
47
+ ...C,
48
48
  children: t.label
49
49
  })
50
50
  });
51
51
  }
52
- return /* @__PURE__ */ u("li", {
52
+ return /* @__PURE__ */ p("li", {
53
53
  className: e.item,
54
- children: [/* @__PURE__ */ l("button", {
54
+ children: [/* @__PURE__ */ f("button", {
55
55
  ref: (e) => {
56
- d.current = e, b(e);
56
+ u.current = e, x(e);
57
57
  },
58
58
  type: "button",
59
- "aria-expanded": g,
60
- "aria-controls": _,
61
- "data-state": g ? "open" : "closed",
59
+ "aria-expanded": _,
60
+ "aria-controls": v,
61
+ "data-state": _ ? "open" : "closed",
62
62
  className: e.trigger,
63
- style: v,
63
+ style: y,
64
64
  onClick: () => {
65
- o.value = g ? null : t.id;
65
+ s.value = _ ? null : t.id;
66
66
  },
67
67
  onKeyDown: (e) => {
68
- x(e), !e.defaultPrevented && e.key === "Escape" && (o.value = null);
68
+ S(e), !e.defaultPrevented && e.key === "Escape" && (s.value = null);
69
69
  },
70
- ...S,
70
+ ...C,
71
71
  children: t.label
72
- }), /* @__PURE__ */ l(n, {
73
- present: g,
74
- children: /* @__PURE__ */ l(h, {
75
- panelId: _,
76
- floatingRef: p,
77
- floatingStyle: y,
72
+ }), /* @__PURE__ */ f(n, {
73
+ present: _,
74
+ children: /* @__PURE__ */ f(g, {
75
+ panelId: v,
76
+ floatingRef: m,
77
+ floatingStyle: b,
78
78
  onClose: () => {
79
- o.value = null, d.current?.focus();
79
+ s.value = null, i(u.current);
80
80
  },
81
81
  children: t.content
82
82
  })
83
83
  })]
84
84
  });
85
85
  }
86
- function h({ panelId: n, floatingRef: r, floatingStyle: i, onClose: a, children: o }) {
87
- return /* @__PURE__ */ l(t, {
86
+ function g({ panelId: n, floatingRef: r, floatingStyle: i, onClose: a, children: o }) {
87
+ return /* @__PURE__ */ f(t, {
88
88
  onDismiss: a,
89
- children: /* @__PURE__ */ l("div", {
89
+ children: /* @__PURE__ */ f("div", {
90
90
  ref: r,
91
91
  id: n,
92
92
  className: e.panel,
@@ -96,4 +96,4 @@ function h({ panelId: n, floatingRef: r, floatingStyle: i, onClose: a, children:
96
96
  });
97
97
  }
98
98
  //#endregion
99
- export { p as NavigationMenu };
99
+ export { m as NavigationMenu };
@@ -1,80 +1,86 @@
1
1
  "use client";
2
2
 
3
3
  import e from "./notification.module.js";
4
- import { Presence as t, cn as n, useSignal as r, useSignals as i } from "@cascivo/core";
5
- import { builtin as a, t as o } from "@cascivo/i18n";
6
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
- import { useRef as l } from "react";
4
+ import { Presence as t, cn as n, normalizeTone as r, useSignal as i, useSignals as a } from "@cascivo/core";
5
+ import { useRef as o } from "react";
6
+ import { builtin as s, t as c } from "@cascivo/i18n";
7
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
8
  //#region ../components/src/notification/notification.tsx
9
- var u = new Set(["warning", "error"]), d = 160;
10
- function f({ variant: e }) {
11
- return e === "success" ? /* @__PURE__ */ c("svg", {
9
+ var d = {
10
+ neutral: "neutral",
11
+ info: "info",
12
+ success: "success",
13
+ warning: "warning",
14
+ danger: "error"
15
+ }, f = new Set(["warning", "error"]), p = 160;
16
+ function m({ variant: e }) {
17
+ return e === "success" ? /* @__PURE__ */ u("svg", {
12
18
  viewBox: "0 0 20 20",
13
19
  width: "20",
14
20
  height: "20",
15
21
  fill: "none",
16
22
  "aria-hidden": "true",
17
- children: [/* @__PURE__ */ s("circle", {
23
+ children: [/* @__PURE__ */ l("circle", {
18
24
  cx: "10",
19
25
  cy: "10",
20
26
  r: "8",
21
27
  stroke: "currentColor",
22
28
  strokeWidth: "1.5"
23
- }), /* @__PURE__ */ s("path", {
29
+ }), /* @__PURE__ */ l("path", {
24
30
  d: "M6.5 10.5l2.5 2.5 4.5-5",
25
31
  stroke: "currentColor",
26
32
  strokeWidth: "1.5",
27
33
  strokeLinecap: "round",
28
34
  strokeLinejoin: "round"
29
35
  })]
30
- }) : e === "warning" ? /* @__PURE__ */ c("svg", {
36
+ }) : e === "warning" ? /* @__PURE__ */ u("svg", {
31
37
  viewBox: "0 0 20 20",
32
38
  width: "20",
33
39
  height: "20",
34
40
  fill: "none",
35
41
  "aria-hidden": "true",
36
- children: [/* @__PURE__ */ s("path", {
42
+ children: [/* @__PURE__ */ l("path", {
37
43
  d: "M10 2.5L18.5 17H1.5L10 2.5z",
38
44
  stroke: "currentColor",
39
45
  strokeWidth: "1.5",
40
46
  strokeLinejoin: "round"
41
- }), /* @__PURE__ */ s("path", {
47
+ }), /* @__PURE__ */ l("path", {
42
48
  d: "M10 8v3.5M10 14h.01",
43
49
  stroke: "currentColor",
44
50
  strokeWidth: "1.5",
45
51
  strokeLinecap: "round"
46
52
  })]
47
- }) : e === "error" ? /* @__PURE__ */ c("svg", {
53
+ }) : e === "error" ? /* @__PURE__ */ u("svg", {
48
54
  viewBox: "0 0 20 20",
49
55
  width: "20",
50
56
  height: "20",
51
57
  fill: "none",
52
58
  "aria-hidden": "true",
53
- children: [/* @__PURE__ */ s("circle", {
59
+ children: [/* @__PURE__ */ l("circle", {
54
60
  cx: "10",
55
61
  cy: "10",
56
62
  r: "8",
57
63
  stroke: "currentColor",
58
64
  strokeWidth: "1.5"
59
- }), /* @__PURE__ */ s("path", {
65
+ }), /* @__PURE__ */ l("path", {
60
66
  d: "M10 6v4.5M10 13.5h.01",
61
67
  stroke: "currentColor",
62
68
  strokeWidth: "1.5",
63
69
  strokeLinecap: "round"
64
70
  })]
65
- }) : /* @__PURE__ */ c("svg", {
71
+ }) : /* @__PURE__ */ u("svg", {
66
72
  viewBox: "0 0 20 20",
67
73
  width: "20",
68
74
  height: "20",
69
75
  fill: "none",
70
76
  "aria-hidden": "true",
71
- children: [/* @__PURE__ */ s("circle", {
77
+ children: [/* @__PURE__ */ l("circle", {
72
78
  cx: "10",
73
79
  cy: "10",
74
80
  r: "8",
75
81
  stroke: "currentColor",
76
82
  strokeWidth: "1.5"
77
- }), /* @__PURE__ */ s("path", {
83
+ }), /* @__PURE__ */ l("path", {
78
84
  d: "M10 9v5M10 6.5h.01",
79
85
  stroke: "currentColor",
80
86
  strokeWidth: "1.5",
@@ -82,48 +88,48 @@ function f({ variant: e }) {
82
88
  })]
83
89
  });
84
90
  }
85
- function p({ title: p, description: m, variant: h = "info", dismissible: g = !1, onDismiss: _, actions: v, icon: y, labels: b, className: x, ...S }) {
86
- i();
87
- let C = r(!0), w = l(_);
88
- w.current = _;
89
- let T = g || _ !== void 0, E = () => {
90
- C.value = !1, setTimeout(() => w.current?.(), d);
91
+ function h({ title: h, description: g, variant: _ = "info", dismissible: v = !1, onDismiss: y, actions: b, icon: x, labels: S, className: C, ...w }) {
92
+ a();
93
+ let T = d[r(_)] ?? _, E = i(!0), D = o(y);
94
+ D.current = y;
95
+ let O = v || y !== void 0, k = () => {
96
+ E.value = !1, setTimeout(() => D.current?.(), p);
91
97
  };
92
- return /* @__PURE__ */ s(t, {
93
- present: C,
94
- children: /* @__PURE__ */ c("div", {
95
- role: u.has(h) ? "alert" : "status",
96
- "data-variant": h,
97
- className: n(e.notification, x),
98
- ...S,
98
+ return /* @__PURE__ */ l(t, {
99
+ present: E,
100
+ children: /* @__PURE__ */ u("div", {
101
+ role: f.has(T) ? "alert" : "status",
102
+ "data-variant": T,
103
+ className: n(e.notification, C),
104
+ ...w,
99
105
  children: [
100
- /* @__PURE__ */ s("span", {
106
+ /* @__PURE__ */ l("span", {
101
107
  className: e.icon,
102
108
  "aria-hidden": "true",
103
- children: y ?? /* @__PURE__ */ s(f, { variant: h })
109
+ children: x ?? /* @__PURE__ */ l(m, { variant: T })
104
110
  }),
105
- /* @__PURE__ */ c("div", {
111
+ /* @__PURE__ */ u("div", {
106
112
  className: e.body,
107
113
  children: [
108
- /* @__PURE__ */ s("div", {
114
+ /* @__PURE__ */ l("div", {
109
115
  className: e.title,
110
- children: p
116
+ children: h
111
117
  }),
112
- m && /* @__PURE__ */ s("div", {
118
+ g && /* @__PURE__ */ l("div", {
113
119
  className: e.description,
114
- children: m
120
+ children: g
115
121
  }),
116
- v && /* @__PURE__ */ s("div", {
122
+ b && /* @__PURE__ */ l("div", {
117
123
  className: e.actions,
118
- children: v
124
+ children: b
119
125
  })
120
126
  ]
121
127
  }),
122
- T && /* @__PURE__ */ s("button", {
128
+ O && /* @__PURE__ */ l("button", {
123
129
  type: "button",
124
130
  className: e.dismiss,
125
- "aria-label": b?.dismiss ?? o(a.notification.dismiss),
126
- onClick: E,
131
+ "aria-label": S?.dismiss ?? c(s.notification.dismiss),
132
+ onClick: k,
127
133
  children: "✕"
128
134
  })
129
135
  ]
@@ -131,4 +137,4 @@ function p({ title: p, description: m, variant: h = "info", dismissible: g = !1,
131
137
  });
132
138
  }
133
139
  //#endregion
134
- export { p as Notification };
140
+ export { h as Notification };
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
 
3
3
  var e = {
4
- notification: "_notification_10586_2",
5
- icon: "_icon_10586_58",
6
- body: "_body_10586_79",
7
- title: "_title_10586_87",
8
- description: "_description_10586_93",
9
- actions: "_actions_10586_99",
10
- dismiss: "_dismiss_10586_106"
4
+ notification: "_notification_imxvx_2",
5
+ icon: "_icon_imxvx_65",
6
+ body: "_body_imxvx_86",
7
+ title: "_title_imxvx_94",
8
+ description: "_description_imxvx_100",
9
+ actions: "_actions_imxvx_106",
10
+ dismiss: "_dismiss_imxvx_113"
11
11
  };
12
12
  //#endregion
13
13
  export { e as default };
@@ -2,99 +2,101 @@
2
2
 
3
3
  import e from "./number-input.module.js";
4
4
  import { cn as t, createMachine as n, useMachine as r, useSignal as i, useSignals as a } from "@cascivo/core";
5
- import { builtin as o, t as s } from "@cascivo/i18n";
6
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
5
+ import { forwardRef as o } from "react";
6
+ import { builtin as s, t as c } from "@cascivo/i18n";
7
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
7
8
  //#region ../components/src/number-input/number-input.tsx
8
- var u = n({
9
+ var d = n({
9
10
  initial: "idle",
10
11
  states: {
11
12
  idle: { on: { FOCUS: "focused" } },
12
13
  focused: { on: { BLUR: "idle" } }
13
14
  }
14
15
  });
15
- function d(e, t, n) {
16
+ function f(e, t, n) {
16
17
  let r = e;
17
18
  return t !== void 0 && (r = Math.max(r, t)), n !== void 0 && (r = Math.min(r, n)), r;
18
19
  }
19
- function f(e) {
20
+ function p(e) {
20
21
  let t = String(e), n = t.indexOf(".");
21
22
  return n === -1 ? 0 : t.length - n - 1;
22
23
  }
23
- function p(e, t) {
24
+ function m(e, t) {
24
25
  let n = 10 ** t;
25
26
  return Math.round(e * n) / n;
26
27
  }
27
- function m(e) {
28
+ function h(e) {
28
29
  let t = e.trim();
29
30
  if (t === "") return null;
30
31
  let n = Number(t);
31
32
  return Number.isFinite(n) ? n : null;
32
33
  }
33
- function h({ value: n, defaultValue: h, 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 }) {
34
+ var g = o(function({ value: n, defaultValue: o, 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
35
  a();
35
- let I = O ?? s(o.numberInput.increment), L = k ?? s(o.numberInput.decrement), [R, z] = r(u), B = n !== void 0, V = i(h ?? null), H = i(""), U = B ? n : V.value, W = j ?? (C ? `cascade-number-input-${C.toLowerCase().replace(/\s+/g, "-")}` : void 0), G = (e) => {
36
- B || (V.value = e), H.value = e == null ? "" : String(e), e !== U && (g ?? _)?.(e);
37
- }, K = () => {
38
- let e = m(H.value);
39
- e != null && (e = d(e, v, y), x !== void 0 && (e = p(e, x))), G(e);
40
- }, q = (e) => {
41
- let t = (R.value === "focused" ? m(H.value) : U) ?? 0, n = x ?? Math.max(f(b), f(t));
42
- G(d(p(t + e * b, n), v, y));
43
- }, J = R.value === "focused" ? H.value : ((e) => e == null ? "" : S ? new Intl.NumberFormat(void 0, S).format(e) : String(e))(U), Y = U != null && y !== void 0 && U >= y, X = U != null && v !== void 0 && U <= v;
44
- return /* @__PURE__ */ l("div", {
36
+ let L = O ?? c(s.numberInput.increment), R = k ?? c(s.numberInput.decrement), [z, B] = r(d), V = n !== void 0, H = i(o ?? null), U = i(""), W = V ? n : 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);
38
+ }, q = () => {
39
+ let e = h(U.value);
40
+ e != null && (e = f(e, v, y), x !== void 0 && (e = m(e, x))), K(e);
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;
45
+ return /* @__PURE__ */ u("div", {
45
46
  className: t(e.wrapper, A),
46
- "data-state": T ? "error" : R.value,
47
+ "data-state": T ? "error" : z.value,
47
48
  "data-size": E,
48
49
  children: [
49
- C && /* @__PURE__ */ c("label", {
50
+ C && /* @__PURE__ */ l("label", {
50
51
  className: e.label,
51
- htmlFor: W,
52
+ htmlFor: G,
52
53
  children: C
53
54
  }),
54
- /* @__PURE__ */ l("div", {
55
+ /* @__PURE__ */ u("div", {
55
56
  className: e.field,
56
- children: [/* @__PURE__ */ c("input", {
57
- id: W,
57
+ children: [/* @__PURE__ */ l("input", {
58
+ id: G,
58
59
  type: "text",
59
60
  inputMode: "decimal",
60
61
  autoComplete: "off",
61
62
  role: "spinbutton",
62
63
  className: e.input,
63
- value: J,
64
+ value: Y,
64
65
  disabled: D,
65
- "aria-valuenow": U ?? void 0,
66
+ "aria-valuenow": W ?? void 0,
66
67
  "aria-valuemin": v,
67
68
  "aria-valuemax": y,
68
69
  "aria-invalid": T ? !0 : void 0,
69
- "aria-describedby": T ? `${W}-error` : w ? `${W}-hint` : void 0,
70
+ "aria-describedby": T ? `${G}-error` : w ? `${G}-hint` : void 0,
70
71
  onChange: (e) => {
71
- H.value = e.target.value;
72
+ U.value = e.target.value;
72
73
  },
73
74
  onFocus: (e) => {
74
- H.value = U == null ? "" : String(U), z("FOCUS"), M?.(e);
75
+ U.value = W == null ? "" : String(W), B("FOCUS"), M?.(e);
75
76
  },
76
77
  onBlur: (e) => {
77
- K(), z("BLUR"), N?.(e);
78
+ q(), B("BLUR"), N?.(e);
78
79
  },
79
80
  onKeyDown: (e) => {
80
- e.key === "ArrowUp" ? (e.preventDefault(), q(1)) : e.key === "ArrowDown" ? (e.preventDefault(), q(-1)) : e.key === "Enter" && K(), P?.(e);
81
+ e.key === "ArrowUp" ? (e.preventDefault(), J(1)) : e.key === "ArrowDown" ? (e.preventDefault(), J(-1)) : e.key === "Enter" && q(), P?.(e);
81
82
  },
83
+ ref: I,
82
84
  ...F
83
- }), /* @__PURE__ */ l("div", {
85
+ }), /* @__PURE__ */ u("div", {
84
86
  className: e.steppers,
85
- children: [/* @__PURE__ */ c("button", {
87
+ children: [/* @__PURE__ */ l("button", {
86
88
  type: "button",
87
89
  className: e.stepper,
88
- "aria-label": I,
90
+ "aria-label": L,
89
91
  tabIndex: -1,
90
- disabled: D || Y,
92
+ disabled: D || X,
91
93
  onMouseDown: (e) => e.preventDefault(),
92
- onClick: () => q(1),
93
- children: /* @__PURE__ */ c("svg", {
94
+ onClick: () => J(1),
95
+ children: /* @__PURE__ */ l("svg", {
94
96
  viewBox: "0 0 10 10",
95
97
  "aria-hidden": "true",
96
98
  focusable: "false",
97
- children: /* @__PURE__ */ c("path", {
99
+ children: /* @__PURE__ */ l("path", {
98
100
  d: "M2 6.5 5 3.5 8 6.5",
99
101
  fill: "none",
100
102
  stroke: "currentColor",
@@ -103,19 +105,19 @@ function h({ value: n, defaultValue: h, onValueChange: g, onChange: _, min: v, m
103
105
  strokeLinejoin: "round"
104
106
  })
105
107
  })
106
- }), /* @__PURE__ */ c("button", {
108
+ }), /* @__PURE__ */ l("button", {
107
109
  type: "button",
108
110
  className: e.stepper,
109
- "aria-label": L,
111
+ "aria-label": R,
110
112
  tabIndex: -1,
111
- disabled: D || X,
113
+ disabled: D || Z,
112
114
  onMouseDown: (e) => e.preventDefault(),
113
- onClick: () => q(-1),
114
- children: /* @__PURE__ */ c("svg", {
115
+ onClick: () => J(-1),
116
+ children: /* @__PURE__ */ l("svg", {
115
117
  viewBox: "0 0 10 10",
116
118
  "aria-hidden": "true",
117
119
  focusable: "false",
118
- children: /* @__PURE__ */ c("path", {
120
+ children: /* @__PURE__ */ l("path", {
119
121
  d: "M2 3.5 5 6.5 8 3.5",
120
122
  fill: "none",
121
123
  stroke: "currentColor",
@@ -127,19 +129,19 @@ function h({ value: n, defaultValue: h, onValueChange: g, onChange: _, min: v, m
127
129
  })]
128
130
  })]
129
131
  }),
130
- T && /* @__PURE__ */ c("span", {
131
- id: `${W}-error`,
132
+ T && /* @__PURE__ */ l("span", {
133
+ id: `${G}-error`,
132
134
  className: e.error,
133
135
  role: "alert",
134
136
  children: T
135
137
  }),
136
- !T && w && /* @__PURE__ */ c("span", {
137
- id: `${W}-hint`,
138
+ !T && w && /* @__PURE__ */ l("span", {
139
+ id: `${G}-hint`,
138
140
  className: e.hint,
139
141
  children: w
140
142
  })
141
143
  ]
142
144
  });
143
- }
145
+ });
144
146
  //#endregion
145
- export { h as NumberInput };
147
+ export { g as NumberInput };
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
 
3
3
  var e = {
4
- wrapper: "_wrapper_q5e5w_2",
5
- label: "_label_q5e5w_27",
6
- field: "_field_q5e5w_35",
7
- input: "_input_q5e5w_39",
8
- steppers: "_steppers_q5e5w_84",
9
- stepper: "_stepper_q5e5w_84",
10
- error: "_error_q5e5w_131",
11
- hint: "_hint_q5e5w_138"
4
+ wrapper: "_wrapper_aavdw_2",
5
+ label: "_label_aavdw_31",
6
+ field: "_field_aavdw_39",
7
+ input: "_input_aavdw_43",
8
+ steppers: "_steppers_aavdw_88",
9
+ stepper: "_stepper_aavdw_88",
10
+ error: "_error_aavdw_135",
11
+ hint: "_hint_aavdw_142"
12
12
  };
13
13
  //#endregion
14
14
  export { e as default };