@wix/site-ui 1.29.0 → 1.31.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.
- package/dist/1268.js +99 -0
- package/dist/1279.js +7 -0
- package/dist/1457.js +10 -0
- package/dist/1477.js +106 -0
- package/dist/1500.js +111 -0
- package/dist/167.js +6 -0
- package/dist/2274.js +34 -0
- package/dist/2287.js +17 -0
- package/dist/2418.js +31 -0
- package/dist/2801.js +20 -0
- package/dist/285.js +86 -0
- package/dist/2861.js +6 -0
- package/dist/3020.js +7 -0
- package/dist/3021.js +72 -0
- package/dist/3056.js +229 -0
- package/dist/3140.js +4 -0
- package/dist/3248.js +307 -0
- package/dist/3296.js +4 -0
- package/dist/3319.js +400 -0
- package/dist/3395.js +4 -0
- package/dist/3485.js +854 -0
- package/dist/353.js +14 -0
- package/dist/3670.js +418 -0
- package/dist/3829.js +113 -0
- package/dist/4026.js +12 -0
- package/dist/4143.js +46 -0
- package/dist/42.js +32 -0
- package/dist/4281.js +30 -0
- package/dist/4346.js +2 -0
- package/dist/4388.js +418 -0
- package/dist/4490.js +32 -0
- package/dist/4495.js +9 -0
- package/dist/4549.js +24 -0
- package/dist/4586.js +41 -0
- package/dist/4586.js.LICENSE.txt +19 -0
- package/dist/4707.js +19 -0
- package/dist/4723.js +7 -0
- package/dist/4745.js +7 -0
- package/dist/4768.js +35 -0
- package/dist/4922.js +15 -0
- package/dist/5036.js +17 -0
- package/dist/5085.js +20 -0
- package/dist/5299.js +597 -0
- package/dist/5659.js +4 -0
- package/dist/5778.js +10 -0
- package/dist/5864.js +86 -0
- package/dist/5992.js +913 -0
- package/dist/5992.js.LICENSE.txt +19 -0
- package/dist/6003.js +10 -0
- package/dist/6046.js +29 -0
- package/dist/6089.js +2355 -0
- package/dist/6107.js +10 -0
- package/dist/6247.js +20 -0
- package/dist/6270.js +487 -0
- package/dist/6329.js +32 -0
- package/dist/6330.js +30 -0
- package/dist/6499.js +7 -0
- package/dist/6535.js +71 -0
- package/dist/6588.js +382 -0
- package/dist/6706.js +16 -0
- package/dist/6825.js +7 -0
- package/dist/6882.js +1562 -0
- package/dist/6914.js +30 -0
- package/dist/7021.js +13 -0
- package/dist/7366.js +83 -0
- package/dist/7373.js +25 -0
- package/dist/7541.js +25 -0
- package/dist/7564.js +10 -0
- package/dist/7642.js +20 -0
- package/dist/7725.js +10 -0
- package/dist/7871.js +38 -0
- package/dist/8052.js +352 -0
- package/dist/8106.js +238 -0
- package/dist/8171.js +346 -0
- package/dist/8225.js +21 -0
- package/dist/8272.js +333 -0
- package/dist/8527.js +58 -0
- package/dist/8724.js +10 -0
- package/dist/8750.js +1920 -0
- package/dist/8758.js +43 -0
- package/dist/880.js +149 -0
- package/dist/8935.js +8 -0
- package/dist/8960.js +22 -0
- package/dist/8971.js +40 -0
- package/dist/8979.js +10 -0
- package/dist/8996.js +71 -0
- package/dist/904.js +121 -0
- package/dist/9048.js +52 -0
- package/dist/9087.js +256 -0
- package/dist/9189.js +158 -0
- package/dist/9255.js +136 -0
- package/dist/9352.js +148 -0
- package/dist/951.js +22 -0
- package/dist/9635.js +22 -0
- package/dist/9829.js +4 -0
- package/dist/9863.js +8 -0
- package/dist/Accordion/index.d.ts +569 -12
- package/dist/Accordion/index.js +423 -8
- package/dist/AlertDialog/index.d.ts +1417 -18
- package/dist/AlertDialog/index.js +34 -14
- package/dist/Autocomplete/index.d.ts +1861 -38
- package/dist/Autocomplete/index.js +98 -24
- package/dist/Avatar/index.d.ts +129 -7
- package/dist/Avatar/index.js +149 -6
- package/dist/Badge/index.css +44 -0
- package/dist/Badge/index.d.ts +22 -0
- package/dist/Badge/index.js +23 -0
- package/dist/Breadcrumbs/index.d.ts +960 -7
- package/dist/Breadcrumbs/index.js +5 -5
- package/dist/Button/index.d.ts +88 -6
- package/dist/Button/index.js +27 -3
- package/dist/Checkbox/index.d.ts +425 -5
- package/dist/Checkbox/index.js +45 -5
- package/dist/CheckboxGroup/index.d.ts +318 -3
- package/dist/CheckboxGroup/index.js +166 -3
- package/dist/Collapsible/index.d.ts +377 -7
- package/dist/Collapsible/index.js +160 -6
- package/dist/Combobox/index.d.ts +1984 -48
- package/dist/Combobox/index.js +352 -29
- package/dist/ContextMenu/index.d.ts +2340 -36
- package/dist/ContextMenu/index.js +197 -22
- package/dist/Dialog/index.d.ts +1355 -18
- package/dist/Dialog/index.js +16 -14
- package/dist/Drawer/index.d.ts +1653 -18
- package/dist/Drawer/index.js +2797 -20
- package/dist/Field/index.d.ts +655 -15
- package/dist/Field/index.js +677 -10
- package/dist/Fieldset/index.d.ts +94 -5
- package/dist/Fieldset/index.js +68 -5
- package/dist/Form/index.d.ts +331 -2
- package/dist/Form/index.js +106 -3
- package/dist/Input/index.d.ts +692 -3
- package/dist/Input/index.js +10 -3
- package/dist/Menu/index.d.ts +2301 -36
- package/dist/Menu/index.js +365 -26
- package/dist/Menubar/index.d.ts +2301 -3
- package/dist/Menubar/index.js +105 -3
- package/dist/Meter/index.d.ts +175 -11
- package/dist/Meter/index.js +129 -9
- package/dist/NavigationMenu/index.d.ts +978 -28
- package/dist/NavigationMenu/index.js +1034 -17
- package/dist/NumberField/index.d.ts +612 -15
- package/dist/NumberField/index.js +1409 -11
- package/dist/Popover/index.d.ts +1655 -20
- package/dist/Popover/index.js +792 -17
- package/dist/PreviewCard/index.d.ts +1523 -14
- package/dist/PreviewCard/index.js +679 -14
- package/dist/Progress/index.d.ts +183 -11
- package/dist/Progress/index.js +181 -9
- package/dist/Radio/index.d.ts +185 -6
- package/dist/Radio/index.js +253 -6
- package/dist/RadioGroup/index.d.ts +341 -2
- package/dist/RadioGroup/index.js +154 -3
- package/dist/ScrollArea/index.d.ts +265 -13
- package/dist/ScrollArea/index.js +892 -10
- package/dist/Select/index.d.ts +1493 -38
- package/dist/Select/index.js +1824 -23
- package/dist/Separator/index.d.ts +80 -6
- package/dist/Separator/index.js +3 -3
- package/dist/Slider/index.d.ts +678 -16
- package/dist/Slider/index.js +1199 -11
- package/dist/Switch/index.d.ts +393 -5
- package/dist/Switch/index.js +208 -6
- package/dist/Tabs/index.d.ts +523 -12
- package/dist/Tabs/index.js +685 -9
- package/dist/Toggle/index.d.ts +305 -2
- package/dist/Toggle/index.js +76 -3
- package/dist/ToggleGroup/index.d.ts +316 -2
- package/dist/ToggleGroup/index.js +102 -3
- package/dist/Toolbar/index.d.ts +282 -13
- package/dist/Toolbar/index.js +230 -9
- package/dist/Tooltip/index.d.ts +1572 -14
- package/dist/Tooltip/index.js +965 -14
- package/dist/index.d.ts +12758 -646
- package/dist/index.js +1 -0
- package/dist/rslib-runtime.js +18 -0
- package/package.json +3 -3
package/dist/ScrollArea/index.js
CHANGED
|
@@ -1,44 +1,926 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ScrollArea } from "@base-ui/react/scroll-area";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
2
|
import clsx from "clsx";
|
|
3
|
+
import { useRenderElement, esm_formatErrorMessage } from "../8272.js";
|
|
4
|
+
import { useBaseUiId } from "../6046.js";
|
|
5
|
+
import { useTimeout } from "../42.js";
|
|
6
|
+
import { useCSPContext } from "../6003.js";
|
|
7
|
+
import { useStableCallback } from "../7541.js";
|
|
8
|
+
import { getTarget, contains } from "../4549.js";
|
|
9
|
+
import { styleDisableScrollbar, normalizeScrollOffset } from "../6329.js";
|
|
10
|
+
import { isWebKit } from "../8971.js";
|
|
11
|
+
import { useDirection } from "../9863.js";
|
|
12
|
+
import { clamp } from "../3296.js";
|
|
13
|
+
import { useIsoLayoutEffect } from "../6499.js";
|
|
14
|
+
import { addEventListener } from "../4723.js";
|
|
4
15
|
import * as __rspack_external_react from "react";
|
|
16
|
+
const ScrollAreaRootContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
|
|
17
|
+
if ("production" !== process.env.NODE_ENV) ScrollAreaRootContext.displayName = "ScrollAreaRootContext";
|
|
18
|
+
function useScrollAreaRootContext() {
|
|
19
|
+
const context = __rspack_external_react.useContext(ScrollAreaRootContext);
|
|
20
|
+
if (void 0 === context) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: ScrollAreaRootContext is missing. ScrollArea parts must be placed within <ScrollArea.Root>.' : esm_formatErrorMessage(53));
|
|
21
|
+
return context;
|
|
22
|
+
}
|
|
23
|
+
let ScrollAreaRootCssVars_ScrollAreaRootCssVars = /*#__PURE__*/ function(ScrollAreaRootCssVars) {
|
|
24
|
+
ScrollAreaRootCssVars["scrollAreaCornerHeight"] = "--scroll-area-corner-height";
|
|
25
|
+
ScrollAreaRootCssVars["scrollAreaCornerWidth"] = "--scroll-area-corner-width";
|
|
26
|
+
return ScrollAreaRootCssVars;
|
|
27
|
+
}({});
|
|
28
|
+
function getOffset(element, prop, axis) {
|
|
29
|
+
if (!element) return 0;
|
|
30
|
+
const styles = getComputedStyle(element);
|
|
31
|
+
const propAxis = 'x' === axis ? 'Inline' : 'Block';
|
|
32
|
+
if ('x' === axis && 'margin' === prop) return 2 * parseFloat(styles[`${prop}InlineStart`]);
|
|
33
|
+
return parseFloat(styles[`${prop}${propAxis}Start`]) + parseFloat(styles[`${prop}${propAxis}End`]);
|
|
34
|
+
}
|
|
35
|
+
let ScrollAreaScrollbarDataAttributes_ScrollAreaScrollbarDataAttributes = /*#__PURE__*/ function(ScrollAreaScrollbarDataAttributes) {
|
|
36
|
+
ScrollAreaScrollbarDataAttributes["orientation"] = "data-orientation";
|
|
37
|
+
ScrollAreaScrollbarDataAttributes["hovering"] = "data-hovering";
|
|
38
|
+
ScrollAreaScrollbarDataAttributes["scrolling"] = "data-scrolling";
|
|
39
|
+
ScrollAreaScrollbarDataAttributes["hasOverflowX"] = "data-has-overflow-x";
|
|
40
|
+
ScrollAreaScrollbarDataAttributes["hasOverflowY"] = "data-has-overflow-y";
|
|
41
|
+
ScrollAreaScrollbarDataAttributes["overflowXStart"] = "data-overflow-x-start";
|
|
42
|
+
ScrollAreaScrollbarDataAttributes["overflowXEnd"] = "data-overflow-x-end";
|
|
43
|
+
ScrollAreaScrollbarDataAttributes["overflowYStart"] = "data-overflow-y-start";
|
|
44
|
+
ScrollAreaScrollbarDataAttributes["overflowYEnd"] = "data-overflow-y-end";
|
|
45
|
+
return ScrollAreaScrollbarDataAttributes;
|
|
46
|
+
}({});
|
|
47
|
+
let ScrollAreaRootDataAttributes_ScrollAreaRootDataAttributes = /*#__PURE__*/ function(ScrollAreaRootDataAttributes) {
|
|
48
|
+
ScrollAreaRootDataAttributes["scrolling"] = "data-scrolling";
|
|
49
|
+
ScrollAreaRootDataAttributes["hasOverflowX"] = "data-has-overflow-x";
|
|
50
|
+
ScrollAreaRootDataAttributes["hasOverflowY"] = "data-has-overflow-y";
|
|
51
|
+
ScrollAreaRootDataAttributes["overflowXStart"] = "data-overflow-x-start";
|
|
52
|
+
ScrollAreaRootDataAttributes["overflowXEnd"] = "data-overflow-x-end";
|
|
53
|
+
ScrollAreaRootDataAttributes["overflowYStart"] = "data-overflow-y-start";
|
|
54
|
+
ScrollAreaRootDataAttributes["overflowYEnd"] = "data-overflow-y-end";
|
|
55
|
+
return ScrollAreaRootDataAttributes;
|
|
56
|
+
}({});
|
|
57
|
+
const scrollAreaStateAttributesMapping = {
|
|
58
|
+
hasOverflowX: (value)=>value ? {
|
|
59
|
+
[ScrollAreaRootDataAttributes_ScrollAreaRootDataAttributes.hasOverflowX]: ''
|
|
60
|
+
} : null,
|
|
61
|
+
hasOverflowY: (value)=>value ? {
|
|
62
|
+
[ScrollAreaRootDataAttributes_ScrollAreaRootDataAttributes.hasOverflowY]: ''
|
|
63
|
+
} : null,
|
|
64
|
+
overflowXStart: (value)=>value ? {
|
|
65
|
+
[ScrollAreaRootDataAttributes_ScrollAreaRootDataAttributes.overflowXStart]: ''
|
|
66
|
+
} : null,
|
|
67
|
+
overflowXEnd: (value)=>value ? {
|
|
68
|
+
[ScrollAreaRootDataAttributes_ScrollAreaRootDataAttributes.overflowXEnd]: ''
|
|
69
|
+
} : null,
|
|
70
|
+
overflowYStart: (value)=>value ? {
|
|
71
|
+
[ScrollAreaRootDataAttributes_ScrollAreaRootDataAttributes.overflowYStart]: ''
|
|
72
|
+
} : null,
|
|
73
|
+
overflowYEnd: (value)=>value ? {
|
|
74
|
+
[ScrollAreaRootDataAttributes_ScrollAreaRootDataAttributes.overflowYEnd]: ''
|
|
75
|
+
} : null,
|
|
76
|
+
cornerHidden: ()=>null
|
|
77
|
+
};
|
|
78
|
+
const DEFAULT_COORDS = {
|
|
79
|
+
x: 0,
|
|
80
|
+
y: 0
|
|
81
|
+
};
|
|
82
|
+
const DEFAULT_SIZE = {
|
|
83
|
+
width: 0,
|
|
84
|
+
height: 0
|
|
85
|
+
};
|
|
86
|
+
const DEFAULT_OVERFLOW_EDGES = {
|
|
87
|
+
xStart: false,
|
|
88
|
+
xEnd: false,
|
|
89
|
+
yStart: false,
|
|
90
|
+
yEnd: false
|
|
91
|
+
};
|
|
92
|
+
const DEFAULT_HIDDEN_STATE = {
|
|
93
|
+
x: true,
|
|
94
|
+
y: true,
|
|
95
|
+
corner: true
|
|
96
|
+
};
|
|
97
|
+
const ScrollAreaRoot_ScrollAreaRoot = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
98
|
+
const { render, className, overflowEdgeThreshold: overflowEdgeThresholdProp, style, ...elementProps } = componentProps;
|
|
99
|
+
const overflowEdgeThreshold = normalizeOverflowEdgeThreshold(overflowEdgeThresholdProp);
|
|
100
|
+
const rootId = useBaseUiId();
|
|
101
|
+
const scrollYTimeout = useTimeout();
|
|
102
|
+
const scrollXTimeout = useTimeout();
|
|
103
|
+
const { nonce, disableStyleElements } = useCSPContext();
|
|
104
|
+
const [hovering, setHovering] = __rspack_external_react.useState(false);
|
|
105
|
+
const [scrollingX, setScrollingX] = __rspack_external_react.useState(false);
|
|
106
|
+
const [scrollingY, setScrollingY] = __rspack_external_react.useState(false);
|
|
107
|
+
const [touchModality, setTouchModality] = __rspack_external_react.useState(false);
|
|
108
|
+
const [hasMeasuredScrollbar, setHasMeasuredScrollbar] = __rspack_external_react.useState(false);
|
|
109
|
+
const [cornerSize, setCornerSize] = __rspack_external_react.useState(DEFAULT_SIZE);
|
|
110
|
+
const [thumbSize, setThumbSize] = __rspack_external_react.useState(DEFAULT_SIZE);
|
|
111
|
+
const [overflowEdges, setOverflowEdges] = __rspack_external_react.useState(DEFAULT_OVERFLOW_EDGES);
|
|
112
|
+
const [hiddenState, setHiddenState] = __rspack_external_react.useState(DEFAULT_HIDDEN_STATE);
|
|
113
|
+
const rootRef = __rspack_external_react.useRef(null);
|
|
114
|
+
const viewportRef = __rspack_external_react.useRef(null);
|
|
115
|
+
const scrollbarYRef = __rspack_external_react.useRef(null);
|
|
116
|
+
const scrollbarXRef = __rspack_external_react.useRef(null);
|
|
117
|
+
const thumbYRef = __rspack_external_react.useRef(null);
|
|
118
|
+
const thumbXRef = __rspack_external_react.useRef(null);
|
|
119
|
+
const cornerRef = __rspack_external_react.useRef(null);
|
|
120
|
+
const thumbDraggingRef = __rspack_external_react.useRef(false);
|
|
121
|
+
const startYRef = __rspack_external_react.useRef(0);
|
|
122
|
+
const startXRef = __rspack_external_react.useRef(0);
|
|
123
|
+
const startScrollTopRef = __rspack_external_react.useRef(0);
|
|
124
|
+
const startScrollLeftRef = __rspack_external_react.useRef(0);
|
|
125
|
+
const currentOrientationRef = __rspack_external_react.useRef('vertical');
|
|
126
|
+
const scrollPositionRef = __rspack_external_react.useRef(DEFAULT_COORDS);
|
|
127
|
+
const handleScroll = useStableCallback((scrollPosition)=>{
|
|
128
|
+
const offsetX = scrollPosition.x - scrollPositionRef.current.x;
|
|
129
|
+
const offsetY = scrollPosition.y - scrollPositionRef.current.y;
|
|
130
|
+
scrollPositionRef.current = scrollPosition;
|
|
131
|
+
if (0 !== offsetY) {
|
|
132
|
+
setScrollingY(true);
|
|
133
|
+
scrollYTimeout.start(500, ()=>{
|
|
134
|
+
setScrollingY(false);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
if (0 !== offsetX) {
|
|
138
|
+
setScrollingX(true);
|
|
139
|
+
scrollXTimeout.start(500, ()=>{
|
|
140
|
+
setScrollingX(false);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
const handlePointerDown = useStableCallback((event)=>{
|
|
145
|
+
if (0 !== event.button) return;
|
|
146
|
+
thumbDraggingRef.current = true;
|
|
147
|
+
startYRef.current = event.clientY;
|
|
148
|
+
startXRef.current = event.clientX;
|
|
149
|
+
currentOrientationRef.current = event.currentTarget.getAttribute(ScrollAreaScrollbarDataAttributes_ScrollAreaScrollbarDataAttributes.orientation);
|
|
150
|
+
if (viewportRef.current) {
|
|
151
|
+
startScrollTopRef.current = viewportRef.current.scrollTop;
|
|
152
|
+
startScrollLeftRef.current = viewportRef.current.scrollLeft;
|
|
153
|
+
}
|
|
154
|
+
if (thumbYRef.current && 'vertical' === currentOrientationRef.current) thumbYRef.current.setPointerCapture(event.pointerId);
|
|
155
|
+
if (thumbXRef.current && 'horizontal' === currentOrientationRef.current) thumbXRef.current.setPointerCapture(event.pointerId);
|
|
156
|
+
});
|
|
157
|
+
const handlePointerMove = useStableCallback((event)=>{
|
|
158
|
+
if (!thumbDraggingRef.current) return;
|
|
159
|
+
const deltaY = event.clientY - startYRef.current;
|
|
160
|
+
const deltaX = event.clientX - startXRef.current;
|
|
161
|
+
if (viewportRef.current) {
|
|
162
|
+
const scrollableContentHeight = viewportRef.current.scrollHeight;
|
|
163
|
+
const viewportHeight = viewportRef.current.clientHeight;
|
|
164
|
+
const scrollableContentWidth = viewportRef.current.scrollWidth;
|
|
165
|
+
const viewportWidth = viewportRef.current.clientWidth;
|
|
166
|
+
if (thumbYRef.current && scrollbarYRef.current && 'vertical' === currentOrientationRef.current) {
|
|
167
|
+
const scrollbarYOffset = getOffset(scrollbarYRef.current, 'padding', 'y');
|
|
168
|
+
const thumbYOffset = getOffset(thumbYRef.current, 'margin', 'y');
|
|
169
|
+
const thumbHeight = thumbYRef.current.offsetHeight;
|
|
170
|
+
const maxThumbOffsetY = scrollbarYRef.current.offsetHeight - thumbHeight - scrollbarYOffset - thumbYOffset;
|
|
171
|
+
const scrollRatioY = deltaY / maxThumbOffsetY;
|
|
172
|
+
viewportRef.current.scrollTop = startScrollTopRef.current + scrollRatioY * (scrollableContentHeight - viewportHeight);
|
|
173
|
+
event.preventDefault();
|
|
174
|
+
setScrollingY(true);
|
|
175
|
+
scrollYTimeout.start(500, ()=>{
|
|
176
|
+
setScrollingY(false);
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
if (thumbXRef.current && scrollbarXRef.current && 'horizontal' === currentOrientationRef.current) {
|
|
180
|
+
const scrollbarXOffset = getOffset(scrollbarXRef.current, 'padding', 'x');
|
|
181
|
+
const thumbXOffset = getOffset(thumbXRef.current, 'margin', 'x');
|
|
182
|
+
const thumbWidth = thumbXRef.current.offsetWidth;
|
|
183
|
+
const maxThumbOffsetX = scrollbarXRef.current.offsetWidth - thumbWidth - scrollbarXOffset - thumbXOffset;
|
|
184
|
+
const scrollRatioX = deltaX / maxThumbOffsetX;
|
|
185
|
+
viewportRef.current.scrollLeft = startScrollLeftRef.current + scrollRatioX * (scrollableContentWidth - viewportWidth);
|
|
186
|
+
event.preventDefault();
|
|
187
|
+
setScrollingX(true);
|
|
188
|
+
scrollXTimeout.start(500, ()=>{
|
|
189
|
+
setScrollingX(false);
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
const handlePointerUp = useStableCallback((event)=>{
|
|
195
|
+
thumbDraggingRef.current = false;
|
|
196
|
+
if (thumbYRef.current && 'vertical' === currentOrientationRef.current) thumbYRef.current.releasePointerCapture(event.pointerId);
|
|
197
|
+
if (thumbXRef.current && 'horizontal' === currentOrientationRef.current) thumbXRef.current.releasePointerCapture(event.pointerId);
|
|
198
|
+
});
|
|
199
|
+
function handleTouchModalityChange(event) {
|
|
200
|
+
setTouchModality('touch' === event.pointerType);
|
|
201
|
+
}
|
|
202
|
+
function handlePointerEnterOrMove(event) {
|
|
203
|
+
handleTouchModalityChange(event);
|
|
204
|
+
if ('touch' !== event.pointerType) {
|
|
205
|
+
const isTargetRootChild = contains(rootRef.current, event.target);
|
|
206
|
+
setHovering(isTargetRootChild);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
const state = __rspack_external_react.useMemo(()=>({
|
|
210
|
+
scrolling: scrollingX || scrollingY,
|
|
211
|
+
hasOverflowX: !hiddenState.x,
|
|
212
|
+
hasOverflowY: !hiddenState.y,
|
|
213
|
+
overflowXStart: overflowEdges.xStart,
|
|
214
|
+
overflowXEnd: overflowEdges.xEnd,
|
|
215
|
+
overflowYStart: overflowEdges.yStart,
|
|
216
|
+
overflowYEnd: overflowEdges.yEnd,
|
|
217
|
+
cornerHidden: hiddenState.corner
|
|
218
|
+
}), [
|
|
219
|
+
scrollingX,
|
|
220
|
+
scrollingY,
|
|
221
|
+
hiddenState.x,
|
|
222
|
+
hiddenState.y,
|
|
223
|
+
hiddenState.corner,
|
|
224
|
+
overflowEdges
|
|
225
|
+
]);
|
|
226
|
+
const props = {
|
|
227
|
+
role: 'presentation',
|
|
228
|
+
onPointerEnter: handlePointerEnterOrMove,
|
|
229
|
+
onPointerMove: handlePointerEnterOrMove,
|
|
230
|
+
onPointerDown: handleTouchModalityChange,
|
|
231
|
+
onPointerLeave () {
|
|
232
|
+
setHovering(false);
|
|
233
|
+
},
|
|
234
|
+
style: {
|
|
235
|
+
position: 'relative',
|
|
236
|
+
[ScrollAreaRootCssVars_ScrollAreaRootCssVars.scrollAreaCornerHeight]: `${cornerSize.height}px`,
|
|
237
|
+
[ScrollAreaRootCssVars_ScrollAreaRootCssVars.scrollAreaCornerWidth]: `${cornerSize.width}px`
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
const element = useRenderElement('div', componentProps, {
|
|
241
|
+
state,
|
|
242
|
+
ref: [
|
|
243
|
+
forwardedRef,
|
|
244
|
+
rootRef
|
|
245
|
+
],
|
|
246
|
+
props: [
|
|
247
|
+
props,
|
|
248
|
+
elementProps
|
|
249
|
+
],
|
|
250
|
+
stateAttributesMapping: scrollAreaStateAttributesMapping
|
|
251
|
+
});
|
|
252
|
+
const contextValue = __rspack_external_react.useMemo(()=>({
|
|
253
|
+
handlePointerDown,
|
|
254
|
+
handlePointerMove,
|
|
255
|
+
handlePointerUp,
|
|
256
|
+
handleScroll,
|
|
257
|
+
cornerSize,
|
|
258
|
+
setCornerSize,
|
|
259
|
+
thumbSize,
|
|
260
|
+
setThumbSize,
|
|
261
|
+
hasMeasuredScrollbar,
|
|
262
|
+
setHasMeasuredScrollbar,
|
|
263
|
+
touchModality,
|
|
264
|
+
cornerRef,
|
|
265
|
+
scrollingX,
|
|
266
|
+
setScrollingX,
|
|
267
|
+
scrollingY,
|
|
268
|
+
setScrollingY,
|
|
269
|
+
hovering,
|
|
270
|
+
setHovering,
|
|
271
|
+
viewportRef,
|
|
272
|
+
rootRef,
|
|
273
|
+
scrollbarYRef,
|
|
274
|
+
scrollbarXRef,
|
|
275
|
+
thumbYRef,
|
|
276
|
+
thumbXRef,
|
|
277
|
+
rootId,
|
|
278
|
+
hiddenState,
|
|
279
|
+
setHiddenState,
|
|
280
|
+
overflowEdges,
|
|
281
|
+
setOverflowEdges,
|
|
282
|
+
viewportState: state,
|
|
283
|
+
overflowEdgeThreshold
|
|
284
|
+
}), [
|
|
285
|
+
handlePointerDown,
|
|
286
|
+
handlePointerMove,
|
|
287
|
+
handlePointerUp,
|
|
288
|
+
handleScroll,
|
|
289
|
+
cornerSize,
|
|
290
|
+
thumbSize,
|
|
291
|
+
hasMeasuredScrollbar,
|
|
292
|
+
touchModality,
|
|
293
|
+
scrollingX,
|
|
294
|
+
setScrollingX,
|
|
295
|
+
scrollingY,
|
|
296
|
+
setScrollingY,
|
|
297
|
+
hovering,
|
|
298
|
+
setHovering,
|
|
299
|
+
rootId,
|
|
300
|
+
hiddenState,
|
|
301
|
+
overflowEdges,
|
|
302
|
+
state,
|
|
303
|
+
overflowEdgeThreshold
|
|
304
|
+
]);
|
|
305
|
+
return /*#__PURE__*/ jsxs(ScrollAreaRootContext.Provider, {
|
|
306
|
+
value: contextValue,
|
|
307
|
+
children: [
|
|
308
|
+
!disableStyleElements && styleDisableScrollbar.getElement(nonce),
|
|
309
|
+
element
|
|
310
|
+
]
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
if ("production" !== process.env.NODE_ENV) ScrollAreaRoot_ScrollAreaRoot.displayName = "ScrollAreaRoot";
|
|
314
|
+
function normalizeOverflowEdgeThreshold(threshold) {
|
|
315
|
+
if ('number' == typeof threshold) {
|
|
316
|
+
const value = Math.max(0, threshold);
|
|
317
|
+
return {
|
|
318
|
+
xStart: value,
|
|
319
|
+
xEnd: value,
|
|
320
|
+
yStart: value,
|
|
321
|
+
yEnd: value
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
return {
|
|
325
|
+
xStart: Math.max(0, threshold?.xStart || 0),
|
|
326
|
+
xEnd: Math.max(0, threshold?.xEnd || 0),
|
|
327
|
+
yStart: Math.max(0, threshold?.yStart || 0),
|
|
328
|
+
yEnd: Math.max(0, threshold?.yEnd || 0)
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
const ScrollAreaViewportContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
|
|
332
|
+
if ("production" !== process.env.NODE_ENV) ScrollAreaViewportContext.displayName = "ScrollAreaViewportContext";
|
|
333
|
+
function useScrollAreaViewportContext() {
|
|
334
|
+
const context = __rspack_external_react.useContext(ScrollAreaViewportContext);
|
|
335
|
+
if (void 0 === context) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: ScrollAreaViewportContext missing. ScrollAreaViewport parts must be placed within <ScrollArea.Viewport>.' : esm_formatErrorMessage(55));
|
|
336
|
+
return context;
|
|
337
|
+
}
|
|
338
|
+
let ScrollAreaViewportCssVars_ScrollAreaViewportCssVars = /*#__PURE__*/ function(ScrollAreaViewportCssVars) {
|
|
339
|
+
ScrollAreaViewportCssVars["scrollAreaOverflowXStart"] = "--scroll-area-overflow-x-start";
|
|
340
|
+
ScrollAreaViewportCssVars["scrollAreaOverflowXEnd"] = "--scroll-area-overflow-x-end";
|
|
341
|
+
ScrollAreaViewportCssVars["scrollAreaOverflowYStart"] = "--scroll-area-overflow-y-start";
|
|
342
|
+
ScrollAreaViewportCssVars["scrollAreaOverflowYEnd"] = "--scroll-area-overflow-y-end";
|
|
343
|
+
return ScrollAreaViewportCssVars;
|
|
344
|
+
}({});
|
|
345
|
+
let scrollAreaOverflowVarsRegistered = false;
|
|
346
|
+
function removeCSSVariableInheritance() {
|
|
347
|
+
if (scrollAreaOverflowVarsRegistered || isWebKit) return;
|
|
348
|
+
if ("u" > typeof CSS && 'registerProperty' in CSS) [
|
|
349
|
+
ScrollAreaViewportCssVars_ScrollAreaViewportCssVars.scrollAreaOverflowXStart,
|
|
350
|
+
ScrollAreaViewportCssVars_ScrollAreaViewportCssVars.scrollAreaOverflowXEnd,
|
|
351
|
+
ScrollAreaViewportCssVars_ScrollAreaViewportCssVars.scrollAreaOverflowYStart,
|
|
352
|
+
ScrollAreaViewportCssVars_ScrollAreaViewportCssVars.scrollAreaOverflowYEnd
|
|
353
|
+
].forEach((name)=>{
|
|
354
|
+
try {
|
|
355
|
+
CSS.registerProperty({
|
|
356
|
+
name,
|
|
357
|
+
syntax: '<length>',
|
|
358
|
+
inherits: false,
|
|
359
|
+
initialValue: '0px'
|
|
360
|
+
});
|
|
361
|
+
} catch {}
|
|
362
|
+
});
|
|
363
|
+
scrollAreaOverflowVarsRegistered = true;
|
|
364
|
+
}
|
|
365
|
+
const ScrollAreaViewport_ScrollAreaViewport = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
366
|
+
const { render, className, style, ...elementProps } = componentProps;
|
|
367
|
+
const { viewportRef, scrollbarYRef, scrollbarXRef, thumbYRef, thumbXRef, cornerRef, cornerSize, setCornerSize, setThumbSize, rootId, setHiddenState, hiddenState, setHasMeasuredScrollbar, handleScroll, setHovering, setOverflowEdges, overflowEdges, overflowEdgeThreshold, scrollingX, scrollingY } = useScrollAreaRootContext();
|
|
368
|
+
const direction = useDirection();
|
|
369
|
+
const programmaticScrollRef = __rspack_external_react.useRef(true);
|
|
370
|
+
const lastMeasuredViewportMetricsRef = __rspack_external_react.useRef([
|
|
371
|
+
NaN,
|
|
372
|
+
NaN,
|
|
373
|
+
NaN,
|
|
374
|
+
NaN
|
|
375
|
+
]);
|
|
376
|
+
const scrollEndTimeout = useTimeout();
|
|
377
|
+
const waitForAnimationsTimeout = useTimeout();
|
|
378
|
+
const computeThumbPosition = useStableCallback(()=>{
|
|
379
|
+
const viewportEl = viewportRef.current;
|
|
380
|
+
const scrollbarYEl = scrollbarYRef.current;
|
|
381
|
+
const scrollbarXEl = scrollbarXRef.current;
|
|
382
|
+
const thumbYEl = thumbYRef.current;
|
|
383
|
+
const thumbXEl = thumbXRef.current;
|
|
384
|
+
const cornerEl = cornerRef.current;
|
|
385
|
+
if (!viewportEl) return;
|
|
386
|
+
const scrollableContentHeight = viewportEl.scrollHeight;
|
|
387
|
+
const scrollableContentWidth = viewportEl.scrollWidth;
|
|
388
|
+
const viewportHeight = viewportEl.clientHeight;
|
|
389
|
+
const viewportWidth = viewportEl.clientWidth;
|
|
390
|
+
const scrollTop = viewportEl.scrollTop;
|
|
391
|
+
const scrollLeft = viewportEl.scrollLeft;
|
|
392
|
+
const lastMeasuredViewportMetrics = lastMeasuredViewportMetricsRef.current;
|
|
393
|
+
const isFirstMeasurement = Number.isNaN(lastMeasuredViewportMetrics[0]);
|
|
394
|
+
lastMeasuredViewportMetrics[0] = viewportHeight;
|
|
395
|
+
lastMeasuredViewportMetrics[1] = scrollableContentHeight;
|
|
396
|
+
lastMeasuredViewportMetrics[2] = viewportWidth;
|
|
397
|
+
lastMeasuredViewportMetrics[3] = scrollableContentWidth;
|
|
398
|
+
if (isFirstMeasurement) setHasMeasuredScrollbar(true);
|
|
399
|
+
if (0 === scrollableContentHeight || 0 === scrollableContentWidth) return;
|
|
400
|
+
const nextHiddenState = getHiddenState(viewportEl);
|
|
401
|
+
const scrollbarYHidden = nextHiddenState.y;
|
|
402
|
+
const scrollbarXHidden = nextHiddenState.x;
|
|
403
|
+
const ratioX = viewportWidth / scrollableContentWidth;
|
|
404
|
+
const ratioY = viewportHeight / scrollableContentHeight;
|
|
405
|
+
const maxScrollLeft = Math.max(0, scrollableContentWidth - viewportWidth);
|
|
406
|
+
const maxScrollTop = Math.max(0, scrollableContentHeight - viewportHeight);
|
|
407
|
+
let scrollLeftFromStart = 0;
|
|
408
|
+
let scrollLeftFromEnd = 0;
|
|
409
|
+
if (!scrollbarXHidden) {
|
|
410
|
+
let rawScrollLeftFromStart = 0;
|
|
411
|
+
rawScrollLeftFromStart = 'rtl' === direction ? clamp(-scrollLeft, 0, maxScrollLeft) : clamp(scrollLeft, 0, maxScrollLeft);
|
|
412
|
+
scrollLeftFromStart = normalizeScrollOffset(rawScrollLeftFromStart, maxScrollLeft);
|
|
413
|
+
scrollLeftFromEnd = maxScrollLeft - scrollLeftFromStart;
|
|
414
|
+
}
|
|
415
|
+
const rawScrollTopFromStart = scrollbarYHidden ? 0 : clamp(scrollTop, 0, maxScrollTop);
|
|
416
|
+
const scrollTopFromStart = scrollbarYHidden ? 0 : normalizeScrollOffset(rawScrollTopFromStart, maxScrollTop);
|
|
417
|
+
const scrollTopFromEnd = scrollbarYHidden ? 0 : maxScrollTop - scrollTopFromStart;
|
|
418
|
+
const nextWidth = scrollbarXHidden ? 0 : viewportWidth;
|
|
419
|
+
const nextHeight = scrollbarYHidden ? 0 : viewportHeight;
|
|
420
|
+
let nextCornerWidth = 0;
|
|
421
|
+
let nextCornerHeight = 0;
|
|
422
|
+
if (!scrollbarXHidden && !scrollbarYHidden) {
|
|
423
|
+
nextCornerWidth = scrollbarYEl?.offsetWidth || 0;
|
|
424
|
+
nextCornerHeight = scrollbarXEl?.offsetHeight || 0;
|
|
425
|
+
}
|
|
426
|
+
const cornerNotYetSized = 0 === cornerSize.width && 0 === cornerSize.height;
|
|
427
|
+
const cornerWidthOffset = cornerNotYetSized ? nextCornerWidth : 0;
|
|
428
|
+
const cornerHeightOffset = cornerNotYetSized ? nextCornerHeight : 0;
|
|
429
|
+
const scrollbarXOffset = getOffset(scrollbarXEl, 'padding', 'x');
|
|
430
|
+
const scrollbarYOffset = getOffset(scrollbarYEl, 'padding', 'y');
|
|
431
|
+
const thumbXOffset = getOffset(thumbXEl, 'margin', 'x');
|
|
432
|
+
const thumbYOffset = getOffset(thumbYEl, 'margin', 'y');
|
|
433
|
+
const idealNextWidth = nextWidth - scrollbarXOffset - thumbXOffset;
|
|
434
|
+
const idealNextHeight = nextHeight - scrollbarYOffset - thumbYOffset;
|
|
435
|
+
const maxNextWidth = scrollbarXEl ? Math.min(scrollbarXEl.offsetWidth - cornerWidthOffset, idealNextWidth) : idealNextWidth;
|
|
436
|
+
const maxNextHeight = scrollbarYEl ? Math.min(scrollbarYEl.offsetHeight - cornerHeightOffset, idealNextHeight) : idealNextHeight;
|
|
437
|
+
const clampedNextWidth = Math.max(16, maxNextWidth * ratioX);
|
|
438
|
+
const clampedNextHeight = Math.max(16, maxNextHeight * ratioY);
|
|
439
|
+
setThumbSize((prevSize)=>{
|
|
440
|
+
if (prevSize.height === clampedNextHeight && prevSize.width === clampedNextWidth) return prevSize;
|
|
441
|
+
return {
|
|
442
|
+
width: clampedNextWidth,
|
|
443
|
+
height: clampedNextHeight
|
|
444
|
+
};
|
|
445
|
+
});
|
|
446
|
+
if (scrollbarYEl && thumbYEl) {
|
|
447
|
+
const maxThumbOffsetY = scrollbarYEl.offsetHeight - clampedNextHeight - scrollbarYOffset - thumbYOffset;
|
|
448
|
+
const scrollRangeY = scrollableContentHeight - viewportHeight;
|
|
449
|
+
const scrollRatioY = 0 === scrollRangeY ? 0 : scrollTop / scrollRangeY;
|
|
450
|
+
const thumbOffsetY = Math.min(maxThumbOffsetY, Math.max(0, scrollRatioY * maxThumbOffsetY));
|
|
451
|
+
thumbYEl.style.transform = `translate3d(0,${thumbOffsetY}px,0)`;
|
|
452
|
+
}
|
|
453
|
+
if (scrollbarXEl && thumbXEl) {
|
|
454
|
+
const maxThumbOffsetX = scrollbarXEl.offsetWidth - clampedNextWidth - scrollbarXOffset - thumbXOffset;
|
|
455
|
+
const scrollRangeX = scrollableContentWidth - viewportWidth;
|
|
456
|
+
const scrollRatioX = 0 === scrollRangeX ? 0 : scrollLeft / scrollRangeX;
|
|
457
|
+
const thumbOffsetX = 'rtl' === direction ? clamp(scrollRatioX * maxThumbOffsetX, -maxThumbOffsetX, 0) : clamp(scrollRatioX * maxThumbOffsetX, 0, maxThumbOffsetX);
|
|
458
|
+
thumbXEl.style.transform = `translate3d(${thumbOffsetX}px,0,0)`;
|
|
459
|
+
}
|
|
460
|
+
const overflowMetricsPx = [
|
|
461
|
+
[
|
|
462
|
+
ScrollAreaViewportCssVars_ScrollAreaViewportCssVars.scrollAreaOverflowXStart,
|
|
463
|
+
scrollLeftFromStart
|
|
464
|
+
],
|
|
465
|
+
[
|
|
466
|
+
ScrollAreaViewportCssVars_ScrollAreaViewportCssVars.scrollAreaOverflowXEnd,
|
|
467
|
+
scrollLeftFromEnd
|
|
468
|
+
],
|
|
469
|
+
[
|
|
470
|
+
ScrollAreaViewportCssVars_ScrollAreaViewportCssVars.scrollAreaOverflowYStart,
|
|
471
|
+
scrollTopFromStart
|
|
472
|
+
],
|
|
473
|
+
[
|
|
474
|
+
ScrollAreaViewportCssVars_ScrollAreaViewportCssVars.scrollAreaOverflowYEnd,
|
|
475
|
+
scrollTopFromEnd
|
|
476
|
+
]
|
|
477
|
+
];
|
|
478
|
+
for (const [cssVar, value] of overflowMetricsPx)viewportEl.style.setProperty(cssVar, `${value}px`);
|
|
479
|
+
if (cornerEl) {
|
|
480
|
+
if (scrollbarXHidden || scrollbarYHidden) setCornerSize({
|
|
481
|
+
width: 0,
|
|
482
|
+
height: 0
|
|
483
|
+
});
|
|
484
|
+
else if (!scrollbarXHidden && !scrollbarYHidden) setCornerSize({
|
|
485
|
+
width: nextCornerWidth,
|
|
486
|
+
height: nextCornerHeight
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
setHiddenState((prevState)=>mergeHiddenState(prevState, nextHiddenState));
|
|
490
|
+
const nextOverflowEdges = {
|
|
491
|
+
xStart: !scrollbarXHidden && scrollLeftFromStart > overflowEdgeThreshold.xStart,
|
|
492
|
+
xEnd: !scrollbarXHidden && scrollLeftFromEnd > overflowEdgeThreshold.xEnd,
|
|
493
|
+
yStart: !scrollbarYHidden && scrollTopFromStart > overflowEdgeThreshold.yStart,
|
|
494
|
+
yEnd: !scrollbarYHidden && scrollTopFromEnd > overflowEdgeThreshold.yEnd
|
|
495
|
+
};
|
|
496
|
+
setOverflowEdges((prev)=>{
|
|
497
|
+
if (prev.xStart === nextOverflowEdges.xStart && prev.xEnd === nextOverflowEdges.xEnd && prev.yStart === nextOverflowEdges.yStart && prev.yEnd === nextOverflowEdges.yEnd) return prev;
|
|
498
|
+
return nextOverflowEdges;
|
|
499
|
+
});
|
|
500
|
+
});
|
|
501
|
+
useIsoLayoutEffect(()=>{
|
|
502
|
+
if (!viewportRef.current) return;
|
|
503
|
+
removeCSSVariableInheritance();
|
|
504
|
+
}, [
|
|
505
|
+
viewportRef
|
|
506
|
+
]);
|
|
507
|
+
useIsoLayoutEffect(()=>{
|
|
508
|
+
queueMicrotask(computeThumbPosition);
|
|
509
|
+
}, [
|
|
510
|
+
computeThumbPosition,
|
|
511
|
+
hiddenState,
|
|
512
|
+
direction
|
|
513
|
+
]);
|
|
514
|
+
useIsoLayoutEffect(()=>{
|
|
515
|
+
if (viewportRef.current?.matches(':hover')) setHovering(true);
|
|
516
|
+
}, [
|
|
517
|
+
viewportRef,
|
|
518
|
+
setHovering
|
|
519
|
+
]);
|
|
520
|
+
__rspack_external_react.useEffect(()=>{
|
|
521
|
+
const viewport = viewportRef.current;
|
|
522
|
+
if ("u" < typeof ResizeObserver || !viewport) return;
|
|
523
|
+
let hasInitialized = false;
|
|
524
|
+
const resizeObserver = new ResizeObserver(()=>{
|
|
525
|
+
if (!hasInitialized) {
|
|
526
|
+
hasInitialized = true;
|
|
527
|
+
const lastMeasuredViewportMetrics = lastMeasuredViewportMetricsRef.current;
|
|
528
|
+
if (lastMeasuredViewportMetrics[0] === viewport.clientHeight && lastMeasuredViewportMetrics[1] === viewport.scrollHeight && lastMeasuredViewportMetrics[2] === viewport.clientWidth && lastMeasuredViewportMetrics[3] === viewport.scrollWidth) return;
|
|
529
|
+
}
|
|
530
|
+
computeThumbPosition();
|
|
531
|
+
});
|
|
532
|
+
resizeObserver.observe(viewport);
|
|
533
|
+
waitForAnimationsTimeout.start(0, ()=>{
|
|
534
|
+
const animations = viewport.getAnimations({
|
|
535
|
+
subtree: true
|
|
536
|
+
});
|
|
537
|
+
if (0 === animations.length) return;
|
|
538
|
+
Promise.allSettled(animations.map((animation)=>animation.finished)).then(computeThumbPosition).catch(()=>{});
|
|
539
|
+
});
|
|
540
|
+
return ()=>{
|
|
541
|
+
resizeObserver.disconnect();
|
|
542
|
+
waitForAnimationsTimeout.clear();
|
|
543
|
+
};
|
|
544
|
+
}, [
|
|
545
|
+
computeThumbPosition,
|
|
546
|
+
viewportRef,
|
|
547
|
+
waitForAnimationsTimeout
|
|
548
|
+
]);
|
|
549
|
+
function handleUserInteraction() {
|
|
550
|
+
programmaticScrollRef.current = false;
|
|
551
|
+
}
|
|
552
|
+
const props = {
|
|
553
|
+
role: 'presentation',
|
|
554
|
+
...rootId && {
|
|
555
|
+
'data-id': `${rootId}-viewport`
|
|
556
|
+
},
|
|
557
|
+
tabIndex: hiddenState.x && hiddenState.y ? -1 : 0,
|
|
558
|
+
className: styleDisableScrollbar.className,
|
|
559
|
+
style: {
|
|
560
|
+
overflow: 'scroll'
|
|
561
|
+
},
|
|
562
|
+
onScroll () {
|
|
563
|
+
if (!viewportRef.current) return;
|
|
564
|
+
computeThumbPosition();
|
|
565
|
+
if (!programmaticScrollRef.current) handleScroll({
|
|
566
|
+
x: viewportRef.current.scrollLeft,
|
|
567
|
+
y: viewportRef.current.scrollTop
|
|
568
|
+
});
|
|
569
|
+
scrollEndTimeout.start(100, ()=>{
|
|
570
|
+
programmaticScrollRef.current = true;
|
|
571
|
+
});
|
|
572
|
+
},
|
|
573
|
+
onWheel: handleUserInteraction,
|
|
574
|
+
onTouchMove: handleUserInteraction,
|
|
575
|
+
onPointerMove: handleUserInteraction,
|
|
576
|
+
onPointerEnter: handleUserInteraction,
|
|
577
|
+
onKeyDown: handleUserInteraction
|
|
578
|
+
};
|
|
579
|
+
const viewportState = __rspack_external_react.useMemo(()=>({
|
|
580
|
+
scrolling: scrollingX || scrollingY,
|
|
581
|
+
hasOverflowX: !hiddenState.x,
|
|
582
|
+
hasOverflowY: !hiddenState.y,
|
|
583
|
+
overflowXStart: overflowEdges.xStart,
|
|
584
|
+
overflowXEnd: overflowEdges.xEnd,
|
|
585
|
+
overflowYStart: overflowEdges.yStart,
|
|
586
|
+
overflowYEnd: overflowEdges.yEnd,
|
|
587
|
+
cornerHidden: hiddenState.corner
|
|
588
|
+
}), [
|
|
589
|
+
scrollingX,
|
|
590
|
+
scrollingY,
|
|
591
|
+
hiddenState.x,
|
|
592
|
+
hiddenState.y,
|
|
593
|
+
hiddenState.corner,
|
|
594
|
+
overflowEdges
|
|
595
|
+
]);
|
|
596
|
+
const element = useRenderElement('div', componentProps, {
|
|
597
|
+
ref: [
|
|
598
|
+
forwardedRef,
|
|
599
|
+
viewportRef
|
|
600
|
+
],
|
|
601
|
+
state: viewportState,
|
|
602
|
+
props: [
|
|
603
|
+
props,
|
|
604
|
+
elementProps
|
|
605
|
+
],
|
|
606
|
+
stateAttributesMapping: scrollAreaStateAttributesMapping
|
|
607
|
+
});
|
|
608
|
+
const contextValue = __rspack_external_react.useMemo(()=>({
|
|
609
|
+
computeThumbPosition
|
|
610
|
+
}), [
|
|
611
|
+
computeThumbPosition
|
|
612
|
+
]);
|
|
613
|
+
return /*#__PURE__*/ jsx(ScrollAreaViewportContext.Provider, {
|
|
614
|
+
value: contextValue,
|
|
615
|
+
children: element
|
|
616
|
+
});
|
|
617
|
+
});
|
|
618
|
+
if ("production" !== process.env.NODE_ENV) ScrollAreaViewport_ScrollAreaViewport.displayName = "ScrollAreaViewport";
|
|
619
|
+
function getHiddenState(viewport) {
|
|
620
|
+
const y = viewport.clientHeight >= viewport.scrollHeight;
|
|
621
|
+
const x = viewport.clientWidth >= viewport.scrollWidth;
|
|
622
|
+
return {
|
|
623
|
+
y,
|
|
624
|
+
x,
|
|
625
|
+
corner: y || x
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
function mergeHiddenState(prevState, nextState) {
|
|
629
|
+
if (prevState.y === nextState.y && prevState.x === nextState.x && prevState.corner === nextState.corner) return prevState;
|
|
630
|
+
return nextState;
|
|
631
|
+
}
|
|
632
|
+
const ScrollAreaScrollbarContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
|
|
633
|
+
if ("production" !== process.env.NODE_ENV) ScrollAreaScrollbarContext.displayName = "ScrollAreaScrollbarContext";
|
|
634
|
+
function useScrollAreaScrollbarContext() {
|
|
635
|
+
const context = __rspack_external_react.useContext(ScrollAreaScrollbarContext);
|
|
636
|
+
if (void 0 === context) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: ScrollAreaScrollbarContext is missing. ScrollAreaScrollbar parts must be placed within <ScrollArea.Scrollbar>.' : esm_formatErrorMessage(54));
|
|
637
|
+
return context;
|
|
638
|
+
}
|
|
639
|
+
let ScrollAreaScrollbarCssVars_ScrollAreaScrollbarCssVars = /*#__PURE__*/ function(ScrollAreaScrollbarCssVars) {
|
|
640
|
+
ScrollAreaScrollbarCssVars["scrollAreaThumbHeight"] = "--scroll-area-thumb-height";
|
|
641
|
+
ScrollAreaScrollbarCssVars["scrollAreaThumbWidth"] = "--scroll-area-thumb-width";
|
|
642
|
+
return ScrollAreaScrollbarCssVars;
|
|
643
|
+
}({});
|
|
644
|
+
const ScrollAreaScrollbar_ScrollAreaScrollbar = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
645
|
+
const { render, className, orientation = 'vertical', keepMounted = false, style, ...elementProps } = componentProps;
|
|
646
|
+
const { hovering, scrollingX, scrollingY, hiddenState, overflowEdges, scrollbarYRef, scrollbarXRef, viewportRef, thumbYRef, thumbXRef, handlePointerDown, handlePointerUp, rootId, thumbSize, hasMeasuredScrollbar } = useScrollAreaRootContext();
|
|
647
|
+
const state = {
|
|
648
|
+
hovering,
|
|
649
|
+
scrolling: {
|
|
650
|
+
horizontal: scrollingX,
|
|
651
|
+
vertical: scrollingY
|
|
652
|
+
}[orientation],
|
|
653
|
+
orientation,
|
|
654
|
+
hasOverflowX: !hiddenState.x,
|
|
655
|
+
hasOverflowY: !hiddenState.y,
|
|
656
|
+
overflowXStart: overflowEdges.xStart,
|
|
657
|
+
overflowXEnd: overflowEdges.xEnd,
|
|
658
|
+
overflowYStart: overflowEdges.yStart,
|
|
659
|
+
overflowYEnd: overflowEdges.yEnd,
|
|
660
|
+
cornerHidden: hiddenState.corner
|
|
661
|
+
};
|
|
662
|
+
const direction = useDirection();
|
|
663
|
+
const hideTrackUntilMeasured = !hasMeasuredScrollbar && !keepMounted;
|
|
664
|
+
const isHidden = 'vertical' === orientation ? hiddenState.y : hiddenState.x;
|
|
665
|
+
const shouldRender = keepMounted || !isHidden;
|
|
666
|
+
__rspack_external_react.useEffect(()=>{
|
|
667
|
+
if (!shouldRender) return;
|
|
668
|
+
const viewportEl = viewportRef.current;
|
|
669
|
+
const scrollbarEl = 'vertical' === orientation ? scrollbarYRef.current : scrollbarXRef.current;
|
|
670
|
+
if (!scrollbarEl) return;
|
|
671
|
+
function handleWheel(event) {
|
|
672
|
+
if (!viewportEl || !scrollbarEl || event.ctrlKey) return;
|
|
673
|
+
event.preventDefault();
|
|
674
|
+
const horizontal = 'horizontal' === orientation;
|
|
675
|
+
const scrollProperty = horizontal ? 'scrollLeft' : 'scrollTop';
|
|
676
|
+
const delta = horizontal ? event.deltaX : event.deltaY;
|
|
677
|
+
const maxScroll = horizontal ? viewportEl.scrollWidth - viewportEl.clientWidth : viewportEl.scrollHeight - viewportEl.clientHeight;
|
|
678
|
+
const minScroll = horizontal && 'rtl' === direction ? -maxScroll : 0;
|
|
679
|
+
const maxScrollValue = horizontal && 'rtl' === direction ? 0 : maxScroll;
|
|
680
|
+
const scrollValue = viewportEl[scrollProperty];
|
|
681
|
+
if (scrollValue <= minScroll && delta < 0 || scrollValue >= maxScrollValue && delta > 0) return;
|
|
682
|
+
viewportEl[scrollProperty] = Math.min(maxScrollValue, Math.max(minScroll, scrollValue + delta));
|
|
683
|
+
}
|
|
684
|
+
return addEventListener(scrollbarEl, 'wheel', handleWheel, {
|
|
685
|
+
passive: false
|
|
686
|
+
});
|
|
687
|
+
}, [
|
|
688
|
+
direction,
|
|
689
|
+
orientation,
|
|
690
|
+
scrollbarXRef,
|
|
691
|
+
scrollbarYRef,
|
|
692
|
+
shouldRender,
|
|
693
|
+
viewportRef
|
|
694
|
+
]);
|
|
695
|
+
const props = {
|
|
696
|
+
...rootId && {
|
|
697
|
+
'data-id': `${rootId}-scrollbar`
|
|
698
|
+
},
|
|
699
|
+
onPointerDown (event) {
|
|
700
|
+
if (0 !== event.button) return;
|
|
701
|
+
const target = getTarget(event.nativeEvent);
|
|
702
|
+
const thumb = 'vertical' === orientation ? thumbYRef.current : thumbXRef.current;
|
|
703
|
+
if (thumb && contains(thumb, target)) return;
|
|
704
|
+
if (!viewportRef.current) return;
|
|
705
|
+
if (thumbYRef.current && scrollbarYRef.current && 'vertical' === orientation) {
|
|
706
|
+
const thumbYOffset = getOffset(thumbYRef.current, 'margin', 'y');
|
|
707
|
+
const scrollbarYOffset = getOffset(scrollbarYRef.current, 'padding', 'y');
|
|
708
|
+
const thumbHeight = thumbYRef.current.offsetHeight;
|
|
709
|
+
const trackRectY = scrollbarYRef.current.getBoundingClientRect();
|
|
710
|
+
const clickY = event.clientY - trackRectY.top - thumbHeight / 2 - scrollbarYOffset + thumbYOffset / 2;
|
|
711
|
+
const scrollableContentHeight = viewportRef.current.scrollHeight;
|
|
712
|
+
const viewportHeight = viewportRef.current.clientHeight;
|
|
713
|
+
const maxThumbOffsetY = scrollbarYRef.current.offsetHeight - thumbHeight - scrollbarYOffset - thumbYOffset;
|
|
714
|
+
const scrollRatioY = clickY / maxThumbOffsetY;
|
|
715
|
+
const newScrollTop = scrollRatioY * (scrollableContentHeight - viewportHeight);
|
|
716
|
+
viewportRef.current.scrollTop = newScrollTop;
|
|
717
|
+
}
|
|
718
|
+
if (thumbXRef.current && scrollbarXRef.current && 'horizontal' === orientation) {
|
|
719
|
+
const thumbXOffset = getOffset(thumbXRef.current, 'margin', 'x');
|
|
720
|
+
const scrollbarXOffset = getOffset(scrollbarXRef.current, 'padding', 'x');
|
|
721
|
+
const thumbWidth = thumbXRef.current.offsetWidth;
|
|
722
|
+
const trackRectX = scrollbarXRef.current.getBoundingClientRect();
|
|
723
|
+
const clickX = event.clientX - trackRectX.left - thumbWidth / 2 - scrollbarXOffset + thumbXOffset / 2;
|
|
724
|
+
const scrollableContentWidth = viewportRef.current.scrollWidth;
|
|
725
|
+
const viewportWidth = viewportRef.current.clientWidth;
|
|
726
|
+
const maxThumbOffsetX = scrollbarXRef.current.offsetWidth - thumbWidth - scrollbarXOffset - thumbXOffset;
|
|
727
|
+
const scrollRatioX = clickX / maxThumbOffsetX;
|
|
728
|
+
let newScrollLeft;
|
|
729
|
+
if ('rtl' === direction) {
|
|
730
|
+
newScrollLeft = (1 - scrollRatioX) * (scrollableContentWidth - viewportWidth);
|
|
731
|
+
if (viewportRef.current.scrollLeft <= 0) newScrollLeft = -newScrollLeft;
|
|
732
|
+
} else newScrollLeft = scrollRatioX * (scrollableContentWidth - viewportWidth);
|
|
733
|
+
viewportRef.current.scrollLeft = newScrollLeft;
|
|
734
|
+
}
|
|
735
|
+
handlePointerDown(event);
|
|
736
|
+
},
|
|
737
|
+
onPointerUp: handlePointerUp,
|
|
738
|
+
style: {
|
|
739
|
+
position: 'absolute',
|
|
740
|
+
touchAction: 'none',
|
|
741
|
+
WebkitUserSelect: 'none',
|
|
742
|
+
userSelect: 'none',
|
|
743
|
+
visibility: hideTrackUntilMeasured ? 'hidden' : void 0,
|
|
744
|
+
...'vertical' === orientation && {
|
|
745
|
+
top: 0,
|
|
746
|
+
bottom: `var(${ScrollAreaRootCssVars_ScrollAreaRootCssVars.scrollAreaCornerHeight})`,
|
|
747
|
+
insetInlineEnd: 0,
|
|
748
|
+
[ScrollAreaScrollbarCssVars_ScrollAreaScrollbarCssVars.scrollAreaThumbHeight]: `${thumbSize.height}px`
|
|
749
|
+
},
|
|
750
|
+
...'horizontal' === orientation && {
|
|
751
|
+
insetInlineStart: 0,
|
|
752
|
+
insetInlineEnd: `var(${ScrollAreaRootCssVars_ScrollAreaRootCssVars.scrollAreaCornerWidth})`,
|
|
753
|
+
bottom: 0,
|
|
754
|
+
[ScrollAreaScrollbarCssVars_ScrollAreaScrollbarCssVars.scrollAreaThumbWidth]: `${thumbSize.width}px`
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
};
|
|
758
|
+
const element = useRenderElement('div', componentProps, {
|
|
759
|
+
ref: [
|
|
760
|
+
forwardedRef,
|
|
761
|
+
'vertical' === orientation ? scrollbarYRef : scrollbarXRef
|
|
762
|
+
],
|
|
763
|
+
state,
|
|
764
|
+
props: [
|
|
765
|
+
props,
|
|
766
|
+
elementProps
|
|
767
|
+
],
|
|
768
|
+
stateAttributesMapping: scrollAreaStateAttributesMapping
|
|
769
|
+
});
|
|
770
|
+
const contextValue = __rspack_external_react.useMemo(()=>({
|
|
771
|
+
orientation
|
|
772
|
+
}), [
|
|
773
|
+
orientation
|
|
774
|
+
]);
|
|
775
|
+
if (!shouldRender) return null;
|
|
776
|
+
return /*#__PURE__*/ jsx(ScrollAreaScrollbarContext.Provider, {
|
|
777
|
+
value: contextValue,
|
|
778
|
+
children: element
|
|
779
|
+
});
|
|
780
|
+
});
|
|
781
|
+
if ("production" !== process.env.NODE_ENV) ScrollAreaScrollbar_ScrollAreaScrollbar.displayName = "ScrollAreaScrollbar";
|
|
782
|
+
const ScrollAreaContent_ScrollAreaContent = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
783
|
+
const { render, className, style, ...elementProps } = componentProps;
|
|
784
|
+
const { computeThumbPosition } = useScrollAreaViewportContext();
|
|
785
|
+
const { viewportState } = useScrollAreaRootContext();
|
|
786
|
+
const contentWrapperRef = __rspack_external_react.useRef(null);
|
|
787
|
+
useIsoLayoutEffect(()=>{
|
|
788
|
+
if ("u" < typeof ResizeObserver) return;
|
|
789
|
+
let hasInitialized = false;
|
|
790
|
+
const resizeObserver = new ResizeObserver(()=>{
|
|
791
|
+
if (!hasInitialized) {
|
|
792
|
+
hasInitialized = true;
|
|
793
|
+
return;
|
|
794
|
+
}
|
|
795
|
+
computeThumbPosition();
|
|
796
|
+
});
|
|
797
|
+
if (contentWrapperRef.current) resizeObserver.observe(contentWrapperRef.current);
|
|
798
|
+
return ()=>{
|
|
799
|
+
resizeObserver.disconnect();
|
|
800
|
+
};
|
|
801
|
+
}, [
|
|
802
|
+
computeThumbPosition
|
|
803
|
+
]);
|
|
804
|
+
const element = useRenderElement('div', componentProps, {
|
|
805
|
+
ref: [
|
|
806
|
+
forwardedRef,
|
|
807
|
+
contentWrapperRef
|
|
808
|
+
],
|
|
809
|
+
state: viewportState,
|
|
810
|
+
stateAttributesMapping: scrollAreaStateAttributesMapping,
|
|
811
|
+
props: [
|
|
812
|
+
{
|
|
813
|
+
role: 'presentation',
|
|
814
|
+
style: {
|
|
815
|
+
minWidth: 'fit-content'
|
|
816
|
+
}
|
|
817
|
+
},
|
|
818
|
+
elementProps
|
|
819
|
+
]
|
|
820
|
+
});
|
|
821
|
+
return element;
|
|
822
|
+
});
|
|
823
|
+
if ("production" !== process.env.NODE_ENV) ScrollAreaContent_ScrollAreaContent.displayName = "ScrollAreaContent";
|
|
824
|
+
const ScrollAreaThumb_ScrollAreaThumb = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
825
|
+
const { render, className, style, ...elementProps } = componentProps;
|
|
826
|
+
const { thumbYRef, thumbXRef, handlePointerDown, handlePointerMove, handlePointerUp, setScrollingX, setScrollingY, hasMeasuredScrollbar } = useScrollAreaRootContext();
|
|
827
|
+
const { orientation } = useScrollAreaScrollbarContext();
|
|
828
|
+
const state = {
|
|
829
|
+
orientation
|
|
830
|
+
};
|
|
831
|
+
const element = useRenderElement('div', componentProps, {
|
|
832
|
+
ref: [
|
|
833
|
+
forwardedRef,
|
|
834
|
+
'vertical' === orientation ? thumbYRef : thumbXRef
|
|
835
|
+
],
|
|
836
|
+
state,
|
|
837
|
+
props: [
|
|
838
|
+
{
|
|
839
|
+
onPointerDown: handlePointerDown,
|
|
840
|
+
onPointerMove: handlePointerMove,
|
|
841
|
+
onPointerUp (event) {
|
|
842
|
+
if ('vertical' === orientation) setScrollingY(false);
|
|
843
|
+
if ('horizontal' === orientation) setScrollingX(false);
|
|
844
|
+
handlePointerUp(event);
|
|
845
|
+
},
|
|
846
|
+
style: {
|
|
847
|
+
visibility: hasMeasuredScrollbar ? void 0 : 'hidden',
|
|
848
|
+
...'vertical' === orientation && {
|
|
849
|
+
height: `var(${ScrollAreaScrollbarCssVars_ScrollAreaScrollbarCssVars.scrollAreaThumbHeight})`
|
|
850
|
+
},
|
|
851
|
+
...'horizontal' === orientation && {
|
|
852
|
+
width: `var(${ScrollAreaScrollbarCssVars_ScrollAreaScrollbarCssVars.scrollAreaThumbWidth})`
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
},
|
|
856
|
+
elementProps
|
|
857
|
+
]
|
|
858
|
+
});
|
|
859
|
+
return element;
|
|
860
|
+
});
|
|
861
|
+
if ("production" !== process.env.NODE_ENV) ScrollAreaThumb_ScrollAreaThumb.displayName = "ScrollAreaThumb";
|
|
862
|
+
const ScrollAreaCorner_ScrollAreaCorner = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
863
|
+
const { render, className, style, ...elementProps } = componentProps;
|
|
864
|
+
const { cornerRef, cornerSize, hiddenState } = useScrollAreaRootContext();
|
|
865
|
+
const element = useRenderElement('div', componentProps, {
|
|
866
|
+
ref: [
|
|
867
|
+
forwardedRef,
|
|
868
|
+
cornerRef
|
|
869
|
+
],
|
|
870
|
+
props: [
|
|
871
|
+
{
|
|
872
|
+
style: {
|
|
873
|
+
position: 'absolute',
|
|
874
|
+
bottom: 0,
|
|
875
|
+
insetInlineEnd: 0,
|
|
876
|
+
width: cornerSize.width,
|
|
877
|
+
height: cornerSize.height
|
|
878
|
+
}
|
|
879
|
+
},
|
|
880
|
+
elementProps
|
|
881
|
+
]
|
|
882
|
+
});
|
|
883
|
+
if (hiddenState.corner) return null;
|
|
884
|
+
return element;
|
|
885
|
+
});
|
|
886
|
+
if ("production" !== process.env.NODE_ENV) ScrollAreaCorner_ScrollAreaCorner.displayName = "ScrollAreaCorner";
|
|
5
887
|
const ScrollArea_module = {
|
|
6
888
|
root: "root-_9VjLl",
|
|
7
889
|
viewport: "viewport-AtdxVk",
|
|
8
890
|
scrollbar: "scrollbar-NftRcM",
|
|
9
891
|
thumb: "thumb-qKKUxU"
|
|
10
892
|
};
|
|
11
|
-
const Root = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(
|
|
893
|
+
const Root = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(ScrollAreaRoot_ScrollAreaRoot, {
|
|
12
894
|
ref: ref,
|
|
13
895
|
className: clsx(ScrollArea_module.root, className),
|
|
14
896
|
...props
|
|
15
897
|
}));
|
|
16
|
-
const Viewport = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(
|
|
898
|
+
const Viewport = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(ScrollAreaViewport_ScrollAreaViewport, {
|
|
17
899
|
ref: ref,
|
|
18
900
|
className: clsx(ScrollArea_module.viewport, className),
|
|
19
901
|
...props
|
|
20
902
|
}));
|
|
21
|
-
const Scrollbar = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(
|
|
903
|
+
const Scrollbar = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(ScrollAreaScrollbar_ScrollAreaScrollbar, {
|
|
22
904
|
ref: ref,
|
|
23
905
|
className: clsx(ScrollArea_module.scrollbar, className),
|
|
24
906
|
...props
|
|
25
907
|
}));
|
|
26
|
-
const Content = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(
|
|
908
|
+
const Content = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(ScrollAreaContent_ScrollAreaContent, {
|
|
27
909
|
ref: ref,
|
|
28
910
|
className: clsx(ScrollArea_module.content, className),
|
|
29
911
|
...props
|
|
30
912
|
}));
|
|
31
|
-
const Thumb = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(
|
|
913
|
+
const Thumb = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(ScrollAreaThumb_ScrollAreaThumb, {
|
|
32
914
|
ref: ref,
|
|
33
915
|
className: clsx(ScrollArea_module.thumb, className),
|
|
34
916
|
...props
|
|
35
917
|
}));
|
|
36
|
-
const Corner = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(
|
|
918
|
+
const Corner = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(ScrollAreaCorner_ScrollAreaCorner, {
|
|
37
919
|
ref: ref,
|
|
38
920
|
className: clsx(ScrollArea_module.corner, className),
|
|
39
921
|
...props
|
|
40
922
|
}));
|
|
41
|
-
const
|
|
923
|
+
const ScrollArea = {
|
|
42
924
|
Root: Root,
|
|
43
925
|
Viewport: Viewport,
|
|
44
926
|
Scrollbar: Scrollbar,
|
|
@@ -46,4 +928,4 @@ const ScrollArea_ScrollArea = {
|
|
|
46
928
|
Thumb: Thumb,
|
|
47
929
|
Corner: Corner
|
|
48
930
|
};
|
|
49
|
-
export {
|
|
931
|
+
export { ScrollArea };
|