@cascivo/react 0.8.0 → 0.10.0

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 (287) hide show
  1. package/README.md +24 -11
  2. package/dist/combobox/combobox.js +73 -73
  3. package/dist/command-menu/command-menu.js +2 -2
  4. package/dist/date-picker/date-picker.js +95 -95
  5. package/dist/field/field.js +24 -15
  6. package/dist/filter/filter.js +12 -12
  7. package/dist/index.d.ts +74 -8
  8. package/dist/index.js +2 -0
  9. package/dist/node/accordion/accordion.js +95 -0
  10. package/dist/node/accordion/accordion.module.js +13 -0
  11. package/dist/node/action-sheet/action-sheet.js +91 -0
  12. package/dist/node/action-sheet/action-sheet.module.js +14 -0
  13. package/dist/node/alert/alert.js +55 -0
  14. package/dist/node/alert/alert.module.js +13 -0
  15. package/dist/node/alert-dialog/alert-dialog.js +68 -0
  16. package/dist/node/alert-dialog/alert-dialog.module.js +13 -0
  17. package/dist/node/app-shell/app-shell.js +80 -0
  18. package/dist/node/app-shell/app-shell.module.js +14 -0
  19. package/dist/node/aspect-ratio/aspect-ratio.js +22 -0
  20. package/dist/node/aspect-ratio/aspect-ratio.module.js +8 -0
  21. package/dist/node/avatar/avatar.js +57 -0
  22. package/dist/node/avatar/avatar.module.js +10 -0
  23. package/dist/node/avatar-group/avatar-group.js +26 -0
  24. package/dist/node/avatar-group/avatar-group.module.js +8 -0
  25. package/dist/node/badge/badge.js +17 -0
  26. package/dist/node/badge/badge.module.js +5 -0
  27. package/dist/node/blockquote/blockquote.js +18 -0
  28. package/dist/node/blockquote/blockquote.module.js +8 -0
  29. package/dist/node/bottom-sheet/bottom-sheet.js +111 -0
  30. package/dist/node/bottom-sheet/bottom-sheet.module.js +16 -0
  31. package/dist/node/breadcrumb/breadcrumb.js +28 -0
  32. package/dist/node/breadcrumb/breadcrumb.module.js +5 -0
  33. package/dist/node/button/button.js +31 -0
  34. package/dist/node/button/button.module.js +5 -0
  35. package/dist/node/button-group/button-group.js +39 -0
  36. package/dist/node/button-group/button-group.module.js +5 -0
  37. package/dist/node/calendar/calendar.js +195 -0
  38. package/dist/node/calendar/calendar.module.js +16 -0
  39. package/dist/node/card/card.js +45 -0
  40. package/dist/node/card/card.module.js +11 -0
  41. package/dist/node/carousel/carousel.js +138 -0
  42. package/dist/node/carousel/carousel.module.js +15 -0
  43. package/dist/node/chat-bubble/chat-bubble.js +33 -0
  44. package/dist/node/chat-bubble/chat-bubble.module.js +13 -0
  45. package/dist/node/checkbox/checkbox.js +38 -0
  46. package/dist/node/checkbox/checkbox.module.js +10 -0
  47. package/dist/node/checkbox-card/checkbox-card.js +48 -0
  48. package/dist/node/checkbox-card/checkbox-card.module.js +13 -0
  49. package/dist/node/code/code.js +16 -0
  50. package/dist/node/code/code.module.js +5 -0
  51. package/dist/node/code-snippet/code-snippet.js +116 -0
  52. package/dist/node/code-snippet/code-snippet.module.js +19 -0
  53. package/dist/node/code-snippet/highlight.js +69 -0
  54. package/dist/node/collapsible/collapsible.js +42 -0
  55. package/dist/node/collapsible/collapsible.module.js +10 -0
  56. package/dist/node/color-picker/color-picker.js +268 -0
  57. package/dist/node/color-picker/color-picker.module.js +20 -0
  58. package/dist/node/combobox/combobox.js +164 -0
  59. package/dist/node/combobox/combobox.module.js +21 -0
  60. package/dist/node/command-menu/command-menu.js +425 -0
  61. package/dist/node/command-menu/command-menu.module.js +36 -0
  62. package/dist/node/comparison/comparison.js +69 -0
  63. package/dist/node/comparison/comparison.module.js +11 -0
  64. package/dist/node/contained-list/contained-list.js +41 -0
  65. package/dist/node/contained-list/contained-list.module.js +13 -0
  66. package/dist/node/context-menu/context-menu.js +89 -0
  67. package/dist/node/context-menu/context-menu.module.js +9 -0
  68. package/dist/node/copy-button/copy-button.js +58 -0
  69. package/dist/node/copy-button/copy-button.module.js +8 -0
  70. package/dist/node/data-list/data-list.js +27 -0
  71. package/dist/node/data-list/data-list.module.js +10 -0
  72. package/dist/node/data-table/data-table.js +370 -0
  73. package/dist/node/data-table/data-table.module.js +35 -0
  74. package/dist/node/date-picker/date-picker.js +218 -0
  75. package/dist/node/date-picker/date-picker.module.js +25 -0
  76. package/dist/node/date-range-picker/date-range-picker.js +196 -0
  77. package/dist/node/date-range-picker/date-range-picker.module.js +20 -0
  78. package/dist/node/dock/dock.js +34 -0
  79. package/dist/node/dock/dock.module.js +10 -0
  80. package/dist/node/drawer/drawer.js +95 -0
  81. package/dist/node/drawer/drawer.module.js +15 -0
  82. package/dist/node/dropdown/dropdown.js +109 -0
  83. package/dist/node/dropdown/dropdown.module.js +11 -0
  84. package/dist/node/editable/editable.js +67 -0
  85. package/dist/node/editable/editable.module.js +13 -0
  86. package/dist/node/empty-state/empty-state.js +34 -0
  87. package/dist/node/empty-state/empty-state.module.js +11 -0
  88. package/dist/node/fab/fab.js +93 -0
  89. package/dist/node/fab/fab.module.js +14 -0
  90. package/dist/node/field/field.js +48 -0
  91. package/dist/node/field/field.module.js +9 -0
  92. package/dist/node/file-uploader/file-uploader.js +122 -0
  93. package/dist/node/file-uploader/file-uploader.module.js +20 -0
  94. package/dist/node/filter/filter.js +34 -0
  95. package/dist/node/filter/filter.module.js +8 -0
  96. package/dist/node/form/form.js +95 -0
  97. package/dist/node/form/form.module.js +5 -0
  98. package/dist/node/header/header.js +44 -0
  99. package/dist/node/header/header.module.js +13 -0
  100. package/dist/node/header-panel/header-panel.js +74 -0
  101. package/dist/node/header-panel/header-panel.module.js +11 -0
  102. package/dist/node/heading/heading.js +24 -0
  103. package/dist/node/heading/heading.module.js +5 -0
  104. package/dist/node/hover-card/hover-card.js +84 -0
  105. package/dist/node/hover-card/hover-card.module.js +8 -0
  106. package/dist/node/icon-button/icon-button.js +21 -0
  107. package/dist/node/icon-button/icon-button.module.js +5 -0
  108. package/dist/node/image/image.js +64 -0
  109. package/dist/node/image/image.module.js +11 -0
  110. package/dist/node/index.js +2 -0
  111. package/dist/node/indicator/indicator.js +18 -0
  112. package/dist/node/indicator/indicator.module.js +8 -0
  113. package/dist/node/inline-loading/inline-loading.js +76 -0
  114. package/dist/node/inline-loading/inline-loading.module.js +11 -0
  115. package/dist/node/input/input.js +54 -0
  116. package/dist/node/input/input.module.js +11 -0
  117. package/dist/node/input-group/input-group.js +41 -0
  118. package/dist/node/input-group/input-group.module.js +11 -0
  119. package/dist/node/item/item.js +52 -0
  120. package/dist/node/item/item.module.js +12 -0
  121. package/dist/node/join/join.js +14 -0
  122. package/dist/node/join/join.module.js +5 -0
  123. package/dist/node/kbd/kbd.js +16 -0
  124. package/dist/node/kbd/kbd.module.js +5 -0
  125. package/dist/node/label/label.js +25 -0
  126. package/dist/node/label/label.module.js +9 -0
  127. package/dist/node/layouts/src/auto-grid/auto-grid.js +19 -0
  128. package/dist/node/layouts/src/auto-grid/auto-grid.module.js +6 -0
  129. package/dist/node/layouts/src/center/center.js +18 -0
  130. package/dist/node/layouts/src/center/center.module.js +5 -0
  131. package/dist/node/layouts/src/columns/columns.js +23 -0
  132. package/dist/node/layouts/src/columns/columns.module.js +8 -0
  133. package/dist/node/layouts/src/flex/flex.js +22 -0
  134. package/dist/node/layouts/src/flex/flex.module.js +5 -0
  135. package/dist/node/layouts/src/grid/grid.js +57 -0
  136. package/dist/node/layouts/src/grid/grid.module.js +9 -0
  137. package/dist/node/layouts/src/spacer/spacer.js +19 -0
  138. package/dist/node/layouts/src/spacer/spacer.module.js +5 -0
  139. package/dist/node/link/link.js +22 -0
  140. package/dist/node/link/link.module.js +5 -0
  141. package/dist/node/list/list.js +23 -0
  142. package/dist/node/list/list.module.js +8 -0
  143. package/dist/node/log-viewer/log-viewer.js +184 -0
  144. package/dist/node/log-viewer/log-viewer.module.js +18 -0
  145. package/dist/node/menu/menu.js +121 -0
  146. package/dist/node/menu/menu.module.js +10 -0
  147. package/dist/node/menu-button/menu-button.js +92 -0
  148. package/dist/node/menu-button/menu-button.module.js +10 -0
  149. package/dist/node/menubar/menubar.js +103 -0
  150. package/dist/node/menubar/menubar.module.js +10 -0
  151. package/dist/node/modal/modal.js +70 -0
  152. package/dist/node/modal/modal.module.js +13 -0
  153. package/dist/node/multi-select/multi-select.js +106 -0
  154. package/dist/node/multi-select/multi-select.module.js +17 -0
  155. package/dist/node/native-select/native-select.js +37 -0
  156. package/dist/node/native-select/native-select.module.js +9 -0
  157. package/dist/node/navigation-menu/navigation-menu.js +99 -0
  158. package/dist/node/navigation-menu/navigation-menu.module.js +12 -0
  159. package/dist/node/notification/notification.js +134 -0
  160. package/dist/node/notification/notification.module.js +13 -0
  161. package/dist/node/number-input/number-input.js +145 -0
  162. package/dist/node/number-input/number-input.module.js +14 -0
  163. package/dist/node/otp-input/otp-input.js +70 -0
  164. package/dist/node/otp-input/otp-input.module.js +8 -0
  165. package/dist/node/overflow-menu/overflow-menu.js +65 -0
  166. package/dist/node/overflow-menu/overflow-menu.module.js +9 -0
  167. package/dist/node/pagination/pagination.js +92 -0
  168. package/dist/node/pagination/pagination.module.js +13 -0
  169. package/dist/node/password-input/password-input.js +80 -0
  170. package/dist/node/password-input/password-input.module.js +13 -0
  171. package/dist/node/popover/popover.js +49 -0
  172. package/dist/node/popover/popover.module.js +8 -0
  173. package/dist/node/popover/use-popover.js +57 -0
  174. package/dist/node/progress/progress.js +17 -0
  175. package/dist/node/progress/progress.module.js +8 -0
  176. package/dist/node/progress-bar/progress-bar.js +44 -0
  177. package/dist/node/progress-bar/progress-bar.module.js +13 -0
  178. package/dist/node/progress-circle/progress-circle.js +48 -0
  179. package/dist/node/progress-circle/progress-circle.module.js +11 -0
  180. package/dist/node/progress-indicator/progress-indicator.js +36 -0
  181. package/dist/node/progress-indicator/progress-indicator.module.js +12 -0
  182. package/dist/node/prose/prose.js +15 -0
  183. package/dist/node/prose/prose.module.js +5 -0
  184. package/dist/node/pull-to-refresh/pull-to-refresh.js +82 -0
  185. package/dist/node/pull-to-refresh/pull-to-refresh.module.js +11 -0
  186. package/dist/node/qr-code/encode.js +585 -0
  187. package/dist/node/qr-code/qr-code.js +41 -0
  188. package/dist/node/qr-code/qr-code.module.js +8 -0
  189. package/dist/node/radial-progress/radial-progress.js +28 -0
  190. package/dist/node/radial-progress/radial-progress.module.js +8 -0
  191. package/dist/node/radio/radio.js +49 -0
  192. package/dist/node/radio/radio.module.js +11 -0
  193. package/dist/node/radio-card/radio-card.js +63 -0
  194. package/dist/node/radio-card/radio-card.module.js +13 -0
  195. package/dist/node/rating-group/rating-group.js +37 -0
  196. package/dist/node/rating-group/rating-group.module.js +8 -0
  197. package/dist/node/react/src/index.js +138 -0
  198. package/dist/node/react/src/theme.js +54 -0
  199. package/dist/node/relative-time/relative-time.js +66 -0
  200. package/dist/node/relative-time/relative-time.module.js +5 -0
  201. package/dist/node/resizable/resizable.js +80 -0
  202. package/dist/node/resizable/resizable.module.js +10 -0
  203. package/dist/node/scroll-area/scroll-area.js +38 -0
  204. package/dist/node/scroll-area/scroll-area.module.js +5 -0
  205. package/dist/node/search/search.js +94 -0
  206. package/dist/node/search/search.module.js +11 -0
  207. package/dist/node/segmented-control/segmented-control.js +43 -0
  208. package/dist/node/segmented-control/segmented-control.module.js +8 -0
  209. package/dist/node/select/select.js +71 -0
  210. package/dist/node/select/select.module.js +13 -0
  211. package/dist/node/separator/separator.js +21 -0
  212. package/dist/node/separator/separator.module.js +5 -0
  213. package/dist/node/sheet/sheet.js +50 -0
  214. package/dist/node/sheet/sheet.module.js +11 -0
  215. package/dist/node/shell-header/shell-header.js +166 -0
  216. package/dist/node/shell-header/shell-header.module.js +25 -0
  217. package/dist/node/side-nav/side-nav.js +333 -0
  218. package/dist/node/side-nav/side-nav.module.js +33 -0
  219. package/dist/node/skeleton/skeleton.js +25 -0
  220. package/dist/node/skeleton/skeleton.module.js +9 -0
  221. package/dist/node/skip-nav/skip-nav.js +27 -0
  222. package/dist/node/skip-nav/skip-nav.module.js +5 -0
  223. package/dist/node/slider/slider.js +29 -0
  224. package/dist/node/slider/slider.module.js +9 -0
  225. package/dist/node/spinner/spinner.js +18 -0
  226. package/dist/node/spinner/spinner.module.js +8 -0
  227. package/dist/node/stack/stack.js +19 -0
  228. package/dist/node/stack/stack.module.js +8 -0
  229. package/dist/node/stat/stat.js +41 -0
  230. package/dist/node/stat/stat.module.js +13 -0
  231. package/dist/node/status/status.js +20 -0
  232. package/dist/node/status/status.module.js +9 -0
  233. package/dist/node/steps/steps.js +35 -0
  234. package/dist/node/steps/steps.module.js +10 -0
  235. package/dist/node/storage/src/drivers.js +36 -0
  236. package/dist/node/storage/src/persisted-signal.js +43 -0
  237. package/dist/node/structured-list/structured-list.js +101 -0
  238. package/dist/node/structured-list/structured-list.module.js +14 -0
  239. package/dist/node/swap/swap.js +36 -0
  240. package/dist/node/swap/swap.module.js +9 -0
  241. package/dist/node/swipe-item/swipe-item.js +62 -0
  242. package/dist/node/swipe-item/swipe-item.module.js +14 -0
  243. package/dist/node/switcher/switcher.js +32 -0
  244. package/dist/node/switcher/switcher.module.js +10 -0
  245. package/dist/node/tabs/tabs.js +95 -0
  246. package/dist/node/tabs/tabs.module.js +10 -0
  247. package/dist/node/tag/tag.js +26 -0
  248. package/dist/node/tag/tag.module.js +8 -0
  249. package/dist/node/tags-input/tags-input.js +64 -0
  250. package/dist/node/tags-input/tags-input.module.js +10 -0
  251. package/dist/node/text/text.js +18 -0
  252. package/dist/node/text/text.module.js +5 -0
  253. package/dist/node/textarea/textarea.js +56 -0
  254. package/dist/node/textarea/textarea.module.js +11 -0
  255. package/dist/node/tile/tile.js +39 -0
  256. package/dist/node/tile/tile.module.js +9 -0
  257. package/dist/node/time-picker/time-picker.js +62 -0
  258. package/dist/node/time-picker/time-picker.module.js +11 -0
  259. package/dist/node/timeline/timeline.js +41 -0
  260. package/dist/node/timeline/timeline.module.js +13 -0
  261. package/dist/node/toast/toast.js +85 -0
  262. package/dist/node/toast/toast.module.js +13 -0
  263. package/dist/node/toc/toc.js +42 -0
  264. package/dist/node/toc/toc.module.js +5 -0
  265. package/dist/node/toc/use-toc-from-region.js +18 -0
  266. package/dist/node/toggle/toggle.js +39 -0
  267. package/dist/node/toggle/toggle.module.js +10 -0
  268. package/dist/node/toggle-group/toggle-group.js +55 -0
  269. package/dist/node/toggle-group/toggle-group.module.js +8 -0
  270. package/dist/node/toggletip/toggletip.js +49 -0
  271. package/dist/node/toggletip/toggletip.module.js +9 -0
  272. package/dist/node/tooltip/tooltip.js +58 -0
  273. package/dist/node/tooltip/tooltip.module.js +8 -0
  274. package/dist/node/tree-view/tree-view.js +201 -0
  275. package/dist/node/tree-view/tree-view.module.js +15 -0
  276. package/dist/node/user/user.js +37 -0
  277. package/dist/node/user/user.module.js +11 -0
  278. package/dist/node/visually-hidden/visually-hidden.js +15 -0
  279. package/dist/node/visually-hidden/visually-hidden.module.js +5 -0
  280. package/dist/number-input/number-input.js +41 -41
  281. package/dist/react/src/theme.js +42 -31
  282. package/dist/search/search.js +35 -35
  283. package/dist/swap/swap.js +12 -12
  284. package/dist/time-picker/time-picker.js +24 -24
  285. package/dist/toggle/toggle.js +12 -12
  286. package/package.json +7 -6
  287. package/readme.body.md +24 -11
@@ -0,0 +1,103 @@
1
+ "use client";
2
+
3
+ import e from "./menubar.module.js";
4
+ import { DismissableLayer as t, Presence as n, cn as r, useAnchorPosition as i, useRovingFocus as a, useSignal as o, useSignals as s } from "@cascivo/core";
5
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
6
+ import { useId as d, useRef as f } from "react";
7
+ //#region ../components/src/menubar/menubar.tsx
8
+ function p({ menus: t, "aria-label": n, className: i }) {
9
+ s();
10
+ let c = d(), u = o(null), f = a({
11
+ orientation: "horizontal",
12
+ loop: !0
13
+ });
14
+ return /* @__PURE__ */ l("div", {
15
+ role: "menubar",
16
+ "aria-label": n,
17
+ className: r(e.menubar, i),
18
+ children: t.map((e, t) => /* @__PURE__ */ l(m, {
19
+ menu: e,
20
+ index: t,
21
+ baseId: c,
22
+ openId: u,
23
+ itemProps: f.getItemProps(t)
24
+ }, e.id))
25
+ });
26
+ }
27
+ function m({ menu: t, baseId: r, openId: a, itemProps: o }) {
28
+ s();
29
+ let d = f(null), p = f(null), m = a.value === t.id, g = `${r}-menu-${t.id}`, { anchorStyle: _, floatingStyle: v } = i({
30
+ anchorRef: d,
31
+ floatingRef: p,
32
+ placement: "bottom-start",
33
+ enabled: m
34
+ }), y = () => {
35
+ (p.current?.querySelector("[role=\"menuitem\"]:not([aria-disabled=\"true\"])"))?.focus();
36
+ }, b = (e) => {
37
+ o.onKeyDown(e), !e.defaultPrevented && (e.key === "ArrowDown" || e.key === "Enter" || e.key === " " ? (e.preventDefault(), a.value = t.id, requestAnimationFrame(y)) : e.key === "Escape" && (a.value = null));
38
+ }, { ref: x, onKeyDown: S, ...C } = o;
39
+ return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("button", {
40
+ ref: (e) => {
41
+ d.current = e, x(e);
42
+ },
43
+ type: "button",
44
+ role: "menuitem",
45
+ "aria-haspopup": "menu",
46
+ "aria-expanded": m,
47
+ "aria-controls": g,
48
+ "data-state": m ? "open" : "closed",
49
+ className: e.trigger,
50
+ style: _,
51
+ onClick: () => {
52
+ a.value = m ? null : t.id;
53
+ },
54
+ onKeyDown: b,
55
+ ...C,
56
+ children: t.label
57
+ }), /* @__PURE__ */ l(n, {
58
+ present: m,
59
+ children: /* @__PURE__ */ l(h, {
60
+ menu: t,
61
+ menuId: g,
62
+ floatingRef: p,
63
+ floatingStyle: v,
64
+ onClose: () => {
65
+ a.value = null, d.current?.focus();
66
+ }
67
+ })
68
+ })] });
69
+ }
70
+ function h({ menu: n, menuId: r, floatingRef: i, floatingStyle: a, onClose: o }) {
71
+ let s = (e) => {
72
+ let t = Array.from(i.current?.querySelectorAll("[role=\"menuitem\"]:not([aria-disabled=\"true\"])") ?? []);
73
+ if (t.length === 0) return;
74
+ let n = t.indexOf(e.currentTarget);
75
+ e.key === "ArrowDown" ? (e.preventDefault(), t[(n + 1) % t.length]?.focus()) : e.key === "ArrowUp" ? (e.preventDefault(), t[(n - 1 + t.length) % t.length]?.focus()) : e.key === "Home" ? (e.preventDefault(), t[0]?.focus()) : e.key === "End" && (e.preventDefault(), t[t.length - 1]?.focus());
76
+ };
77
+ return /* @__PURE__ */ l(t, {
78
+ onDismiss: o,
79
+ children: /* @__PURE__ */ l("div", {
80
+ ref: i,
81
+ id: r,
82
+ role: "menu",
83
+ "aria-label": typeof n.label == "string" ? n.label : void 0,
84
+ className: e.panel,
85
+ style: a,
86
+ children: n.items.map((t) => /* @__PURE__ */ l("div", {
87
+ role: "menuitem",
88
+ tabIndex: -1,
89
+ "aria-disabled": t.disabled,
90
+ className: e.item,
91
+ onClick: () => {
92
+ t.disabled || (t.onSelect?.(), o());
93
+ },
94
+ onKeyDown: (e) => {
95
+ t.disabled || (e.key === "Enter" || e.key === " " ? (e.preventDefault(), t.onSelect?.(), o()) : s(e));
96
+ },
97
+ children: t.label
98
+ }, t.id))
99
+ })
100
+ });
101
+ }
102
+ //#endregion
103
+ export { p as Menubar };
@@ -0,0 +1,10 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ menubar: "_menubar_1fs00_2",
5
+ trigger: "_trigger_1fs00_12",
6
+ panel: "_panel_1fs00_35",
7
+ item: "_item_1fs00_66"
8
+ };
9
+ //#endregion
10
+ export { e as default };
@@ -0,0 +1,70 @@
1
+ "use client";
2
+
3
+ import e from "./modal.module.js";
4
+ import { cn as t, useDraggable as n, useId as r, useSignal as i, useSignalEffect as a, useSignals as o } from "@cascivo/core";
5
+ import { builtin as s, t as c } from "@cascivo/i18n";
6
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
7
+ import { useRef as d } from "react";
8
+ //#region ../components/src/modal/modal.tsx
9
+ function f({ open: f = !1, onClose: p, title: m, description: h, children: g, className: _, size: v = "md", draggable: y = !1 }) {
10
+ o();
11
+ let b = d(null), x = d(p);
12
+ x.current = p;
13
+ let S = r("cascivo-modal-title"), C = r("cascivo-modal-desc"), { handleRef: w, offset: T } = n({ isDisabled: !y }), E = y ? {
14
+ "--modal-x": `${T.value.x}px`,
15
+ "--modal-y": `${T.value.y}px`
16
+ } : void 0, D = i(f);
17
+ return D.value = f, a(() => {
18
+ let e = b.current;
19
+ e && (D.value ? e.open || e.showModal() : e.open && e.close());
20
+ }), a(() => {
21
+ let e = b.current;
22
+ if (!e) return;
23
+ let t = () => x.current?.();
24
+ return e.addEventListener("close", t), () => e.removeEventListener("close", t);
25
+ }), /* @__PURE__ */ l("dialog", {
26
+ ref: b,
27
+ "data-size": v,
28
+ "data-draggable": y || void 0,
29
+ className: t(e.dialog, _),
30
+ style: E,
31
+ onClick: (e) => {
32
+ e.target === b.current && b.current?.close();
33
+ },
34
+ "aria-labelledby": m ? S : void 0,
35
+ "aria-describedby": h ? C : void 0,
36
+ children: /* @__PURE__ */ u("div", {
37
+ className: e.panel,
38
+ children: [
39
+ (m || p) && /* @__PURE__ */ u("div", {
40
+ className: e.header,
41
+ ref: y ? (e) => {
42
+ w.current = e;
43
+ } : void 0,
44
+ children: [m && /* @__PURE__ */ l("h2", {
45
+ id: S,
46
+ className: e.title,
47
+ children: m
48
+ }), p && /* @__PURE__ */ l("button", {
49
+ type: "button",
50
+ className: e.close,
51
+ onClick: () => b.current?.close(),
52
+ "aria-label": c(s.modal.close),
53
+ children: "✕"
54
+ })]
55
+ }),
56
+ h && /* @__PURE__ */ l("p", {
57
+ id: C,
58
+ className: e.description,
59
+ children: h
60
+ }),
61
+ /* @__PURE__ */ l("div", {
62
+ className: e.body,
63
+ children: g
64
+ })
65
+ ]
66
+ })
67
+ });
68
+ }
69
+ //#endregion
70
+ export { f as Modal };
@@ -0,0 +1,13 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ dialog: "_dialog_t1gwg_2",
5
+ panel: "_panel_t1gwg_69",
6
+ header: "_header_t1gwg_79",
7
+ title: "_title_t1gwg_101",
8
+ close: "_close_t1gwg_110",
9
+ description: "_description_t1gwg_138",
10
+ body: "_body_t1gwg_148"
11
+ };
12
+ //#endregion
13
+ export { e as default };
@@ -0,0 +1,106 @@
1
+ "use client";
2
+
3
+ import { usePopover as e } from "../popover/use-popover.js";
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";
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;
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;
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);
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();
29
+ };
30
+ return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
31
+ });
32
+ function E(e) {
33
+ p.includes(e) ? m(p.filter((t) => t !== e)) : m([...p, e]);
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,
41
+ type: "button",
42
+ className: t.trigger,
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", {
49
+ className: t["trigger-label"],
50
+ children: D
51
+ }), /* @__PURE__ */ l("span", {
52
+ className: t.chevron,
53
+ "aria-hidden": "true"
54
+ })]
55
+ }), /* @__PURE__ */ u("div", {
56
+ ref: b.popoverRef,
57
+ popover: "auto",
58
+ className: t.panel,
59
+ style: { positionAnchor: b.anchorName },
60
+ tabIndex: -1,
61
+ children: [/* @__PURE__ */ l("div", {
62
+ className: t["search-row"],
63
+ children: /* @__PURE__ */ l("input", {
64
+ ref: w,
65
+ type: "search",
66
+ className: t.search,
67
+ placeholder: O,
68
+ value: x.value,
69
+ onChange: (e) => {
70
+ x.value = e.currentTarget.value, S.value = -1;
71
+ }
72
+ })
73
+ }), /* @__PURE__ */ l("div", {
74
+ ref: C,
75
+ role: "listbox",
76
+ "aria-multiselectable": "true",
77
+ "aria-label": _?.label ?? c(s.multiSelect.label),
78
+ className: t.options,
79
+ children: T.value.length === 0 ? /* @__PURE__ */ l("div", {
80
+ className: t["no-results"],
81
+ children: k
82
+ }) : T.value.map((e, n) => /* @__PURE__ */ u("div", {
83
+ role: "option",
84
+ "aria-selected": p.includes(e.value),
85
+ "aria-disabled": e.disabled,
86
+ "data-active": n === S.value ? "" : void 0,
87
+ "data-selected": p.includes(e.value) ? "" : void 0,
88
+ "data-disabled": e.disabled ? "" : void 0,
89
+ className: t.option,
90
+ onMouseDown: (t) => {
91
+ t.preventDefault(), e.disabled || E(e.value);
92
+ },
93
+ onMouseEnter: () => {
94
+ S.value = n;
95
+ },
96
+ children: [/* @__PURE__ */ l("span", {
97
+ className: t.checkbox,
98
+ "aria-hidden": "true"
99
+ }), e.label]
100
+ }, e.value))
101
+ })]
102
+ })]
103
+ });
104
+ }
105
+ //#endregion
106
+ export { f as MultiSelect };
@@ -0,0 +1,17 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ wrapper: "_wrapper_nkk1l_2",
5
+ trigger: "_trigger_nkk1l_8",
6
+ "trigger-label": "_trigger-label_nkk1l_47",
7
+ chevron: "_chevron_nkk1l_59",
8
+ panel: "_panel_nkk1l_79",
9
+ "search-row": "_search-row_nkk1l_117",
10
+ search: "_search_nkk1l_117",
11
+ options: "_options_nkk1l_138",
12
+ option: "_option_nkk1l_138",
13
+ checkbox: "_checkbox_nkk1l_166",
14
+ "no-results": "_no-results_nkk1l_181"
15
+ };
16
+ //#endregion
17
+ export { e as default };
@@ -0,0 +1,37 @@
1
+ "use client";
2
+
3
+ import e from "./native-select.module.js";
4
+ import { cn as t } from "@cascivo/core";
5
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
6
+ //#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", {
10
+ className: t(e.root, f),
11
+ "data-size": o,
12
+ "data-invalid": s || void 0,
13
+ children: [/* @__PURE__ */ r("select", {
14
+ className: e.select,
15
+ disabled: c,
16
+ "aria-invalid": s || void 0,
17
+ value: u,
18
+ defaultValue: !m && h ? d ?? "" : d,
19
+ ...p,
20
+ children: [h && /* @__PURE__ */ n("option", {
21
+ value: "",
22
+ disabled: !0,
23
+ hidden: !0,
24
+ children: l
25
+ }), i ? i.map((e) => /* @__PURE__ */ n("option", {
26
+ value: e.value,
27
+ disabled: e.disabled,
28
+ children: e.label
29
+ }, e.value)) : a]
30
+ }), /* @__PURE__ */ n("span", {
31
+ className: e.chevron,
32
+ "aria-hidden": "true"
33
+ })]
34
+ });
35
+ }
36
+ //#endregion
37
+ export { i as NativeSelect };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ root: "_root_1s4kv_2",
5
+ select: "_select_1s4kv_24",
6
+ chevron: "_chevron_1s4kv_66"
7
+ };
8
+ //#endregion
9
+ export { e as default };
@@ -0,0 +1,99 @@
1
+ "use client";
2
+
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";
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({
11
+ orientation: i,
12
+ loop: !0
13
+ });
14
+ return /* @__PURE__ */ l("nav", {
15
+ "aria-label": n,
16
+ className: r(e.nav, a),
17
+ "data-orientation": i,
18
+ children: /* @__PURE__ */ l("ul", {
19
+ role: "list",
20
+ className: e.list,
21
+ children: t.map((e, t) => /* @__PURE__ */ l(m, {
22
+ item: e,
23
+ baseId: u,
24
+ openId: f,
25
+ itemProps: p.getItemProps(t)
26
+ }, e.id))
27
+ })
28
+ });
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,
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", {
41
+ className: e.item,
42
+ children: /* @__PURE__ */ l(n, {
43
+ ref: (e) => b(e),
44
+ href: t.href,
45
+ className: e.link,
46
+ onKeyDown: x,
47
+ ...S,
48
+ children: t.label
49
+ })
50
+ });
51
+ }
52
+ return /* @__PURE__ */ u("li", {
53
+ className: e.item,
54
+ children: [/* @__PURE__ */ l("button", {
55
+ ref: (e) => {
56
+ d.current = e, b(e);
57
+ },
58
+ type: "button",
59
+ "aria-expanded": g,
60
+ "aria-controls": _,
61
+ "data-state": g ? "open" : "closed",
62
+ className: e.trigger,
63
+ style: v,
64
+ onClick: () => {
65
+ o.value = g ? null : t.id;
66
+ },
67
+ onKeyDown: (e) => {
68
+ x(e), !e.defaultPrevented && e.key === "Escape" && (o.value = null);
69
+ },
70
+ ...S,
71
+ children: t.label
72
+ }), /* @__PURE__ */ l(n, {
73
+ present: g,
74
+ children: /* @__PURE__ */ l(h, {
75
+ panelId: _,
76
+ floatingRef: p,
77
+ floatingStyle: y,
78
+ onClose: () => {
79
+ o.value = null, d.current?.focus();
80
+ },
81
+ children: t.content
82
+ })
83
+ })]
84
+ });
85
+ }
86
+ function h({ panelId: n, floatingRef: r, floatingStyle: i, onClose: a, children: o }) {
87
+ return /* @__PURE__ */ l(t, {
88
+ onDismiss: a,
89
+ children: /* @__PURE__ */ l("div", {
90
+ ref: r,
91
+ id: n,
92
+ className: e.panel,
93
+ style: i,
94
+ children: o
95
+ })
96
+ });
97
+ }
98
+ //#endregion
99
+ export { p as NavigationMenu };
@@ -0,0 +1,12 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ nav: "_nav_1k4lc_2",
5
+ list: "_list_1k4lc_6",
6
+ item: "_item_1k4lc_20",
7
+ link: "_link_1k4lc_24",
8
+ trigger: "_trigger_1k4lc_25",
9
+ panel: "_panel_1k4lc_50"
10
+ };
11
+ //#endregion
12
+ export { e as default };
@@ -0,0 +1,134 @@
1
+ "use client";
2
+
3
+ import e from "./notification.module.js";
4
+ import { Presence as t, cn as n, useSignal as r, useSignals as i } from "@cascivo/core";
5
+ import { builtin as a, t as o } from "@cascivo/i18n";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
+ import { useRef as l } from "react";
8
+ //#region ../components/src/notification/notification.tsx
9
+ var u = new Set(["warning", "error"]), d = 160;
10
+ function f({ variant: e }) {
11
+ return e === "success" ? /* @__PURE__ */ c("svg", {
12
+ viewBox: "0 0 20 20",
13
+ width: "20",
14
+ height: "20",
15
+ fill: "none",
16
+ "aria-hidden": "true",
17
+ children: [/* @__PURE__ */ s("circle", {
18
+ cx: "10",
19
+ cy: "10",
20
+ r: "8",
21
+ stroke: "currentColor",
22
+ strokeWidth: "1.5"
23
+ }), /* @__PURE__ */ s("path", {
24
+ d: "M6.5 10.5l2.5 2.5 4.5-5",
25
+ stroke: "currentColor",
26
+ strokeWidth: "1.5",
27
+ strokeLinecap: "round",
28
+ strokeLinejoin: "round"
29
+ })]
30
+ }) : e === "warning" ? /* @__PURE__ */ c("svg", {
31
+ viewBox: "0 0 20 20",
32
+ width: "20",
33
+ height: "20",
34
+ fill: "none",
35
+ "aria-hidden": "true",
36
+ children: [/* @__PURE__ */ s("path", {
37
+ d: "M10 2.5L18.5 17H1.5L10 2.5z",
38
+ stroke: "currentColor",
39
+ strokeWidth: "1.5",
40
+ strokeLinejoin: "round"
41
+ }), /* @__PURE__ */ s("path", {
42
+ d: "M10 8v3.5M10 14h.01",
43
+ stroke: "currentColor",
44
+ strokeWidth: "1.5",
45
+ strokeLinecap: "round"
46
+ })]
47
+ }) : e === "error" ? /* @__PURE__ */ c("svg", {
48
+ viewBox: "0 0 20 20",
49
+ width: "20",
50
+ height: "20",
51
+ fill: "none",
52
+ "aria-hidden": "true",
53
+ children: [/* @__PURE__ */ s("circle", {
54
+ cx: "10",
55
+ cy: "10",
56
+ r: "8",
57
+ stroke: "currentColor",
58
+ strokeWidth: "1.5"
59
+ }), /* @__PURE__ */ s("path", {
60
+ d: "M10 6v4.5M10 13.5h.01",
61
+ stroke: "currentColor",
62
+ strokeWidth: "1.5",
63
+ strokeLinecap: "round"
64
+ })]
65
+ }) : /* @__PURE__ */ c("svg", {
66
+ viewBox: "0 0 20 20",
67
+ width: "20",
68
+ height: "20",
69
+ fill: "none",
70
+ "aria-hidden": "true",
71
+ children: [/* @__PURE__ */ s("circle", {
72
+ cx: "10",
73
+ cy: "10",
74
+ r: "8",
75
+ stroke: "currentColor",
76
+ strokeWidth: "1.5"
77
+ }), /* @__PURE__ */ s("path", {
78
+ d: "M10 9v5M10 6.5h.01",
79
+ stroke: "currentColor",
80
+ strokeWidth: "1.5",
81
+ strokeLinecap: "round"
82
+ })]
83
+ });
84
+ }
85
+ function p({ title: p, description: m, variant: h = "info", dismissible: g = !1, onDismiss: _, actions: v, icon: y, labels: b, className: x, ...S }) {
86
+ i();
87
+ let C = r(!0), w = l(_);
88
+ w.current = _;
89
+ let T = g || _ !== void 0, E = () => {
90
+ C.value = !1, setTimeout(() => w.current?.(), d);
91
+ };
92
+ return /* @__PURE__ */ s(t, {
93
+ present: C,
94
+ children: /* @__PURE__ */ c("div", {
95
+ role: u.has(h) ? "alert" : "status",
96
+ "data-variant": h,
97
+ className: n(e.notification, x),
98
+ ...S,
99
+ children: [
100
+ /* @__PURE__ */ s("span", {
101
+ className: e.icon,
102
+ "aria-hidden": "true",
103
+ children: y ?? /* @__PURE__ */ s(f, { variant: h })
104
+ }),
105
+ /* @__PURE__ */ c("div", {
106
+ className: e.body,
107
+ children: [
108
+ /* @__PURE__ */ s("div", {
109
+ className: e.title,
110
+ children: p
111
+ }),
112
+ m && /* @__PURE__ */ s("div", {
113
+ className: e.description,
114
+ children: m
115
+ }),
116
+ v && /* @__PURE__ */ s("div", {
117
+ className: e.actions,
118
+ children: v
119
+ })
120
+ ]
121
+ }),
122
+ T && /* @__PURE__ */ s("button", {
123
+ type: "button",
124
+ className: e.dismiss,
125
+ "aria-label": b?.dismiss ?? o(a.notification.dismiss),
126
+ onClick: E,
127
+ children: "✕"
128
+ })
129
+ ]
130
+ })
131
+ });
132
+ }
133
+ //#endregion
134
+ export { p as Notification };
@@ -0,0 +1,13 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ notification: "_notification_10586_2",
5
+ icon: "_icon_10586_58",
6
+ body: "_body_10586_79",
7
+ title: "_title_10586_87",
8
+ description: "_description_10586_93",
9
+ actions: "_actions_10586_99",
10
+ dismiss: "_dismiss_10586_106"
11
+ };
12
+ //#endregion
13
+ export { e as default };