@cascivo/react 0.12.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/dist/accordion/accordion.js +46 -44
  2. package/dist/action-sheet/action-sheet.js +16 -16
  3. package/dist/alert-dialog/alert-dialog.js +34 -34
  4. package/dist/app-shell/app-shell.css +1 -1
  5. package/dist/app-shell/app-shell.js +36 -33
  6. package/dist/app-shell/app-shell.module.js +8 -8
  7. package/dist/avatar-group/avatar-group.js +6 -6
  8. package/dist/badge/badge.js +17 -10
  9. package/dist/bottom-sheet/bottom-sheet.js +18 -18
  10. package/dist/button/button.css +1 -1
  11. package/dist/button/button.js +15 -12
  12. package/dist/button/button.module.js +1 -1
  13. package/dist/button-group/button-group.js +8 -8
  14. package/dist/card/card.css +1 -1
  15. package/dist/card/card.module.js +8 -8
  16. package/dist/carousel/carousel.js +20 -20
  17. package/dist/checkbox/checkbox.js +21 -21
  18. package/dist/checkbox-card/checkbox-card.js +15 -13
  19. package/dist/collapsible/collapsible.js +7 -7
  20. package/dist/color-picker/color-picker.js +26 -26
  21. package/dist/combobox/combobox.css +1 -1
  22. package/dist/combobox/combobox.js +86 -86
  23. package/dist/combobox/combobox.module.js +15 -15
  24. package/dist/command-menu/command-menu.js +111 -111
  25. package/dist/comparison/comparison.js +10 -10
  26. package/dist/context-menu/context-menu.js +9 -9
  27. package/dist/copy-button/copy-button.js +18 -16
  28. package/dist/data-table/data-table.css +1 -1
  29. package/dist/data-table/data-table.js +8 -2
  30. package/dist/data-table/data-table.module.js +29 -29
  31. package/dist/date-picker/date-picker.css +1 -1
  32. package/dist/date-picker/date-picker.js +25 -25
  33. package/dist/date-picker/date-picker.module.js +19 -19
  34. package/dist/date-range-picker/date-range-picker.js +26 -26
  35. package/dist/drawer/drawer.css +1 -1
  36. package/dist/drawer/drawer.js +18 -17
  37. package/dist/drawer/drawer.module.js +9 -9
  38. package/dist/dropdown/dropdown.js +48 -48
  39. package/dist/editable/editable.js +11 -11
  40. package/dist/fab/fab.js +53 -53
  41. package/dist/field/field.js +8 -8
  42. package/dist/file-uploader/file-uploader.css +1 -1
  43. package/dist/file-uploader/file-uploader.js +19 -19
  44. package/dist/file-uploader/file-uploader.module.js +14 -14
  45. package/dist/filter/filter.js +10 -9
  46. package/dist/header-panel/header-panel.js +31 -31
  47. package/dist/hover-card/hover-card.js +21 -21
  48. package/dist/icon-button/icon-button.css +1 -1
  49. package/dist/icon-button/icon-button.js +5 -5
  50. package/dist/icon-button/icon-button.module.js +1 -1
  51. package/dist/index.d.ts +1475 -251
  52. package/dist/input/input.css +1 -1
  53. package/dist/input/input.js +22 -21
  54. package/dist/input/input.module.js +5 -5
  55. package/dist/item/item.css +1 -1
  56. package/dist/item/item.module.js +6 -6
  57. package/dist/layouts/src/page-header/page-header.css +1 -0
  58. package/dist/layouts/src/page-header/page-header.js +33 -0
  59. package/dist/layouts/src/page-header/page-header.module.js +13 -0
  60. package/dist/link/link.js +14 -12
  61. package/dist/log-viewer/log-viewer.js +26 -26
  62. package/dist/menu/menu.js +20 -20
  63. package/dist/menu-button/menu-button.js +48 -48
  64. package/dist/menubar/menubar.js +42 -42
  65. package/dist/modal/modal.css +1 -1
  66. package/dist/modal/modal.js +41 -35
  67. package/dist/modal/modal.module.js +8 -7
  68. package/dist/multi-select/multi-select.css +1 -1
  69. package/dist/multi-select/multi-select.js +57 -57
  70. package/dist/multi-select/multi-select.module.js +11 -11
  71. package/dist/native-select/native-select.js +13 -11
  72. package/dist/navigation-menu/navigation-menu.js +46 -46
  73. package/dist/node/accordion/accordion.js +46 -44
  74. package/dist/node/action-sheet/action-sheet.js +16 -16
  75. package/dist/node/alert-dialog/alert-dialog.js +34 -34
  76. package/dist/node/app-shell/app-shell.js +36 -33
  77. package/dist/node/app-shell/app-shell.module.js +8 -8
  78. package/dist/node/avatar-group/avatar-group.js +6 -6
  79. package/dist/node/badge/badge.js +17 -10
  80. package/dist/node/bottom-sheet/bottom-sheet.js +18 -18
  81. package/dist/node/button/button.js +15 -12
  82. package/dist/node/button/button.module.js +1 -1
  83. package/dist/node/button-group/button-group.js +8 -8
  84. package/dist/node/card/card.module.js +8 -8
  85. package/dist/node/carousel/carousel.js +20 -20
  86. package/dist/node/checkbox/checkbox.js +21 -21
  87. package/dist/node/checkbox-card/checkbox-card.js +15 -13
  88. package/dist/node/collapsible/collapsible.js +7 -7
  89. package/dist/node/color-picker/color-picker.js +26 -26
  90. package/dist/node/combobox/combobox.js +86 -86
  91. package/dist/node/combobox/combobox.module.js +15 -15
  92. package/dist/node/command-menu/command-menu.js +111 -111
  93. package/dist/node/comparison/comparison.js +10 -10
  94. package/dist/node/context-menu/context-menu.js +9 -9
  95. package/dist/node/copy-button/copy-button.js +18 -16
  96. package/dist/node/data-table/data-table.js +8 -2
  97. package/dist/node/data-table/data-table.module.js +29 -29
  98. package/dist/node/date-picker/date-picker.js +25 -25
  99. package/dist/node/date-picker/date-picker.module.js +19 -19
  100. package/dist/node/date-range-picker/date-range-picker.js +26 -26
  101. package/dist/node/drawer/drawer.js +18 -17
  102. package/dist/node/drawer/drawer.module.js +9 -9
  103. package/dist/node/dropdown/dropdown.js +48 -48
  104. package/dist/node/editable/editable.js +11 -11
  105. package/dist/node/fab/fab.js +53 -53
  106. package/dist/node/field/field.js +8 -8
  107. package/dist/node/file-uploader/file-uploader.js +19 -19
  108. package/dist/node/file-uploader/file-uploader.module.js +14 -14
  109. package/dist/node/filter/filter.js +10 -9
  110. package/dist/node/header-panel/header-panel.js +31 -31
  111. package/dist/node/hover-card/hover-card.js +21 -21
  112. package/dist/node/icon-button/icon-button.js +5 -5
  113. package/dist/node/icon-button/icon-button.module.js +1 -1
  114. package/dist/node/input/input.js +22 -21
  115. package/dist/node/input/input.module.js +5 -5
  116. package/dist/node/item/item.module.js +6 -6
  117. package/dist/node/layouts/src/page-header/page-header.js +33 -0
  118. package/dist/node/layouts/src/page-header/page-header.module.js +12 -0
  119. package/dist/node/link/link.js +14 -12
  120. package/dist/node/log-viewer/log-viewer.js +26 -26
  121. package/dist/node/menu/menu.js +20 -20
  122. package/dist/node/menu-button/menu-button.js +48 -48
  123. package/dist/node/menubar/menubar.js +42 -42
  124. package/dist/node/modal/modal.js +41 -35
  125. package/dist/node/modal/modal.module.js +8 -7
  126. package/dist/node/multi-select/multi-select.js +57 -57
  127. package/dist/node/multi-select/multi-select.module.js +11 -11
  128. package/dist/node/native-select/native-select.js +13 -11
  129. package/dist/node/navigation-menu/navigation-menu.js +46 -46
  130. package/dist/node/notification/notification.js +50 -44
  131. package/dist/node/notification/notification.module.js +7 -7
  132. package/dist/node/number-input/number-input.js +52 -50
  133. package/dist/node/number-input/number-input.module.js +8 -8
  134. package/dist/node/otp-input/otp-input.js +8 -8
  135. package/dist/node/otp-input/otp-input.module.js +2 -2
  136. package/dist/node/overflow-menu/overflow-menu.js +18 -13
  137. package/dist/node/password-input/password-input.js +28 -27
  138. package/dist/node/password-input/password-input.module.js +7 -7
  139. package/dist/node/popover/popover.js +26 -24
  140. package/dist/node/progress/progress.js +3 -2
  141. package/dist/node/pull-to-refresh/pull-to-refresh.js +13 -13
  142. package/dist/node/radial-progress/radial-progress.js +5 -5
  143. package/dist/node/radio/radio.js +23 -22
  144. package/dist/node/radio-card/radio-card.js +27 -26
  145. package/dist/node/react/src/index.js +4 -3
  146. package/dist/node/react/src/theme.js +30 -19
  147. package/dist/node/resizable/resizable.js +11 -11
  148. package/dist/node/scroll-area/scroll-area.js +4 -4
  149. package/dist/node/search/search.js +49 -49
  150. package/dist/node/search/search.module.js +5 -5
  151. package/dist/node/select/select.js +27 -26
  152. package/dist/node/sheet/sheet.js +11 -10
  153. package/dist/node/sheet/sheet.module.js +5 -5
  154. package/dist/node/side-nav/side-nav.js +91 -91
  155. package/dist/node/skip-nav/skip-nav.js +12 -12
  156. package/dist/node/slider/slider.js +13 -11
  157. package/dist/node/stat/stat.js +6 -5
  158. package/dist/node/stat/stat.module.js +7 -7
  159. package/dist/node/status/status.js +18 -11
  160. package/dist/node/steps/steps.js +23 -23
  161. package/dist/node/structured-list/structured-list.js +33 -32
  162. package/dist/node/tabs/tabs.js +49 -47
  163. package/dist/node/tag/tag.js +22 -15
  164. package/dist/node/tags-input/tags-input.js +35 -35
  165. package/dist/node/tags-input/tags-input.module.js +4 -4
  166. package/dist/node/textarea/textarea.js +22 -21
  167. package/dist/node/tile/tile.module.js +3 -3
  168. package/dist/node/time-picker/time-picker.js +22 -21
  169. package/dist/node/time-picker/time-picker.module.js +5 -5
  170. package/dist/node/timeline/timeline.js +22 -16
  171. package/dist/node/toast/toast.js +15 -15
  172. package/dist/node/toc/toc.js +8 -8
  173. package/dist/node/toggle/toggle.js +15 -13
  174. package/dist/node/toggle-group/toggle-group.js +10 -10
  175. package/dist/node/toggletip/toggletip.js +9 -9
  176. package/dist/node/tooltip/tooltip.js +5 -5
  177. package/dist/node/tree-view/tree-view.js +32 -32
  178. package/dist/notification/notification.css +1 -1
  179. package/dist/notification/notification.js +50 -44
  180. package/dist/notification/notification.module.js +7 -7
  181. package/dist/number-input/number-input.css +1 -1
  182. package/dist/number-input/number-input.js +52 -50
  183. package/dist/number-input/number-input.module.js +8 -8
  184. package/dist/otp-input/otp-input.css +1 -1
  185. package/dist/otp-input/otp-input.js +8 -8
  186. package/dist/otp-input/otp-input.module.js +2 -2
  187. package/dist/overflow-menu/overflow-menu.js +18 -13
  188. package/dist/password-input/password-input.css +1 -1
  189. package/dist/password-input/password-input.js +28 -27
  190. package/dist/password-input/password-input.module.js +7 -7
  191. package/dist/popover/popover.js +26 -24
  192. package/dist/progress/progress.js +3 -2
  193. package/dist/pull-to-refresh/pull-to-refresh.js +13 -13
  194. package/dist/radial-progress/radial-progress.js +5 -5
  195. package/dist/radio/radio.js +23 -22
  196. package/dist/radio-card/radio-card.js +27 -26
  197. package/dist/react/src/index.js +4 -3
  198. package/dist/react/src/theme.js +30 -19
  199. package/dist/resizable/resizable.js +11 -11
  200. package/dist/scroll-area/scroll-area.js +4 -4
  201. package/dist/search/search.css +1 -1
  202. package/dist/search/search.js +49 -49
  203. package/dist/search/search.module.js +5 -5
  204. package/dist/select/select.js +27 -26
  205. package/dist/sheet/sheet.css +1 -1
  206. package/dist/sheet/sheet.js +11 -10
  207. package/dist/sheet/sheet.module.js +5 -5
  208. package/dist/side-nav/side-nav.js +91 -91
  209. package/dist/skip-nav/skip-nav.js +12 -12
  210. package/dist/slider/slider.js +13 -11
  211. package/dist/stat/stat.css +1 -1
  212. package/dist/stat/stat.js +6 -5
  213. package/dist/stat/stat.module.js +7 -7
  214. package/dist/status/status.js +18 -11
  215. package/dist/steps/steps.js +23 -23
  216. package/dist/structured-list/structured-list.js +33 -32
  217. package/dist/styles.css +87 -23
  218. package/dist/tabs/tabs.js +49 -47
  219. package/dist/tag/tag.js +22 -15
  220. package/dist/tags-input/tags-input.css +1 -1
  221. package/dist/tags-input/tags-input.js +35 -35
  222. package/dist/tags-input/tags-input.module.js +4 -4
  223. package/dist/textarea/textarea.js +22 -21
  224. package/dist/tile/tile.css +1 -1
  225. package/dist/tile/tile.module.js +3 -3
  226. package/dist/time-picker/time-picker.css +1 -1
  227. package/dist/time-picker/time-picker.js +22 -21
  228. package/dist/time-picker/time-picker.module.js +5 -5
  229. package/dist/timeline/timeline.js +22 -16
  230. package/dist/toast/toast.js +15 -15
  231. package/dist/toc/toc.js +8 -8
  232. package/dist/toggle/toggle.js +15 -13
  233. package/dist/toggle-group/toggle-group.js +10 -10
  234. package/dist/toggletip/toggletip.js +9 -9
  235. package/dist/tooltip/tooltip.js +5 -5
  236. package/dist/tree-view/tree-view.js +32 -32
  237. package/package.json +10 -4
@@ -2,11 +2,11 @@
2
2
 
3
3
  import e from "./password-input.module.js";
4
4
  import { cn as t, useSignal as n, useSignals as r } from "@cascivo/core";
5
- import { builtin as i, t as a } from "@cascivo/i18n";
6
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
- import { useId as c } from "react";
5
+ import { forwardRef as i, useId as a } from "react";
6
+ import { builtin as o, t as s } from "@cascivo/i18n";
7
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
8
  //#region ../components/src/password-input/password-input.tsx
9
- function l(e) {
9
+ function u(e) {
10
10
  if (!e) return {
11
11
  score: 0,
12
12
  label: "weak"
@@ -23,58 +23,59 @@ function l(e) {
23
23
  ][t]
24
24
  };
25
25
  }
26
- function u({ showStrengthMeter: u = !1, size: d = "md", labels: f, className: p, id: m, value: h, defaultValue: g, onChange: _, ...v }) {
26
+ var d = i(function({ showStrengthMeter: i = !1, size: d = "md", labels: f, className: p, id: m, value: h, defaultValue: g, onChange: _, ...v }, y) {
27
27
  r();
28
- let y = n(!1), b = n(typeof h == "string" ? h : typeof g == "string" ? g : "");
29
- typeof h == "string" && (b.value = h);
30
- let x = c(), S = m ?? `cascade-password-${x}`, C = u ? l(b.value) : null, w = y.value ? f?.hide ?? a(i.passwordInput.hide) : f?.reveal ?? a(i.passwordInput.reveal), T = C ? f?.strengthLabel ? f.strengthLabel(C.label) : a(i.passwordInput.strengthLabel, { level: C.label }) : void 0;
31
- return /* @__PURE__ */ s("div", {
28
+ let b = n(!1), x = n(typeof h == "string" ? h : typeof g == "string" ? g : "");
29
+ typeof h == "string" && (x.value = h);
30
+ let S = a(), C = m ?? `cascade-password-${S}`, w = i ? u(x.value) : null, T = b.value ? f?.hide ?? s(o.passwordInput.hide) : f?.reveal ?? s(o.passwordInput.reveal), E = w ? f?.strengthLabel ? f.strengthLabel(w.label) : s(o.passwordInput.strengthLabel, { level: w.label }) : void 0;
31
+ return /* @__PURE__ */ l("div", {
32
32
  className: t(e.wrapper, p),
33
33
  "data-size": d,
34
- "data-revealed": y.value ? "" : void 0,
35
- children: [/* @__PURE__ */ s("div", {
34
+ "data-revealed": b.value ? "" : void 0,
35
+ children: [/* @__PURE__ */ l("div", {
36
36
  className: e["input-row"],
37
- children: [/* @__PURE__ */ o("input", {
37
+ children: [/* @__PURE__ */ c("input", {
38
+ ref: y,
38
39
  ...v,
39
- id: S,
40
- type: y.value ? "text" : "password",
40
+ id: C,
41
+ type: b.value ? "text" : "password",
41
42
  className: e.input,
42
43
  value: h,
43
44
  defaultValue: g,
44
45
  onChange: (e) => {
45
- typeof h != "string" && (b.value = e.currentTarget.value), _?.(e);
46
+ typeof h != "string" && (x.value = e.currentTarget.value), _?.(e);
46
47
  }
47
- }), /* @__PURE__ */ o("button", {
48
+ }), /* @__PURE__ */ c("button", {
48
49
  type: "button",
49
50
  className: e["reveal-btn"],
50
- "aria-label": w,
51
+ "aria-label": T,
51
52
  onClick: () => {
52
- y.value = !y.value;
53
+ b.value = !b.value;
53
54
  },
54
- children: /* @__PURE__ */ o("span", {
55
+ children: /* @__PURE__ */ c("span", {
55
56
  className: e["reveal-icon"],
56
57
  "aria-hidden": "true"
57
58
  })
58
59
  })]
59
- }), u && C && /* @__PURE__ */ o("div", {
60
+ }), i && w && /* @__PURE__ */ c("div", {
60
61
  className: e["strength-meter"],
61
62
  role: "meter",
62
- "aria-label": T,
63
- "aria-valuenow": C.score,
63
+ "aria-label": E,
64
+ "aria-valuenow": w.score,
64
65
  "aria-valuemin": 0,
65
66
  "aria-valuemax": 4,
66
- "data-strength": C.label,
67
+ "data-strength": w.label,
67
68
  children: [
68
69
  0,
69
70
  1,
70
71
  2,
71
72
  3
72
- ].map((t) => /* @__PURE__ */ o("div", {
73
+ ].map((t) => /* @__PURE__ */ c("div", {
73
74
  className: e["strength-segment"],
74
- "data-filled": t < C.score ? "" : void 0
75
+ "data-filled": t < w.score ? "" : void 0
75
76
  }, t))
76
77
  })]
77
78
  });
78
- }
79
+ });
79
80
  //#endregion
80
- export { u as PasswordInput };
81
+ export { d as PasswordInput };
@@ -2,13 +2,13 @@
2
2
 
3
3
  import './password-input.css';
4
4
  var e = {
5
- wrapper: "_wrapper_r2rcd_2",
6
- "input-row": "_input-row_r2rcd_26",
7
- input: "_input_r2rcd_26",
8
- "reveal-btn": "_reveal-btn_r2rcd_68",
9
- "reveal-icon": "_reveal-icon_r2rcd_94",
10
- "strength-meter": "_strength-meter_r2rcd_114",
11
- "strength-segment": "_strength-segment_r2rcd_135"
5
+ wrapper: "_wrapper_19052_2",
6
+ "input-row": "_input-row_19052_30",
7
+ input: "_input_19052_30",
8
+ "reveal-btn": "_reveal-btn_19052_72",
9
+ "reveal-icon": "_reveal-icon_19052_98",
10
+ "strength-meter": "_strength-meter_19052_118",
11
+ "strength-segment": "_strength-segment_19052_139"
12
12
  };
13
13
  //#endregion
14
14
  export { e as default };
@@ -2,48 +2,50 @@
2
2
 
3
3
  import { usePopover as e } from "./use-popover.js";
4
4
  import t from "./popover.module.js";
5
- import { useSignals as n } from "@cascivo/core";
6
- import { jsx as r } from "react/jsx-runtime";
5
+ import { Slot as n, useSignals as r } from "@cascivo/core";
7
6
  import { createContext as i } from "react";
7
+ import { jsx as a } from "react/jsx-runtime";
8
8
  //#region ../components/src/popover/popover.tsx
9
- var a = i(null);
10
- function o({ children: t, ...n }) {
11
- let i = e(n);
12
- return /* @__PURE__ */ r(a.Provider, {
13
- value: i,
9
+ var o = i(null);
10
+ function s({ children: t, ...n }) {
11
+ let r = e(n);
12
+ return /* @__PURE__ */ a(o.Provider, {
13
+ value: r,
14
14
  children: t
15
15
  });
16
16
  }
17
- function s({ children: e }) {
18
- return n(), /* @__PURE__ */ r(a.Consumer, { children: (n) => {
17
+ function c({ children: e, asChild: i = !1 }) {
18
+ r();
19
+ let s = i ? n : "button";
20
+ return /* @__PURE__ */ a(o.Consumer, { children: (n) => {
19
21
  if (!n) throw Error("PopoverTrigger must be used inside <Popover>");
20
- let { triggerRef: i, toggle: a, anchorName: o, isOpen: s } = n;
21
- return /* @__PURE__ */ r("button", {
22
- ref: i,
23
- type: "button",
24
- "aria-expanded": s.value,
22
+ let { triggerRef: r, toggle: o, anchorName: c, isOpen: l } = n;
23
+ return /* @__PURE__ */ a(s, {
24
+ ref: r,
25
+ type: i ? void 0 : "button",
26
+ "aria-expanded": l.value,
25
27
  "aria-haspopup": "dialog",
26
- style: { anchorName: o },
27
- onClick: a,
28
+ style: { anchorName: c },
29
+ onClick: o,
28
30
  className: t.trigger,
29
31
  children: e
30
32
  });
31
33
  } });
32
34
  }
33
- function c({ children: e, className: i }) {
34
- return n(), /* @__PURE__ */ r(a.Consumer, { children: (n) => {
35
- if (!n) throw Error("PopoverContent must be used inside <Popover>");
36
- let { popoverRef: a, anchorName: o, isOpen: s } = n;
37
- return /* @__PURE__ */ r("div", {
38
- ref: a,
35
+ function l({ children: e, className: n }) {
36
+ return r(), /* @__PURE__ */ a(o.Consumer, { children: (r) => {
37
+ if (!r) throw Error("PopoverContent must be used inside <Popover>");
38
+ let { popoverRef: i, anchorName: o, isOpen: s } = r;
39
+ return /* @__PURE__ */ a("div", {
40
+ ref: i,
39
41
  popover: "auto",
40
42
  role: "dialog",
41
43
  "data-state": s.value ? "open" : "closed",
42
44
  style: { positionAnchor: o },
43
- className: [t.content, i].filter(Boolean).join(" "),
45
+ className: [t.content, n].filter(Boolean).join(" "),
44
46
  children: e
45
47
  });
46
48
  } });
47
49
  }
48
50
  //#endregion
49
- export { o as Popover, c as PopoverContent, s as PopoverTrigger };
51
+ export { s as Popover, l as PopoverContent, c as PopoverTrigger };
@@ -3,14 +3,15 @@
3
3
  import e from "./progress.module.js";
4
4
  import { jsx as t } from "react/jsx-runtime";
5
5
  //#region ../components/src/progress/progress.tsx
6
- function n({ value: n, variant: r = "primary", size: i = "md", className: a, ...o }) {
6
+ function n({ value: n, variant: r = "primary", size: i = "md", className: a, ariaLabel: o, ...s }) {
7
7
  return /* @__PURE__ */ t("progress", {
8
+ "aria-label": s["aria-label"] ?? o,
8
9
  className: [e.progress, a].filter(Boolean).join(" "),
9
10
  "data-variant": r,
10
11
  "data-size": i,
11
12
  value: n,
12
13
  max: n === void 0 ? void 0 : 100,
13
- ...o
14
+ ...s
14
15
  });
15
16
  }
16
17
  //#endregion
@@ -3,18 +3,18 @@
3
3
  import { Spinner as e } from "../spinner/spinner.js";
4
4
  import t from "./pull-to-refresh.module.js";
5
5
  import { cn as n, useSignal as r, useSignalEffect as i, useSignals as a } from "@cascivo/core";
6
- import { builtin as o, t as s } from "@cascivo/i18n";
7
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
- import { useRef as u } from "react";
6
+ import { useRef as o } from "react";
7
+ import { builtin as s, t as c } from "@cascivo/i18n";
8
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
9
9
  //#region ../components/src/pull-to-refresh/pull-to-refresh.tsx
10
10
  var d = .5;
11
11
  function f({ onRefresh: f, children: p, threshold: m = 64, disabled: h = !1, labels: g, className: _ }) {
12
12
  a();
13
- let v = u(null), y = r(0), b = r(!1), x = r(!1), S = u(f);
13
+ let v = o(null), y = r(0), b = r(!1), x = r(!1), S = o(f);
14
14
  S.current = f;
15
- let C = u(m);
15
+ let C = o(m);
16
16
  C.current = m;
17
- let w = u(h);
17
+ let w = o(h);
18
18
  w.current = h, i(() => {
19
19
  let e = v.current;
20
20
  if (!e || typeof window > "u") return;
@@ -39,21 +39,21 @@ function f({ onRefresh: f, children: p, threshold: m = 64, disabled: h = !1, lab
39
39
  e.removeEventListener("pointerdown", r), window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", a), window.removeEventListener("pointercancel", a);
40
40
  };
41
41
  });
42
- let T = b.value ? m : y.value, E = Math.min(T / m, 1), D = E >= 1, O = b.value ? g?.refreshing ?? s(o.pullToRefresh.refreshing) : D ? g?.release ?? s(o.pullToRefresh.release) : T > 0 ? g?.pull ?? s(o.pullToRefresh.pull) : "", k = { "--_pull": `${T}px` };
43
- return /* @__PURE__ */ l("div", {
42
+ let T = b.value ? m : y.value, E = Math.min(T / m, 1), D = E >= 1, O = b.value ? g?.refreshing ?? c(s.pullToRefresh.refreshing) : D ? g?.release ?? c(s.pullToRefresh.release) : T > 0 ? g?.pull ?? c(s.pullToRefresh.pull) : "", k = { "--_pull": `${T}px` };
43
+ return /* @__PURE__ */ u("div", {
44
44
  className: n(t.root, _),
45
45
  style: k,
46
46
  children: [
47
- /* @__PURE__ */ c("div", {
47
+ /* @__PURE__ */ l("div", {
48
48
  className: t.indicator,
49
49
  "data-dragging": x.value ? "" : void 0,
50
- children: b.value ? /* @__PURE__ */ c(e, { size: "sm" }) : /* @__PURE__ */ c("svg", {
50
+ children: b.value ? /* @__PURE__ */ l(e, { size: "sm" }) : /* @__PURE__ */ l("svg", {
51
51
  "aria-hidden": "true",
52
52
  viewBox: "0 0 16 16",
53
53
  className: t.arrow,
54
54
  "data-ready": D ? "" : void 0,
55
55
  style: { opacity: E },
56
- children: /* @__PURE__ */ c("path", {
56
+ children: /* @__PURE__ */ l("path", {
57
57
  d: "M8 13V3M4 7l4-4 4 4",
58
58
  fill: "none",
59
59
  stroke: "currentColor",
@@ -63,13 +63,13 @@ function f({ onRefresh: f, children: p, threshold: m = 64, disabled: h = !1, lab
63
63
  })
64
64
  })
65
65
  }),
66
- /* @__PURE__ */ c("span", {
66
+ /* @__PURE__ */ l("span", {
67
67
  role: "status",
68
68
  "aria-live": "polite",
69
69
  className: t.srOnly,
70
70
  children: O
71
71
  }),
72
- /* @__PURE__ */ c("div", {
72
+ /* @__PURE__ */ l("div", {
73
73
  ref: v,
74
74
  className: t.viewport,
75
75
  "data-dragging": x.value ? "" : void 0,
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
 
3
3
  import e from "./radial-progress.module.js";
4
- import { jsx as t } from "react/jsx-runtime";
5
- import { useId as n } from "react";
4
+ import { useId as t } from "react";
5
+ import { jsx as n } from "react/jsx-runtime";
6
6
  //#region ../components/src/radial-progress/radial-progress.tsx
7
7
  function r({ value: r, size: i = "md", variant: a = "primary", children: o, className: s, ...c }) {
8
- let l = Math.min(100, Math.max(0, r)), u = n();
9
- return /* @__PURE__ */ t("div", {
8
+ let l = Math.min(100, Math.max(0, r)), u = t();
9
+ return /* @__PURE__ */ n("div", {
10
10
  role: "progressbar",
11
11
  "aria-valuenow": l,
12
12
  "aria-valuemin": 0,
@@ -17,7 +17,7 @@ function r({ value: r, size: i = "md", variant: a = "primary", children: o, clas
17
17
  "data-variant": a,
18
18
  style: { "--cascivo-radial-progress": l },
19
19
  ...c,
20
- children: /* @__PURE__ */ t("span", {
20
+ children: /* @__PURE__ */ n("span", {
21
21
  id: u,
22
22
  className: e.label,
23
23
  children: o ?? `${l}%`
@@ -2,48 +2,49 @@
2
2
 
3
3
  import e from "./radio.module.js";
4
4
  import { cn as t } from "@cascivo/core";
5
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
6
- import { Children as i, cloneElement as a, isValidElement as o } from "react";
5
+ import { Children as n, cloneElement as r, forwardRef as i, isValidElement as a } from "react";
6
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
7
  //#region ../components/src/radio/radio.tsx
8
- function s({ label: i, className: a, id: o, disabled: s, value: c, ...l }) {
9
- let u = o ?? (i ? `cascade-radio-${c}` : void 0);
10
- return /* @__PURE__ */ r("label", {
11
- className: t(e.wrapper, a),
12
- "data-disabled": s || void 0,
8
+ var c = i(function({ label: n, className: r, id: i, disabled: a, value: c, ...l }, u) {
9
+ let d = i ?? (n ? `cascade-radio-${c}` : void 0);
10
+ return /* @__PURE__ */ s("label", {
11
+ className: t(e.wrapper, r),
12
+ "data-disabled": a || void 0,
13
13
  children: [
14
- /* @__PURE__ */ n("input", {
15
- id: u,
14
+ /* @__PURE__ */ o("input", {
15
+ id: d,
16
16
  type: "radio",
17
17
  value: c,
18
18
  className: e.input,
19
- disabled: s,
19
+ disabled: a,
20
+ ref: u,
20
21
  ...l
21
22
  }),
22
- /* @__PURE__ */ n("span", {
23
+ /* @__PURE__ */ o("span", {
23
24
  className: e.control,
24
25
  "aria-hidden": "true"
25
26
  }),
26
- i && /* @__PURE__ */ n("span", {
27
+ n && /* @__PURE__ */ o("span", {
27
28
  className: e.label,
28
- children: i
29
+ children: n
29
30
  })
30
31
  ]
31
32
  });
32
- }
33
- function c({ name: r, value: s, defaultValue: c, onChange: l, orientation: u = "vertical", className: d, children: f }) {
33
+ });
34
+ function l({ name: i, value: s, defaultValue: c, onChange: l, orientation: u = "vertical", className: d, children: f }) {
34
35
  let p = s !== void 0;
35
- return /* @__PURE__ */ n("div", {
36
+ return /* @__PURE__ */ o("div", {
36
37
  role: "radiogroup",
37
38
  "data-orientation": u,
38
39
  className: t(e.group, d),
39
- children: i.map(f, (e) => {
40
- if (!o(e)) return e;
41
- let t = e, n = t.props.value, i = { name: r };
42
- return p ? i.checked = n === s : c !== void 0 && (i.defaultChecked = n === c), l && (i.onChange = (e) => {
40
+ children: n.map(f, (e) => {
41
+ if (!a(e)) return e;
42
+ let t = e, n = t.props.value, o = { name: i };
43
+ return p ? o.checked = n === s : c !== void 0 && (o.defaultChecked = n === c), l && (o.onChange = (e) => {
43
44
  e.target.checked && l(n);
44
- }), a(t, i);
45
+ }), r(t, o);
45
46
  })
46
47
  });
47
48
  }
48
49
  //#endregion
49
- export { s as Radio, c as RadioGroup };
50
+ export { c as Radio, l as RadioGroup };
@@ -2,62 +2,63 @@
2
2
 
3
3
  import e from "./radio-card.module.js";
4
4
  import { cn as t } from "@cascivo/core";
5
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
6
- import { createContext as i } from "react";
5
+ import { createContext as n, forwardRef as r } from "react";
6
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
7
  //#region ../components/src/radio-card/radio-card.tsx
8
- var a = i({ name: "" });
9
- function o({ name: r, label: i, value: o, defaultValue: s, onValueChange: c, children: l, className: u }) {
10
- return /* @__PURE__ */ n(a.Provider, {
8
+ var o = n({ name: "" });
9
+ function s({ name: n, label: r, value: a, defaultValue: s, onValueChange: c, children: l, className: u }) {
10
+ return /* @__PURE__ */ i(o.Provider, {
11
11
  value: {
12
- name: r,
13
- value: o,
12
+ name: n,
13
+ value: a,
14
14
  defaultValue: s,
15
15
  onValueChange: c
16
16
  },
17
- children: /* @__PURE__ */ n("div", {
17
+ children: /* @__PURE__ */ i("div", {
18
18
  role: "radiogroup",
19
- "aria-label": i,
19
+ "aria-label": r,
20
20
  className: t(e.group, u),
21
21
  children: l
22
22
  })
23
23
  });
24
24
  }
25
- function s({ value: t, title: i, description: o, disabled: s, hideIndicator: c, ...l }) {
26
- return /* @__PURE__ */ n(a.Consumer, { children: (a) => /* @__PURE__ */ r("label", {
25
+ var c = r(function({ value: t, title: n, description: r, disabled: s, hideIndicator: c, ...l }, u) {
26
+ return /* @__PURE__ */ i(o.Consumer, { children: (o) => /* @__PURE__ */ a("label", {
27
27
  className: e.card,
28
28
  "data-disabled": s || void 0,
29
29
  children: [
30
- /* @__PURE__ */ n("input", {
30
+ /* @__PURE__ */ i("input", {
31
31
  type: "radio",
32
32
  className: e.input,
33
- name: a.name,
33
+ name: o.name,
34
34
  value: t,
35
35
  disabled: s,
36
- ...a.value === void 0 ? {
37
- defaultChecked: a.defaultValue === t,
38
- onChange: () => a.onValueChange?.(t)
36
+ ...o.value === void 0 ? {
37
+ defaultChecked: o.defaultValue === t,
38
+ onChange: () => o.onValueChange?.(t)
39
39
  } : {
40
- checked: a.value === t,
41
- onChange: () => a.onValueChange?.(t)
40
+ checked: o.value === t,
41
+ onChange: () => o.onValueChange?.(t)
42
42
  },
43
+ ref: u,
43
44
  ...l
44
45
  }),
45
- !c && /* @__PURE__ */ n("span", {
46
+ !c && /* @__PURE__ */ i("span", {
46
47
  className: e.glyph,
47
48
  "aria-hidden": "true"
48
49
  }),
49
- /* @__PURE__ */ r("span", {
50
+ /* @__PURE__ */ a("span", {
50
51
  className: e.body,
51
- children: [/* @__PURE__ */ n("span", {
52
+ children: [/* @__PURE__ */ i("span", {
52
53
  className: e.title,
53
- children: i
54
- }), o && /* @__PURE__ */ n("span", {
54
+ children: n
55
+ }), r && /* @__PURE__ */ i("span", {
55
56
  className: e.description,
56
- children: o
57
+ children: r
57
58
  })]
58
59
  })
59
60
  ]
60
61
  }) });
61
- }
62
+ });
62
63
  //#endregion
63
- export { s as RadioCard, o as RadioCardGroup };
64
+ export { c as RadioCard, s as RadioCardGroup };
@@ -133,6 +133,7 @@ import { Columns as rn } from "../../layouts/src/columns/columns.js";
133
133
  import { Center as an } from "../../layouts/src/center/center.js";
134
134
  import { Spacer as on } from "../../layouts/src/spacer/spacer.js";
135
135
  import { AutoGrid as sn } from "../../layouts/src/auto-grid/auto-grid.js";
136
- import { ThemeProvider as cn, setTheme as ln, themePreloadScript as un, themeSignal as dn, useTheme as fn } from "./theme.js";
137
- import { DismissableLayer as pn, ErrorBoundary as mn, FocusScope as hn, Portal as gn, Presence as _n, Slot as vn, SuspenseBoundary as yn, VisuallyHidden as bn, batch as xn, cn as Sn, composeRefs as Cn, computePosition as wn, computed as Tn, createMachine as En, createScope as Dn, createStreamBuffer as On, effect as kn, getLinkComponent as An, mergeProps as jn, setLinkComponent as Mn, signal as Nn, useAnchorPosition as Pn, useClipboard as Fn, useComputed as In, useControllableSignal as Ln, useDisclosure as Rn, useEffectPropSignal as zn, useId as Bn, useMachine as Vn, useMediaQuery as Hn, useRovingFocus as Un, useScope as Wn, useScrollLock as Gn, useSignal as Kn, useSignalEffect as qn, useSignals as Jn, useStreamBuffer as Yn, useTypeahead as Xn } from "@cascivo/core";
138
- export { M as Accordion, N as AccordionContent, P as AccordionItem, F as AccordionTrigger, I as ActionSheet, d as Alert, ye as AlertDialog, Yt as AppShell, _t as AspectRatio, sn as AutoGrid, f as Avatar, p as AvatarGroup, c as Badge, $e as Blockquote, xe as BottomSheet, z as Breadcrumb, t as Button, dt as ButtonGroup, Ft as Calendar, r as Card, i as CardContent, a as CardFooter, o as CardHeader, s as CardTitle, Rt as Carousel, an as Center, Xt as ChatBubble, v as Checkbox, He as CheckboxCard, Qe as Code, Ut as CodeSnippet, gt as Collapsible, Lt as ColorPicker, rn as Columns, ce as Combobox, ne as CommandMenu, we as Comparison, Tt as ContainedList, Et as ContainedListItem, Se as ContextMenu, Ce as ContextMenuItem, Ue as CopyButton, Dt as DataList, te as DataTable, le as DatePicker, It as DateRangePicker, pn as DismissableLayer, Bt as Dock, Vt as Drawer, w as Dropdown, Ie as Editable, X as EmptyState, mn as ErrorBoundary, Z as Fab, ct as Field, ue as FileUploader, lt as Filter, nn as Flex, hn as FocusScope, ae as Form, en as Grid, tn as GridItem, H as Header, Be as HeaderPanel, Xe as Heading, Te as HoverCard, Ee as HoverCardContent, De as HoverCardTrigger, ut as IconButton, h as Image, Kt as Indicator, pt as InlineLoading, n as Input, Ne as InputGroup, Pe as InputGroupAddon, kt as Item, At as ItemActions, jt as ItemContent, Mt as ItemDescription, Nt as ItemMedia, Pt as ItemTitle, qt as Join, L as Kbd, st as Label, R as Link, et as List, tt as ListItem, nt as LogViewer, he as Menu, vt as MenuButton, ge as MenuItem, _e as MenuSeparator, ve as MenuTrigger, bt as Menubar, l as Modal, ke as MultiSelect, Ht as NativeSelect, xt as NavigationMenu, mt as Notification, ee as NumberInput, je as OtpInput, Q as OverflowMenu, G as Pagination, Oe as PasswordInput, fe as Popover, pe as PopoverContent, me as PopoverTrigger, gn as Portal, _n as Presence, Je as Progress, Y as ProgressBar, Ye as ProgressCircle, K as ProgressIndicator, rt as Prose, it as PullToRefresh, at as QrCode, Zt as RadialProgress, y as Radio, Le as RadioCard, Re as RadioCardGroup, b as RadioGroup, Fe as RatingGroup, ot as RelativeTime, zt as Resizable, ht as ScrollArea, $ as Search, Me as SegmentedControl, _ as Select, u as Separator, be as Sheet, ze as ShellHeader, W as SideNav, J as Skeleton, Ke as SkipNavLink, qe as SkipNavTarget, S as Slider, vn as Slot, on as Spacer, e as Spinner, Jt as Stack, We as Stat, Ge as Status, Wt as Steps, wt as StructuredList, yn as SuspenseBoundary, Qt as Swap, $t as SwipeItem, Ve as Switcher, O as Tabs, k as TabsContent, A as TabsList, j as TabsTrigger, q as Tag, Ae as TagsInput, Ze as Text, g as Textarea, cn as ThemeProvider, Gt as Tile, de as TimePicker, Ot as Timeline, T as ToastProvider, B as Toc, x as Toggle, ft as ToggleGroup, yt as Toggletip, C as Tooltip, St as TreeView, m as User, bn as VisuallyHidden, xn as batch, Sn as cn, Cn as composeRefs, wn as computePosition, Tn as computed, oe as createForm, En as createMachine, Dn as createScope, On as createStreamBuffer, E as dismissAllToasts, kn as effect, re as fuzzyMatch, ie as fuzzyScore, An as getLinkComponent, jn as mergeProps, Mn as setLinkComponent, ln as setTheme, Nn as signal, un as themePreloadScript, dn as themeSignal, Ct as treeViewMessages, Pn as useAnchorPosition, Fn as useClipboard, In as useComputed, Ln as useControllableSignal, Rn as useDisclosure, zn as useEffectPropSignal, se as useForm, Bn as useId, Vn as useMachine, Hn as useMediaQuery, U as usePopover, Un as useRovingFocus, Wn as useScope, Gn as useScrollLock, Kn as useSignal, qn as useSignalEffect, Jn as useSignals, Yn as useStreamBuffer, fn as useTheme, D as useToast, V as useTocFromRegion, Xn as useTypeahead };
136
+ import { PageHeader as cn } from "../../layouts/src/page-header/page-header.js";
137
+ import { ThemeProvider as ln, applyTheme as un, setTheme as dn, themePreloadScript as fn, themeSignal as pn, useTheme as mn } from "./theme.js";
138
+ import { DismissableLayer as hn, ErrorBoundary as gn, FocusScope as _n, Portal as vn, Presence as yn, Slot as bn, SuspenseBoundary as xn, VisuallyHidden as Sn, batch as Cn, cn as wn, composeRefs as Tn, computePosition as En, computed as Dn, createMachine as On, createScope as kn, createStreamBuffer as An, effect as jn, getLinkComponent as Mn, mergeProps as Nn, setLinkComponent as Pn, signal as Fn, useAnchorPosition as In, useClipboard as Ln, useComputed as Rn, useControllableSignal as zn, useDisclosure as Bn, useEffectPropSignal as Vn, useId as Hn, useMachine as Un, useMediaQuery as Wn, useRovingFocus as Gn, useScope as Kn, useScrollLock as qn, useSignal as Jn, useSignalEffect as Yn, useSignals as Xn, useStreamBuffer as Zn, useTypeahead as Qn } from "@cascivo/core";
139
+ export { M as Accordion, N as AccordionContent, P as AccordionItem, F as AccordionTrigger, I as ActionSheet, d as Alert, ye as AlertDialog, Yt as AppShell, _t as AspectRatio, sn as AutoGrid, f as Avatar, p as AvatarGroup, c as Badge, $e as Blockquote, xe as BottomSheet, z as Breadcrumb, t as Button, dt as ButtonGroup, Ft as Calendar, r as Card, i as CardContent, a as CardFooter, o as CardHeader, s as CardTitle, Rt as Carousel, an as Center, Xt as ChatBubble, v as Checkbox, He as CheckboxCard, Qe as Code, Ut as CodeSnippet, gt as Collapsible, Lt as ColorPicker, rn as Columns, ce as Combobox, ne as CommandMenu, we as Comparison, Tt as ContainedList, Et as ContainedListItem, Se as ContextMenu, Ce as ContextMenuItem, Ue as CopyButton, Dt as DataList, te as DataTable, le as DatePicker, It as DateRangePicker, hn as DismissableLayer, Bt as Dock, Vt as Drawer, w as Dropdown, Ie as Editable, X as EmptyState, gn as ErrorBoundary, Z as Fab, ct as Field, ue as FileUploader, lt as Filter, nn as Flex, _n as FocusScope, ae as Form, en as Grid, tn as GridItem, H as Header, Be as HeaderPanel, Xe as Heading, Te as HoverCard, Ee as HoverCardContent, De as HoverCardTrigger, ut as IconButton, h as Image, Kt as Indicator, pt as InlineLoading, n as Input, Ne as InputGroup, Pe as InputGroupAddon, kt as Item, At as ItemActions, jt as ItemContent, Mt as ItemDescription, Nt as ItemMedia, Pt as ItemTitle, qt as Join, L as Kbd, st as Label, R as Link, et as List, tt as ListItem, nt as LogViewer, he as Menu, vt as MenuButton, ge as MenuItem, _e as MenuSeparator, ve as MenuTrigger, bt as Menubar, l as Modal, ke as MultiSelect, Ht as NativeSelect, xt as NavigationMenu, mt as Notification, ee as NumberInput, je as OtpInput, Q as OverflowMenu, cn as PageHeader, G as Pagination, Oe as PasswordInput, fe as Popover, pe as PopoverContent, me as PopoverTrigger, vn as Portal, yn as Presence, Je as Progress, Y as ProgressBar, Ye as ProgressCircle, K as ProgressIndicator, rt as Prose, it as PullToRefresh, at as QrCode, Zt as RadialProgress, y as Radio, Le as RadioCard, Re as RadioCardGroup, b as RadioGroup, Fe as RatingGroup, ot as RelativeTime, zt as Resizable, ht as ScrollArea, $ as Search, Me as SegmentedControl, _ as Select, u as Separator, be as Sheet, ze as ShellHeader, W as SideNav, J as Skeleton, Ke as SkipNavLink, qe as SkipNavTarget, S as Slider, bn as Slot, on as Spacer, e as Spinner, Jt as Stack, We as Stat, Ge as Status, Wt as Steps, wt as StructuredList, xn as SuspenseBoundary, Qt as Swap, $t as SwipeItem, Ve as Switcher, O as Tabs, k as TabsContent, A as TabsList, j as TabsTrigger, q as Tag, Ae as TagsInput, Ze as Text, g as Textarea, ln as ThemeProvider, Gt as Tile, de as TimePicker, Ot as Timeline, T as ToastProvider, B as Toc, x as Toggle, ft as ToggleGroup, yt as Toggletip, C as Tooltip, St as TreeView, m as User, Sn as VisuallyHidden, un as applyTheme, Cn as batch, wn as cn, Tn as composeRefs, En as computePosition, Dn as computed, oe as createForm, On as createMachine, kn as createScope, An as createStreamBuffer, E as dismissAllToasts, jn as effect, re as fuzzyMatch, ie as fuzzyScore, Mn as getLinkComponent, Nn as mergeProps, Pn as setLinkComponent, dn as setTheme, Fn as signal, fn as themePreloadScript, pn as themeSignal, Ct as treeViewMessages, In as useAnchorPosition, Ln as useClipboard, Rn as useComputed, zn as useControllableSignal, Bn as useDisclosure, Vn as useEffectPropSignal, se as useForm, Hn as useId, Un as useMachine, Wn as useMediaQuery, U as usePopover, Gn as useRovingFocus, Kn as useScope, qn as useScrollLock, Jn as useSignal, Yn as useSignalEffect, Xn as useSignals, Zn as useStreamBuffer, mn as useTheme, D as useToast, V as useTocFromRegion, Qn as useTypeahead };
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { persistedSignal as e } from "../../storage/src/persisted-signal.js";
4
4
  import { useSignalEffect as t, useSignals as n } from "@cascivo/core";
5
- import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
6
- import { useRef as o } from "react";
5
+ import { useRef as r } from "react";
6
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
7
7
  //#region src/theme.tsx
8
8
  var s = "cascivo-theme", c = "data-theme";
9
9
  function l() {
@@ -12,7 +12,7 @@ function l() {
12
12
  var u = /* @__PURE__ */ new Set();
13
13
  function d(e, t) {
14
14
  l() && (e === null || typeof document > "u" || typeof requestAnimationFrame != "function" || u.has(t) || requestAnimationFrame(() => {
15
- u.has(t) || getComputedStyle(e).getPropertyValue("--cascivo-color-accent").trim() === "" && (u.add(t), console.warn(`cascivo ThemeProvider: data-theme=${JSON.stringify(t)} was set, but no cascivo theme CSS defines it — every --cascivo-color-* token is unresolved, so components render grayscale. Import '@cascivo/themes/all.css' once in your entry (or '@cascivo/react/styles.css', which bundles the light and dark themes). Using a custom theme? Ensure its stylesheet is loaded and defines [data-theme=${JSON.stringify(t)}]. Docs: https://cascivo.com/docs/theming — offline: npx -y @cascivo/docs guide theming`));
15
+ u.has(t) || getComputedStyle(e).getPropertyValue("--cascivo-color-accent").trim() === "" && (u.add(t), console.warn(`cascivo ThemeProvider: data-theme=${JSON.stringify(t)} was set, but no cascivo theme CSS defines it — every --cascivo-color-* token is unresolved, so components render grayscale. Import '@cascivo/themes/all.css' once in your entry (or '@cascivo/react/styles.css', which bundles the light and dark themes). Using a custom theme? Ensure its stylesheet is loaded and defines [data-theme=${JSON.stringify(t)}]. Docs: https://cascivo.com/docs/theming.md — offline: npx -y @cascivo/docs guide theming`));
16
16
  }));
17
17
  }
18
18
  var f = null, p = {
@@ -29,39 +29,50 @@ function h() {
29
29
  function g() {
30
30
  return f ??= e(p.storageKey, h()), f;
31
31
  }
32
- function _(e) {
32
+ var _ = !1, v = !1;
33
+ function y(e) {
34
+ !l() || v || typeof requestAnimationFrame == "function" && requestAnimationFrame(() => {
35
+ _ || v || (v = !0, console.warn(`cascivo setTheme(${JSON.stringify(e)}): no <ThemeProvider> is mounted, so the theme signal updated but the ${c} attribute was never written — nothing on the page will restyle. Wrap your app in <ThemeProvider> (it is SSR-safe and persists the choice), or call applyTheme() to write the attribute directly if you are theming outside React. Docs: https://cascivo.com/docs/theming.md — offline: npx -y @cascivo/docs guide theming`));
36
+ });
37
+ }
38
+ function b(e) {
39
+ g().value = e, y(e);
40
+ }
41
+ function x(e, t) {
33
42
  g().value = e;
43
+ let n = t ?? (typeof document < "u" ? document.documentElement : null);
44
+ n !== null && (n.setAttribute(c, e), d(n, e));
34
45
  }
35
- function v() {
36
- return n(), [g().value, _];
46
+ function S() {
47
+ return n(), [g().value, b];
37
48
  }
38
- function y() {
49
+ function C() {
39
50
  return g();
40
51
  }
41
- function b(e) {
52
+ function w(e) {
42
53
  return JSON.stringify(e).replace(/</g, "\\u003c");
43
54
  }
44
- function x({ defaultTheme: e, value: n, storageKey: l = s, attribute: u = c, target: m, onChange: h, nonce: _, children: v }) {
45
- let y = o(!1);
46
- y.current || (y.current = !0, (f === null || p.storageKey !== l) && (p = {
55
+ function T({ defaultTheme: e, value: n, storageKey: l = s, attribute: u = c, target: m, onChange: h, nonce: v, children: y }) {
56
+ let b = r(!1);
57
+ b.current || (b.current = !0, (f === null || p.storageKey !== l) && (p = {
47
58
  storageKey: l,
48
59
  defaultTheme: e ?? "light",
49
60
  explicit: e !== void 0
50
61
  }, f = null));
51
62
  let x = g();
52
63
  n !== void 0 && (x.value = n);
53
- let S = o(h);
64
+ let S = r(h);
54
65
  return S.current = h, t(() => {
55
66
  let e = x.value, t = m ? m.current : typeof document < "u" ? document.documentElement : null;
56
- t?.setAttribute(u, e), d(t, e), S.current?.(e);
57
- }), n !== void 0 && !m ? /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("script", {
58
- nonce: _,
59
- dangerouslySetInnerHTML: { __html: `document.documentElement.setAttribute(${b(u)},${b(n)})` }
60
- }), v] }) : /* @__PURE__ */ i(r, { children: v });
67
+ _ = !0, t?.setAttribute(u, e), d(t, e), S.current?.(e);
68
+ }), n !== void 0 && !m ? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("script", {
69
+ nonce: v,
70
+ dangerouslySetInnerHTML: { __html: `document.documentElement.setAttribute(${w(u)},${w(n)})` }
71
+ }), y] }) : /* @__PURE__ */ a(i, { children: y });
61
72
  }
62
- function S(e = {}) {
73
+ function E(e = {}) {
63
74
  let t = JSON.stringify(e.storageKey ?? s), n = JSON.stringify(e.attribute ?? c), r = JSON.stringify(e.defaultTheme ?? "light"), i = e.defaultTheme === void 0 ? "if(typeof matchMedia==='function'){if(matchMedia('(prefers-color-scheme: dark)').matches)v='dark';else if(matchMedia('(prefers-color-scheme: light)').matches)v='light';}" : "";
64
75
  return `(function(){try{var v=${r};` + i + `var raw=localStorage.getItem(${t});if(raw){v=raw;try{var e=JSON.parse(raw);if(e&&typeof e==='object'&&'value'in e)v=e.value;}catch(_){}}document.documentElement.setAttribute(${n},v);}catch(_){}})();`;
65
76
  }
66
77
  //#endregion
67
- export { x as ThemeProvider, _ as setTheme, S as themePreloadScript, y as themeSignal, v as useTheme };
78
+ export { T as ThemeProvider, x as applyTheme, b as setTheme, E as themePreloadScript, C as themeSignal, S as useTheme };