@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
@@ -1,100 +1,100 @@
1
1
  "use client";
2
2
 
3
3
  import e from "./dropdown.module.js";
4
- import { composeRefs as t, createMachine as n, useEffectPropSignal as r, useMachine as i, useSignal as a, useSignalEffect as o, useSignals as s } from "@cascivo/core";
5
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
- import { cloneElement as u, useRef as d } from "react";
4
+ import { composeRefs as t, createMachine as n, focusElement as r, useEffectPropSignal as i, useMachine as a, useSignal as o, useSignalEffect as s, useSignals as c } from "@cascivo/core";
5
+ import { cloneElement as l, useRef as u } from "react";
6
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
7
7
  //#region ../components/src/dropdown/dropdown.tsx
8
- var f = n({
8
+ var p = n({
9
9
  initial: "closed",
10
10
  states: {
11
11
  closed: { on: { OPEN: "open" } },
12
12
  open: { on: { CLOSE: "closed" } }
13
13
  }
14
14
  });
15
- function p({ trigger: n, items: p, onSelect: m, placement: h = "bottom-start", open: g, onOpenChange: _ }) {
16
- s();
17
- let [v, y] = i(f), b = d(null), x = d(null), S = d(null), C = d([]), w = a(-1), T = g !== void 0, E = T ? g : v.value === "open", D = r(E), O = p.map((e, t) => ({
15
+ function m({ trigger: n, items: m, onSelect: h, placement: g = "bottom-start", open: _, onOpenChange: v }) {
16
+ c();
17
+ let [y, b] = a(p), x = u(null), S = u(null), C = u(null), w = u([]), T = o(-1), E = _ !== void 0, D = E ? _ : y.value === "open", O = i(D), k = m.map((e, t) => ({
18
18
  item: e,
19
19
  index: t
20
- })).filter(({ item: e }) => !e.separator && !e.disabled).map(({ index: e }) => e), k = (e) => {
21
- T || y(e ? "OPEN" : "CLOSE"), _?.(e);
20
+ })).filter(({ item: e }) => !e.separator && !e.disabled).map(({ index: e }) => e), A = (e) => {
21
+ E || b(e ? "OPEN" : "CLOSE"), v?.(e);
22
22
  };
23
- o(() => {
24
- let e = w.value;
25
- D.value && e >= 0 && C.current[e]?.focus();
26
- }), o(() => {
27
- D.value ? w.value = O[0] ?? -1 : w.value = -1;
28
- }), o(() => {
29
- D.value ? S.current?.showPopover() : S.current?.hidePopover();
30
- }), o(() => {
31
- let e = S.current;
23
+ s(() => {
24
+ let e = T.value;
25
+ O.value && e >= 0 && w.current[e]?.focus();
26
+ }), s(() => {
27
+ O.value ? T.value = k[0] ?? -1 : T.value = -1;
28
+ }), s(() => {
29
+ O.value ? C.current?.showPopover() : C.current?.hidePopover();
30
+ }), s(() => {
31
+ let e = C.current;
32
32
  if (!e) return;
33
33
  let t = (e) => {
34
- e.newState === "closed" && k(!1);
34
+ e.newState === "closed" && A(!1);
35
35
  };
36
36
  return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
37
37
  });
38
- let A = (e) => {
39
- let t = p[e];
40
- !t || t.separator || t.disabled || (m?.(t.value), k(!1), x.current?.focus());
41
- }, j = (e) => {
42
- O.length !== 0 && (w.value = O[(O.indexOf(w.value) + e + O.length) % O.length] ?? -1);
38
+ let j = (e) => {
39
+ let t = m[e];
40
+ !t || t.separator || t.disabled || (h?.(t.value), A(!1), r(S.current));
43
41
  }, M = (e) => {
42
+ k.length !== 0 && (T.value = k[(k.indexOf(T.value) + e + k.length) % k.length] ?? -1);
43
+ }, N = (e) => {
44
44
  switch (e.key) {
45
45
  case "ArrowDown":
46
- e.preventDefault(), j(1);
46
+ e.preventDefault(), M(1);
47
47
  break;
48
48
  case "ArrowUp":
49
- e.preventDefault(), j(-1);
49
+ e.preventDefault(), M(-1);
50
50
  break;
51
51
  case "Home":
52
- e.preventDefault(), w.value = O[0] ?? -1;
52
+ e.preventDefault(), T.value = k[0] ?? -1;
53
53
  break;
54
54
  case "End":
55
- e.preventDefault(), w.value = O[O.length - 1] ?? -1;
55
+ e.preventDefault(), T.value = k[k.length - 1] ?? -1;
56
56
  break;
57
57
  case "Escape":
58
- e.preventDefault(), k(!1), x.current?.focus();
58
+ e.preventDefault(), A(!1), r(S.current);
59
59
  break;
60
60
  case "Enter":
61
61
  case " ":
62
- e.preventDefault(), A(w.value);
62
+ e.preventDefault(), j(T.value);
63
63
  break;
64
64
  }
65
- }, N = n, P = u(N, {
66
- ref: t(x, N.props.ref),
65
+ }, P = n, F = l(P, {
66
+ ref: t(S, P.props.ref),
67
67
  onClick: (e) => {
68
- N.props.onClick?.(e), k(!E);
68
+ P.props.onClick?.(e), A(!D);
69
69
  },
70
70
  "aria-haspopup": "menu",
71
- "aria-expanded": E
71
+ "aria-expanded": D
72
72
  });
73
- return /* @__PURE__ */ l("div", {
74
- ref: b,
73
+ return /* @__PURE__ */ f("div", {
74
+ ref: x,
75
75
  className: e.root,
76
- children: [P, /* @__PURE__ */ c("div", {
77
- ref: S,
76
+ children: [F, /* @__PURE__ */ d("div", {
77
+ ref: C,
78
78
  popover: "auto",
79
79
  role: "menu",
80
- "data-placement": h,
81
- "data-state": E ? "open" : "closed",
80
+ "data-placement": g,
81
+ "data-state": D ? "open" : "closed",
82
82
  className: e.menu,
83
- onKeyDown: M,
84
- children: p.map((t, n) => t.separator ? /* @__PURE__ */ c("div", {
83
+ onKeyDown: N,
84
+ children: m.map((t, n) => t.separator ? /* @__PURE__ */ d("div", {
85
85
  role: "separator",
86
86
  className: e.separator
87
- }, `sep-${n}`) : /* @__PURE__ */ l("button", {
87
+ }, `sep-${n}`) : /* @__PURE__ */ f("button", {
88
88
  type: "button",
89
89
  role: "menuitem",
90
90
  ref: (e) => {
91
- C.current[n] = e;
91
+ w.current[n] = e;
92
92
  },
93
- tabIndex: w.value === n ? 0 : -1,
93
+ tabIndex: T.value === n ? 0 : -1,
94
94
  disabled: t.disabled,
95
95
  className: e.item,
96
- onClick: () => A(n),
97
- children: [t.icon && /* @__PURE__ */ c("span", {
96
+ onClick: () => j(n),
97
+ children: [t.icon && /* @__PURE__ */ d("span", {
98
98
  className: e.icon,
99
99
  "aria-hidden": "true",
100
100
  children: t.icon
@@ -104,4 +104,4 @@ function p({ trigger: n, items: p, onSelect: m, placement: h = "bottom-start", o
104
104
  });
105
105
  }
106
106
  //#endregion
107
- export { p as Dropdown };
107
+ export { m as Dropdown };
@@ -2,14 +2,14 @@
2
2
 
3
3
  import e from "./editable.module.js";
4
4
  import { cn as t, useSignal as n, useSignalEffect as r, useSignals as i } from "@cascivo/core";
5
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
- import { useRef as s } from "react";
5
+ import { useRef as a } from "react";
6
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
7
  //#region ../components/src/editable/editable.tsx
8
8
  function c({ value: c, onValueChange: l, placeholder: u, disabled: d = !1, submitOnBlur: f = !0, onCancel: p, className: m, ...h }) {
9
9
  i();
10
- let g = n(!1), _ = n(c), v = s(null), y = s(p);
10
+ let g = n(!1), _ = n(c), v = a(null), y = a(p);
11
11
  y.current = p;
12
- let b = s(l);
12
+ let b = a(l);
13
13
  b.current = l, g.value || (_.value = c), r(() => {
14
14
  if (g.value) {
15
15
  let e = v.current;
@@ -22,10 +22,10 @@ function c({ value: c, onValueChange: l, placeholder: u, disabled: d = !1, submi
22
22
  function S() {
23
23
  _.value = c, g.value = !1, y.current?.();
24
24
  }
25
- return g.value ? /* @__PURE__ */ a("div", {
25
+ return g.value ? /* @__PURE__ */ o("div", {
26
26
  className: t(e.wrapper, e.editing, m),
27
27
  ...h,
28
- children: /* @__PURE__ */ a("input", {
28
+ children: /* @__PURE__ */ o("input", {
29
29
  ref: v,
30
30
  className: e.input,
31
31
  value: _.value,
@@ -39,24 +39,24 @@ function c({ value: c, onValueChange: l, placeholder: u, disabled: d = !1, submi
39
39
  f ? x() : S();
40
40
  }
41
41
  })
42
- }) : /* @__PURE__ */ a("div", {
42
+ }) : /* @__PURE__ */ o("div", {
43
43
  className: t(e.wrapper, m),
44
44
  "data-disabled": d ? "" : void 0,
45
45
  ...h,
46
- children: /* @__PURE__ */ o("button", {
46
+ children: /* @__PURE__ */ s("button", {
47
47
  type: "button",
48
48
  className: e.preview,
49
49
  disabled: d,
50
50
  onClick: () => {
51
51
  d || (g.value = !0);
52
52
  },
53
- children: [/* @__PURE__ */ a("span", {
53
+ children: [/* @__PURE__ */ o("span", {
54
54
  className: e["preview-text"],
55
- children: c || /* @__PURE__ */ a("span", {
55
+ children: c || /* @__PURE__ */ o("span", {
56
56
  className: e.placeholder,
57
57
  children: u
58
58
  })
59
- }), /* @__PURE__ */ a("span", {
59
+ }), /* @__PURE__ */ o("span", {
60
60
  className: e["edit-icon"],
61
61
  "aria-hidden": "true"
62
62
  })]
@@ -1,65 +1,65 @@
1
1
  "use client";
2
2
 
3
3
  import e from "./fab.module.js";
4
- import { DismissableLayer as t, Presence as n, cn as r, useControllableSignal as i, useRovingFocus as a, useSignalEffect as o, useSignals as s } from "@cascivo/core";
5
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
- import { useId as u, useRef as d } from "react";
4
+ import { DismissableLayer as t, Presence as n, cn as r, focusElement as i, useControllableSignal as a, useRovingFocus as o, useSignalEffect as s, useSignals as c } from "@cascivo/core";
5
+ import { useId as l, useRef as u } from "react";
6
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
7
7
  //#region ../components/src/fab/fab.tsx
8
- function f({ children: f, label: p, onClick: m, actions: h, position: g = "bottom-end", open: _, defaultOpen: v, onOpenChange: y, className: b }) {
9
- s();
10
- let x = h != null && h.length > 0, [S, C] = i({
11
- value: _,
12
- defaultValue: v ?? !1,
13
- onChange: y
14
- }), w = a({
8
+ function p({ children: p, label: m, onClick: h, actions: g, position: _ = "bottom-end", open: v, defaultOpen: y, onOpenChange: b, className: x }) {
9
+ c();
10
+ let S = g != null && g.length > 0, [C, w] = a({
11
+ value: v,
12
+ defaultValue: y ?? !1,
13
+ onChange: b
14
+ }), T = o({
15
15
  orientation: "vertical",
16
16
  loop: !0
17
- }), T = d(null), E = d(null), D = u(), O = d(!1);
18
- o(() => {
19
- let e = x && S.value;
20
- e && !O.current ? E.current?.querySelector("[role=\"menuitem\"]:not([aria-disabled=\"true\"])")?.focus() : !e && O.current && T.current?.focus(), O.current = e;
17
+ }), E = u(null), D = u(null), O = l(), k = u(!1);
18
+ s(() => {
19
+ let e = S && C.value;
20
+ e && !k.current ? D.current?.querySelector("[role=\"menuitem\"]:not([aria-disabled=\"true\"])")?.focus() : !e && k.current && i(E.current), k.current = e;
21
21
  });
22
- let k = (e) => {
23
- e.disabled || (e.onSelect(), C(!1));
24
- }, A = /* @__PURE__ */ c("button", {
25
- ref: T,
22
+ let A = (e) => {
23
+ e.disabled || (e.onSelect(), w(!1));
24
+ }, j = /* @__PURE__ */ d("button", {
25
+ ref: E,
26
26
  type: "button",
27
- "aria-label": p,
27
+ "aria-label": m,
28
28
  className: e.fab,
29
- ...x ? {
29
+ ...S ? {
30
30
  "aria-haspopup": "menu",
31
- "aria-expanded": S.value,
32
- "aria-controls": D,
33
- "data-state": S.value ? "open" : "closed",
34
- onClick: () => C(!S.value)
35
- } : { onClick: m },
36
- children: /* @__PURE__ */ c("span", {
31
+ "aria-expanded": C.value,
32
+ "aria-controls": O,
33
+ "data-state": C.value ? "open" : "closed",
34
+ onClick: () => w(!C.value)
35
+ } : { onClick: h },
36
+ children: /* @__PURE__ */ d("span", {
37
37
  className: e.icon,
38
38
  "aria-hidden": "true",
39
- children: f
39
+ children: p
40
40
  })
41
41
  });
42
- return x ? /* @__PURE__ */ c(t, {
43
- onDismiss: () => C(!1),
44
- escapeDismisses: S.value,
45
- disableOutsidePointer: !S.value,
46
- children: /* @__PURE__ */ l("div", {
47
- className: r(e.root, b),
48
- "data-position": g,
49
- children: [/* @__PURE__ */ c(n, {
50
- present: S,
51
- children: /* @__PURE__ */ c("menu", {
52
- ref: E,
53
- id: D,
42
+ return S ? /* @__PURE__ */ d(t, {
43
+ onDismiss: () => w(!1),
44
+ escapeDismisses: C.value,
45
+ disableOutsidePointer: !C.value,
46
+ children: /* @__PURE__ */ f("div", {
47
+ className: r(e.root, x),
48
+ "data-position": _,
49
+ children: [/* @__PURE__ */ d(n, {
50
+ present: C,
51
+ children: /* @__PURE__ */ d("menu", {
52
+ ref: D,
53
+ id: O,
54
54
  role: "menu",
55
- "aria-label": p,
55
+ "aria-label": m,
56
56
  className: e.dial,
57
- children: h.map((t, n) => {
58
- let r = w.getItemProps(n);
59
- return /* @__PURE__ */ c("li", {
57
+ children: g.map((t, n) => {
58
+ let r = T.getItemProps(n);
59
+ return /* @__PURE__ */ d("li", {
60
60
  role: "presentation",
61
61
  className: e.dialItem,
62
- children: /* @__PURE__ */ l("button", {
62
+ children: /* @__PURE__ */ f("button", {
63
63
  ref: r.ref,
64
64
  type: "button",
65
65
  role: "menuitem",
@@ -68,11 +68,11 @@ function f({ children: f, label: p, onClick: m, actions: h, position: g = "botto
68
68
  className: e.action,
69
69
  onKeyDown: r.onKeyDown,
70
70
  onFocus: r.onFocus,
71
- onClick: () => k(t),
72
- children: [/* @__PURE__ */ c("span", {
71
+ onClick: () => A(t),
72
+ children: [/* @__PURE__ */ d("span", {
73
73
  className: e.actionLabel,
74
74
  children: t.label
75
- }), /* @__PURE__ */ c("span", {
75
+ }), /* @__PURE__ */ d("span", {
76
76
  className: e.actionIcon,
77
77
  "aria-hidden": "true",
78
78
  children: t.icon
@@ -81,13 +81,13 @@ function f({ children: f, label: p, onClick: m, actions: h, position: g = "botto
81
81
  }, t.id ?? n);
82
82
  })
83
83
  })
84
- }), A]
84
+ }), j]
85
85
  })
86
- }) : /* @__PURE__ */ c("div", {
87
- className: r(e.root, b),
88
- "data-position": g,
89
- children: A
86
+ }) : /* @__PURE__ */ d("div", {
87
+ className: r(e.root, x),
88
+ "data-position": _,
89
+ children: j
90
90
  });
91
91
  }
92
92
  //#endregion
93
- export { f as Fab };
93
+ export { p as Fab };
@@ -3,8 +3,8 @@
3
3
  import { Label as e } from "../label/label.js";
4
4
  import t from "./field.module.js";
5
5
  import { cn as n, useId as r } from "@cascivo/core";
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
- import { Children as o, cloneElement as s, isValidElement as c } from "react";
6
+ import { Children as i, cloneElement as a, isValidElement as o } from "react";
7
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
8
8
  //#region ../components/src/field/field.tsx
9
9
  var l = /* @__PURE__ */ new Set();
10
10
  function u() {
@@ -17,25 +17,25 @@ function d(e, t) {
17
17
  }
18
18
  function f({ label: l, description: u, error: f, required: p = !1, disabled: m = !1, id: h, children: g, className: _ }) {
19
19
  let v = r("cascade-field"), y = h ?? v, b = `${y}-description`, x = `${y}-error`, S = [u ? b : null, f ? x : null].filter(Boolean).join(" ") || void 0, C = { id: y };
20
- S && (C["aria-describedby"] = S), f && (C["aria-invalid"] = !0), (m || g.props.disabled) && (C.disabled = !0), c(g) && d(l, g);
21
- let w = c(g) ? s(o.only(g), C) : g;
22
- return /* @__PURE__ */ a("div", {
20
+ S && (C["aria-describedby"] = S), f && (C["aria-invalid"] = !0), (m || g.props.disabled) && (C.disabled = !0), o(g) && d(l, g);
21
+ let w = o(g) ? a(i.only(g), C) : g;
22
+ return /* @__PURE__ */ c("div", {
23
23
  className: n(t.field, _),
24
24
  "data-disabled": m ? "" : void 0,
25
25
  children: [
26
- l && /* @__PURE__ */ i(e, {
26
+ l && /* @__PURE__ */ s(e, {
27
27
  htmlFor: y,
28
28
  required: p,
29
29
  disabled: m,
30
30
  children: l
31
31
  }),
32
32
  w,
33
- u && /* @__PURE__ */ i("p", {
33
+ u && /* @__PURE__ */ s("p", {
34
34
  id: b,
35
35
  className: t.description,
36
36
  children: u
37
37
  }),
38
- f && /* @__PURE__ */ i("p", {
38
+ f && /* @__PURE__ */ s("p", {
39
39
  id: x,
40
40
  role: "alert",
41
41
  className: t.error,
@@ -3,9 +3,9 @@
3
3
  import { Spinner as e } from "../spinner/spinner.js";
4
4
  import t from "./file-uploader.module.js";
5
5
  import { cn as n, useSignal as r, useSignals as i } from "@cascivo/core";
6
- import { builtin as a, t as o } from "@cascivo/i18n";
7
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
8
- import { useRef as l } from "react";
6
+ import { useRef as a } from "react";
7
+ import { builtin as o, t as s } from "@cascivo/i18n";
8
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
9
  //#region ../components/src/file-uploader/file-uploader.tsx
10
10
  function u(e, t) {
11
11
  let n = t.split(",").map((e) => e.trim()).filter(Boolean);
@@ -16,21 +16,21 @@ function d(e) {
16
16
  }
17
17
  function f({ files: f = [], onFilesAdded: p, onRemove: m, multiple: h = !1, accept: g, maxSize: _, onRejected: v, label: y, hint: b, labels: x, disabled: S = !1, className: C }) {
18
18
  i();
19
- let w = l(null), T = r(!1), E = y ?? x?.label ?? o(a.fileUploader.label), D = x?.drop ?? o(a.fileUploader.drop), O = x?.uploading ?? o(a.fileUploader.uploading), k = x?.complete ?? o(a.fileUploader.complete), A = x?.error ?? o(a.fileUploader.error), j = (e) => x?.remove ? x.remove.replace("{name}", e) : o(a.fileUploader.remove, { name: e }), M = `cascade-uploader-${E.toLowerCase().replace(/\s+/g, "-")}`, N = `${M}-label`, P = `${M}-hint`, F = (e) => {
19
+ let w = a(null), T = r(!1), E = y ?? x?.label ?? s(o.fileUploader.label), D = x?.drop ?? s(o.fileUploader.drop), O = x?.uploading ?? s(o.fileUploader.uploading), k = x?.complete ?? s(o.fileUploader.complete), A = x?.error ?? s(o.fileUploader.error), j = (e) => x?.remove ? x.remove.replace("{name}", e) : s(o.fileUploader.remove, { name: e }), M = `cascade-uploader-${E.toLowerCase().replace(/\s+/g, "-")}`, N = `${M}-label`, P = `${M}-hint`, F = (e) => {
20
20
  if (!e || e.length === 0) return;
21
21
  let t = h ? Array.from(e) : Array.from(e).slice(0, 1), n = [], r = [], i = [];
22
22
  for (let e of t) g && !u(e, g) ? r.push(e) : _ !== void 0 && e.size > _ ? i.push(e) : n.push(e);
23
23
  r.length > 0 && v?.(r, "type"), i.length > 0 && v?.(i, "size"), n.length > 0 && p?.(n);
24
24
  };
25
- return /* @__PURE__ */ c("div", {
25
+ return /* @__PURE__ */ l("div", {
26
26
  className: n(t.uploader, C),
27
27
  children: [
28
- /* @__PURE__ */ s("span", {
28
+ /* @__PURE__ */ c("span", {
29
29
  id: N,
30
30
  className: t.label,
31
31
  children: E
32
32
  }),
33
- /* @__PURE__ */ s("input", {
33
+ /* @__PURE__ */ c("input", {
34
34
  ref: w,
35
35
  type: "file",
36
36
  className: t.input,
@@ -43,7 +43,7 @@ function f({ files: f = [], onFilesAdded: p, onRemove: m, multiple: h = !1, acce
43
43
  F(e.target.files), e.target.value = "";
44
44
  }
45
45
  }),
46
- /* @__PURE__ */ s("button", {
46
+ /* @__PURE__ */ c("button", {
47
47
  type: "button",
48
48
  className: t.zone,
49
49
  "data-state": T.value ? "dragover" : "idle",
@@ -62,53 +62,53 @@ function f({ files: f = [], onFilesAdded: p, onRemove: m, multiple: h = !1, acce
62
62
  },
63
63
  children: D
64
64
  }),
65
- b && /* @__PURE__ */ s("span", {
65
+ b && /* @__PURE__ */ c("span", {
66
66
  id: P,
67
67
  className: t.hint,
68
68
  children: b
69
69
  }),
70
- f.length > 0 && /* @__PURE__ */ s("ul", {
70
+ f.length > 0 && /* @__PURE__ */ c("ul", {
71
71
  className: t.list,
72
72
  "aria-live": "polite",
73
- children: f.map((n) => /* @__PURE__ */ c("li", {
73
+ children: f.map((n) => /* @__PURE__ */ l("li", {
74
74
  className: t.file,
75
75
  "data-state": n.status,
76
76
  children: [
77
- /* @__PURE__ */ c("span", {
77
+ /* @__PURE__ */ l("span", {
78
78
  className: t.status,
79
79
  children: [
80
- n.status === "uploading" && /* @__PURE__ */ s(e, {
80
+ n.status === "uploading" && /* @__PURE__ */ c(e, {
81
81
  size: "sm",
82
82
  label: O
83
83
  }),
84
- n.status === "complete" && /* @__PURE__ */ s("span", {
84
+ n.status === "complete" && /* @__PURE__ */ c("span", {
85
85
  className: t["glyph-complete"],
86
86
  "aria-label": k,
87
87
  children: "✓"
88
88
  }),
89
- n.status === "error" && /* @__PURE__ */ s("span", {
89
+ n.status === "error" && /* @__PURE__ */ c("span", {
90
90
  className: t["glyph-error"],
91
91
  "aria-label": A,
92
92
  children: "✕"
93
93
  })
94
94
  ]
95
95
  }),
96
- /* @__PURE__ */ s("span", {
96
+ /* @__PURE__ */ c("span", {
97
97
  className: t.name,
98
98
  children: n.name
99
99
  }),
100
- n.size !== void 0 && /* @__PURE__ */ s("span", {
100
+ n.size !== void 0 && /* @__PURE__ */ c("span", {
101
101
  className: t.size,
102
102
  children: d(n.size)
103
103
  }),
104
- /* @__PURE__ */ s("button", {
104
+ /* @__PURE__ */ c("button", {
105
105
  type: "button",
106
106
  className: t.remove,
107
107
  "aria-label": j(n.name),
108
108
  onClick: () => m?.(n.id),
109
109
  children: "✕"
110
110
  }),
111
- n.status === "error" && n.errorMessage && /* @__PURE__ */ s("span", {
111
+ n.status === "error" && n.errorMessage && /* @__PURE__ */ c("span", {
112
112
  className: t["error-message"],
113
113
  children: n.errorMessage
114
114
  })
@@ -1,20 +1,20 @@
1
1
  "use client";
2
2
 
3
3
  var e = {
4
- uploader: "_uploader_bw6tn_2",
5
- label: "_label_bw6tn_9",
6
- input: "_input_bw6tn_15",
7
- zone: "_zone_bw6tn_24",
8
- hint: "_hint_bw6tn_57",
9
- list: "_list_bw6tn_62",
10
- file: "_file_bw6tn_71",
11
- status: "_status_bw6tn_88",
12
- "glyph-complete": "_glyph-complete_bw6tn_94",
13
- "glyph-error": "_glyph-error_bw6tn_98",
14
- name: "_name_bw6tn_102",
15
- size: "_size_bw6tn_109",
16
- remove: "_remove_bw6tn_115",
17
- "error-message": "_error-message_bw6tn_135"
4
+ uploader: "_uploader_nfhc5_2",
5
+ label: "_label_nfhc5_13",
6
+ input: "_input_nfhc5_19",
7
+ zone: "_zone_nfhc5_28",
8
+ hint: "_hint_nfhc5_61",
9
+ list: "_list_nfhc5_66",
10
+ file: "_file_nfhc5_75",
11
+ status: "_status_nfhc5_92",
12
+ "glyph-complete": "_glyph-complete_nfhc5_98",
13
+ "glyph-error": "_glyph-error_nfhc5_102",
14
+ name: "_name_nfhc5_106",
15
+ size: "_size_nfhc5_113",
16
+ remove: "_remove_nfhc5_119",
17
+ "error-message": "_error-message_nfhc5_139"
18
18
  };
19
19
  //#endregion
20
20
  export { e as default };
@@ -4,28 +4,29 @@ import e from "./filter.module.js";
4
4
  import { useControllableSignal as t, useSignals as n } from "@cascivo/core";
5
5
  import { jsx as r } from "react/jsx-runtime";
6
6
  //#region ../components/src/filter/filter.tsx
7
- function i({ options: i, value: a, defaultValue: o = [], onValueChange: s, onChange: c, multi: l = !1, variant: u = "pill", className: d, ...f }) {
7
+ function i({ options: i, value: a, defaultValue: o = [], onValueChange: s, onChange: c, multi: l = !1, variant: u = "pill", className: d, ariaLabel: f, ...p }) {
8
8
  n();
9
- let [p, m] = t({
9
+ let [m, h] = t({
10
10
  value: a,
11
11
  defaultValue: o,
12
12
  onChange: s ?? c
13
13
  });
14
- function h(e) {
15
- let t = p.value, n;
16
- n = l ? t.includes(e) ? t.filter((t) => t !== e) : [...t, e] : t.includes(e) ? [] : [e], m(n);
14
+ function g(e) {
15
+ let t = m.value, n;
16
+ n = l ? t.includes(e) ? t.filter((t) => t !== e) : [...t, e] : t.includes(e) ? [] : [e], h(n);
17
17
  }
18
18
  return /* @__PURE__ */ r("div", {
19
19
  role: "group",
20
20
  className: [e.filter, d].filter(Boolean).join(" "),
21
21
  "data-variant": u,
22
- ...f,
22
+ "aria-label": p["aria-label"] ?? f,
23
+ ...p,
23
24
  children: i.map((t) => /* @__PURE__ */ r("button", {
24
25
  type: "button",
25
26
  className: e.item,
26
- "data-selected": p.value.includes(t.value) || void 0,
27
- onClick: () => h(t.value),
28
- "aria-pressed": p.value.includes(t.value),
27
+ "data-selected": m.value.includes(t.value) || void 0,
28
+ onClick: () => g(t.value),
29
+ "aria-pressed": m.value.includes(t.value),
29
30
  children: t.label
30
31
  }, t.value))
31
32
  });