@cascivo/react 0.9.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 (278) hide show
  1. package/README.md +5 -5
  2. package/dist/command-menu/command-menu.js +2 -2
  3. package/dist/field/field.js +24 -15
  4. package/dist/index.d.ts +13 -0
  5. package/dist/node/accordion/accordion.js +95 -0
  6. package/dist/node/accordion/accordion.module.js +13 -0
  7. package/dist/node/action-sheet/action-sheet.js +91 -0
  8. package/dist/node/action-sheet/action-sheet.module.js +14 -0
  9. package/dist/node/alert/alert.js +55 -0
  10. package/dist/node/alert/alert.module.js +13 -0
  11. package/dist/node/alert-dialog/alert-dialog.js +68 -0
  12. package/dist/node/alert-dialog/alert-dialog.module.js +13 -0
  13. package/dist/node/app-shell/app-shell.js +80 -0
  14. package/dist/node/app-shell/app-shell.module.js +14 -0
  15. package/dist/node/aspect-ratio/aspect-ratio.js +22 -0
  16. package/dist/node/aspect-ratio/aspect-ratio.module.js +8 -0
  17. package/dist/node/avatar/avatar.js +57 -0
  18. package/dist/node/avatar/avatar.module.js +10 -0
  19. package/dist/node/avatar-group/avatar-group.js +26 -0
  20. package/dist/node/avatar-group/avatar-group.module.js +8 -0
  21. package/dist/node/badge/badge.js +17 -0
  22. package/dist/node/badge/badge.module.js +5 -0
  23. package/dist/node/blockquote/blockquote.js +18 -0
  24. package/dist/node/blockquote/blockquote.module.js +8 -0
  25. package/dist/node/bottom-sheet/bottom-sheet.js +111 -0
  26. package/dist/node/bottom-sheet/bottom-sheet.module.js +16 -0
  27. package/dist/node/breadcrumb/breadcrumb.js +28 -0
  28. package/dist/node/breadcrumb/breadcrumb.module.js +5 -0
  29. package/dist/node/button/button.js +31 -0
  30. package/dist/node/button/button.module.js +5 -0
  31. package/dist/node/button-group/button-group.js +39 -0
  32. package/dist/node/button-group/button-group.module.js +5 -0
  33. package/dist/node/calendar/calendar.js +195 -0
  34. package/dist/node/calendar/calendar.module.js +16 -0
  35. package/dist/node/card/card.js +45 -0
  36. package/dist/node/card/card.module.js +11 -0
  37. package/dist/node/carousel/carousel.js +138 -0
  38. package/dist/node/carousel/carousel.module.js +15 -0
  39. package/dist/node/chat-bubble/chat-bubble.js +33 -0
  40. package/dist/node/chat-bubble/chat-bubble.module.js +13 -0
  41. package/dist/node/checkbox/checkbox.js +38 -0
  42. package/dist/node/checkbox/checkbox.module.js +10 -0
  43. package/dist/node/checkbox-card/checkbox-card.js +48 -0
  44. package/dist/node/checkbox-card/checkbox-card.module.js +13 -0
  45. package/dist/node/code/code.js +16 -0
  46. package/dist/node/code/code.module.js +5 -0
  47. package/dist/node/code-snippet/code-snippet.js +116 -0
  48. package/dist/node/code-snippet/code-snippet.module.js +19 -0
  49. package/dist/node/code-snippet/highlight.js +69 -0
  50. package/dist/node/collapsible/collapsible.js +42 -0
  51. package/dist/node/collapsible/collapsible.module.js +10 -0
  52. package/dist/node/color-picker/color-picker.js +268 -0
  53. package/dist/node/color-picker/color-picker.module.js +20 -0
  54. package/dist/node/combobox/combobox.js +164 -0
  55. package/dist/node/combobox/combobox.module.js +21 -0
  56. package/dist/node/command-menu/command-menu.js +425 -0
  57. package/dist/node/command-menu/command-menu.module.js +36 -0
  58. package/dist/node/comparison/comparison.js +69 -0
  59. package/dist/node/comparison/comparison.module.js +11 -0
  60. package/dist/node/contained-list/contained-list.js +41 -0
  61. package/dist/node/contained-list/contained-list.module.js +13 -0
  62. package/dist/node/context-menu/context-menu.js +89 -0
  63. package/dist/node/context-menu/context-menu.module.js +9 -0
  64. package/dist/node/copy-button/copy-button.js +58 -0
  65. package/dist/node/copy-button/copy-button.module.js +8 -0
  66. package/dist/node/data-list/data-list.js +27 -0
  67. package/dist/node/data-list/data-list.module.js +10 -0
  68. package/dist/node/data-table/data-table.js +370 -0
  69. package/dist/node/data-table/data-table.module.js +35 -0
  70. package/dist/node/date-picker/date-picker.js +218 -0
  71. package/dist/node/date-picker/date-picker.module.js +25 -0
  72. package/dist/node/date-range-picker/date-range-picker.js +196 -0
  73. package/dist/node/date-range-picker/date-range-picker.module.js +20 -0
  74. package/dist/node/dock/dock.js +34 -0
  75. package/dist/node/dock/dock.module.js +10 -0
  76. package/dist/node/drawer/drawer.js +95 -0
  77. package/dist/node/drawer/drawer.module.js +15 -0
  78. package/dist/node/dropdown/dropdown.js +109 -0
  79. package/dist/node/dropdown/dropdown.module.js +11 -0
  80. package/dist/node/editable/editable.js +67 -0
  81. package/dist/node/editable/editable.module.js +13 -0
  82. package/dist/node/empty-state/empty-state.js +34 -0
  83. package/dist/node/empty-state/empty-state.module.js +11 -0
  84. package/dist/node/fab/fab.js +93 -0
  85. package/dist/node/fab/fab.module.js +14 -0
  86. package/dist/node/field/field.js +48 -0
  87. package/dist/node/field/field.module.js +9 -0
  88. package/dist/node/file-uploader/file-uploader.js +122 -0
  89. package/dist/node/file-uploader/file-uploader.module.js +20 -0
  90. package/dist/node/filter/filter.js +34 -0
  91. package/dist/node/filter/filter.module.js +8 -0
  92. package/dist/node/form/form.js +95 -0
  93. package/dist/node/form/form.module.js +5 -0
  94. package/dist/node/header/header.js +44 -0
  95. package/dist/node/header/header.module.js +13 -0
  96. package/dist/node/header-panel/header-panel.js +74 -0
  97. package/dist/node/header-panel/header-panel.module.js +11 -0
  98. package/dist/node/heading/heading.js +24 -0
  99. package/dist/node/heading/heading.module.js +5 -0
  100. package/dist/node/hover-card/hover-card.js +84 -0
  101. package/dist/node/hover-card/hover-card.module.js +8 -0
  102. package/dist/node/icon-button/icon-button.js +21 -0
  103. package/dist/node/icon-button/icon-button.module.js +5 -0
  104. package/dist/node/image/image.js +64 -0
  105. package/dist/node/image/image.module.js +11 -0
  106. package/dist/node/index.js +2 -0
  107. package/dist/node/indicator/indicator.js +18 -0
  108. package/dist/node/indicator/indicator.module.js +8 -0
  109. package/dist/node/inline-loading/inline-loading.js +76 -0
  110. package/dist/node/inline-loading/inline-loading.module.js +11 -0
  111. package/dist/node/input/input.js +54 -0
  112. package/dist/node/input/input.module.js +11 -0
  113. package/dist/node/input-group/input-group.js +41 -0
  114. package/dist/node/input-group/input-group.module.js +11 -0
  115. package/dist/node/item/item.js +52 -0
  116. package/dist/node/item/item.module.js +12 -0
  117. package/dist/node/join/join.js +14 -0
  118. package/dist/node/join/join.module.js +5 -0
  119. package/dist/node/kbd/kbd.js +16 -0
  120. package/dist/node/kbd/kbd.module.js +5 -0
  121. package/dist/node/label/label.js +25 -0
  122. package/dist/node/label/label.module.js +9 -0
  123. package/dist/node/layouts/src/auto-grid/auto-grid.js +19 -0
  124. package/dist/node/layouts/src/auto-grid/auto-grid.module.js +6 -0
  125. package/dist/node/layouts/src/center/center.js +18 -0
  126. package/dist/node/layouts/src/center/center.module.js +5 -0
  127. package/dist/node/layouts/src/columns/columns.js +23 -0
  128. package/dist/node/layouts/src/columns/columns.module.js +8 -0
  129. package/dist/node/layouts/src/flex/flex.js +22 -0
  130. package/dist/node/layouts/src/flex/flex.module.js +5 -0
  131. package/dist/node/layouts/src/grid/grid.js +57 -0
  132. package/dist/node/layouts/src/grid/grid.module.js +9 -0
  133. package/dist/node/layouts/src/spacer/spacer.js +19 -0
  134. package/dist/node/layouts/src/spacer/spacer.module.js +5 -0
  135. package/dist/node/link/link.js +22 -0
  136. package/dist/node/link/link.module.js +5 -0
  137. package/dist/node/list/list.js +23 -0
  138. package/dist/node/list/list.module.js +8 -0
  139. package/dist/node/log-viewer/log-viewer.js +184 -0
  140. package/dist/node/log-viewer/log-viewer.module.js +18 -0
  141. package/dist/node/menu/menu.js +121 -0
  142. package/dist/node/menu/menu.module.js +10 -0
  143. package/dist/node/menu-button/menu-button.js +92 -0
  144. package/dist/node/menu-button/menu-button.module.js +10 -0
  145. package/dist/node/menubar/menubar.js +103 -0
  146. package/dist/node/menubar/menubar.module.js +10 -0
  147. package/dist/node/modal/modal.js +70 -0
  148. package/dist/node/modal/modal.module.js +13 -0
  149. package/dist/node/multi-select/multi-select.js +106 -0
  150. package/dist/node/multi-select/multi-select.module.js +17 -0
  151. package/dist/node/native-select/native-select.js +37 -0
  152. package/dist/node/native-select/native-select.module.js +9 -0
  153. package/dist/node/navigation-menu/navigation-menu.js +99 -0
  154. package/dist/node/navigation-menu/navigation-menu.module.js +12 -0
  155. package/dist/node/notification/notification.js +134 -0
  156. package/dist/node/notification/notification.module.js +13 -0
  157. package/dist/node/number-input/number-input.js +145 -0
  158. package/dist/node/number-input/number-input.module.js +14 -0
  159. package/dist/node/otp-input/otp-input.js +70 -0
  160. package/dist/node/otp-input/otp-input.module.js +8 -0
  161. package/dist/node/overflow-menu/overflow-menu.js +65 -0
  162. package/dist/node/overflow-menu/overflow-menu.module.js +9 -0
  163. package/dist/node/pagination/pagination.js +92 -0
  164. package/dist/node/pagination/pagination.module.js +13 -0
  165. package/dist/node/password-input/password-input.js +80 -0
  166. package/dist/node/password-input/password-input.module.js +13 -0
  167. package/dist/node/popover/popover.js +49 -0
  168. package/dist/node/popover/popover.module.js +8 -0
  169. package/dist/node/popover/use-popover.js +57 -0
  170. package/dist/node/progress/progress.js +17 -0
  171. package/dist/node/progress/progress.module.js +8 -0
  172. package/dist/node/progress-bar/progress-bar.js +44 -0
  173. package/dist/node/progress-bar/progress-bar.module.js +13 -0
  174. package/dist/node/progress-circle/progress-circle.js +48 -0
  175. package/dist/node/progress-circle/progress-circle.module.js +11 -0
  176. package/dist/node/progress-indicator/progress-indicator.js +36 -0
  177. package/dist/node/progress-indicator/progress-indicator.module.js +12 -0
  178. package/dist/node/prose/prose.js +15 -0
  179. package/dist/node/prose/prose.module.js +5 -0
  180. package/dist/node/pull-to-refresh/pull-to-refresh.js +82 -0
  181. package/dist/node/pull-to-refresh/pull-to-refresh.module.js +11 -0
  182. package/dist/node/qr-code/encode.js +585 -0
  183. package/dist/node/qr-code/qr-code.js +41 -0
  184. package/dist/node/qr-code/qr-code.module.js +8 -0
  185. package/dist/node/radial-progress/radial-progress.js +28 -0
  186. package/dist/node/radial-progress/radial-progress.module.js +8 -0
  187. package/dist/node/radio/radio.js +49 -0
  188. package/dist/node/radio/radio.module.js +11 -0
  189. package/dist/node/radio-card/radio-card.js +63 -0
  190. package/dist/node/radio-card/radio-card.module.js +13 -0
  191. package/dist/node/rating-group/rating-group.js +37 -0
  192. package/dist/node/rating-group/rating-group.module.js +8 -0
  193. package/dist/node/react/src/index.js +138 -0
  194. package/dist/node/react/src/theme.js +54 -0
  195. package/dist/node/relative-time/relative-time.js +66 -0
  196. package/dist/node/relative-time/relative-time.module.js +5 -0
  197. package/dist/node/resizable/resizable.js +80 -0
  198. package/dist/node/resizable/resizable.module.js +10 -0
  199. package/dist/node/scroll-area/scroll-area.js +38 -0
  200. package/dist/node/scroll-area/scroll-area.module.js +5 -0
  201. package/dist/node/search/search.js +94 -0
  202. package/dist/node/search/search.module.js +11 -0
  203. package/dist/node/segmented-control/segmented-control.js +43 -0
  204. package/dist/node/segmented-control/segmented-control.module.js +8 -0
  205. package/dist/node/select/select.js +71 -0
  206. package/dist/node/select/select.module.js +13 -0
  207. package/dist/node/separator/separator.js +21 -0
  208. package/dist/node/separator/separator.module.js +5 -0
  209. package/dist/node/sheet/sheet.js +50 -0
  210. package/dist/node/sheet/sheet.module.js +11 -0
  211. package/dist/node/shell-header/shell-header.js +166 -0
  212. package/dist/node/shell-header/shell-header.module.js +25 -0
  213. package/dist/node/side-nav/side-nav.js +333 -0
  214. package/dist/node/side-nav/side-nav.module.js +33 -0
  215. package/dist/node/skeleton/skeleton.js +25 -0
  216. package/dist/node/skeleton/skeleton.module.js +9 -0
  217. package/dist/node/skip-nav/skip-nav.js +27 -0
  218. package/dist/node/skip-nav/skip-nav.module.js +5 -0
  219. package/dist/node/slider/slider.js +29 -0
  220. package/dist/node/slider/slider.module.js +9 -0
  221. package/dist/node/spinner/spinner.js +18 -0
  222. package/dist/node/spinner/spinner.module.js +8 -0
  223. package/dist/node/stack/stack.js +19 -0
  224. package/dist/node/stack/stack.module.js +8 -0
  225. package/dist/node/stat/stat.js +41 -0
  226. package/dist/node/stat/stat.module.js +13 -0
  227. package/dist/node/status/status.js +20 -0
  228. package/dist/node/status/status.module.js +9 -0
  229. package/dist/node/steps/steps.js +35 -0
  230. package/dist/node/steps/steps.module.js +10 -0
  231. package/dist/node/storage/src/drivers.js +36 -0
  232. package/dist/node/storage/src/persisted-signal.js +43 -0
  233. package/dist/node/structured-list/structured-list.js +101 -0
  234. package/dist/node/structured-list/structured-list.module.js +14 -0
  235. package/dist/node/swap/swap.js +36 -0
  236. package/dist/node/swap/swap.module.js +9 -0
  237. package/dist/node/swipe-item/swipe-item.js +62 -0
  238. package/dist/node/swipe-item/swipe-item.module.js +14 -0
  239. package/dist/node/switcher/switcher.js +32 -0
  240. package/dist/node/switcher/switcher.module.js +10 -0
  241. package/dist/node/tabs/tabs.js +95 -0
  242. package/dist/node/tabs/tabs.module.js +10 -0
  243. package/dist/node/tag/tag.js +26 -0
  244. package/dist/node/tag/tag.module.js +8 -0
  245. package/dist/node/tags-input/tags-input.js +64 -0
  246. package/dist/node/tags-input/tags-input.module.js +10 -0
  247. package/dist/node/text/text.js +18 -0
  248. package/dist/node/text/text.module.js +5 -0
  249. package/dist/node/textarea/textarea.js +56 -0
  250. package/dist/node/textarea/textarea.module.js +11 -0
  251. package/dist/node/tile/tile.js +39 -0
  252. package/dist/node/tile/tile.module.js +9 -0
  253. package/dist/node/time-picker/time-picker.js +62 -0
  254. package/dist/node/time-picker/time-picker.module.js +11 -0
  255. package/dist/node/timeline/timeline.js +41 -0
  256. package/dist/node/timeline/timeline.module.js +13 -0
  257. package/dist/node/toast/toast.js +85 -0
  258. package/dist/node/toast/toast.module.js +13 -0
  259. package/dist/node/toc/toc.js +42 -0
  260. package/dist/node/toc/toc.module.js +5 -0
  261. package/dist/node/toc/use-toc-from-region.js +18 -0
  262. package/dist/node/toggle/toggle.js +39 -0
  263. package/dist/node/toggle/toggle.module.js +10 -0
  264. package/dist/node/toggle-group/toggle-group.js +55 -0
  265. package/dist/node/toggle-group/toggle-group.module.js +8 -0
  266. package/dist/node/toggletip/toggletip.js +49 -0
  267. package/dist/node/toggletip/toggletip.module.js +9 -0
  268. package/dist/node/tooltip/tooltip.js +58 -0
  269. package/dist/node/tooltip/tooltip.module.js +8 -0
  270. package/dist/node/tree-view/tree-view.js +201 -0
  271. package/dist/node/tree-view/tree-view.module.js +15 -0
  272. package/dist/node/user/user.js +37 -0
  273. package/dist/node/user/user.module.js +11 -0
  274. package/dist/node/visually-hidden/visually-hidden.js +15 -0
  275. package/dist/node/visually-hidden/visually-hidden.module.js +5 -0
  276. package/dist/react/src/theme.js +35 -29
  277. package/package.json +3 -2
  278. package/readme.body.md +5 -5
@@ -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 };
@@ -0,0 +1,145 @@
1
+ "use client";
2
+
3
+ import e from "./number-input.module.js";
4
+ import { cn as t, createMachine as n, useMachine as r, useSignal as i, useSignals as a } from "@cascivo/core";
5
+ import { builtin as o, t as s } from "@cascivo/i18n";
6
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
7
+ //#region ../components/src/number-input/number-input.tsx
8
+ var u = n({
9
+ initial: "idle",
10
+ states: {
11
+ idle: { on: { FOCUS: "focused" } },
12
+ focused: { on: { BLUR: "idle" } }
13
+ }
14
+ });
15
+ function d(e, t, n) {
16
+ let r = e;
17
+ return t !== void 0 && (r = Math.max(r, t)), n !== void 0 && (r = Math.min(r, n)), r;
18
+ }
19
+ function f(e) {
20
+ let t = String(e), n = t.indexOf(".");
21
+ return n === -1 ? 0 : t.length - n - 1;
22
+ }
23
+ function p(e, t) {
24
+ let n = 10 ** t;
25
+ return Math.round(e * n) / n;
26
+ }
27
+ function m(e) {
28
+ let t = e.trim();
29
+ if (t === "") return null;
30
+ let n = Number(t);
31
+ return Number.isFinite(n) ? n : null;
32
+ }
33
+ function h({ value: n, defaultValue: h, onValueChange: g, onChange: _, min: v, max: y, step: b = 1, precision: x, formatOptions: S, label: C, hint: w, error: T, size: E = "md", disabled: D, incrementLabel: O, decrementLabel: k, className: A, id: j, onFocus: M, onBlur: N, onKeyDown: P, ...F }) {
34
+ a();
35
+ let I = O ?? s(o.numberInput.increment), L = k ?? s(o.numberInput.decrement), [R, z] = r(u), B = n !== void 0, V = i(h ?? null), H = i(""), U = B ? n : V.value, W = j ?? (C ? `cascade-number-input-${C.toLowerCase().replace(/\s+/g, "-")}` : void 0), G = (e) => {
36
+ B || (V.value = e), H.value = e == null ? "" : String(e), e !== U && (g ?? _)?.(e);
37
+ }, K = () => {
38
+ let e = m(H.value);
39
+ e != null && (e = d(e, v, y), x !== void 0 && (e = p(e, x))), G(e);
40
+ }, q = (e) => {
41
+ let t = (R.value === "focused" ? m(H.value) : U) ?? 0, n = x ?? Math.max(f(b), f(t));
42
+ G(d(p(t + e * b, n), v, y));
43
+ }, J = R.value === "focused" ? H.value : ((e) => e == null ? "" : S ? new Intl.NumberFormat(void 0, S).format(e) : String(e))(U), Y = U != null && y !== void 0 && U >= y, X = U != null && v !== void 0 && U <= v;
44
+ return /* @__PURE__ */ l("div", {
45
+ className: t(e.wrapper, A),
46
+ "data-state": T ? "error" : R.value,
47
+ "data-size": E,
48
+ children: [
49
+ C && /* @__PURE__ */ c("label", {
50
+ className: e.label,
51
+ htmlFor: W,
52
+ children: C
53
+ }),
54
+ /* @__PURE__ */ l("div", {
55
+ className: e.field,
56
+ children: [/* @__PURE__ */ c("input", {
57
+ id: W,
58
+ type: "text",
59
+ inputMode: "decimal",
60
+ autoComplete: "off",
61
+ role: "spinbutton",
62
+ className: e.input,
63
+ value: J,
64
+ disabled: D,
65
+ "aria-valuenow": U ?? void 0,
66
+ "aria-valuemin": v,
67
+ "aria-valuemax": y,
68
+ "aria-invalid": T ? !0 : void 0,
69
+ "aria-describedby": T ? `${W}-error` : w ? `${W}-hint` : void 0,
70
+ onChange: (e) => {
71
+ H.value = e.target.value;
72
+ },
73
+ onFocus: (e) => {
74
+ H.value = U == null ? "" : String(U), z("FOCUS"), M?.(e);
75
+ },
76
+ onBlur: (e) => {
77
+ K(), z("BLUR"), N?.(e);
78
+ },
79
+ onKeyDown: (e) => {
80
+ e.key === "ArrowUp" ? (e.preventDefault(), q(1)) : e.key === "ArrowDown" ? (e.preventDefault(), q(-1)) : e.key === "Enter" && K(), P?.(e);
81
+ },
82
+ ...F
83
+ }), /* @__PURE__ */ l("div", {
84
+ className: e.steppers,
85
+ children: [/* @__PURE__ */ c("button", {
86
+ type: "button",
87
+ className: e.stepper,
88
+ "aria-label": I,
89
+ tabIndex: -1,
90
+ disabled: D || Y,
91
+ onMouseDown: (e) => e.preventDefault(),
92
+ onClick: () => q(1),
93
+ children: /* @__PURE__ */ c("svg", {
94
+ viewBox: "0 0 10 10",
95
+ "aria-hidden": "true",
96
+ focusable: "false",
97
+ children: /* @__PURE__ */ c("path", {
98
+ d: "M2 6.5 5 3.5 8 6.5",
99
+ fill: "none",
100
+ stroke: "currentColor",
101
+ strokeWidth: "1.5",
102
+ strokeLinecap: "round",
103
+ strokeLinejoin: "round"
104
+ })
105
+ })
106
+ }), /* @__PURE__ */ c("button", {
107
+ type: "button",
108
+ className: e.stepper,
109
+ "aria-label": L,
110
+ tabIndex: -1,
111
+ disabled: D || X,
112
+ onMouseDown: (e) => e.preventDefault(),
113
+ onClick: () => q(-1),
114
+ children: /* @__PURE__ */ c("svg", {
115
+ viewBox: "0 0 10 10",
116
+ "aria-hidden": "true",
117
+ focusable: "false",
118
+ children: /* @__PURE__ */ c("path", {
119
+ d: "M2 3.5 5 6.5 8 3.5",
120
+ fill: "none",
121
+ stroke: "currentColor",
122
+ strokeWidth: "1.5",
123
+ strokeLinecap: "round",
124
+ strokeLinejoin: "round"
125
+ })
126
+ })
127
+ })]
128
+ })]
129
+ }),
130
+ T && /* @__PURE__ */ c("span", {
131
+ id: `${W}-error`,
132
+ className: e.error,
133
+ role: "alert",
134
+ children: T
135
+ }),
136
+ !T && w && /* @__PURE__ */ c("span", {
137
+ id: `${W}-hint`,
138
+ className: e.hint,
139
+ children: w
140
+ })
141
+ ]
142
+ });
143
+ }
144
+ //#endregion
145
+ export { h as NumberInput };
@@ -0,0 +1,14 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ wrapper: "_wrapper_q5e5w_2",
5
+ label: "_label_q5e5w_27",
6
+ field: "_field_q5e5w_35",
7
+ input: "_input_q5e5w_39",
8
+ steppers: "_steppers_q5e5w_84",
9
+ stepper: "_stepper_q5e5w_84",
10
+ error: "_error_q5e5w_131",
11
+ hint: "_hint_q5e5w_138"
12
+ };
13
+ //#endregion
14
+ export { e as default };
@@ -0,0 +1,70 @@
1
+ "use client";
2
+
3
+ import e from "./otp-input.module.js";
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 } from "react/jsx-runtime";
7
+ import { useRef as s } from "react";
8
+ //#region ../components/src/otp-input/otp-input.tsx
9
+ function c({ length: c = 6, value: l, onValueChange: u, disabled: d = !1, type: f = "numeric", className: p, ...m }) {
10
+ r();
11
+ let h = n(Array.from({ length: c }, (e, t) => l[t] ?? "")), g = s([]), _ = Array.from({ length: c }, (e, t) => l[t] ?? "");
12
+ JSON.stringify(h.value) !== JSON.stringify(_) && (h.value = _);
13
+ function v(e) {
14
+ u(e.join("")), h.value = e;
15
+ }
16
+ function y(e) {
17
+ let t = Math.max(0, Math.min(c - 1, e));
18
+ g.current[t]?.focus();
19
+ }
20
+ function b(e, t) {
21
+ if (!(f === "numeric" ? /^\d$/ : /^[a-zA-Z0-9]$/).test(t)) return;
22
+ let n = [...h.value];
23
+ n[e] = t, v(n), e < c - 1 && y(e + 1);
24
+ }
25
+ function x(e, t) {
26
+ if (t.key === "Backspace") {
27
+ t.preventDefault();
28
+ let n = [...h.value];
29
+ n[e] ? (n[e] = "", v(n)) : e > 0 && (n[e - 1] = "", v(n), y(e - 1));
30
+ } else t.key === "ArrowLeft" ? (t.preventDefault(), y(e - 1)) : t.key === "ArrowRight" && (t.preventDefault(), y(e + 1));
31
+ }
32
+ function S(e, t) {
33
+ let n = t.clipboardData.getData("text").replace(/\s/g, "").slice(0, c - e);
34
+ if (!(f === "numeric" ? /^\d+$/ : /^[a-zA-Z0-9]+$/).test(n)) return;
35
+ t.preventDefault();
36
+ let r = [...h.value];
37
+ for (let t = 0; t < n.length; t++) e + t < c && (r[e + t] = n[t] ?? "");
38
+ v(r), y(Math.min(e + n.length, c - 1));
39
+ }
40
+ let C = a(i.otpInput.label);
41
+ return /* @__PURE__ */ o("div", {
42
+ className: t(e.wrapper, p),
43
+ role: "group",
44
+ "aria-label": C,
45
+ ...m,
46
+ children: h.value.map((t, n) => /* @__PURE__ */ o("input", {
47
+ ref: (e) => {
48
+ g.current[n] = e;
49
+ },
50
+ type: f === "numeric" ? "tel" : "text",
51
+ inputMode: f === "numeric" ? "numeric" : "text",
52
+ className: e.slot,
53
+ value: t,
54
+ maxLength: 1,
55
+ "aria-label": a(i.otpInput.digit, { n: String(n + 1) }),
56
+ autoComplete: n === 0 ? "one-time-code" : "off",
57
+ disabled: d,
58
+ "data-filled": t ? "" : void 0,
59
+ onChange: (e) => {
60
+ let t = e.currentTarget.value.slice(-1);
61
+ t && b(n, t);
62
+ },
63
+ onKeyDown: (e) => x(n, e),
64
+ onPaste: (e) => S(n, e),
65
+ onFocus: (e) => e.currentTarget.select()
66
+ }, n))
67
+ });
68
+ }
69
+ //#endregion
70
+ export { c as OtpInput };
@@ -0,0 +1,8 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ wrapper: "_wrapper_15f1m_2",
5
+ slot: "_slot_15f1m_8"
6
+ };
7
+ //#endregion
8
+ export { e as default };
@@ -0,0 +1,65 @@
1
+ "use client";
2
+
3
+ import { Dropdown as e } from "../dropdown/dropdown.js";
4
+ import t from "./overflow-menu.module.js";
5
+ import { cn as n, useSignals as r } from "@cascivo/core";
6
+ import { builtin as i, t as a } from "@cascivo/i18n";
7
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
8
+ //#region ../components/src/overflow-menu/overflow-menu.tsx
9
+ function l() {
10
+ return /* @__PURE__ */ c("svg", {
11
+ viewBox: "0 0 16 16",
12
+ width: "16",
13
+ height: "16",
14
+ fill: "currentColor",
15
+ "aria-hidden": "true",
16
+ children: [
17
+ /* @__PURE__ */ s("circle", {
18
+ cx: "8",
19
+ cy: "3",
20
+ r: "1.5"
21
+ }),
22
+ /* @__PURE__ */ s("circle", {
23
+ cx: "8",
24
+ cy: "8",
25
+ r: "1.5"
26
+ }),
27
+ /* @__PURE__ */ s("circle", {
28
+ cx: "8",
29
+ cy: "13",
30
+ r: "1.5"
31
+ })
32
+ ]
33
+ });
34
+ }
35
+ function u({ items: u, onSelect: d, placement: f = "bottom-end", ariaLabel: p, size: m = "md", disabled: h = !1, className: g }) {
36
+ r();
37
+ let _ = p ?? a(i.overflowMenu.trigger), v = u.map((e) => {
38
+ let n = {
39
+ label: e.label,
40
+ value: e.value
41
+ };
42
+ return e.disabled !== void 0 && (n.disabled = e.disabled), e.destructive ? n.icon = /* @__PURE__ */ c(o, { children: [e.icon, /* @__PURE__ */ s("span", {
43
+ className: t["destructive-flag"],
44
+ "aria-hidden": "true"
45
+ })] }) : e.icon !== void 0 && (n.icon = e.icon), n;
46
+ });
47
+ return /* @__PURE__ */ s("div", {
48
+ className: n(t.root, g),
49
+ children: /* @__PURE__ */ s(e, {
50
+ items: v,
51
+ onSelect: (e) => d?.(e),
52
+ placement: f,
53
+ trigger: /* @__PURE__ */ s("button", {
54
+ type: "button",
55
+ className: t.trigger,
56
+ "data-size": m,
57
+ disabled: h,
58
+ "aria-label": _,
59
+ children: /* @__PURE__ */ s(l, {})
60
+ })
61
+ })
62
+ });
63
+ }
64
+ //#endregion
65
+ export { u as OverflowMenu };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ root: "_root_14jtg_2",
5
+ trigger: "_trigger_14jtg_6",
6
+ "destructive-flag": "_destructive-flag_14jtg_49"
7
+ };
8
+ //#endregion
9
+ export { e as default };
@@ -0,0 +1,92 @@
1
+ "use client";
2
+
3
+ import e from "./pagination.module.js";
4
+ import { cn as t, useSignals as n } from "@cascivo/core";
5
+ import { builtin as r, t as i } from "@cascivo/i18n";
6
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
+ //#region ../components/src/pagination/pagination.tsx
8
+ var s = [
9
+ 10,
10
+ 25,
11
+ 50,
12
+ 100
13
+ ];
14
+ function c({ page: c, pageSize: l, totalItems: u, onPageChange: d, onPageSizeChange: f, pageSizeOptions: p = s, labels: m, className: h }) {
15
+ n();
16
+ let g = Math.max(1, Math.ceil(u / l)), _ = Math.min(Math.max(c, 1), g), v = u === 0 ? 0 : (_ - 1) * l + 1, y = Math.min(_ * l, u), b = m?.nav ?? i(r.pagination.nav), x = m?.itemsPerPage ?? i(r.pagination.itemsPerPage), S = m?.pageOf?.(_, g) ?? i(r.pagination.pageOf, {
17
+ page: _,
18
+ total: g
19
+ }), C = m?.range?.(v, y, u) ?? i(r.pagination.range, {
20
+ start: v,
21
+ end: y,
22
+ total: u
23
+ }), w = m?.previous ?? i(r.pagination.previous), T = m?.next ?? i(r.pagination.next);
24
+ return /* @__PURE__ */ o("nav", {
25
+ "aria-label": b,
26
+ className: t(e.pagination, h),
27
+ children: [
28
+ f && /* @__PURE__ */ o("label", {
29
+ className: e.group,
30
+ children: [/* @__PURE__ */ a("span", {
31
+ className: e.label,
32
+ children: x
33
+ }), /* @__PURE__ */ a("select", {
34
+ className: e.select,
35
+ value: l,
36
+ onChange: (e) => f(Number(e.target.value)),
37
+ children: p.map((e) => /* @__PURE__ */ a("option", {
38
+ value: e,
39
+ children: e
40
+ }, e))
41
+ })]
42
+ }),
43
+ /* @__PURE__ */ a("span", {
44
+ className: e.range,
45
+ children: C
46
+ }),
47
+ /* @__PURE__ */ o("div", {
48
+ className: e.group,
49
+ children: [/* @__PURE__ */ a("select", {
50
+ className: e.select,
51
+ "aria-label": S,
52
+ value: _,
53
+ onChange: (e) => d(Number(e.target.value)),
54
+ children: Array.from({ length: g }, (e, t) => /* @__PURE__ */ a("option", {
55
+ value: t + 1,
56
+ children: t + 1
57
+ }, t + 1))
58
+ }), /* @__PURE__ */ a("span", {
59
+ className: e.label,
60
+ "aria-hidden": "true",
61
+ children: S
62
+ })]
63
+ }),
64
+ /* @__PURE__ */ o("div", {
65
+ className: e.buttons,
66
+ children: [/* @__PURE__ */ a("button", {
67
+ type: "button",
68
+ className: e.button,
69
+ "aria-label": w,
70
+ disabled: _ <= 1,
71
+ onClick: () => d(_ - 1),
72
+ children: /* @__PURE__ */ a("span", {
73
+ "aria-hidden": "true",
74
+ children: "‹"
75
+ })
76
+ }), /* @__PURE__ */ a("button", {
77
+ type: "button",
78
+ className: e.button,
79
+ "aria-label": T,
80
+ disabled: _ >= g,
81
+ onClick: () => d(_ + 1),
82
+ children: /* @__PURE__ */ a("span", {
83
+ "aria-hidden": "true",
84
+ children: "›"
85
+ })
86
+ })]
87
+ })
88
+ ]
89
+ });
90
+ }
91
+ //#endregion
92
+ export { c as Pagination };
@@ -0,0 +1,13 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ pagination: "_pagination_1rt7c_2",
5
+ group: "_group_1rt7c_13",
6
+ label: "_label_1rt7c_19",
7
+ range: "_range_1rt7c_25",
8
+ select: "_select_1rt7c_35",
9
+ buttons: "_buttons_1rt7c_70",
10
+ button: "_button_1rt7c_70"
11
+ };
12
+ //#endregion
13
+ export { e as default };