@factorialco/f0-react 14.31.3 → 15.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/{ArchiveThumbnail-DqVIQZoW.js → ArchiveThumbnail-CMOY3hug.js} +5 -5
- package/dist/{ArchiveViewer-b2Wp0JUG.js → ArchiveViewer-Bc5iN2gm.js} +15 -15
- package/dist/{ChatPostComposerDialog-Zsz4Ni_S.js → ChatPostComposerDialog-NOdBRHQW.js} +3 -3
- package/dist/{CoachmarkProvider-C78Xiefk.js → CoachmarkProvider-CQE9J_S1.js} +26525 -26539
- package/dist/{CodeThumbnail-u2nL4mSO.js → CodeThumbnail-JLPjPSHE.js} +1 -1
- package/dist/{CodeViewer-hVg25taQ.js → CodeViewer-HhRZ_KtU.js} +8 -8
- package/dist/{DocumentToolbar-DY5GWF2m.js → DocumentToolbar-C3YeGLiY.js} +5 -5
- package/dist/{DocxViewer-BvNPALXn.js → DocxViewer-B_pUywX2.js} +3 -3
- package/dist/{F0AiProcessingOverlay-DJL2v246.js → F0AiProcessingOverlay-CreyUmNt.js} +2869 -2398
- package/dist/{F0Alert-BLx10d2-.js → F0Alert-Dfw9wvmG.js} +15 -15
- package/dist/F0AudioPlayer-BqKZE5cb.js +2 -0
- package/dist/{F0Button-BfcH39fa.js → F0Button-Hs9dD3kp.js} +3281 -3224
- package/dist/{F0CanvasPanel-D7WW8pd6.js → F0CanvasPanel-QAikAHrt.js} +9045 -8669
- package/dist/F0CanvasPanel.css +1 -1
- package/dist/{F0DocumentViewer-DqmvgGr8.js → F0DocumentViewer-BBZNZzXF.js} +1 -1
- package/dist/{F0DocumentViewer-CjrlS3ZO.js → F0DocumentViewer-DtBBvHeY.js} +4 -4
- package/dist/{F0Icon-BODMWayd.js → F0Icon-C0Ks-zGo.js} +1 -1
- package/dist/{F0Map-CVeX6rRX.js → F0Map-DrGsOz1c.js} +609 -599
- package/dist/{F0Select-CYFD0h9x.js → F0Select-D8elfH2c.js} +7134 -7107
- package/dist/{F0Text-DYI-dgwG.js → F0Text-BdLMC6rw.js} +2 -2
- package/dist/F0VideoPlayer-BzehPrsz.js +1 -0
- package/dist/{F0VideoPlayer-Z7YNLq4v.js → F0VideoPlayer-mLzBl6O5.js} +255 -255
- package/dist/{HtmlThumbnail-CENW-PSn.js → HtmlThumbnail-C2fHnIU5.js} +1 -1
- package/dist/{HtmlViewer-CkYgtVYE.js → HtmlViewer-CNHsP0_Q.js} +9 -9
- package/dist/{LayoutGroup-BDMkthvj.js → LayoutGroup-B5tU1ztA.js} +14 -14
- package/dist/{Map-BDHD0YwP.js → Map-Cfzh4DYS.js} +13 -13
- package/dist/{PdfThumbnail-8GNGxMJt.js → PdfThumbnail-BhMepsUK.js} +1 -1
- package/dist/{PdfViewer-Dnw3HwAO.js → PdfViewer-CL30Vr4B.js} +11 -11
- package/dist/{SandboxedHtmlFrame-DulTTwnE.js → SandboxedHtmlFrame-QjmWXSV-.js} +2 -2
- package/dist/{SheetViewer-zWlafaWN.js → SheetViewer-Cs_vLeh4.js} +15 -15
- package/dist/{TextViewer-Z77_eAGH.js → TextViewer-CGoMovpP.js} +4 -4
- package/dist/ai.d.ts +4 -4
- package/dist/ai.js +5 -5
- package/dist/component-status.js +34 -12
- package/dist/{dist-Cuwaibqg.js → dist-BCNVh6y5.js} +2 -1
- package/dist/dist-C8J2FPJo.js +970 -0
- package/dist/{dist-Dh-hHue-.js → dist-CJIEhLuL.js} +3 -3
- package/dist/dist-CQSuXDpA.js +12 -0
- package/dist/{dist-B1ho8lUr.js → dist-DVsrUl0U.js} +6 -6
- package/dist/{dist-CYzeNTKV.js → dist-DpAd2wW2.js} +40 -40
- package/dist/experimental.d.ts +92 -77
- package/dist/experimental.js +6667 -7067
- package/dist/{exports-Ck-BjPQ_.d.ts → exports-BSI98RKf.d.ts} +96 -94
- package/dist/f0.d.ts +52 -8
- package/dist/f0.js +1761 -1761
- package/dist/{google-D1V0swd7.js → google-CG30Y63J.js} +1 -1
- package/dist/{highlight-CXWCrLa3.js → highlight-DUGKJ8WM.js} +7 -7
- package/dist/{i18n-provider-C0z4575b.js → i18n-provider-DoTL-0tJ.js} +1 -1
- package/dist/{i18n-provider-defaults-D87XbZtT.d.ts → i18n-provider-defaults-BkNbvakp.d.ts} +21 -15
- package/dist/{i18n-provider-defaults-BeyCAnkS.js → i18n-provider-defaults-ZqFx7uFw.js} +21 -19
- package/dist/i18n-provider-defaults.d.ts +1 -1
- package/dist/i18n-provider-defaults.js +1 -1
- package/dist/{index-BakET5p_.d.ts → index-CeGTmQfe.d.ts} +308 -385
- package/dist/{maplibre-HGgd69Ss.js → maplibre-iSstWV_1.js} +2 -2
- package/dist/{pdfWorker-t0S8Tmzi.js → pdfWorker-DwNAnhfp.js} +1 -1
- package/dist/{popover-BsFj9cmb.js → popover-CCSQvMSp.js} +898 -1678
- package/dist/{skeleton-DWdckpXm.js → skeleton-BsalZgC5.js} +1 -1
- package/dist/styles.css +1 -1
- package/dist/{toolbarStyles-B9vf6pee.js → toolbarStyles-DGCICoyx.js} +1 -1
- package/dist/{types-BqSHd7u-.d.ts → types-Brch_2zb.d.ts} +2 -2
- package/dist/{useData-C7KI_3q1.js → useData-D4FE64eT.js} +110 -109
- package/package.json +6 -3
- package/tailwind.config.ts +49 -0
- package/dist/F0AudioPlayer-D6O-SSQc.js +0 -2
- package/dist/F0VideoPlayer-DSAREEuf.js +0 -1
- package/dist/scrollarea-CStky4Xl.js +0 -691
|
@@ -0,0 +1,970 @@
|
|
|
1
|
+
import { L as e } from "./tooltip-DFMOxXQO.js";
|
|
2
|
+
import { i as t, r as n } from "./F0Button-Hs9dD3kp.js";
|
|
3
|
+
import { o as r } from "./F0Icon-C0Ks-zGo.js";
|
|
4
|
+
import * as i from "react";
|
|
5
|
+
import { createElement as a, forwardRef as o, useEffect as s, useRef as c } from "react";
|
|
6
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
import * as f from "react-dom";
|
|
8
|
+
//#region src/elements/Text/variants.ts
|
|
9
|
+
var p = r({
|
|
10
|
+
base: "text-base text-f1-foreground",
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
heading: "text-lg font-semibold",
|
|
14
|
+
body: "",
|
|
15
|
+
description: "text-f1-foreground-secondary",
|
|
16
|
+
small: "text-sm font-medium text-f1-foreground-secondary",
|
|
17
|
+
inverse: "text-f1-foreground-inverse",
|
|
18
|
+
code: "text-f1-foreground-secondary",
|
|
19
|
+
label: "font-medium",
|
|
20
|
+
"heading-large": "text-2xl font-semibold",
|
|
21
|
+
"label-input": "font-medium text-f1-foreground-secondary",
|
|
22
|
+
selected: "font-medium text-f1-foreground-selected",
|
|
23
|
+
warning: "text-f1-foreground-warning",
|
|
24
|
+
critical: "text-f1-foreground-critical",
|
|
25
|
+
positive: "text-f1-foreground-positive",
|
|
26
|
+
info: "text-f1-foreground-info",
|
|
27
|
+
"warning-strong": "font-semibold text-f1-foreground-warning",
|
|
28
|
+
"critical-strong": "font-semibold text-f1-foreground-critical",
|
|
29
|
+
"positive-strong": "font-semibold text-f1-foreground-positive",
|
|
30
|
+
"info-strong": "font-semibold text-f1-foreground-info"
|
|
31
|
+
},
|
|
32
|
+
align: {
|
|
33
|
+
left: "text-left",
|
|
34
|
+
center: "text-center",
|
|
35
|
+
right: "text-right"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
defaultVariants: {
|
|
39
|
+
variant: "body",
|
|
40
|
+
align: "left"
|
|
41
|
+
}
|
|
42
|
+
}), m = {
|
|
43
|
+
"heading-large": "h1",
|
|
44
|
+
heading: "h2",
|
|
45
|
+
body: "p",
|
|
46
|
+
description: "p",
|
|
47
|
+
label: "p",
|
|
48
|
+
"label-input": "label",
|
|
49
|
+
small: "p",
|
|
50
|
+
selected: "p",
|
|
51
|
+
inverse: "p",
|
|
52
|
+
warning: "p",
|
|
53
|
+
critical: "p",
|
|
54
|
+
positive: "p",
|
|
55
|
+
info: "p",
|
|
56
|
+
"warning-strong": "p",
|
|
57
|
+
"critical-strong": "p",
|
|
58
|
+
"positive-strong": "p",
|
|
59
|
+
"info-strong": "p",
|
|
60
|
+
code: "code"
|
|
61
|
+
}, h = o(({ content: r, variant: i, align: o, className: s, as: c, ellipsis: l, noEllipsisTooltip: d, markdown: f, required: h, ...g }, _) => {
|
|
62
|
+
let v = c ?? m[i ?? "body"], y = h ? /* @__PURE__ */ u("span", {
|
|
63
|
+
className: "text-f1-foreground-critical",
|
|
64
|
+
"aria-hidden": "true",
|
|
65
|
+
children: " *"
|
|
66
|
+
}) : null;
|
|
67
|
+
if (l !== void 0) {
|
|
68
|
+
let t = typeof l == "number" ? l : 1;
|
|
69
|
+
return y ? a(v, {
|
|
70
|
+
...g,
|
|
71
|
+
className: e(p({
|
|
72
|
+
variant: i,
|
|
73
|
+
align: o
|
|
74
|
+
}), s, "inline-flex gap-0.5"),
|
|
75
|
+
ref: _
|
|
76
|
+
}, /* @__PURE__ */ u(n, {
|
|
77
|
+
lines: t,
|
|
78
|
+
noTooltip: d,
|
|
79
|
+
tag: "span",
|
|
80
|
+
className: "min-w-0",
|
|
81
|
+
markdown: f,
|
|
82
|
+
children: r
|
|
83
|
+
}), y) : /* @__PURE__ */ u(n, {
|
|
84
|
+
ref: _,
|
|
85
|
+
lines: t,
|
|
86
|
+
noTooltip: d,
|
|
87
|
+
tag: v,
|
|
88
|
+
className: e(p({
|
|
89
|
+
variant: i,
|
|
90
|
+
align: o
|
|
91
|
+
}), s),
|
|
92
|
+
markdown: f,
|
|
93
|
+
...g,
|
|
94
|
+
children: r
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (f) {
|
|
98
|
+
let n = t(r);
|
|
99
|
+
return y ? a(v, {
|
|
100
|
+
...g,
|
|
101
|
+
className: e(p({
|
|
102
|
+
variant: i,
|
|
103
|
+
align: o
|
|
104
|
+
}), s),
|
|
105
|
+
ref: _
|
|
106
|
+
}, /* @__PURE__ */ u("span", { dangerouslySetInnerHTML: { __html: n } }), y) : a(v, {
|
|
107
|
+
...g,
|
|
108
|
+
className: e(p({
|
|
109
|
+
variant: i,
|
|
110
|
+
align: o
|
|
111
|
+
}), s),
|
|
112
|
+
ref: _,
|
|
113
|
+
dangerouslySetInnerHTML: { __html: n }
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return a(v, {
|
|
117
|
+
...g,
|
|
118
|
+
className: e(p({
|
|
119
|
+
variant: i,
|
|
120
|
+
align: o
|
|
121
|
+
}), s),
|
|
122
|
+
ref: _
|
|
123
|
+
}, r, y);
|
|
124
|
+
});
|
|
125
|
+
h.displayName = "Text";
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-context@1.1.1_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-context/dist/index.mjs
|
|
128
|
+
function g(e, t = []) {
|
|
129
|
+
let n = [];
|
|
130
|
+
function r(t, r) {
|
|
131
|
+
let a = i.createContext(r), o = n.length;
|
|
132
|
+
n = [...n, r];
|
|
133
|
+
let s = (t) => {
|
|
134
|
+
let { scope: n, children: r, ...s } = t, c = n?.[e]?.[o] || a, l = i.useMemo(() => s, Object.values(s));
|
|
135
|
+
return /* @__PURE__ */ u(c.Provider, {
|
|
136
|
+
value: l,
|
|
137
|
+
children: r
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
s.displayName = t + "Provider";
|
|
141
|
+
function c(n, s) {
|
|
142
|
+
let c = s?.[e]?.[o] || a, l = i.useContext(c);
|
|
143
|
+
if (l) return l;
|
|
144
|
+
if (r !== void 0) return r;
|
|
145
|
+
throw Error(`\`${n}\` must be used within \`${t}\``);
|
|
146
|
+
}
|
|
147
|
+
return [s, c];
|
|
148
|
+
}
|
|
149
|
+
let a = () => {
|
|
150
|
+
let t = n.map((e) => i.createContext(e));
|
|
151
|
+
return function(n) {
|
|
152
|
+
let r = n?.[e] || t;
|
|
153
|
+
return i.useMemo(() => ({ [`__scope${e}`]: {
|
|
154
|
+
...n,
|
|
155
|
+
[e]: r
|
|
156
|
+
} }), [n, r]);
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
return a.scopeName = e, [r, _(a, ...t)];
|
|
160
|
+
}
|
|
161
|
+
function _(...e) {
|
|
162
|
+
let t = e[0];
|
|
163
|
+
if (e.length === 1) return t;
|
|
164
|
+
let n = () => {
|
|
165
|
+
let n = e.map((e) => ({
|
|
166
|
+
useScope: e(),
|
|
167
|
+
scopeName: e.scopeName
|
|
168
|
+
}));
|
|
169
|
+
return function(e) {
|
|
170
|
+
let r = n.reduce((t, { useScope: n, scopeName: r }) => {
|
|
171
|
+
let i = n(e)[`__scope${r}`];
|
|
172
|
+
return {
|
|
173
|
+
...t,
|
|
174
|
+
...i
|
|
175
|
+
};
|
|
176
|
+
}, {});
|
|
177
|
+
return i.useMemo(() => ({ [`__scope${t.scopeName}`]: r }), [r]);
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
return n.scopeName = t.scopeName, n;
|
|
181
|
+
}
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.0_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
184
|
+
function v(e) {
|
|
185
|
+
let t = i.useRef(e);
|
|
186
|
+
return i.useEffect(() => {
|
|
187
|
+
t.current = e;
|
|
188
|
+
}), i.useMemo(() => (...e) => t.current?.(...e), []);
|
|
189
|
+
}
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.0_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
192
|
+
var y = globalThis?.document ? i.useLayoutEffect : () => {};
|
|
193
|
+
//#endregion
|
|
194
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.1_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
195
|
+
function b(e, t) {
|
|
196
|
+
if (typeof e == "function") return e(t);
|
|
197
|
+
e != null && (e.current = t);
|
|
198
|
+
}
|
|
199
|
+
function x(...e) {
|
|
200
|
+
return (t) => {
|
|
201
|
+
let n = !1, r = e.map((e) => {
|
|
202
|
+
let r = b(e, t);
|
|
203
|
+
return !n && typeof r == "function" && (n = !0), r;
|
|
204
|
+
});
|
|
205
|
+
if (n) return () => {
|
|
206
|
+
for (let t = 0; t < r.length; t++) {
|
|
207
|
+
let n = r[t];
|
|
208
|
+
typeof n == "function" ? n() : b(e[t], null);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
function S(...e) {
|
|
214
|
+
return i.useCallback(x(...e), e);
|
|
215
|
+
}
|
|
216
|
+
//#endregion
|
|
217
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-slot@1.1.1_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
218
|
+
var C = i.forwardRef((e, t) => {
|
|
219
|
+
let { children: n, ...r } = e, a = i.Children.toArray(n), o = a.find(E);
|
|
220
|
+
if (o) {
|
|
221
|
+
let e = o.props.children, n = a.map((t) => t === o ? i.Children.count(e) > 1 ? i.Children.only(null) : i.isValidElement(e) ? e.props.children : null : t);
|
|
222
|
+
return /* @__PURE__ */ u(w, {
|
|
223
|
+
...r,
|
|
224
|
+
ref: t,
|
|
225
|
+
children: i.isValidElement(e) ? i.cloneElement(e, void 0, n) : null
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
return /* @__PURE__ */ u(w, {
|
|
229
|
+
...r,
|
|
230
|
+
ref: t,
|
|
231
|
+
children: n
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
C.displayName = "Slot";
|
|
235
|
+
var w = i.forwardRef((e, t) => {
|
|
236
|
+
let { children: n, ...r } = e;
|
|
237
|
+
if (i.isValidElement(n)) {
|
|
238
|
+
let e = O(n);
|
|
239
|
+
return i.cloneElement(n, {
|
|
240
|
+
...D(r, n.props),
|
|
241
|
+
ref: t ? x(t, e) : e
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
return i.Children.count(n) > 1 ? i.Children.only(null) : null;
|
|
245
|
+
});
|
|
246
|
+
w.displayName = "SlotClone";
|
|
247
|
+
var T = ({ children: e }) => /* @__PURE__ */ u(l, { children: e });
|
|
248
|
+
function E(e) {
|
|
249
|
+
return i.isValidElement(e) && e.type === T;
|
|
250
|
+
}
|
|
251
|
+
function D(e, t) {
|
|
252
|
+
let n = { ...t };
|
|
253
|
+
for (let r in t) {
|
|
254
|
+
let i = e[r], a = t[r];
|
|
255
|
+
/^on[A-Z]/.test(r) ? i && a ? n[r] = (...e) => {
|
|
256
|
+
a(...e), i(...e);
|
|
257
|
+
} : i && (n[r] = i) : r === "style" ? n[r] = {
|
|
258
|
+
...i,
|
|
259
|
+
...a
|
|
260
|
+
} : r === "className" && (n[r] = [i, a].filter(Boolean).join(" "));
|
|
261
|
+
}
|
|
262
|
+
return {
|
|
263
|
+
...e,
|
|
264
|
+
...n
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
function O(e) {
|
|
268
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
269
|
+
return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
270
|
+
}
|
|
271
|
+
//#endregion
|
|
272
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-primitive@2.0.1_@types+react-dom@18.3.1_@types+react@18.3.18_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
273
|
+
var k = [
|
|
274
|
+
"a",
|
|
275
|
+
"button",
|
|
276
|
+
"div",
|
|
277
|
+
"form",
|
|
278
|
+
"h2",
|
|
279
|
+
"h3",
|
|
280
|
+
"img",
|
|
281
|
+
"input",
|
|
282
|
+
"label",
|
|
283
|
+
"li",
|
|
284
|
+
"nav",
|
|
285
|
+
"ol",
|
|
286
|
+
"p",
|
|
287
|
+
"span",
|
|
288
|
+
"svg",
|
|
289
|
+
"ul"
|
|
290
|
+
].reduce((e, t) => {
|
|
291
|
+
let n = i.forwardRef((e, n) => {
|
|
292
|
+
let { asChild: r, ...i } = e, a = r ? C : t;
|
|
293
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ u(a, {
|
|
294
|
+
...i,
|
|
295
|
+
ref: n
|
|
296
|
+
});
|
|
297
|
+
});
|
|
298
|
+
return n.displayName = `Primitive.${t}`, {
|
|
299
|
+
...e,
|
|
300
|
+
[t]: n
|
|
301
|
+
};
|
|
302
|
+
}, {});
|
|
303
|
+
function A(e, t) {
|
|
304
|
+
e && f.flushSync(() => e.dispatchEvent(t));
|
|
305
|
+
}
|
|
306
|
+
//#endregion
|
|
307
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-presence@1.1.2_@types+react-dom@18.3.1_@types+react@18.3.18_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
308
|
+
function ee(e, t) {
|
|
309
|
+
return i.useReducer((e, n) => t[e][n] ?? e, e);
|
|
310
|
+
}
|
|
311
|
+
var j = (e) => {
|
|
312
|
+
let { present: t, children: n } = e, r = te(t), a = typeof n == "function" ? n({ present: r.isPresent }) : i.Children.only(n), o = S(r.ref, ne(a));
|
|
313
|
+
return typeof n == "function" || r.isPresent ? i.cloneElement(a, { ref: o }) : null;
|
|
314
|
+
};
|
|
315
|
+
j.displayName = "Presence";
|
|
316
|
+
function te(e) {
|
|
317
|
+
let [t, n] = i.useState(), r = i.useRef({}), a = i.useRef(e), o = i.useRef("none"), [s, c] = ee(e ? "mounted" : "unmounted", {
|
|
318
|
+
mounted: {
|
|
319
|
+
UNMOUNT: "unmounted",
|
|
320
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
321
|
+
},
|
|
322
|
+
unmountSuspended: {
|
|
323
|
+
MOUNT: "mounted",
|
|
324
|
+
ANIMATION_END: "unmounted"
|
|
325
|
+
},
|
|
326
|
+
unmounted: { MOUNT: "mounted" }
|
|
327
|
+
});
|
|
328
|
+
return i.useEffect(() => {
|
|
329
|
+
let e = M(r.current);
|
|
330
|
+
o.current = s === "mounted" ? e : "none";
|
|
331
|
+
}, [s]), y(() => {
|
|
332
|
+
let t = r.current, n = a.current;
|
|
333
|
+
if (n !== e) {
|
|
334
|
+
let r = o.current, i = M(t);
|
|
335
|
+
e ? c("MOUNT") : i === "none" || t?.display === "none" ? c("UNMOUNT") : c(n && r !== i ? "ANIMATION_OUT" : "UNMOUNT"), a.current = e;
|
|
336
|
+
}
|
|
337
|
+
}, [e, c]), y(() => {
|
|
338
|
+
if (t) {
|
|
339
|
+
let e, n = t.ownerDocument.defaultView ?? window, i = (i) => {
|
|
340
|
+
let o = M(r.current).includes(i.animationName);
|
|
341
|
+
if (i.target === t && o && (c("ANIMATION_END"), !a.current)) {
|
|
342
|
+
let r = t.style.animationFillMode;
|
|
343
|
+
t.style.animationFillMode = "forwards", e = n.setTimeout(() => {
|
|
344
|
+
t.style.animationFillMode === "forwards" && (t.style.animationFillMode = r);
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
}, s = (e) => {
|
|
348
|
+
e.target === t && (o.current = M(r.current));
|
|
349
|
+
};
|
|
350
|
+
return t.addEventListener("animationstart", s), t.addEventListener("animationcancel", i), t.addEventListener("animationend", i), () => {
|
|
351
|
+
n.clearTimeout(e), t.removeEventListener("animationstart", s), t.removeEventListener("animationcancel", i), t.removeEventListener("animationend", i);
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
c("ANIMATION_END");
|
|
355
|
+
}, [t, c]), {
|
|
356
|
+
isPresent: ["mounted", "unmountSuspended"].includes(s),
|
|
357
|
+
ref: i.useCallback((e) => {
|
|
358
|
+
e && (r.current = getComputedStyle(e)), n(e);
|
|
359
|
+
}, [])
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
function M(e) {
|
|
363
|
+
return e?.animationName || "none";
|
|
364
|
+
}
|
|
365
|
+
function ne(e) {
|
|
366
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
367
|
+
return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
368
|
+
}
|
|
369
|
+
//#endregion
|
|
370
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-direction@1.1.0_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
371
|
+
var re = i.createContext(void 0);
|
|
372
|
+
function N(e) {
|
|
373
|
+
let t = i.useContext(re);
|
|
374
|
+
return e || t || "ltr";
|
|
375
|
+
}
|
|
376
|
+
//#endregion
|
|
377
|
+
//#region ../../node_modules/.pnpm/@radix-ui+number@1.1.0/node_modules/@radix-ui/number/dist/index.mjs
|
|
378
|
+
function ie(e, [t, n]) {
|
|
379
|
+
return Math.min(n, Math.max(t, e));
|
|
380
|
+
}
|
|
381
|
+
//#endregion
|
|
382
|
+
//#region ../../node_modules/.pnpm/@radix-ui+primitive@1.1.1/node_modules/@radix-ui/primitive/dist/index.mjs
|
|
383
|
+
function P(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
384
|
+
return function(r) {
|
|
385
|
+
if (e?.(r), n === !1 || !r.defaultPrevented) return t?.(r);
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
//#endregion
|
|
389
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-scroll-area@1.2.2_@types+react-dom@18.3.1_@types+react@18.3.18_react-do_d1c2e430632c5110d1500ba7deeafccd/node_modules/@radix-ui/react-scroll-area/dist/index.mjs
|
|
390
|
+
function ae(e, t) {
|
|
391
|
+
return i.useReducer((e, n) => t[e][n] ?? e, e);
|
|
392
|
+
}
|
|
393
|
+
var F = "ScrollArea", [oe, se] = g(F), [ce, I] = oe(F), le = i.forwardRef((e, t) => {
|
|
394
|
+
let { __scopeScrollArea: n, type: r = "hover", dir: a, scrollHideDelay: o = 600, ...s } = e, [c, l] = i.useState(null), [d, f] = i.useState(null), [p, m] = i.useState(null), [h, g] = i.useState(null), [_, v] = i.useState(null), [y, b] = i.useState(0), [x, C] = i.useState(0), [w, T] = i.useState(!1), [E, D] = i.useState(!1), O = S(t, (e) => l(e)), A = N(a);
|
|
395
|
+
return /* @__PURE__ */ u(ce, {
|
|
396
|
+
scope: n,
|
|
397
|
+
type: r,
|
|
398
|
+
dir: A,
|
|
399
|
+
scrollHideDelay: o,
|
|
400
|
+
scrollArea: c,
|
|
401
|
+
viewport: d,
|
|
402
|
+
onViewportChange: f,
|
|
403
|
+
content: p,
|
|
404
|
+
onContentChange: m,
|
|
405
|
+
scrollbarX: h,
|
|
406
|
+
onScrollbarXChange: g,
|
|
407
|
+
scrollbarXEnabled: w,
|
|
408
|
+
onScrollbarXEnabledChange: T,
|
|
409
|
+
scrollbarY: _,
|
|
410
|
+
onScrollbarYChange: v,
|
|
411
|
+
scrollbarYEnabled: E,
|
|
412
|
+
onScrollbarYEnabledChange: D,
|
|
413
|
+
onCornerWidthChange: b,
|
|
414
|
+
onCornerHeightChange: C,
|
|
415
|
+
children: /* @__PURE__ */ u(k.div, {
|
|
416
|
+
dir: A,
|
|
417
|
+
...s,
|
|
418
|
+
ref: O,
|
|
419
|
+
style: {
|
|
420
|
+
position: "relative",
|
|
421
|
+
"--radix-scroll-area-corner-width": y + "px",
|
|
422
|
+
"--radix-scroll-area-corner-height": x + "px",
|
|
423
|
+
...e.style
|
|
424
|
+
}
|
|
425
|
+
})
|
|
426
|
+
});
|
|
427
|
+
});
|
|
428
|
+
le.displayName = F;
|
|
429
|
+
var ue = "ScrollAreaViewport", de = i.forwardRef((e, t) => {
|
|
430
|
+
let { __scopeScrollArea: n, children: r, nonce: a, ...o } = e, s = I(ue, n), c = S(t, i.useRef(null), s.onViewportChange);
|
|
431
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("style", {
|
|
432
|
+
dangerouslySetInnerHTML: { __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}" },
|
|
433
|
+
nonce: a
|
|
434
|
+
}), /* @__PURE__ */ u(k.div, {
|
|
435
|
+
"data-radix-scroll-area-viewport": "",
|
|
436
|
+
...o,
|
|
437
|
+
ref: c,
|
|
438
|
+
style: {
|
|
439
|
+
overflowX: s.scrollbarXEnabled ? "scroll" : "hidden",
|
|
440
|
+
overflowY: s.scrollbarYEnabled ? "scroll" : "hidden",
|
|
441
|
+
...e.style
|
|
442
|
+
},
|
|
443
|
+
children: /* @__PURE__ */ u("div", {
|
|
444
|
+
ref: s.onContentChange,
|
|
445
|
+
style: {
|
|
446
|
+
minWidth: "100%",
|
|
447
|
+
display: "table"
|
|
448
|
+
},
|
|
449
|
+
children: r
|
|
450
|
+
})
|
|
451
|
+
})] });
|
|
452
|
+
});
|
|
453
|
+
de.displayName = ue;
|
|
454
|
+
var L = "ScrollAreaScrollbar", R = i.forwardRef((e, t) => {
|
|
455
|
+
let { forceMount: n, ...r } = e, a = I(L, e.__scopeScrollArea), { onScrollbarXEnabledChange: o, onScrollbarYEnabledChange: s } = a, c = e.orientation === "horizontal";
|
|
456
|
+
return i.useEffect(() => (c ? o(!0) : s(!0), () => {
|
|
457
|
+
c ? o(!1) : s(!1);
|
|
458
|
+
}), [
|
|
459
|
+
c,
|
|
460
|
+
o,
|
|
461
|
+
s
|
|
462
|
+
]), a.type === "hover" ? /* @__PURE__ */ u(fe, {
|
|
463
|
+
...r,
|
|
464
|
+
ref: t,
|
|
465
|
+
forceMount: n
|
|
466
|
+
}) : a.type === "scroll" ? /* @__PURE__ */ u(pe, {
|
|
467
|
+
...r,
|
|
468
|
+
ref: t,
|
|
469
|
+
forceMount: n
|
|
470
|
+
}) : a.type === "auto" ? /* @__PURE__ */ u(z, {
|
|
471
|
+
...r,
|
|
472
|
+
ref: t,
|
|
473
|
+
forceMount: n
|
|
474
|
+
}) : a.type === "always" ? /* @__PURE__ */ u(B, {
|
|
475
|
+
...r,
|
|
476
|
+
ref: t
|
|
477
|
+
}) : null;
|
|
478
|
+
});
|
|
479
|
+
R.displayName = L;
|
|
480
|
+
var fe = i.forwardRef((e, t) => {
|
|
481
|
+
let { forceMount: n, ...r } = e, a = I(L, e.__scopeScrollArea), [o, s] = i.useState(!1);
|
|
482
|
+
return i.useEffect(() => {
|
|
483
|
+
let e = a.scrollArea, t = 0;
|
|
484
|
+
if (e) {
|
|
485
|
+
let n = () => {
|
|
486
|
+
window.clearTimeout(t), s(!0);
|
|
487
|
+
}, r = () => {
|
|
488
|
+
t = window.setTimeout(() => s(!1), a.scrollHideDelay);
|
|
489
|
+
};
|
|
490
|
+
return e.addEventListener("pointerenter", n), e.addEventListener("pointerleave", r), () => {
|
|
491
|
+
window.clearTimeout(t), e.removeEventListener("pointerenter", n), e.removeEventListener("pointerleave", r);
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
}, [a.scrollArea, a.scrollHideDelay]), /* @__PURE__ */ u(j, {
|
|
495
|
+
present: n || o,
|
|
496
|
+
children: /* @__PURE__ */ u(z, {
|
|
497
|
+
"data-state": o ? "visible" : "hidden",
|
|
498
|
+
...r,
|
|
499
|
+
ref: t
|
|
500
|
+
})
|
|
501
|
+
});
|
|
502
|
+
}), pe = i.forwardRef((e, t) => {
|
|
503
|
+
let { forceMount: n, ...r } = e, a = I(L, e.__scopeScrollArea), o = e.orientation === "horizontal", s = J(() => l("SCROLL_END"), 100), [c, l] = ae("hidden", {
|
|
504
|
+
hidden: { SCROLL: "scrolling" },
|
|
505
|
+
scrolling: {
|
|
506
|
+
SCROLL_END: "idle",
|
|
507
|
+
POINTER_ENTER: "interacting"
|
|
508
|
+
},
|
|
509
|
+
interacting: {
|
|
510
|
+
SCROLL: "interacting",
|
|
511
|
+
POINTER_LEAVE: "idle"
|
|
512
|
+
},
|
|
513
|
+
idle: {
|
|
514
|
+
HIDE: "hidden",
|
|
515
|
+
SCROLL: "scrolling",
|
|
516
|
+
POINTER_ENTER: "interacting"
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
return i.useEffect(() => {
|
|
520
|
+
if (c === "idle") {
|
|
521
|
+
let e = window.setTimeout(() => l("HIDE"), a.scrollHideDelay);
|
|
522
|
+
return () => window.clearTimeout(e);
|
|
523
|
+
}
|
|
524
|
+
}, [
|
|
525
|
+
c,
|
|
526
|
+
a.scrollHideDelay,
|
|
527
|
+
l
|
|
528
|
+
]), i.useEffect(() => {
|
|
529
|
+
let e = a.viewport, t = o ? "scrollLeft" : "scrollTop";
|
|
530
|
+
if (e) {
|
|
531
|
+
let n = e[t], r = () => {
|
|
532
|
+
let r = e[t];
|
|
533
|
+
n !== r && (l("SCROLL"), s()), n = r;
|
|
534
|
+
};
|
|
535
|
+
return e.addEventListener("scroll", r), () => e.removeEventListener("scroll", r);
|
|
536
|
+
}
|
|
537
|
+
}, [
|
|
538
|
+
a.viewport,
|
|
539
|
+
o,
|
|
540
|
+
l,
|
|
541
|
+
s
|
|
542
|
+
]), /* @__PURE__ */ u(j, {
|
|
543
|
+
present: n || c !== "hidden",
|
|
544
|
+
children: /* @__PURE__ */ u(B, {
|
|
545
|
+
"data-state": c === "hidden" ? "hidden" : "visible",
|
|
546
|
+
...r,
|
|
547
|
+
ref: t,
|
|
548
|
+
onPointerEnter: P(e.onPointerEnter, () => l("POINTER_ENTER")),
|
|
549
|
+
onPointerLeave: P(e.onPointerLeave, () => l("POINTER_LEAVE"))
|
|
550
|
+
})
|
|
551
|
+
});
|
|
552
|
+
}), z = i.forwardRef((e, t) => {
|
|
553
|
+
let n = I(L, e.__scopeScrollArea), { forceMount: r, ...a } = e, [o, s] = i.useState(!1), c = e.orientation === "horizontal", l = J(() => {
|
|
554
|
+
if (n.viewport) {
|
|
555
|
+
let e = n.viewport.offsetWidth < n.viewport.scrollWidth, t = n.viewport.offsetHeight < n.viewport.scrollHeight;
|
|
556
|
+
s(c ? e : t);
|
|
557
|
+
}
|
|
558
|
+
}, 10);
|
|
559
|
+
return Y(n.viewport, l), Y(n.content, l), /* @__PURE__ */ u(j, {
|
|
560
|
+
present: r || o,
|
|
561
|
+
children: /* @__PURE__ */ u(B, {
|
|
562
|
+
"data-state": o ? "visible" : "hidden",
|
|
563
|
+
...a,
|
|
564
|
+
ref: t
|
|
565
|
+
})
|
|
566
|
+
});
|
|
567
|
+
}), B = i.forwardRef((e, t) => {
|
|
568
|
+
let { orientation: n = "vertical", ...r } = e, a = I(L, e.__scopeScrollArea), o = i.useRef(null), s = i.useRef(0), [c, l] = i.useState({
|
|
569
|
+
content: 0,
|
|
570
|
+
viewport: 0,
|
|
571
|
+
scrollbar: {
|
|
572
|
+
size: 0,
|
|
573
|
+
paddingStart: 0,
|
|
574
|
+
paddingEnd: 0
|
|
575
|
+
}
|
|
576
|
+
}), d = be(c.viewport, c.content), f = {
|
|
577
|
+
...r,
|
|
578
|
+
sizes: c,
|
|
579
|
+
onSizesChange: l,
|
|
580
|
+
hasThumb: d > 0 && d < 1,
|
|
581
|
+
onThumbChange: (e) => o.current = e,
|
|
582
|
+
onThumbPointerUp: () => s.current = 0,
|
|
583
|
+
onThumbPointerDown: (e) => s.current = e
|
|
584
|
+
};
|
|
585
|
+
function p(e, t) {
|
|
586
|
+
return xe(e, s.current, c, t);
|
|
587
|
+
}
|
|
588
|
+
return n === "horizontal" ? /* @__PURE__ */ u(me, {
|
|
589
|
+
...f,
|
|
590
|
+
ref: t,
|
|
591
|
+
onThumbPositionChange: () => {
|
|
592
|
+
if (a.viewport && o.current) {
|
|
593
|
+
let e = a.viewport.scrollLeft, t = Se(e, c, a.dir);
|
|
594
|
+
o.current.style.transform = `translate3d(${t}px, 0, 0)`;
|
|
595
|
+
}
|
|
596
|
+
},
|
|
597
|
+
onWheelScroll: (e) => {
|
|
598
|
+
a.viewport && (a.viewport.scrollLeft = e);
|
|
599
|
+
},
|
|
600
|
+
onDragScroll: (e) => {
|
|
601
|
+
a.viewport && (a.viewport.scrollLeft = p(e, a.dir));
|
|
602
|
+
}
|
|
603
|
+
}) : n === "vertical" ? /* @__PURE__ */ u(he, {
|
|
604
|
+
...f,
|
|
605
|
+
ref: t,
|
|
606
|
+
onThumbPositionChange: () => {
|
|
607
|
+
if (a.viewport && o.current) {
|
|
608
|
+
let e = a.viewport.scrollTop, t = Se(e, c);
|
|
609
|
+
o.current.style.transform = `translate3d(0, ${t}px, 0)`;
|
|
610
|
+
}
|
|
611
|
+
},
|
|
612
|
+
onWheelScroll: (e) => {
|
|
613
|
+
a.viewport && (a.viewport.scrollTop = e);
|
|
614
|
+
},
|
|
615
|
+
onDragScroll: (e) => {
|
|
616
|
+
a.viewport && (a.viewport.scrollTop = p(e));
|
|
617
|
+
}
|
|
618
|
+
}) : null;
|
|
619
|
+
}), me = i.forwardRef((e, t) => {
|
|
620
|
+
let { sizes: n, onSizesChange: r, ...a } = e, o = I(L, e.__scopeScrollArea), [s, c] = i.useState(), l = i.useRef(null), d = S(t, l, o.onScrollbarXChange);
|
|
621
|
+
return i.useEffect(() => {
|
|
622
|
+
l.current && c(getComputedStyle(l.current));
|
|
623
|
+
}, [l]), /* @__PURE__ */ u(H, {
|
|
624
|
+
"data-orientation": "horizontal",
|
|
625
|
+
...a,
|
|
626
|
+
ref: d,
|
|
627
|
+
sizes: n,
|
|
628
|
+
style: {
|
|
629
|
+
bottom: 0,
|
|
630
|
+
left: o.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
631
|
+
right: o.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
632
|
+
"--radix-scroll-area-thumb-width": q(n) + "px",
|
|
633
|
+
...e.style
|
|
634
|
+
},
|
|
635
|
+
onThumbPointerDown: (t) => e.onThumbPointerDown(t.x),
|
|
636
|
+
onDragScroll: (t) => e.onDragScroll(t.x),
|
|
637
|
+
onWheelScroll: (t, n) => {
|
|
638
|
+
if (o.viewport) {
|
|
639
|
+
let r = o.viewport.scrollLeft + t.deltaX;
|
|
640
|
+
e.onWheelScroll(r), we(r, n) && t.preventDefault();
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
onResize: () => {
|
|
644
|
+
l.current && o.viewport && s && r({
|
|
645
|
+
content: o.viewport.scrollWidth,
|
|
646
|
+
viewport: o.viewport.offsetWidth,
|
|
647
|
+
scrollbar: {
|
|
648
|
+
size: l.current.clientWidth,
|
|
649
|
+
paddingStart: K(s.paddingLeft),
|
|
650
|
+
paddingEnd: K(s.paddingRight)
|
|
651
|
+
}
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
});
|
|
655
|
+
}), he = i.forwardRef((e, t) => {
|
|
656
|
+
let { sizes: n, onSizesChange: r, ...a } = e, o = I(L, e.__scopeScrollArea), [s, c] = i.useState(), l = i.useRef(null), d = S(t, l, o.onScrollbarYChange);
|
|
657
|
+
return i.useEffect(() => {
|
|
658
|
+
l.current && c(getComputedStyle(l.current));
|
|
659
|
+
}, [l]), /* @__PURE__ */ u(H, {
|
|
660
|
+
"data-orientation": "vertical",
|
|
661
|
+
...a,
|
|
662
|
+
ref: d,
|
|
663
|
+
sizes: n,
|
|
664
|
+
style: {
|
|
665
|
+
top: 0,
|
|
666
|
+
right: o.dir === "ltr" ? 0 : void 0,
|
|
667
|
+
left: o.dir === "rtl" ? 0 : void 0,
|
|
668
|
+
bottom: "var(--radix-scroll-area-corner-height)",
|
|
669
|
+
"--radix-scroll-area-thumb-height": q(n) + "px",
|
|
670
|
+
...e.style
|
|
671
|
+
},
|
|
672
|
+
onThumbPointerDown: (t) => e.onThumbPointerDown(t.y),
|
|
673
|
+
onDragScroll: (t) => e.onDragScroll(t.y),
|
|
674
|
+
onWheelScroll: (t, n) => {
|
|
675
|
+
if (o.viewport) {
|
|
676
|
+
let r = o.viewport.scrollTop + t.deltaY;
|
|
677
|
+
e.onWheelScroll(r), we(r, n) && t.preventDefault();
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
onResize: () => {
|
|
681
|
+
l.current && o.viewport && s && r({
|
|
682
|
+
content: o.viewport.scrollHeight,
|
|
683
|
+
viewport: o.viewport.offsetHeight,
|
|
684
|
+
scrollbar: {
|
|
685
|
+
size: l.current.clientHeight,
|
|
686
|
+
paddingStart: K(s.paddingTop),
|
|
687
|
+
paddingEnd: K(s.paddingBottom)
|
|
688
|
+
}
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
}), [ge, V] = oe(L), H = i.forwardRef((e, t) => {
|
|
693
|
+
let { __scopeScrollArea: n, sizes: r, hasThumb: a, onThumbChange: o, onThumbPointerUp: s, onThumbPointerDown: c, onThumbPositionChange: l, onDragScroll: d, onWheelScroll: f, onResize: p, ...m } = e, h = I(L, n), [g, _] = i.useState(null), y = S(t, (e) => _(e)), b = i.useRef(null), x = i.useRef(""), C = h.viewport, w = r.content - r.viewport, T = v(f), E = v(l), D = J(p, 10);
|
|
694
|
+
function O(e) {
|
|
695
|
+
if (b.current) {
|
|
696
|
+
let t = e.clientX - b.current.left, n = e.clientY - b.current.top;
|
|
697
|
+
d({
|
|
698
|
+
x: t,
|
|
699
|
+
y: n
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
return i.useEffect(() => {
|
|
704
|
+
let e = (e) => {
|
|
705
|
+
let t = e.target;
|
|
706
|
+
g?.contains(t) && T(e, w);
|
|
707
|
+
};
|
|
708
|
+
return document.addEventListener("wheel", e, { passive: !1 }), () => document.removeEventListener("wheel", e, { passive: !1 });
|
|
709
|
+
}, [
|
|
710
|
+
C,
|
|
711
|
+
g,
|
|
712
|
+
w,
|
|
713
|
+
T
|
|
714
|
+
]), i.useEffect(E, [r, E]), Y(g, D), Y(h.content, D), /* @__PURE__ */ u(ge, {
|
|
715
|
+
scope: n,
|
|
716
|
+
scrollbar: g,
|
|
717
|
+
hasThumb: a,
|
|
718
|
+
onThumbChange: v(o),
|
|
719
|
+
onThumbPointerUp: v(s),
|
|
720
|
+
onThumbPositionChange: E,
|
|
721
|
+
onThumbPointerDown: v(c),
|
|
722
|
+
children: /* @__PURE__ */ u(k.div, {
|
|
723
|
+
...m,
|
|
724
|
+
ref: y,
|
|
725
|
+
style: {
|
|
726
|
+
position: "absolute",
|
|
727
|
+
...m.style
|
|
728
|
+
},
|
|
729
|
+
onPointerDown: P(e.onPointerDown, (e) => {
|
|
730
|
+
e.button === 0 && (e.target.setPointerCapture(e.pointerId), b.current = g.getBoundingClientRect(), x.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", h.viewport && (h.viewport.style.scrollBehavior = "auto"), O(e));
|
|
731
|
+
}),
|
|
732
|
+
onPointerMove: P(e.onPointerMove, O),
|
|
733
|
+
onPointerUp: P(e.onPointerUp, (e) => {
|
|
734
|
+
let t = e.target;
|
|
735
|
+
t.hasPointerCapture(e.pointerId) && t.releasePointerCapture(e.pointerId), document.body.style.webkitUserSelect = x.current, h.viewport && (h.viewport.style.scrollBehavior = ""), b.current = null;
|
|
736
|
+
})
|
|
737
|
+
})
|
|
738
|
+
});
|
|
739
|
+
}), U = "ScrollAreaThumb", W = i.forwardRef((e, t) => {
|
|
740
|
+
let { forceMount: n, ...r } = e, i = V(U, e.__scopeScrollArea);
|
|
741
|
+
return /* @__PURE__ */ u(j, {
|
|
742
|
+
present: n || i.hasThumb,
|
|
743
|
+
children: /* @__PURE__ */ u(_e, {
|
|
744
|
+
ref: t,
|
|
745
|
+
...r
|
|
746
|
+
})
|
|
747
|
+
});
|
|
748
|
+
}), _e = i.forwardRef((e, t) => {
|
|
749
|
+
let { __scopeScrollArea: n, style: r, ...a } = e, o = I(U, n), s = V(U, n), { onThumbPositionChange: c } = s, l = S(t, (e) => s.onThumbChange(e)), d = i.useRef(void 0), f = J(() => {
|
|
750
|
+
d.current &&= (d.current(), void 0);
|
|
751
|
+
}, 100);
|
|
752
|
+
return i.useEffect(() => {
|
|
753
|
+
let e = o.viewport;
|
|
754
|
+
if (e) {
|
|
755
|
+
let t = () => {
|
|
756
|
+
if (f(), !d.current) {
|
|
757
|
+
let t = Te(e, c);
|
|
758
|
+
d.current = t, c();
|
|
759
|
+
}
|
|
760
|
+
};
|
|
761
|
+
return c(), e.addEventListener("scroll", t), () => e.removeEventListener("scroll", t);
|
|
762
|
+
}
|
|
763
|
+
}, [
|
|
764
|
+
o.viewport,
|
|
765
|
+
f,
|
|
766
|
+
c
|
|
767
|
+
]), /* @__PURE__ */ u(k.div, {
|
|
768
|
+
"data-state": s.hasThumb ? "visible" : "hidden",
|
|
769
|
+
...a,
|
|
770
|
+
ref: l,
|
|
771
|
+
style: {
|
|
772
|
+
width: "var(--radix-scroll-area-thumb-width)",
|
|
773
|
+
height: "var(--radix-scroll-area-thumb-height)",
|
|
774
|
+
...r
|
|
775
|
+
},
|
|
776
|
+
onPointerDownCapture: P(e.onPointerDownCapture, (e) => {
|
|
777
|
+
let t = e.target.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top;
|
|
778
|
+
s.onThumbPointerDown({
|
|
779
|
+
x: n,
|
|
780
|
+
y: r
|
|
781
|
+
});
|
|
782
|
+
}),
|
|
783
|
+
onPointerUp: P(e.onPointerUp, s.onThumbPointerUp)
|
|
784
|
+
});
|
|
785
|
+
});
|
|
786
|
+
W.displayName = U;
|
|
787
|
+
var G = "ScrollAreaCorner", ve = i.forwardRef((e, t) => {
|
|
788
|
+
let n = I(G, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
|
|
789
|
+
return n.type !== "scroll" && r ? /* @__PURE__ */ u(ye, {
|
|
790
|
+
...e,
|
|
791
|
+
ref: t
|
|
792
|
+
}) : null;
|
|
793
|
+
});
|
|
794
|
+
ve.displayName = G;
|
|
795
|
+
var ye = i.forwardRef((e, t) => {
|
|
796
|
+
let { __scopeScrollArea: n, ...r } = e, a = I(G, n), [o, s] = i.useState(0), [c, l] = i.useState(0), d = !!(o && c);
|
|
797
|
+
return Y(a.scrollbarX, () => {
|
|
798
|
+
let e = a.scrollbarX?.offsetHeight || 0;
|
|
799
|
+
a.onCornerHeightChange(e), l(e);
|
|
800
|
+
}), Y(a.scrollbarY, () => {
|
|
801
|
+
let e = a.scrollbarY?.offsetWidth || 0;
|
|
802
|
+
a.onCornerWidthChange(e), s(e);
|
|
803
|
+
}), d ? /* @__PURE__ */ u(k.div, {
|
|
804
|
+
...r,
|
|
805
|
+
ref: t,
|
|
806
|
+
style: {
|
|
807
|
+
width: o,
|
|
808
|
+
height: c,
|
|
809
|
+
position: "absolute",
|
|
810
|
+
right: a.dir === "ltr" ? 0 : void 0,
|
|
811
|
+
left: a.dir === "rtl" ? 0 : void 0,
|
|
812
|
+
bottom: 0,
|
|
813
|
+
...e.style
|
|
814
|
+
}
|
|
815
|
+
}) : null;
|
|
816
|
+
});
|
|
817
|
+
function K(e) {
|
|
818
|
+
return e ? parseInt(e, 10) : 0;
|
|
819
|
+
}
|
|
820
|
+
function be(e, t) {
|
|
821
|
+
let n = e / t;
|
|
822
|
+
return isNaN(n) ? 0 : n;
|
|
823
|
+
}
|
|
824
|
+
function q(e) {
|
|
825
|
+
let t = be(e.viewport, e.content), n = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, r = (e.scrollbar.size - n) * t;
|
|
826
|
+
return Math.max(r, 18);
|
|
827
|
+
}
|
|
828
|
+
function xe(e, t, n, r = "ltr") {
|
|
829
|
+
let i = q(n), a = i / 2, o = t || a, s = i - o, c = n.scrollbar.paddingStart + o, l = n.scrollbar.size - n.scrollbar.paddingEnd - s, u = n.content - n.viewport, d = r === "ltr" ? [0, u] : [u * -1, 0];
|
|
830
|
+
return Ce([c, l], d)(e);
|
|
831
|
+
}
|
|
832
|
+
function Se(e, t, n = "ltr") {
|
|
833
|
+
let r = q(t), i = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, a = t.scrollbar.size - i, o = t.content - t.viewport, s = a - r, c = ie(e, n === "ltr" ? [0, o] : [o * -1, 0]);
|
|
834
|
+
return Ce([0, o], [0, s])(c);
|
|
835
|
+
}
|
|
836
|
+
function Ce(e, t) {
|
|
837
|
+
return (n) => {
|
|
838
|
+
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
839
|
+
let r = (t[1] - t[0]) / (e[1] - e[0]);
|
|
840
|
+
return t[0] + r * (n - e[0]);
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
function we(e, t) {
|
|
844
|
+
return e > 0 && e < t;
|
|
845
|
+
}
|
|
846
|
+
var Te = (e, t = () => {}) => {
|
|
847
|
+
let n = {
|
|
848
|
+
left: e.scrollLeft,
|
|
849
|
+
top: e.scrollTop
|
|
850
|
+
}, r = 0;
|
|
851
|
+
return (function i() {
|
|
852
|
+
let a = {
|
|
853
|
+
left: e.scrollLeft,
|
|
854
|
+
top: e.scrollTop
|
|
855
|
+
}, o = n.left !== a.left, s = n.top !== a.top;
|
|
856
|
+
(o || s) && t(), n = a, r = window.requestAnimationFrame(i);
|
|
857
|
+
})(), () => window.cancelAnimationFrame(r);
|
|
858
|
+
};
|
|
859
|
+
function J(e, t) {
|
|
860
|
+
let n = v(e), r = i.useRef(0);
|
|
861
|
+
return i.useEffect(() => () => window.clearTimeout(r.current), []), i.useCallback(() => {
|
|
862
|
+
window.clearTimeout(r.current), r.current = window.setTimeout(n, t);
|
|
863
|
+
}, [n, t]);
|
|
864
|
+
}
|
|
865
|
+
function Y(e, t) {
|
|
866
|
+
let n = v(t);
|
|
867
|
+
y(() => {
|
|
868
|
+
let t = 0;
|
|
869
|
+
if (e) {
|
|
870
|
+
let r = new ResizeObserver(() => {
|
|
871
|
+
cancelAnimationFrame(t), t = window.requestAnimationFrame(n);
|
|
872
|
+
});
|
|
873
|
+
return r.observe(e), () => {
|
|
874
|
+
window.cancelAnimationFrame(t), r.unobserve(e);
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
}, [e, n]);
|
|
878
|
+
}
|
|
879
|
+
var X = le, Z = de, Ee = ve, Q = o(({ className: t, children: n, showBar: r = !0, viewportRef: i, onScrollTop: a, onScrollBottom: o, focusableViewport: l = !0, scrollMargin: f = 0, ...p }, m) => {
|
|
880
|
+
let h = c(null), g = i ?? h;
|
|
881
|
+
return s(() => {
|
|
882
|
+
let e = (e) => {
|
|
883
|
+
let { scrollTop: t, scrollHeight: n, clientHeight: r } = e.target;
|
|
884
|
+
t - f <= 0 && a && a(), t + r + f >= n && o && o();
|
|
885
|
+
}, t = g.current;
|
|
886
|
+
return t?.addEventListener("scroll", e), () => {
|
|
887
|
+
t?.removeEventListener("scroll", e);
|
|
888
|
+
};
|
|
889
|
+
}, [
|
|
890
|
+
g.current,
|
|
891
|
+
o,
|
|
892
|
+
a,
|
|
893
|
+
f
|
|
894
|
+
]), /* @__PURE__ */ d(X, {
|
|
895
|
+
ref: m,
|
|
896
|
+
className: e("relative overflow-hidden", t),
|
|
897
|
+
scrollHideDelay: 200,
|
|
898
|
+
...p,
|
|
899
|
+
children: [
|
|
900
|
+
/* @__PURE__ */ u(Z, {
|
|
901
|
+
ref: g,
|
|
902
|
+
className: "size-full snap-none rounded-[inherit] [&>div]:!block",
|
|
903
|
+
tabIndex: l ? 0 : void 0,
|
|
904
|
+
"data-scroll-container": !0,
|
|
905
|
+
children: n
|
|
906
|
+
}),
|
|
907
|
+
/* @__PURE__ */ u($, {
|
|
908
|
+
orientation: "vertical",
|
|
909
|
+
showBar: r
|
|
910
|
+
}),
|
|
911
|
+
/* @__PURE__ */ u($, {
|
|
912
|
+
orientation: "horizontal",
|
|
913
|
+
showBar: r
|
|
914
|
+
}),
|
|
915
|
+
/* @__PURE__ */ u(Ee, {})
|
|
916
|
+
]
|
|
917
|
+
});
|
|
918
|
+
});
|
|
919
|
+
Q.displayName = "ScrollAreaImpl";
|
|
920
|
+
var De = o((e, t) => /* @__PURE__ */ u(Q, {
|
|
921
|
+
ref: t,
|
|
922
|
+
...e,
|
|
923
|
+
focusableViewport: !0
|
|
924
|
+
}));
|
|
925
|
+
De.displayName = X.displayName;
|
|
926
|
+
var Oe = o((e, t) => /* @__PURE__ */ u(Q, {
|
|
927
|
+
ref: t,
|
|
928
|
+
...e,
|
|
929
|
+
focusableViewport: !1
|
|
930
|
+
}));
|
|
931
|
+
Oe.displayName = X.displayName;
|
|
932
|
+
var $ = o(({ className: t, orientation: n = "vertical", showBar: r = !0, ...i }, a) => /* @__PURE__ */ u(R, {
|
|
933
|
+
ref: a,
|
|
934
|
+
orientation: n,
|
|
935
|
+
className: e("group/scrollbar z-50 flex touch-none select-none p-[1px]", "transition-opacity data-[state=hidden]:pointer-events-none data-[state=visible]:pointer-events-auto data-[state=hidden]:opacity-0 data-[state=visible]:opacity-100", n === "vertical" && "h-full w-2", n === "horizontal" && "h-2 flex-col", t),
|
|
936
|
+
...i,
|
|
937
|
+
children: r ? /* @__PURE__ */ u(W, { className: "relative flex-1 rounded-full bg-f1-background-inverse opacity-30 transition-opacity group-hover/scrollbar:opacity-50" }) : null
|
|
938
|
+
}));
|
|
939
|
+
$.displayName = R.displayName;
|
|
940
|
+
//#endregion
|
|
941
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.1.0_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
942
|
+
function ke({ prop: e, defaultProp: t, onChange: n = () => {} }) {
|
|
943
|
+
let [r, a] = Ae({
|
|
944
|
+
defaultProp: t,
|
|
945
|
+
onChange: n
|
|
946
|
+
}), o = e !== void 0, s = o ? e : r, c = v(n);
|
|
947
|
+
return [s, i.useCallback((t) => {
|
|
948
|
+
if (o) {
|
|
949
|
+
let n = typeof t == "function" ? t(e) : t;
|
|
950
|
+
n !== e && c(n);
|
|
951
|
+
} else a(t);
|
|
952
|
+
}, [
|
|
953
|
+
o,
|
|
954
|
+
e,
|
|
955
|
+
a,
|
|
956
|
+
c
|
|
957
|
+
])];
|
|
958
|
+
}
|
|
959
|
+
function Ae({ defaultProp: e, onChange: t }) {
|
|
960
|
+
let n = i.useState(e), [r] = n, a = i.useRef(r), o = v(t);
|
|
961
|
+
return i.useEffect(() => {
|
|
962
|
+
a.current !== r && (o(r), a.current = r);
|
|
963
|
+
}, [
|
|
964
|
+
r,
|
|
965
|
+
a,
|
|
966
|
+
o
|
|
967
|
+
]), n;
|
|
968
|
+
}
|
|
969
|
+
//#endregion
|
|
970
|
+
export { v as _, Ee as a, p as b, P as c, k as d, A as f, y as g, S as h, $ as i, N as l, x as m, Oe as n, X as o, C as p, De as r, Z as s, ke as t, j as u, g as v, h as y };
|