@cascivo/react 0.13.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 (160) 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 +202 -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/side-nav/side-nav.js +91 -91
  112. package/dist/node/skip-nav/skip-nav.js +12 -12
  113. package/dist/node/slider/slider.js +13 -11
  114. package/dist/node/structured-list/structured-list.js +23 -23
  115. package/dist/node/tabs/tabs.js +49 -47
  116. package/dist/node/tags-input/tags-input.js +35 -35
  117. package/dist/node/textarea/textarea.js +22 -21
  118. package/dist/node/time-picker/time-picker.js +22 -21
  119. package/dist/node/toast/toast.js +15 -15
  120. package/dist/node/toc/toc.js +8 -8
  121. package/dist/node/toggle/toggle.js +15 -13
  122. package/dist/node/toggle-group/toggle-group.js +10 -10
  123. package/dist/node/toggletip/toggletip.js +9 -9
  124. package/dist/node/tooltip/tooltip.js +5 -5
  125. package/dist/node/tree-view/tree-view.js +32 -32
  126. package/dist/notification/notification.js +26 -26
  127. package/dist/number-input/number-input.js +52 -50
  128. package/dist/otp-input/otp-input.js +8 -8
  129. package/dist/password-input/password-input.js +28 -27
  130. package/dist/popover/popover.js +26 -24
  131. package/dist/pull-to-refresh/pull-to-refresh.js +13 -13
  132. package/dist/radial-progress/radial-progress.js +5 -5
  133. package/dist/radio/radio.js +23 -22
  134. package/dist/radio-card/radio-card.js +27 -26
  135. package/dist/react/src/index.js +3 -3
  136. package/dist/react/src/theme.js +30 -19
  137. package/dist/resizable/resizable.js +11 -11
  138. package/dist/scroll-area/scroll-area.js +4 -4
  139. package/dist/search/search.js +49 -49
  140. package/dist/select/select.js +27 -26
  141. package/dist/sheet/sheet.css +1 -1
  142. package/dist/sheet/sheet.js +11 -10
  143. package/dist/sheet/sheet.module.js +5 -5
  144. package/dist/side-nav/side-nav.js +91 -91
  145. package/dist/skip-nav/skip-nav.js +12 -12
  146. package/dist/slider/slider.js +13 -11
  147. package/dist/structured-list/structured-list.js +23 -23
  148. package/dist/styles.css +55 -5
  149. package/dist/tabs/tabs.js +49 -47
  150. package/dist/tags-input/tags-input.js +35 -35
  151. package/dist/textarea/textarea.js +22 -21
  152. package/dist/time-picker/time-picker.js +22 -21
  153. package/dist/toast/toast.js +15 -15
  154. package/dist/toc/toc.js +8 -8
  155. package/dist/toggle/toggle.js +15 -13
  156. package/dist/toggle-group/toggle-group.js +10 -10
  157. package/dist/toggletip/toggletip.js +9 -9
  158. package/dist/tooltip/tooltip.js +5 -5
  159. package/dist/tree-view/tree-view.js +32 -32
  160. package/package.json +10 -4
@@ -2,20 +2,20 @@
2
2
 
3
3
  import e from "./carousel.module.js";
4
4
  import { cn as t, useControllableSignal as n, useRovingFocus as r, useSignalEffect 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";
5
+ import { useId as o, useRef as s } from "react";
6
+ import { builtin as c, t as l } from "@cascivo/i18n";
7
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
8
8
  //#region ../components/src/carousel/carousel.tsx
9
9
  function f(e, t) {
10
10
  return t || (e == null ? [] : Array.isArray(e) ? e : [e]);
11
11
  }
12
12
  function p({ children: p, slides: m, index: h, defaultIndex: g, onIndexChange: _, loop: v = !1, className: y, labels: b }) {
13
13
  a();
14
- let x = u(), S = f(p, m), C = S.length, [w, T] = n({
14
+ let x = o(), S = f(p, m), C = S.length, [w, T] = n({
15
15
  value: h,
16
16
  defaultValue: g ?? 0,
17
17
  onChange: _
18
- }), E = d(null), D = d([]), O = d(!1), { getItemProps: k, setActiveIndex: A } = r({
18
+ }), E = s(null), D = s([]), O = s(!1), { getItemProps: k, setActiveIndex: A } = r({
19
19
  orientation: "horizontal",
20
20
  loop: v
21
21
  });
@@ -40,28 +40,28 @@ function p({ children: p, slides: m, index: h, defaultIndex: g, onIndexChange: _
40
40
  }), window.setTimeout(() => {
41
41
  O.current = !1;
42
42
  }, 400)), T(t), A(t);
43
- }, M = b?.region ?? s(o.carousel.region), N = b?.previous ?? s(o.carousel.previous), P = b?.next ?? s(o.carousel.next);
44
- return /* @__PURE__ */ l("section", {
43
+ }, M = b?.region ?? l(c.carousel.region), N = b?.previous ?? l(c.carousel.previous), P = b?.next ?? l(c.carousel.next);
44
+ return /* @__PURE__ */ d("section", {
45
45
  className: t(e.carousel, y),
46
46
  "aria-roledescription": "carousel",
47
47
  "aria-label": M,
48
- children: [/* @__PURE__ */ l("div", {
48
+ children: [/* @__PURE__ */ d("div", {
49
49
  className: e.viewport,
50
50
  children: [
51
- /* @__PURE__ */ c("button", {
51
+ /* @__PURE__ */ u("button", {
52
52
  type: "button",
53
53
  className: t(e.nav, e.prev),
54
54
  "aria-label": N,
55
55
  "aria-controls": `${x}-track`,
56
56
  disabled: !v && w.value <= 0,
57
57
  onClick: () => j(w.value - 1),
58
- children: /* @__PURE__ */ c("svg", {
58
+ children: /* @__PURE__ */ u("svg", {
59
59
  width: "20",
60
60
  height: "20",
61
61
  viewBox: "0 0 24 24",
62
62
  fill: "none",
63
63
  "aria-hidden": "true",
64
- children: /* @__PURE__ */ c("path", {
64
+ children: /* @__PURE__ */ u("path", {
65
65
  d: "m15 18-6-6 6-6",
66
66
  stroke: "currentColor",
67
67
  strokeWidth: "2",
@@ -70,18 +70,18 @@ function p({ children: p, slides: m, index: h, defaultIndex: g, onIndexChange: _
70
70
  })
71
71
  })
72
72
  }),
73
- /* @__PURE__ */ c("div", {
73
+ /* @__PURE__ */ u("div", {
74
74
  ref: E,
75
75
  id: `${x}-track`,
76
76
  className: e.track,
77
- children: S.map((t, n) => /* @__PURE__ */ c("div", {
77
+ children: S.map((t, n) => /* @__PURE__ */ u("div", {
78
78
  ref: (e) => {
79
79
  D.current[n] = e;
80
80
  },
81
81
  className: e.slide,
82
82
  role: "group",
83
83
  "aria-roledescription": "slide",
84
- "aria-label": s(o.carousel.slide, {
84
+ "aria-label": l(c.carousel.slide, {
85
85
  n: n + 1,
86
86
  total: C
87
87
  }),
@@ -89,20 +89,20 @@ function p({ children: p, slides: m, index: h, defaultIndex: g, onIndexChange: _
89
89
  children: t
90
90
  }, n))
91
91
  }),
92
- /* @__PURE__ */ c("button", {
92
+ /* @__PURE__ */ u("button", {
93
93
  type: "button",
94
94
  className: t(e.nav, e.next),
95
95
  "aria-label": P,
96
96
  "aria-controls": `${x}-track`,
97
97
  disabled: !v && w.value >= C - 1,
98
98
  onClick: () => j(w.value + 1),
99
- children: /* @__PURE__ */ c("svg", {
99
+ children: /* @__PURE__ */ u("svg", {
100
100
  width: "20",
101
101
  height: "20",
102
102
  viewBox: "0 0 24 24",
103
103
  fill: "none",
104
104
  "aria-hidden": "true",
105
- children: /* @__PURE__ */ c("path", {
105
+ children: /* @__PURE__ */ u("path", {
106
106
  d: "m9 18 6-6-6-6",
107
107
  stroke: "currentColor",
108
108
  strokeWidth: "2",
@@ -112,17 +112,17 @@ function p({ children: p, slides: m, index: h, defaultIndex: g, onIndexChange: _
112
112
  })
113
113
  })
114
114
  ]
115
- }), /* @__PURE__ */ c("div", {
115
+ }), /* @__PURE__ */ u("div", {
116
116
  className: e.dots,
117
117
  role: "group",
118
118
  "aria-label": M,
119
119
  children: S.map((t, n) => {
120
120
  let r = k(n);
121
- return /* @__PURE__ */ c("button", {
121
+ return /* @__PURE__ */ u("button", {
122
122
  ref: r.ref,
123
123
  type: "button",
124
124
  className: e.dot,
125
- "aria-label": s(o.carousel.goTo, { n: n + 1 }),
125
+ "aria-label": l(c.carousel.goTo, { n: n + 1 }),
126
126
  "aria-current": n === w.value || void 0,
127
127
  "data-active": n === w.value || void 0,
128
128
  tabIndex: r.tabIndex,
@@ -1,38 +1,38 @@
1
1
  "use client";
2
2
 
3
3
  import e from "./checkbox.module.js";
4
- import { cn as t, useEffectPropSignal as n, useSignalEffect as r } from "@cascivo/core";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
- import { useRef as o } from "react";
4
+ import { cn as t, composeRefs as n, useEffectPropSignal as r, useSignalEffect as i } from "@cascivo/core";
5
+ import { forwardRef as a, useRef as o } from "react";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
7
  //#region ../components/src/checkbox/checkbox.tsx
8
- function s({ label: s, indeterminate: c = !1, className: l, id: u, disabled: d, ...f }) {
9
- let p = o(null), m = n(c);
10
- r(() => {
11
- p.current && (p.current.indeterminate = m.value);
8
+ var l = a(function({ label: a, indeterminate: l = !1, className: u, id: d, disabled: f, ...p }, m) {
9
+ let h = o(null), g = r(l);
10
+ i(() => {
11
+ h.current && (h.current.indeterminate = g.value);
12
12
  });
13
- let h = u ?? (s ? `cascade-checkbox-${s.toLowerCase().replace(/\s+/g, "-")}` : void 0);
14
- return /* @__PURE__ */ a("label", {
15
- className: t(e.wrapper, l),
16
- "data-disabled": d || void 0,
13
+ let _ = d ?? (a ? `cascade-checkbox-${a.toLowerCase().replace(/\s+/g, "-")}` : void 0);
14
+ return /* @__PURE__ */ c("label", {
15
+ className: t(e.wrapper, u),
16
+ "data-disabled": f || void 0,
17
17
  children: [
18
- /* @__PURE__ */ i("input", {
19
- ref: p,
20
- id: h,
18
+ /* @__PURE__ */ s("input", {
19
+ ref: n(m, h),
20
+ id: _,
21
21
  type: "checkbox",
22
22
  className: e.input,
23
- disabled: d,
24
- ...f
23
+ disabled: f,
24
+ ...p
25
25
  }),
26
- /* @__PURE__ */ i("span", {
26
+ /* @__PURE__ */ s("span", {
27
27
  className: e.control,
28
28
  "aria-hidden": "true"
29
29
  }),
30
- s && /* @__PURE__ */ i("span", {
30
+ a && /* @__PURE__ */ s("span", {
31
31
  className: e.label,
32
- children: s
32
+ children: a
33
33
  })
34
34
  ]
35
35
  });
36
- }
36
+ });
37
37
  //#endregion
38
- export { s as Checkbox };
38
+ export { l as Checkbox };
@@ -2,28 +2,30 @@
2
2
 
3
3
  import e from "./checkbox-card.module.js";
4
4
  import { cn as t } from "@cascivo/core";
5
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
+ import { forwardRef as n } from "react";
6
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
7
  //#region ../components/src/checkbox-card/checkbox-card.tsx
7
- function i({ title: i, description: a, checked: o, defaultChecked: s, disabled: c, onCheckedChange: l, className: u, ...d }) {
8
- return /* @__PURE__ */ r("label", {
8
+ var a = n(function({ title: n, description: a, checked: o, defaultChecked: s, disabled: c, onCheckedChange: l, className: u, ...d }, f) {
9
+ return /* @__PURE__ */ i("label", {
9
10
  className: t(e.card, u),
10
11
  "data-disabled": c || void 0,
11
12
  children: [
12
- /* @__PURE__ */ n("input", {
13
+ /* @__PURE__ */ r("input", {
13
14
  type: "checkbox",
14
15
  className: e.input,
15
16
  disabled: c,
16
17
  ...o === void 0 ? { defaultChecked: s } : { checked: o },
17
18
  onChange: (e) => l?.(e.currentTarget.checked),
19
+ ref: f,
18
20
  ...d
19
21
  }),
20
- /* @__PURE__ */ n("span", {
22
+ /* @__PURE__ */ r("span", {
21
23
  className: e.glyph,
22
24
  "aria-hidden": "true",
23
- children: /* @__PURE__ */ n("svg", {
25
+ children: /* @__PURE__ */ r("svg", {
24
26
  viewBox: "0 0 12 12",
25
27
  className: e.check,
26
- children: /* @__PURE__ */ n("path", {
28
+ children: /* @__PURE__ */ r("path", {
27
29
  d: "M2.5 6.5 5 9l4.5-5.5",
28
30
  fill: "none",
29
31
  stroke: "currentColor",
@@ -31,18 +33,18 @@ function i({ title: i, description: a, checked: o, defaultChecked: s, disabled:
31
33
  })
32
34
  })
33
35
  }),
34
- /* @__PURE__ */ r("span", {
36
+ /* @__PURE__ */ i("span", {
35
37
  className: e.body,
36
- children: [/* @__PURE__ */ n("span", {
38
+ children: [/* @__PURE__ */ r("span", {
37
39
  className: e.title,
38
- children: i
39
- }), a && /* @__PURE__ */ n("span", {
40
+ children: n
41
+ }), a && /* @__PURE__ */ r("span", {
40
42
  className: e.description,
41
43
  children: a
42
44
  })]
43
45
  })
44
46
  ]
45
47
  });
46
- }
48
+ });
47
49
  //#endregion
48
- export { i as CheckboxCard };
50
+ export { a as CheckboxCard };
@@ -2,8 +2,8 @@
2
2
 
3
3
  import e from "./collapsible.module.js";
4
4
  import { cn as t, useControllableSignal as n, useSignals as r } from "@cascivo/core";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
- import { useId as o } from "react";
5
+ import { useId as i } from "react";
6
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
7
  //#region ../components/src/collapsible/collapsible.tsx
8
8
  function s({ open: s, defaultOpen: c = !1, onOpenChange: l, trigger: u, disabled: d = !1, className: f, children: p }) {
9
9
  r();
@@ -11,11 +11,11 @@ function s({ open: s, defaultOpen: c = !1, onOpenChange: l, trigger: u, disabled
11
11
  ...s === void 0 ? {} : { value: s },
12
12
  defaultValue: c,
13
13
  ...l ? { onChange: l } : {}
14
- }), g = o(), _ = `${g}-content`, v = `${g}-trigger`, y = m.value;
15
- return /* @__PURE__ */ a("div", {
14
+ }), g = i(), _ = `${g}-content`, v = `${g}-trigger`, y = m.value;
15
+ return /* @__PURE__ */ o("div", {
16
16
  "data-state": y ? "open" : "closed",
17
17
  className: t(e.root, f),
18
- children: [/* @__PURE__ */ i("button", {
18
+ children: [/* @__PURE__ */ a("button", {
19
19
  type: "button",
20
20
  id: v,
21
21
  "aria-expanded": y,
@@ -25,13 +25,13 @@ function s({ open: s, defaultOpen: c = !1, onOpenChange: l, trigger: u, disabled
25
25
  className: e.trigger,
26
26
  onClick: () => h(!y),
27
27
  children: u
28
- }), /* @__PURE__ */ i("div", {
28
+ }), /* @__PURE__ */ a("div", {
29
29
  id: _,
30
30
  role: "region",
31
31
  "aria-labelledby": v,
32
32
  "data-state": y ? "open" : "closed",
33
33
  className: e.content,
34
- children: /* @__PURE__ */ i("div", {
34
+ children: /* @__PURE__ */ a("div", {
35
35
  className: e.contentInner,
36
36
  children: p
37
37
  })
@@ -2,9 +2,9 @@
2
2
 
3
3
  import e from "./color-picker.module.js";
4
4
  import { cn as t, useControllableSignal as n, useSignal 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 { useId as d, useRef as f } from "react";
5
+ import { useId as o, useRef as s } from "react";
6
+ import { builtin as c, t as l } from "@cascivo/i18n";
7
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
8
8
  //#region ../components/src/color-picker/color-picker.tsx
9
9
  function p(e, t, n) {
10
10
  return Math.min(n, Math.max(t, e));
@@ -75,11 +75,11 @@ function _({ h: e, s: t, l: n, a: r }) {
75
75
  }
76
76
  function v({ value: v, defaultValue: y, onValueChange: b, presets: x, alpha: S = !0, label: C, disabled: w, size: T = "md", className: E, labels: D }) {
77
77
  a();
78
- let O = d(), [k, A] = n({
78
+ let O = o(), [k, A] = n({
79
79
  value: v,
80
80
  defaultValue: y ?? "#3b82f6",
81
81
  onChange: b
82
- }), j = f(null), M = r(!1), N = g(m(k.value)), P = (e) => {
82
+ }), j = s(null), M = r(!1), N = g(m(k.value)), P = (e) => {
83
83
  A(h(_(e), S));
84
84
  }, F = (e, t) => {
85
85
  let n = j.current;
@@ -119,22 +119,22 @@ function v({ value: v, defaultValue: y, onValueChange: b, presets: x, alpha: S =
119
119
  }, R = typeof window < "u" ? window.EyeDropper : void 0, z = () => {
120
120
  R && new R().open().then((e) => A(e.sRGBHex));
121
121
  }, B = {
122
- hue: D?.hue ?? s(o.colorPicker.hue),
123
- alpha: D?.alpha ?? s(o.colorPicker.alpha),
124
- colorArea: D?.colorArea ?? s(o.colorPicker.colorArea),
125
- eyedropper: D?.eyedropper ?? s(o.colorPicker.eyedropper)
122
+ hue: D?.hue ?? l(c.colorPicker.hue),
123
+ alpha: D?.alpha ?? l(c.colorPicker.alpha),
124
+ colorArea: D?.colorArea ?? l(c.colorPicker.colorArea),
125
+ eyedropper: D?.eyedropper ?? l(c.colorPicker.eyedropper)
126
126
  }, V = h(m(k.value), !1), H = `hsl(${N.h} 100% 50%)`;
127
- return /* @__PURE__ */ u("div", {
127
+ return /* @__PURE__ */ f("div", {
128
128
  className: t(e.picker, E),
129
129
  "data-size": T,
130
130
  "data-disabled": w || void 0,
131
131
  children: [
132
- C && /* @__PURE__ */ l("span", {
132
+ C && /* @__PURE__ */ d("span", {
133
133
  className: e.label,
134
134
  id: `${O}-label`,
135
135
  children: C
136
136
  }),
137
- /* @__PURE__ */ l("div", {
137
+ /* @__PURE__ */ d("div", {
138
138
  ref: j,
139
139
  className: e.area,
140
140
  role: "slider",
@@ -147,7 +147,7 @@ function v({ value: v, defaultValue: y, onValueChange: b, presets: x, alpha: S =
147
147
  w || (e.preventDefault(), M.value = !0, F(e.clientX, e.clientY));
148
148
  },
149
149
  onKeyDown: I,
150
- children: /* @__PURE__ */ l("span", {
150
+ children: /* @__PURE__ */ d("span", {
151
151
  className: e.thumb,
152
152
  style: {
153
153
  insetInlineStart: `${N.s}%`,
@@ -156,15 +156,15 @@ function v({ value: v, defaultValue: y, onValueChange: b, presets: x, alpha: S =
156
156
  }
157
157
  })
158
158
  }),
159
- /* @__PURE__ */ u("div", {
159
+ /* @__PURE__ */ f("div", {
160
160
  className: e.sliders,
161
161
  children: [
162
- /* @__PURE__ */ l("label", {
162
+ /* @__PURE__ */ d("label", {
163
163
  className: e.srOnly,
164
164
  htmlFor: `${O}-hue`,
165
165
  children: B.hue
166
166
  }),
167
- /* @__PURE__ */ l("input", {
167
+ /* @__PURE__ */ d("input", {
168
168
  id: `${O}-hue`,
169
169
  className: e.hue,
170
170
  type: "range",
@@ -181,11 +181,11 @@ function v({ value: v, defaultValue: y, onValueChange: b, presets: x, alpha: S =
181
181
  a: N.a
182
182
  })
183
183
  }),
184
- S && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("label", {
184
+ S && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("label", {
185
185
  className: e.srOnly,
186
186
  htmlFor: `${O}-alpha`,
187
187
  children: B.alpha
188
- }), /* @__PURE__ */ l("input", {
188
+ }), /* @__PURE__ */ d("input", {
189
189
  id: `${O}-alpha`,
190
190
  className: e.alpha,
191
191
  type: "range",
@@ -205,11 +205,11 @@ function v({ value: v, defaultValue: y, onValueChange: b, presets: x, alpha: S =
205
205
  })] })
206
206
  ]
207
207
  }),
208
- x && x.length > 0 && /* @__PURE__ */ l("div", {
208
+ x && x.length > 0 && /* @__PURE__ */ d("div", {
209
209
  className: e.presets,
210
210
  role: "group",
211
211
  "aria-label": B.colorArea,
212
- children: x.map((t, n) => /* @__PURE__ */ l("button", {
212
+ children: x.map((t, n) => /* @__PURE__ */ d("button", {
213
213
  type: "button",
214
214
  className: e.preset,
215
215
  style: { backgroundColor: t },
@@ -222,15 +222,15 @@ function v({ value: v, defaultValue: y, onValueChange: b, presets: x, alpha: S =
222
222
  }
223
223
  }, t))
224
224
  }),
225
- /* @__PURE__ */ u("div", {
225
+ /* @__PURE__ */ f("div", {
226
226
  className: e.row,
227
227
  children: [
228
- /* @__PURE__ */ l("span", {
228
+ /* @__PURE__ */ d("span", {
229
229
  className: e.preview,
230
230
  style: { backgroundColor: k.value },
231
231
  "aria-hidden": "true"
232
232
  }),
233
- /* @__PURE__ */ l("input", {
233
+ /* @__PURE__ */ d("input", {
234
234
  className: e.text,
235
235
  type: "text",
236
236
  value: k.value,
@@ -238,19 +238,19 @@ function v({ value: v, defaultValue: y, onValueChange: b, presets: x, alpha: S =
238
238
  "aria-label": C ?? B.colorArea,
239
239
  onChange: (e) => A(e.target.value)
240
240
  }),
241
- R && /* @__PURE__ */ l("button", {
241
+ R && /* @__PURE__ */ d("button", {
242
242
  type: "button",
243
243
  className: e.eyedropper,
244
244
  "aria-label": B.eyedropper,
245
245
  disabled: w,
246
246
  onClick: z,
247
- children: /* @__PURE__ */ l("svg", {
247
+ children: /* @__PURE__ */ d("svg", {
248
248
  width: "16",
249
249
  height: "16",
250
250
  viewBox: "0 0 24 24",
251
251
  fill: "none",
252
252
  "aria-hidden": "true",
253
- children: /* @__PURE__ */ l("path", {
253
+ children: /* @__PURE__ */ d("path", {
254
254
  d: "m2 22 1-1h3l9-9M3 21v-3l9-9m1.5 1.5-2-2M19 2l3 3-9 9-3-3z",
255
255
  stroke: "currentColor",
256
256
  strokeWidth: "2",