@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.
- package/dist/components/accordion/accordion.js +57 -48
- package/dist/components/accordion/accordion.js.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.js +120 -92
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/avatar/avatar-group.js +38 -35
- package/dist/components/avatar/avatar-group.js.map +1 -1
- package/dist/components/avatar/avatar.js +78 -71
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/badge/badge.js +60 -55
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +99 -54
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/button/button.js +87 -77
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button-group/button-group.js +36 -32
- package/dist/components/button-group/button-group.js.map +1 -1
- package/dist/components/callout/callout.js +105 -98
- package/dist/components/callout/callout.js.map +1 -1
- package/dist/components/card/card.js +62 -52
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/checkbox/checkbox.js +22 -19
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/code-block/code-block.js +135 -123
- package/dist/components/code-block/code-block.js.map +1 -1
- package/dist/components/code-editor/code-editor.js +276 -260
- package/dist/components/code-editor/code-editor.js.map +1 -1
- package/dist/components/collapsible-sidebar/collapsible-sidebar.js +62 -56
- package/dist/components/collapsible-sidebar/collapsible-sidebar.js.map +1 -1
- package/dist/components/command/command.js +116 -105
- package/dist/components/command/command.js.map +1 -1
- package/dist/components/data-table/data-table-body.js +38 -34
- package/dist/components/data-table/data-table-body.js.map +1 -1
- package/dist/components/data-table/data-table-column-header.js +30 -26
- package/dist/components/data-table/data-table-column-header.js.map +1 -1
- package/dist/components/data-table/data-table-column-order.js +79 -73
- package/dist/components/data-table/data-table-column-order.js.map +1 -1
- package/dist/components/data-table/data-table-column-visibility.js +25 -22
- package/dist/components/data-table/data-table-column-visibility.js.map +1 -1
- package/dist/components/data-table/data-table-content.js +47 -44
- package/dist/components/data-table/data-table-content.js.map +1 -1
- package/dist/components/data-table/data-table-error.js +36 -32
- package/dist/components/data-table/data-table-error.js.map +1 -1
- package/dist/components/data-table/data-table-footer.js +10 -8
- package/dist/components/data-table/data-table-footer.js.map +1 -1
- package/dist/components/data-table/data-table-header-draggable.js +40 -36
- package/dist/components/data-table/data-table-header-draggable.js.map +1 -1
- package/dist/components/data-table/data-table-header.js +113 -99
- package/dist/components/data-table/data-table-header.js.map +1 -1
- package/dist/components/data-table/data-table-loading.js +21 -18
- package/dist/components/data-table/data-table-loading.js.map +1 -1
- package/dist/components/data-table/data-table-resize-handle.js +13 -11
- package/dist/components/data-table/data-table-resize-handle.js.map +1 -1
- package/dist/components/data-table/data-table-row.js +71 -59
- package/dist/components/data-table/data-table-row.js.map +1 -1
- package/dist/components/data-table/data-table-toolbar.js +9 -7
- package/dist/components/data-table/data-table-toolbar.js.map +1 -1
- package/dist/components/data-table/data-table.js +48 -46
- package/dist/components/data-table/data-table.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.js +173 -164
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/date-range-picker/range-calendar.js +36 -34
- package/dist/components/date-range-picker/range-calendar.js.map +1 -1
- package/dist/components/date-time-picker/calendar.js +290 -272
- package/dist/components/date-time-picker/calendar.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-input.js +22 -20
- package/dist/components/date-time-picker/date-time-picker-input.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-panel.js +126 -120
- package/dist/components/date-time-picker/date-time-picker-panel.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker.js +42 -40
- package/dist/components/date-time-picker/date-time-picker.js.map +1 -1
- package/dist/components/date-time-picker/time-picker.js +95 -87
- package/dist/components/date-time-picker/time-picker.js.map +1 -1
- package/dist/components/dialog/dialog.js +115 -95
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/drawer/drawer.js +144 -109
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.js +141 -112
- package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/field/field-combobox.js +196 -176
- package/dist/components/field/field-combobox.js.map +1 -1
- package/dist/components/field/field.js +137 -126
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/list/list.js +237 -219
- package/dist/components/list/list.js.map +1 -1
- package/dist/components/option-card/option-card.js +129 -116
- package/dist/components/option-card/option-card.js.map +1 -1
- package/dist/components/pill/pill.js +55 -51
- package/dist/components/pill/pill.js.map +1 -1
- package/dist/components/popover/popover.js +53 -36
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/radio/radio.js +38 -34
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/scroll-area/scroll-area.js +38 -35
- package/dist/components/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/scroll-overflow/scroll-overflow.js +166 -151
- package/dist/components/scroll-overflow/scroll-overflow.js.map +1 -1
- package/dist/components/segmented-control/segmented-control.js +93 -85
- package/dist/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/select/select.js +149 -128
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/separator/separator.js +19 -16
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/skeleton/skeleton.js +34 -30
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/spinner/spinner.js +22 -17
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/components/surface/surface.js +25 -22
- package/dist/components/surface/surface.js.map +1 -1
- package/dist/components/switch/switch.js +66 -57
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/table/table-pagination.js +139 -129
- package/dist/components/table/table-pagination.js.map +1 -1
- package/dist/components/table/table.js +104 -90
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/tabs/tabs.js +206 -128
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/toast/toast.js +112 -100
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toggle/toggle.js +32 -30
- package/dist/components/toggle/toggle.js.map +1 -1
- package/dist/components/tooltip/tooltip.js +59 -46
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/lib/clear-button.js +18 -17
- package/dist/lib/clear-button.js.map +1 -1
- package/dist/styles/host-reset.js +47 -0
- package/dist/styles/host-reset.js.map +1 -0
- package/dist/styles/overlay-layer.js +5 -0
- package/dist/styles/overlay-layer.js.map +1 -0
- package/dist/tokens.json +1 -1
- package/package.json +8 -6
- package/scripts/migration-diagnostics.mjs +42 -7
- package/scripts/migration-sweep.mjs +9 -1
|
@@ -1,100 +1,101 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { Root as
|
|
4
|
-
import { mergeClasses as
|
|
5
|
-
import { makeZenithStyles as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
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
|
|
12
|
-
const { scrollStep:
|
|
13
|
-
const t =
|
|
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 (
|
|
16
|
-
const e = Math.round(t.scrollLeft),
|
|
17
|
-
|
|
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),
|
|
20
|
-
|
|
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
|
-
}, [
|
|
23
|
-
|
|
24
|
-
const t =
|
|
23
|
+
}, [n]);
|
|
24
|
+
w.useEffect(() => {
|
|
25
|
+
const t = h.current;
|
|
25
26
|
if (!t) return;
|
|
26
|
-
|
|
27
|
+
p();
|
|
27
28
|
let e = null;
|
|
28
29
|
if (typeof ResizeObserver < "u") {
|
|
29
30
|
e = new ResizeObserver(() => {
|
|
30
|
-
|
|
31
|
+
p();
|
|
31
32
|
}), e.observe(t);
|
|
32
|
-
for (const
|
|
33
|
-
e.observe(
|
|
33
|
+
for (const i of t.children)
|
|
34
|
+
e.observe(i);
|
|
34
35
|
}
|
|
35
|
-
return t.addEventListener("scroll",
|
|
36
|
-
e == null || e.disconnect(), t.removeEventListener("scroll",
|
|
36
|
+
return t.addEventListener("scroll", p, { passive: !0 }), () => {
|
|
37
|
+
e == null || e.disconnect(), t.removeEventListener("scroll", p);
|
|
37
38
|
};
|
|
38
|
-
}, [
|
|
39
|
-
const
|
|
39
|
+
}, [p]);
|
|
40
|
+
const z = w.useCallback(() => {
|
|
40
41
|
var t;
|
|
41
|
-
(t =
|
|
42
|
-
[
|
|
43
|
-
behavior:
|
|
42
|
+
(t = h.current) == null || t.scrollBy({
|
|
43
|
+
[n ? "left" : "top"]: -m,
|
|
44
|
+
behavior: D()
|
|
44
45
|
});
|
|
45
|
-
}, [
|
|
46
|
+
}, [m, n]), o = w.useCallback(() => {
|
|
46
47
|
var t;
|
|
47
|
-
(t =
|
|
48
|
-
[
|
|
49
|
-
behavior:
|
|
48
|
+
(t = h.current) == null || t.scrollBy({
|
|
49
|
+
[n ? "left" : "top"]: m,
|
|
50
|
+
behavior: D()
|
|
50
51
|
});
|
|
51
|
-
}, [
|
|
52
|
+
}, [m, n]);
|
|
52
53
|
return {
|
|
53
|
-
scrollRef:
|
|
54
|
-
hasOverflow:
|
|
55
|
-
canScrollStart:
|
|
56
|
-
canScrollEnd:
|
|
57
|
-
scrollToStart:
|
|
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
|
|
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
|
-
...
|
|
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
|
-
),
|
|
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
|
-
...
|
|
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
|
-
),
|
|
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
|
-
...
|
|
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
|
-
),
|
|
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
|
-
...
|
|
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
|
-
),
|
|
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
|
-
...
|
|
154
|
-
...
|
|
155
|
-
...
|
|
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:
|
|
186
|
-
...
|
|
192
|
+
backgroundColor: B,
|
|
193
|
+
...b.borderRadius(P),
|
|
187
194
|
backdropFilter: "blur(4px)",
|
|
188
|
-
color:
|
|
195
|
+
color: G,
|
|
189
196
|
":hover": {
|
|
190
|
-
backgroundColor:
|
|
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
|
-
...
|
|
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
|
-
...
|
|
230
|
+
...a,
|
|
231
|
+
...b.borderRadius(U),
|
|
221
232
|
":focus-visible": {
|
|
222
233
|
outlineWidth: "2px",
|
|
223
234
|
outlineOffset: "2px",
|
|
224
235
|
outlineStyle: "solid",
|
|
225
|
-
outlineColor:
|
|
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
|
-
...
|
|
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:
|
|
277
|
+
backgroundColor: B
|
|
263
278
|
}
|
|
264
|
-
}),
|
|
265
|
-
className:
|
|
266
|
-
children:
|
|
267
|
-
arrows:
|
|
268
|
-
gradients:
|
|
269
|
-
gradientWidth:
|
|
270
|
-
gradientColor:
|
|
271
|
-
shadow:
|
|
272
|
-
scrollbar:
|
|
273
|
-
scrollStep:
|
|
274
|
-
orientation:
|
|
275
|
-
...
|
|
276
|
-
},
|
|
277
|
-
const o =
|
|
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:
|
|
280
|
-
canScrollStart:
|
|
281
|
-
canScrollEnd:
|
|
282
|
-
scrollToStart:
|
|
283
|
-
scrollToEnd:
|
|
284
|
-
} =
|
|
285
|
-
var
|
|
286
|
-
if (
|
|
287
|
-
const
|
|
288
|
-
switch (
|
|
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
|
-
|
|
305
|
+
v.preventDefault(), V();
|
|
306
|
+
break;
|
|
307
|
+
case T:
|
|
308
|
+
v.preventDefault(), E();
|
|
294
309
|
break;
|
|
295
310
|
case "Home":
|
|
296
|
-
|
|
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
|
-
|
|
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__ */
|
|
324
|
+
return /* @__PURE__ */ I(
|
|
310
325
|
"div",
|
|
311
326
|
{
|
|
312
|
-
ref:
|
|
327
|
+
ref: z,
|
|
313
328
|
"data-slot": "scroll-overflow",
|
|
314
|
-
[
|
|
315
|
-
"data-orientation":
|
|
316
|
-
"data-has-overflow":
|
|
317
|
-
"data-can-scroll-start":
|
|
318
|
-
"data-can-scroll-end":
|
|
319
|
-
className:
|
|
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
|
-
|
|
337
|
+
m
|
|
323
338
|
),
|
|
324
339
|
children: [
|
|
325
|
-
|
|
340
|
+
S && d && /* @__PURE__ */ l(
|
|
326
341
|
"div",
|
|
327
342
|
{
|
|
328
343
|
"data-slot": "scroll-overflow-fade-start",
|
|
329
|
-
[
|
|
344
|
+
[s]: "scroll-overflow-fade-start",
|
|
330
345
|
"aria-hidden": "true",
|
|
331
|
-
className:
|
|
346
|
+
className: f(
|
|
332
347
|
o.fade,
|
|
333
348
|
r ? o.fadeHorizontalStart : o.fadeVerticalStart,
|
|
334
|
-
|
|
349
|
+
x && (r ? o.shadowHorizontalStart : o.shadowVerticalStart)
|
|
335
350
|
),
|
|
336
351
|
style: r ? {
|
|
337
|
-
width:
|
|
338
|
-
background: `linear-gradient(to right, ${
|
|
352
|
+
width: u,
|
|
353
|
+
background: `linear-gradient(to right, ${C}, transparent)`
|
|
339
354
|
} : {
|
|
340
|
-
height:
|
|
341
|
-
background: `linear-gradient(to bottom, ${
|
|
355
|
+
height: u,
|
|
356
|
+
background: `linear-gradient(to bottom, ${C}, transparent)`
|
|
342
357
|
}
|
|
343
358
|
}
|
|
344
359
|
),
|
|
345
|
-
|
|
360
|
+
h && d && /* @__PURE__ */ l(
|
|
346
361
|
"button",
|
|
347
362
|
{
|
|
348
363
|
"data-slot": "scroll-overflow-arrow-start",
|
|
349
|
-
[
|
|
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:
|
|
354
|
-
className:
|
|
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
|
-
[
|
|
377
|
+
[s]: "scroll-overflow-arrow-icon",
|
|
363
378
|
className: o.arrowBadge,
|
|
364
|
-
children: r ? /* @__PURE__ */ l(
|
|
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__ */
|
|
370
|
-
|
|
384
|
+
/* @__PURE__ */ I(
|
|
385
|
+
M,
|
|
371
386
|
{
|
|
372
387
|
"data-slot": "scroll-overflow-root",
|
|
373
388
|
type: "scroll",
|
|
374
|
-
[
|
|
375
|
-
className:
|
|
389
|
+
[s]: "scroll-overflow-root",
|
|
390
|
+
className: f(
|
|
376
391
|
o.scrollAreaRoot,
|
|
377
392
|
r ? o.scrollAreaRootHorizontal : o.scrollAreaRootVertical,
|
|
378
|
-
|
|
393
|
+
g && (r ? o.scrollAreaRootScrollbarHorizontal : o.scrollAreaRootScrollbarVertical)
|
|
379
394
|
),
|
|
380
|
-
...
|
|
395
|
+
...p,
|
|
381
396
|
children: [
|
|
382
397
|
/* @__PURE__ */ l(
|
|
383
|
-
|
|
398
|
+
O,
|
|
384
399
|
{
|
|
385
400
|
ref: e,
|
|
386
401
|
"data-slot": "scroll-overflow-viewport",
|
|
387
|
-
[
|
|
388
|
-
tabIndex:
|
|
389
|
-
onKeyDown:
|
|
390
|
-
className:
|
|
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
|
-
|
|
408
|
+
g && o.viewportFlex,
|
|
394
409
|
!r && o.viewportVertical
|
|
395
410
|
),
|
|
396
|
-
children:
|
|
411
|
+
children: y
|
|
397
412
|
}
|
|
398
413
|
),
|
|
399
414
|
/* @__PURE__ */ l(
|
|
400
|
-
|
|
415
|
+
F,
|
|
401
416
|
{
|
|
402
417
|
forceMount: !0,
|
|
403
|
-
orientation:
|
|
418
|
+
orientation: n,
|
|
404
419
|
"data-slot": "scroll-overflow-scrollbar",
|
|
405
|
-
[
|
|
406
|
-
className:
|
|
420
|
+
[s]: "scroll-overflow-scrollbar",
|
|
421
|
+
className: f(
|
|
407
422
|
t.track,
|
|
408
|
-
|
|
423
|
+
g ? o.scrollbar : o.scrollbarHidden,
|
|
409
424
|
r ? o.scrollbarHorizontal : o.scrollbarVertical
|
|
410
425
|
),
|
|
411
426
|
children: /* @__PURE__ */ l(
|
|
412
|
-
|
|
427
|
+
W,
|
|
413
428
|
{
|
|
414
429
|
"data-slot": "scroll-overflow-thumb",
|
|
415
|
-
[
|
|
416
|
-
className:
|
|
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
|
-
|
|
439
|
+
S && k && /* @__PURE__ */ l(
|
|
425
440
|
"div",
|
|
426
441
|
{
|
|
427
442
|
"data-slot": "scroll-overflow-fade-end",
|
|
428
|
-
[
|
|
443
|
+
[s]: "scroll-overflow-fade-end",
|
|
429
444
|
"aria-hidden": "true",
|
|
430
|
-
className:
|
|
445
|
+
className: f(
|
|
431
446
|
o.fade,
|
|
432
447
|
r ? o.fadeHorizontalEnd : o.fadeVerticalEnd,
|
|
433
|
-
|
|
448
|
+
x && (r ? o.shadowHorizontalEnd : o.shadowVerticalEnd)
|
|
434
449
|
),
|
|
435
450
|
style: r ? {
|
|
436
|
-
width:
|
|
437
|
-
background: `linear-gradient(to left, ${
|
|
451
|
+
width: u,
|
|
452
|
+
background: `linear-gradient(to left, ${C}, transparent)`
|
|
438
453
|
} : {
|
|
439
|
-
height:
|
|
440
|
-
background: `linear-gradient(to top, ${
|
|
454
|
+
height: u,
|
|
455
|
+
background: `linear-gradient(to top, ${C}, transparent)`
|
|
441
456
|
}
|
|
442
457
|
}
|
|
443
458
|
),
|
|
444
|
-
|
|
459
|
+
h && k && /* @__PURE__ */ l(
|
|
445
460
|
"button",
|
|
446
461
|
{
|
|
447
462
|
"data-slot": "scroll-overflow-arrow-end",
|
|
448
|
-
[
|
|
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:
|
|
453
|
-
className:
|
|
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
|
-
[
|
|
476
|
+
[s]: "scroll-overflow-arrow-icon",
|
|
462
477
|
className: o.arrowBadge,
|
|
463
|
-
children: r ? /* @__PURE__ */ l(
|
|
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
|
-
|
|
474
|
-
|
|
488
|
+
co as ScrollOverflow,
|
|
489
|
+
q as useScrollOverflow
|
|
475
490
|
};
|
|
476
491
|
//# sourceMappingURL=scroll-overflow.js.map
|