lizaui 6.0.8 → 7.0.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/chunks/index-BydcKEwP.js +2 -0
- package/dist/chunks/index-BydcKEwP.js.map +1 -0
- package/dist/chunks/index-ybbFyaIJ.js +87 -0
- package/dist/chunks/index-ybbFyaIJ.js.map +1 -0
- package/dist/chunks/scroll-area-BM9h23ua.js +556 -0
- package/dist/chunks/scroll-area-BM9h23ua.js.map +1 -0
- package/dist/chunks/scroll-area-DIX2F6c9.js +2 -0
- package/dist/chunks/scroll-area-DIX2F6c9.js.map +1 -0
- package/dist/chunks/select-4dF9GyBV.js +2 -0
- package/dist/chunks/select-4dF9GyBV.js.map +1 -0
- package/dist/chunks/{select-KroYdQPb.js → select-BeerOZNC.js} +132 -143
- package/dist/chunks/select-BeerOZNC.js.map +1 -0
- package/dist/chunks/{textarea-ClUh9LtQ.js → textarea-9E0vAKDj.js} +9 -9
- package/dist/chunks/{textarea-ClUh9LtQ.js.map → textarea-9E0vAKDj.js.map} +1 -1
- package/dist/components/phone-input/phone-input.d.ts.map +1 -1
- package/dist/pagination/index.cjs.js +1 -1
- package/dist/pagination/index.es.js +2 -2
- package/dist/phone-input/index.cjs.js +14 -14
- package/dist/phone-input/index.cjs.js.map +1 -1
- package/dist/phone-input/index.es.js +680 -662
- package/dist/phone-input/index.es.js.map +1 -1
- package/dist/time-input/index.es.js +1 -1
- package/dist/ui/index.cjs.js +4 -4
- package/dist/ui/index.cjs.js.map +1 -1
- package/dist/ui/index.es.js +2536 -3075
- package/dist/ui/index.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/chevron-down-BJdjIpSS.js +0 -2
- package/dist/chunks/chevron-down-BJdjIpSS.js.map +0 -1
- package/dist/chunks/chevron-down-BarFwo2L.js +0 -75
- package/dist/chunks/chevron-down-BarFwo2L.js.map +0 -1
- package/dist/chunks/search-BUtVV_ij.js +0 -2
- package/dist/chunks/search-BUtVV_ij.js.map +0 -1
- package/dist/chunks/search-YTvzxtJf.js +0 -9
- package/dist/chunks/search-YTvzxtJf.js.map +0 -1
- package/dist/chunks/select-BBV4-uzN.js +0 -2
- package/dist/chunks/select-BBV4-uzN.js.map +0 -1
- package/dist/chunks/select-KroYdQPb.js.map +0 -1
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
import { c as ce, u as se, a as ae } from "./index-ybbFyaIJ.js";
|
|
2
|
+
import { j as f } from "./jsx-runtime-Cl_4eDuT.js";
|
|
3
|
+
import * as c from "react";
|
|
4
|
+
import { c as ie, P as _, a as O, b as C, u as P, d as de } from "./textarea-9E0vAKDj.js";
|
|
5
|
+
import { u as A } from "./index-Do-g2tEs.js";
|
|
6
|
+
import { c as F } from "./utils-BFAOD39w.js";
|
|
7
|
+
const ue = [
|
|
8
|
+
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
9
|
+
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
10
|
+
], Ne = ce("search", ue);
|
|
11
|
+
function he(e, o) {
|
|
12
|
+
return c.useReducer((r, l) => o[r][l] ?? r, e);
|
|
13
|
+
}
|
|
14
|
+
var U = "ScrollArea", [$, We] = ie(U), [fe, v] = $(U), q = c.forwardRef(
|
|
15
|
+
(e, o) => {
|
|
16
|
+
const {
|
|
17
|
+
__scopeScrollArea: r,
|
|
18
|
+
type: l = "hover",
|
|
19
|
+
dir: t,
|
|
20
|
+
scrollHideDelay: n = 600,
|
|
21
|
+
...s
|
|
22
|
+
} = e, [a, i] = c.useState(null), [h, d] = c.useState(null), [b, u] = c.useState(null), [S, w] = c.useState(null), [T, Y] = c.useState(null), [x, L] = c.useState(0), [M, j] = c.useState(0), [D, y] = c.useState(!1), [N, W] = c.useState(!1), m = A(o, (R) => i(R)), p = se(t);
|
|
23
|
+
return /* @__PURE__ */ f.jsx(
|
|
24
|
+
fe,
|
|
25
|
+
{
|
|
26
|
+
scope: r,
|
|
27
|
+
type: l,
|
|
28
|
+
dir: p,
|
|
29
|
+
scrollHideDelay: n,
|
|
30
|
+
scrollArea: a,
|
|
31
|
+
viewport: h,
|
|
32
|
+
onViewportChange: d,
|
|
33
|
+
content: b,
|
|
34
|
+
onContentChange: u,
|
|
35
|
+
scrollbarX: S,
|
|
36
|
+
onScrollbarXChange: w,
|
|
37
|
+
scrollbarXEnabled: D,
|
|
38
|
+
onScrollbarXEnabledChange: y,
|
|
39
|
+
scrollbarY: T,
|
|
40
|
+
onScrollbarYChange: Y,
|
|
41
|
+
scrollbarYEnabled: N,
|
|
42
|
+
onScrollbarYEnabledChange: W,
|
|
43
|
+
onCornerWidthChange: L,
|
|
44
|
+
onCornerHeightChange: j,
|
|
45
|
+
children: /* @__PURE__ */ f.jsx(
|
|
46
|
+
_.div,
|
|
47
|
+
{
|
|
48
|
+
dir: p,
|
|
49
|
+
...s,
|
|
50
|
+
ref: m,
|
|
51
|
+
style: {
|
|
52
|
+
position: "relative",
|
|
53
|
+
// Pass corner sizes as CSS vars to reduce re-renders of context consumers
|
|
54
|
+
"--radix-scroll-area-corner-width": x + "px",
|
|
55
|
+
"--radix-scroll-area-corner-height": M + "px",
|
|
56
|
+
...e.style
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
q.displayName = U;
|
|
65
|
+
var G = "ScrollAreaViewport", J = c.forwardRef(
|
|
66
|
+
(e, o) => {
|
|
67
|
+
const { __scopeScrollArea: r, children: l, nonce: t, ...n } = e, s = v(G, r), a = c.useRef(null), i = A(o, a, s.onViewportChange);
|
|
68
|
+
return /* @__PURE__ */ f.jsxs(f.Fragment, { children: [
|
|
69
|
+
/* @__PURE__ */ f.jsx(
|
|
70
|
+
"style",
|
|
71
|
+
{
|
|
72
|
+
dangerouslySetInnerHTML: {
|
|
73
|
+
__html: "[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"
|
|
74
|
+
},
|
|
75
|
+
nonce: t
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ f.jsx(
|
|
79
|
+
_.div,
|
|
80
|
+
{
|
|
81
|
+
"data-radix-scroll-area-viewport": "",
|
|
82
|
+
...n,
|
|
83
|
+
ref: i,
|
|
84
|
+
style: {
|
|
85
|
+
/**
|
|
86
|
+
* We don't support `visible` because the intention is to have at least one scrollbar
|
|
87
|
+
* if this component is used and `visible` will behave like `auto` in that case
|
|
88
|
+
* https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description
|
|
89
|
+
*
|
|
90
|
+
* We don't handle `auto` because the intention is for the native implementation
|
|
91
|
+
* to be hidden if using this component. We just want to ensure the node is scrollable
|
|
92
|
+
* so could have used either `scroll` or `auto` here. We picked `scroll` to prevent
|
|
93
|
+
* the browser from having to work out whether to render native scrollbars or not,
|
|
94
|
+
* we tell it to with the intention of hiding them in CSS.
|
|
95
|
+
*/
|
|
96
|
+
overflowX: s.scrollbarXEnabled ? "scroll" : "hidden",
|
|
97
|
+
overflowY: s.scrollbarYEnabled ? "scroll" : "hidden",
|
|
98
|
+
...e.style
|
|
99
|
+
},
|
|
100
|
+
children: /* @__PURE__ */ f.jsx("div", { ref: s.onContentChange, style: { minWidth: "100%", display: "table" }, children: l })
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
] });
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
J.displayName = G;
|
|
107
|
+
var g = "ScrollAreaScrollbar", K = c.forwardRef(
|
|
108
|
+
(e, o) => {
|
|
109
|
+
const { forceMount: r, ...l } = e, t = v(g, e.__scopeScrollArea), { onScrollbarXEnabledChange: n, onScrollbarYEnabledChange: s } = t, a = e.orientation === "horizontal";
|
|
110
|
+
return c.useEffect(() => (a ? n(!0) : s(!0), () => {
|
|
111
|
+
a ? n(!1) : s(!1);
|
|
112
|
+
}), [a, n, s]), t.type === "hover" ? /* @__PURE__ */ f.jsx(be, { ...l, ref: o, forceMount: r }) : t.type === "scroll" ? /* @__PURE__ */ f.jsx(Se, { ...l, ref: o, forceMount: r }) : t.type === "auto" ? /* @__PURE__ */ f.jsx(Q, { ...l, ref: o, forceMount: r }) : t.type === "always" ? /* @__PURE__ */ f.jsx(k, { ...l, ref: o }) : null;
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
K.displayName = g;
|
|
116
|
+
var be = c.forwardRef((e, o) => {
|
|
117
|
+
const { forceMount: r, ...l } = e, t = v(g, e.__scopeScrollArea), [n, s] = c.useState(!1);
|
|
118
|
+
return c.useEffect(() => {
|
|
119
|
+
const a = t.scrollArea;
|
|
120
|
+
let i = 0;
|
|
121
|
+
if (a) {
|
|
122
|
+
const h = () => {
|
|
123
|
+
window.clearTimeout(i), s(!0);
|
|
124
|
+
}, d = () => {
|
|
125
|
+
i = window.setTimeout(() => s(!1), t.scrollHideDelay);
|
|
126
|
+
};
|
|
127
|
+
return a.addEventListener("pointerenter", h), a.addEventListener("pointerleave", d), () => {
|
|
128
|
+
window.clearTimeout(i), a.removeEventListener("pointerenter", h), a.removeEventListener("pointerleave", d);
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}, [t.scrollArea, t.scrollHideDelay]), /* @__PURE__ */ f.jsx(O, { present: r || n, children: /* @__PURE__ */ f.jsx(
|
|
132
|
+
Q,
|
|
133
|
+
{
|
|
134
|
+
"data-state": n ? "visible" : "hidden",
|
|
135
|
+
...l,
|
|
136
|
+
ref: o
|
|
137
|
+
}
|
|
138
|
+
) });
|
|
139
|
+
}), Se = c.forwardRef((e, o) => {
|
|
140
|
+
const { forceMount: r, ...l } = e, t = v(g, e.__scopeScrollArea), n = e.orientation === "horizontal", s = X(() => i("SCROLL_END"), 100), [a, i] = he("hidden", {
|
|
141
|
+
hidden: {
|
|
142
|
+
SCROLL: "scrolling"
|
|
143
|
+
},
|
|
144
|
+
scrolling: {
|
|
145
|
+
SCROLL_END: "idle",
|
|
146
|
+
POINTER_ENTER: "interacting"
|
|
147
|
+
},
|
|
148
|
+
interacting: {
|
|
149
|
+
SCROLL: "interacting",
|
|
150
|
+
POINTER_LEAVE: "idle"
|
|
151
|
+
},
|
|
152
|
+
idle: {
|
|
153
|
+
HIDE: "hidden",
|
|
154
|
+
SCROLL: "scrolling",
|
|
155
|
+
POINTER_ENTER: "interacting"
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
return c.useEffect(() => {
|
|
159
|
+
if (a === "idle") {
|
|
160
|
+
const h = window.setTimeout(() => i("HIDE"), t.scrollHideDelay);
|
|
161
|
+
return () => window.clearTimeout(h);
|
|
162
|
+
}
|
|
163
|
+
}, [a, t.scrollHideDelay, i]), c.useEffect(() => {
|
|
164
|
+
const h = t.viewport, d = n ? "scrollLeft" : "scrollTop";
|
|
165
|
+
if (h) {
|
|
166
|
+
let b = h[d];
|
|
167
|
+
const u = () => {
|
|
168
|
+
const S = h[d];
|
|
169
|
+
b !== S && (i("SCROLL"), s()), b = S;
|
|
170
|
+
};
|
|
171
|
+
return h.addEventListener("scroll", u), () => h.removeEventListener("scroll", u);
|
|
172
|
+
}
|
|
173
|
+
}, [t.viewport, n, i, s]), /* @__PURE__ */ f.jsx(O, { present: r || a !== "hidden", children: /* @__PURE__ */ f.jsx(
|
|
174
|
+
k,
|
|
175
|
+
{
|
|
176
|
+
"data-state": a === "hidden" ? "hidden" : "visible",
|
|
177
|
+
...l,
|
|
178
|
+
ref: o,
|
|
179
|
+
onPointerEnter: C(e.onPointerEnter, () => i("POINTER_ENTER")),
|
|
180
|
+
onPointerLeave: C(e.onPointerLeave, () => i("POINTER_LEAVE"))
|
|
181
|
+
}
|
|
182
|
+
) });
|
|
183
|
+
}), Q = c.forwardRef((e, o) => {
|
|
184
|
+
const r = v(g, e.__scopeScrollArea), { forceMount: l, ...t } = e, [n, s] = c.useState(!1), a = e.orientation === "horizontal", i = X(() => {
|
|
185
|
+
if (r.viewport) {
|
|
186
|
+
const h = r.viewport.offsetWidth < r.viewport.scrollWidth, d = r.viewport.offsetHeight < r.viewport.scrollHeight;
|
|
187
|
+
s(a ? h : d);
|
|
188
|
+
}
|
|
189
|
+
}, 10);
|
|
190
|
+
return E(r.viewport, i), E(r.content, i), /* @__PURE__ */ f.jsx(O, { present: l || n, children: /* @__PURE__ */ f.jsx(
|
|
191
|
+
k,
|
|
192
|
+
{
|
|
193
|
+
"data-state": n ? "visible" : "hidden",
|
|
194
|
+
...t,
|
|
195
|
+
ref: o
|
|
196
|
+
}
|
|
197
|
+
) });
|
|
198
|
+
}), k = c.forwardRef((e, o) => {
|
|
199
|
+
const { orientation: r = "vertical", ...l } = e, t = v(g, e.__scopeScrollArea), n = c.useRef(null), s = c.useRef(0), [a, i] = c.useState({
|
|
200
|
+
content: 0,
|
|
201
|
+
viewport: 0,
|
|
202
|
+
scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
|
|
203
|
+
}), h = te(a.viewport, a.content), d = {
|
|
204
|
+
...l,
|
|
205
|
+
sizes: a,
|
|
206
|
+
onSizesChange: i,
|
|
207
|
+
hasThumb: h > 0 && h < 1,
|
|
208
|
+
onThumbChange: (u) => n.current = u,
|
|
209
|
+
onThumbPointerUp: () => s.current = 0,
|
|
210
|
+
onThumbPointerDown: (u) => s.current = u
|
|
211
|
+
};
|
|
212
|
+
function b(u, S) {
|
|
213
|
+
return xe(u, s.current, a, S);
|
|
214
|
+
}
|
|
215
|
+
return r === "horizontal" ? /* @__PURE__ */ f.jsx(
|
|
216
|
+
me,
|
|
217
|
+
{
|
|
218
|
+
...d,
|
|
219
|
+
ref: o,
|
|
220
|
+
onThumbPositionChange: () => {
|
|
221
|
+
if (t.viewport && n.current) {
|
|
222
|
+
const u = t.viewport.scrollLeft, S = B(u, a, t.dir);
|
|
223
|
+
n.current.style.transform = `translate3d(${S}px, 0, 0)`;
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
onWheelScroll: (u) => {
|
|
227
|
+
t.viewport && (t.viewport.scrollLeft = u);
|
|
228
|
+
},
|
|
229
|
+
onDragScroll: (u) => {
|
|
230
|
+
t.viewport && (t.viewport.scrollLeft = b(u, t.dir));
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
) : r === "vertical" ? /* @__PURE__ */ f.jsx(
|
|
234
|
+
ve,
|
|
235
|
+
{
|
|
236
|
+
...d,
|
|
237
|
+
ref: o,
|
|
238
|
+
onThumbPositionChange: () => {
|
|
239
|
+
if (t.viewport && n.current) {
|
|
240
|
+
const u = t.viewport.scrollTop, S = B(u, a);
|
|
241
|
+
n.current.style.transform = `translate3d(0, ${S}px, 0)`;
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
onWheelScroll: (u) => {
|
|
245
|
+
t.viewport && (t.viewport.scrollTop = u);
|
|
246
|
+
},
|
|
247
|
+
onDragScroll: (u) => {
|
|
248
|
+
t.viewport && (t.viewport.scrollTop = b(u));
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
) : null;
|
|
252
|
+
}), me = c.forwardRef((e, o) => {
|
|
253
|
+
const { sizes: r, onSizesChange: l, ...t } = e, n = v(g, e.__scopeScrollArea), [s, a] = c.useState(), i = c.useRef(null), h = A(o, i, n.onScrollbarXChange);
|
|
254
|
+
return c.useEffect(() => {
|
|
255
|
+
i.current && a(getComputedStyle(i.current));
|
|
256
|
+
}, [i]), /* @__PURE__ */ f.jsx(
|
|
257
|
+
ee,
|
|
258
|
+
{
|
|
259
|
+
"data-orientation": "horizontal",
|
|
260
|
+
...t,
|
|
261
|
+
ref: h,
|
|
262
|
+
sizes: r,
|
|
263
|
+
style: {
|
|
264
|
+
bottom: 0,
|
|
265
|
+
left: n.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
266
|
+
right: n.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
267
|
+
"--radix-scroll-area-thumb-width": I(r) + "px",
|
|
268
|
+
...e.style
|
|
269
|
+
},
|
|
270
|
+
onThumbPointerDown: (d) => e.onThumbPointerDown(d.x),
|
|
271
|
+
onDragScroll: (d) => e.onDragScroll(d.x),
|
|
272
|
+
onWheelScroll: (d, b) => {
|
|
273
|
+
if (n.viewport) {
|
|
274
|
+
const u = n.viewport.scrollLeft + d.deltaX;
|
|
275
|
+
e.onWheelScroll(u), le(u, b) && d.preventDefault();
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
onResize: () => {
|
|
279
|
+
i.current && n.viewport && s && l({
|
|
280
|
+
content: n.viewport.scrollWidth,
|
|
281
|
+
viewport: n.viewport.offsetWidth,
|
|
282
|
+
scrollbar: {
|
|
283
|
+
size: i.current.clientWidth,
|
|
284
|
+
paddingStart: z(s.paddingLeft),
|
|
285
|
+
paddingEnd: z(s.paddingRight)
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
}), ve = c.forwardRef((e, o) => {
|
|
292
|
+
const { sizes: r, onSizesChange: l, ...t } = e, n = v(g, e.__scopeScrollArea), [s, a] = c.useState(), i = c.useRef(null), h = A(o, i, n.onScrollbarYChange);
|
|
293
|
+
return c.useEffect(() => {
|
|
294
|
+
i.current && a(getComputedStyle(i.current));
|
|
295
|
+
}, [i]), /* @__PURE__ */ f.jsx(
|
|
296
|
+
ee,
|
|
297
|
+
{
|
|
298
|
+
"data-orientation": "vertical",
|
|
299
|
+
...t,
|
|
300
|
+
ref: h,
|
|
301
|
+
sizes: r,
|
|
302
|
+
style: {
|
|
303
|
+
top: 0,
|
|
304
|
+
right: n.dir === "ltr" ? 0 : void 0,
|
|
305
|
+
left: n.dir === "rtl" ? 0 : void 0,
|
|
306
|
+
bottom: "var(--radix-scroll-area-corner-height)",
|
|
307
|
+
"--radix-scroll-area-thumb-height": I(r) + "px",
|
|
308
|
+
...e.style
|
|
309
|
+
},
|
|
310
|
+
onThumbPointerDown: (d) => e.onThumbPointerDown(d.y),
|
|
311
|
+
onDragScroll: (d) => e.onDragScroll(d.y),
|
|
312
|
+
onWheelScroll: (d, b) => {
|
|
313
|
+
if (n.viewport) {
|
|
314
|
+
const u = n.viewport.scrollTop + d.deltaY;
|
|
315
|
+
e.onWheelScroll(u), le(u, b) && d.preventDefault();
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
onResize: () => {
|
|
319
|
+
i.current && n.viewport && s && l({
|
|
320
|
+
content: n.viewport.scrollHeight,
|
|
321
|
+
viewport: n.viewport.offsetHeight,
|
|
322
|
+
scrollbar: {
|
|
323
|
+
size: i.current.clientHeight,
|
|
324
|
+
paddingStart: z(s.paddingTop),
|
|
325
|
+
paddingEnd: z(s.paddingBottom)
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
);
|
|
331
|
+
}), [pe, Z] = $(g), ee = c.forwardRef((e, o) => {
|
|
332
|
+
const {
|
|
333
|
+
__scopeScrollArea: r,
|
|
334
|
+
sizes: l,
|
|
335
|
+
hasThumb: t,
|
|
336
|
+
onThumbChange: n,
|
|
337
|
+
onThumbPointerUp: s,
|
|
338
|
+
onThumbPointerDown: a,
|
|
339
|
+
onThumbPositionChange: i,
|
|
340
|
+
onDragScroll: h,
|
|
341
|
+
onWheelScroll: d,
|
|
342
|
+
onResize: b,
|
|
343
|
+
...u
|
|
344
|
+
} = e, S = v(g, r), [w, T] = c.useState(null), Y = A(o, (m) => T(m)), x = c.useRef(null), L = c.useRef(""), M = S.viewport, j = l.content - l.viewport, D = P(d), y = P(i), N = X(b, 10);
|
|
345
|
+
function W(m) {
|
|
346
|
+
if (x.current) {
|
|
347
|
+
const p = m.clientX - x.current.left, R = m.clientY - x.current.top;
|
|
348
|
+
h({ x: p, y: R });
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return c.useEffect(() => {
|
|
352
|
+
const m = (p) => {
|
|
353
|
+
const R = p.target;
|
|
354
|
+
w?.contains(R) && D(p, j);
|
|
355
|
+
};
|
|
356
|
+
return document.addEventListener("wheel", m, { passive: !1 }), () => document.removeEventListener("wheel", m, { passive: !1 });
|
|
357
|
+
}, [M, w, j, D]), c.useEffect(y, [l, y]), E(w, N), E(S.content, N), /* @__PURE__ */ f.jsx(
|
|
358
|
+
pe,
|
|
359
|
+
{
|
|
360
|
+
scope: r,
|
|
361
|
+
scrollbar: w,
|
|
362
|
+
hasThumb: t,
|
|
363
|
+
onThumbChange: P(n),
|
|
364
|
+
onThumbPointerUp: P(s),
|
|
365
|
+
onThumbPositionChange: y,
|
|
366
|
+
onThumbPointerDown: P(a),
|
|
367
|
+
children: /* @__PURE__ */ f.jsx(
|
|
368
|
+
_.div,
|
|
369
|
+
{
|
|
370
|
+
...u,
|
|
371
|
+
ref: Y,
|
|
372
|
+
style: { position: "absolute", ...u.style },
|
|
373
|
+
onPointerDown: C(e.onPointerDown, (m) => {
|
|
374
|
+
m.button === 0 && (m.target.setPointerCapture(m.pointerId), x.current = w.getBoundingClientRect(), L.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", S.viewport && (S.viewport.style.scrollBehavior = "auto"), W(m));
|
|
375
|
+
}),
|
|
376
|
+
onPointerMove: C(e.onPointerMove, W),
|
|
377
|
+
onPointerUp: C(e.onPointerUp, (m) => {
|
|
378
|
+
const p = m.target;
|
|
379
|
+
p.hasPointerCapture(m.pointerId) && p.releasePointerCapture(m.pointerId), document.body.style.webkitUserSelect = L.current, S.viewport && (S.viewport.style.scrollBehavior = ""), x.current = null;
|
|
380
|
+
})
|
|
381
|
+
}
|
|
382
|
+
)
|
|
383
|
+
}
|
|
384
|
+
);
|
|
385
|
+
}), H = "ScrollAreaThumb", re = c.forwardRef(
|
|
386
|
+
(e, o) => {
|
|
387
|
+
const { forceMount: r, ...l } = e, t = Z(H, e.__scopeScrollArea);
|
|
388
|
+
return /* @__PURE__ */ f.jsx(O, { present: r || t.hasThumb, children: /* @__PURE__ */ f.jsx(we, { ref: o, ...l }) });
|
|
389
|
+
}
|
|
390
|
+
), we = c.forwardRef(
|
|
391
|
+
(e, o) => {
|
|
392
|
+
const { __scopeScrollArea: r, style: l, ...t } = e, n = v(H, r), s = Z(H, r), { onThumbPositionChange: a } = s, i = A(
|
|
393
|
+
o,
|
|
394
|
+
(b) => s.onThumbChange(b)
|
|
395
|
+
), h = c.useRef(void 0), d = X(() => {
|
|
396
|
+
h.current && (h.current(), h.current = void 0);
|
|
397
|
+
}, 100);
|
|
398
|
+
return c.useEffect(() => {
|
|
399
|
+
const b = n.viewport;
|
|
400
|
+
if (b) {
|
|
401
|
+
const u = () => {
|
|
402
|
+
if (d(), !h.current) {
|
|
403
|
+
const S = Pe(b, a);
|
|
404
|
+
h.current = S, a();
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
return a(), b.addEventListener("scroll", u), () => b.removeEventListener("scroll", u);
|
|
408
|
+
}
|
|
409
|
+
}, [n.viewport, d, a]), /* @__PURE__ */ f.jsx(
|
|
410
|
+
_.div,
|
|
411
|
+
{
|
|
412
|
+
"data-state": s.hasThumb ? "visible" : "hidden",
|
|
413
|
+
...t,
|
|
414
|
+
ref: i,
|
|
415
|
+
style: {
|
|
416
|
+
width: "var(--radix-scroll-area-thumb-width)",
|
|
417
|
+
height: "var(--radix-scroll-area-thumb-height)",
|
|
418
|
+
...l
|
|
419
|
+
},
|
|
420
|
+
onPointerDownCapture: C(e.onPointerDownCapture, (b) => {
|
|
421
|
+
const S = b.target.getBoundingClientRect(), w = b.clientX - S.left, T = b.clientY - S.top;
|
|
422
|
+
s.onThumbPointerDown({ x: w, y: T });
|
|
423
|
+
}),
|
|
424
|
+
onPointerUp: C(e.onPointerUp, s.onThumbPointerUp)
|
|
425
|
+
}
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
);
|
|
429
|
+
re.displayName = H;
|
|
430
|
+
var V = "ScrollAreaCorner", oe = c.forwardRef(
|
|
431
|
+
(e, o) => {
|
|
432
|
+
const r = v(V, e.__scopeScrollArea), l = !!(r.scrollbarX && r.scrollbarY);
|
|
433
|
+
return r.type !== "scroll" && l ? /* @__PURE__ */ f.jsx(ge, { ...e, ref: o }) : null;
|
|
434
|
+
}
|
|
435
|
+
);
|
|
436
|
+
oe.displayName = V;
|
|
437
|
+
var ge = c.forwardRef((e, o) => {
|
|
438
|
+
const { __scopeScrollArea: r, ...l } = e, t = v(V, r), [n, s] = c.useState(0), [a, i] = c.useState(0), h = !!(n && a);
|
|
439
|
+
return E(t.scrollbarX, () => {
|
|
440
|
+
const d = t.scrollbarX?.offsetHeight || 0;
|
|
441
|
+
t.onCornerHeightChange(d), i(d);
|
|
442
|
+
}), E(t.scrollbarY, () => {
|
|
443
|
+
const d = t.scrollbarY?.offsetWidth || 0;
|
|
444
|
+
t.onCornerWidthChange(d), s(d);
|
|
445
|
+
}), h ? /* @__PURE__ */ f.jsx(
|
|
446
|
+
_.div,
|
|
447
|
+
{
|
|
448
|
+
...l,
|
|
449
|
+
ref: o,
|
|
450
|
+
style: {
|
|
451
|
+
width: n,
|
|
452
|
+
height: a,
|
|
453
|
+
position: "absolute",
|
|
454
|
+
right: t.dir === "ltr" ? 0 : void 0,
|
|
455
|
+
left: t.dir === "rtl" ? 0 : void 0,
|
|
456
|
+
bottom: 0,
|
|
457
|
+
...e.style
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
) : null;
|
|
461
|
+
});
|
|
462
|
+
function z(e) {
|
|
463
|
+
return e ? parseInt(e, 10) : 0;
|
|
464
|
+
}
|
|
465
|
+
function te(e, o) {
|
|
466
|
+
const r = e / o;
|
|
467
|
+
return isNaN(r) ? 0 : r;
|
|
468
|
+
}
|
|
469
|
+
function I(e) {
|
|
470
|
+
const o = te(e.viewport, e.content), r = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, l = (e.scrollbar.size - r) * o;
|
|
471
|
+
return Math.max(l, 18);
|
|
472
|
+
}
|
|
473
|
+
function xe(e, o, r, l = "ltr") {
|
|
474
|
+
const t = I(r), n = t / 2, s = o || n, a = t - s, i = r.scrollbar.paddingStart + s, h = r.scrollbar.size - r.scrollbar.paddingEnd - a, d = r.content - r.viewport, b = l === "ltr" ? [0, d] : [d * -1, 0];
|
|
475
|
+
return ne([i, h], b)(e);
|
|
476
|
+
}
|
|
477
|
+
function B(e, o, r = "ltr") {
|
|
478
|
+
const l = I(o), t = o.scrollbar.paddingStart + o.scrollbar.paddingEnd, n = o.scrollbar.size - t, s = o.content - o.viewport, a = n - l, i = r === "ltr" ? [0, s] : [s * -1, 0], h = ae(e, i);
|
|
479
|
+
return ne([0, s], [0, a])(h);
|
|
480
|
+
}
|
|
481
|
+
function ne(e, o) {
|
|
482
|
+
return (r) => {
|
|
483
|
+
if (e[0] === e[1] || o[0] === o[1]) return o[0];
|
|
484
|
+
const l = (o[1] - o[0]) / (e[1] - e[0]);
|
|
485
|
+
return o[0] + l * (r - e[0]);
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
function le(e, o) {
|
|
489
|
+
return e > 0 && e < o;
|
|
490
|
+
}
|
|
491
|
+
var Pe = (e, o = () => {
|
|
492
|
+
}) => {
|
|
493
|
+
let r = { left: e.scrollLeft, top: e.scrollTop }, l = 0;
|
|
494
|
+
return (function t() {
|
|
495
|
+
const n = { left: e.scrollLeft, top: e.scrollTop }, s = r.left !== n.left, a = r.top !== n.top;
|
|
496
|
+
(s || a) && o(), r = n, l = window.requestAnimationFrame(t);
|
|
497
|
+
})(), () => window.cancelAnimationFrame(l);
|
|
498
|
+
};
|
|
499
|
+
function X(e, o) {
|
|
500
|
+
const r = P(e), l = c.useRef(0);
|
|
501
|
+
return c.useEffect(() => () => window.clearTimeout(l.current), []), c.useCallback(() => {
|
|
502
|
+
window.clearTimeout(l.current), l.current = window.setTimeout(r, o);
|
|
503
|
+
}, [r, o]);
|
|
504
|
+
}
|
|
505
|
+
function E(e, o) {
|
|
506
|
+
const r = P(o);
|
|
507
|
+
de(() => {
|
|
508
|
+
let l = 0;
|
|
509
|
+
if (e) {
|
|
510
|
+
const t = new ResizeObserver(() => {
|
|
511
|
+
cancelAnimationFrame(l), l = window.requestAnimationFrame(r);
|
|
512
|
+
});
|
|
513
|
+
return t.observe(e), () => {
|
|
514
|
+
window.cancelAnimationFrame(l), t.unobserve(e);
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
}, [e, r]);
|
|
518
|
+
}
|
|
519
|
+
var Ce = q, Re = J, Ee = oe;
|
|
520
|
+
function He({ className: e, children: o, ...r }) {
|
|
521
|
+
return /* @__PURE__ */ f.jsxs(Ce, { "data-slot": "scroll-area", className: F("relative", e), ...r, children: [
|
|
522
|
+
/* @__PURE__ */ f.jsx(
|
|
523
|
+
Re,
|
|
524
|
+
{
|
|
525
|
+
"data-slot": "scroll-area-viewport",
|
|
526
|
+
className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
|
|
527
|
+
children: o
|
|
528
|
+
}
|
|
529
|
+
),
|
|
530
|
+
/* @__PURE__ */ f.jsx(Ae, {}),
|
|
531
|
+
/* @__PURE__ */ f.jsx(Ee, {})
|
|
532
|
+
] });
|
|
533
|
+
}
|
|
534
|
+
function Ae({ className: e, orientation: o = "vertical", ...r }) {
|
|
535
|
+
return /* @__PURE__ */ f.jsx(
|
|
536
|
+
K,
|
|
537
|
+
{
|
|
538
|
+
"data-slot": "scroll-area-scrollbar",
|
|
539
|
+
orientation: o,
|
|
540
|
+
className: F(
|
|
541
|
+
"flex touch-none p-px transition-colors select-none",
|
|
542
|
+
o === "vertical" && "h-full w-2.5 border-l border-l-transparent",
|
|
543
|
+
o === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
|
|
544
|
+
e
|
|
545
|
+
),
|
|
546
|
+
...r,
|
|
547
|
+
children: /* @__PURE__ */ f.jsx(re, { "data-slot": "scroll-area-thumb", className: "bg-border relative flex-1 rounded-full" })
|
|
548
|
+
}
|
|
549
|
+
);
|
|
550
|
+
}
|
|
551
|
+
export {
|
|
552
|
+
Ne as S,
|
|
553
|
+
He as a,
|
|
554
|
+
Ae as b
|
|
555
|
+
};
|
|
556
|
+
//# sourceMappingURL=scroll-area-BM9h23ua.js.map
|