@epilot/zenith-react 0.2.0-next.0 → 0.2.0-next.3

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 (133) hide show
  1. package/dist/components/accordion/accordion.js +57 -48
  2. package/dist/components/accordion/accordion.js.map +1 -1
  3. package/dist/components/alert-dialog/alert-dialog.js +120 -92
  4. package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
  5. package/dist/components/avatar/avatar-group.js +38 -35
  6. package/dist/components/avatar/avatar-group.js.map +1 -1
  7. package/dist/components/avatar/avatar.js +78 -71
  8. package/dist/components/avatar/avatar.js.map +1 -1
  9. package/dist/components/badge/badge.js +60 -55
  10. package/dist/components/badge/badge.js.map +1 -1
  11. package/dist/components/breadcrumb/breadcrumb.js +99 -54
  12. package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
  13. package/dist/components/button/button.js +87 -77
  14. package/dist/components/button/button.js.map +1 -1
  15. package/dist/components/button-group/button-group.js +36 -32
  16. package/dist/components/button-group/button-group.js.map +1 -1
  17. package/dist/components/callout/callout.js +105 -98
  18. package/dist/components/callout/callout.js.map +1 -1
  19. package/dist/components/card/card.js +62 -52
  20. package/dist/components/card/card.js.map +1 -1
  21. package/dist/components/checkbox/checkbox.js +22 -19
  22. package/dist/components/checkbox/checkbox.js.map +1 -1
  23. package/dist/components/code-block/code-block.js +135 -123
  24. package/dist/components/code-block/code-block.js.map +1 -1
  25. package/dist/components/code-editor/code-editor.js +276 -260
  26. package/dist/components/code-editor/code-editor.js.map +1 -1
  27. package/dist/components/collapsible-sidebar/collapsible-sidebar.js +62 -56
  28. package/dist/components/collapsible-sidebar/collapsible-sidebar.js.map +1 -1
  29. package/dist/components/command/command.js +116 -105
  30. package/dist/components/command/command.js.map +1 -1
  31. package/dist/components/data-table/data-table-body.js +38 -34
  32. package/dist/components/data-table/data-table-body.js.map +1 -1
  33. package/dist/components/data-table/data-table-column-header.js +30 -26
  34. package/dist/components/data-table/data-table-column-header.js.map +1 -1
  35. package/dist/components/data-table/data-table-column-order.js +79 -73
  36. package/dist/components/data-table/data-table-column-order.js.map +1 -1
  37. package/dist/components/data-table/data-table-column-visibility.js +25 -22
  38. package/dist/components/data-table/data-table-column-visibility.js.map +1 -1
  39. package/dist/components/data-table/data-table-content.js +47 -44
  40. package/dist/components/data-table/data-table-content.js.map +1 -1
  41. package/dist/components/data-table/data-table-error.js +36 -32
  42. package/dist/components/data-table/data-table-error.js.map +1 -1
  43. package/dist/components/data-table/data-table-footer.js +10 -8
  44. package/dist/components/data-table/data-table-footer.js.map +1 -1
  45. package/dist/components/data-table/data-table-header-draggable.js +40 -36
  46. package/dist/components/data-table/data-table-header-draggable.js.map +1 -1
  47. package/dist/components/data-table/data-table-header.js +113 -99
  48. package/dist/components/data-table/data-table-header.js.map +1 -1
  49. package/dist/components/data-table/data-table-loading.js +21 -18
  50. package/dist/components/data-table/data-table-loading.js.map +1 -1
  51. package/dist/components/data-table/data-table-resize-handle.js +13 -11
  52. package/dist/components/data-table/data-table-resize-handle.js.map +1 -1
  53. package/dist/components/data-table/data-table-row.js +71 -59
  54. package/dist/components/data-table/data-table-row.js.map +1 -1
  55. package/dist/components/data-table/data-table-toolbar.js +9 -7
  56. package/dist/components/data-table/data-table-toolbar.js.map +1 -1
  57. package/dist/components/data-table/data-table.js +48 -46
  58. package/dist/components/data-table/data-table.js.map +1 -1
  59. package/dist/components/date-range-picker/date-range-picker.js +173 -164
  60. package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
  61. package/dist/components/date-range-picker/range-calendar.js +36 -34
  62. package/dist/components/date-range-picker/range-calendar.js.map +1 -1
  63. package/dist/components/date-time-picker/calendar.js +290 -272
  64. package/dist/components/date-time-picker/calendar.js.map +1 -1
  65. package/dist/components/date-time-picker/date-time-picker-input.js +22 -20
  66. package/dist/components/date-time-picker/date-time-picker-input.js.map +1 -1
  67. package/dist/components/date-time-picker/date-time-picker-panel.js +126 -120
  68. package/dist/components/date-time-picker/date-time-picker-panel.js.map +1 -1
  69. package/dist/components/date-time-picker/date-time-picker.js +42 -40
  70. package/dist/components/date-time-picker/date-time-picker.js.map +1 -1
  71. package/dist/components/date-time-picker/time-picker.js +95 -87
  72. package/dist/components/date-time-picker/time-picker.js.map +1 -1
  73. package/dist/components/dialog/dialog.js +115 -95
  74. package/dist/components/dialog/dialog.js.map +1 -1
  75. package/dist/components/drawer/drawer.js +144 -109
  76. package/dist/components/drawer/drawer.js.map +1 -1
  77. package/dist/components/dropdown-menu/dropdown-menu.js +141 -112
  78. package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
  79. package/dist/components/field/field-combobox.js +196 -176
  80. package/dist/components/field/field-combobox.js.map +1 -1
  81. package/dist/components/field/field.js +137 -126
  82. package/dist/components/field/field.js.map +1 -1
  83. package/dist/components/list/list.js +237 -219
  84. package/dist/components/list/list.js.map +1 -1
  85. package/dist/components/option-card/option-card.js +129 -116
  86. package/dist/components/option-card/option-card.js.map +1 -1
  87. package/dist/components/pill/pill.js +55 -51
  88. package/dist/components/pill/pill.js.map +1 -1
  89. package/dist/components/popover/popover.js +53 -36
  90. package/dist/components/popover/popover.js.map +1 -1
  91. package/dist/components/radio/radio.js +38 -34
  92. package/dist/components/radio/radio.js.map +1 -1
  93. package/dist/components/scroll-area/scroll-area.js +38 -35
  94. package/dist/components/scroll-area/scroll-area.js.map +1 -1
  95. package/dist/components/scroll-overflow/scroll-overflow.js +166 -151
  96. package/dist/components/scroll-overflow/scroll-overflow.js.map +1 -1
  97. package/dist/components/segmented-control/segmented-control.js +93 -85
  98. package/dist/components/segmented-control/segmented-control.js.map +1 -1
  99. package/dist/components/select/select.js +149 -128
  100. package/dist/components/select/select.js.map +1 -1
  101. package/dist/components/separator/separator.js +19 -16
  102. package/dist/components/separator/separator.js.map +1 -1
  103. package/dist/components/skeleton/skeleton.js +34 -30
  104. package/dist/components/skeleton/skeleton.js.map +1 -1
  105. package/dist/components/spinner/spinner.js +22 -17
  106. package/dist/components/spinner/spinner.js.map +1 -1
  107. package/dist/components/surface/surface.js +25 -22
  108. package/dist/components/surface/surface.js.map +1 -1
  109. package/dist/components/switch/switch.js +66 -57
  110. package/dist/components/switch/switch.js.map +1 -1
  111. package/dist/components/table/table-pagination.js +139 -129
  112. package/dist/components/table/table-pagination.js.map +1 -1
  113. package/dist/components/table/table.js +104 -90
  114. package/dist/components/table/table.js.map +1 -1
  115. package/dist/components/tabs/tabs.js +206 -128
  116. package/dist/components/tabs/tabs.js.map +1 -1
  117. package/dist/components/toast/toast.js +112 -100
  118. package/dist/components/toast/toast.js.map +1 -1
  119. package/dist/components/toggle/toggle.js +32 -30
  120. package/dist/components/toggle/toggle.js.map +1 -1
  121. package/dist/components/tooltip/tooltip.js +59 -46
  122. package/dist/components/tooltip/tooltip.js.map +1 -1
  123. package/dist/index.d.ts +12 -0
  124. package/dist/lib/clear-button.js +18 -17
  125. package/dist/lib/clear-button.js.map +1 -1
  126. package/dist/styles/host-reset.js +47 -0
  127. package/dist/styles/host-reset.js.map +1 -0
  128. package/dist/styles/overlay-layer.js +5 -0
  129. package/dist/styles/overlay-layer.js.map +1 -0
  130. package/dist/tokens.json +1 -1
  131. package/package.json +8 -6
  132. package/scripts/migration-diagnostics.mjs +42 -7
  133. package/scripts/migration-sweep.mjs +9 -1
@@ -1,100 +1,101 @@
1
- import { jsxs as A, jsx as l } from "react/jsx-runtime";
2
- import * as f from "react";
3
- import { Root as T, Viewport as M, Scrollbar as O, Thumb as F } from "../../vendor/.bun/@radix-ui_react-scroll-area@1.2.10_2b23df507bdda662/vendor/@radix-ui/react-scroll-area/dist/index.js";
4
- import { mergeClasses as d, SLOT_ATTR as n, shorthands as v } from "@epilot/zenith-runtime/v1";
5
- import { makeZenithStyles as W } from "../../styles/make-styles.js";
6
- import { grayA8 as I, accentA8 as Z, grayA12 as j, gray1 as K, radiusMd as $, radiusSm as G } from "../../tokens/index.js";
7
- import { useScrollbarStyles as U } from "../scroll-area/scrollbar-styles.js";
8
- function B() {
1
+ import { jsxs as I, jsx as l } from "react/jsx-runtime";
2
+ import * as w from "react";
3
+ import { Root as M, Viewport as O, Scrollbar as F, Thumb as W } from "../../vendor/.bun/@radix-ui_react-scroll-area@1.2.10_2b23df507bdda662/vendor/@radix-ui/react-scroll-area/dist/index.js";
4
+ import { mergeClasses as f, SLOT_ATTR as s, shorthands as b } from "@epilot/zenith-runtime/v1";
5
+ import { makeZenithStyles as Z } from "../../styles/make-styles.js";
6
+ import { boxModel as a, nativeControl as j } from "../../styles/host-reset.js";
7
+ import { grayA8 as B, accentA8 as K, grayA12 as $, gray1 as G, radiusMd as U, radiusSm as P } from "../../tokens/index.js";
8
+ import { useScrollbarStyles as _ } from "../scroll-area/scrollbar-styles.js";
9
+ function D() {
9
10
  return typeof window > "u" || !window.matchMedia || window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth";
10
11
  }
11
- function P(s = {}) {
12
- const { scrollStep: b = 200, orientation: H = "horizontal" } = s, w = f.useRef(null), [g, h] = f.useState(!1), [m, C] = f.useState(!1), [x, S] = f.useState(!1), a = H === "horizontal", u = f.useCallback(() => {
13
- const t = w.current;
12
+ function q(c = {}) {
13
+ const { scrollStep: m = 200, orientation: y = "horizontal" } = c, h = w.useRef(null), [S, u] = w.useState(!1), [C, x] = w.useState(!1), [g, H] = w.useState(!1), n = y === "horizontal", p = w.useCallback(() => {
14
+ const t = h.current;
14
15
  if (t)
15
- if (a) {
16
- const e = Math.round(t.scrollLeft), c = t.scrollWidth, i = t.clientWidth;
17
- h(c > i), C(e > 0), S(e + i < c - 1);
16
+ if (n) {
17
+ const e = Math.round(t.scrollLeft), i = t.scrollWidth, d = t.clientWidth;
18
+ u(i > d), x(e > 0), H(e + d < i - 1);
18
19
  } else {
19
- const e = Math.round(t.scrollTop), c = t.scrollHeight, i = t.clientHeight;
20
- h(c > i), C(e > 0), S(e + i < c - 1);
20
+ const e = Math.round(t.scrollTop), i = t.scrollHeight, d = t.clientHeight;
21
+ u(i > d), x(e > 0), H(e + d < i - 1);
21
22
  }
22
- }, [a]);
23
- f.useEffect(() => {
24
- const t = w.current;
23
+ }, [n]);
24
+ w.useEffect(() => {
25
+ const t = h.current;
25
26
  if (!t) return;
26
- u();
27
+ p();
27
28
  let e = null;
28
29
  if (typeof ResizeObserver < "u") {
29
30
  e = new ResizeObserver(() => {
30
- u();
31
+ p();
31
32
  }), e.observe(t);
32
- for (const c of t.children)
33
- e.observe(c);
33
+ for (const i of t.children)
34
+ e.observe(i);
34
35
  }
35
- return t.addEventListener("scroll", u, { passive: !0 }), () => {
36
- e == null || e.disconnect(), t.removeEventListener("scroll", u);
36
+ return t.addEventListener("scroll", p, { passive: !0 }), () => {
37
+ e == null || e.disconnect(), t.removeEventListener("scroll", p);
37
38
  };
38
- }, [u]);
39
- const y = f.useCallback(() => {
39
+ }, [p]);
40
+ const z = w.useCallback(() => {
40
41
  var t;
41
- (t = w.current) == null || t.scrollBy({
42
- [a ? "left" : "top"]: -b,
43
- behavior: B()
42
+ (t = h.current) == null || t.scrollBy({
43
+ [n ? "left" : "top"]: -m,
44
+ behavior: D()
44
45
  });
45
- }, [b, a]), o = f.useCallback(() => {
46
+ }, [m, n]), o = w.useCallback(() => {
46
47
  var t;
47
- (t = w.current) == null || t.scrollBy({
48
- [a ? "left" : "top"]: b,
49
- behavior: B()
48
+ (t = h.current) == null || t.scrollBy({
49
+ [n ? "left" : "top"]: m,
50
+ behavior: D()
50
51
  });
51
- }, [b, a]);
52
+ }, [m, n]);
52
53
  return {
53
- scrollRef: w,
54
- hasOverflow: g,
55
- canScrollStart: m,
56
- canScrollEnd: x,
57
- scrollToStart: y,
54
+ scrollRef: h,
55
+ hasOverflow: S,
56
+ canScrollStart: C,
57
+ canScrollEnd: g,
58
+ scrollToStart: z,
58
59
  scrollToEnd: o
59
60
  };
60
61
  }
61
- const _ = (s) => /* @__PURE__ */ l(
62
+ const J = (c) => /* @__PURE__ */ l(
62
63
  "svg",
63
64
  {
64
65
  viewBox: "0 0 16 16",
65
66
  xmlns: "http://www.w3.org/2000/svg",
66
67
  fill: "currentColor",
67
- ...s,
68
+ ...c,
68
69
  children: /* @__PURE__ */ l("path", { d: "M 8.86 10.51 C 8.94 10.51 9.02 10.49 9.08 10.43 C 9.14 10.38 9.17 10.3 9.17 10.21 V 5.79 C 9.17 5.7 9.14 5.62 9.08 5.57 C 9.01 5.51 8.94 5.49 8.86 5.49 C 8.84 5.49 8.77 5.52 8.65 5.58 L 6.55 7.68 C 6.5 7.73 6.47 7.78 6.44 7.83 C 6.42 7.88 6.41 7.94 6.41 8 C 6.41 8.06 6.42 8.12 6.44 8.17 C 6.47 8.22 6.5 8.27 6.55 8.32 L 8.65 10.42 C 8.68 10.45 8.71 10.47 8.75 10.49 C 8.78 10.51 8.82 10.51 8.86 10.51 Z" })
69
70
  }
70
- ), q = (s) => /* @__PURE__ */ l(
71
+ ), Q = (c) => /* @__PURE__ */ l(
71
72
  "svg",
72
73
  {
73
74
  viewBox: "0 0 16 16",
74
75
  xmlns: "http://www.w3.org/2000/svg",
75
76
  fill: "currentColor",
76
- ...s,
77
+ ...c,
77
78
  children: /* @__PURE__ */ l("path", { d: "M7.14 10.51C7.06 10.51 6.98 10.49 6.92 10.43C6.86 10.38 6.83 10.3 6.83 10.21V5.79C6.83 5.7 6.86 5.62 6.92 5.57C6.99 5.51 7.06 5.49 7.14 5.49C7.16 5.49 7.23 5.52 7.35 5.58L9.45 7.68C9.5 7.73 9.53 7.78 9.56 7.83C9.58 7.88 9.59 7.94 9.59 8C9.59 8.06 9.58 8.12 9.56 8.17C9.53 8.22 9.5 8.27 9.45 8.32L7.35 10.42C7.32 10.45 7.29 10.47 7.25 10.49C7.22 10.51 7.18 10.51 7.14 10.51Z" })
78
79
  }
79
- ), J = (s) => /* @__PURE__ */ l(
80
+ ), X = (c) => /* @__PURE__ */ l(
80
81
  "svg",
81
82
  {
82
83
  viewBox: "0 0 16 16",
83
84
  xmlns: "http://www.w3.org/2000/svg",
84
85
  fill: "currentColor",
85
- ...s,
86
+ ...c,
86
87
  children: /* @__PURE__ */ l("path", { d: "M5.49 7.14C5.49 7.06 5.51 6.98 5.57 6.92C5.62 6.86 5.7 6.83 5.79 6.83H10.21C10.3 6.83 10.38 6.86 10.43 6.92C10.49 6.99 10.51 7.06 10.51 7.14C10.51 7.16 10.48 7.23 10.42 7.35L8.32 9.45C8.27 9.5 8.22 9.53 8.17 9.56C8.12 9.58 8.06 9.59 8 9.59C7.94 9.59 7.88 9.58 7.83 9.56C7.78 9.53 7.73 9.5 7.68 9.45L5.58 7.35C5.55 7.32 5.53 7.29 5.51 7.25C5.49 7.22 5.49 7.18 5.49 7.14Z" })
87
88
  }
88
- ), Q = (s) => /* @__PURE__ */ l(
89
+ ), Y = (c) => /* @__PURE__ */ l(
89
90
  "svg",
90
91
  {
91
92
  viewBox: "0 0 16 16",
92
93
  xmlns: "http://www.w3.org/2000/svg",
93
94
  fill: "currentColor",
94
- ...s,
95
+ ...c,
95
96
  children: /* @__PURE__ */ l("path", { d: "M10.51 8.86C10.51 8.94 10.49 9.02 10.43 9.08C10.38 9.14 10.3 9.17 10.21 9.17H5.79C5.7 9.17 5.62 9.14 5.57 9.08C5.51 9.01 5.49 8.94 5.49 8.86C5.49 8.84 5.52 8.77 5.58 8.65L7.68 6.55C7.73 6.5 7.78 6.47 7.83 6.44C7.88 6.42 7.94 6.41 8 6.41C8.06 6.41 8.12 6.42 8.17 6.44C8.22 6.47 8.27 6.5 8.32 6.55L10.42 8.65C10.45 8.68 10.47 8.71 10.49 8.75C10.51 8.78 10.51 8.82 10.51 8.86Z" })
96
97
  }
97
- ), X = W({
98
+ ), oo = Z({
98
99
  container: {
99
100
  position: "relative",
100
101
  display: "flex"
@@ -143,6 +144,7 @@ const _ = (s) => /* @__PURE__ */ l(
143
144
  boxShadow: "inset 0 -8px 6px -6px rgba(0,0,0,0.08)"
144
145
  },
145
146
  arrowButton: {
147
+ ...j,
146
148
  position: "absolute",
147
149
  zIndex: 20,
148
150
  display: "flex",
@@ -150,60 +152,68 @@ const _ = (s) => /* @__PURE__ */ l(
150
152
  justifyContent: "center",
151
153
  cursor: "pointer",
152
154
  backgroundColor: "transparent",
153
- ...v.borderStyle("none"),
154
- ...v.borderWidth(0),
155
- ...v.padding(0)
155
+ ...b.borderStyle("none"),
156
+ ...b.borderWidth(0),
157
+ ...b.padding(0)
156
158
  },
157
159
  arrowHorizontalStart: {
160
+ ...a,
158
161
  left: 0,
159
162
  top: 0,
160
163
  bottom: 0,
161
164
  width: "1.5rem"
162
165
  },
163
166
  arrowHorizontalEnd: {
167
+ ...a,
164
168
  right: 0,
165
169
  top: 0,
166
170
  bottom: 0,
167
171
  width: "1.5rem"
168
172
  },
169
173
  arrowVerticalStart: {
174
+ ...a,
170
175
  top: 0,
171
176
  left: 0,
172
177
  right: 0,
173
178
  height: "1.5rem"
174
179
  },
175
180
  arrowVerticalEnd: {
181
+ ...a,
176
182
  bottom: 0,
177
183
  left: 0,
178
184
  right: 0,
179
185
  height: "1.5rem"
180
186
  },
181
187
  arrowBadge: {
188
+ ...a,
182
189
  display: "flex",
183
190
  alignItems: "center",
184
191
  justifyContent: "center",
185
- backgroundColor: I,
186
- ...v.borderRadius(G),
192
+ backgroundColor: B,
193
+ ...b.borderRadius(P),
187
194
  backdropFilter: "blur(4px)",
188
- color: K,
195
+ color: G,
189
196
  ":hover": {
190
- backgroundColor: j
197
+ backgroundColor: $
191
198
  }
192
199
  },
193
200
  arrowIcon: {
201
+ ...a,
194
202
  width: "1rem",
195
203
  height: "1rem"
196
204
  },
197
205
  scrollAreaRoot: {
198
- ...v.overflow("hidden"),
206
+ ...b.overflow("hidden"),
199
207
  flexGrow: 1,
200
208
  flexShrink: 1,
201
209
  flexBasis: "0%"
202
210
  },
203
211
  scrollAreaRootHorizontal: {
212
+ ...a,
204
213
  minWidth: 0
205
214
  },
206
215
  scrollAreaRootVertical: {
216
+ ...a,
207
217
  minHeight: 0,
208
218
  display: "flex",
209
219
  flexDirection: "column"
@@ -217,12 +227,13 @@ const _ = (s) => /* @__PURE__ */ l(
217
227
  flexDirection: "row"
218
228
  },
219
229
  viewport: {
220
- ...v.borderRadius($),
230
+ ...a,
231
+ ...b.borderRadius(U),
221
232
  ":focus-visible": {
222
233
  outlineWidth: "2px",
223
234
  outlineOffset: "2px",
224
235
  outlineStyle: "solid",
225
- outlineColor: Z
236
+ outlineColor: K
226
237
  }
227
238
  },
228
239
  viewportHorizontal: {
@@ -232,6 +243,7 @@ const _ = (s) => /* @__PURE__ */ l(
232
243
  }
233
244
  },
234
245
  viewportVertical: {
246
+ ...a,
235
247
  flexGrow: 1,
236
248
  flexShrink: 1,
237
249
  flexBasis: "0%",
@@ -243,7 +255,8 @@ const _ = (s) => /* @__PURE__ */ l(
243
255
  flexBasis: "0%"
244
256
  },
245
257
  scrollbar: {
246
- ...v.padding("1px"),
258
+ ...a,
259
+ ...b.padding("1px"),
247
260
  transitionProperty: "color, background-color, border-color",
248
261
  transitionDuration: "150ms"
249
262
  },
@@ -251,107 +264,109 @@ const _ = (s) => /* @__PURE__ */ l(
251
264
  display: "none"
252
265
  },
253
266
  scrollbarHorizontal: {
267
+ ...a,
254
268
  height: "0.5rem",
255
269
  flexDirection: "column"
256
270
  },
257
271
  scrollbarVertical: {
272
+ ...a,
258
273
  width: "0.5rem",
259
274
  flexDirection: "row"
260
275
  },
261
276
  thumb: {
262
- backgroundColor: I
277
+ backgroundColor: B
263
278
  }
264
- }), ao = f.forwardRef(function({
265
- className: b,
266
- children: H,
267
- arrows: w = !1,
268
- gradients: g = !0,
269
- gradientWidth: h = 40,
270
- gradientColor: m = "var(--volt-body)",
271
- shadow: C = !0,
272
- scrollbar: x = !1,
273
- scrollStep: S,
274
- orientation: a = "horizontal",
275
- ...u
276
- }, y) {
277
- const o = X(), t = U(), {
279
+ }), co = w.forwardRef(function({
280
+ className: m,
281
+ children: y,
282
+ arrows: h = !1,
283
+ gradients: S = !0,
284
+ gradientWidth: u = 40,
285
+ gradientColor: C = "var(--volt-body)",
286
+ shadow: x = !0,
287
+ scrollbar: g = !1,
288
+ scrollStep: H,
289
+ orientation: n = "horizontal",
290
+ ...p
291
+ }, z) {
292
+ const o = oo(), t = _(), {
278
293
  scrollRef: e,
279
- hasOverflow: c,
280
- canScrollStart: i,
281
- canScrollEnd: z,
282
- scrollToStart: k,
283
- scrollToEnd: V
284
- } = P({ scrollStep: S, orientation: a }), r = a === "horizontal", D = (p) => {
285
- var E, R;
286
- if (p.target !== p.currentTarget) return;
287
- const L = r ? "ArrowLeft" : "ArrowUp", N = r ? "ArrowRight" : "ArrowDown";
288
- switch (p.key) {
289
- case L:
290
- p.preventDefault(), k();
291
- break;
294
+ hasOverflow: i,
295
+ canScrollStart: d,
296
+ canScrollEnd: k,
297
+ scrollToStart: V,
298
+ scrollToEnd: E
299
+ } = q({ scrollStep: H, orientation: n }), r = n === "horizontal", L = (v) => {
300
+ var R, A;
301
+ if (v.target !== v.currentTarget) return;
302
+ const N = r ? "ArrowLeft" : "ArrowUp", T = r ? "ArrowRight" : "ArrowDown";
303
+ switch (v.key) {
292
304
  case N:
293
- p.preventDefault(), V();
305
+ v.preventDefault(), V();
306
+ break;
307
+ case T:
308
+ v.preventDefault(), E();
294
309
  break;
295
310
  case "Home":
296
- p.preventDefault(), (E = e.current) == null || E.scrollTo({
311
+ v.preventDefault(), (R = e.current) == null || R.scrollTo({
297
312
  [r ? "left" : "top"]: 0,
298
313
  behavior: "smooth"
299
314
  });
300
315
  break;
301
316
  case "End":
302
- p.preventDefault(), (R = e.current) == null || R.scrollTo({
317
+ v.preventDefault(), (A = e.current) == null || A.scrollTo({
303
318
  [r ? "left" : "top"]: r ? e.current.scrollWidth : e.current.scrollHeight,
304
319
  behavior: "smooth"
305
320
  });
306
321
  break;
307
322
  }
308
323
  };
309
- return /* @__PURE__ */ A(
324
+ return /* @__PURE__ */ I(
310
325
  "div",
311
326
  {
312
- ref: y,
327
+ ref: z,
313
328
  "data-slot": "scroll-overflow",
314
- [n]: "scroll-overflow",
315
- "data-orientation": a,
316
- "data-has-overflow": c || void 0,
317
- "data-can-scroll-start": i || void 0,
318
- "data-can-scroll-end": z || void 0,
319
- className: d(
329
+ [s]: "scroll-overflow",
330
+ "data-orientation": n,
331
+ "data-has-overflow": i || void 0,
332
+ "data-can-scroll-start": d || void 0,
333
+ "data-can-scroll-end": k || void 0,
334
+ className: f(
320
335
  o.container,
321
336
  r ? o.containerHorizontal : o.containerVertical,
322
- b
337
+ m
323
338
  ),
324
339
  children: [
325
- g && i && /* @__PURE__ */ l(
340
+ S && d && /* @__PURE__ */ l(
326
341
  "div",
327
342
  {
328
343
  "data-slot": "scroll-overflow-fade-start",
329
- [n]: "scroll-overflow-fade-start",
344
+ [s]: "scroll-overflow-fade-start",
330
345
  "aria-hidden": "true",
331
- className: d(
346
+ className: f(
332
347
  o.fade,
333
348
  r ? o.fadeHorizontalStart : o.fadeVerticalStart,
334
- C && (r ? o.shadowHorizontalStart : o.shadowVerticalStart)
349
+ x && (r ? o.shadowHorizontalStart : o.shadowVerticalStart)
335
350
  ),
336
351
  style: r ? {
337
- width: h,
338
- background: `linear-gradient(to right, ${m}, transparent)`
352
+ width: u,
353
+ background: `linear-gradient(to right, ${C}, transparent)`
339
354
  } : {
340
- height: h,
341
- background: `linear-gradient(to bottom, ${m}, transparent)`
355
+ height: u,
356
+ background: `linear-gradient(to bottom, ${C}, transparent)`
342
357
  }
343
358
  }
344
359
  ),
345
- w && i && /* @__PURE__ */ l(
360
+ h && d && /* @__PURE__ */ l(
346
361
  "button",
347
362
  {
348
363
  "data-slot": "scroll-overflow-arrow-start",
349
- [n]: "scroll-overflow-arrow-start",
364
+ [s]: "scroll-overflow-arrow-start",
350
365
  type: "button",
351
366
  tabIndex: -1,
352
367
  "aria-label": r ? "Scroll left" : "Scroll up",
353
- onClick: k,
354
- className: d(
368
+ onClick: V,
369
+ className: f(
355
370
  o.arrowButton,
356
371
  r ? o.arrowHorizontalStart : o.arrowVerticalStart
357
372
  ),
@@ -359,61 +374,61 @@ const _ = (s) => /* @__PURE__ */ l(
359
374
  "span",
360
375
  {
361
376
  "data-slot": "scroll-overflow-arrow-icon",
362
- [n]: "scroll-overflow-arrow-icon",
377
+ [s]: "scroll-overflow-arrow-icon",
363
378
  className: o.arrowBadge,
364
- children: r ? /* @__PURE__ */ l(_, { className: o.arrowIcon }) : /* @__PURE__ */ l(J, { className: o.arrowIcon })
379
+ children: r ? /* @__PURE__ */ l(J, { className: o.arrowIcon }) : /* @__PURE__ */ l(X, { className: o.arrowIcon })
365
380
  }
366
381
  )
367
382
  }
368
383
  ),
369
- /* @__PURE__ */ A(
370
- T,
384
+ /* @__PURE__ */ I(
385
+ M,
371
386
  {
372
387
  "data-slot": "scroll-overflow-root",
373
388
  type: "scroll",
374
- [n]: "scroll-overflow-root",
375
- className: d(
389
+ [s]: "scroll-overflow-root",
390
+ className: f(
376
391
  o.scrollAreaRoot,
377
392
  r ? o.scrollAreaRootHorizontal : o.scrollAreaRootVertical,
378
- x && (r ? o.scrollAreaRootScrollbarHorizontal : o.scrollAreaRootScrollbarVertical)
393
+ g && (r ? o.scrollAreaRootScrollbarHorizontal : o.scrollAreaRootScrollbarVertical)
379
394
  ),
380
- ...u,
395
+ ...p,
381
396
  children: [
382
397
  /* @__PURE__ */ l(
383
- M,
398
+ O,
384
399
  {
385
400
  ref: e,
386
401
  "data-slot": "scroll-overflow-viewport",
387
- [n]: "scroll-overflow-viewport",
388
- tabIndex: c ? 0 : void 0,
389
- onKeyDown: D,
390
- className: d(
402
+ [s]: "scroll-overflow-viewport",
403
+ tabIndex: i ? 0 : void 0,
404
+ onKeyDown: L,
405
+ className: f(
391
406
  o.viewport,
392
407
  r && o.viewportHorizontal,
393
- x && o.viewportFlex,
408
+ g && o.viewportFlex,
394
409
  !r && o.viewportVertical
395
410
  ),
396
- children: H
411
+ children: y
397
412
  }
398
413
  ),
399
414
  /* @__PURE__ */ l(
400
- O,
415
+ F,
401
416
  {
402
417
  forceMount: !0,
403
- orientation: a,
418
+ orientation: n,
404
419
  "data-slot": "scroll-overflow-scrollbar",
405
- [n]: "scroll-overflow-scrollbar",
406
- className: d(
420
+ [s]: "scroll-overflow-scrollbar",
421
+ className: f(
407
422
  t.track,
408
- x ? o.scrollbar : o.scrollbarHidden,
423
+ g ? o.scrollbar : o.scrollbarHidden,
409
424
  r ? o.scrollbarHorizontal : o.scrollbarVertical
410
425
  ),
411
426
  children: /* @__PURE__ */ l(
412
- F,
427
+ W,
413
428
  {
414
429
  "data-slot": "scroll-overflow-thumb",
415
- [n]: "scroll-overflow-thumb",
416
- className: d(t.thumb, o.thumb)
430
+ [s]: "scroll-overflow-thumb",
431
+ className: f(t.thumb, o.thumb)
417
432
  }
418
433
  )
419
434
  }
@@ -421,36 +436,36 @@ const _ = (s) => /* @__PURE__ */ l(
421
436
  ]
422
437
  }
423
438
  ),
424
- g && z && /* @__PURE__ */ l(
439
+ S && k && /* @__PURE__ */ l(
425
440
  "div",
426
441
  {
427
442
  "data-slot": "scroll-overflow-fade-end",
428
- [n]: "scroll-overflow-fade-end",
443
+ [s]: "scroll-overflow-fade-end",
429
444
  "aria-hidden": "true",
430
- className: d(
445
+ className: f(
431
446
  o.fade,
432
447
  r ? o.fadeHorizontalEnd : o.fadeVerticalEnd,
433
- C && (r ? o.shadowHorizontalEnd : o.shadowVerticalEnd)
448
+ x && (r ? o.shadowHorizontalEnd : o.shadowVerticalEnd)
434
449
  ),
435
450
  style: r ? {
436
- width: h,
437
- background: `linear-gradient(to left, ${m}, transparent)`
451
+ width: u,
452
+ background: `linear-gradient(to left, ${C}, transparent)`
438
453
  } : {
439
- height: h,
440
- background: `linear-gradient(to top, ${m}, transparent)`
454
+ height: u,
455
+ background: `linear-gradient(to top, ${C}, transparent)`
441
456
  }
442
457
  }
443
458
  ),
444
- w && z && /* @__PURE__ */ l(
459
+ h && k && /* @__PURE__ */ l(
445
460
  "button",
446
461
  {
447
462
  "data-slot": "scroll-overflow-arrow-end",
448
- [n]: "scroll-overflow-arrow-end",
463
+ [s]: "scroll-overflow-arrow-end",
449
464
  type: "button",
450
465
  tabIndex: -1,
451
466
  "aria-label": r ? "Scroll right" : "Scroll down",
452
- onClick: V,
453
- className: d(
467
+ onClick: E,
468
+ className: f(
454
469
  o.arrowButton,
455
470
  r ? o.arrowHorizontalEnd : o.arrowVerticalEnd
456
471
  ),
@@ -458,9 +473,9 @@ const _ = (s) => /* @__PURE__ */ l(
458
473
  "span",
459
474
  {
460
475
  "data-slot": "scroll-overflow-arrow-icon",
461
- [n]: "scroll-overflow-arrow-icon",
476
+ [s]: "scroll-overflow-arrow-icon",
462
477
  className: o.arrowBadge,
463
- children: r ? /* @__PURE__ */ l(q, { className: o.arrowIcon }) : /* @__PURE__ */ l(Q, { className: o.arrowIcon })
478
+ children: r ? /* @__PURE__ */ l(Q, { className: o.arrowIcon }) : /* @__PURE__ */ l(Y, { className: o.arrowIcon })
464
479
  }
465
480
  )
466
481
  }
@@ -470,7 +485,7 @@ const _ = (s) => /* @__PURE__ */ l(
470
485
  );
471
486
  });
472
487
  export {
473
- ao as ScrollOverflow,
474
- P as useScrollOverflow
488
+ co as ScrollOverflow,
489
+ q as useScrollOverflow
475
490
  };
476
491
  //# sourceMappingURL=scroll-overflow.js.map