@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,98 +2,98 @@
2
2
 
3
3
  import { usePopover as e } from "../popover/use-popover.js";
4
4
  import t from "./multi-select.module.js";
5
- import { cn as n, useComputed as r, useSignal as i, useSignalEffect as a, useSignals as o } from "@cascivo/core";
6
- import { builtin as s, t as c } from "@cascivo/i18n";
7
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
- import { useRef as d } from "react";
5
+ import { cn as n, focusElement as r, useComputed as i, useSignal as a, useSignalEffect as o, useSignals as s } from "@cascivo/core";
6
+ import { useRef as c } from "react";
7
+ import { builtin as l, t as u } from "@cascivo/i18n";
8
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
9
9
  //#region ../components/src/multi-select/multi-select.tsx
10
- function f({ options: f, value: p, onValueChange: m, placeholder: h, disabled: g = !1, labels: _, className: v, ...y }) {
11
- o();
12
- let b = e({ placement: "bottom" }), x = i(""), S = i(-1), C = d(null), w = d(null), T = r(() => {
13
- let e = x.value.toLowerCase();
14
- return e ? f.filter((t) => t.label.toLowerCase().includes(e)) : f;
10
+ function p({ options: p, value: m, onValueChange: h, placeholder: g, disabled: _ = !1, labels: v, className: y, ...b }) {
11
+ s();
12
+ let x = e({ placement: "bottom" }), S = a(""), C = a(-1), w = c(null), T = c(null), E = i(() => {
13
+ let e = S.value.toLowerCase();
14
+ return e ? p.filter((t) => t.label.toLowerCase().includes(e)) : p;
15
15
  });
16
- a(() => {
17
- b.isOpen.value ? (S.value = -1, setTimeout(() => w.current?.focus(), 0)) : x.value = "";
18
- }), a(() => {
19
- let e = C.current;
20
- if (!e || !b.isOpen.value) return;
16
+ o(() => {
17
+ x.isOpen.value ? (C.value = -1, setTimeout(() => r(T.current), 0)) : S.value = "";
18
+ }), o(() => {
19
+ let e = w.current;
20
+ if (!e || !x.isOpen.value) return;
21
21
  let t = (e) => {
22
- let t = T.value;
23
- if (e.key === "ArrowDown") e.preventDefault(), S.value = Math.min(S.value + 1, t.length - 1);
24
- else if (e.key === "ArrowUp") e.preventDefault(), S.value = Math.max(S.value - 1, -1);
22
+ let t = E.value;
23
+ if (e.key === "ArrowDown") e.preventDefault(), C.value = Math.min(C.value + 1, t.length - 1);
24
+ else if (e.key === "ArrowUp") e.preventDefault(), C.value = Math.max(C.value - 1, -1);
25
25
  else if (e.key === " " || e.key === "Enter") {
26
- let n = t[S.value];
27
- n && !n.disabled && (e.preventDefault(), E(n.value));
28
- } else e.key === "Escape" && b.close();
26
+ let n = t[C.value];
27
+ n && !n.disabled && (e.preventDefault(), D(n.value));
28
+ } else e.key === "Escape" && x.close();
29
29
  };
30
30
  return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
31
31
  });
32
- function E(e) {
33
- p.includes(e) ? m(p.filter((t) => t !== e)) : m([...p, e]);
32
+ function D(e) {
33
+ m.includes(e) ? h(m.filter((t) => t !== e)) : h([...m, e]);
34
34
  }
35
- let D = p.length === 0 ? h ?? _?.placeholder ?? c(s.multiSelect.placeholder) : _?.selected ? _.selected(p.length) : c(s.multiSelect.selected, { count: String(p.length) }), O = _?.search ?? c(s.multiSelect.search), k = _?.noResults ?? c(s.multiSelect.noResults);
36
- return /* @__PURE__ */ u("div", {
37
- className: n(t.wrapper, v),
38
- ...y,
39
- children: [/* @__PURE__ */ u("button", {
40
- ref: b.triggerRef,
35
+ let O = m.length === 0 ? g ?? v?.placeholder ?? u(l.multiSelect.placeholder) : v?.selected ? v.selected(m.length) : u(l.multiSelect.selected, { count: String(m.length) }), k = v?.search ?? u(l.multiSelect.search), A = v?.noResults ?? u(l.multiSelect.noResults);
36
+ return /* @__PURE__ */ f("div", {
37
+ className: n(t.wrapper, y),
38
+ ...b,
39
+ children: [/* @__PURE__ */ f("button", {
40
+ ref: x.triggerRef,
41
41
  type: "button",
42
42
  className: t.trigger,
43
43
  "aria-haspopup": "listbox",
44
- "aria-expanded": b.isOpen.value,
45
- disabled: g,
46
- style: { anchorName: b.anchorName },
47
- onClick: () => b.toggle(),
48
- children: [/* @__PURE__ */ l("span", {
44
+ "aria-expanded": x.isOpen.value,
45
+ disabled: _,
46
+ style: { anchorName: x.anchorName },
47
+ onClick: () => x.toggle(),
48
+ children: [/* @__PURE__ */ d("span", {
49
49
  className: t["trigger-label"],
50
- children: D
51
- }), /* @__PURE__ */ l("span", {
50
+ children: O
51
+ }), /* @__PURE__ */ d("span", {
52
52
  className: t.chevron,
53
53
  "aria-hidden": "true"
54
54
  })]
55
- }), /* @__PURE__ */ u("div", {
56
- ref: b.popoverRef,
55
+ }), /* @__PURE__ */ f("div", {
56
+ ref: x.popoverRef,
57
57
  popover: "auto",
58
58
  className: t.panel,
59
- style: { positionAnchor: b.anchorName },
59
+ style: { positionAnchor: x.anchorName },
60
60
  tabIndex: -1,
61
- children: [/* @__PURE__ */ l("div", {
61
+ children: [/* @__PURE__ */ d("div", {
62
62
  className: t["search-row"],
63
- children: /* @__PURE__ */ l("input", {
64
- ref: w,
63
+ children: /* @__PURE__ */ d("input", {
64
+ ref: T,
65
65
  type: "search",
66
66
  className: t.search,
67
- placeholder: O,
68
- value: x.value,
67
+ placeholder: k,
68
+ value: S.value,
69
69
  onChange: (e) => {
70
- x.value = e.currentTarget.value, S.value = -1;
70
+ S.value = e.currentTarget.value, C.value = -1;
71
71
  }
72
72
  })
73
- }), /* @__PURE__ */ l("div", {
74
- ref: C,
73
+ }), /* @__PURE__ */ d("div", {
74
+ ref: w,
75
75
  role: "listbox",
76
76
  "aria-multiselectable": "true",
77
- "aria-label": _?.label ?? c(s.multiSelect.label),
77
+ "aria-label": v?.label ?? u(l.multiSelect.label),
78
78
  className: t.options,
79
- children: T.value.length === 0 ? /* @__PURE__ */ l("div", {
79
+ children: E.value.length === 0 ? /* @__PURE__ */ d("div", {
80
80
  className: t["no-results"],
81
- children: k
82
- }) : T.value.map((e, n) => /* @__PURE__ */ u("div", {
81
+ children: A
82
+ }) : E.value.map((e, n) => /* @__PURE__ */ f("div", {
83
83
  role: "option",
84
- "aria-selected": p.includes(e.value),
84
+ "aria-selected": m.includes(e.value),
85
85
  "aria-disabled": e.disabled,
86
- "data-active": n === S.value ? "" : void 0,
87
- "data-selected": p.includes(e.value) ? "" : void 0,
86
+ "data-active": n === C.value ? "" : void 0,
87
+ "data-selected": m.includes(e.value) ? "" : void 0,
88
88
  "data-disabled": e.disabled ? "" : void 0,
89
89
  className: t.option,
90
90
  onMouseDown: (t) => {
91
- t.preventDefault(), e.disabled || E(e.value);
91
+ t.preventDefault(), e.disabled || D(e.value);
92
92
  },
93
93
  onMouseEnter: () => {
94
- S.value = n;
94
+ C.value = n;
95
95
  },
96
- children: [/* @__PURE__ */ l("span", {
96
+ children: [/* @__PURE__ */ d("span", {
97
97
  className: t.checkbox,
98
98
  "aria-hidden": "true"
99
99
  }), e.label]
@@ -103,4 +103,4 @@ function f({ options: f, value: p, onValueChange: m, placeholder: h, disabled: g
103
103
  });
104
104
  }
105
105
  //#endregion
106
- export { f as MultiSelect };
106
+ export { p as MultiSelect };
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
 
3
3
  var e = {
4
- wrapper: "_wrapper_1r5fv_2",
5
- trigger: "_trigger_1r5fv_12",
6
- "trigger-label": "_trigger-label_1r5fv_51",
7
- chevron: "_chevron_1r5fv_63",
8
- panel: "_panel_1r5fv_83",
9
- "search-row": "_search-row_1r5fv_121",
10
- search: "_search_1r5fv_121",
11
- options: "_options_1r5fv_142",
12
- option: "_option_1r5fv_142",
13
- checkbox: "_checkbox_1r5fv_170",
14
- "no-results": "_no-results_1r5fv_185"
4
+ wrapper: "_wrapper_1fi6e_2",
5
+ trigger: "_trigger_1fi6e_12",
6
+ "trigger-label": "_trigger-label_1fi6e_51",
7
+ chevron: "_chevron_1fi6e_63",
8
+ panel: "_panel_1fi6e_83",
9
+ "search-row": "_search-row_1fi6e_128",
10
+ search: "_search_1fi6e_128",
11
+ options: "_options_1fi6e_149",
12
+ option: "_option_1fi6e_149",
13
+ checkbox: "_checkbox_1fi6e_177",
14
+ "no-results": "_no-results_1fi6e_192"
15
15
  };
16
16
  //#endregion
17
17
  export { e as default };
@@ -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 };
@@ -2,9 +2,9 @@
2
2
 
3
3
  import e from "./notification.module.js";
4
4
  import { Presence as t, cn as n, normalizeTone 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";
7
- import { useRef as u } from "react";
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
9
  var d = {
10
10
  neutral: "neutral",
@@ -14,73 +14,73 @@ var d = {
14
14
  danger: "error"
15
15
  }, f = new Set(["warning", "error"]), p = 160;
16
16
  function m({ variant: e }) {
17
- return e === "success" ? /* @__PURE__ */ l("svg", {
17
+ return e === "success" ? /* @__PURE__ */ u("svg", {
18
18
  viewBox: "0 0 20 20",
19
19
  width: "20",
20
20
  height: "20",
21
21
  fill: "none",
22
22
  "aria-hidden": "true",
23
- children: [/* @__PURE__ */ c("circle", {
23
+ children: [/* @__PURE__ */ l("circle", {
24
24
  cx: "10",
25
25
  cy: "10",
26
26
  r: "8",
27
27
  stroke: "currentColor",
28
28
  strokeWidth: "1.5"
29
- }), /* @__PURE__ */ c("path", {
29
+ }), /* @__PURE__ */ l("path", {
30
30
  d: "M6.5 10.5l2.5 2.5 4.5-5",
31
31
  stroke: "currentColor",
32
32
  strokeWidth: "1.5",
33
33
  strokeLinecap: "round",
34
34
  strokeLinejoin: "round"
35
35
  })]
36
- }) : e === "warning" ? /* @__PURE__ */ l("svg", {
36
+ }) : e === "warning" ? /* @__PURE__ */ u("svg", {
37
37
  viewBox: "0 0 20 20",
38
38
  width: "20",
39
39
  height: "20",
40
40
  fill: "none",
41
41
  "aria-hidden": "true",
42
- children: [/* @__PURE__ */ c("path", {
42
+ children: [/* @__PURE__ */ l("path", {
43
43
  d: "M10 2.5L18.5 17H1.5L10 2.5z",
44
44
  stroke: "currentColor",
45
45
  strokeWidth: "1.5",
46
46
  strokeLinejoin: "round"
47
- }), /* @__PURE__ */ c("path", {
47
+ }), /* @__PURE__ */ l("path", {
48
48
  d: "M10 8v3.5M10 14h.01",
49
49
  stroke: "currentColor",
50
50
  strokeWidth: "1.5",
51
51
  strokeLinecap: "round"
52
52
  })]
53
- }) : e === "error" ? /* @__PURE__ */ l("svg", {
53
+ }) : e === "error" ? /* @__PURE__ */ u("svg", {
54
54
  viewBox: "0 0 20 20",
55
55
  width: "20",
56
56
  height: "20",
57
57
  fill: "none",
58
58
  "aria-hidden": "true",
59
- children: [/* @__PURE__ */ c("circle", {
59
+ children: [/* @__PURE__ */ l("circle", {
60
60
  cx: "10",
61
61
  cy: "10",
62
62
  r: "8",
63
63
  stroke: "currentColor",
64
64
  strokeWidth: "1.5"
65
- }), /* @__PURE__ */ c("path", {
65
+ }), /* @__PURE__ */ l("path", {
66
66
  d: "M10 6v4.5M10 13.5h.01",
67
67
  stroke: "currentColor",
68
68
  strokeWidth: "1.5",
69
69
  strokeLinecap: "round"
70
70
  })]
71
- }) : /* @__PURE__ */ l("svg", {
71
+ }) : /* @__PURE__ */ u("svg", {
72
72
  viewBox: "0 0 20 20",
73
73
  width: "20",
74
74
  height: "20",
75
75
  fill: "none",
76
76
  "aria-hidden": "true",
77
- children: [/* @__PURE__ */ c("circle", {
77
+ children: [/* @__PURE__ */ l("circle", {
78
78
  cx: "10",
79
79
  cy: "10",
80
80
  r: "8",
81
81
  stroke: "currentColor",
82
82
  strokeWidth: "1.5"
83
- }), /* @__PURE__ */ c("path", {
83
+ }), /* @__PURE__ */ l("path", {
84
84
  d: "M10 9v5M10 6.5h.01",
85
85
  stroke: "currentColor",
86
86
  strokeWidth: "1.5",
@@ -90,45 +90,45 @@ function m({ variant: e }) {
90
90
  }
91
91
  function h({ title: h, description: g, variant: _ = "info", dismissible: v = !1, onDismiss: y, actions: b, icon: x, labels: S, className: C, ...w }) {
92
92
  a();
93
- let T = d[r(_)] ?? _, E = i(!0), D = u(y);
93
+ let T = d[r(_)] ?? _, E = i(!0), D = o(y);
94
94
  D.current = y;
95
95
  let O = v || y !== void 0, k = () => {
96
96
  E.value = !1, setTimeout(() => D.current?.(), p);
97
97
  };
98
- return /* @__PURE__ */ c(t, {
98
+ return /* @__PURE__ */ l(t, {
99
99
  present: E,
100
- children: /* @__PURE__ */ l("div", {
100
+ children: /* @__PURE__ */ u("div", {
101
101
  role: f.has(T) ? "alert" : "status",
102
102
  "data-variant": T,
103
103
  className: n(e.notification, C),
104
104
  ...w,
105
105
  children: [
106
- /* @__PURE__ */ c("span", {
106
+ /* @__PURE__ */ l("span", {
107
107
  className: e.icon,
108
108
  "aria-hidden": "true",
109
- children: x ?? /* @__PURE__ */ c(m, { variant: T })
109
+ children: x ?? /* @__PURE__ */ l(m, { variant: T })
110
110
  }),
111
- /* @__PURE__ */ l("div", {
111
+ /* @__PURE__ */ u("div", {
112
112
  className: e.body,
113
113
  children: [
114
- /* @__PURE__ */ c("div", {
114
+ /* @__PURE__ */ l("div", {
115
115
  className: e.title,
116
116
  children: h
117
117
  }),
118
- g && /* @__PURE__ */ c("div", {
118
+ g && /* @__PURE__ */ l("div", {
119
119
  className: e.description,
120
120
  children: g
121
121
  }),
122
- b && /* @__PURE__ */ c("div", {
122
+ b && /* @__PURE__ */ l("div", {
123
123
  className: e.actions,
124
124
  children: b
125
125
  })
126
126
  ]
127
127
  }),
128
- O && /* @__PURE__ */ c("button", {
128
+ O && /* @__PURE__ */ l("button", {
129
129
  type: "button",
130
130
  className: e.dismiss,
131
- "aria-label": S?.dismiss ?? s(o.notification.dismiss),
131
+ "aria-label": S?.dismiss ?? c(s.notification.dismiss),
132
132
  onClick: k,
133
133
  children: "✕"
134
134
  })