@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,39 @@
1
+ "use client";
2
+
3
+ import e from "./tile.module.js";
4
+ import { Slot as t, cn as n, useControllableSignal as r, useSignals as i } from "@cascivo/core";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ //#region ../components/src/tile/tile.tsx
7
+ function s({ value: s, selected: c, defaultSelected: l, onSelect: u, selectable: d = "single", disabled: f, icon: p, asChild: m, children: h, className: g }) {
8
+ i();
9
+ let [_, v] = r({
10
+ value: c,
11
+ defaultValue: l ?? !1,
12
+ onChange: () => u?.(s)
13
+ }), y = () => {
14
+ f || v(d === "multi" ? !_.value : !0);
15
+ };
16
+ return /* @__PURE__ */ o(m ? t : "div", {
17
+ role: d === "multi" ? "checkbox" : "radio",
18
+ "aria-checked": _.value,
19
+ "aria-disabled": f || void 0,
20
+ tabIndex: f ? -1 : 0,
21
+ "data-selected": _.value || void 0,
22
+ "data-disabled": f || void 0,
23
+ className: n(e.tile, g),
24
+ onClick: y,
25
+ onKeyDown: (e) => {
26
+ (e.key === " " || e.key === "Enter") && (e.preventDefault(), y());
27
+ },
28
+ children: [p && /* @__PURE__ */ a("span", {
29
+ className: e.icon,
30
+ "aria-hidden": "true",
31
+ children: p
32
+ }), /* @__PURE__ */ a("span", {
33
+ className: e.body,
34
+ children: h
35
+ })]
36
+ });
37
+ }
38
+ //#endregion
39
+ export { s as Tile };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ tile: "_tile_1wkku_2",
5
+ icon: "_icon_1wkku_36",
6
+ body: "_body_1wkku_49"
7
+ };
8
+ //#endregion
9
+ export { e as default };
@@ -0,0 +1,62 @@
1
+ "use client";
2
+
3
+ import e from "./time-picker.module.js";
4
+ import { cn as t, createMachine as n, useMachine as r, useSignals as i } from "@cascivo/core";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ //#region ../components/src/time-picker/time-picker.tsx
7
+ var s = n({
8
+ initial: "idle",
9
+ states: {
10
+ idle: { on: { FOCUS: "focused" } },
11
+ focused: { on: { BLUR: "idle" } }
12
+ }
13
+ });
14
+ function c({ value: n, defaultValue: c, onValueChange: l, onChange: u, min: d, max: f, step: p, label: m, hint: h, error: g, size: _ = "md", className: v, id: y, onFocus: b, onBlur: x, ...S }) {
15
+ i();
16
+ let [C, w] = r(s), T = y ?? (m ? `cascade-time-picker-${m.toLowerCase().replace(/\s+/g, "-")}` : void 0);
17
+ return /* @__PURE__ */ o("div", {
18
+ className: t(e.wrapper, v),
19
+ "data-state": g ? "error" : C.value,
20
+ "data-size": _,
21
+ children: [
22
+ m && /* @__PURE__ */ a("label", {
23
+ className: e.label,
24
+ htmlFor: T,
25
+ children: m
26
+ }),
27
+ /* @__PURE__ */ a("input", {
28
+ id: T,
29
+ type: "time",
30
+ className: e.input,
31
+ value: n,
32
+ defaultValue: c,
33
+ min: d,
34
+ max: f,
35
+ step: p,
36
+ "aria-invalid": g ? !0 : void 0,
37
+ "aria-describedby": g ? `${T}-error` : h ? `${T}-hint` : void 0,
38
+ onChange: (e) => (l ?? u)?.(e.target.value),
39
+ onFocus: (e) => {
40
+ w("FOCUS"), b?.(e);
41
+ },
42
+ onBlur: (e) => {
43
+ w("BLUR"), x?.(e);
44
+ },
45
+ ...S
46
+ }),
47
+ g && /* @__PURE__ */ a("span", {
48
+ id: `${T}-error`,
49
+ className: e.error,
50
+ role: "alert",
51
+ children: g
52
+ }),
53
+ !g && h && /* @__PURE__ */ a("span", {
54
+ id: `${T}-hint`,
55
+ className: e.hint,
56
+ children: h
57
+ })
58
+ ]
59
+ });
60
+ }
61
+ //#endregion
62
+ export { c as TimePicker };
@@ -0,0 +1,11 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ wrapper: "_wrapper_shh6w_2",
5
+ label: "_label_shh6w_25",
6
+ input: "_input_shh6w_32",
7
+ error: "_error_shh6w_66",
8
+ hint: "_hint_shh6w_71"
9
+ };
10
+ //#endregion
11
+ export { e as default };
@@ -0,0 +1,41 @@
1
+ "use client";
2
+
3
+ import e from "./timeline.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/timeline/timeline.tsx
7
+ function i({ items: i, orientation: a = "vertical", className: o, ...s }) {
8
+ return /* @__PURE__ */ n("ol", {
9
+ "data-orientation": a,
10
+ className: t(e.list, o),
11
+ ...s,
12
+ children: i.map((t) => /* @__PURE__ */ r("li", {
13
+ "data-status": t.status ?? "upcoming",
14
+ "aria-current": t.status === "current" ? "step" : void 0,
15
+ className: e.item,
16
+ children: [/* @__PURE__ */ n("span", {
17
+ className: e.marker,
18
+ "aria-hidden": "true",
19
+ children: t.icon
20
+ }), /* @__PURE__ */ r("div", {
21
+ className: e.content,
22
+ children: [
23
+ /* @__PURE__ */ n("div", {
24
+ className: e.title,
25
+ children: t.title
26
+ }),
27
+ t.time ? /* @__PURE__ */ n("time", {
28
+ className: e.time,
29
+ children: t.time
30
+ }) : null,
31
+ t.description ? /* @__PURE__ */ n("div", {
32
+ className: e.description,
33
+ children: t.description
34
+ }) : null
35
+ ]
36
+ })]
37
+ }, t.id))
38
+ });
39
+ }
40
+ //#endregion
41
+ export { i as Timeline };
@@ -0,0 +1,13 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ list: "_list_1f4du_2",
5
+ item: "_item_1f4du_21",
6
+ marker: "_marker_1f4du_63",
7
+ content: "_content_1f4du_96",
8
+ title: "_title_1f4du_103",
9
+ time: "_time_1f4du_110",
10
+ description: "_description_1f4du_115"
11
+ };
12
+ //#endregion
13
+ export { e as default };
@@ -0,0 +1,85 @@
1
+ "use client";
2
+
3
+ import e from "./toast.module.js";
4
+ import { createMachine as t, signal as n, useMachine as r, useSignalEffect as i, useSignals as a } from "@cascivo/core";
5
+ import { builtin as o, t as s } from "@cascivo/i18n";
6
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
7
+ import { useRef as d } from "react";
8
+ //#region ../components/src/toast/toast.tsx
9
+ var f = 5e3, p = 160, m = 0, h = n([]);
10
+ function g(e) {
11
+ h.value = [...h.value, {
12
+ id: m++,
13
+ ...e
14
+ }];
15
+ }
16
+ function _(e) {
17
+ h.value = h.value.filter((t) => t.id !== e);
18
+ }
19
+ function v({ children: t }) {
20
+ a();
21
+ let n = h.value.slice(-3);
22
+ return /* @__PURE__ */ u(c, { children: [t, /* @__PURE__ */ l("div", {
23
+ className: e.viewport,
24
+ role: "region",
25
+ "aria-label": s(o.toast.region),
26
+ children: n.map((e) => /* @__PURE__ */ l(b, {
27
+ toast: e,
28
+ onDismiss: () => _(e.id)
29
+ }, e.id))
30
+ })] });
31
+ }
32
+ var y = t({
33
+ initial: "visible",
34
+ states: {
35
+ visible: { on: { DISMISS: "dismissing" } },
36
+ dismissing: { on: { END: "gone" } }
37
+ }
38
+ });
39
+ function b({ toast: t, onDismiss: n }) {
40
+ a();
41
+ let [c, m] = r(y), h = d(n);
42
+ h.current = n;
43
+ let g = t.duration ?? f, _ = t.variant === "destructive";
44
+ return i(() => {
45
+ let e = c.value;
46
+ if (e === "visible") {
47
+ let e = setTimeout(() => m("DISMISS"), g);
48
+ return () => clearTimeout(e);
49
+ }
50
+ if (e === "dismissing") {
51
+ let e = setTimeout(() => h.current(), p);
52
+ return () => clearTimeout(e);
53
+ }
54
+ }), /* @__PURE__ */ u("div", {
55
+ role: _ ? "alert" : "status",
56
+ "aria-live": _ ? "assertive" : "polite",
57
+ "data-variant": t.variant ?? "default",
58
+ "data-state": c.value,
59
+ className: e.toast,
60
+ children: [/* @__PURE__ */ u("div", {
61
+ className: e.body,
62
+ children: [/* @__PURE__ */ l("div", {
63
+ className: e.title,
64
+ children: t.title
65
+ }), t.description && /* @__PURE__ */ l("div", {
66
+ className: e.description,
67
+ children: t.description
68
+ })]
69
+ }), /* @__PURE__ */ l("button", {
70
+ type: "button",
71
+ className: e.close,
72
+ "aria-label": s(o.toast.dismiss),
73
+ onClick: () => m("DISMISS"),
74
+ children: "✕"
75
+ })]
76
+ });
77
+ }
78
+ function x() {
79
+ return { toast: g };
80
+ }
81
+ function S() {
82
+ h.value = [];
83
+ }
84
+ //#endregion
85
+ export { v as ToastProvider, S as dismissAllToasts, x as useToast };
@@ -0,0 +1,13 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ viewport: "_viewport_cshyp_2",
5
+ toast: "_toast_cshyp_23",
6
+ icon: "_icon_cshyp_62",
7
+ title: "_title_cshyp_63",
8
+ body: "_body_cshyp_92",
9
+ description: "_description_cshyp_108",
10
+ close: "_close_cshyp_115"
11
+ };
12
+ //#endregion
13
+ export { e as default };
@@ -0,0 +1,42 @@
1
+ "use client";
2
+
3
+ import e from "./toc.module.js";
4
+ import { cn as t, useSignal as n, useSignalEffect as r, useSignals as i } from "@cascivo/core";
5
+ import { builtin as a, t as o } from "@cascivo/i18n";
6
+ import { jsx as s } from "react/jsx-runtime";
7
+ import { useRef as c } from "react";
8
+ //#region ../components/src/toc/toc.tsx
9
+ function l({ items: l, activeId: u, onActiveChange: d, labels: f, className: p }) {
10
+ i();
11
+ let m = u !== void 0, h = n(u ?? l[0]?.id ?? "");
12
+ m && (h.value = u);
13
+ let g = c(d);
14
+ return g.current = d, r(() => {
15
+ if (m || typeof document > "u" || typeof IntersectionObserver > "u") return;
16
+ let e = l.map((e) => document.getElementById(e.id)).filter((e) => e !== null);
17
+ if (e.length === 0) return;
18
+ let t = /* @__PURE__ */ new Set(), n = new IntersectionObserver((e) => {
19
+ for (let n of e) n.isIntersecting ? t.add(n.target.id) : t.delete(n.target.id);
20
+ let n = l.find((e) => t.has(e.id));
21
+ n && n.id !== h.value && (h.value = n.id, g.current?.(n.id));
22
+ }, {
23
+ rootMargin: "0px 0px -70% 0px",
24
+ threshold: 0
25
+ });
26
+ for (let t of e) n.observe(t);
27
+ return () => n.disconnect();
28
+ }), /* @__PURE__ */ s("nav", {
29
+ "aria-label": f?.nav ?? o(a.toc.nav),
30
+ className: t(e.toc, p),
31
+ children: /* @__PURE__ */ s("ol", { children: l.map((e) => /* @__PURE__ */ s("li", {
32
+ style: { "--toc-level": e.level ?? 2 },
33
+ children: /* @__PURE__ */ s("a", {
34
+ href: `#${e.id}`,
35
+ "aria-current": e.id === h.value ? "location" : void 0,
36
+ children: e.label
37
+ })
38
+ }, e.id)) })
39
+ });
40
+ }
41
+ //#endregion
42
+ export { l as Toc };
@@ -0,0 +1,5 @@
1
+ "use client";
2
+
3
+ var e = { toc: "_toc_1w9fk_2" };
4
+ //#endregion
5
+ export { e as default };
@@ -0,0 +1,18 @@
1
+ "use client";
2
+
3
+ import { useSignal as e, useSignalEffect as t, useSignals as n } from "@cascivo/core";
4
+ //#region ../components/src/toc/use-toc-from-region.ts
5
+ function r(r, i = {}) {
6
+ n();
7
+ let a = i.selector ?? "h2, h3, h4", o = e([]);
8
+ return t(() => {
9
+ let e = r.current;
10
+ e && (o.value = Array.from(e.querySelectorAll(a)).filter((e) => e.id !== "").map((e) => ({
11
+ id: e.id,
12
+ label: e.textContent?.trim() ?? "",
13
+ level: Number(e.tagName.slice(1)) || 2
14
+ })));
15
+ }), o;
16
+ }
17
+ //#endregion
18
+ export { r as useTocFromRegion };
@@ -0,0 +1,39 @@
1
+ "use client";
2
+
3
+ import e from "./toggle.module.js";
4
+ import { cn as t, createMachine as n, useMachine as r, useSignals as i } from "@cascivo/core";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ //#region ../components/src/toggle/toggle.tsx
7
+ function s({ checked: s, defaultChecked: c = !1, onValueChange: l, onChange: u, label: d, size: f = "md", className: p, disabled: m, ...h }) {
8
+ i();
9
+ let [g, _] = r(n({
10
+ initial: c ? "on" : "off",
11
+ states: {
12
+ off: { on: { TOGGLE: "on" } },
13
+ on: { on: { TOGGLE: "off" } }
14
+ }
15
+ })), v = s !== void 0, y = v ? s : g.value === "on";
16
+ return /* @__PURE__ */ o("button", {
17
+ type: "button",
18
+ role: "switch",
19
+ "aria-checked": y,
20
+ "data-state": y ? "on" : "off",
21
+ "data-size": f,
22
+ disabled: m,
23
+ className: t(e.toggle, p),
24
+ onClick: () => {
25
+ v || _("TOGGLE"), (l ?? u)?.(!y);
26
+ },
27
+ ...h,
28
+ children: [/* @__PURE__ */ a("span", {
29
+ className: e.track,
30
+ "aria-hidden": "true",
31
+ children: /* @__PURE__ */ a("span", { className: e.thumb })
32
+ }), d && /* @__PURE__ */ a("span", {
33
+ className: e.label,
34
+ children: d
35
+ })]
36
+ });
37
+ }
38
+ //#endregion
39
+ export { s as Toggle };
@@ -0,0 +1,10 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ toggle: "_toggle_1vvuo_2",
5
+ track: "_track_1vvuo_33",
6
+ thumb: "_thumb_1vvuo_53",
7
+ label: "_label_1vvuo_66"
8
+ };
9
+ //#endregion
10
+ export { e as default };
@@ -0,0 +1,55 @@
1
+ "use client";
2
+
3
+ import e from "./toggle-group.module.js";
4
+ import { cn as t, useControllableSignal as n, useRovingFocus as r, useSignals as i } from "@cascivo/core";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ import { forwardRef as s } from "react";
7
+ //#region ../components/src/toggle-group/toggle-group.tsx
8
+ function c(e, t) {
9
+ return Array.isArray(e) ? e.includes(t) : e === t;
10
+ }
11
+ var l = s(function({ type: s, value: l, defaultValue: u, onValueChange: d, items: f, orientation: p = "horizontal", size: m = "md", disabled: h = !1, className: g, ..._ }, v) {
12
+ i();
13
+ let [y, b] = n({
14
+ value: l,
15
+ defaultValue: u ?? (s === "multiple" ? [] : ""),
16
+ onChange: d
17
+ }), x = r({
18
+ orientation: p,
19
+ loop: !0
20
+ }), S = (e) => {
21
+ let t = y.value;
22
+ if (s === "multiple") {
23
+ let n = Array.isArray(t) ? t : [];
24
+ b(n.includes(e) ? n.filter((t) => t !== e) : [...n, e]);
25
+ } else b(t === e ? "" : e);
26
+ };
27
+ return /* @__PURE__ */ a("div", {
28
+ role: s === "single" ? "radiogroup" : "group",
29
+ "data-orientation": p,
30
+ "data-size": m,
31
+ className: t(e.toggleGroup, g),
32
+ ref: v,
33
+ ..._,
34
+ children: f.map((t, n) => {
35
+ let r = c(y.value, t.value), i = h || t.disabled, { ref: l, ...u } = x.getItemProps(n);
36
+ return /* @__PURE__ */ o("button", {
37
+ type: "button",
38
+ ...s === "single" ? {
39
+ role: "radio",
40
+ "aria-checked": r
41
+ } : { "aria-pressed": r },
42
+ ...u,
43
+ ref: l,
44
+ "data-state": r ? "on" : "off",
45
+ disabled: i,
46
+ "aria-label": t.icon && !t.label ? t.value : void 0,
47
+ className: e.item,
48
+ onClick: () => S(t.value),
49
+ children: [t.icon, t.label && /* @__PURE__ */ a("span", { children: t.label })]
50
+ }, t.value);
51
+ })
52
+ });
53
+ });
54
+ //#endregion
55
+ export { l as ToggleGroup };
@@ -0,0 +1,8 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ toggleGroup: "_toggleGroup_s4o5x_2",
5
+ item: "_item_s4o5x_33"
6
+ };
7
+ //#endregion
8
+ export { e as default };
@@ -0,0 +1,49 @@
1
+ "use client";
2
+
3
+ import e from "./toggletip.module.js";
4
+ import { DismissableLayer as t, cn as n, useAnchorPosition as r, useControllableSignal as i, useSignals as a } from "@cascivo/core";
5
+ import { builtin as o, t as s } from "@cascivo/i18n";
6
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
7
+ import { useId as u, useRef as d } from "react";
8
+ //#region ../components/src/toggletip/toggletip.tsx
9
+ function f({ trigger: f, children: p, placement: m = "top", defaultOpen: h = !1, open: g, onOpenChange: _, labels: v, className: y }) {
10
+ a();
11
+ let [b, x] = i({
12
+ ...g !== void 0 && { value: g },
13
+ defaultValue: h,
14
+ ..._ && { onChange: _ }
15
+ }), S = d(null), C = d(null), w = u(), { anchorStyle: T, floatingStyle: E } = r({
16
+ anchorRef: S,
17
+ floatingRef: C,
18
+ placement: m,
19
+ enabled: b
20
+ });
21
+ return /* @__PURE__ */ l("span", {
22
+ className: n(e.root, y),
23
+ children: [/* @__PURE__ */ c("button", {
24
+ ref: S,
25
+ type: "button",
26
+ className: e.trigger,
27
+ "aria-expanded": b.value,
28
+ "aria-controls": w,
29
+ "aria-label": v?.label ?? s(o.toggletip.label),
30
+ style: T,
31
+ onClick: () => x(!b.value),
32
+ children: f
33
+ }), b.value ? /* @__PURE__ */ c(t, {
34
+ onDismiss: () => x(!1),
35
+ children: /* @__PURE__ */ c("div", {
36
+ ref: C,
37
+ id: w,
38
+ role: "status",
39
+ "data-state": "open",
40
+ "data-placement": m,
41
+ className: e.bubble,
42
+ style: E,
43
+ children: p
44
+ })
45
+ }) : null]
46
+ });
47
+ }
48
+ //#endregion
49
+ export { f as Toggletip };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ root: "_root_1t09l_2",
5
+ trigger: "_trigger_1t09l_7",
6
+ bubble: "_bubble_1t09l_28"
7
+ };
8
+ //#endregion
9
+ export { e as default };
@@ -0,0 +1,58 @@
1
+ "use client";
2
+
3
+ import e from "./tooltip.module.js";
4
+ import { createMachine as t, useId as n, useMachine as r, useSignalEffect as i, useSignals as a } from "@cascivo/core";
5
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
+ import { cloneElement as c, useRef as l } from "react";
7
+ //#region ../components/src/tooltip/tooltip.tsx
8
+ var u = t({
9
+ initial: "hidden",
10
+ states: {
11
+ hidden: { on: { SHOW: "visible" } },
12
+ visible: { on: { HIDE: "hidden" } }
13
+ }
14
+ });
15
+ function d({ content: t, placement: d = "top", children: f, delay: p = 200 }) {
16
+ a();
17
+ let [m, h] = r(u), g = n("cascivo-tooltip"), _ = n("cascivo-anchor"), v = l(void 0), y = l(null), b = m.value === "visible", x = () => {
18
+ clearTimeout(v.current), v.current = setTimeout(() => h("SHOW"), p);
19
+ }, S = () => {
20
+ clearTimeout(v.current), h("HIDE");
21
+ };
22
+ i(() => () => clearTimeout(v.current)), i(() => {
23
+ m.value === "visible" ? y.current?.showPopover() : y.current?.hidePopover();
24
+ });
25
+ let C = f, w = C.props, T = {
26
+ id: _,
27
+ style: { anchorName: `--tooltip-${_}` },
28
+ onMouseEnter: (e) => {
29
+ w.onMouseEnter?.(e), x();
30
+ },
31
+ onMouseLeave: (e) => {
32
+ w.onMouseLeave?.(e), S();
33
+ },
34
+ onFocus: (e) => {
35
+ w.onFocus?.(e), x();
36
+ },
37
+ onBlur: (e) => {
38
+ w.onBlur?.(e), S();
39
+ },
40
+ "aria-describedby": b ? g : w["aria-describedby"]
41
+ };
42
+ return /* @__PURE__ */ s("span", {
43
+ className: e.root,
44
+ children: [c(C, T), /* @__PURE__ */ o("span", {
45
+ ref: y,
46
+ popover: "manual",
47
+ role: "tooltip",
48
+ id: g,
49
+ "data-placement": d,
50
+ "data-state": b ? "visible" : "hidden",
51
+ "data-anchor": `--tooltip-${_}`,
52
+ className: e.tooltip,
53
+ children: t
54
+ })]
55
+ });
56
+ }
57
+ //#endregion
58
+ export { d as Tooltip };
@@ -0,0 +1,8 @@
1
+ "use client";
2
+
3
+ var e = {
4
+ root: "_root_1t9q1_2",
5
+ tooltip: "_tooltip_1t9q1_7"
6
+ };
7
+ //#endregion
8
+ export { e as default };