@arcadeai/design-system 0.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/README.md +128 -0
- package/dist/check-CxcShTlQ.js +11 -0
- package/dist/chevron-down-D_a-ccxi.js +11 -0
- package/dist/chevron-right-DriXIqe5.js +11 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +195 -0
- package/dist/components/ui/atoms/accordion.d.ts +7 -0
- package/dist/components/ui/atoms/accordion.js +289 -0
- package/dist/components/ui/atoms/alert.d.ts +9 -0
- package/dist/components/ui/atoms/alert.js +66 -0
- package/dist/components/ui/atoms/avatar.d.ts +6 -0
- package/dist/components/ui/atoms/avatar.js +130 -0
- package/dist/components/ui/atoms/badge.d.ts +9 -0
- package/dist/components/ui/atoms/badge.js +41 -0
- package/dist/components/ui/atoms/breadcrumb.d.ts +11 -0
- package/dist/components/ui/atoms/breadcrumb.js +115 -0
- package/dist/components/ui/atoms/button.d.ts +10 -0
- package/dist/components/ui/atoms/button.js +51 -0
- package/dist/components/ui/atoms/card.d.ts +9 -0
- package/dist/components/ui/atoms/card.js +90 -0
- package/dist/components/ui/atoms/chart.d.ts +68 -0
- package/dist/components/ui/atoms/chart.js +10477 -0
- package/dist/components/ui/atoms/collapsible.d.ts +5 -0
- package/dist/components/ui/atoms/collapsible.js +34 -0
- package/dist/components/ui/atoms/command.d.ts +18 -0
- package/dist/components/ui/atoms/command.js +490 -0
- package/dist/components/ui/atoms/dialog.d.ts +15 -0
- package/dist/components/ui/atoms/dialog.js +135 -0
- package/dist/components/ui/atoms/dropdown-menu.d.ts +25 -0
- package/dist/components/ui/atoms/dropdown-menu.js +1035 -0
- package/dist/components/ui/atoms/form.d.ts +24 -0
- package/dist/components/ui/atoms/form.js +297 -0
- package/dist/components/ui/atoms/hover-card.d.ts +6 -0
- package/dist/components/ui/atoms/hover-card.js +211 -0
- package/dist/components/ui/atoms/index.d.ts +33 -0
- package/dist/components/ui/atoms/index.js +195 -0
- package/dist/components/ui/atoms/input.d.ts +3 -0
- package/dist/components/ui/atoms/input.js +21 -0
- package/dist/components/ui/atoms/label.d.ts +4 -0
- package/dist/components/ui/atoms/label.js +36 -0
- package/dist/components/ui/atoms/popover.d.ts +7 -0
- package/dist/components/ui/atoms/popover.js +266 -0
- package/dist/components/ui/atoms/progress.d.ts +4 -0
- package/dist/components/ui/atoms/progress.js +107 -0
- package/dist/components/ui/atoms/resizable.d.ts +8 -0
- package/dist/components/ui/atoms/resizable.js +1564 -0
- package/dist/components/ui/atoms/scroll-area.d.ts +5 -0
- package/dist/components/ui/atoms/scroll-area.js +580 -0
- package/dist/components/ui/atoms/select.d.ts +15 -0
- package/dist/components/ui/atoms/select.js +1000 -0
- package/dist/components/ui/atoms/separator.d.ts +4 -0
- package/dist/components/ui/atoms/separator.js +44 -0
- package/dist/components/ui/atoms/sheet.d.ts +14 -0
- package/dist/components/ui/atoms/sheet.js +127 -0
- package/dist/components/ui/atoms/sidebar.d.ts +69 -0
- package/dist/components/ui/atoms/sidebar.js +602 -0
- package/dist/components/ui/atoms/skeleton.d.ts +2 -0
- package/dist/components/ui/atoms/skeleton.js +15 -0
- package/dist/components/ui/atoms/slider.d.ts +4 -0
- package/dist/components/ui/atoms/slider.js +484 -0
- package/dist/components/ui/atoms/sonner.d.ts +3 -0
- package/dist/components/ui/atoms/sonner.js +788 -0
- package/dist/components/ui/atoms/switch.d.ts +4 -0
- package/dist/components/ui/atoms/switch.js +155 -0
- package/dist/components/ui/atoms/table.d.ts +10 -0
- package/dist/components/ui/atoms/table.js +114 -0
- package/dist/components/ui/atoms/tabs.d.ts +7 -0
- package/dist/components/ui/atoms/tabs.js +218 -0
- package/dist/components/ui/atoms/textarea.d.ts +3 -0
- package/dist/components/ui/atoms/textarea.js +18 -0
- package/dist/components/ui/atoms/toggle.d.ts +9 -0
- package/dist/components/ui/atoms/toggle.js +70 -0
- package/dist/components/ui/atoms/tooltip.d.ts +7 -0
- package/dist/components/ui/atoms/tooltip.js +376 -0
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.js +195 -0
- package/dist/createLucideIcon-B6fy1GTR.js +94 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +14 -0
- package/dist/index-BAhNQL1u.js +675 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/index-ByaXH_ih.js +10 -0
- package/dist/index-C9KW2H79.js +36 -0
- package/dist/index-CB1Wkg0G.js +83 -0
- package/dist/index-CHDs-SiB.js +27 -0
- package/dist/index-CJFGOBPb.js +122 -0
- package/dist/index-CL4N9wMT.js +259 -0
- package/dist/index-CuMpq4Un.js +47 -0
- package/dist/index-CxK6rt_N.js +119 -0
- package/dist/index-D2uXV4lz.js +181 -0
- package/dist/index-DLeNytVF.js +9 -0
- package/dist/index-DYfkNB0n.js +54 -0
- package/dist/index-DdnpnyX2.js +34 -0
- package/dist/index-DuekHEmj.js +6 -0
- package/dist/index-DwYXX2sM.js +13 -0
- package/dist/index-Dy7YuPrV.js +1532 -0
- package/dist/index-QMp1pYFl.js +145 -0
- package/dist/index-UFb2E87s.js +70 -0
- package/dist/index-nluJZSbA.js +31 -0
- package/dist/index-p7nYL7BU.js +71 -0
- package/dist/index-rKs9bXHr.js +6 -0
- package/dist/index-umR1UobZ.js +13 -0
- package/dist/index.css +2 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +4 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +195 -0
- package/dist/utils-Dy2WjYNJ.js +2744 -0
- package/package.json +100 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
2
|
+
import type * as React from 'react';
|
|
3
|
+
declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,580 @@
|
|
|
1
|
+
import { jsx as b, jsxs as $, Fragment as se } from "react/jsx-runtime";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
import { P as L } from "../../../index-C9KW2H79.js";
|
|
4
|
+
import { P as I } from "../../../index-p7nYL7BU.js";
|
|
5
|
+
import { c as ae } from "../../../index-UFb2E87s.js";
|
|
6
|
+
import { u as T } from "../../../index-CB1Wkg0G.js";
|
|
7
|
+
import { u as C } from "../../../index-DwYXX2sM.js";
|
|
8
|
+
import { u as ie } from "../../../index-ByaXH_ih.js";
|
|
9
|
+
import { u as de } from "../../../index-DuekHEmj.js";
|
|
10
|
+
import { c as ue } from "../../../index-rKs9bXHr.js";
|
|
11
|
+
import { c as R } from "../../../index-DLeNytVF.js";
|
|
12
|
+
import { c as j } from "../../../utils-Dy2WjYNJ.js";
|
|
13
|
+
function fe(e, o) {
|
|
14
|
+
return c.useReducer((r, l) => o[r][l] ?? r, e);
|
|
15
|
+
}
|
|
16
|
+
var V = "ScrollArea", [q, Ye] = ae(V), [he, v] = q(V), G = c.forwardRef(
|
|
17
|
+
(e, o) => {
|
|
18
|
+
const {
|
|
19
|
+
__scopeScrollArea: r,
|
|
20
|
+
type: l = "hover",
|
|
21
|
+
dir: t,
|
|
22
|
+
scrollHideDelay: n = 600,
|
|
23
|
+
...s
|
|
24
|
+
} = e, [a, i] = c.useState(null), [f, d] = c.useState(null), [h, u] = c.useState(null), [m, p] = c.useState(null), [x, M] = c.useState(null), [P, _] = c.useState(0), [U, D] = c.useState(0), [N, y] = c.useState(!1), [W, H] = c.useState(!1), S = T(o, (E) => i(E)), w = ie(t);
|
|
25
|
+
return /* @__PURE__ */ b(
|
|
26
|
+
he,
|
|
27
|
+
{
|
|
28
|
+
scope: r,
|
|
29
|
+
type: l,
|
|
30
|
+
dir: w,
|
|
31
|
+
scrollHideDelay: n,
|
|
32
|
+
scrollArea: a,
|
|
33
|
+
viewport: f,
|
|
34
|
+
onViewportChange: d,
|
|
35
|
+
content: h,
|
|
36
|
+
onContentChange: u,
|
|
37
|
+
scrollbarX: m,
|
|
38
|
+
onScrollbarXChange: p,
|
|
39
|
+
scrollbarXEnabled: N,
|
|
40
|
+
onScrollbarXEnabledChange: y,
|
|
41
|
+
scrollbarY: x,
|
|
42
|
+
onScrollbarYChange: M,
|
|
43
|
+
scrollbarYEnabled: W,
|
|
44
|
+
onScrollbarYEnabledChange: H,
|
|
45
|
+
onCornerWidthChange: _,
|
|
46
|
+
onCornerHeightChange: D,
|
|
47
|
+
children: /* @__PURE__ */ b(
|
|
48
|
+
L.div,
|
|
49
|
+
{
|
|
50
|
+
dir: w,
|
|
51
|
+
...s,
|
|
52
|
+
ref: S,
|
|
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": P + "px",
|
|
57
|
+
"--radix-scroll-area-corner-height": U + "px",
|
|
58
|
+
...e.style
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
G.displayName = V;
|
|
67
|
+
var J = "ScrollAreaViewport", K = c.forwardRef(
|
|
68
|
+
(e, o) => {
|
|
69
|
+
const { __scopeScrollArea: r, children: l, nonce: t, ...n } = e, s = v(J, r), a = c.useRef(null), i = T(o, a, s.onViewportChange);
|
|
70
|
+
return /* @__PURE__ */ $(se, { children: [
|
|
71
|
+
/* @__PURE__ */ b(
|
|
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: t
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ b(
|
|
81
|
+
L.div,
|
|
82
|
+
{
|
|
83
|
+
"data-radix-scroll-area-viewport": "",
|
|
84
|
+
...n,
|
|
85
|
+
ref: i,
|
|
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: s.scrollbarXEnabled ? "scroll" : "hidden",
|
|
99
|
+
overflowY: s.scrollbarYEnabled ? "scroll" : "hidden",
|
|
100
|
+
...e.style
|
|
101
|
+
},
|
|
102
|
+
children: /* @__PURE__ */ b("div", { ref: s.onContentChange, style: { minWidth: "100%", display: "table" }, children: l })
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
] });
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
K.displayName = J;
|
|
109
|
+
var g = "ScrollAreaScrollbar", Q = c.forwardRef(
|
|
110
|
+
(e, o) => {
|
|
111
|
+
const { forceMount: r, ...l } = e, t = v(g, e.__scopeScrollArea), { onScrollbarXEnabledChange: n, onScrollbarYEnabledChange: s } = t, a = e.orientation === "horizontal";
|
|
112
|
+
return c.useEffect(() => (a ? n(!0) : s(!0), () => {
|
|
113
|
+
a ? n(!1) : s(!1);
|
|
114
|
+
}), [a, n, s]), t.type === "hover" ? /* @__PURE__ */ b(be, { ...l, ref: o, forceMount: r }) : t.type === "scroll" ? /* @__PURE__ */ b(me, { ...l, ref: o, forceMount: r }) : t.type === "auto" ? /* @__PURE__ */ b(Z, { ...l, ref: o, forceMount: r }) : t.type === "always" ? /* @__PURE__ */ b(B, { ...l, ref: o }) : null;
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
Q.displayName = g;
|
|
118
|
+
var be = c.forwardRef((e, o) => {
|
|
119
|
+
const { forceMount: r, ...l } = e, t = v(g, e.__scopeScrollArea), [n, s] = c.useState(!1);
|
|
120
|
+
return c.useEffect(() => {
|
|
121
|
+
const a = t.scrollArea;
|
|
122
|
+
let i = 0;
|
|
123
|
+
if (a) {
|
|
124
|
+
const f = () => {
|
|
125
|
+
window.clearTimeout(i), s(!0);
|
|
126
|
+
}, d = () => {
|
|
127
|
+
i = window.setTimeout(() => s(!1), t.scrollHideDelay);
|
|
128
|
+
};
|
|
129
|
+
return a.addEventListener("pointerenter", f), a.addEventListener("pointerleave", d), () => {
|
|
130
|
+
window.clearTimeout(i), a.removeEventListener("pointerenter", f), a.removeEventListener("pointerleave", d);
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
}, [t.scrollArea, t.scrollHideDelay]), /* @__PURE__ */ b(I, { present: r || n, children: /* @__PURE__ */ b(
|
|
134
|
+
Z,
|
|
135
|
+
{
|
|
136
|
+
"data-state": n ? "visible" : "hidden",
|
|
137
|
+
...l,
|
|
138
|
+
ref: o
|
|
139
|
+
}
|
|
140
|
+
) });
|
|
141
|
+
}), me = c.forwardRef((e, o) => {
|
|
142
|
+
const { forceMount: r, ...l } = e, t = v(g, e.__scopeScrollArea), n = e.orientation === "horizontal", s = Y(() => i("SCROLL_END"), 100), [a, i] = fe("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 c.useEffect(() => {
|
|
161
|
+
if (a === "idle") {
|
|
162
|
+
const f = window.setTimeout(() => i("HIDE"), t.scrollHideDelay);
|
|
163
|
+
return () => window.clearTimeout(f);
|
|
164
|
+
}
|
|
165
|
+
}, [a, t.scrollHideDelay, i]), c.useEffect(() => {
|
|
166
|
+
const f = t.viewport, d = n ? "scrollLeft" : "scrollTop";
|
|
167
|
+
if (f) {
|
|
168
|
+
let h = f[d];
|
|
169
|
+
const u = () => {
|
|
170
|
+
const m = f[d];
|
|
171
|
+
h !== m && (i("SCROLL"), s()), h = m;
|
|
172
|
+
};
|
|
173
|
+
return f.addEventListener("scroll", u), () => f.removeEventListener("scroll", u);
|
|
174
|
+
}
|
|
175
|
+
}, [t.viewport, n, i, s]), /* @__PURE__ */ b(I, { present: r || a !== "hidden", children: /* @__PURE__ */ b(
|
|
176
|
+
B,
|
|
177
|
+
{
|
|
178
|
+
"data-state": a === "hidden" ? "hidden" : "visible",
|
|
179
|
+
...l,
|
|
180
|
+
ref: o,
|
|
181
|
+
onPointerEnter: R(e.onPointerEnter, () => i("POINTER_ENTER")),
|
|
182
|
+
onPointerLeave: R(e.onPointerLeave, () => i("POINTER_LEAVE"))
|
|
183
|
+
}
|
|
184
|
+
) });
|
|
185
|
+
}), Z = c.forwardRef((e, o) => {
|
|
186
|
+
const r = v(g, e.__scopeScrollArea), { forceMount: l, ...t } = e, [n, s] = c.useState(!1), a = e.orientation === "horizontal", i = Y(() => {
|
|
187
|
+
if (r.viewport) {
|
|
188
|
+
const f = r.viewport.offsetWidth < r.viewport.scrollWidth, d = r.viewport.offsetHeight < r.viewport.scrollHeight;
|
|
189
|
+
s(a ? f : d);
|
|
190
|
+
}
|
|
191
|
+
}, 10);
|
|
192
|
+
return A(r.viewport, i), A(r.content, i), /* @__PURE__ */ b(I, { present: l || n, children: /* @__PURE__ */ b(
|
|
193
|
+
B,
|
|
194
|
+
{
|
|
195
|
+
"data-state": n ? "visible" : "hidden",
|
|
196
|
+
...t,
|
|
197
|
+
ref: o
|
|
198
|
+
}
|
|
199
|
+
) });
|
|
200
|
+
}), B = c.forwardRef((e, o) => {
|
|
201
|
+
const { orientation: r = "vertical", ...l } = e, t = v(g, e.__scopeScrollArea), n = c.useRef(null), s = c.useRef(0), [a, i] = c.useState({
|
|
202
|
+
content: 0,
|
|
203
|
+
viewport: 0,
|
|
204
|
+
scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
|
|
205
|
+
}), f = ne(a.viewport, a.content), d = {
|
|
206
|
+
...l,
|
|
207
|
+
sizes: a,
|
|
208
|
+
onSizesChange: i,
|
|
209
|
+
hasThumb: f > 0 && f < 1,
|
|
210
|
+
onThumbChange: (u) => n.current = u,
|
|
211
|
+
onThumbPointerUp: () => s.current = 0,
|
|
212
|
+
onThumbPointerDown: (u) => s.current = u
|
|
213
|
+
};
|
|
214
|
+
function h(u, m) {
|
|
215
|
+
return Pe(u, s.current, a, m);
|
|
216
|
+
}
|
|
217
|
+
return r === "horizontal" ? /* @__PURE__ */ b(
|
|
218
|
+
Se,
|
|
219
|
+
{
|
|
220
|
+
...d,
|
|
221
|
+
ref: o,
|
|
222
|
+
onThumbPositionChange: () => {
|
|
223
|
+
if (t.viewport && n.current) {
|
|
224
|
+
const u = t.viewport.scrollLeft, m = F(u, a, t.dir);
|
|
225
|
+
n.current.style.transform = `translate3d(${m}px, 0, 0)`;
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
onWheelScroll: (u) => {
|
|
229
|
+
t.viewport && (t.viewport.scrollLeft = u);
|
|
230
|
+
},
|
|
231
|
+
onDragScroll: (u) => {
|
|
232
|
+
t.viewport && (t.viewport.scrollLeft = h(u, t.dir));
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
) : r === "vertical" ? /* @__PURE__ */ b(
|
|
236
|
+
pe,
|
|
237
|
+
{
|
|
238
|
+
...d,
|
|
239
|
+
ref: o,
|
|
240
|
+
onThumbPositionChange: () => {
|
|
241
|
+
if (t.viewport && n.current) {
|
|
242
|
+
const u = t.viewport.scrollTop, m = F(u, a);
|
|
243
|
+
n.current.style.transform = `translate3d(0, ${m}px, 0)`;
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
onWheelScroll: (u) => {
|
|
247
|
+
t.viewport && (t.viewport.scrollTop = u);
|
|
248
|
+
},
|
|
249
|
+
onDragScroll: (u) => {
|
|
250
|
+
t.viewport && (t.viewport.scrollTop = h(u));
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
) : null;
|
|
254
|
+
}), Se = c.forwardRef((e, o) => {
|
|
255
|
+
const { sizes: r, onSizesChange: l, ...t } = e, n = v(g, e.__scopeScrollArea), [s, a] = c.useState(), i = c.useRef(null), f = T(o, i, n.onScrollbarXChange);
|
|
256
|
+
return c.useEffect(() => {
|
|
257
|
+
i.current && a(getComputedStyle(i.current));
|
|
258
|
+
}, [i]), /* @__PURE__ */ b(
|
|
259
|
+
re,
|
|
260
|
+
{
|
|
261
|
+
"data-orientation": "horizontal",
|
|
262
|
+
...t,
|
|
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": X(r) + "px",
|
|
270
|
+
...e.style
|
|
271
|
+
},
|
|
272
|
+
onThumbPointerDown: (d) => e.onThumbPointerDown(d.x),
|
|
273
|
+
onDragScroll: (d) => e.onDragScroll(d.x),
|
|
274
|
+
onWheelScroll: (d, h) => {
|
|
275
|
+
if (n.viewport) {
|
|
276
|
+
const u = n.viewport.scrollLeft + d.deltaX;
|
|
277
|
+
e.onWheelScroll(u), ce(u, h) && d.preventDefault();
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
onResize: () => {
|
|
281
|
+
i.current && n.viewport && s && l({
|
|
282
|
+
content: n.viewport.scrollWidth,
|
|
283
|
+
viewport: n.viewport.offsetWidth,
|
|
284
|
+
scrollbar: {
|
|
285
|
+
size: i.current.clientWidth,
|
|
286
|
+
paddingStart: O(s.paddingLeft),
|
|
287
|
+
paddingEnd: O(s.paddingRight)
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
);
|
|
293
|
+
}), pe = c.forwardRef((e, o) => {
|
|
294
|
+
const { sizes: r, onSizesChange: l, ...t } = e, n = v(g, e.__scopeScrollArea), [s, a] = c.useState(), i = c.useRef(null), f = T(o, i, n.onScrollbarYChange);
|
|
295
|
+
return c.useEffect(() => {
|
|
296
|
+
i.current && a(getComputedStyle(i.current));
|
|
297
|
+
}, [i]), /* @__PURE__ */ b(
|
|
298
|
+
re,
|
|
299
|
+
{
|
|
300
|
+
"data-orientation": "vertical",
|
|
301
|
+
...t,
|
|
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": X(r) + "px",
|
|
310
|
+
...e.style
|
|
311
|
+
},
|
|
312
|
+
onThumbPointerDown: (d) => e.onThumbPointerDown(d.y),
|
|
313
|
+
onDragScroll: (d) => e.onDragScroll(d.y),
|
|
314
|
+
onWheelScroll: (d, h) => {
|
|
315
|
+
if (n.viewport) {
|
|
316
|
+
const u = n.viewport.scrollTop + d.deltaY;
|
|
317
|
+
e.onWheelScroll(u), ce(u, h) && d.preventDefault();
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
onResize: () => {
|
|
321
|
+
i.current && n.viewport && s && l({
|
|
322
|
+
content: n.viewport.scrollHeight,
|
|
323
|
+
viewport: n.viewport.offsetHeight,
|
|
324
|
+
scrollbar: {
|
|
325
|
+
size: i.current.clientHeight,
|
|
326
|
+
paddingStart: O(s.paddingTop),
|
|
327
|
+
paddingEnd: O(s.paddingBottom)
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
);
|
|
333
|
+
}), [ve, ee] = q(g), re = c.forwardRef((e, o) => {
|
|
334
|
+
const {
|
|
335
|
+
__scopeScrollArea: r,
|
|
336
|
+
sizes: l,
|
|
337
|
+
hasThumb: t,
|
|
338
|
+
onThumbChange: n,
|
|
339
|
+
onThumbPointerUp: s,
|
|
340
|
+
onThumbPointerDown: a,
|
|
341
|
+
onThumbPositionChange: i,
|
|
342
|
+
onDragScroll: f,
|
|
343
|
+
onWheelScroll: d,
|
|
344
|
+
onResize: h,
|
|
345
|
+
...u
|
|
346
|
+
} = e, m = v(g, r), [p, x] = c.useState(null), M = T(o, (S) => x(S)), P = c.useRef(null), _ = c.useRef(""), U = m.viewport, D = l.content - l.viewport, N = C(d), y = C(i), W = Y(h, 10);
|
|
347
|
+
function H(S) {
|
|
348
|
+
if (P.current) {
|
|
349
|
+
const w = S.clientX - P.current.left, E = S.clientY - P.current.top;
|
|
350
|
+
f({ x: w, y: E });
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return c.useEffect(() => {
|
|
354
|
+
const S = (w) => {
|
|
355
|
+
const E = w.target;
|
|
356
|
+
(p == null ? void 0 : p.contains(E)) && N(w, D);
|
|
357
|
+
};
|
|
358
|
+
return document.addEventListener("wheel", S, { passive: !1 }), () => document.removeEventListener("wheel", S, { passive: !1 });
|
|
359
|
+
}, [U, p, D, N]), c.useEffect(y, [l, y]), A(p, W), A(m.content, W), /* @__PURE__ */ b(
|
|
360
|
+
ve,
|
|
361
|
+
{
|
|
362
|
+
scope: r,
|
|
363
|
+
scrollbar: p,
|
|
364
|
+
hasThumb: t,
|
|
365
|
+
onThumbChange: C(n),
|
|
366
|
+
onThumbPointerUp: C(s),
|
|
367
|
+
onThumbPositionChange: y,
|
|
368
|
+
onThumbPointerDown: C(a),
|
|
369
|
+
children: /* @__PURE__ */ b(
|
|
370
|
+
L.div,
|
|
371
|
+
{
|
|
372
|
+
...u,
|
|
373
|
+
ref: M,
|
|
374
|
+
style: { position: "absolute", ...u.style },
|
|
375
|
+
onPointerDown: R(e.onPointerDown, (S) => {
|
|
376
|
+
S.button === 0 && (S.target.setPointerCapture(S.pointerId), P.current = p.getBoundingClientRect(), _.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", m.viewport && (m.viewport.style.scrollBehavior = "auto"), H(S));
|
|
377
|
+
}),
|
|
378
|
+
onPointerMove: R(e.onPointerMove, H),
|
|
379
|
+
onPointerUp: R(e.onPointerUp, (S) => {
|
|
380
|
+
const w = S.target;
|
|
381
|
+
w.hasPointerCapture(S.pointerId) && w.releasePointerCapture(S.pointerId), document.body.style.webkitUserSelect = _.current, m.viewport && (m.viewport.style.scrollBehavior = ""), P.current = null;
|
|
382
|
+
})
|
|
383
|
+
}
|
|
384
|
+
)
|
|
385
|
+
}
|
|
386
|
+
);
|
|
387
|
+
}), z = "ScrollAreaThumb", oe = c.forwardRef(
|
|
388
|
+
(e, o) => {
|
|
389
|
+
const { forceMount: r, ...l } = e, t = ee(z, e.__scopeScrollArea);
|
|
390
|
+
return /* @__PURE__ */ b(I, { present: r || t.hasThumb, children: /* @__PURE__ */ b(we, { ref: o, ...l }) });
|
|
391
|
+
}
|
|
392
|
+
), we = c.forwardRef(
|
|
393
|
+
(e, o) => {
|
|
394
|
+
const { __scopeScrollArea: r, style: l, ...t } = e, n = v(z, r), s = ee(z, r), { onThumbPositionChange: a } = s, i = T(
|
|
395
|
+
o,
|
|
396
|
+
(h) => s.onThumbChange(h)
|
|
397
|
+
), f = c.useRef(void 0), d = Y(() => {
|
|
398
|
+
f.current && (f.current(), f.current = void 0);
|
|
399
|
+
}, 100);
|
|
400
|
+
return c.useEffect(() => {
|
|
401
|
+
const h = n.viewport;
|
|
402
|
+
if (h) {
|
|
403
|
+
const u = () => {
|
|
404
|
+
if (d(), !f.current) {
|
|
405
|
+
const m = Ce(h, a);
|
|
406
|
+
f.current = m, a();
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
return a(), h.addEventListener("scroll", u), () => h.removeEventListener("scroll", u);
|
|
410
|
+
}
|
|
411
|
+
}, [n.viewport, d, a]), /* @__PURE__ */ b(
|
|
412
|
+
L.div,
|
|
413
|
+
{
|
|
414
|
+
"data-state": s.hasThumb ? "visible" : "hidden",
|
|
415
|
+
...t,
|
|
416
|
+
ref: i,
|
|
417
|
+
style: {
|
|
418
|
+
width: "var(--radix-scroll-area-thumb-width)",
|
|
419
|
+
height: "var(--radix-scroll-area-thumb-height)",
|
|
420
|
+
...l
|
|
421
|
+
},
|
|
422
|
+
onPointerDownCapture: R(e.onPointerDownCapture, (h) => {
|
|
423
|
+
const m = h.target.getBoundingClientRect(), p = h.clientX - m.left, x = h.clientY - m.top;
|
|
424
|
+
s.onThumbPointerDown({ x: p, y: x });
|
|
425
|
+
}),
|
|
426
|
+
onPointerUp: R(e.onPointerUp, s.onThumbPointerUp)
|
|
427
|
+
}
|
|
428
|
+
);
|
|
429
|
+
}
|
|
430
|
+
);
|
|
431
|
+
oe.displayName = z;
|
|
432
|
+
var k = "ScrollAreaCorner", te = c.forwardRef(
|
|
433
|
+
(e, o) => {
|
|
434
|
+
const r = v(k, e.__scopeScrollArea), l = !!(r.scrollbarX && r.scrollbarY);
|
|
435
|
+
return r.type !== "scroll" && l ? /* @__PURE__ */ b(ge, { ...e, ref: o }) : null;
|
|
436
|
+
}
|
|
437
|
+
);
|
|
438
|
+
te.displayName = k;
|
|
439
|
+
var ge = c.forwardRef((e, o) => {
|
|
440
|
+
const { __scopeScrollArea: r, ...l } = e, t = v(k, r), [n, s] = c.useState(0), [a, i] = c.useState(0), f = !!(n && a);
|
|
441
|
+
return A(t.scrollbarX, () => {
|
|
442
|
+
var h;
|
|
443
|
+
const d = ((h = t.scrollbarX) == null ? void 0 : h.offsetHeight) || 0;
|
|
444
|
+
t.onCornerHeightChange(d), i(d);
|
|
445
|
+
}), A(t.scrollbarY, () => {
|
|
446
|
+
var h;
|
|
447
|
+
const d = ((h = t.scrollbarY) == null ? void 0 : h.offsetWidth) || 0;
|
|
448
|
+
t.onCornerWidthChange(d), s(d);
|
|
449
|
+
}), f ? /* @__PURE__ */ b(
|
|
450
|
+
L.div,
|
|
451
|
+
{
|
|
452
|
+
...l,
|
|
453
|
+
ref: o,
|
|
454
|
+
style: {
|
|
455
|
+
width: n,
|
|
456
|
+
height: a,
|
|
457
|
+
position: "absolute",
|
|
458
|
+
right: t.dir === "ltr" ? 0 : void 0,
|
|
459
|
+
left: t.dir === "rtl" ? 0 : void 0,
|
|
460
|
+
bottom: 0,
|
|
461
|
+
...e.style
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
) : null;
|
|
465
|
+
});
|
|
466
|
+
function O(e) {
|
|
467
|
+
return e ? parseInt(e, 10) : 0;
|
|
468
|
+
}
|
|
469
|
+
function ne(e, o) {
|
|
470
|
+
const r = e / o;
|
|
471
|
+
return isNaN(r) ? 0 : r;
|
|
472
|
+
}
|
|
473
|
+
function X(e) {
|
|
474
|
+
const o = ne(e.viewport, e.content), r = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, l = (e.scrollbar.size - r) * o;
|
|
475
|
+
return Math.max(l, 18);
|
|
476
|
+
}
|
|
477
|
+
function Pe(e, o, r, l = "ltr") {
|
|
478
|
+
const t = X(r), n = t / 2, s = o || n, a = t - s, i = r.scrollbar.paddingStart + s, f = r.scrollbar.size - r.scrollbar.paddingEnd - a, d = r.content - r.viewport, h = l === "ltr" ? [0, d] : [d * -1, 0];
|
|
479
|
+
return le([i, f], h)(e);
|
|
480
|
+
}
|
|
481
|
+
function F(e, o, r = "ltr") {
|
|
482
|
+
const l = X(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], f = ue(e, i);
|
|
483
|
+
return le([0, s], [0, a])(f);
|
|
484
|
+
}
|
|
485
|
+
function le(e, o) {
|
|
486
|
+
return (r) => {
|
|
487
|
+
if (e[0] === e[1] || o[0] === o[1]) return o[0];
|
|
488
|
+
const l = (o[1] - o[0]) / (e[1] - e[0]);
|
|
489
|
+
return o[0] + l * (r - e[0]);
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
function ce(e, o) {
|
|
493
|
+
return e > 0 && e < o;
|
|
494
|
+
}
|
|
495
|
+
var Ce = (e, o = () => {
|
|
496
|
+
}) => {
|
|
497
|
+
let r = { left: e.scrollLeft, top: e.scrollTop }, l = 0;
|
|
498
|
+
return function t() {
|
|
499
|
+
const n = { left: e.scrollLeft, top: e.scrollTop }, s = r.left !== n.left, a = r.top !== n.top;
|
|
500
|
+
(s || a) && o(), r = n, l = window.requestAnimationFrame(t);
|
|
501
|
+
}(), () => window.cancelAnimationFrame(l);
|
|
502
|
+
};
|
|
503
|
+
function Y(e, o) {
|
|
504
|
+
const r = C(e), l = c.useRef(0);
|
|
505
|
+
return c.useEffect(() => () => window.clearTimeout(l.current), []), c.useCallback(() => {
|
|
506
|
+
window.clearTimeout(l.current), l.current = window.setTimeout(r, o);
|
|
507
|
+
}, [r, o]);
|
|
508
|
+
}
|
|
509
|
+
function A(e, o) {
|
|
510
|
+
const r = C(o);
|
|
511
|
+
de(() => {
|
|
512
|
+
let l = 0;
|
|
513
|
+
if (e) {
|
|
514
|
+
const t = new ResizeObserver(() => {
|
|
515
|
+
cancelAnimationFrame(l), l = window.requestAnimationFrame(r);
|
|
516
|
+
});
|
|
517
|
+
return t.observe(e), () => {
|
|
518
|
+
window.cancelAnimationFrame(l), t.unobserve(e);
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
}, [e, r]);
|
|
522
|
+
}
|
|
523
|
+
var Re = G, Ee = K, Ae = te;
|
|
524
|
+
function Me({
|
|
525
|
+
className: e,
|
|
526
|
+
children: o,
|
|
527
|
+
...r
|
|
528
|
+
}) {
|
|
529
|
+
return /* @__PURE__ */ $(
|
|
530
|
+
Re,
|
|
531
|
+
{
|
|
532
|
+
className: j("relative", e),
|
|
533
|
+
"data-slot": "scroll-area",
|
|
534
|
+
...r,
|
|
535
|
+
children: [
|
|
536
|
+
/* @__PURE__ */ b(
|
|
537
|
+
Ee,
|
|
538
|
+
{
|
|
539
|
+
className: "size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:outline-1 focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
540
|
+
"data-slot": "scroll-area-viewport",
|
|
541
|
+
children: o
|
|
542
|
+
}
|
|
543
|
+
),
|
|
544
|
+
/* @__PURE__ */ b(Te, {}),
|
|
545
|
+
/* @__PURE__ */ b(Ae, {})
|
|
546
|
+
]
|
|
547
|
+
}
|
|
548
|
+
);
|
|
549
|
+
}
|
|
550
|
+
function Te({
|
|
551
|
+
className: e,
|
|
552
|
+
orientation: o = "vertical",
|
|
553
|
+
...r
|
|
554
|
+
}) {
|
|
555
|
+
return /* @__PURE__ */ b(
|
|
556
|
+
Q,
|
|
557
|
+
{
|
|
558
|
+
className: j(
|
|
559
|
+
"flex touch-none select-none p-px transition-colors",
|
|
560
|
+
o === "vertical" && "h-full w-2.5 border-l border-l-transparent",
|
|
561
|
+
o === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
|
|
562
|
+
e
|
|
563
|
+
),
|
|
564
|
+
"data-slot": "scroll-area-scrollbar",
|
|
565
|
+
orientation: o,
|
|
566
|
+
...r,
|
|
567
|
+
children: /* @__PURE__ */ b(
|
|
568
|
+
oe,
|
|
569
|
+
{
|
|
570
|
+
className: "relative flex-1 rounded-full bg-border",
|
|
571
|
+
"data-slot": "scroll-area-thumb"
|
|
572
|
+
}
|
|
573
|
+
)
|
|
574
|
+
}
|
|
575
|
+
);
|
|
576
|
+
}
|
|
577
|
+
export {
|
|
578
|
+
Me as ScrollArea,
|
|
579
|
+
Te as ScrollBar
|
|
580
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
2
|
+
import type * as React from 'react';
|
|
3
|
+
declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
7
|
+
size?: 'sm' | 'default';
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function SelectContent({ className, children, position, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|