@cascivo/react 0.13.0 → 0.14.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 (170) 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 +14 -12
  6. package/dist/app-shell/app-shell.module.js +8 -8
  7. package/dist/avatar-group/avatar-group.js +6 -6
  8. package/dist/bottom-sheet/bottom-sheet.js +18 -18
  9. package/dist/button/button.js +15 -12
  10. package/dist/button-group/button-group.js +8 -8
  11. package/dist/carousel/carousel.js +20 -20
  12. package/dist/checkbox/checkbox.js +21 -21
  13. package/dist/checkbox-card/checkbox-card.js +15 -13
  14. package/dist/collapsible/collapsible.js +7 -7
  15. package/dist/color-picker/color-picker.js +26 -26
  16. package/dist/combobox/combobox.js +86 -86
  17. package/dist/command-menu/command-menu.js +111 -111
  18. package/dist/comparison/comparison.js +10 -10
  19. package/dist/context-menu/context-menu.js +9 -9
  20. package/dist/copy-button/copy-button.js +18 -16
  21. package/dist/data-table/data-table.js +1 -1
  22. package/dist/date-picker/date-picker.js +25 -25
  23. package/dist/date-range-picker/date-range-picker.js +26 -26
  24. package/dist/drawer/drawer.css +1 -1
  25. package/dist/drawer/drawer.js +18 -17
  26. package/dist/drawer/drawer.module.js +9 -9
  27. package/dist/dropdown/dropdown.js +48 -48
  28. package/dist/editable/editable.js +11 -11
  29. package/dist/fab/fab.js +53 -53
  30. package/dist/field/field.js +8 -8
  31. package/dist/file-uploader/file-uploader.js +19 -19
  32. package/dist/header-panel/header-panel.js +31 -31
  33. package/dist/hover-card/hover-card.js +21 -21
  34. package/dist/icon-button/icon-button.js +5 -5
  35. package/dist/index.d.ts +233 -194
  36. package/dist/input/input.js +22 -21
  37. package/dist/link/link.js +8 -6
  38. package/dist/log-viewer/log-viewer.js +26 -26
  39. package/dist/menu/menu.js +20 -20
  40. package/dist/menu-button/menu-button.js +48 -48
  41. package/dist/menubar/menubar.js +42 -42
  42. package/dist/modal/modal.css +1 -1
  43. package/dist/modal/modal.js +41 -35
  44. package/dist/modal/modal.module.js +8 -7
  45. package/dist/multi-select/multi-select.css +1 -1
  46. package/dist/multi-select/multi-select.js +57 -57
  47. package/dist/multi-select/multi-select.module.js +11 -11
  48. package/dist/native-select/native-select.js +13 -11
  49. package/dist/navigation-menu/navigation-menu.js +46 -46
  50. package/dist/node/accordion/accordion.js +46 -44
  51. package/dist/node/action-sheet/action-sheet.js +16 -16
  52. package/dist/node/alert-dialog/alert-dialog.js +34 -34
  53. package/dist/node/app-shell/app-shell.js +14 -12
  54. package/dist/node/app-shell/app-shell.module.js +8 -8
  55. package/dist/node/avatar-group/avatar-group.js +6 -6
  56. package/dist/node/bottom-sheet/bottom-sheet.js +18 -18
  57. package/dist/node/button/button.js +15 -12
  58. package/dist/node/button-group/button-group.js +8 -8
  59. package/dist/node/carousel/carousel.js +20 -20
  60. package/dist/node/checkbox/checkbox.js +21 -21
  61. package/dist/node/checkbox-card/checkbox-card.js +15 -13
  62. package/dist/node/collapsible/collapsible.js +7 -7
  63. package/dist/node/color-picker/color-picker.js +26 -26
  64. package/dist/node/combobox/combobox.js +86 -86
  65. package/dist/node/command-menu/command-menu.js +111 -111
  66. package/dist/node/comparison/comparison.js +10 -10
  67. package/dist/node/context-menu/context-menu.js +9 -9
  68. package/dist/node/copy-button/copy-button.js +18 -16
  69. package/dist/node/data-table/data-table.js +1 -1
  70. package/dist/node/date-picker/date-picker.js +25 -25
  71. package/dist/node/date-range-picker/date-range-picker.js +26 -26
  72. package/dist/node/drawer/drawer.js +18 -17
  73. package/dist/node/drawer/drawer.module.js +9 -9
  74. package/dist/node/dropdown/dropdown.js +48 -48
  75. package/dist/node/editable/editable.js +11 -11
  76. package/dist/node/fab/fab.js +53 -53
  77. package/dist/node/field/field.js +8 -8
  78. package/dist/node/file-uploader/file-uploader.js +19 -19
  79. package/dist/node/header-panel/header-panel.js +31 -31
  80. package/dist/node/hover-card/hover-card.js +21 -21
  81. package/dist/node/icon-button/icon-button.js +5 -5
  82. package/dist/node/input/input.js +22 -21
  83. package/dist/node/link/link.js +8 -6
  84. package/dist/node/log-viewer/log-viewer.js +26 -26
  85. package/dist/node/menu/menu.js +20 -20
  86. package/dist/node/menu-button/menu-button.js +48 -48
  87. package/dist/node/menubar/menubar.js +42 -42
  88. package/dist/node/modal/modal.js +41 -35
  89. package/dist/node/modal/modal.module.js +8 -7
  90. package/dist/node/multi-select/multi-select.js +57 -57
  91. package/dist/node/multi-select/multi-select.module.js +11 -11
  92. package/dist/node/native-select/native-select.js +13 -11
  93. package/dist/node/navigation-menu/navigation-menu.js +46 -46
  94. package/dist/node/notification/notification.js +26 -26
  95. package/dist/node/number-input/number-input.js +52 -50
  96. package/dist/node/otp-input/otp-input.js +8 -8
  97. package/dist/node/password-input/password-input.js +28 -27
  98. package/dist/node/popover/popover.js +26 -24
  99. package/dist/node/pull-to-refresh/pull-to-refresh.js +13 -13
  100. package/dist/node/radial-progress/radial-progress.js +5 -5
  101. package/dist/node/radio/radio.js +23 -22
  102. package/dist/node/radio-card/radio-card.js +27 -26
  103. package/dist/node/react/src/index.js +3 -3
  104. package/dist/node/react/src/theme.js +30 -19
  105. package/dist/node/resizable/resizable.js +11 -11
  106. package/dist/node/scroll-area/scroll-area.js +4 -4
  107. package/dist/node/search/search.js +49 -49
  108. package/dist/node/select/select.js +27 -26
  109. package/dist/node/sheet/sheet.js +11 -10
  110. package/dist/node/sheet/sheet.module.js +5 -5
  111. package/dist/node/shell-header/shell-header.js +21 -18
  112. package/dist/node/shell-header/shell-header.module.js +20 -19
  113. package/dist/node/side-nav/side-nav.js +91 -91
  114. package/dist/node/skip-nav/skip-nav.js +12 -12
  115. package/dist/node/slider/slider.js +13 -11
  116. package/dist/node/structured-list/structured-list.js +23 -23
  117. package/dist/node/tabs/tabs.js +49 -47
  118. package/dist/node/tags-input/tags-input.js +35 -35
  119. package/dist/node/textarea/textarea.js +22 -21
  120. package/dist/node/time-picker/time-picker.js +22 -21
  121. package/dist/node/timeline/timeline.js +23 -16
  122. package/dist/node/timeline/timeline.module.js +7 -7
  123. package/dist/node/toast/toast.js +15 -15
  124. package/dist/node/toc/toc.js +8 -8
  125. package/dist/node/toggle/toggle.js +15 -13
  126. package/dist/node/toggle-group/toggle-group.js +10 -10
  127. package/dist/node/toggletip/toggletip.js +9 -9
  128. package/dist/node/tooltip/tooltip.js +5 -5
  129. package/dist/node/tree-view/tree-view.js +32 -32
  130. package/dist/notification/notification.js +26 -26
  131. package/dist/number-input/number-input.js +52 -50
  132. package/dist/otp-input/otp-input.js +8 -8
  133. package/dist/password-input/password-input.js +28 -27
  134. package/dist/popover/popover.js +26 -24
  135. package/dist/pull-to-refresh/pull-to-refresh.js +13 -13
  136. package/dist/radial-progress/radial-progress.js +5 -5
  137. package/dist/radio/radio.js +23 -22
  138. package/dist/radio-card/radio-card.js +27 -26
  139. package/dist/react/src/index.js +3 -3
  140. package/dist/react/src/theme.js +30 -19
  141. package/dist/resizable/resizable.js +11 -11
  142. package/dist/scroll-area/scroll-area.js +4 -4
  143. package/dist/search/search.js +49 -49
  144. package/dist/select/select.js +27 -26
  145. package/dist/sheet/sheet.css +1 -1
  146. package/dist/sheet/sheet.js +11 -10
  147. package/dist/sheet/sheet.module.js +5 -5
  148. package/dist/shell-header/shell-header.css +1 -1
  149. package/dist/shell-header/shell-header.js +21 -18
  150. package/dist/shell-header/shell-header.module.js +20 -19
  151. package/dist/side-nav/side-nav.js +91 -91
  152. package/dist/skip-nav/skip-nav.js +12 -12
  153. package/dist/slider/slider.js +13 -11
  154. package/dist/structured-list/structured-list.js +23 -23
  155. package/dist/styles.css +57 -7
  156. package/dist/tabs/tabs.js +49 -47
  157. package/dist/tags-input/tags-input.js +35 -35
  158. package/dist/textarea/textarea.js +22 -21
  159. package/dist/time-picker/time-picker.js +22 -21
  160. package/dist/timeline/timeline.css +1 -1
  161. package/dist/timeline/timeline.js +23 -16
  162. package/dist/timeline/timeline.module.js +7 -7
  163. package/dist/toast/toast.js +15 -15
  164. package/dist/toc/toc.js +8 -8
  165. package/dist/toggle/toggle.js +15 -13
  166. package/dist/toggle-group/toggle-group.js +10 -10
  167. package/dist/toggletip/toggletip.js +9 -9
  168. package/dist/tooltip/tooltip.js +5 -5
  169. package/dist/tree-view/tree-view.js +32 -32
  170. package/package.json +10 -4
@@ -4,9 +4,9 @@ import { Button as e } from "../button/button.js";
4
4
  import { Checkbox as t } from "../checkbox/checkbox.js";
5
5
  import n from "./data-table.module.js";
6
6
  import { batch as r, cn as i, useComputed as a, useSignal as o, useSignalEffect as ee, useSignals as te } from "@cascivo/core";
7
+ import { Fragment as ne, useId as re, useRef as ie } from "react";
7
8
  import { builtin as s, t as c } from "@cascivo/i18n";
8
9
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
9
- import { Fragment as ne, useId as re, useRef as ie } from "react";
10
10
  import { flushSync as ae } from "react-dom";
11
11
  //#region ../components/src/data-table/data-table.tsx
12
12
  function d(e, t) {
@@ -2,9 +2,9 @@
2
2
 
3
3
  import e from "./date-picker.module.js";
4
4
  import { batch as t, cn as n, createMachine as r, useMachine as i, useSignal as a, useSignalEffect as o, useSignals as s } from "@cascivo/core";
5
- import { builtin as c, currentLocale as ee, t as l } from "@cascivo/i18n";
6
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
7
- import { useId as f, useRef as te } from "react";
5
+ import { useId as c, useRef as ee } from "react";
6
+ import { builtin as l, currentLocale as te, t as u } from "@cascivo/i18n";
7
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
8
8
  //#region ../components/src/date-picker/date-picker.tsx
9
9
  var p = r({
10
10
  initial: "closed",
@@ -41,9 +41,9 @@ function _(e) {
41
41
  }
42
42
  function v({ value: r, defaultValue: v, onValueChange: y, onChange: b, min: x, max: S, clearable: C = !1, label: w, hint: T, error: E, size: D = "md", disabled: O = !1, labels: k, className: re, id: A }) {
43
43
  s();
44
- let [j, M] = i(p), N = f(), P = A ?? `cascade-date-picker-${N}`, F = `${N}-grid`, I = ee(), ie = k?.placeholder ?? l(c.datePicker.placeholder), ae = k?.previousMonth ?? l(c.datePicker.previousMonth), L = k?.nextMonth ?? l(c.datePicker.nextMonth), R = k?.clear ?? l(c.datePicker.clear), z = /* @__PURE__ */ new Date(), B = g(z), V = a(r ?? v);
44
+ let [j, M] = i(p), N = c(), P = A ?? `cascade-date-picker-${N}`, F = `${N}-grid`, I = te(), ie = k?.placeholder ?? u(l.datePicker.placeholder), ae = k?.previousMonth ?? u(l.datePicker.previousMonth), L = k?.nextMonth ?? u(l.datePicker.nextMonth), R = k?.clear ?? u(l.datePicker.clear), z = /* @__PURE__ */ new Date(), B = g(z), V = a(r ?? v);
45
45
  r !== void 0 && (V.value = r);
46
- let H = a(V.value ? _(V.value).getUTCFullYear() : z.getUTCFullYear()), U = a(V.value ? _(V.value).getUTCMonth() : z.getUTCMonth()), W = a(V.value), G = te(null);
46
+ let H = a(V.value ? _(V.value).getUTCFullYear() : z.getUTCFullYear()), U = a(V.value ? _(V.value).getUTCMonth() : z.getUTCMonth()), W = a(V.value), G = ee(null);
47
47
  o(() => {
48
48
  if (j.value !== "open") return;
49
49
  let e = (e) => {
@@ -94,20 +94,20 @@ function v({ value: r, defaultValue: v, onValueChange: y, onChange: b, min: x, m
94
94
  });
95
95
  }
96
96
  }, $ = V.value ? h(_(V.value), I) : "";
97
- return /* @__PURE__ */ d("div", {
97
+ return /* @__PURE__ */ f("div", {
98
98
  ref: G,
99
99
  className: n(e.wrapper, re),
100
100
  "data-state": E ? "error" : j.value,
101
101
  "data-size": D,
102
102
  children: [
103
- w && /* @__PURE__ */ u("label", {
103
+ w && /* @__PURE__ */ d("label", {
104
104
  className: e.label,
105
105
  htmlFor: P,
106
106
  children: w
107
107
  }),
108
- /* @__PURE__ */ d("div", {
108
+ /* @__PURE__ */ f("div", {
109
109
  className: e.field,
110
- children: [/* @__PURE__ */ d("button", {
110
+ children: [/* @__PURE__ */ f("button", {
111
111
  id: P,
112
112
  type: "button",
113
113
  role: "combobox",
@@ -119,15 +119,15 @@ function v({ value: r, defaultValue: v, onValueChange: y, onChange: b, min: x, m
119
119
  className: e.trigger,
120
120
  disabled: O,
121
121
  onClick: j.value === "open" ? q : K,
122
- children: [/* @__PURE__ */ u("span", {
122
+ children: [/* @__PURE__ */ d("span", {
123
123
  className: n(e.value, $ ? void 0 : e.placeholder),
124
124
  children: $ || ie
125
- }), /* @__PURE__ */ u("span", {
125
+ }), /* @__PURE__ */ d("span", {
126
126
  className: e.icon,
127
127
  "aria-hidden": "true",
128
128
  children: "📅"
129
129
  })]
130
- }), C && V.value !== void 0 && /* @__PURE__ */ u("button", {
130
+ }), C && V.value !== void 0 && /* @__PURE__ */ d("button", {
131
131
  type: "button",
132
132
  className: e.clear,
133
133
  "aria-label": R,
@@ -135,29 +135,29 @@ function v({ value: r, defaultValue: v, onValueChange: y, onChange: b, min: x, m
135
135
  children: "✕"
136
136
  })]
137
137
  }),
138
- /* @__PURE__ */ d("div", {
138
+ /* @__PURE__ */ f("div", {
139
139
  id: F,
140
140
  role: "dialog",
141
141
  "aria-label": Q,
142
142
  className: e.calendar,
143
143
  "data-state": j.value,
144
144
  onKeyDown: de,
145
- children: [/* @__PURE__ */ d("div", {
145
+ children: [/* @__PURE__ */ f("div", {
146
146
  className: e.header,
147
147
  children: [
148
- /* @__PURE__ */ u("button", {
148
+ /* @__PURE__ */ d("button", {
149
149
  type: "button",
150
150
  className: e.navButton,
151
151
  "aria-label": ae,
152
152
  onClick: se,
153
153
  children: "‹"
154
154
  }),
155
- /* @__PURE__ */ u("span", {
155
+ /* @__PURE__ */ d("span", {
156
156
  className: e.monthLabel,
157
157
  "aria-live": "polite",
158
158
  children: Q
159
159
  }),
160
- /* @__PURE__ */ u("button", {
160
+ /* @__PURE__ */ d("button", {
161
161
  type: "button",
162
162
  className: e.navButton,
163
163
  "aria-label": L,
@@ -165,20 +165,20 @@ function v({ value: r, defaultValue: v, onValueChange: y, onChange: b, min: x, m
165
165
  children: "›"
166
166
  })
167
167
  ]
168
- }), /* @__PURE__ */ d("table", {
168
+ }), /* @__PURE__ */ f("table", {
169
169
  role: "grid",
170
170
  className: e.grid,
171
- children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: ue.map((t) => /* @__PURE__ */ u("th", {
171
+ children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: ue.map((t) => /* @__PURE__ */ d("th", {
172
172
  className: e.weekday,
173
173
  abbr: t,
174
174
  scope: "col",
175
175
  children: t
176
- }, t)) }) }), /* @__PURE__ */ u("tbody", { children: Z.map((t, n) => /* @__PURE__ */ u("tr", { children: t.map((t, n) => {
177
- if (!t) return /* @__PURE__ */ u("td", { className: e.empty }, n);
176
+ }, t)) }) }), /* @__PURE__ */ d("tbody", { children: Z.map((t, n) => /* @__PURE__ */ d("tr", { children: t.map((t, n) => {
177
+ if (!t) return /* @__PURE__ */ d("td", { className: e.empty }, n);
178
178
  let r = g(t), i = r === V.value, a = r === B, o = r === W.value, s = x !== void 0 && r < x || S !== void 0 && r > S;
179
- return /* @__PURE__ */ u("td", {
179
+ return /* @__PURE__ */ d("td", {
180
180
  className: e.cell,
181
- children: /* @__PURE__ */ u("button", {
181
+ children: /* @__PURE__ */ d("button", {
182
182
  type: "button",
183
183
  className: e.day,
184
184
  tabIndex: o ? 0 : -1,
@@ -200,13 +200,13 @@ function v({ value: r, defaultValue: v, onValueChange: y, onChange: b, min: x, m
200
200
  }) }, n)) })]
201
201
  })]
202
202
  }),
203
- E && /* @__PURE__ */ u("span", {
203
+ E && /* @__PURE__ */ d("span", {
204
204
  id: `${N}-error`,
205
205
  className: e.error,
206
206
  role: "alert",
207
207
  children: E
208
208
  }),
209
- !E && T && /* @__PURE__ */ u("span", {
209
+ !E && T && /* @__PURE__ */ d("span", {
210
210
  id: `${N}-hint`,
211
211
  className: e.hint,
212
212
  children: T
@@ -2,10 +2,10 @@
2
2
 
3
3
  import { Calendar as e } from "../calendar/calendar.js";
4
4
  import t from "./date-range-picker.module.js";
5
- import { batch as n, cn as r, useControllableSignal as i, useSignal as a, useSignalEffect as o, useSignals as s } from "@cascivo/core";
6
- import { builtin as c, currentLocale as ee, t as l } from "@cascivo/i18n";
7
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
8
- import { useRef as f } from "react";
5
+ import { batch as n, cn as r, useControllableSignal as ee, useSignal as i, useSignalEffect as a, useSignals as o } from "@cascivo/core";
6
+ import { useRef as s } from "react";
7
+ import { builtin as c, currentLocale as l, t as u } from "@cascivo/i18n";
8
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
9
9
  //#region ../components/src/date-range-picker/date-range-picker.tsx
10
10
  function p(e) {
11
11
  return Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate());
@@ -21,15 +21,15 @@ function h(e, t, n) {
21
21
  };
22
22
  }
23
23
  function g({ value: g, defaultValue: _, onValueChange: te, min: v, max: y, disabled: b, presets: x, locale: S, placeholder: C, size: w = "md", labels: T, className: ne }) {
24
- s();
25
- let E = S ?? ee(), re = C ?? l(c.dateRangePicker.placeholder), D = T?.apply ?? l(c.dateRangePicker.apply), O = T?.clear ?? l(c.dateRangePicker.clear), k = T?.previousMonth ?? l(c.calendar.previousMonth), A = T?.nextMonth ?? l(c.calendar.nextMonth), [j, M] = i({
24
+ o();
25
+ let E = S ?? l(), re = C ?? u(c.dateRangePicker.placeholder), D = T?.apply ?? u(c.dateRangePicker.apply), O = T?.clear ?? u(c.dateRangePicker.clear), k = T?.previousMonth ?? u(c.calendar.previousMonth), A = T?.nextMonth ?? u(c.calendar.nextMonth), [j, M] = ee({
26
26
  value: g === void 0 ? void 0 : g,
27
27
  defaultValue: _ ?? null,
28
28
  onChange: (e) => {
29
29
  e && te?.(e);
30
30
  }
31
- }), N = a(!1), P = a(null), F = a(null), I = j.value?.start ?? _?.start ?? /* @__PURE__ */ new Date(), L = a(I.getUTCFullYear()), R = a(I.getUTCMonth()), z = f(null);
32
- o(() => {
31
+ }), N = i(!1), P = i(null), F = i(null), I = j.value?.start ?? _?.start ?? /* @__PURE__ */ new Date(), L = i(I.getUTCFullYear()), R = i(I.getUTCMonth()), z = s(null);
32
+ a(() => {
33
33
  if (!N.value) return;
34
34
  let e = (e) => {
35
35
  z.current && !z.current.contains(e.target) && (N.value = !1);
@@ -102,49 +102,49 @@ function g({ value: g, defaultValue: _, onValueChange: te, min: v, max: y, disab
102
102
  nextMonth: A
103
103
  }
104
104
  };
105
- return /* @__PURE__ */ d("div", {
105
+ return /* @__PURE__ */ f("div", {
106
106
  ref: z,
107
107
  className: r(t.wrapper, ne),
108
108
  "data-size": w,
109
109
  onKeyDown: (e) => {
110
110
  e.key === "Escape" && N.value && (e.stopPropagation(), V());
111
111
  },
112
- children: [/* @__PURE__ */ d("button", {
112
+ children: [/* @__PURE__ */ f("button", {
113
113
  type: "button",
114
114
  role: "combobox",
115
115
  "aria-expanded": N.value,
116
116
  "aria-haspopup": "dialog",
117
- "aria-label": T?.label ?? l(c.dateRangePicker.label),
117
+ "aria-label": T?.label ?? u(c.dateRangePicker.label),
118
118
  className: t.trigger,
119
119
  onClick: N.value ? V : B,
120
- children: [/* @__PURE__ */ u("span", {
120
+ children: [/* @__PURE__ */ d("span", {
121
121
  className: r(t.value, Z ? void 0 : t.placeholder),
122
122
  children: Z || re
123
- }), /* @__PURE__ */ u("span", {
123
+ }), /* @__PURE__ */ d("span", {
124
124
  className: t.icon,
125
125
  "aria-hidden": "true",
126
126
  children: "📅"
127
127
  })]
128
- }), /* @__PURE__ */ d("div", {
128
+ }), /* @__PURE__ */ f("div", {
129
129
  role: "dialog",
130
130
  className: t.panel,
131
131
  "data-state": N.value ? "open" : "closed",
132
132
  children: [
133
- x && x.length > 0 && /* @__PURE__ */ u("div", {
133
+ x && x.length > 0 && /* @__PURE__ */ d("div", {
134
134
  className: t.presets,
135
- children: x.map((e) => /* @__PURE__ */ u("button", {
135
+ children: x.map((e) => /* @__PURE__ */ d("button", {
136
136
  type: "button",
137
137
  className: t.preset,
138
138
  onClick: () => W(e),
139
139
  children: e.label
140
140
  }, e.label))
141
141
  }),
142
- /* @__PURE__ */ d("div", {
142
+ /* @__PURE__ */ f("div", {
143
143
  className: t.calendars,
144
144
  children: [
145
- /* @__PURE__ */ u("div", {
145
+ /* @__PURE__ */ d("div", {
146
146
  className: t.calNav,
147
- children: /* @__PURE__ */ u("button", {
147
+ children: /* @__PURE__ */ d("button", {
148
148
  type: "button",
149
149
  className: t.navButton,
150
150
  "aria-label": k,
@@ -152,19 +152,19 @@ function g({ value: g, defaultValue: _, onValueChange: te, min: v, max: y, disab
152
152
  children: "‹"
153
153
  })
154
154
  }),
155
- /* @__PURE__ */ u(e, {
155
+ /* @__PURE__ */ d(e, {
156
156
  month: R.value,
157
157
  year: L.value,
158
158
  ...$
159
159
  }),
160
- /* @__PURE__ */ u(e, {
160
+ /* @__PURE__ */ d(e, {
161
161
  month: Q.month,
162
162
  year: Q.year,
163
163
  ...$
164
164
  }),
165
- /* @__PURE__ */ u("div", {
165
+ /* @__PURE__ */ d("div", {
166
166
  className: t.calNav,
167
- children: /* @__PURE__ */ u("button", {
167
+ children: /* @__PURE__ */ d("button", {
168
168
  type: "button",
169
169
  className: t.navButton,
170
170
  "aria-label": A,
@@ -174,14 +174,14 @@ function g({ value: g, defaultValue: _, onValueChange: te, min: v, max: y, disab
174
174
  })
175
175
  ]
176
176
  }),
177
- /* @__PURE__ */ d("div", {
177
+ /* @__PURE__ */ f("div", {
178
178
  className: t.footer,
179
- children: [/* @__PURE__ */ u("button", {
179
+ children: [/* @__PURE__ */ d("button", {
180
180
  type: "button",
181
181
  className: t.clearBtn,
182
182
  onClick: G,
183
183
  children: O
184
- }), /* @__PURE__ */ u("button", {
184
+ }), /* @__PURE__ */ d("button", {
185
185
  type: "button",
186
186
  className: t.applyBtn,
187
187
  onClick: V,
@@ -2,9 +2,9 @@
2
2
 
3
3
  import e from "./drawer.module.js";
4
4
  import { DismissableLayer as t, FocusScope as n, Portal as r, Presence as i, cn as a, useControllableSignal as o, useDraggable as s, useScrollLock as c, useSignals as l } from "@cascivo/core";
5
- import { builtin as u, t as d } from "@cascivo/i18n";
6
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
7
- import { useId as m } from "react";
5
+ import { useId as u } from "react";
6
+ import { builtin as d, t as f } from "@cascivo/i18n";
7
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
8
8
  //#region ../components/src/drawer/drawer.tsx
9
9
  var h = 80;
10
10
  function g({ open: g, defaultOpen: _, onOpenChange: v, side: y = "end", size: b, title: x, description: S, children: C, labels: w, className: T, swipeToDismiss: E = !1 }) {
@@ -22,25 +22,25 @@ function g({ open: g, defaultOpen: _, onOpenChange: v, side: y = "end", size: b,
22
22
  let t = k === "y" ? e.y : e.x, n = y === "end" && t > h || y === "start" && t < -80 || y === "bottom" && t > h || y === "top" && t < -80;
23
23
  N(), n && O(!1);
24
24
  }
25
- }), P = m(), F = m(), I = w?.close ?? d(u.drawer.close), L = {
25
+ }), P = u(), F = u(), I = w?.close ?? f(d.drawer.close), L = {
26
26
  ...b ? { "--_drawer-size": b } : {},
27
27
  ...E ? {
28
28
  "--_drawer-drag-x": `${j.value.x}px`,
29
29
  "--_drawer-drag-y": `${j.value.y}px`
30
30
  } : {}
31
31
  };
32
- return /* @__PURE__ */ f(r, { children: /* @__PURE__ */ f(i, {
32
+ return /* @__PURE__ */ p(r, { children: /* @__PURE__ */ p(i, {
33
33
  present: D,
34
- children: /* @__PURE__ */ f("div", {
34
+ children: /* @__PURE__ */ p("div", {
35
35
  className: e.overlay,
36
36
  "data-side": y,
37
- children: /* @__PURE__ */ f(t, {
37
+ children: /* @__PURE__ */ p(t, {
38
38
  onDismiss: () => O(!1),
39
- children: /* @__PURE__ */ f(n, {
39
+ children: /* @__PURE__ */ p(n, {
40
40
  trapped: !0,
41
41
  restoreFocus: !0,
42
42
  autoFocus: !0,
43
- children: /* @__PURE__ */ p("div", {
43
+ children: /* @__PURE__ */ m("div", {
44
44
  role: "dialog",
45
45
  "aria-modal": "true",
46
46
  "aria-labelledby": x ? P : void 0,
@@ -49,30 +49,30 @@ function g({ open: g, defaultOpen: _, onOpenChange: v, side: y = "end", size: b,
49
49
  "data-dragging": E && M.value ? "" : void 0,
50
50
  className: a(e.panel, T),
51
51
  style: L,
52
- children: [(x || S) && /* @__PURE__ */ p("div", {
52
+ children: [(x || S) && /* @__PURE__ */ m("div", {
53
53
  className: e.header,
54
54
  ref: E ? A : void 0,
55
- children: [/* @__PURE__ */ p("div", {
55
+ children: [/* @__PURE__ */ m("div", {
56
56
  className: e.heading,
57
- children: [x && /* @__PURE__ */ f("h2", {
57
+ children: [x && /* @__PURE__ */ p("h2", {
58
58
  id: P,
59
59
  className: e.title,
60
60
  children: x
61
- }), S && /* @__PURE__ */ f("p", {
61
+ }), S && /* @__PURE__ */ p("p", {
62
62
  id: F,
63
63
  className: e.description,
64
64
  children: S
65
65
  })]
66
- }), /* @__PURE__ */ f("button", {
66
+ }), /* @__PURE__ */ p("button", {
67
67
  type: "button",
68
68
  "aria-label": I,
69
69
  onClick: () => O(!1),
70
70
  className: e.close,
71
- children: /* @__PURE__ */ f("svg", {
71
+ children: /* @__PURE__ */ p("svg", {
72
72
  "aria-hidden": "true",
73
73
  viewBox: "0 0 16 16",
74
74
  className: e.closeIcon,
75
- children: /* @__PURE__ */ f("path", {
75
+ children: /* @__PURE__ */ p("path", {
76
76
  d: "M4 4l8 8M12 4l-8 8",
77
77
  fill: "none",
78
78
  stroke: "currentColor",
@@ -81,8 +81,9 @@ function g({ open: g, defaultOpen: _, onOpenChange: v, side: y = "end", size: b,
81
81
  })
82
82
  })
83
83
  })]
84
- }), /* @__PURE__ */ f("div", {
84
+ }), /* @__PURE__ */ p("div", {
85
85
  className: e.body,
86
+ "data-cascivo-drawer-body": "",
86
87
  children: C
87
88
  })]
88
89
  })
@@ -1,15 +1,15 @@
1
1
  "use client";
2
2
 
3
3
  var e = {
4
- overlay: "_overlay_cbcjg_2",
5
- panel: "_panel_cbcjg_39",
6
- header: "_header_cbcjg_124",
7
- heading: "_heading_cbcjg_134",
8
- title: "_title_cbcjg_140",
9
- description: "_description_cbcjg_147",
10
- close: "_close_cbcjg_153",
11
- closeIcon: "_closeIcon_cbcjg_181",
12
- body: "_body_cbcjg_186"
4
+ overlay: "_overlay_1q94b_2",
5
+ panel: "_panel_1q94b_39",
6
+ header: "_header_1q94b_124",
7
+ heading: "_heading_1q94b_134",
8
+ title: "_title_1q94b_140",
9
+ description: "_description_1q94b_147",
10
+ close: "_close_1q94b_153",
11
+ closeIcon: "_closeIcon_1q94b_181",
12
+ body: "_body_1q94b_186"
13
13
  };
14
14
  //#endregion
15
15
  export { e as default };
@@ -1,100 +1,100 @@
1
1
  "use client";
2
2
 
3
3
  import e from "./dropdown.module.js";
4
- import { composeRefs as t, createMachine as n, useEffectPropSignal as r, useMachine as i, useSignal as a, useSignalEffect as o, useSignals as s } from "@cascivo/core";
5
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
- import { cloneElement as u, useRef as d } from "react";
4
+ import { composeRefs as t, createMachine as n, focusElement as r, useEffectPropSignal as i, useMachine as a, useSignal as o, useSignalEffect as s, useSignals as c } from "@cascivo/core";
5
+ import { cloneElement as l, useRef as u } from "react";
6
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
7
7
  //#region ../components/src/dropdown/dropdown.tsx
8
- var f = n({
8
+ var p = n({
9
9
  initial: "closed",
10
10
  states: {
11
11
  closed: { on: { OPEN: "open" } },
12
12
  open: { on: { CLOSE: "closed" } }
13
13
  }
14
14
  });
15
- function p({ trigger: n, items: p, onSelect: m, placement: h = "bottom-start", open: g, onOpenChange: _ }) {
16
- s();
17
- let [v, y] = i(f), b = d(null), x = d(null), S = d(null), C = d([]), w = a(-1), T = g !== void 0, E = T ? g : v.value === "open", D = r(E), O = p.map((e, t) => ({
15
+ function m({ trigger: n, items: m, onSelect: h, placement: g = "bottom-start", open: _, onOpenChange: v }) {
16
+ c();
17
+ let [y, b] = a(p), x = u(null), S = u(null), C = u(null), w = u([]), T = o(-1), E = _ !== void 0, D = E ? _ : y.value === "open", O = i(D), k = m.map((e, t) => ({
18
18
  item: e,
19
19
  index: t
20
- })).filter(({ item: e }) => !e.separator && !e.disabled).map(({ index: e }) => e), k = (e) => {
21
- T || y(e ? "OPEN" : "CLOSE"), _?.(e);
20
+ })).filter(({ item: e }) => !e.separator && !e.disabled).map(({ index: e }) => e), A = (e) => {
21
+ E || b(e ? "OPEN" : "CLOSE"), v?.(e);
22
22
  };
23
- o(() => {
24
- let e = w.value;
25
- D.value && e >= 0 && C.current[e]?.focus();
26
- }), o(() => {
27
- D.value ? w.value = O[0] ?? -1 : w.value = -1;
28
- }), o(() => {
29
- D.value ? S.current?.showPopover() : S.current?.hidePopover();
30
- }), o(() => {
31
- let e = S.current;
23
+ s(() => {
24
+ let e = T.value;
25
+ O.value && e >= 0 && w.current[e]?.focus();
26
+ }), s(() => {
27
+ O.value ? T.value = k[0] ?? -1 : T.value = -1;
28
+ }), s(() => {
29
+ O.value ? C.current?.showPopover() : C.current?.hidePopover();
30
+ }), s(() => {
31
+ let e = C.current;
32
32
  if (!e) return;
33
33
  let t = (e) => {
34
- e.newState === "closed" && k(!1);
34
+ e.newState === "closed" && A(!1);
35
35
  };
36
36
  return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
37
37
  });
38
- let A = (e) => {
39
- let t = p[e];
40
- !t || t.separator || t.disabled || (m?.(t.value), k(!1), x.current?.focus());
41
- }, j = (e) => {
42
- O.length !== 0 && (w.value = O[(O.indexOf(w.value) + e + O.length) % O.length] ?? -1);
38
+ let j = (e) => {
39
+ let t = m[e];
40
+ !t || t.separator || t.disabled || (h?.(t.value), A(!1), r(S.current));
43
41
  }, M = (e) => {
42
+ k.length !== 0 && (T.value = k[(k.indexOf(T.value) + e + k.length) % k.length] ?? -1);
43
+ }, N = (e) => {
44
44
  switch (e.key) {
45
45
  case "ArrowDown":
46
- e.preventDefault(), j(1);
46
+ e.preventDefault(), M(1);
47
47
  break;
48
48
  case "ArrowUp":
49
- e.preventDefault(), j(-1);
49
+ e.preventDefault(), M(-1);
50
50
  break;
51
51
  case "Home":
52
- e.preventDefault(), w.value = O[0] ?? -1;
52
+ e.preventDefault(), T.value = k[0] ?? -1;
53
53
  break;
54
54
  case "End":
55
- e.preventDefault(), w.value = O[O.length - 1] ?? -1;
55
+ e.preventDefault(), T.value = k[k.length - 1] ?? -1;
56
56
  break;
57
57
  case "Escape":
58
- e.preventDefault(), k(!1), x.current?.focus();
58
+ e.preventDefault(), A(!1), r(S.current);
59
59
  break;
60
60
  case "Enter":
61
61
  case " ":
62
- e.preventDefault(), A(w.value);
62
+ e.preventDefault(), j(T.value);
63
63
  break;
64
64
  }
65
- }, N = n, P = u(N, {
66
- ref: t(x, N.props.ref),
65
+ }, P = n, F = l(P, {
66
+ ref: t(S, P.props.ref),
67
67
  onClick: (e) => {
68
- N.props.onClick?.(e), k(!E);
68
+ P.props.onClick?.(e), A(!D);
69
69
  },
70
70
  "aria-haspopup": "menu",
71
- "aria-expanded": E
71
+ "aria-expanded": D
72
72
  });
73
- return /* @__PURE__ */ l("div", {
74
- ref: b,
73
+ return /* @__PURE__ */ f("div", {
74
+ ref: x,
75
75
  className: e.root,
76
- children: [P, /* @__PURE__ */ c("div", {
77
- ref: S,
76
+ children: [F, /* @__PURE__ */ d("div", {
77
+ ref: C,
78
78
  popover: "auto",
79
79
  role: "menu",
80
- "data-placement": h,
81
- "data-state": E ? "open" : "closed",
80
+ "data-placement": g,
81
+ "data-state": D ? "open" : "closed",
82
82
  className: e.menu,
83
- onKeyDown: M,
84
- children: p.map((t, n) => t.separator ? /* @__PURE__ */ c("div", {
83
+ onKeyDown: N,
84
+ children: m.map((t, n) => t.separator ? /* @__PURE__ */ d("div", {
85
85
  role: "separator",
86
86
  className: e.separator
87
- }, `sep-${n}`) : /* @__PURE__ */ l("button", {
87
+ }, `sep-${n}`) : /* @__PURE__ */ f("button", {
88
88
  type: "button",
89
89
  role: "menuitem",
90
90
  ref: (e) => {
91
- C.current[n] = e;
91
+ w.current[n] = e;
92
92
  },
93
- tabIndex: w.value === n ? 0 : -1,
93
+ tabIndex: T.value === n ? 0 : -1,
94
94
  disabled: t.disabled,
95
95
  className: e.item,
96
- onClick: () => A(n),
97
- children: [t.icon && /* @__PURE__ */ c("span", {
96
+ onClick: () => j(n),
97
+ children: [t.icon && /* @__PURE__ */ d("span", {
98
98
  className: e.icon,
99
99
  "aria-hidden": "true",
100
100
  children: t.icon
@@ -104,4 +104,4 @@ function p({ trigger: n, items: p, onSelect: m, placement: h = "bottom-start", o
104
104
  });
105
105
  }
106
106
  //#endregion
107
- export { p as Dropdown };
107
+ export { m as Dropdown };
@@ -2,14 +2,14 @@
2
2
 
3
3
  import e from "./editable.module.js";
4
4
  import { cn as t, useSignal as n, useSignalEffect as r, useSignals as i } from "@cascivo/core";
5
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
- import { useRef as s } from "react";
5
+ import { useRef as a } from "react";
6
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
7
  //#region ../components/src/editable/editable.tsx
8
8
  function c({ value: c, onValueChange: l, placeholder: u, disabled: d = !1, submitOnBlur: f = !0, onCancel: p, className: m, ...h }) {
9
9
  i();
10
- let g = n(!1), _ = n(c), v = s(null), y = s(p);
10
+ let g = n(!1), _ = n(c), v = a(null), y = a(p);
11
11
  y.current = p;
12
- let b = s(l);
12
+ let b = a(l);
13
13
  b.current = l, g.value || (_.value = c), r(() => {
14
14
  if (g.value) {
15
15
  let e = v.current;
@@ -22,10 +22,10 @@ function c({ value: c, onValueChange: l, placeholder: u, disabled: d = !1, submi
22
22
  function S() {
23
23
  _.value = c, g.value = !1, y.current?.();
24
24
  }
25
- return g.value ? /* @__PURE__ */ a("div", {
25
+ return g.value ? /* @__PURE__ */ o("div", {
26
26
  className: t(e.wrapper, e.editing, m),
27
27
  ...h,
28
- children: /* @__PURE__ */ a("input", {
28
+ children: /* @__PURE__ */ o("input", {
29
29
  ref: v,
30
30
  className: e.input,
31
31
  value: _.value,
@@ -39,24 +39,24 @@ function c({ value: c, onValueChange: l, placeholder: u, disabled: d = !1, submi
39
39
  f ? x() : S();
40
40
  }
41
41
  })
42
- }) : /* @__PURE__ */ a("div", {
42
+ }) : /* @__PURE__ */ o("div", {
43
43
  className: t(e.wrapper, m),
44
44
  "data-disabled": d ? "" : void 0,
45
45
  ...h,
46
- children: /* @__PURE__ */ o("button", {
46
+ children: /* @__PURE__ */ s("button", {
47
47
  type: "button",
48
48
  className: e.preview,
49
49
  disabled: d,
50
50
  onClick: () => {
51
51
  d || (g.value = !0);
52
52
  },
53
- children: [/* @__PURE__ */ a("span", {
53
+ children: [/* @__PURE__ */ o("span", {
54
54
  className: e["preview-text"],
55
- children: c || /* @__PURE__ */ a("span", {
55
+ children: c || /* @__PURE__ */ o("span", {
56
56
  className: e.placeholder,
57
57
  children: u
58
58
  })
59
- }), /* @__PURE__ */ a("span", {
59
+ }), /* @__PURE__ */ o("span", {
60
60
  className: e["edit-icon"],
61
61
  "aria-hidden": "true"
62
62
  })]