@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
@@ -3,12 +3,12 @@
3
3
  import { Spinner as e } from "../spinner/spinner.js";
4
4
  import { Kbd as t } from "../kbd/kbd.js";
5
5
  import n from "./command-menu.module.js";
6
- import { batch as r, cn as i, useEffectPropSignal as a, useSignal as o, useSignalEffect as s, useSignals as ee } from "@cascivo/core";
7
- import { builtin as c, t as l } from "@cascivo/i18n";
8
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
- import { useId as te, useRef as f } from "react";
6
+ import { batch as r, cn as i, focusElement as a, useEffectPropSignal as o, useSignal as s, useSignalEffect as c, useSignals as ee } from "@cascivo/core";
7
+ import { useId as te, useRef as l } from "react";
8
+ import { builtin as u, t as d } from "@cascivo/i18n";
9
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
10
10
  //#region ../components/src/command-menu/command-menu.tsx
11
- function p(e, t) {
11
+ function m(e, t) {
12
12
  if (e.length === 0) return {
13
13
  score: 1,
14
14
  indices: []
@@ -25,21 +25,21 @@ function p(e, t) {
25
25
  indices: s
26
26
  } : null;
27
27
  }
28
- function m(e, t) {
29
- return p(e, t)?.score ?? 0;
30
- }
31
28
  function h(e, t) {
32
- let n = m(e, t.label);
29
+ return m(e, t)?.score ?? 0;
30
+ }
31
+ function g(e, t) {
32
+ let n = h(e, t.label);
33
33
  for (let r of t.keywords ?? []) {
34
- let t = m(e, r);
34
+ let t = h(e, r);
35
35
  t > n && (n = t);
36
36
  }
37
37
  return n;
38
38
  }
39
- function g(e, t) {
39
+ function _(e, t) {
40
40
  if (t.length === 0) return e;
41
41
  let r = new Set(t), i = [], a = "", o = r.has(0), s = (e) => {
42
- a !== "" && (i.push(o ? /* @__PURE__ */ u("mark", {
42
+ a !== "" && (i.push(o ? /* @__PURE__ */ f("mark", {
43
43
  className: n.match,
44
44
  children: a
45
45
  }, e) : a), a = "");
@@ -50,7 +50,7 @@ function g(e, t) {
50
50
  }
51
51
  return s(e.length), i;
52
52
  }
53
- function _(e, t) {
53
+ function v(e, t) {
54
54
  for (let n of t) {
55
55
  let t = n.prefix;
56
56
  if (t) {
@@ -66,49 +66,49 @@ function _(e, t) {
66
66
  }
67
67
  return null;
68
68
  }
69
- function v({ open: m, onOpenChange: v, groups: ne, placeholder: re, emptyLabel: ie, hotkey: y = !0, label: b, loading: x = !1, onQueryChange: S, scopes: C = [], className: ae }) {
69
+ function y({ open: h, onOpenChange: y, groups: ne, placeholder: re, emptyLabel: ie, hotkey: b = !0, label: x, loading: S = !1, onQueryChange: C, scopes: w = [], className: ae }) {
70
70
  ee();
71
- let w = b ?? l(c.commandMenu.label), T = ie ?? l(c.commandMenu.empty), E = te(), D = `${E}-listbox`, O = f(null), k = f(null), A = f([]), j = f(v);
72
- j.current = v;
73
- let M = f(S);
74
- M.current = S;
75
- let N = a(m), P = a(y), F = o(""), I = o(0), L = o([]), R = o(null), z = L.value.at(-1)?.groups ?? ne, B = re ?? L.value.at(-1)?.placeholder ?? l(c.commandMenu.placeholder), V = C.find((e) => e.id === R.value) ?? null, H = z.filter((e) => !R.value || !e.scope || e.scope === R.value).map((e) => ({
71
+ let T = x ?? d(u.commandMenu.label), E = ie ?? d(u.commandMenu.empty), D = te(), O = `${D}-listbox`, k = l(null), A = l(null), j = l([]), M = l(y);
72
+ M.current = y;
73
+ let N = l(C);
74
+ N.current = C;
75
+ let P = o(h), oe = o(b), F = s(""), I = s(0), L = s([]), R = s(null), z = L.value.at(-1)?.groups ?? ne, B = re ?? L.value.at(-1)?.placeholder ?? d(u.commandMenu.placeholder), V = w.find((e) => e.id === R.value) ?? null, H = z.filter((e) => !R.value || !e.scope || e.scope === R.value).map((e) => ({
76
76
  heading: e.heading,
77
77
  items: e.items.map((e) => ({
78
78
  item: e,
79
- score: h(F.value, e)
79
+ score: g(F.value, e)
80
80
  })).filter(({ score: e }) => e > 0).sort((e, t) => t.score - e.score).map(({ item: e }) => ({
81
81
  item: e,
82
- indices: p(F.value, e.label)?.indices ?? []
82
+ indices: m(F.value, e.label)?.indices ?? []
83
83
  }))
84
- })).filter((e) => e.items.length > 0), U = H.flatMap((e) => e.items.map((e) => e.item)), W = U.flatMap((e, t) => e.disabled ? [] : [t]), G = W.includes(I.value) ? I.value : W[0] ?? -1, K = (e) => `${E}-option-${e}`;
85
- s(() => {
86
- let e = O.current;
87
- e && (N.value ? e.open || (r(() => {
84
+ })).filter((e) => e.items.length > 0), U = H.flatMap((e) => e.items.map((e) => e.item)), W = U.flatMap((e, t) => e.disabled ? [] : [t]), G = W.includes(I.value) ? I.value : W[0] ?? -1, K = (e) => `${D}-option-${e}`;
85
+ c(() => {
86
+ let e = k.current;
87
+ e && (P.value ? e.open || (r(() => {
88
88
  F.value = "", I.value = 0, L.value = [], R.value = null;
89
- }), typeof e.showModal == "function" && e.showModal(), k.current?.focus()) : e.open && (L.value = [], e.close()));
90
- }), s(() => {
91
- let e = O.current;
89
+ }), typeof e.showModal == "function" && e.showModal(), a(A.current)) : e.open && (L.value = [], e.close()));
90
+ }), c(() => {
91
+ let e = k.current;
92
92
  if (!e) return;
93
- let t = () => j.current(!1);
93
+ let t = () => M.current(!1);
94
94
  return e.addEventListener("close", t), () => e.removeEventListener("close", t);
95
- }), s(() => {
96
- if (!P.value) return;
95
+ }), c(() => {
96
+ if (!oe.value) return;
97
97
  let e = (e) => {
98
- (e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k" && (e.preventDefault(), j.current(!N.value));
98
+ (e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k" && (e.preventDefault(), M.current(!P.value));
99
99
  };
100
100
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
101
101
  });
102
102
  let q = (e) => {
103
103
  I.value = e;
104
- let t = A.current[e];
104
+ let t = j.current[e];
105
105
  t && typeof t.scrollIntoView == "function" && t.scrollIntoView({ block: "nearest" });
106
106
  }, J = (e) => {
107
107
  if (W.length === 0) return;
108
108
  let t = W[(W.indexOf(G) + e + W.length) % W.length];
109
109
  t !== void 0 && q(t);
110
110
  }, Y = (e) => {
111
- e.onSelect(), v(!1);
111
+ e.onSelect(), y(!1);
112
112
  }, X = (e, t) => {
113
113
  if (!(!e || e.disabled)) {
114
114
  if (e.page) {
@@ -123,23 +123,23 @@ function v({ open: m, onOpenChange: v, groups: ne, placeholder: re, emptyLabel:
123
123
  n && Y(n);
124
124
  return;
125
125
  }
126
- t !== "secondary" && (e.onSelect?.(), v(!1));
126
+ t !== "secondary" && (e.onSelect?.(), y(!1));
127
127
  }
128
- }, oe = (e) => {
129
- if (C.length === 0) return;
130
- let t = [null, ...C.map((e) => e.id)], n = t[(t.indexOf(R.value) + e + t.length) % t.length];
128
+ }, se = (e) => {
129
+ if (w.length === 0) return;
130
+ let t = [null, ...w.map((e) => e.id)], n = t[(t.indexOf(R.value) + e + t.length) % t.length];
131
131
  r(() => {
132
132
  R.value = n ?? null, I.value = 0;
133
133
  });
134
134
  }, Z = () => {
135
135
  r(() => {
136
136
  R.value = null, I.value = 0;
137
- }), k.current?.focus();
137
+ }), a(A.current);
138
138
  }, Q = () => {
139
139
  r(() => {
140
140
  L.value = L.value.slice(0, -1), F.value = "", I.value = 0;
141
141
  });
142
- }, se = (e) => {
142
+ }, ce = (e) => {
143
143
  switch (e.key) {
144
144
  case "ArrowDown":
145
145
  e.preventDefault(), J(1);
@@ -148,7 +148,7 @@ function v({ open: m, onOpenChange: v, groups: ne, placeholder: re, emptyLabel:
148
148
  e.preventDefault(), J(-1);
149
149
  break;
150
150
  case "Tab":
151
- C.length > 0 && (e.preventDefault(), oe(e.shiftKey ? -1 : 1));
151
+ w.length > 0 && (e.preventDefault(), se(e.shiftKey ? -1 : 1));
152
152
  break;
153
153
  case "Home":
154
154
  e.preventDefault(), W[0] !== void 0 && q(W[0]);
@@ -166,24 +166,24 @@ function v({ open: m, onOpenChange: v, groups: ne, placeholder: re, emptyLabel:
166
166
  F.value === "" && (L.value.length > 0 ? (e.preventDefault(), Q()) : R.value && (e.preventDefault(), Z()));
167
167
  break;
168
168
  }
169
- }, ce = (e) => {
170
- e.key === "Escape" && (e.preventDefault(), L.value.length > 0 ? Q() : O.current?.close());
171
169
  }, le = (e) => {
172
- e.target === O.current && O.current?.close();
170
+ e.key === "Escape" && (e.preventDefault(), L.value.length > 0 ? Q() : k.current?.close());
171
+ }, ue = (e) => {
172
+ e.target === k.current && k.current?.close();
173
173
  }, $ = -1;
174
- return /* @__PURE__ */ u("dialog", {
175
- ref: O,
176
- "aria-label": w,
174
+ return /* @__PURE__ */ f("dialog", {
175
+ ref: k,
176
+ "aria-label": T,
177
177
  className: i(n.dialog, ae),
178
- onClick: le,
179
- onKeyDown: ce,
180
- children: /* @__PURE__ */ d("div", {
178
+ onClick: ue,
179
+ onKeyDown: le,
180
+ children: /* @__PURE__ */ p("div", {
181
181
  className: n.panel,
182
182
  children: [
183
- /* @__PURE__ */ d("div", {
183
+ /* @__PURE__ */ p("div", {
184
184
  className: n.search,
185
185
  children: [
186
- /* @__PURE__ */ d("svg", {
186
+ /* @__PURE__ */ p("svg", {
187
187
  className: n.searchIcon,
188
188
  "aria-hidden": "true",
189
189
  viewBox: "0 0 16 16",
@@ -193,30 +193,30 @@ function v({ open: m, onOpenChange: v, groups: ne, placeholder: re, emptyLabel:
193
193
  stroke: "currentColor",
194
194
  strokeWidth: "1.5",
195
195
  strokeLinecap: "round",
196
- children: [/* @__PURE__ */ u("circle", {
196
+ children: [/* @__PURE__ */ f("circle", {
197
197
  cx: "7",
198
198
  cy: "7",
199
199
  r: "4.5"
200
- }), /* @__PURE__ */ u("line", {
200
+ }), /* @__PURE__ */ f("line", {
201
201
  x1: "10.5",
202
202
  y1: "10.5",
203
203
  x2: "14",
204
204
  y2: "14"
205
205
  })]
206
206
  }),
207
- V && /* @__PURE__ */ d("span", {
207
+ V && /* @__PURE__ */ p("span", {
208
208
  className: n.scopeChip,
209
- children: [V.label, /* @__PURE__ */ u("button", {
209
+ children: [V.label, /* @__PURE__ */ f("button", {
210
210
  type: "button",
211
211
  className: n.scopeClear,
212
- "aria-label": l(c.commandMenu.clearScope),
212
+ "aria-label": d(u.commandMenu.clearScope),
213
213
  onClick: Z,
214
- children: /* @__PURE__ */ u("svg", {
214
+ children: /* @__PURE__ */ f("svg", {
215
215
  viewBox: "0 0 16 16",
216
216
  width: "12",
217
217
  height: "12",
218
218
  "aria-hidden": "true",
219
- children: /* @__PURE__ */ u("path", {
219
+ children: /* @__PURE__ */ f("path", {
220
220
  d: "M4 4l8 8M12 4l-8 8",
221
221
  fill: "none",
222
222
  stroke: "currentColor",
@@ -226,15 +226,15 @@ function v({ open: m, onOpenChange: v, groups: ne, placeholder: re, emptyLabel:
226
226
  })
227
227
  })]
228
228
  }),
229
- /* @__PURE__ */ u("input", {
230
- ref: k,
229
+ /* @__PURE__ */ f("input", {
230
+ ref: A,
231
231
  type: "text",
232
232
  role: "combobox",
233
233
  "aria-expanded": "true",
234
- "aria-controls": D,
234
+ "aria-controls": O,
235
235
  "aria-activedescendant": G >= 0 ? K(G) : void 0,
236
236
  "aria-autocomplete": "list",
237
- "aria-label": w,
237
+ "aria-label": T,
238
238
  autoComplete: "off",
239
239
  spellCheck: !1,
240
240
  className: n.input,
@@ -242,61 +242,61 @@ function v({ open: m, onOpenChange: v, groups: ne, placeholder: re, emptyLabel:
242
242
  value: F.value,
243
243
  onChange: (e) => {
244
244
  let t = e.target.value;
245
- if (!R.value && C.length > 0) {
246
- let e = _(t, C);
245
+ if (!R.value && w.length > 0) {
246
+ let e = v(t, w);
247
247
  e && (R.value = e.scope.id, t = e.rest);
248
248
  }
249
- F.value = t, I.value = 0, M.current?.(t);
249
+ F.value = t, I.value = 0, N.current?.(t);
250
250
  },
251
- onKeyDown: se
251
+ onKeyDown: ce
252
252
  })
253
253
  ]
254
254
  }),
255
- C.length > 0 && /* @__PURE__ */ d("div", {
255
+ w.length > 0 && /* @__PURE__ */ p("div", {
256
256
  className: n.scopes,
257
- children: [/* @__PURE__ */ u("span", {
257
+ children: [/* @__PURE__ */ f("span", {
258
258
  className: n.scopesLabel,
259
- children: l(c.commandMenu.scopeLabel)
260
- }), C.map((e) => /* @__PURE__ */ d("button", {
259
+ children: d(u.commandMenu.scopeLabel)
260
+ }), w.map((e) => /* @__PURE__ */ p("button", {
261
261
  type: "button",
262
262
  className: n.scopePill,
263
263
  "data-active": e.id === R.value || void 0,
264
264
  onClick: () => {
265
265
  r(() => {
266
266
  R.value = R.value === e.id ? null : e.id, I.value = 0;
267
- }), k.current?.focus();
267
+ }), a(A.current);
268
268
  },
269
- children: [e.prefix && /* @__PURE__ */ u("span", {
269
+ children: [e.prefix && /* @__PURE__ */ f("span", {
270
270
  className: n.scopePrefix,
271
271
  children: e.prefix
272
272
  }), e.label]
273
273
  }, e.id))]
274
274
  }),
275
- /* @__PURE__ */ d("div", {
275
+ /* @__PURE__ */ p("div", {
276
276
  className: n.list,
277
- children: [/* @__PURE__ */ u("div", {
277
+ children: [/* @__PURE__ */ f("div", {
278
278
  role: "listbox",
279
- id: D,
280
- "aria-label": b,
279
+ id: O,
280
+ "aria-label": x,
281
281
  tabIndex: 0,
282
- children: H.map((e, r) => /* @__PURE__ */ d("div", {
282
+ children: H.map((e, r) => /* @__PURE__ */ p("div", {
283
283
  role: "group",
284
284
  "aria-label": e.heading,
285
285
  className: n.group,
286
- children: [e.heading && /* @__PURE__ */ d("div", {
286
+ children: [e.heading && /* @__PURE__ */ p("div", {
287
287
  className: n.heading,
288
288
  "aria-hidden": "true",
289
- children: [/* @__PURE__ */ u("span", { children: e.heading }), F.value !== "" && /* @__PURE__ */ u("span", {
289
+ children: [/* @__PURE__ */ f("span", { children: e.heading }), F.value !== "" && /* @__PURE__ */ f("span", {
290
290
  className: n.count,
291
- children: l(c.commandMenu.matches, { count: e.items.length })
291
+ children: d(u.commandMenu.matches, { count: e.items.length })
292
292
  })]
293
293
  }), e.items.map((e) => {
294
294
  let { item: r, indices: i } = e;
295
295
  $++;
296
296
  let a = $;
297
- return /* @__PURE__ */ d("div", {
297
+ return /* @__PURE__ */ p("div", {
298
298
  ref: (e) => {
299
- A.current[a] = e;
299
+ j.current[a] = e;
300
300
  },
301
301
  id: K(a),
302
302
  role: "option",
@@ -310,50 +310,50 @@ function v({ open: m, onOpenChange: v, groups: ne, placeholder: re, emptyLabel:
310
310
  },
311
311
  onClick: () => X(r, "primary"),
312
312
  children: [
313
- r.icon && /* @__PURE__ */ u("span", {
313
+ r.icon && /* @__PURE__ */ f("span", {
314
314
  className: n.icon,
315
315
  "aria-hidden": "true",
316
316
  children: r.icon
317
317
  }),
318
- /* @__PURE__ */ d("span", {
318
+ /* @__PURE__ */ p("span", {
319
319
  className: n.text,
320
- children: [/* @__PURE__ */ u("span", {
320
+ children: [/* @__PURE__ */ f("span", {
321
321
  className: n.label,
322
- children: g(r.label, i)
323
- }), r.description && /* @__PURE__ */ u("span", {
322
+ children: _(r.label, i)
323
+ }), r.description && /* @__PURE__ */ f("span", {
324
324
  className: n.description,
325
325
  children: r.description
326
326
  })]
327
327
  }),
328
- r.status && /* @__PURE__ */ d("span", {
328
+ r.status && /* @__PURE__ */ p("span", {
329
329
  className: n.status,
330
330
  "data-tone": r.status.tone ?? "neutral",
331
- children: [/* @__PURE__ */ u("span", {
331
+ children: [/* @__PURE__ */ f("span", {
332
332
  className: n.statusDot,
333
333
  "aria-hidden": "true"
334
334
  }), r.status.label]
335
335
  }),
336
- r.actions && r.actions.length > 0 && /* @__PURE__ */ u("span", {
336
+ r.actions && r.actions.length > 0 && /* @__PURE__ */ f("span", {
337
337
  className: n.actions,
338
- children: r.actions.map((e) => /* @__PURE__ */ d("span", {
338
+ children: r.actions.map((e) => /* @__PURE__ */ p("span", {
339
339
  className: n.action,
340
340
  onClick: (t) => {
341
341
  t.stopPropagation(), Y(e);
342
342
  },
343
- children: [e.label, e.shortcut && /* @__PURE__ */ u("span", {
343
+ children: [e.label, e.shortcut && /* @__PURE__ */ f("span", {
344
344
  className: n.actionKeys,
345
345
  "aria-hidden": "true",
346
- children: e.shortcut.map((e, n) => /* @__PURE__ */ u(t, {
346
+ children: e.shortcut.map((e, n) => /* @__PURE__ */ f(t, {
347
347
  size: "sm",
348
348
  children: e
349
349
  }, n))
350
350
  })]
351
351
  }, e.id))
352
352
  }),
353
- r.shortcut && /* @__PURE__ */ u("span", {
353
+ r.shortcut && /* @__PURE__ */ f("span", {
354
354
  className: n.shortcut,
355
355
  "aria-hidden": "true",
356
- children: r.shortcut.map((e, n) => /* @__PURE__ */ u(t, {
356
+ children: r.shortcut.map((e, n) => /* @__PURE__ */ f(t, {
357
357
  size: "sm",
358
358
  children: e
359
359
  }, n))
@@ -362,51 +362,51 @@ function v({ open: m, onOpenChange: v, groups: ne, placeholder: re, emptyLabel:
362
362
  }, r.id);
363
363
  })]
364
364
  }, e.heading ?? `group-${r}`))
365
- }), U.length === 0 && (x ? /* @__PURE__ */ d("div", {
365
+ }), U.length === 0 && (S ? /* @__PURE__ */ p("div", {
366
366
  role: "status",
367
367
  className: n.empty,
368
- children: [/* @__PURE__ */ u(e, { size: "sm" }), l(c.commandMenu.loading)]
369
- }) : /* @__PURE__ */ u("div", {
368
+ children: [/* @__PURE__ */ f(e, { size: "sm" }), d(u.commandMenu.loading)]
369
+ }) : /* @__PURE__ */ f("div", {
370
370
  role: "status",
371
371
  className: n.empty,
372
- children: T
372
+ children: E
373
373
  }))]
374
374
  }),
375
- /* @__PURE__ */ d("div", {
375
+ /* @__PURE__ */ p("div", {
376
376
  className: n.footer,
377
377
  "aria-hidden": "true",
378
378
  children: [
379
- /* @__PURE__ */ d("span", {
379
+ /* @__PURE__ */ p("span", {
380
380
  className: n.hint,
381
381
  children: [
382
- /* @__PURE__ */ u(t, {
382
+ /* @__PURE__ */ f(t, {
383
383
  size: "sm",
384
384
  children: "↑"
385
385
  }),
386
- /* @__PURE__ */ u(t, {
386
+ /* @__PURE__ */ f(t, {
387
387
  size: "sm",
388
388
  children: "↓"
389
389
  }),
390
390
  " navigate"
391
391
  ]
392
392
  }),
393
- /* @__PURE__ */ d("span", {
393
+ /* @__PURE__ */ p("span", {
394
394
  className: n.hint,
395
- children: [/* @__PURE__ */ u(t, {
395
+ children: [/* @__PURE__ */ f(t, {
396
396
  size: "sm",
397
397
  children: "↵"
398
398
  }), " open"]
399
399
  }),
400
- C.length > 0 && /* @__PURE__ */ d("span", {
400
+ w.length > 0 && /* @__PURE__ */ p("span", {
401
401
  className: n.hint,
402
- children: [/* @__PURE__ */ u(t, {
402
+ children: [/* @__PURE__ */ f(t, {
403
403
  size: "sm",
404
404
  children: "Tab"
405
405
  }), " scope"]
406
406
  }),
407
- /* @__PURE__ */ d("span", {
407
+ /* @__PURE__ */ p("span", {
408
408
  className: n.hint,
409
- children: [/* @__PURE__ */ u(t, {
409
+ children: [/* @__PURE__ */ f(t, {
410
410
  size: "sm",
411
411
  children: "esc"
412
412
  }), " close"]
@@ -418,4 +418,4 @@ function v({ open: m, onOpenChange: v, groups: ne, placeholder: re, emptyLabel:
418
418
  });
419
419
  }
420
420
  //#endregion
421
- export { v as CommandMenu, p as fuzzyMatch, m as fuzzyScore };
421
+ export { y as CommandMenu, m as fuzzyMatch, h as fuzzyScore };
@@ -2,14 +2,14 @@
2
2
 
3
3
  import e from "./comparison.module.js";
4
4
  import { cn as t, useControllableSignal 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";
5
+ import { useRef as a } from "react";
6
+ import { builtin as o, t as s } from "@cascivo/i18n";
7
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
8
  //#region ../components/src/comparison/comparison.tsx
9
9
  var u = (e) => Math.min(100, Math.max(0, e));
10
10
  function d({ after: d, before: f, position: p, defaultPosition: m = 50, onPositionChange: h, orientation: g = "horizontal", keyboardStep: _ = 5, label: v, className: y, ...b }) {
11
11
  i();
12
- let x = l(null), S = r(!1), [C, w] = n({
12
+ let x = a(null), S = r(!1), [C, w] = n({
13
13
  value: p,
14
14
  defaultValue: m,
15
15
  onChange: h
@@ -22,7 +22,7 @@ function d({ after: d, before: f, position: p, defaultPosition: m = 50, onPositi
22
22
  let t = g === "vertical" ? "ArrowUp" : "ArrowLeft", n = g === "vertical" ? "ArrowDown" : "ArrowRight", r = null;
23
23
  e.key === t || e.key === "ArrowLeft" || e.key === "ArrowUp" ? r = T - _ : e.key === n || e.key === "ArrowRight" || e.key === "ArrowDown" ? r = T + _ : e.key === "Home" ? r = 0 : e.key === "End" ? r = 100 : e.key === "PageUp" ? r = T + _ * 2 : e.key === "PageDown" && (r = T - _ * 2), r !== null && (e.preventDefault(), w(u(r)));
24
24
  };
25
- return /* @__PURE__ */ c("div", {
25
+ return /* @__PURE__ */ l("div", {
26
26
  ref: x,
27
27
  "data-orientation": g,
28
28
  "data-dragging": S.value || void 0,
@@ -39,21 +39,21 @@ function d({ after: d, before: f, position: p, defaultPosition: m = 50, onPositi
39
39
  },
40
40
  ...b,
41
41
  children: [
42
- /* @__PURE__ */ s("div", {
42
+ /* @__PURE__ */ c("div", {
43
43
  className: e.item,
44
44
  children: d
45
45
  }),
46
- /* @__PURE__ */ s("div", {
46
+ /* @__PURE__ */ c("div", {
47
47
  className: e.before,
48
48
  "aria-hidden": "true",
49
49
  children: f
50
50
  }),
51
- /* @__PURE__ */ s("div", {
51
+ /* @__PURE__ */ c("div", {
52
52
  className: e.divider,
53
- children: /* @__PURE__ */ s("div", {
53
+ children: /* @__PURE__ */ c("div", {
54
54
  role: "slider",
55
55
  tabIndex: 0,
56
- "aria-label": v ?? o(a.comparison.label),
56
+ "aria-label": v ?? s(o.comparison.label),
57
57
  "aria-orientation": g,
58
58
  "aria-valuemin": 0,
59
59
  "aria-valuemax": 100,
@@ -2,12 +2,12 @@
2
2
 
3
3
  import e from "./context-menu.module.js";
4
4
  import { useSignal as t, useSignalEffect as n, useSignals as r } from "@cascivo/core";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
- import { useRef as o } from "react";
5
+ import { useRef as i } from "react";
6
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
7
  //#region ../components/src/context-menu/context-menu.tsx
8
8
  function s({ children: s }) {
9
9
  r();
10
- let c = o(null), l = o(null), u = t(!1), d = () => {
10
+ let c = i(null), l = i(null), u = t(!1), d = () => {
11
11
  let e = c.current;
12
12
  return e ? Array.from(e.querySelectorAll("[role=\"menuitem\"]:not([aria-disabled=\"true\"])")) : [];
13
13
  }, f = (e) => {
@@ -53,11 +53,11 @@ function s({ children: s }) {
53
53
  t && (t.style.setProperty("--cascivo-context-x", `${e.clientX}px`), t.style.setProperty("--cascivo-context-y", `${e.clientY}px`), u.value = !0);
54
54
  }
55
55
  let [h, ...g] = Array.isArray(s) ? s : [s];
56
- return /* @__PURE__ */ a("div", {
56
+ return /* @__PURE__ */ o("div", {
57
57
  ref: l,
58
58
  onContextMenu: m,
59
59
  className: e.wrapper,
60
- children: [h, /* @__PURE__ */ i("div", {
60
+ children: [h, /* @__PURE__ */ a("div", {
61
61
  ref: c,
62
62
  popover: "auto",
63
63
  role: "menu",
@@ -69,17 +69,17 @@ function s({ children: s }) {
69
69
  });
70
70
  }
71
71
  function c({ children: t, onSelect: n, disabled: r }) {
72
- function a() {
72
+ function i() {
73
73
  r || n();
74
74
  }
75
75
  function o(e) {
76
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a());
76
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i());
77
77
  }
78
- return /* @__PURE__ */ i("div", {
78
+ return /* @__PURE__ */ a("div", {
79
79
  role: "menuitem",
80
80
  tabIndex: r ? -1 : 0,
81
81
  "aria-disabled": r,
82
- onClick: a,
82
+ onClick: i,
83
83
  onKeyDown: o,
84
84
  className: e.item,
85
85
  children: t
@@ -2,29 +2,31 @@
2
2
 
3
3
  import e from "./copy-button.module.js";
4
4
  import { cn as t, useSignal as n, useSignals as r } from "@cascivo/core";
5
- import { builtin as i, t as a } from "@cascivo/i18n";
6
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
5
+ import { forwardRef as i } from "react";
6
+ import { builtin as a, t as o } from "@cascivo/i18n";
7
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
8
  //#region ../components/src/copy-button/copy-button.tsx
8
- function c({ value: c, size: l = "md", labels: u, className: d, ...f }) {
9
+ var l = i(function({ value: i, size: l = "md", labels: u, className: d, ...f }, p) {
9
10
  r();
10
- let p = n(!1), m = u?.copy ?? a(i.copyButton.copy), h = u?.copied ?? a(i.copyButton.copied);
11
- return /* @__PURE__ */ o("button", {
11
+ let m = n(!1), h = u?.copy ?? o(a.copyButton.copy), g = u?.copied ?? o(a.copyButton.copied);
12
+ return /* @__PURE__ */ s("button", {
12
13
  type: "button",
13
- "aria-label": p.value ? h : m,
14
- "data-state": p.value ? "copied" : "idle",
14
+ "aria-label": m.value ? g : h,
15
+ "data-state": m.value ? "copied" : "idle",
15
16
  "data-size": l,
16
17
  className: t(e.copyButton, d),
17
18
  onClick: () => {
18
- navigator.clipboard.writeText(c), p.value = !0, setTimeout(() => {
19
- p.value = !1;
19
+ navigator.clipboard.writeText(i), m.value = !0, setTimeout(() => {
20
+ m.value = !1;
20
21
  }, 2e3);
21
22
  },
23
+ ref: p,
22
24
  ...f,
23
- children: p.value ? /* @__PURE__ */ o("svg", {
25
+ children: m.value ? /* @__PURE__ */ s("svg", {
24
26
  "aria-hidden": "true",
25
27
  viewBox: "0 0 16 16",
26
28
  className: e.icon,
27
- children: /* @__PURE__ */ o("path", {
29
+ children: /* @__PURE__ */ s("path", {
28
30
  d: "M13.5 4.5 6 12 2.5 8.5",
29
31
  fill: "none",
30
32
  stroke: "currentColor",
@@ -32,11 +34,11 @@ function c({ value: c, size: l = "md", labels: u, className: d, ...f }) {
32
34
  strokeLinecap: "round",
33
35
  strokeLinejoin: "round"
34
36
  })
35
- }) : /* @__PURE__ */ s("svg", {
37
+ }) : /* @__PURE__ */ c("svg", {
36
38
  "aria-hidden": "true",
37
39
  viewBox: "0 0 16 16",
38
40
  className: e.icon,
39
- children: [/* @__PURE__ */ o("rect", {
41
+ children: [/* @__PURE__ */ s("rect", {
40
42
  x: "5.5",
41
43
  y: "5.5",
42
44
  width: "8",
@@ -45,7 +47,7 @@ function c({ value: c, size: l = "md", labels: u, className: d, ...f }) {
45
47
  fill: "none",
46
48
  stroke: "currentColor",
47
49
  strokeWidth: "1.5"
48
- }), /* @__PURE__ */ o("path", {
50
+ }), /* @__PURE__ */ s("path", {
49
51
  d: "M3.5 10.5h-1a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v1",
50
52
  fill: "none",
51
53
  stroke: "currentColor",
@@ -53,6 +55,6 @@ function c({ value: c, size: l = "md", labels: u, className: d, ...f }) {
53
55
  })]
54
56
  })
55
57
  });
56
- }
58
+ });
57
59
  //#endregion
58
- export { c as CopyButton };
60
+ export { l as CopyButton };