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