@stargazers-stella/cosmic-ui 0.1.4
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 +96 -0
- package/dist/index.cjs +2864 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +178 -0
- package/dist/index.d.ts +178 -0
- package/dist/index.js +2770 -0
- package/dist/index.js.map +1 -0
- package/package.json +44 -0
- package/theme.css +71 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,2770 @@
|
|
|
1
|
+
// src/utils.ts
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
function cn(...inputs) {
|
|
5
|
+
return twMerge(clsx(inputs));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// src/components/ui/alert.tsx
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
var variantClasses = {
|
|
12
|
+
default: "border-border/70 bg-secondary/50 text-foreground",
|
|
13
|
+
destructive: "border-red-600/60 bg-red-950/40 text-red-50",
|
|
14
|
+
info: "border-blue-500/50 bg-blue-900/30 text-blue-50"
|
|
15
|
+
};
|
|
16
|
+
var Alert = React.forwardRef(
|
|
17
|
+
({ className, variant = "default", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
ref,
|
|
21
|
+
role: "alert",
|
|
22
|
+
className: cn(
|
|
23
|
+
"w-full rounded-xl border p-4 text-sm shadow-sm backdrop-blur",
|
|
24
|
+
variantClasses[variant],
|
|
25
|
+
className
|
|
26
|
+
),
|
|
27
|
+
...props
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
);
|
|
31
|
+
Alert.displayName = "Alert";
|
|
32
|
+
var AlertTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
33
|
+
"h5",
|
|
34
|
+
{
|
|
35
|
+
ref,
|
|
36
|
+
className: cn("mb-1 font-semibold leading-none tracking-tight", className),
|
|
37
|
+
...props
|
|
38
|
+
}
|
|
39
|
+
));
|
|
40
|
+
AlertTitle.displayName = "AlertTitle";
|
|
41
|
+
var AlertDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
ref,
|
|
45
|
+
className: cn("text-sm leading-relaxed opacity-90", className),
|
|
46
|
+
...props
|
|
47
|
+
}
|
|
48
|
+
));
|
|
49
|
+
AlertDescription.displayName = "AlertDescription";
|
|
50
|
+
|
|
51
|
+
// src/components/ui/badge.tsx
|
|
52
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
53
|
+
function Badge({ className, variant = "default", ...props }) {
|
|
54
|
+
return /* @__PURE__ */ jsx2(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
className: cn(
|
|
58
|
+
"inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold transition-shadow",
|
|
59
|
+
variant === "default" && "bg-primary/80 text-primary-foreground shadow-glow",
|
|
60
|
+
variant === "outline" && "border border-border/70 text-muted-foreground hover:text-foreground",
|
|
61
|
+
variant === "glow" && "bg-gradient-to-r from-indigo-500/70 to-purple-600/70 text-white shadow-glow",
|
|
62
|
+
className
|
|
63
|
+
),
|
|
64
|
+
...props
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// src/components/ui/button.tsx
|
|
70
|
+
import * as React2 from "react";
|
|
71
|
+
import { cva } from "class-variance-authority";
|
|
72
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
73
|
+
var buttonVariants = cva(
|
|
74
|
+
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 ring-offset-background",
|
|
75
|
+
{
|
|
76
|
+
variants: {
|
|
77
|
+
variant: {
|
|
78
|
+
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
79
|
+
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
80
|
+
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
81
|
+
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
82
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
83
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
84
|
+
},
|
|
85
|
+
size: {
|
|
86
|
+
default: "h-10 px-4 py-2",
|
|
87
|
+
sm: "h-9 rounded-md px-3",
|
|
88
|
+
lg: "h-11 rounded-md px-8",
|
|
89
|
+
icon: "h-10 w-10"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
defaultVariants: {
|
|
93
|
+
variant: "default",
|
|
94
|
+
size: "default"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
var Button = React2.forwardRef(
|
|
99
|
+
({ className, variant, size, ...props }, ref) => {
|
|
100
|
+
return /* @__PURE__ */ jsx3(
|
|
101
|
+
"button",
|
|
102
|
+
{
|
|
103
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
104
|
+
ref,
|
|
105
|
+
...props
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
Button.displayName = "Button";
|
|
111
|
+
|
|
112
|
+
// src/components/ui/card.tsx
|
|
113
|
+
import * as React3 from "react";
|
|
114
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
115
|
+
var Card = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
116
|
+
"div",
|
|
117
|
+
{
|
|
118
|
+
ref,
|
|
119
|
+
className: cn(
|
|
120
|
+
"rounded-2xl border border-border/70 bg-card/80 text-card-foreground shadow-card backdrop-blur-xl",
|
|
121
|
+
className
|
|
122
|
+
),
|
|
123
|
+
...props
|
|
124
|
+
}
|
|
125
|
+
));
|
|
126
|
+
Card.displayName = "Card";
|
|
127
|
+
var CardHeader = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4("div", { ref, className: cn("space-y-1.5 p-6", className), ...props }));
|
|
128
|
+
CardHeader.displayName = "CardHeader";
|
|
129
|
+
var CardTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4("h3", { ref, className: cn("text-xl font-semibold", className), ...props }));
|
|
130
|
+
CardTitle.displayName = "CardTitle";
|
|
131
|
+
var CardDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
132
|
+
"p",
|
|
133
|
+
{
|
|
134
|
+
ref,
|
|
135
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
136
|
+
...props
|
|
137
|
+
}
|
|
138
|
+
));
|
|
139
|
+
CardDescription.displayName = "CardDescription";
|
|
140
|
+
var CardContent = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
141
|
+
CardContent.displayName = "CardContent";
|
|
142
|
+
var CardFooter = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
143
|
+
"div",
|
|
144
|
+
{
|
|
145
|
+
ref,
|
|
146
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
147
|
+
...props
|
|
148
|
+
}
|
|
149
|
+
));
|
|
150
|
+
CardFooter.displayName = "CardFooter";
|
|
151
|
+
|
|
152
|
+
// src/components/ui/command.tsx
|
|
153
|
+
import * as React29 from "react";
|
|
154
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
155
|
+
import { Search } from "lucide-react";
|
|
156
|
+
|
|
157
|
+
// src/components/ui/dialog.tsx
|
|
158
|
+
import * as React28 from "react";
|
|
159
|
+
|
|
160
|
+
// node_modules/@radix-ui/react-dialog/dist/index.mjs
|
|
161
|
+
import * as React27 from "react";
|
|
162
|
+
|
|
163
|
+
// node_modules/@radix-ui/primitive/dist/index.mjs
|
|
164
|
+
var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
165
|
+
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
166
|
+
return function handleEvent(event) {
|
|
167
|
+
originalEventHandler?.(event);
|
|
168
|
+
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
169
|
+
return ourEventHandler?.(event);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
175
|
+
import * as React4 from "react";
|
|
176
|
+
function setRef(ref, value) {
|
|
177
|
+
if (typeof ref === "function") {
|
|
178
|
+
return ref(value);
|
|
179
|
+
} else if (ref !== null && ref !== void 0) {
|
|
180
|
+
ref.current = value;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
function composeRefs(...refs) {
|
|
184
|
+
return (node) => {
|
|
185
|
+
let hasCleanup = false;
|
|
186
|
+
const cleanups = refs.map((ref) => {
|
|
187
|
+
const cleanup = setRef(ref, node);
|
|
188
|
+
if (!hasCleanup && typeof cleanup == "function") {
|
|
189
|
+
hasCleanup = true;
|
|
190
|
+
}
|
|
191
|
+
return cleanup;
|
|
192
|
+
});
|
|
193
|
+
if (hasCleanup) {
|
|
194
|
+
return () => {
|
|
195
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
196
|
+
const cleanup = cleanups[i];
|
|
197
|
+
if (typeof cleanup == "function") {
|
|
198
|
+
cleanup();
|
|
199
|
+
} else {
|
|
200
|
+
setRef(refs[i], null);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function useComposedRefs(...refs) {
|
|
208
|
+
return React4.useCallback(composeRefs(...refs), refs);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// node_modules/@radix-ui/react-context/dist/index.mjs
|
|
212
|
+
import * as React5 from "react";
|
|
213
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
214
|
+
function createContext2(rootComponentName, defaultContext) {
|
|
215
|
+
const Context = React5.createContext(defaultContext);
|
|
216
|
+
const Provider = (props) => {
|
|
217
|
+
const { children, ...context } = props;
|
|
218
|
+
const value = React5.useMemo(() => context, Object.values(context));
|
|
219
|
+
return /* @__PURE__ */ jsx5(Context.Provider, { value, children });
|
|
220
|
+
};
|
|
221
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
222
|
+
function useContext22(consumerName) {
|
|
223
|
+
const context = React5.useContext(Context);
|
|
224
|
+
if (context) return context;
|
|
225
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
226
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
227
|
+
}
|
|
228
|
+
return [Provider, useContext22];
|
|
229
|
+
}
|
|
230
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
231
|
+
let defaultContexts = [];
|
|
232
|
+
function createContext32(rootComponentName, defaultContext) {
|
|
233
|
+
const BaseContext = React5.createContext(defaultContext);
|
|
234
|
+
const index = defaultContexts.length;
|
|
235
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
236
|
+
const Provider = (props) => {
|
|
237
|
+
const { scope, children, ...context } = props;
|
|
238
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
239
|
+
const value = React5.useMemo(() => context, Object.values(context));
|
|
240
|
+
return /* @__PURE__ */ jsx5(Context.Provider, { value, children });
|
|
241
|
+
};
|
|
242
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
243
|
+
function useContext22(consumerName, scope) {
|
|
244
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
245
|
+
const context = React5.useContext(Context);
|
|
246
|
+
if (context) return context;
|
|
247
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
248
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
249
|
+
}
|
|
250
|
+
return [Provider, useContext22];
|
|
251
|
+
}
|
|
252
|
+
const createScope = () => {
|
|
253
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
254
|
+
return React5.createContext(defaultContext);
|
|
255
|
+
});
|
|
256
|
+
return function useScope(scope) {
|
|
257
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
258
|
+
return React5.useMemo(
|
|
259
|
+
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
260
|
+
[scope, contexts]
|
|
261
|
+
);
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
createScope.scopeName = scopeName;
|
|
265
|
+
return [createContext32, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
266
|
+
}
|
|
267
|
+
function composeContextScopes(...scopes) {
|
|
268
|
+
const baseScope = scopes[0];
|
|
269
|
+
if (scopes.length === 1) return baseScope;
|
|
270
|
+
const createScope = () => {
|
|
271
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
272
|
+
useScope: createScope2(),
|
|
273
|
+
scopeName: createScope2.scopeName
|
|
274
|
+
}));
|
|
275
|
+
return function useComposedScopes(overrideScopes) {
|
|
276
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
277
|
+
const scopeProps = useScope(overrideScopes);
|
|
278
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
279
|
+
return { ...nextScopes2, ...currentScope };
|
|
280
|
+
}, {});
|
|
281
|
+
return React5.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
createScope.scopeName = baseScope.scopeName;
|
|
285
|
+
return createScope;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// node_modules/@radix-ui/react-id/dist/index.mjs
|
|
289
|
+
import * as React7 from "react";
|
|
290
|
+
|
|
291
|
+
// node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
292
|
+
import * as React6 from "react";
|
|
293
|
+
var useLayoutEffect2 = globalThis?.document ? React6.useLayoutEffect : () => {
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
// node_modules/@radix-ui/react-id/dist/index.mjs
|
|
297
|
+
var useReactId = React7[" useId ".trim().toString()] || (() => void 0);
|
|
298
|
+
var count = 0;
|
|
299
|
+
function useId(deterministicId) {
|
|
300
|
+
const [id, setId] = React7.useState(useReactId());
|
|
301
|
+
useLayoutEffect2(() => {
|
|
302
|
+
if (!deterministicId) setId((reactId) => reactId ?? String(count++));
|
|
303
|
+
}, [deterministicId]);
|
|
304
|
+
return deterministicId || (id ? `radix-${id}` : "");
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
308
|
+
import * as React8 from "react";
|
|
309
|
+
import * as React22 from "react";
|
|
310
|
+
var useInsertionEffect = React8[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
311
|
+
function useControllableState({
|
|
312
|
+
prop,
|
|
313
|
+
defaultProp,
|
|
314
|
+
onChange = () => {
|
|
315
|
+
},
|
|
316
|
+
caller
|
|
317
|
+
}) {
|
|
318
|
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
319
|
+
defaultProp,
|
|
320
|
+
onChange
|
|
321
|
+
});
|
|
322
|
+
const isControlled = prop !== void 0;
|
|
323
|
+
const value = isControlled ? prop : uncontrolledProp;
|
|
324
|
+
if (true) {
|
|
325
|
+
const isControlledRef = React8.useRef(prop !== void 0);
|
|
326
|
+
React8.useEffect(() => {
|
|
327
|
+
const wasControlled = isControlledRef.current;
|
|
328
|
+
if (wasControlled !== isControlled) {
|
|
329
|
+
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
330
|
+
const to = isControlled ? "controlled" : "uncontrolled";
|
|
331
|
+
console.warn(
|
|
332
|
+
`${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
isControlledRef.current = isControlled;
|
|
336
|
+
}, [isControlled, caller]);
|
|
337
|
+
}
|
|
338
|
+
const setValue = React8.useCallback(
|
|
339
|
+
(nextValue) => {
|
|
340
|
+
if (isControlled) {
|
|
341
|
+
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
342
|
+
if (value2 !== prop) {
|
|
343
|
+
onChangeRef.current?.(value2);
|
|
344
|
+
}
|
|
345
|
+
} else {
|
|
346
|
+
setUncontrolledProp(nextValue);
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
|
350
|
+
);
|
|
351
|
+
return [value, setValue];
|
|
352
|
+
}
|
|
353
|
+
function useUncontrolledState({
|
|
354
|
+
defaultProp,
|
|
355
|
+
onChange
|
|
356
|
+
}) {
|
|
357
|
+
const [value, setValue] = React8.useState(defaultProp);
|
|
358
|
+
const prevValueRef = React8.useRef(value);
|
|
359
|
+
const onChangeRef = React8.useRef(onChange);
|
|
360
|
+
useInsertionEffect(() => {
|
|
361
|
+
onChangeRef.current = onChange;
|
|
362
|
+
}, [onChange]);
|
|
363
|
+
React8.useEffect(() => {
|
|
364
|
+
if (prevValueRef.current !== value) {
|
|
365
|
+
onChangeRef.current?.(value);
|
|
366
|
+
prevValueRef.current = value;
|
|
367
|
+
}
|
|
368
|
+
}, [value, prevValueRef]);
|
|
369
|
+
return [value, setValue, onChangeRef];
|
|
370
|
+
}
|
|
371
|
+
function isFunction(value) {
|
|
372
|
+
return typeof value === "function";
|
|
373
|
+
}
|
|
374
|
+
var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
|
|
375
|
+
|
|
376
|
+
// node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
377
|
+
import * as React13 from "react";
|
|
378
|
+
|
|
379
|
+
// node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
380
|
+
import * as React10 from "react";
|
|
381
|
+
import * as ReactDOM from "react-dom";
|
|
382
|
+
|
|
383
|
+
// node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
384
|
+
import * as React9 from "react";
|
|
385
|
+
import { Fragment as Fragment2, jsx as jsx6 } from "react/jsx-runtime";
|
|
386
|
+
// @__NO_SIDE_EFFECTS__
|
|
387
|
+
function createSlot(ownerName) {
|
|
388
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
389
|
+
const Slot2 = React9.forwardRef((props, forwardedRef) => {
|
|
390
|
+
const { children, ...slotProps } = props;
|
|
391
|
+
const childrenArray = React9.Children.toArray(children);
|
|
392
|
+
const slottable = childrenArray.find(isSlottable);
|
|
393
|
+
if (slottable) {
|
|
394
|
+
const newElement = slottable.props.children;
|
|
395
|
+
const newChildren = childrenArray.map((child) => {
|
|
396
|
+
if (child === slottable) {
|
|
397
|
+
if (React9.Children.count(newElement) > 1) return React9.Children.only(null);
|
|
398
|
+
return React9.isValidElement(newElement) ? newElement.props.children : null;
|
|
399
|
+
} else {
|
|
400
|
+
return child;
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
return /* @__PURE__ */ jsx6(SlotClone, { ...slotProps, ref: forwardedRef, children: React9.isValidElement(newElement) ? React9.cloneElement(newElement, void 0, newChildren) : null });
|
|
404
|
+
}
|
|
405
|
+
return /* @__PURE__ */ jsx6(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
406
|
+
});
|
|
407
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
408
|
+
return Slot2;
|
|
409
|
+
}
|
|
410
|
+
// @__NO_SIDE_EFFECTS__
|
|
411
|
+
function createSlotClone(ownerName) {
|
|
412
|
+
const SlotClone = React9.forwardRef((props, forwardedRef) => {
|
|
413
|
+
const { children, ...slotProps } = props;
|
|
414
|
+
if (React9.isValidElement(children)) {
|
|
415
|
+
const childrenRef = getElementRef(children);
|
|
416
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
417
|
+
if (children.type !== React9.Fragment) {
|
|
418
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
419
|
+
}
|
|
420
|
+
return React9.cloneElement(children, props2);
|
|
421
|
+
}
|
|
422
|
+
return React9.Children.count(children) > 1 ? React9.Children.only(null) : null;
|
|
423
|
+
});
|
|
424
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
425
|
+
return SlotClone;
|
|
426
|
+
}
|
|
427
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
428
|
+
function isSlottable(child) {
|
|
429
|
+
return React9.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
430
|
+
}
|
|
431
|
+
function mergeProps(slotProps, childProps) {
|
|
432
|
+
const overrideProps = { ...childProps };
|
|
433
|
+
for (const propName in childProps) {
|
|
434
|
+
const slotPropValue = slotProps[propName];
|
|
435
|
+
const childPropValue = childProps[propName];
|
|
436
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
437
|
+
if (isHandler) {
|
|
438
|
+
if (slotPropValue && childPropValue) {
|
|
439
|
+
overrideProps[propName] = (...args) => {
|
|
440
|
+
const result = childPropValue(...args);
|
|
441
|
+
slotPropValue(...args);
|
|
442
|
+
return result;
|
|
443
|
+
};
|
|
444
|
+
} else if (slotPropValue) {
|
|
445
|
+
overrideProps[propName] = slotPropValue;
|
|
446
|
+
}
|
|
447
|
+
} else if (propName === "style") {
|
|
448
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
449
|
+
} else if (propName === "className") {
|
|
450
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
return { ...slotProps, ...overrideProps };
|
|
454
|
+
}
|
|
455
|
+
function getElementRef(element) {
|
|
456
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
457
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
458
|
+
if (mayWarn) {
|
|
459
|
+
return element.ref;
|
|
460
|
+
}
|
|
461
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
462
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
463
|
+
if (mayWarn) {
|
|
464
|
+
return element.props.ref;
|
|
465
|
+
}
|
|
466
|
+
return element.props.ref || element.ref;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
470
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
471
|
+
var NODES = [
|
|
472
|
+
"a",
|
|
473
|
+
"button",
|
|
474
|
+
"div",
|
|
475
|
+
"form",
|
|
476
|
+
"h2",
|
|
477
|
+
"h3",
|
|
478
|
+
"img",
|
|
479
|
+
"input",
|
|
480
|
+
"label",
|
|
481
|
+
"li",
|
|
482
|
+
"nav",
|
|
483
|
+
"ol",
|
|
484
|
+
"p",
|
|
485
|
+
"select",
|
|
486
|
+
"span",
|
|
487
|
+
"svg",
|
|
488
|
+
"ul"
|
|
489
|
+
];
|
|
490
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
|
491
|
+
const Slot2 = createSlot(`Primitive.${node}`);
|
|
492
|
+
const Node2 = React10.forwardRef((props, forwardedRef) => {
|
|
493
|
+
const { asChild, ...primitiveProps } = props;
|
|
494
|
+
const Comp = asChild ? Slot2 : node;
|
|
495
|
+
if (typeof window !== "undefined") {
|
|
496
|
+
window[Symbol.for("radix-ui")] = true;
|
|
497
|
+
}
|
|
498
|
+
return /* @__PURE__ */ jsx7(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
499
|
+
});
|
|
500
|
+
Node2.displayName = `Primitive.${node}`;
|
|
501
|
+
return { ...primitive, [node]: Node2 };
|
|
502
|
+
}, {});
|
|
503
|
+
function dispatchDiscreteCustomEvent(target, event) {
|
|
504
|
+
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
// node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
508
|
+
import * as React11 from "react";
|
|
509
|
+
function useCallbackRef(callback) {
|
|
510
|
+
const callbackRef = React11.useRef(callback);
|
|
511
|
+
React11.useEffect(() => {
|
|
512
|
+
callbackRef.current = callback;
|
|
513
|
+
});
|
|
514
|
+
return React11.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
// node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
|
|
518
|
+
import * as React12 from "react";
|
|
519
|
+
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
520
|
+
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
521
|
+
React12.useEffect(() => {
|
|
522
|
+
const handleKeyDown = (event) => {
|
|
523
|
+
if (event.key === "Escape") {
|
|
524
|
+
onEscapeKeyDown(event);
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
|
|
528
|
+
return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
|
|
529
|
+
}, [onEscapeKeyDown, ownerDocument]);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
533
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
534
|
+
var DISMISSABLE_LAYER_NAME = "DismissableLayer";
|
|
535
|
+
var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
536
|
+
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
537
|
+
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
538
|
+
var originalBodyPointerEvents;
|
|
539
|
+
var DismissableLayerContext = React13.createContext({
|
|
540
|
+
layers: /* @__PURE__ */ new Set(),
|
|
541
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
542
|
+
branches: /* @__PURE__ */ new Set()
|
|
543
|
+
});
|
|
544
|
+
var DismissableLayer = React13.forwardRef(
|
|
545
|
+
(props, forwardedRef) => {
|
|
546
|
+
const {
|
|
547
|
+
disableOutsidePointerEvents = false,
|
|
548
|
+
onEscapeKeyDown,
|
|
549
|
+
onPointerDownOutside,
|
|
550
|
+
onFocusOutside,
|
|
551
|
+
onInteractOutside,
|
|
552
|
+
onDismiss,
|
|
553
|
+
...layerProps
|
|
554
|
+
} = props;
|
|
555
|
+
const context = React13.useContext(DismissableLayerContext);
|
|
556
|
+
const [node, setNode] = React13.useState(null);
|
|
557
|
+
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
558
|
+
const [, force] = React13.useState({});
|
|
559
|
+
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
560
|
+
const layers = Array.from(context.layers);
|
|
561
|
+
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
562
|
+
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
|
563
|
+
const index = node ? layers.indexOf(node) : -1;
|
|
564
|
+
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
565
|
+
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
566
|
+
const pointerDownOutside = usePointerDownOutside((event) => {
|
|
567
|
+
const target = event.target;
|
|
568
|
+
const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
|
|
569
|
+
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
570
|
+
onPointerDownOutside?.(event);
|
|
571
|
+
onInteractOutside?.(event);
|
|
572
|
+
if (!event.defaultPrevented) onDismiss?.();
|
|
573
|
+
}, ownerDocument);
|
|
574
|
+
const focusOutside = useFocusOutside((event) => {
|
|
575
|
+
const target = event.target;
|
|
576
|
+
const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
|
|
577
|
+
if (isFocusInBranch) return;
|
|
578
|
+
onFocusOutside?.(event);
|
|
579
|
+
onInteractOutside?.(event);
|
|
580
|
+
if (!event.defaultPrevented) onDismiss?.();
|
|
581
|
+
}, ownerDocument);
|
|
582
|
+
useEscapeKeydown((event) => {
|
|
583
|
+
const isHighestLayer = index === context.layers.size - 1;
|
|
584
|
+
if (!isHighestLayer) return;
|
|
585
|
+
onEscapeKeyDown?.(event);
|
|
586
|
+
if (!event.defaultPrevented && onDismiss) {
|
|
587
|
+
event.preventDefault();
|
|
588
|
+
onDismiss();
|
|
589
|
+
}
|
|
590
|
+
}, ownerDocument);
|
|
591
|
+
React13.useEffect(() => {
|
|
592
|
+
if (!node) return;
|
|
593
|
+
if (disableOutsidePointerEvents) {
|
|
594
|
+
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
595
|
+
originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
596
|
+
ownerDocument.body.style.pointerEvents = "none";
|
|
597
|
+
}
|
|
598
|
+
context.layersWithOutsidePointerEventsDisabled.add(node);
|
|
599
|
+
}
|
|
600
|
+
context.layers.add(node);
|
|
601
|
+
dispatchUpdate();
|
|
602
|
+
return () => {
|
|
603
|
+
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
|
|
604
|
+
ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
608
|
+
React13.useEffect(() => {
|
|
609
|
+
return () => {
|
|
610
|
+
if (!node) return;
|
|
611
|
+
context.layers.delete(node);
|
|
612
|
+
context.layersWithOutsidePointerEventsDisabled.delete(node);
|
|
613
|
+
dispatchUpdate();
|
|
614
|
+
};
|
|
615
|
+
}, [node, context]);
|
|
616
|
+
React13.useEffect(() => {
|
|
617
|
+
const handleUpdate = () => force({});
|
|
618
|
+
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
619
|
+
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
620
|
+
}, []);
|
|
621
|
+
return /* @__PURE__ */ jsx8(
|
|
622
|
+
Primitive.div,
|
|
623
|
+
{
|
|
624
|
+
...layerProps,
|
|
625
|
+
ref: composedRefs,
|
|
626
|
+
style: {
|
|
627
|
+
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
|
|
628
|
+
...props.style
|
|
629
|
+
},
|
|
630
|
+
onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
631
|
+
onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
632
|
+
onPointerDownCapture: composeEventHandlers(
|
|
633
|
+
props.onPointerDownCapture,
|
|
634
|
+
pointerDownOutside.onPointerDownCapture
|
|
635
|
+
)
|
|
636
|
+
}
|
|
637
|
+
);
|
|
638
|
+
}
|
|
639
|
+
);
|
|
640
|
+
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
641
|
+
var BRANCH_NAME = "DismissableLayerBranch";
|
|
642
|
+
var DismissableLayerBranch = React13.forwardRef((props, forwardedRef) => {
|
|
643
|
+
const context = React13.useContext(DismissableLayerContext);
|
|
644
|
+
const ref = React13.useRef(null);
|
|
645
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
646
|
+
React13.useEffect(() => {
|
|
647
|
+
const node = ref.current;
|
|
648
|
+
if (node) {
|
|
649
|
+
context.branches.add(node);
|
|
650
|
+
return () => {
|
|
651
|
+
context.branches.delete(node);
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
}, [context.branches]);
|
|
655
|
+
return /* @__PURE__ */ jsx8(Primitive.div, { ...props, ref: composedRefs });
|
|
656
|
+
});
|
|
657
|
+
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
658
|
+
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
659
|
+
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
660
|
+
const isPointerInsideReactTreeRef = React13.useRef(false);
|
|
661
|
+
const handleClickRef = React13.useRef(() => {
|
|
662
|
+
});
|
|
663
|
+
React13.useEffect(() => {
|
|
664
|
+
const handlePointerDown = (event) => {
|
|
665
|
+
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
666
|
+
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
667
|
+
handleAndDispatchCustomEvent(
|
|
668
|
+
POINTER_DOWN_OUTSIDE,
|
|
669
|
+
handlePointerDownOutside,
|
|
670
|
+
eventDetail,
|
|
671
|
+
{ discrete: true }
|
|
672
|
+
);
|
|
673
|
+
};
|
|
674
|
+
var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
|
|
675
|
+
const eventDetail = { originalEvent: event };
|
|
676
|
+
if (event.pointerType === "touch") {
|
|
677
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
678
|
+
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
|
|
679
|
+
ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
|
|
680
|
+
} else {
|
|
681
|
+
handleAndDispatchPointerDownOutsideEvent2();
|
|
682
|
+
}
|
|
683
|
+
} else {
|
|
684
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
685
|
+
}
|
|
686
|
+
isPointerInsideReactTreeRef.current = false;
|
|
687
|
+
};
|
|
688
|
+
const timerId = window.setTimeout(() => {
|
|
689
|
+
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
|
690
|
+
}, 0);
|
|
691
|
+
return () => {
|
|
692
|
+
window.clearTimeout(timerId);
|
|
693
|
+
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
|
694
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
695
|
+
};
|
|
696
|
+
}, [ownerDocument, handlePointerDownOutside]);
|
|
697
|
+
return {
|
|
698
|
+
// ensures we check React component tree (not just DOM tree)
|
|
699
|
+
onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
703
|
+
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
704
|
+
const isFocusInsideReactTreeRef = React13.useRef(false);
|
|
705
|
+
React13.useEffect(() => {
|
|
706
|
+
const handleFocus = (event) => {
|
|
707
|
+
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
708
|
+
const eventDetail = { originalEvent: event };
|
|
709
|
+
handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
710
|
+
discrete: false
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
};
|
|
714
|
+
ownerDocument.addEventListener("focusin", handleFocus);
|
|
715
|
+
return () => ownerDocument.removeEventListener("focusin", handleFocus);
|
|
716
|
+
}, [ownerDocument, handleFocusOutside]);
|
|
717
|
+
return {
|
|
718
|
+
onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
|
|
719
|
+
onBlurCapture: () => isFocusInsideReactTreeRef.current = false
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
function dispatchUpdate() {
|
|
723
|
+
const event = new CustomEvent(CONTEXT_UPDATE);
|
|
724
|
+
document.dispatchEvent(event);
|
|
725
|
+
}
|
|
726
|
+
function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
727
|
+
const target = detail.originalEvent.target;
|
|
728
|
+
const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
|
|
729
|
+
if (handler) target.addEventListener(name, handler, { once: true });
|
|
730
|
+
if (discrete) {
|
|
731
|
+
dispatchDiscreteCustomEvent(target, event);
|
|
732
|
+
} else {
|
|
733
|
+
target.dispatchEvent(event);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
// node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
738
|
+
import * as React14 from "react";
|
|
739
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
740
|
+
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
741
|
+
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
742
|
+
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
743
|
+
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
744
|
+
var FocusScope = React14.forwardRef((props, forwardedRef) => {
|
|
745
|
+
const {
|
|
746
|
+
loop = false,
|
|
747
|
+
trapped = false,
|
|
748
|
+
onMountAutoFocus: onMountAutoFocusProp,
|
|
749
|
+
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
750
|
+
...scopeProps
|
|
751
|
+
} = props;
|
|
752
|
+
const [container, setContainer] = React14.useState(null);
|
|
753
|
+
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
754
|
+
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
755
|
+
const lastFocusedElementRef = React14.useRef(null);
|
|
756
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
757
|
+
const focusScope = React14.useRef({
|
|
758
|
+
paused: false,
|
|
759
|
+
pause() {
|
|
760
|
+
this.paused = true;
|
|
761
|
+
},
|
|
762
|
+
resume() {
|
|
763
|
+
this.paused = false;
|
|
764
|
+
}
|
|
765
|
+
}).current;
|
|
766
|
+
React14.useEffect(() => {
|
|
767
|
+
if (trapped) {
|
|
768
|
+
let handleFocusIn2 = function(event) {
|
|
769
|
+
if (focusScope.paused || !container) return;
|
|
770
|
+
const target = event.target;
|
|
771
|
+
if (container.contains(target)) {
|
|
772
|
+
lastFocusedElementRef.current = target;
|
|
773
|
+
} else {
|
|
774
|
+
focus(lastFocusedElementRef.current, { select: true });
|
|
775
|
+
}
|
|
776
|
+
}, handleFocusOut2 = function(event) {
|
|
777
|
+
if (focusScope.paused || !container) return;
|
|
778
|
+
const relatedTarget = event.relatedTarget;
|
|
779
|
+
if (relatedTarget === null) return;
|
|
780
|
+
if (!container.contains(relatedTarget)) {
|
|
781
|
+
focus(lastFocusedElementRef.current, { select: true });
|
|
782
|
+
}
|
|
783
|
+
}, handleMutations2 = function(mutations) {
|
|
784
|
+
const focusedElement = document.activeElement;
|
|
785
|
+
if (focusedElement !== document.body) return;
|
|
786
|
+
for (const mutation of mutations) {
|
|
787
|
+
if (mutation.removedNodes.length > 0) focus(container);
|
|
788
|
+
}
|
|
789
|
+
};
|
|
790
|
+
var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;
|
|
791
|
+
document.addEventListener("focusin", handleFocusIn2);
|
|
792
|
+
document.addEventListener("focusout", handleFocusOut2);
|
|
793
|
+
const mutationObserver = new MutationObserver(handleMutations2);
|
|
794
|
+
if (container) mutationObserver.observe(container, { childList: true, subtree: true });
|
|
795
|
+
return () => {
|
|
796
|
+
document.removeEventListener("focusin", handleFocusIn2);
|
|
797
|
+
document.removeEventListener("focusout", handleFocusOut2);
|
|
798
|
+
mutationObserver.disconnect();
|
|
799
|
+
};
|
|
800
|
+
}
|
|
801
|
+
}, [trapped, container, focusScope.paused]);
|
|
802
|
+
React14.useEffect(() => {
|
|
803
|
+
if (container) {
|
|
804
|
+
focusScopesStack.add(focusScope);
|
|
805
|
+
const previouslyFocusedElement = document.activeElement;
|
|
806
|
+
const hasFocusedCandidate = container.contains(previouslyFocusedElement);
|
|
807
|
+
if (!hasFocusedCandidate) {
|
|
808
|
+
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
809
|
+
container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
810
|
+
container.dispatchEvent(mountEvent);
|
|
811
|
+
if (!mountEvent.defaultPrevented) {
|
|
812
|
+
focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
|
|
813
|
+
if (document.activeElement === previouslyFocusedElement) {
|
|
814
|
+
focus(container);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
return () => {
|
|
819
|
+
container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
820
|
+
setTimeout(() => {
|
|
821
|
+
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
|
|
822
|
+
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
823
|
+
container.dispatchEvent(unmountEvent);
|
|
824
|
+
if (!unmountEvent.defaultPrevented) {
|
|
825
|
+
focus(previouslyFocusedElement ?? document.body, { select: true });
|
|
826
|
+
}
|
|
827
|
+
container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
828
|
+
focusScopesStack.remove(focusScope);
|
|
829
|
+
}, 0);
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
833
|
+
const handleKeyDown = React14.useCallback(
|
|
834
|
+
(event) => {
|
|
835
|
+
if (!loop && !trapped) return;
|
|
836
|
+
if (focusScope.paused) return;
|
|
837
|
+
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
838
|
+
const focusedElement = document.activeElement;
|
|
839
|
+
if (isTabKey && focusedElement) {
|
|
840
|
+
const container2 = event.currentTarget;
|
|
841
|
+
const [first, last] = getTabbableEdges(container2);
|
|
842
|
+
const hasTabbableElementsInside = first && last;
|
|
843
|
+
if (!hasTabbableElementsInside) {
|
|
844
|
+
if (focusedElement === container2) event.preventDefault();
|
|
845
|
+
} else {
|
|
846
|
+
if (!event.shiftKey && focusedElement === last) {
|
|
847
|
+
event.preventDefault();
|
|
848
|
+
if (loop) focus(first, { select: true });
|
|
849
|
+
} else if (event.shiftKey && focusedElement === first) {
|
|
850
|
+
event.preventDefault();
|
|
851
|
+
if (loop) focus(last, { select: true });
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
},
|
|
856
|
+
[loop, trapped, focusScope.paused]
|
|
857
|
+
);
|
|
858
|
+
return /* @__PURE__ */ jsx9(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
859
|
+
});
|
|
860
|
+
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
861
|
+
function focusFirst(candidates, { select = false } = {}) {
|
|
862
|
+
const previouslyFocusedElement = document.activeElement;
|
|
863
|
+
for (const candidate of candidates) {
|
|
864
|
+
focus(candidate, { select });
|
|
865
|
+
if (document.activeElement !== previouslyFocusedElement) return;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
function getTabbableEdges(container) {
|
|
869
|
+
const candidates = getTabbableCandidates(container);
|
|
870
|
+
const first = findVisible(candidates, container);
|
|
871
|
+
const last = findVisible(candidates.reverse(), container);
|
|
872
|
+
return [first, last];
|
|
873
|
+
}
|
|
874
|
+
function getTabbableCandidates(container) {
|
|
875
|
+
const nodes = [];
|
|
876
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
877
|
+
acceptNode: (node) => {
|
|
878
|
+
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
879
|
+
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
|
|
880
|
+
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
881
|
+
}
|
|
882
|
+
});
|
|
883
|
+
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
884
|
+
return nodes;
|
|
885
|
+
}
|
|
886
|
+
function findVisible(elements, container) {
|
|
887
|
+
for (const element of elements) {
|
|
888
|
+
if (!isHidden(element, { upTo: container })) return element;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
function isHidden(node, { upTo }) {
|
|
892
|
+
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
893
|
+
while (node) {
|
|
894
|
+
if (upTo !== void 0 && node === upTo) return false;
|
|
895
|
+
if (getComputedStyle(node).display === "none") return true;
|
|
896
|
+
node = node.parentElement;
|
|
897
|
+
}
|
|
898
|
+
return false;
|
|
899
|
+
}
|
|
900
|
+
function isSelectableInput(element) {
|
|
901
|
+
return element instanceof HTMLInputElement && "select" in element;
|
|
902
|
+
}
|
|
903
|
+
function focus(element, { select = false } = {}) {
|
|
904
|
+
if (element && element.focus) {
|
|
905
|
+
const previouslyFocusedElement = document.activeElement;
|
|
906
|
+
element.focus({ preventScroll: true });
|
|
907
|
+
if (element !== previouslyFocusedElement && isSelectableInput(element) && select)
|
|
908
|
+
element.select();
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
var focusScopesStack = createFocusScopesStack();
|
|
912
|
+
function createFocusScopesStack() {
|
|
913
|
+
let stack = [];
|
|
914
|
+
return {
|
|
915
|
+
add(focusScope) {
|
|
916
|
+
const activeFocusScope = stack[0];
|
|
917
|
+
if (focusScope !== activeFocusScope) {
|
|
918
|
+
activeFocusScope?.pause();
|
|
919
|
+
}
|
|
920
|
+
stack = arrayRemove(stack, focusScope);
|
|
921
|
+
stack.unshift(focusScope);
|
|
922
|
+
},
|
|
923
|
+
remove(focusScope) {
|
|
924
|
+
stack = arrayRemove(stack, focusScope);
|
|
925
|
+
stack[0]?.resume();
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
function arrayRemove(array, item) {
|
|
930
|
+
const updatedArray = [...array];
|
|
931
|
+
const index = updatedArray.indexOf(item);
|
|
932
|
+
if (index !== -1) {
|
|
933
|
+
updatedArray.splice(index, 1);
|
|
934
|
+
}
|
|
935
|
+
return updatedArray;
|
|
936
|
+
}
|
|
937
|
+
function removeLinks(items) {
|
|
938
|
+
return items.filter((item) => item.tagName !== "A");
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
// node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
942
|
+
import * as React15 from "react";
|
|
943
|
+
import ReactDOM2 from "react-dom";
|
|
944
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
945
|
+
var PORTAL_NAME = "Portal";
|
|
946
|
+
var Portal = React15.forwardRef((props, forwardedRef) => {
|
|
947
|
+
const { container: containerProp, ...portalProps } = props;
|
|
948
|
+
const [mounted, setMounted] = React15.useState(false);
|
|
949
|
+
useLayoutEffect2(() => setMounted(true), []);
|
|
950
|
+
const container = containerProp || mounted && globalThis?.document?.body;
|
|
951
|
+
return container ? ReactDOM2.createPortal(/* @__PURE__ */ jsx10(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
952
|
+
});
|
|
953
|
+
Portal.displayName = PORTAL_NAME;
|
|
954
|
+
|
|
955
|
+
// node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
956
|
+
import * as React23 from "react";
|
|
957
|
+
import * as React16 from "react";
|
|
958
|
+
function useStateMachine(initialState, machine) {
|
|
959
|
+
return React16.useReducer((state, event) => {
|
|
960
|
+
const nextState = machine[state][event];
|
|
961
|
+
return nextState ?? state;
|
|
962
|
+
}, initialState);
|
|
963
|
+
}
|
|
964
|
+
var Presence = (props) => {
|
|
965
|
+
const { present, children } = props;
|
|
966
|
+
const presence = usePresence(present);
|
|
967
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React23.Children.only(children);
|
|
968
|
+
const ref = useComposedRefs(presence.ref, getElementRef2(child));
|
|
969
|
+
const forceMount = typeof children === "function";
|
|
970
|
+
return forceMount || presence.isPresent ? React23.cloneElement(child, { ref }) : null;
|
|
971
|
+
};
|
|
972
|
+
Presence.displayName = "Presence";
|
|
973
|
+
function usePresence(present) {
|
|
974
|
+
const [node, setNode] = React23.useState();
|
|
975
|
+
const stylesRef = React23.useRef(null);
|
|
976
|
+
const prevPresentRef = React23.useRef(present);
|
|
977
|
+
const prevAnimationNameRef = React23.useRef("none");
|
|
978
|
+
const initialState = present ? "mounted" : "unmounted";
|
|
979
|
+
const [state, send] = useStateMachine(initialState, {
|
|
980
|
+
mounted: {
|
|
981
|
+
UNMOUNT: "unmounted",
|
|
982
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
983
|
+
},
|
|
984
|
+
unmountSuspended: {
|
|
985
|
+
MOUNT: "mounted",
|
|
986
|
+
ANIMATION_END: "unmounted"
|
|
987
|
+
},
|
|
988
|
+
unmounted: {
|
|
989
|
+
MOUNT: "mounted"
|
|
990
|
+
}
|
|
991
|
+
});
|
|
992
|
+
React23.useEffect(() => {
|
|
993
|
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
994
|
+
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
995
|
+
}, [state]);
|
|
996
|
+
useLayoutEffect2(() => {
|
|
997
|
+
const styles = stylesRef.current;
|
|
998
|
+
const wasPresent = prevPresentRef.current;
|
|
999
|
+
const hasPresentChanged = wasPresent !== present;
|
|
1000
|
+
if (hasPresentChanged) {
|
|
1001
|
+
const prevAnimationName = prevAnimationNameRef.current;
|
|
1002
|
+
const currentAnimationName = getAnimationName(styles);
|
|
1003
|
+
if (present) {
|
|
1004
|
+
send("MOUNT");
|
|
1005
|
+
} else if (currentAnimationName === "none" || styles?.display === "none") {
|
|
1006
|
+
send("UNMOUNT");
|
|
1007
|
+
} else {
|
|
1008
|
+
const isAnimating = prevAnimationName !== currentAnimationName;
|
|
1009
|
+
if (wasPresent && isAnimating) {
|
|
1010
|
+
send("ANIMATION_OUT");
|
|
1011
|
+
} else {
|
|
1012
|
+
send("UNMOUNT");
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
prevPresentRef.current = present;
|
|
1016
|
+
}
|
|
1017
|
+
}, [present, send]);
|
|
1018
|
+
useLayoutEffect2(() => {
|
|
1019
|
+
if (node) {
|
|
1020
|
+
let timeoutId;
|
|
1021
|
+
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
1022
|
+
const handleAnimationEnd = (event) => {
|
|
1023
|
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
1024
|
+
const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
|
|
1025
|
+
if (event.target === node && isCurrentAnimation) {
|
|
1026
|
+
send("ANIMATION_END");
|
|
1027
|
+
if (!prevPresentRef.current) {
|
|
1028
|
+
const currentFillMode = node.style.animationFillMode;
|
|
1029
|
+
node.style.animationFillMode = "forwards";
|
|
1030
|
+
timeoutId = ownerWindow.setTimeout(() => {
|
|
1031
|
+
if (node.style.animationFillMode === "forwards") {
|
|
1032
|
+
node.style.animationFillMode = currentFillMode;
|
|
1033
|
+
}
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
};
|
|
1038
|
+
const handleAnimationStart = (event) => {
|
|
1039
|
+
if (event.target === node) {
|
|
1040
|
+
prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
1041
|
+
}
|
|
1042
|
+
};
|
|
1043
|
+
node.addEventListener("animationstart", handleAnimationStart);
|
|
1044
|
+
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
1045
|
+
node.addEventListener("animationend", handleAnimationEnd);
|
|
1046
|
+
return () => {
|
|
1047
|
+
ownerWindow.clearTimeout(timeoutId);
|
|
1048
|
+
node.removeEventListener("animationstart", handleAnimationStart);
|
|
1049
|
+
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
1050
|
+
node.removeEventListener("animationend", handleAnimationEnd);
|
|
1051
|
+
};
|
|
1052
|
+
} else {
|
|
1053
|
+
send("ANIMATION_END");
|
|
1054
|
+
}
|
|
1055
|
+
}, [node, send]);
|
|
1056
|
+
return {
|
|
1057
|
+
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
1058
|
+
ref: React23.useCallback((node2) => {
|
|
1059
|
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
1060
|
+
setNode(node2);
|
|
1061
|
+
}, [])
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
function getAnimationName(styles) {
|
|
1065
|
+
return styles?.animationName || "none";
|
|
1066
|
+
}
|
|
1067
|
+
function getElementRef2(element) {
|
|
1068
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
1069
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
1070
|
+
if (mayWarn) {
|
|
1071
|
+
return element.ref;
|
|
1072
|
+
}
|
|
1073
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
1074
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
1075
|
+
if (mayWarn) {
|
|
1076
|
+
return element.props.ref;
|
|
1077
|
+
}
|
|
1078
|
+
return element.props.ref || element.ref;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
// node_modules/@radix-ui/react-focus-guards/dist/index.mjs
|
|
1082
|
+
import * as React17 from "react";
|
|
1083
|
+
var count2 = 0;
|
|
1084
|
+
function useFocusGuards() {
|
|
1085
|
+
React17.useEffect(() => {
|
|
1086
|
+
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
1087
|
+
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
1088
|
+
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
1089
|
+
count2++;
|
|
1090
|
+
return () => {
|
|
1091
|
+
if (count2 === 1) {
|
|
1092
|
+
document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
|
|
1093
|
+
}
|
|
1094
|
+
count2--;
|
|
1095
|
+
};
|
|
1096
|
+
}, []);
|
|
1097
|
+
}
|
|
1098
|
+
function createFocusGuard() {
|
|
1099
|
+
const element = document.createElement("span");
|
|
1100
|
+
element.setAttribute("data-radix-focus-guard", "");
|
|
1101
|
+
element.tabIndex = 0;
|
|
1102
|
+
element.style.outline = "none";
|
|
1103
|
+
element.style.opacity = "0";
|
|
1104
|
+
element.style.position = "fixed";
|
|
1105
|
+
element.style.pointerEvents = "none";
|
|
1106
|
+
return element;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
// node_modules/tslib/tslib.es6.mjs
|
|
1110
|
+
var __assign = function() {
|
|
1111
|
+
__assign = Object.assign || function __assign2(t) {
|
|
1112
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1113
|
+
s = arguments[i];
|
|
1114
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
1115
|
+
}
|
|
1116
|
+
return t;
|
|
1117
|
+
};
|
|
1118
|
+
return __assign.apply(this, arguments);
|
|
1119
|
+
};
|
|
1120
|
+
function __rest(s, e) {
|
|
1121
|
+
var t = {};
|
|
1122
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1123
|
+
t[p] = s[p];
|
|
1124
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1125
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1126
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1127
|
+
t[p[i]] = s[p[i]];
|
|
1128
|
+
}
|
|
1129
|
+
return t;
|
|
1130
|
+
}
|
|
1131
|
+
function __spreadArray(to, from, pack) {
|
|
1132
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1133
|
+
if (ar || !(i in from)) {
|
|
1134
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
1135
|
+
ar[i] = from[i];
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
// node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
1142
|
+
import * as React26 from "react";
|
|
1143
|
+
|
|
1144
|
+
// node_modules/react-remove-scroll/dist/es2015/UI.js
|
|
1145
|
+
import * as React20 from "react";
|
|
1146
|
+
|
|
1147
|
+
// node_modules/react-remove-scroll-bar/dist/es2015/constants.js
|
|
1148
|
+
var zeroRightClassName = "right-scroll-bar-position";
|
|
1149
|
+
var fullWidthClassName = "width-before-scroll-bar";
|
|
1150
|
+
var noScrollbarsClassName = "with-scroll-bars-hidden";
|
|
1151
|
+
var removedBarSizeVariable = "--removed-body-scroll-bar-size";
|
|
1152
|
+
|
|
1153
|
+
// node_modules/use-callback-ref/dist/es2015/assignRef.js
|
|
1154
|
+
function assignRef(ref, value) {
|
|
1155
|
+
if (typeof ref === "function") {
|
|
1156
|
+
ref(value);
|
|
1157
|
+
} else if (ref) {
|
|
1158
|
+
ref.current = value;
|
|
1159
|
+
}
|
|
1160
|
+
return ref;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
// node_modules/use-callback-ref/dist/es2015/useRef.js
|
|
1164
|
+
import { useState as useState7 } from "react";
|
|
1165
|
+
function useCallbackRef2(initialValue, callback) {
|
|
1166
|
+
var ref = useState7(function() {
|
|
1167
|
+
return {
|
|
1168
|
+
// value
|
|
1169
|
+
value: initialValue,
|
|
1170
|
+
// last callback
|
|
1171
|
+
callback,
|
|
1172
|
+
// "memoized" public interface
|
|
1173
|
+
facade: {
|
|
1174
|
+
get current() {
|
|
1175
|
+
return ref.value;
|
|
1176
|
+
},
|
|
1177
|
+
set current(value) {
|
|
1178
|
+
var last = ref.value;
|
|
1179
|
+
if (last !== value) {
|
|
1180
|
+
ref.value = value;
|
|
1181
|
+
ref.callback(value, last);
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
};
|
|
1186
|
+
})[0];
|
|
1187
|
+
ref.callback = callback;
|
|
1188
|
+
return ref.facade;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
// node_modules/use-callback-ref/dist/es2015/useMergeRef.js
|
|
1192
|
+
import * as React18 from "react";
|
|
1193
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React18.useLayoutEffect : React18.useEffect;
|
|
1194
|
+
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
1195
|
+
function useMergeRefs(refs, defaultValue) {
|
|
1196
|
+
var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
|
|
1197
|
+
return refs.forEach(function(ref) {
|
|
1198
|
+
return assignRef(ref, newValue);
|
|
1199
|
+
});
|
|
1200
|
+
});
|
|
1201
|
+
useIsomorphicLayoutEffect(function() {
|
|
1202
|
+
var oldValue = currentValues.get(callbackRef);
|
|
1203
|
+
if (oldValue) {
|
|
1204
|
+
var prevRefs_1 = new Set(oldValue);
|
|
1205
|
+
var nextRefs_1 = new Set(refs);
|
|
1206
|
+
var current_1 = callbackRef.current;
|
|
1207
|
+
prevRefs_1.forEach(function(ref) {
|
|
1208
|
+
if (!nextRefs_1.has(ref)) {
|
|
1209
|
+
assignRef(ref, null);
|
|
1210
|
+
}
|
|
1211
|
+
});
|
|
1212
|
+
nextRefs_1.forEach(function(ref) {
|
|
1213
|
+
if (!prevRefs_1.has(ref)) {
|
|
1214
|
+
assignRef(ref, current_1);
|
|
1215
|
+
}
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
currentValues.set(callbackRef, refs);
|
|
1219
|
+
}, [refs]);
|
|
1220
|
+
return callbackRef;
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
// node_modules/use-sidecar/dist/es2015/medium.js
|
|
1224
|
+
function ItoI(a) {
|
|
1225
|
+
return a;
|
|
1226
|
+
}
|
|
1227
|
+
function innerCreateMedium(defaults, middleware) {
|
|
1228
|
+
if (middleware === void 0) {
|
|
1229
|
+
middleware = ItoI;
|
|
1230
|
+
}
|
|
1231
|
+
var buffer = [];
|
|
1232
|
+
var assigned = false;
|
|
1233
|
+
var medium = {
|
|
1234
|
+
read: function() {
|
|
1235
|
+
if (assigned) {
|
|
1236
|
+
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
1237
|
+
}
|
|
1238
|
+
if (buffer.length) {
|
|
1239
|
+
return buffer[buffer.length - 1];
|
|
1240
|
+
}
|
|
1241
|
+
return defaults;
|
|
1242
|
+
},
|
|
1243
|
+
useMedium: function(data) {
|
|
1244
|
+
var item = middleware(data, assigned);
|
|
1245
|
+
buffer.push(item);
|
|
1246
|
+
return function() {
|
|
1247
|
+
buffer = buffer.filter(function(x) {
|
|
1248
|
+
return x !== item;
|
|
1249
|
+
});
|
|
1250
|
+
};
|
|
1251
|
+
},
|
|
1252
|
+
assignSyncMedium: function(cb) {
|
|
1253
|
+
assigned = true;
|
|
1254
|
+
while (buffer.length) {
|
|
1255
|
+
var cbs = buffer;
|
|
1256
|
+
buffer = [];
|
|
1257
|
+
cbs.forEach(cb);
|
|
1258
|
+
}
|
|
1259
|
+
buffer = {
|
|
1260
|
+
push: function(x) {
|
|
1261
|
+
return cb(x);
|
|
1262
|
+
},
|
|
1263
|
+
filter: function() {
|
|
1264
|
+
return buffer;
|
|
1265
|
+
}
|
|
1266
|
+
};
|
|
1267
|
+
},
|
|
1268
|
+
assignMedium: function(cb) {
|
|
1269
|
+
assigned = true;
|
|
1270
|
+
var pendingQueue = [];
|
|
1271
|
+
if (buffer.length) {
|
|
1272
|
+
var cbs = buffer;
|
|
1273
|
+
buffer = [];
|
|
1274
|
+
cbs.forEach(cb);
|
|
1275
|
+
pendingQueue = buffer;
|
|
1276
|
+
}
|
|
1277
|
+
var executeQueue = function() {
|
|
1278
|
+
var cbs2 = pendingQueue;
|
|
1279
|
+
pendingQueue = [];
|
|
1280
|
+
cbs2.forEach(cb);
|
|
1281
|
+
};
|
|
1282
|
+
var cycle = function() {
|
|
1283
|
+
return Promise.resolve().then(executeQueue);
|
|
1284
|
+
};
|
|
1285
|
+
cycle();
|
|
1286
|
+
buffer = {
|
|
1287
|
+
push: function(x) {
|
|
1288
|
+
pendingQueue.push(x);
|
|
1289
|
+
cycle();
|
|
1290
|
+
},
|
|
1291
|
+
filter: function(filter) {
|
|
1292
|
+
pendingQueue = pendingQueue.filter(filter);
|
|
1293
|
+
return buffer;
|
|
1294
|
+
}
|
|
1295
|
+
};
|
|
1296
|
+
}
|
|
1297
|
+
};
|
|
1298
|
+
return medium;
|
|
1299
|
+
}
|
|
1300
|
+
function createSidecarMedium(options) {
|
|
1301
|
+
if (options === void 0) {
|
|
1302
|
+
options = {};
|
|
1303
|
+
}
|
|
1304
|
+
var medium = innerCreateMedium(null);
|
|
1305
|
+
medium.options = __assign({ async: true, ssr: false }, options);
|
|
1306
|
+
return medium;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
// node_modules/use-sidecar/dist/es2015/exports.js
|
|
1310
|
+
import * as React19 from "react";
|
|
1311
|
+
var SideCar = function(_a) {
|
|
1312
|
+
var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
|
|
1313
|
+
if (!sideCar) {
|
|
1314
|
+
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
1315
|
+
}
|
|
1316
|
+
var Target = sideCar.read();
|
|
1317
|
+
if (!Target) {
|
|
1318
|
+
throw new Error("Sidecar medium not found");
|
|
1319
|
+
}
|
|
1320
|
+
return React19.createElement(Target, __assign({}, rest));
|
|
1321
|
+
};
|
|
1322
|
+
SideCar.isSideCarExport = true;
|
|
1323
|
+
function exportSidecar(medium, exported) {
|
|
1324
|
+
medium.useMedium(exported);
|
|
1325
|
+
return SideCar;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
// node_modules/react-remove-scroll/dist/es2015/medium.js
|
|
1329
|
+
var effectCar = createSidecarMedium();
|
|
1330
|
+
|
|
1331
|
+
// node_modules/react-remove-scroll/dist/es2015/UI.js
|
|
1332
|
+
var nothing = function() {
|
|
1333
|
+
return;
|
|
1334
|
+
};
|
|
1335
|
+
var RemoveScroll = React20.forwardRef(function(props, parentRef) {
|
|
1336
|
+
var ref = React20.useRef(null);
|
|
1337
|
+
var _a = React20.useState({
|
|
1338
|
+
onScrollCapture: nothing,
|
|
1339
|
+
onWheelCapture: nothing,
|
|
1340
|
+
onTouchMoveCapture: nothing
|
|
1341
|
+
}), callbacks = _a[0], setCallbacks = _a[1];
|
|
1342
|
+
var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
|
|
1343
|
+
var SideCar2 = sideCar;
|
|
1344
|
+
var containerRef = useMergeRefs([ref, parentRef]);
|
|
1345
|
+
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
1346
|
+
return React20.createElement(
|
|
1347
|
+
React20.Fragment,
|
|
1348
|
+
null,
|
|
1349
|
+
enabled && React20.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
|
|
1350
|
+
forwardProps ? React20.cloneElement(React20.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React20.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
|
|
1351
|
+
);
|
|
1352
|
+
});
|
|
1353
|
+
RemoveScroll.defaultProps = {
|
|
1354
|
+
enabled: true,
|
|
1355
|
+
removeScrollBar: true,
|
|
1356
|
+
inert: false
|
|
1357
|
+
};
|
|
1358
|
+
RemoveScroll.classNames = {
|
|
1359
|
+
fullWidth: fullWidthClassName,
|
|
1360
|
+
zeroRight: zeroRightClassName
|
|
1361
|
+
};
|
|
1362
|
+
|
|
1363
|
+
// node_modules/react-remove-scroll/dist/es2015/SideEffect.js
|
|
1364
|
+
import * as React25 from "react";
|
|
1365
|
+
|
|
1366
|
+
// node_modules/react-remove-scroll-bar/dist/es2015/component.js
|
|
1367
|
+
import * as React24 from "react";
|
|
1368
|
+
|
|
1369
|
+
// node_modules/react-style-singleton/dist/es2015/hook.js
|
|
1370
|
+
import * as React21 from "react";
|
|
1371
|
+
|
|
1372
|
+
// node_modules/get-nonce/dist/es2015/index.js
|
|
1373
|
+
var currentNonce;
|
|
1374
|
+
var getNonce = function() {
|
|
1375
|
+
if (currentNonce) {
|
|
1376
|
+
return currentNonce;
|
|
1377
|
+
}
|
|
1378
|
+
if (typeof __webpack_nonce__ !== "undefined") {
|
|
1379
|
+
return __webpack_nonce__;
|
|
1380
|
+
}
|
|
1381
|
+
return void 0;
|
|
1382
|
+
};
|
|
1383
|
+
|
|
1384
|
+
// node_modules/react-style-singleton/dist/es2015/singleton.js
|
|
1385
|
+
function makeStyleTag() {
|
|
1386
|
+
if (!document)
|
|
1387
|
+
return null;
|
|
1388
|
+
var tag = document.createElement("style");
|
|
1389
|
+
tag.type = "text/css";
|
|
1390
|
+
var nonce = getNonce();
|
|
1391
|
+
if (nonce) {
|
|
1392
|
+
tag.setAttribute("nonce", nonce);
|
|
1393
|
+
}
|
|
1394
|
+
return tag;
|
|
1395
|
+
}
|
|
1396
|
+
function injectStyles(tag, css) {
|
|
1397
|
+
if (tag.styleSheet) {
|
|
1398
|
+
tag.styleSheet.cssText = css;
|
|
1399
|
+
} else {
|
|
1400
|
+
tag.appendChild(document.createTextNode(css));
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
function insertStyleTag(tag) {
|
|
1404
|
+
var head = document.head || document.getElementsByTagName("head")[0];
|
|
1405
|
+
head.appendChild(tag);
|
|
1406
|
+
}
|
|
1407
|
+
var stylesheetSingleton = function() {
|
|
1408
|
+
var counter = 0;
|
|
1409
|
+
var stylesheet = null;
|
|
1410
|
+
return {
|
|
1411
|
+
add: function(style) {
|
|
1412
|
+
if (counter == 0) {
|
|
1413
|
+
if (stylesheet = makeStyleTag()) {
|
|
1414
|
+
injectStyles(stylesheet, style);
|
|
1415
|
+
insertStyleTag(stylesheet);
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
counter++;
|
|
1419
|
+
},
|
|
1420
|
+
remove: function() {
|
|
1421
|
+
counter--;
|
|
1422
|
+
if (!counter && stylesheet) {
|
|
1423
|
+
stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
|
|
1424
|
+
stylesheet = null;
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1428
|
+
};
|
|
1429
|
+
|
|
1430
|
+
// node_modules/react-style-singleton/dist/es2015/hook.js
|
|
1431
|
+
var styleHookSingleton = function() {
|
|
1432
|
+
var sheet = stylesheetSingleton();
|
|
1433
|
+
return function(styles, isDynamic) {
|
|
1434
|
+
React21.useEffect(function() {
|
|
1435
|
+
sheet.add(styles);
|
|
1436
|
+
return function() {
|
|
1437
|
+
sheet.remove();
|
|
1438
|
+
};
|
|
1439
|
+
}, [styles && isDynamic]);
|
|
1440
|
+
};
|
|
1441
|
+
};
|
|
1442
|
+
|
|
1443
|
+
// node_modules/react-style-singleton/dist/es2015/component.js
|
|
1444
|
+
var styleSingleton = function() {
|
|
1445
|
+
var useStyle = styleHookSingleton();
|
|
1446
|
+
var Sheet = function(_a) {
|
|
1447
|
+
var styles = _a.styles, dynamic = _a.dynamic;
|
|
1448
|
+
useStyle(styles, dynamic);
|
|
1449
|
+
return null;
|
|
1450
|
+
};
|
|
1451
|
+
return Sheet;
|
|
1452
|
+
};
|
|
1453
|
+
|
|
1454
|
+
// node_modules/react-remove-scroll-bar/dist/es2015/utils.js
|
|
1455
|
+
var zeroGap = {
|
|
1456
|
+
left: 0,
|
|
1457
|
+
top: 0,
|
|
1458
|
+
right: 0,
|
|
1459
|
+
gap: 0
|
|
1460
|
+
};
|
|
1461
|
+
var parse = function(x) {
|
|
1462
|
+
return parseInt(x || "", 10) || 0;
|
|
1463
|
+
};
|
|
1464
|
+
var getOffset = function(gapMode) {
|
|
1465
|
+
var cs = window.getComputedStyle(document.body);
|
|
1466
|
+
var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
|
|
1467
|
+
var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
|
|
1468
|
+
var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
|
|
1469
|
+
return [parse(left), parse(top), parse(right)];
|
|
1470
|
+
};
|
|
1471
|
+
var getGapWidth = function(gapMode) {
|
|
1472
|
+
if (gapMode === void 0) {
|
|
1473
|
+
gapMode = "margin";
|
|
1474
|
+
}
|
|
1475
|
+
if (typeof window === "undefined") {
|
|
1476
|
+
return zeroGap;
|
|
1477
|
+
}
|
|
1478
|
+
var offsets = getOffset(gapMode);
|
|
1479
|
+
var documentWidth = document.documentElement.clientWidth;
|
|
1480
|
+
var windowWidth = window.innerWidth;
|
|
1481
|
+
return {
|
|
1482
|
+
left: offsets[0],
|
|
1483
|
+
top: offsets[1],
|
|
1484
|
+
right: offsets[2],
|
|
1485
|
+
gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
|
|
1486
|
+
};
|
|
1487
|
+
};
|
|
1488
|
+
|
|
1489
|
+
// node_modules/react-remove-scroll-bar/dist/es2015/component.js
|
|
1490
|
+
var Style = styleSingleton();
|
|
1491
|
+
var lockAttribute = "data-scroll-locked";
|
|
1492
|
+
var getStyles = function(_a, allowRelative, gapMode, important) {
|
|
1493
|
+
var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
|
|
1494
|
+
if (gapMode === void 0) {
|
|
1495
|
+
gapMode = "margin";
|
|
1496
|
+
}
|
|
1497
|
+
return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
|
|
1498
|
+
allowRelative && "position: relative ".concat(important, ";"),
|
|
1499
|
+
gapMode === "margin" && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
|
|
1500
|
+
gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
|
|
1501
|
+
].filter(Boolean).join(""), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
|
|
1502
|
+
};
|
|
1503
|
+
var getCurrentUseCounter = function() {
|
|
1504
|
+
var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10);
|
|
1505
|
+
return isFinite(counter) ? counter : 0;
|
|
1506
|
+
};
|
|
1507
|
+
var useLockAttribute = function() {
|
|
1508
|
+
React24.useEffect(function() {
|
|
1509
|
+
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
1510
|
+
return function() {
|
|
1511
|
+
var newCounter = getCurrentUseCounter() - 1;
|
|
1512
|
+
if (newCounter <= 0) {
|
|
1513
|
+
document.body.removeAttribute(lockAttribute);
|
|
1514
|
+
} else {
|
|
1515
|
+
document.body.setAttribute(lockAttribute, newCounter.toString());
|
|
1516
|
+
}
|
|
1517
|
+
};
|
|
1518
|
+
}, []);
|
|
1519
|
+
};
|
|
1520
|
+
var RemoveScrollBar = function(_a) {
|
|
1521
|
+
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
1522
|
+
useLockAttribute();
|
|
1523
|
+
var gap = React24.useMemo(function() {
|
|
1524
|
+
return getGapWidth(gapMode);
|
|
1525
|
+
}, [gapMode]);
|
|
1526
|
+
return React24.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
1527
|
+
};
|
|
1528
|
+
|
|
1529
|
+
// node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
|
|
1530
|
+
var passiveSupported = false;
|
|
1531
|
+
if (typeof window !== "undefined") {
|
|
1532
|
+
try {
|
|
1533
|
+
options = Object.defineProperty({}, "passive", {
|
|
1534
|
+
get: function() {
|
|
1535
|
+
passiveSupported = true;
|
|
1536
|
+
return true;
|
|
1537
|
+
}
|
|
1538
|
+
});
|
|
1539
|
+
window.addEventListener("test", options, options);
|
|
1540
|
+
window.removeEventListener("test", options, options);
|
|
1541
|
+
} catch (err) {
|
|
1542
|
+
passiveSupported = false;
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
var options;
|
|
1546
|
+
var nonPassive = passiveSupported ? { passive: false } : false;
|
|
1547
|
+
|
|
1548
|
+
// node_modules/react-remove-scroll/dist/es2015/handleScroll.js
|
|
1549
|
+
var alwaysContainsScroll = function(node) {
|
|
1550
|
+
return node.tagName === "TEXTAREA";
|
|
1551
|
+
};
|
|
1552
|
+
var elementCanBeScrolled = function(node, overflow) {
|
|
1553
|
+
if (!(node instanceof Element)) {
|
|
1554
|
+
return false;
|
|
1555
|
+
}
|
|
1556
|
+
var styles = window.getComputedStyle(node);
|
|
1557
|
+
return (
|
|
1558
|
+
// not-not-scrollable
|
|
1559
|
+
styles[overflow] !== "hidden" && // contains scroll inside self
|
|
1560
|
+
!(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible")
|
|
1561
|
+
);
|
|
1562
|
+
};
|
|
1563
|
+
var elementCouldBeVScrolled = function(node) {
|
|
1564
|
+
return elementCanBeScrolled(node, "overflowY");
|
|
1565
|
+
};
|
|
1566
|
+
var elementCouldBeHScrolled = function(node) {
|
|
1567
|
+
return elementCanBeScrolled(node, "overflowX");
|
|
1568
|
+
};
|
|
1569
|
+
var locationCouldBeScrolled = function(axis, node) {
|
|
1570
|
+
var ownerDocument = node.ownerDocument;
|
|
1571
|
+
var current = node;
|
|
1572
|
+
do {
|
|
1573
|
+
if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) {
|
|
1574
|
+
current = current.host;
|
|
1575
|
+
}
|
|
1576
|
+
var isScrollable = elementCouldBeScrolled(axis, current);
|
|
1577
|
+
if (isScrollable) {
|
|
1578
|
+
var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
|
|
1579
|
+
if (scrollHeight > clientHeight) {
|
|
1580
|
+
return true;
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
current = current.parentNode;
|
|
1584
|
+
} while (current && current !== ownerDocument.body);
|
|
1585
|
+
return false;
|
|
1586
|
+
};
|
|
1587
|
+
var getVScrollVariables = function(_a) {
|
|
1588
|
+
var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
|
1589
|
+
return [
|
|
1590
|
+
scrollTop,
|
|
1591
|
+
scrollHeight,
|
|
1592
|
+
clientHeight
|
|
1593
|
+
];
|
|
1594
|
+
};
|
|
1595
|
+
var getHScrollVariables = function(_a) {
|
|
1596
|
+
var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
|
|
1597
|
+
return [
|
|
1598
|
+
scrollLeft,
|
|
1599
|
+
scrollWidth,
|
|
1600
|
+
clientWidth
|
|
1601
|
+
];
|
|
1602
|
+
};
|
|
1603
|
+
var elementCouldBeScrolled = function(axis, node) {
|
|
1604
|
+
return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
|
|
1605
|
+
};
|
|
1606
|
+
var getScrollVariables = function(axis, node) {
|
|
1607
|
+
return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
|
|
1608
|
+
};
|
|
1609
|
+
var getDirectionFactor = function(axis, direction) {
|
|
1610
|
+
return axis === "h" && direction === "rtl" ? -1 : 1;
|
|
1611
|
+
};
|
|
1612
|
+
var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
1613
|
+
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
|
|
1614
|
+
var delta = directionFactor * sourceDelta;
|
|
1615
|
+
var target = event.target;
|
|
1616
|
+
var targetInLock = endTarget.contains(target);
|
|
1617
|
+
var shouldCancelScroll = false;
|
|
1618
|
+
var isDeltaPositive = delta > 0;
|
|
1619
|
+
var availableScroll = 0;
|
|
1620
|
+
var availableScrollTop = 0;
|
|
1621
|
+
do {
|
|
1622
|
+
if (!target) {
|
|
1623
|
+
break;
|
|
1624
|
+
}
|
|
1625
|
+
var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
|
|
1626
|
+
var elementScroll = scroll_1 - capacity - directionFactor * position;
|
|
1627
|
+
if (position || elementScroll) {
|
|
1628
|
+
if (elementCouldBeScrolled(axis, target)) {
|
|
1629
|
+
availableScroll += elementScroll;
|
|
1630
|
+
availableScrollTop += position;
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
var parent_1 = target.parentNode;
|
|
1634
|
+
target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1;
|
|
1635
|
+
} while (
|
|
1636
|
+
// portaled content
|
|
1637
|
+
!targetInLock && target !== document.body || // self content
|
|
1638
|
+
targetInLock && (endTarget.contains(target) || endTarget === target)
|
|
1639
|
+
);
|
|
1640
|
+
if (isDeltaPositive && (noOverscroll && Math.abs(availableScroll) < 1 || !noOverscroll && delta > availableScroll)) {
|
|
1641
|
+
shouldCancelScroll = true;
|
|
1642
|
+
} else if (!isDeltaPositive && (noOverscroll && Math.abs(availableScrollTop) < 1 || !noOverscroll && -delta > availableScrollTop)) {
|
|
1643
|
+
shouldCancelScroll = true;
|
|
1644
|
+
}
|
|
1645
|
+
return shouldCancelScroll;
|
|
1646
|
+
};
|
|
1647
|
+
|
|
1648
|
+
// node_modules/react-remove-scroll/dist/es2015/SideEffect.js
|
|
1649
|
+
var getTouchXY = function(event) {
|
|
1650
|
+
return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
|
|
1651
|
+
};
|
|
1652
|
+
var getDeltaXY = function(event) {
|
|
1653
|
+
return [event.deltaX, event.deltaY];
|
|
1654
|
+
};
|
|
1655
|
+
var extractRef = function(ref) {
|
|
1656
|
+
return ref && "current" in ref ? ref.current : ref;
|
|
1657
|
+
};
|
|
1658
|
+
var deltaCompare = function(x, y) {
|
|
1659
|
+
return x[0] === y[0] && x[1] === y[1];
|
|
1660
|
+
};
|
|
1661
|
+
var generateStyle = function(id) {
|
|
1662
|
+
return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n");
|
|
1663
|
+
};
|
|
1664
|
+
var idCounter = 0;
|
|
1665
|
+
var lockStack = [];
|
|
1666
|
+
function RemoveScrollSideCar(props) {
|
|
1667
|
+
var shouldPreventQueue = React25.useRef([]);
|
|
1668
|
+
var touchStartRef = React25.useRef([0, 0]);
|
|
1669
|
+
var activeAxis = React25.useRef();
|
|
1670
|
+
var id = React25.useState(idCounter++)[0];
|
|
1671
|
+
var Style2 = React25.useState(styleSingleton)[0];
|
|
1672
|
+
var lastProps = React25.useRef(props);
|
|
1673
|
+
React25.useEffect(function() {
|
|
1674
|
+
lastProps.current = props;
|
|
1675
|
+
}, [props]);
|
|
1676
|
+
React25.useEffect(function() {
|
|
1677
|
+
if (props.inert) {
|
|
1678
|
+
document.body.classList.add("block-interactivity-".concat(id));
|
|
1679
|
+
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
1680
|
+
allow_1.forEach(function(el) {
|
|
1681
|
+
return el.classList.add("allow-interactivity-".concat(id));
|
|
1682
|
+
});
|
|
1683
|
+
return function() {
|
|
1684
|
+
document.body.classList.remove("block-interactivity-".concat(id));
|
|
1685
|
+
allow_1.forEach(function(el) {
|
|
1686
|
+
return el.classList.remove("allow-interactivity-".concat(id));
|
|
1687
|
+
});
|
|
1688
|
+
};
|
|
1689
|
+
}
|
|
1690
|
+
return;
|
|
1691
|
+
}, [props.inert, props.lockRef.current, props.shards]);
|
|
1692
|
+
var shouldCancelEvent = React25.useCallback(function(event, parent) {
|
|
1693
|
+
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
|
|
1694
|
+
return !lastProps.current.allowPinchZoom;
|
|
1695
|
+
}
|
|
1696
|
+
var touch = getTouchXY(event);
|
|
1697
|
+
var touchStart = touchStartRef.current;
|
|
1698
|
+
var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0];
|
|
1699
|
+
var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1];
|
|
1700
|
+
var currentAxis;
|
|
1701
|
+
var target = event.target;
|
|
1702
|
+
var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v";
|
|
1703
|
+
if ("touches" in event && moveDirection === "h" && target.type === "range") {
|
|
1704
|
+
return false;
|
|
1705
|
+
}
|
|
1706
|
+
var selection = window.getSelection();
|
|
1707
|
+
var anchorNode = selection && selection.anchorNode;
|
|
1708
|
+
var isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : false;
|
|
1709
|
+
if (isTouchingSelection) {
|
|
1710
|
+
return false;
|
|
1711
|
+
}
|
|
1712
|
+
var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
1713
|
+
if (!canBeScrolledInMainDirection) {
|
|
1714
|
+
return true;
|
|
1715
|
+
}
|
|
1716
|
+
if (canBeScrolledInMainDirection) {
|
|
1717
|
+
currentAxis = moveDirection;
|
|
1718
|
+
} else {
|
|
1719
|
+
currentAxis = moveDirection === "v" ? "h" : "v";
|
|
1720
|
+
canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
1721
|
+
}
|
|
1722
|
+
if (!canBeScrolledInMainDirection) {
|
|
1723
|
+
return false;
|
|
1724
|
+
}
|
|
1725
|
+
if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) {
|
|
1726
|
+
activeAxis.current = currentAxis;
|
|
1727
|
+
}
|
|
1728
|
+
if (!currentAxis) {
|
|
1729
|
+
return true;
|
|
1730
|
+
}
|
|
1731
|
+
var cancelingAxis = activeAxis.current || currentAxis;
|
|
1732
|
+
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
|
|
1733
|
+
}, []);
|
|
1734
|
+
var shouldPrevent = React25.useCallback(function(_event) {
|
|
1735
|
+
var event = _event;
|
|
1736
|
+
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
1737
|
+
return;
|
|
1738
|
+
}
|
|
1739
|
+
var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event);
|
|
1740
|
+
var sourceEvent = shouldPreventQueue.current.filter(function(e) {
|
|
1741
|
+
return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta);
|
|
1742
|
+
})[0];
|
|
1743
|
+
if (sourceEvent && sourceEvent.should) {
|
|
1744
|
+
if (event.cancelable) {
|
|
1745
|
+
event.preventDefault();
|
|
1746
|
+
}
|
|
1747
|
+
return;
|
|
1748
|
+
}
|
|
1749
|
+
if (!sourceEvent) {
|
|
1750
|
+
var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) {
|
|
1751
|
+
return node.contains(event.target);
|
|
1752
|
+
});
|
|
1753
|
+
var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
|
|
1754
|
+
if (shouldStop) {
|
|
1755
|
+
if (event.cancelable) {
|
|
1756
|
+
event.preventDefault();
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
}, []);
|
|
1761
|
+
var shouldCancel = React25.useCallback(function(name, delta, target, should) {
|
|
1762
|
+
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
1763
|
+
shouldPreventQueue.current.push(event);
|
|
1764
|
+
setTimeout(function() {
|
|
1765
|
+
shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
|
|
1766
|
+
return e !== event;
|
|
1767
|
+
});
|
|
1768
|
+
}, 1);
|
|
1769
|
+
}, []);
|
|
1770
|
+
var scrollTouchStart = React25.useCallback(function(event) {
|
|
1771
|
+
touchStartRef.current = getTouchXY(event);
|
|
1772
|
+
activeAxis.current = void 0;
|
|
1773
|
+
}, []);
|
|
1774
|
+
var scrollWheel = React25.useCallback(function(event) {
|
|
1775
|
+
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
1776
|
+
}, []);
|
|
1777
|
+
var scrollTouchMove = React25.useCallback(function(event) {
|
|
1778
|
+
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
1779
|
+
}, []);
|
|
1780
|
+
React25.useEffect(function() {
|
|
1781
|
+
lockStack.push(Style2);
|
|
1782
|
+
props.setCallbacks({
|
|
1783
|
+
onScrollCapture: scrollWheel,
|
|
1784
|
+
onWheelCapture: scrollWheel,
|
|
1785
|
+
onTouchMoveCapture: scrollTouchMove
|
|
1786
|
+
});
|
|
1787
|
+
document.addEventListener("wheel", shouldPrevent, nonPassive);
|
|
1788
|
+
document.addEventListener("touchmove", shouldPrevent, nonPassive);
|
|
1789
|
+
document.addEventListener("touchstart", scrollTouchStart, nonPassive);
|
|
1790
|
+
return function() {
|
|
1791
|
+
lockStack = lockStack.filter(function(inst) {
|
|
1792
|
+
return inst !== Style2;
|
|
1793
|
+
});
|
|
1794
|
+
document.removeEventListener("wheel", shouldPrevent, nonPassive);
|
|
1795
|
+
document.removeEventListener("touchmove", shouldPrevent, nonPassive);
|
|
1796
|
+
document.removeEventListener("touchstart", scrollTouchStart, nonPassive);
|
|
1797
|
+
};
|
|
1798
|
+
}, []);
|
|
1799
|
+
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
1800
|
+
return React25.createElement(
|
|
1801
|
+
React25.Fragment,
|
|
1802
|
+
null,
|
|
1803
|
+
inert ? React25.createElement(Style2, { styles: generateStyle(id) }) : null,
|
|
1804
|
+
removeScrollBar ? React25.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
|
|
1805
|
+
);
|
|
1806
|
+
}
|
|
1807
|
+
function getOutermostShadowParent(node) {
|
|
1808
|
+
var shadowParent = null;
|
|
1809
|
+
while (node !== null) {
|
|
1810
|
+
if (node instanceof ShadowRoot) {
|
|
1811
|
+
shadowParent = node.host;
|
|
1812
|
+
node = node.host;
|
|
1813
|
+
}
|
|
1814
|
+
node = node.parentNode;
|
|
1815
|
+
}
|
|
1816
|
+
return shadowParent;
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
// node_modules/react-remove-scroll/dist/es2015/sidecar.js
|
|
1820
|
+
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
1821
|
+
|
|
1822
|
+
// node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
1823
|
+
var ReactRemoveScroll = React26.forwardRef(function(props, ref) {
|
|
1824
|
+
return React26.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
|
|
1825
|
+
});
|
|
1826
|
+
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
1827
|
+
var Combination_default = ReactRemoveScroll;
|
|
1828
|
+
|
|
1829
|
+
// node_modules/aria-hidden/dist/es2015/index.js
|
|
1830
|
+
var getDefaultParent = function(originalTarget) {
|
|
1831
|
+
if (typeof document === "undefined") {
|
|
1832
|
+
return null;
|
|
1833
|
+
}
|
|
1834
|
+
var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
|
|
1835
|
+
return sampleTarget.ownerDocument.body;
|
|
1836
|
+
};
|
|
1837
|
+
var counterMap = /* @__PURE__ */ new WeakMap();
|
|
1838
|
+
var uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
1839
|
+
var markerMap = {};
|
|
1840
|
+
var lockCount = 0;
|
|
1841
|
+
var unwrapHost = function(node) {
|
|
1842
|
+
return node && (node.host || unwrapHost(node.parentNode));
|
|
1843
|
+
};
|
|
1844
|
+
var correctTargets = function(parent, targets) {
|
|
1845
|
+
return targets.map(function(target) {
|
|
1846
|
+
if (parent.contains(target)) {
|
|
1847
|
+
return target;
|
|
1848
|
+
}
|
|
1849
|
+
var correctedTarget = unwrapHost(target);
|
|
1850
|
+
if (correctedTarget && parent.contains(correctedTarget)) {
|
|
1851
|
+
return correctedTarget;
|
|
1852
|
+
}
|
|
1853
|
+
console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing");
|
|
1854
|
+
return null;
|
|
1855
|
+
}).filter(function(x) {
|
|
1856
|
+
return Boolean(x);
|
|
1857
|
+
});
|
|
1858
|
+
};
|
|
1859
|
+
var applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) {
|
|
1860
|
+
var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
1861
|
+
if (!markerMap[markerName]) {
|
|
1862
|
+
markerMap[markerName] = /* @__PURE__ */ new WeakMap();
|
|
1863
|
+
}
|
|
1864
|
+
var markerCounter = markerMap[markerName];
|
|
1865
|
+
var hiddenNodes = [];
|
|
1866
|
+
var elementsToKeep = /* @__PURE__ */ new Set();
|
|
1867
|
+
var elementsToStop = new Set(targets);
|
|
1868
|
+
var keep = function(el) {
|
|
1869
|
+
if (!el || elementsToKeep.has(el)) {
|
|
1870
|
+
return;
|
|
1871
|
+
}
|
|
1872
|
+
elementsToKeep.add(el);
|
|
1873
|
+
keep(el.parentNode);
|
|
1874
|
+
};
|
|
1875
|
+
targets.forEach(keep);
|
|
1876
|
+
var deep = function(parent) {
|
|
1877
|
+
if (!parent || elementsToStop.has(parent)) {
|
|
1878
|
+
return;
|
|
1879
|
+
}
|
|
1880
|
+
Array.prototype.forEach.call(parent.children, function(node) {
|
|
1881
|
+
if (elementsToKeep.has(node)) {
|
|
1882
|
+
deep(node);
|
|
1883
|
+
} else {
|
|
1884
|
+
try {
|
|
1885
|
+
var attr = node.getAttribute(controlAttribute);
|
|
1886
|
+
var alreadyHidden = attr !== null && attr !== "false";
|
|
1887
|
+
var counterValue = (counterMap.get(node) || 0) + 1;
|
|
1888
|
+
var markerValue = (markerCounter.get(node) || 0) + 1;
|
|
1889
|
+
counterMap.set(node, counterValue);
|
|
1890
|
+
markerCounter.set(node, markerValue);
|
|
1891
|
+
hiddenNodes.push(node);
|
|
1892
|
+
if (counterValue === 1 && alreadyHidden) {
|
|
1893
|
+
uncontrolledNodes.set(node, true);
|
|
1894
|
+
}
|
|
1895
|
+
if (markerValue === 1) {
|
|
1896
|
+
node.setAttribute(markerName, "true");
|
|
1897
|
+
}
|
|
1898
|
+
if (!alreadyHidden) {
|
|
1899
|
+
node.setAttribute(controlAttribute, "true");
|
|
1900
|
+
}
|
|
1901
|
+
} catch (e) {
|
|
1902
|
+
console.error("aria-hidden: cannot operate on ", node, e);
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
});
|
|
1906
|
+
};
|
|
1907
|
+
deep(parentNode);
|
|
1908
|
+
elementsToKeep.clear();
|
|
1909
|
+
lockCount++;
|
|
1910
|
+
return function() {
|
|
1911
|
+
hiddenNodes.forEach(function(node) {
|
|
1912
|
+
var counterValue = counterMap.get(node) - 1;
|
|
1913
|
+
var markerValue = markerCounter.get(node) - 1;
|
|
1914
|
+
counterMap.set(node, counterValue);
|
|
1915
|
+
markerCounter.set(node, markerValue);
|
|
1916
|
+
if (!counterValue) {
|
|
1917
|
+
if (!uncontrolledNodes.has(node)) {
|
|
1918
|
+
node.removeAttribute(controlAttribute);
|
|
1919
|
+
}
|
|
1920
|
+
uncontrolledNodes.delete(node);
|
|
1921
|
+
}
|
|
1922
|
+
if (!markerValue) {
|
|
1923
|
+
node.removeAttribute(markerName);
|
|
1924
|
+
}
|
|
1925
|
+
});
|
|
1926
|
+
lockCount--;
|
|
1927
|
+
if (!lockCount) {
|
|
1928
|
+
counterMap = /* @__PURE__ */ new WeakMap();
|
|
1929
|
+
counterMap = /* @__PURE__ */ new WeakMap();
|
|
1930
|
+
uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
1931
|
+
markerMap = {};
|
|
1932
|
+
}
|
|
1933
|
+
};
|
|
1934
|
+
};
|
|
1935
|
+
var hideOthers = function(originalTarget, parentNode, markerName) {
|
|
1936
|
+
if (markerName === void 0) {
|
|
1937
|
+
markerName = "data-aria-hidden";
|
|
1938
|
+
}
|
|
1939
|
+
var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
1940
|
+
var activeParentNode = parentNode || getDefaultParent(originalTarget);
|
|
1941
|
+
if (!activeParentNode) {
|
|
1942
|
+
return function() {
|
|
1943
|
+
return null;
|
|
1944
|
+
};
|
|
1945
|
+
}
|
|
1946
|
+
targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script")));
|
|
1947
|
+
return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
|
|
1948
|
+
};
|
|
1949
|
+
|
|
1950
|
+
// node_modules/@radix-ui/react-dialog/dist/index.mjs
|
|
1951
|
+
import { Fragment as Fragment5, jsx as jsx11, jsxs } from "react/jsx-runtime";
|
|
1952
|
+
var DIALOG_NAME = "Dialog";
|
|
1953
|
+
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
1954
|
+
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
|
1955
|
+
var Dialog = (props) => {
|
|
1956
|
+
const {
|
|
1957
|
+
__scopeDialog,
|
|
1958
|
+
children,
|
|
1959
|
+
open: openProp,
|
|
1960
|
+
defaultOpen,
|
|
1961
|
+
onOpenChange,
|
|
1962
|
+
modal = true
|
|
1963
|
+
} = props;
|
|
1964
|
+
const triggerRef = React27.useRef(null);
|
|
1965
|
+
const contentRef = React27.useRef(null);
|
|
1966
|
+
const [open, setOpen] = useControllableState({
|
|
1967
|
+
prop: openProp,
|
|
1968
|
+
defaultProp: defaultOpen ?? false,
|
|
1969
|
+
onChange: onOpenChange,
|
|
1970
|
+
caller: DIALOG_NAME
|
|
1971
|
+
});
|
|
1972
|
+
return /* @__PURE__ */ jsx11(
|
|
1973
|
+
DialogProvider,
|
|
1974
|
+
{
|
|
1975
|
+
scope: __scopeDialog,
|
|
1976
|
+
triggerRef,
|
|
1977
|
+
contentRef,
|
|
1978
|
+
contentId: useId(),
|
|
1979
|
+
titleId: useId(),
|
|
1980
|
+
descriptionId: useId(),
|
|
1981
|
+
open,
|
|
1982
|
+
onOpenChange: setOpen,
|
|
1983
|
+
onOpenToggle: React27.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
1984
|
+
modal,
|
|
1985
|
+
children
|
|
1986
|
+
}
|
|
1987
|
+
);
|
|
1988
|
+
};
|
|
1989
|
+
Dialog.displayName = DIALOG_NAME;
|
|
1990
|
+
var TRIGGER_NAME = "DialogTrigger";
|
|
1991
|
+
var DialogTrigger = React27.forwardRef(
|
|
1992
|
+
(props, forwardedRef) => {
|
|
1993
|
+
const { __scopeDialog, ...triggerProps } = props;
|
|
1994
|
+
const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
|
|
1995
|
+
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
1996
|
+
return /* @__PURE__ */ jsx11(
|
|
1997
|
+
Primitive.button,
|
|
1998
|
+
{
|
|
1999
|
+
type: "button",
|
|
2000
|
+
"aria-haspopup": "dialog",
|
|
2001
|
+
"aria-expanded": context.open,
|
|
2002
|
+
"aria-controls": context.contentId,
|
|
2003
|
+
"data-state": getState(context.open),
|
|
2004
|
+
...triggerProps,
|
|
2005
|
+
ref: composedTriggerRef,
|
|
2006
|
+
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
2007
|
+
}
|
|
2008
|
+
);
|
|
2009
|
+
}
|
|
2010
|
+
);
|
|
2011
|
+
DialogTrigger.displayName = TRIGGER_NAME;
|
|
2012
|
+
var PORTAL_NAME2 = "DialogPortal";
|
|
2013
|
+
var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME2, {
|
|
2014
|
+
forceMount: void 0
|
|
2015
|
+
});
|
|
2016
|
+
var DialogPortal = (props) => {
|
|
2017
|
+
const { __scopeDialog, forceMount, children, container } = props;
|
|
2018
|
+
const context = useDialogContext(PORTAL_NAME2, __scopeDialog);
|
|
2019
|
+
return /* @__PURE__ */ jsx11(PortalProvider, { scope: __scopeDialog, forceMount, children: React27.Children.map(children, (child) => /* @__PURE__ */ jsx11(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx11(Portal, { asChild: true, container, children: child }) })) });
|
|
2020
|
+
};
|
|
2021
|
+
DialogPortal.displayName = PORTAL_NAME2;
|
|
2022
|
+
var OVERLAY_NAME = "DialogOverlay";
|
|
2023
|
+
var DialogOverlay = React27.forwardRef(
|
|
2024
|
+
(props, forwardedRef) => {
|
|
2025
|
+
const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
|
|
2026
|
+
const { forceMount = portalContext.forceMount, ...overlayProps } = props;
|
|
2027
|
+
const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
|
|
2028
|
+
return context.modal ? /* @__PURE__ */ jsx11(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx11(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
|
|
2029
|
+
}
|
|
2030
|
+
);
|
|
2031
|
+
DialogOverlay.displayName = OVERLAY_NAME;
|
|
2032
|
+
var Slot = createSlot("DialogOverlay.RemoveScroll");
|
|
2033
|
+
var DialogOverlayImpl = React27.forwardRef(
|
|
2034
|
+
(props, forwardedRef) => {
|
|
2035
|
+
const { __scopeDialog, ...overlayProps } = props;
|
|
2036
|
+
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
2037
|
+
return (
|
|
2038
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
2039
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
2040
|
+
/* @__PURE__ */ jsx11(Combination_default, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx11(
|
|
2041
|
+
Primitive.div,
|
|
2042
|
+
{
|
|
2043
|
+
"data-state": getState(context.open),
|
|
2044
|
+
...overlayProps,
|
|
2045
|
+
ref: forwardedRef,
|
|
2046
|
+
style: { pointerEvents: "auto", ...overlayProps.style }
|
|
2047
|
+
}
|
|
2048
|
+
) })
|
|
2049
|
+
);
|
|
2050
|
+
}
|
|
2051
|
+
);
|
|
2052
|
+
var CONTENT_NAME = "DialogContent";
|
|
2053
|
+
var DialogContent = React27.forwardRef(
|
|
2054
|
+
(props, forwardedRef) => {
|
|
2055
|
+
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
|
|
2056
|
+
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
2057
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
2058
|
+
return /* @__PURE__ */ jsx11(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx11(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx11(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
|
2059
|
+
}
|
|
2060
|
+
);
|
|
2061
|
+
DialogContent.displayName = CONTENT_NAME;
|
|
2062
|
+
var DialogContentModal = React27.forwardRef(
|
|
2063
|
+
(props, forwardedRef) => {
|
|
2064
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
2065
|
+
const contentRef = React27.useRef(null);
|
|
2066
|
+
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
|
2067
|
+
React27.useEffect(() => {
|
|
2068
|
+
const content = contentRef.current;
|
|
2069
|
+
if (content) return hideOthers(content);
|
|
2070
|
+
}, []);
|
|
2071
|
+
return /* @__PURE__ */ jsx11(
|
|
2072
|
+
DialogContentImpl,
|
|
2073
|
+
{
|
|
2074
|
+
...props,
|
|
2075
|
+
ref: composedRefs,
|
|
2076
|
+
trapFocus: context.open,
|
|
2077
|
+
disableOutsidePointerEvents: true,
|
|
2078
|
+
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
2079
|
+
event.preventDefault();
|
|
2080
|
+
context.triggerRef.current?.focus();
|
|
2081
|
+
}),
|
|
2082
|
+
onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
|
|
2083
|
+
const originalEvent = event.detail.originalEvent;
|
|
2084
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
2085
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
2086
|
+
if (isRightClick) event.preventDefault();
|
|
2087
|
+
}),
|
|
2088
|
+
onFocusOutside: composeEventHandlers(
|
|
2089
|
+
props.onFocusOutside,
|
|
2090
|
+
(event) => event.preventDefault()
|
|
2091
|
+
)
|
|
2092
|
+
}
|
|
2093
|
+
);
|
|
2094
|
+
}
|
|
2095
|
+
);
|
|
2096
|
+
var DialogContentNonModal = React27.forwardRef(
|
|
2097
|
+
(props, forwardedRef) => {
|
|
2098
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
2099
|
+
const hasInteractedOutsideRef = React27.useRef(false);
|
|
2100
|
+
const hasPointerDownOutsideRef = React27.useRef(false);
|
|
2101
|
+
return /* @__PURE__ */ jsx11(
|
|
2102
|
+
DialogContentImpl,
|
|
2103
|
+
{
|
|
2104
|
+
...props,
|
|
2105
|
+
ref: forwardedRef,
|
|
2106
|
+
trapFocus: false,
|
|
2107
|
+
disableOutsidePointerEvents: false,
|
|
2108
|
+
onCloseAutoFocus: (event) => {
|
|
2109
|
+
props.onCloseAutoFocus?.(event);
|
|
2110
|
+
if (!event.defaultPrevented) {
|
|
2111
|
+
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
2112
|
+
event.preventDefault();
|
|
2113
|
+
}
|
|
2114
|
+
hasInteractedOutsideRef.current = false;
|
|
2115
|
+
hasPointerDownOutsideRef.current = false;
|
|
2116
|
+
},
|
|
2117
|
+
onInteractOutside: (event) => {
|
|
2118
|
+
props.onInteractOutside?.(event);
|
|
2119
|
+
if (!event.defaultPrevented) {
|
|
2120
|
+
hasInteractedOutsideRef.current = true;
|
|
2121
|
+
if (event.detail.originalEvent.type === "pointerdown") {
|
|
2122
|
+
hasPointerDownOutsideRef.current = true;
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
const target = event.target;
|
|
2126
|
+
const targetIsTrigger = context.triggerRef.current?.contains(target);
|
|
2127
|
+
if (targetIsTrigger) event.preventDefault();
|
|
2128
|
+
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
|
2129
|
+
event.preventDefault();
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
);
|
|
2134
|
+
}
|
|
2135
|
+
);
|
|
2136
|
+
var DialogContentImpl = React27.forwardRef(
|
|
2137
|
+
(props, forwardedRef) => {
|
|
2138
|
+
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
|
2139
|
+
const context = useDialogContext(CONTENT_NAME, __scopeDialog);
|
|
2140
|
+
const contentRef = React27.useRef(null);
|
|
2141
|
+
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
2142
|
+
useFocusGuards();
|
|
2143
|
+
return /* @__PURE__ */ jsxs(Fragment5, { children: [
|
|
2144
|
+
/* @__PURE__ */ jsx11(
|
|
2145
|
+
FocusScope,
|
|
2146
|
+
{
|
|
2147
|
+
asChild: true,
|
|
2148
|
+
loop: true,
|
|
2149
|
+
trapped: trapFocus,
|
|
2150
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
2151
|
+
onUnmountAutoFocus: onCloseAutoFocus,
|
|
2152
|
+
children: /* @__PURE__ */ jsx11(
|
|
2153
|
+
DismissableLayer,
|
|
2154
|
+
{
|
|
2155
|
+
role: "dialog",
|
|
2156
|
+
id: context.contentId,
|
|
2157
|
+
"aria-describedby": context.descriptionId,
|
|
2158
|
+
"aria-labelledby": context.titleId,
|
|
2159
|
+
"data-state": getState(context.open),
|
|
2160
|
+
...contentProps,
|
|
2161
|
+
ref: composedRefs,
|
|
2162
|
+
onDismiss: () => context.onOpenChange(false)
|
|
2163
|
+
}
|
|
2164
|
+
)
|
|
2165
|
+
}
|
|
2166
|
+
),
|
|
2167
|
+
/* @__PURE__ */ jsxs(Fragment5, { children: [
|
|
2168
|
+
/* @__PURE__ */ jsx11(TitleWarning, { titleId: context.titleId }),
|
|
2169
|
+
/* @__PURE__ */ jsx11(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
|
|
2170
|
+
] })
|
|
2171
|
+
] });
|
|
2172
|
+
}
|
|
2173
|
+
);
|
|
2174
|
+
var TITLE_NAME = "DialogTitle";
|
|
2175
|
+
var DialogTitle = React27.forwardRef(
|
|
2176
|
+
(props, forwardedRef) => {
|
|
2177
|
+
const { __scopeDialog, ...titleProps } = props;
|
|
2178
|
+
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
2179
|
+
return /* @__PURE__ */ jsx11(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
|
|
2180
|
+
}
|
|
2181
|
+
);
|
|
2182
|
+
DialogTitle.displayName = TITLE_NAME;
|
|
2183
|
+
var DESCRIPTION_NAME = "DialogDescription";
|
|
2184
|
+
var DialogDescription = React27.forwardRef(
|
|
2185
|
+
(props, forwardedRef) => {
|
|
2186
|
+
const { __scopeDialog, ...descriptionProps } = props;
|
|
2187
|
+
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
2188
|
+
return /* @__PURE__ */ jsx11(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
|
|
2189
|
+
}
|
|
2190
|
+
);
|
|
2191
|
+
DialogDescription.displayName = DESCRIPTION_NAME;
|
|
2192
|
+
var CLOSE_NAME = "DialogClose";
|
|
2193
|
+
var DialogClose = React27.forwardRef(
|
|
2194
|
+
(props, forwardedRef) => {
|
|
2195
|
+
const { __scopeDialog, ...closeProps } = props;
|
|
2196
|
+
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
|
2197
|
+
return /* @__PURE__ */ jsx11(
|
|
2198
|
+
Primitive.button,
|
|
2199
|
+
{
|
|
2200
|
+
type: "button",
|
|
2201
|
+
...closeProps,
|
|
2202
|
+
ref: forwardedRef,
|
|
2203
|
+
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
|
2204
|
+
}
|
|
2205
|
+
);
|
|
2206
|
+
}
|
|
2207
|
+
);
|
|
2208
|
+
DialogClose.displayName = CLOSE_NAME;
|
|
2209
|
+
function getState(open) {
|
|
2210
|
+
return open ? "open" : "closed";
|
|
2211
|
+
}
|
|
2212
|
+
var TITLE_WARNING_NAME = "DialogTitleWarning";
|
|
2213
|
+
var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
|
|
2214
|
+
contentName: CONTENT_NAME,
|
|
2215
|
+
titleName: TITLE_NAME,
|
|
2216
|
+
docsSlug: "dialog"
|
|
2217
|
+
});
|
|
2218
|
+
var TitleWarning = ({ titleId }) => {
|
|
2219
|
+
const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
|
|
2220
|
+
const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
|
|
2221
|
+
|
|
2222
|
+
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
2223
|
+
|
|
2224
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
|
|
2225
|
+
React27.useEffect(() => {
|
|
2226
|
+
if (titleId) {
|
|
2227
|
+
const hasTitle = document.getElementById(titleId);
|
|
2228
|
+
if (!hasTitle) console.error(MESSAGE);
|
|
2229
|
+
}
|
|
2230
|
+
}, [MESSAGE, titleId]);
|
|
2231
|
+
return null;
|
|
2232
|
+
};
|
|
2233
|
+
var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
|
|
2234
|
+
var DescriptionWarning = ({ contentRef, descriptionId }) => {
|
|
2235
|
+
const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
|
|
2236
|
+
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
|
|
2237
|
+
React27.useEffect(() => {
|
|
2238
|
+
const describedById = contentRef.current?.getAttribute("aria-describedby");
|
|
2239
|
+
if (descriptionId && describedById) {
|
|
2240
|
+
const hasDescription = document.getElementById(descriptionId);
|
|
2241
|
+
if (!hasDescription) console.warn(MESSAGE);
|
|
2242
|
+
}
|
|
2243
|
+
}, [MESSAGE, contentRef, descriptionId]);
|
|
2244
|
+
return null;
|
|
2245
|
+
};
|
|
2246
|
+
var Root = Dialog;
|
|
2247
|
+
var Trigger = DialogTrigger;
|
|
2248
|
+
var Portal2 = DialogPortal;
|
|
2249
|
+
var Overlay = DialogOverlay;
|
|
2250
|
+
var Content = DialogContent;
|
|
2251
|
+
var Title = DialogTitle;
|
|
2252
|
+
var Description = DialogDescription;
|
|
2253
|
+
var Close = DialogClose;
|
|
2254
|
+
|
|
2255
|
+
// src/components/ui/dialog.tsx
|
|
2256
|
+
import { X } from "lucide-react";
|
|
2257
|
+
import { jsx as jsx12, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
2258
|
+
var Dialog2 = Root;
|
|
2259
|
+
var DialogTrigger2 = Trigger;
|
|
2260
|
+
var DialogPortal2 = Portal2;
|
|
2261
|
+
var DialogOverlay2 = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
2262
|
+
Overlay,
|
|
2263
|
+
{
|
|
2264
|
+
ref,
|
|
2265
|
+
className: cn(
|
|
2266
|
+
"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0",
|
|
2267
|
+
className
|
|
2268
|
+
),
|
|
2269
|
+
...props
|
|
2270
|
+
}
|
|
2271
|
+
));
|
|
2272
|
+
DialogOverlay2.displayName = Overlay.displayName;
|
|
2273
|
+
var DialogContent2 = React28.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs2(DialogPortal2, { children: [
|
|
2274
|
+
/* @__PURE__ */ jsx12(DialogOverlay2, {}),
|
|
2275
|
+
/* @__PURE__ */ jsxs2(
|
|
2276
|
+
Content,
|
|
2277
|
+
{
|
|
2278
|
+
ref,
|
|
2279
|
+
className: cn(
|
|
2280
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-6 rounded-xl border border-border bg-popover p-6 shadow-xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95",
|
|
2281
|
+
className
|
|
2282
|
+
),
|
|
2283
|
+
...props,
|
|
2284
|
+
children: [
|
|
2285
|
+
children,
|
|
2286
|
+
/* @__PURE__ */ jsxs2(Close, { className: "absolute right-3 top-3 rounded-full p-2 text-muted-foreground transition hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: [
|
|
2287
|
+
/* @__PURE__ */ jsx12(X, { className: "h-4 w-4" }),
|
|
2288
|
+
/* @__PURE__ */ jsx12("span", { className: "sr-only", children: "Close" })
|
|
2289
|
+
] })
|
|
2290
|
+
]
|
|
2291
|
+
}
|
|
2292
|
+
)
|
|
2293
|
+
] }));
|
|
2294
|
+
DialogContent2.displayName = Content.displayName;
|
|
2295
|
+
var DialogHeader = ({
|
|
2296
|
+
className,
|
|
2297
|
+
...props
|
|
2298
|
+
}) => /* @__PURE__ */ jsx12(
|
|
2299
|
+
"div",
|
|
2300
|
+
{
|
|
2301
|
+
className: cn(
|
|
2302
|
+
"flex flex-col space-y-1.5 text-left",
|
|
2303
|
+
className
|
|
2304
|
+
),
|
|
2305
|
+
...props
|
|
2306
|
+
}
|
|
2307
|
+
);
|
|
2308
|
+
DialogHeader.displayName = "DialogHeader";
|
|
2309
|
+
var DialogTitle2 = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
2310
|
+
Title,
|
|
2311
|
+
{
|
|
2312
|
+
ref,
|
|
2313
|
+
className: cn("text-lg font-semibold leading-none tracking-tight", className),
|
|
2314
|
+
...props
|
|
2315
|
+
}
|
|
2316
|
+
));
|
|
2317
|
+
DialogTitle2.displayName = Title.displayName;
|
|
2318
|
+
var DialogDescription2 = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
2319
|
+
Description,
|
|
2320
|
+
{
|
|
2321
|
+
ref,
|
|
2322
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
2323
|
+
...props
|
|
2324
|
+
}
|
|
2325
|
+
));
|
|
2326
|
+
DialogDescription2.displayName = Description.displayName;
|
|
2327
|
+
|
|
2328
|
+
// src/components/ui/command.tsx
|
|
2329
|
+
import { jsx as jsx13, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2330
|
+
var Command = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
2331
|
+
CommandPrimitive,
|
|
2332
|
+
{
|
|
2333
|
+
ref,
|
|
2334
|
+
className: cn(
|
|
2335
|
+
"flex h-full w-full flex-col rounded-lg bg-popover text-foreground shadow-lg",
|
|
2336
|
+
className
|
|
2337
|
+
),
|
|
2338
|
+
...props
|
|
2339
|
+
}
|
|
2340
|
+
));
|
|
2341
|
+
Command.displayName = CommandPrimitive.displayName;
|
|
2342
|
+
var CommandDialog = ({ children, ...props }) => /* @__PURE__ */ jsx13(Dialog2, { ...props, children: /* @__PURE__ */ jsx13(DialogContent2, { className: "overflow-hidden border border-border/60 bg-popover/95 p-0 shadow-2xl sm:max-w-3xl", children: /* @__PURE__ */ jsx13(Command, { className: "min-h-[520px] bg-transparent [&_[cmdk-input-wrapper]]:px-4", children }) }) });
|
|
2343
|
+
var CommandInput = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs3("div", { className: "flex items-center border-b border-border px-3", "cmdk-input-wrapper": "", children: [
|
|
2344
|
+
/* @__PURE__ */ jsx13(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
2345
|
+
/* @__PURE__ */ jsx13(
|
|
2346
|
+
CommandPrimitive.Input,
|
|
2347
|
+
{
|
|
2348
|
+
ref,
|
|
2349
|
+
className: cn(
|
|
2350
|
+
"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground",
|
|
2351
|
+
className
|
|
2352
|
+
),
|
|
2353
|
+
...props
|
|
2354
|
+
}
|
|
2355
|
+
)
|
|
2356
|
+
] }));
|
|
2357
|
+
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
2358
|
+
var CommandList = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
2359
|
+
CommandPrimitive.List,
|
|
2360
|
+
{
|
|
2361
|
+
ref,
|
|
2362
|
+
className: cn("max-h-[520px] overflow-y-auto", className),
|
|
2363
|
+
...props
|
|
2364
|
+
}
|
|
2365
|
+
));
|
|
2366
|
+
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
2367
|
+
var CommandEmpty = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
2368
|
+
CommandPrimitive.Empty,
|
|
2369
|
+
{
|
|
2370
|
+
ref,
|
|
2371
|
+
className: cn("py-6 text-center text-sm text-muted-foreground", className),
|
|
2372
|
+
...props
|
|
2373
|
+
}
|
|
2374
|
+
));
|
|
2375
|
+
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
2376
|
+
var CommandGroup = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
2377
|
+
CommandPrimitive.Group,
|
|
2378
|
+
{
|
|
2379
|
+
ref,
|
|
2380
|
+
className: cn(
|
|
2381
|
+
"px-3 py-4 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
2382
|
+
className
|
|
2383
|
+
),
|
|
2384
|
+
...props
|
|
2385
|
+
}
|
|
2386
|
+
));
|
|
2387
|
+
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
2388
|
+
var CommandItem = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
2389
|
+
CommandPrimitive.Item,
|
|
2390
|
+
{
|
|
2391
|
+
ref,
|
|
2392
|
+
className: cn(
|
|
2393
|
+
"flex cursor-pointer select-none items-center rounded-md px-2 py-2 text-sm transition hover:bg-secondary hover:text-secondary-foreground aria-selected:bg-secondary",
|
|
2394
|
+
className
|
|
2395
|
+
),
|
|
2396
|
+
...props
|
|
2397
|
+
}
|
|
2398
|
+
));
|
|
2399
|
+
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
2400
|
+
var CommandSeparator = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
2401
|
+
CommandPrimitive.Separator,
|
|
2402
|
+
{
|
|
2403
|
+
ref,
|
|
2404
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
2405
|
+
...props
|
|
2406
|
+
}
|
|
2407
|
+
));
|
|
2408
|
+
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
2409
|
+
var CommandShortcut = ({
|
|
2410
|
+
className,
|
|
2411
|
+
...props
|
|
2412
|
+
}) => /* @__PURE__ */ jsx13(
|
|
2413
|
+
"span",
|
|
2414
|
+
{
|
|
2415
|
+
className: cn("ml-auto text-xs tracking-wide text-muted-foreground", className),
|
|
2416
|
+
...props
|
|
2417
|
+
}
|
|
2418
|
+
);
|
|
2419
|
+
CommandShortcut.displayName = "CommandShortcut";
|
|
2420
|
+
|
|
2421
|
+
// src/components/ui/dropdown-menu.tsx
|
|
2422
|
+
import * as React30 from "react";
|
|
2423
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
2424
|
+
import { Check, ChevronRight, Circle } from "lucide-react";
|
|
2425
|
+
import { jsx as jsx14, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2426
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
2427
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
2428
|
+
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
2429
|
+
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
2430
|
+
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
2431
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
2432
|
+
var DropdownMenuSubTrigger = React30.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs4(
|
|
2433
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
2434
|
+
{
|
|
2435
|
+
ref,
|
|
2436
|
+
className: cn(
|
|
2437
|
+
"flex cursor-pointer select-none items-center rounded-md px-2 py-1.5 text-sm outline-none focus:bg-secondary",
|
|
2438
|
+
inset && "pl-8",
|
|
2439
|
+
className
|
|
2440
|
+
),
|
|
2441
|
+
...props,
|
|
2442
|
+
children: [
|
|
2443
|
+
children,
|
|
2444
|
+
/* @__PURE__ */ jsx14(ChevronRight, { className: "ml-auto h-4 w-4" })
|
|
2445
|
+
]
|
|
2446
|
+
}
|
|
2447
|
+
));
|
|
2448
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
2449
|
+
var DropdownMenuSubContent = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
2450
|
+
DropdownMenuPrimitive.SubContent,
|
|
2451
|
+
{
|
|
2452
|
+
ref,
|
|
2453
|
+
className: cn(
|
|
2454
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
2455
|
+
className
|
|
2456
|
+
),
|
|
2457
|
+
...props
|
|
2458
|
+
}
|
|
2459
|
+
));
|
|
2460
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
2461
|
+
var DropdownMenuContent = React30.forwardRef(({ className, sideOffset = 6, ...props }, ref) => /* @__PURE__ */ jsx14(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx14(
|
|
2462
|
+
DropdownMenuPrimitive.Content,
|
|
2463
|
+
{
|
|
2464
|
+
ref,
|
|
2465
|
+
sideOffset,
|
|
2466
|
+
className: cn(
|
|
2467
|
+
"z-50 min-w-[10rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
2468
|
+
className
|
|
2469
|
+
),
|
|
2470
|
+
...props
|
|
2471
|
+
}
|
|
2472
|
+
) }));
|
|
2473
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
2474
|
+
var DropdownMenuItem = React30.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
2475
|
+
DropdownMenuPrimitive.Item,
|
|
2476
|
+
{
|
|
2477
|
+
ref,
|
|
2478
|
+
className: cn(
|
|
2479
|
+
"relative flex cursor-pointer select-none items-center rounded-md px-2 py-1.5 text-sm outline-none transition focus:bg-secondary focus:text-secondary-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2480
|
+
inset && "pl-8",
|
|
2481
|
+
className
|
|
2482
|
+
),
|
|
2483
|
+
...props
|
|
2484
|
+
}
|
|
2485
|
+
));
|
|
2486
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
2487
|
+
var DropdownMenuCheckboxItem = React30.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs4(
|
|
2488
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
2489
|
+
{
|
|
2490
|
+
ref,
|
|
2491
|
+
className: cn(
|
|
2492
|
+
"relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm outline-none transition focus:bg-secondary focus:text-secondary-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2493
|
+
className
|
|
2494
|
+
),
|
|
2495
|
+
checked,
|
|
2496
|
+
...props,
|
|
2497
|
+
children: [
|
|
2498
|
+
/* @__PURE__ */ jsx14("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx14(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx14(Check, { className: "h-4 w-4" }) }) }),
|
|
2499
|
+
children
|
|
2500
|
+
]
|
|
2501
|
+
}
|
|
2502
|
+
));
|
|
2503
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
2504
|
+
var DropdownMenuRadioItem = React30.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs4(
|
|
2505
|
+
DropdownMenuPrimitive.RadioItem,
|
|
2506
|
+
{
|
|
2507
|
+
ref,
|
|
2508
|
+
className: cn(
|
|
2509
|
+
"relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm outline-none transition focus:bg-secondary focus:text-secondary-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2510
|
+
className
|
|
2511
|
+
),
|
|
2512
|
+
...props,
|
|
2513
|
+
children: [
|
|
2514
|
+
/* @__PURE__ */ jsx14("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx14(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx14(Circle, { className: "h-2 w-2 fill-current" }) }) }),
|
|
2515
|
+
children
|
|
2516
|
+
]
|
|
2517
|
+
}
|
|
2518
|
+
));
|
|
2519
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
2520
|
+
var DropdownMenuLabel = React30.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
2521
|
+
DropdownMenuPrimitive.Label,
|
|
2522
|
+
{
|
|
2523
|
+
ref,
|
|
2524
|
+
className: cn(
|
|
2525
|
+
"px-2 py-1.5 text-sm font-semibold text-muted-foreground",
|
|
2526
|
+
inset && "pl-8",
|
|
2527
|
+
className
|
|
2528
|
+
),
|
|
2529
|
+
...props
|
|
2530
|
+
}
|
|
2531
|
+
));
|
|
2532
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
2533
|
+
var DropdownMenuSeparator = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
2534
|
+
DropdownMenuPrimitive.Separator,
|
|
2535
|
+
{
|
|
2536
|
+
ref,
|
|
2537
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
2538
|
+
...props
|
|
2539
|
+
}
|
|
2540
|
+
));
|
|
2541
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
2542
|
+
var DropdownMenuShortcut = ({
|
|
2543
|
+
className,
|
|
2544
|
+
...props
|
|
2545
|
+
}) => {
|
|
2546
|
+
return /* @__PURE__ */ jsx14(
|
|
2547
|
+
"span",
|
|
2548
|
+
{
|
|
2549
|
+
className: cn("ml-auto text-xs tracking-wide text-muted-foreground", className),
|
|
2550
|
+
...props
|
|
2551
|
+
}
|
|
2552
|
+
);
|
|
2553
|
+
};
|
|
2554
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
2555
|
+
|
|
2556
|
+
// src/components/ui/input.tsx
|
|
2557
|
+
import * as React31 from "react";
|
|
2558
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2559
|
+
var Input = React31.forwardRef(
|
|
2560
|
+
({ className, type, ...props }, ref) => {
|
|
2561
|
+
return /* @__PURE__ */ jsx15(
|
|
2562
|
+
"input",
|
|
2563
|
+
{
|
|
2564
|
+
type,
|
|
2565
|
+
className: cn(
|
|
2566
|
+
"flex h-10 w-full rounded-lg border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
2567
|
+
className
|
|
2568
|
+
),
|
|
2569
|
+
ref,
|
|
2570
|
+
...props
|
|
2571
|
+
}
|
|
2572
|
+
);
|
|
2573
|
+
}
|
|
2574
|
+
);
|
|
2575
|
+
Input.displayName = "Input";
|
|
2576
|
+
|
|
2577
|
+
// src/components/ui/select.tsx
|
|
2578
|
+
import * as React32 from "react";
|
|
2579
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
2580
|
+
import { Check as Check2, ChevronDown, ChevronUp } from "lucide-react";
|
|
2581
|
+
import { jsx as jsx16, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2582
|
+
var Select = SelectPrimitive.Root;
|
|
2583
|
+
var SelectGroup = SelectPrimitive.Group;
|
|
2584
|
+
var SelectValue = SelectPrimitive.Value;
|
|
2585
|
+
var SelectTrigger = React32.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs5(
|
|
2586
|
+
SelectPrimitive.Trigger,
|
|
2587
|
+
{
|
|
2588
|
+
ref,
|
|
2589
|
+
className: cn(
|
|
2590
|
+
"inline-flex h-10 w-full items-center justify-between gap-2 rounded-lg border border-input bg-black/10 px-3 text-sm font-medium shadow-sm transition focus:outline-none focus:ring-2 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
2591
|
+
className
|
|
2592
|
+
),
|
|
2593
|
+
...props,
|
|
2594
|
+
children: [
|
|
2595
|
+
children,
|
|
2596
|
+
/* @__PURE__ */ jsx16(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx16(ChevronDown, { className: "h-4 w-4 opacity-70" }) })
|
|
2597
|
+
]
|
|
2598
|
+
}
|
|
2599
|
+
));
|
|
2600
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
2601
|
+
var SelectContent = React32.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx16(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs5(
|
|
2602
|
+
SelectPrimitive.Content,
|
|
2603
|
+
{
|
|
2604
|
+
ref,
|
|
2605
|
+
className: cn(
|
|
2606
|
+
"relative z-50 min-w-[10rem] overflow-hidden rounded-lg border border-border bg-popover text-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
2607
|
+
position === "popper" && "translate-y-1",
|
|
2608
|
+
className
|
|
2609
|
+
),
|
|
2610
|
+
position,
|
|
2611
|
+
...props,
|
|
2612
|
+
children: [
|
|
2613
|
+
/* @__PURE__ */ jsx16(SelectPrimitive.ScrollUpButton, { className: "flex items-center justify-center py-1", children: /* @__PURE__ */ jsx16(ChevronUp, { className: "h-4 w-4" }) }),
|
|
2614
|
+
/* @__PURE__ */ jsx16(SelectPrimitive.Viewport, { className: "p-1", children }),
|
|
2615
|
+
/* @__PURE__ */ jsx16(SelectPrimitive.ScrollDownButton, { className: "flex items-center justify-center py-1", children: /* @__PURE__ */ jsx16(ChevronDown, { className: "h-4 w-4" }) })
|
|
2616
|
+
]
|
|
2617
|
+
}
|
|
2618
|
+
) }));
|
|
2619
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
2620
|
+
var SelectItem = React32.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs5(
|
|
2621
|
+
SelectPrimitive.Item,
|
|
2622
|
+
{
|
|
2623
|
+
ref,
|
|
2624
|
+
className: cn(
|
|
2625
|
+
"relative flex w-full cursor-pointer select-none items-center rounded-md px-3 py-2 pl-9 text-sm outline-none focus:bg-secondary focus:text-secondary-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2626
|
+
className
|
|
2627
|
+
),
|
|
2628
|
+
...props,
|
|
2629
|
+
children: [
|
|
2630
|
+
/* @__PURE__ */ jsx16("span", { className: "absolute left-3 inline-flex", children: /* @__PURE__ */ jsx16(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx16(Check2, { className: "h-4 w-4" }) }) }),
|
|
2631
|
+
/* @__PURE__ */ jsx16(SelectPrimitive.ItemText, { children })
|
|
2632
|
+
]
|
|
2633
|
+
}
|
|
2634
|
+
));
|
|
2635
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
2636
|
+
|
|
2637
|
+
// src/components/ui/sonner.tsx
|
|
2638
|
+
import { Toaster as SonnerToaster } from "sonner";
|
|
2639
|
+
var Toaster = SonnerToaster;
|
|
2640
|
+
|
|
2641
|
+
// src/components/ui/table.tsx
|
|
2642
|
+
import * as React33 from "react";
|
|
2643
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2644
|
+
var Table = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
2645
|
+
"table",
|
|
2646
|
+
{
|
|
2647
|
+
ref,
|
|
2648
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
2649
|
+
...props
|
|
2650
|
+
}
|
|
2651
|
+
));
|
|
2652
|
+
Table.displayName = "Table";
|
|
2653
|
+
var TableHeader = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17("thead", { ref, className: cn("[&_tr]:border-b border-border/60", className), ...props }));
|
|
2654
|
+
TableHeader.displayName = "TableHeader";
|
|
2655
|
+
var TableBody = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props }));
|
|
2656
|
+
TableBody.displayName = "TableBody";
|
|
2657
|
+
var TableRow = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
2658
|
+
"tr",
|
|
2659
|
+
{
|
|
2660
|
+
ref,
|
|
2661
|
+
className: cn(
|
|
2662
|
+
"border-b border-border/50 transition-colors hover:bg-secondary/40 data-[state=selected]:bg-secondary",
|
|
2663
|
+
className
|
|
2664
|
+
),
|
|
2665
|
+
...props
|
|
2666
|
+
}
|
|
2667
|
+
));
|
|
2668
|
+
TableRow.displayName = "TableRow";
|
|
2669
|
+
var TableHead = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
2670
|
+
"th",
|
|
2671
|
+
{
|
|
2672
|
+
ref,
|
|
2673
|
+
className: cn(
|
|
2674
|
+
"h-11 px-4 text-left align-middle text-xs font-semibold text-muted-foreground",
|
|
2675
|
+
className
|
|
2676
|
+
),
|
|
2677
|
+
...props
|
|
2678
|
+
}
|
|
2679
|
+
));
|
|
2680
|
+
TableHead.displayName = "TableHead";
|
|
2681
|
+
var TableCell = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
2682
|
+
"td",
|
|
2683
|
+
{
|
|
2684
|
+
ref,
|
|
2685
|
+
className: cn("p-4 align-middle text-sm text-foreground/90", className),
|
|
2686
|
+
...props
|
|
2687
|
+
}
|
|
2688
|
+
));
|
|
2689
|
+
TableCell.displayName = "TableCell";
|
|
2690
|
+
|
|
2691
|
+
// src/components/ui/textarea.tsx
|
|
2692
|
+
import * as React34 from "react";
|
|
2693
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2694
|
+
var Textarea = React34.forwardRef(
|
|
2695
|
+
({ className, ...props }, ref) => {
|
|
2696
|
+
return /* @__PURE__ */ jsx18(
|
|
2697
|
+
"textarea",
|
|
2698
|
+
{
|
|
2699
|
+
className: cn(
|
|
2700
|
+
"flex min-h-[120px] w-full rounded-lg border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
2701
|
+
className
|
|
2702
|
+
),
|
|
2703
|
+
ref,
|
|
2704
|
+
...props
|
|
2705
|
+
}
|
|
2706
|
+
);
|
|
2707
|
+
}
|
|
2708
|
+
);
|
|
2709
|
+
Textarea.displayName = "Textarea";
|
|
2710
|
+
export {
|
|
2711
|
+
Alert,
|
|
2712
|
+
AlertDescription,
|
|
2713
|
+
AlertTitle,
|
|
2714
|
+
Badge,
|
|
2715
|
+
Button,
|
|
2716
|
+
Card,
|
|
2717
|
+
CardContent,
|
|
2718
|
+
CardDescription,
|
|
2719
|
+
CardFooter,
|
|
2720
|
+
CardHeader,
|
|
2721
|
+
CardTitle,
|
|
2722
|
+
Command,
|
|
2723
|
+
CommandDialog,
|
|
2724
|
+
CommandEmpty,
|
|
2725
|
+
CommandGroup,
|
|
2726
|
+
CommandInput,
|
|
2727
|
+
CommandItem,
|
|
2728
|
+
CommandList,
|
|
2729
|
+
CommandSeparator,
|
|
2730
|
+
CommandShortcut,
|
|
2731
|
+
Dialog2 as Dialog,
|
|
2732
|
+
DialogContent2 as DialogContent,
|
|
2733
|
+
DialogDescription2 as DialogDescription,
|
|
2734
|
+
DialogHeader,
|
|
2735
|
+
DialogTitle2 as DialogTitle,
|
|
2736
|
+
DialogTrigger2 as DialogTrigger,
|
|
2737
|
+
DropdownMenu,
|
|
2738
|
+
DropdownMenuCheckboxItem,
|
|
2739
|
+
DropdownMenuContent,
|
|
2740
|
+
DropdownMenuGroup,
|
|
2741
|
+
DropdownMenuItem,
|
|
2742
|
+
DropdownMenuLabel,
|
|
2743
|
+
DropdownMenuPortal,
|
|
2744
|
+
DropdownMenuRadioGroup,
|
|
2745
|
+
DropdownMenuRadioItem,
|
|
2746
|
+
DropdownMenuSeparator,
|
|
2747
|
+
DropdownMenuShortcut,
|
|
2748
|
+
DropdownMenuSub,
|
|
2749
|
+
DropdownMenuSubContent,
|
|
2750
|
+
DropdownMenuSubTrigger,
|
|
2751
|
+
DropdownMenuTrigger,
|
|
2752
|
+
Input,
|
|
2753
|
+
Select,
|
|
2754
|
+
SelectContent,
|
|
2755
|
+
SelectGroup,
|
|
2756
|
+
SelectItem,
|
|
2757
|
+
SelectTrigger,
|
|
2758
|
+
SelectValue,
|
|
2759
|
+
Table,
|
|
2760
|
+
TableBody,
|
|
2761
|
+
TableCell,
|
|
2762
|
+
TableHead,
|
|
2763
|
+
TableHeader,
|
|
2764
|
+
TableRow,
|
|
2765
|
+
Textarea,
|
|
2766
|
+
Toaster,
|
|
2767
|
+
buttonVariants,
|
|
2768
|
+
cn
|
|
2769
|
+
};
|
|
2770
|
+
//# sourceMappingURL=index.js.map
|