@remotion/design 4.0.373 → 4.0.374
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button.d.ts +1 -0
- package/dist/Button.js +5 -4
- package/dist/Input.d.ts +4 -0
- package/dist/Input.js +7 -0
- package/dist/Spinner.d.ts +5 -0
- package/dist/Spinner.js +45 -0
- package/dist/esm/index.mjs +423 -349
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +6 -6
package/dist/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/Button.tsx
|
|
2
|
-
import { useCallback, useRef, useState as useState2 } from "react";
|
|
2
|
+
import { useCallback, useRef as useRef2, useState as useState2 } from "react";
|
|
3
3
|
|
|
4
4
|
// src/helpers/cn.ts
|
|
5
5
|
import { clsx } from "clsx";
|
|
@@ -315,12 +315,62 @@ var Outer = ({
|
|
|
315
315
|
});
|
|
316
316
|
};
|
|
317
317
|
|
|
318
|
-
// src/
|
|
318
|
+
// src/Spinner.tsx
|
|
319
|
+
import { useEffect as useEffect2, useMemo as useMemo2, useRef } from "react";
|
|
319
320
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
320
|
-
var
|
|
321
|
+
var viewBox = 100;
|
|
322
|
+
var lines = 8;
|
|
323
|
+
var translated = "M 44 0 L 50 0 a 6 6 0 0 1 6 6 L 56 26 a 6 6 0 0 1 -6 6 L 50 32 a 6 6 0 0 1 -6 -6 L 44 6 a 6 6 0 0 1 6 -6 Z";
|
|
324
|
+
var Spinner = ({ size, duration }) => {
|
|
325
|
+
const style = useMemo2(() => {
|
|
326
|
+
return {
|
|
327
|
+
width: size,
|
|
328
|
+
height: size
|
|
329
|
+
};
|
|
330
|
+
}, [size]);
|
|
331
|
+
const pathsRef = useRef([]);
|
|
332
|
+
useEffect2(() => {
|
|
333
|
+
const animate = () => {
|
|
334
|
+
const now = performance.now();
|
|
335
|
+
for (let index = 0;index < lines; index++) {
|
|
336
|
+
const path = pathsRef.current[index];
|
|
337
|
+
if (!path)
|
|
338
|
+
continue;
|
|
339
|
+
const progress = (now / 1000 - index * (duration / lines)) % duration / duration;
|
|
340
|
+
const opacity = 1 - 0.85 * progress;
|
|
341
|
+
path.style.opacity = opacity.toString();
|
|
342
|
+
}
|
|
343
|
+
requestAnimationFrame(animate);
|
|
344
|
+
};
|
|
345
|
+
const id = requestAnimationFrame(animate);
|
|
346
|
+
return () => {
|
|
347
|
+
cancelAnimationFrame(id);
|
|
348
|
+
};
|
|
349
|
+
}, [duration]);
|
|
350
|
+
return /* @__PURE__ */ jsx3("svg", {
|
|
351
|
+
style,
|
|
352
|
+
viewBox: `0 0 ${viewBox} ${viewBox}`,
|
|
353
|
+
children: new Array(lines).fill(true).map((_, index) => {
|
|
354
|
+
return /* @__PURE__ */ jsx3("path", {
|
|
355
|
+
ref: (el) => pathsRef.current[index] = el,
|
|
356
|
+
style: {
|
|
357
|
+
rotate: `${index * Math.PI * 2 / lines}rad`,
|
|
358
|
+
transformOrigin: "center center",
|
|
359
|
+
opacity: 1
|
|
360
|
+
},
|
|
361
|
+
d: translated,
|
|
362
|
+
fill: "currentColor"
|
|
363
|
+
}, index);
|
|
364
|
+
})
|
|
365
|
+
});
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
// src/Button.tsx
|
|
369
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
370
|
+
var Button = ({ children, className, disabled, depth, loading, ...buttonProps }) => {
|
|
321
371
|
const [dimensions, setDimensions] = useState2(null);
|
|
322
|
-
const ref =
|
|
323
|
-
const { isActive, progress } = useHoverTransforms(ref, Boolean(disabled));
|
|
372
|
+
const ref = useRef2(null);
|
|
373
|
+
const { isActive, progress } = useHoverTransforms(ref, Boolean(disabled || loading));
|
|
324
374
|
const onPointerEnter = useCallback((e) => {
|
|
325
375
|
if (e.pointerType !== "mouse") {
|
|
326
376
|
return;
|
|
@@ -355,18 +405,30 @@ var Button = ({ children, className, disabled, depth, ...buttonProps }) => {
|
|
|
355
405
|
};
|
|
356
406
|
});
|
|
357
407
|
}, []);
|
|
358
|
-
const content = /* @__PURE__ */
|
|
408
|
+
const content = /* @__PURE__ */ jsxs2("button", {
|
|
359
409
|
type: "button",
|
|
360
|
-
disabled,
|
|
361
|
-
className: cn("text-text", "flex", "justify-center", "bg-button-bg", "items-center", "font-brand", "border-solid", "text-[1em]", "rounded-lg", "border-black", "border-2", "border-b-4", "cursor-pointer", "px-4", "h-12", "flex", "flex-row", "items-center", "disabled:cursor-default", "disabled:
|
|
410
|
+
disabled: disabled || loading,
|
|
411
|
+
className: cn("text-text", "flex", "justify-center", "bg-button-bg", "items-center", "font-brand", "border-solid", "text-[1em]", "rounded-lg", "border-black", "border-2", "border-b-4", "cursor-pointer", "px-4", "h-12", "flex", "flex-row", "items-center", "disabled:cursor-default", "disabled:opacity-50", "relative", "overflow-hidden", className),
|
|
362
412
|
...buttonProps,
|
|
363
|
-
children
|
|
413
|
+
children: [
|
|
414
|
+
/* @__PURE__ */ jsx4("div", {
|
|
415
|
+
className: cn(loading && "invisible"),
|
|
416
|
+
children
|
|
417
|
+
}),
|
|
418
|
+
loading ? /* @__PURE__ */ jsx4("div", {
|
|
419
|
+
className: cn("absolute w-full h-full flex inset-0 items-center justify-center text-inherit bg-inherit"),
|
|
420
|
+
children: /* @__PURE__ */ jsx4(Spinner, {
|
|
421
|
+
size: 20,
|
|
422
|
+
duration: 1
|
|
423
|
+
})
|
|
424
|
+
}) : null
|
|
425
|
+
]
|
|
364
426
|
});
|
|
365
|
-
return /* @__PURE__ */
|
|
427
|
+
return /* @__PURE__ */ jsx4("div", {
|
|
366
428
|
ref,
|
|
367
429
|
className: "contents",
|
|
368
430
|
onPointerEnter,
|
|
369
|
-
children: dimensions && (isActive || progress > 0) ? /* @__PURE__ */
|
|
431
|
+
children: dimensions && (isActive || progress > 0) ? /* @__PURE__ */ jsx4(Outer, {
|
|
370
432
|
parentRef: ref,
|
|
371
433
|
width: dimensions.width,
|
|
372
434
|
height: dimensions.height,
|
|
@@ -378,10 +440,10 @@ var Button = ({ children, className, disabled, depth, ...buttonProps }) => {
|
|
|
378
440
|
});
|
|
379
441
|
};
|
|
380
442
|
// src/Card.tsx
|
|
381
|
-
import
|
|
382
|
-
import { jsx as
|
|
383
|
-
var Card =
|
|
384
|
-
return /* @__PURE__ */
|
|
443
|
+
import React4 from "react";
|
|
444
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
445
|
+
var Card = React4.forwardRef(({ children, className, ...rest }, ref) => {
|
|
446
|
+
return /* @__PURE__ */ jsx5("div", {
|
|
385
447
|
ref,
|
|
386
448
|
className: cn("rounded-lg border-2 border-black bg-card-bg text-text border-b-4", className),
|
|
387
449
|
...rest,
|
|
@@ -390,23 +452,23 @@ var Card = React3.forwardRef(({ children, className, ...rest }, ref) => {
|
|
|
390
452
|
});
|
|
391
453
|
Card.displayName = "Card";
|
|
392
454
|
// src/CheckIcon.tsx
|
|
393
|
-
import { jsx as
|
|
455
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
394
456
|
var d = "M143.056 81.4934C147.25 77.2994 147.25 70.4506 143.056 66.2566C138.862 62.0627 132.013 62.0627 127.819 66.2566L86.1875 107.888L69.1809 90.8816C64.9869 86.6877 58.1381 86.6877 53.9441 90.8816C49.7502 95.0756 49.7502 101.924 53.9441 106.118L78.5691 130.743C82.7631 134.937 89.6119 134.937 93.8059 130.743L143.056 81.4934Z";
|
|
395
457
|
var CheckIcon = (props) => {
|
|
396
|
-
return /* @__PURE__ */
|
|
458
|
+
return /* @__PURE__ */ jsx6("svg", {
|
|
397
459
|
...props,
|
|
398
460
|
viewBox: "50.79867500000001 63.11117499999997 95.40282500000015 70.77732499999999",
|
|
399
461
|
fill: "none",
|
|
400
462
|
xmlns: "http://www.w3.org/2000/svg",
|
|
401
|
-
children: /* @__PURE__ */
|
|
463
|
+
children: /* @__PURE__ */ jsx6("path", {
|
|
402
464
|
d,
|
|
403
465
|
fill: "currentcolor"
|
|
404
466
|
})
|
|
405
467
|
});
|
|
406
468
|
};
|
|
407
469
|
// src/Counter.tsx
|
|
408
|
-
import { jsx as
|
|
409
|
-
var Triangle = ({ rotated }) => /* @__PURE__ */
|
|
470
|
+
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
471
|
+
var Triangle = ({ rotated }) => /* @__PURE__ */ jsx7("svg", {
|
|
410
472
|
width: "12px",
|
|
411
473
|
height: "7px",
|
|
412
474
|
viewBox: "0 0 12 7",
|
|
@@ -414,7 +476,7 @@ var Triangle = ({ rotated }) => /* @__PURE__ */ jsx6("svg", {
|
|
|
414
476
|
style: {
|
|
415
477
|
transform: rotated ? "rotate(180deg)" : "rotate(0deg)"
|
|
416
478
|
},
|
|
417
|
-
children: /* @__PURE__ */
|
|
479
|
+
children: /* @__PURE__ */ jsx7("path", {
|
|
418
480
|
className: "fill-text",
|
|
419
481
|
d: "M7.17096 0.475588C6.73198 0.0764969 6.01906 0.0764969 5.58007 0.475588L1.08483 4.56228C0.761737 4.85601 0.666915 5.29341 0.84251 5.67654C1.01811 6.05966 1.42549 6.3087 1.88203 6.3087H10.8725C11.3255 6.3087 11.7364 6.05966 11.912 5.67654C12.0876 5.29341 11.9893 4.85601 11.6697 4.56228L7.17448 0.475588H7.17096Z"
|
|
420
482
|
})
|
|
@@ -449,11 +511,11 @@ var Counter = ({
|
|
|
449
511
|
const increment = () => {
|
|
450
512
|
setCount(count + step);
|
|
451
513
|
};
|
|
452
|
-
return /* @__PURE__ */
|
|
514
|
+
return /* @__PURE__ */ jsxs3(Card, {
|
|
453
515
|
style: container,
|
|
454
516
|
className: cn("w-[140px] flex flex-row overflow-hidden"),
|
|
455
517
|
children: [
|
|
456
|
-
/* @__PURE__ */
|
|
518
|
+
/* @__PURE__ */ jsx7("input", {
|
|
457
519
|
className: "fontbrand text-2xl font-medium min-w-[80px] border-0 text-end outline-0 text-text overflow-hidden flex-1 px-0 py-0 pr-2 w-full h-full tabular-nums",
|
|
458
520
|
type: "number",
|
|
459
521
|
onClick: (e) => e.currentTarget.select(),
|
|
@@ -473,28 +535,28 @@ var Counter = ({
|
|
|
473
535
|
}
|
|
474
536
|
}
|
|
475
537
|
}),
|
|
476
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
477
539
|
className: "flex flex-col h-full",
|
|
478
540
|
children: [
|
|
479
|
-
/* @__PURE__ */
|
|
541
|
+
/* @__PURE__ */ jsx7("button", {
|
|
480
542
|
type: "button",
|
|
481
543
|
className: "border-0 flex-1 p-0 pt-[5px] bg-transparent",
|
|
482
544
|
style: {
|
|
483
545
|
...buttonContainer
|
|
484
546
|
},
|
|
485
547
|
onClick: increment,
|
|
486
|
-
children: /* @__PURE__ */
|
|
548
|
+
children: /* @__PURE__ */ jsx7(Triangle, {
|
|
487
549
|
rotated: false
|
|
488
550
|
})
|
|
489
551
|
}),
|
|
490
|
-
/* @__PURE__ */
|
|
552
|
+
/* @__PURE__ */ jsx7("button", {
|
|
491
553
|
type: "button",
|
|
492
554
|
className: "border-0 flex-1 p-0 bg-transparent pb-[5px] pl-[1px]",
|
|
493
555
|
style: {
|
|
494
556
|
...buttonContainer
|
|
495
557
|
},
|
|
496
558
|
onClick: decrement,
|
|
497
|
-
children: /* @__PURE__ */
|
|
559
|
+
children: /* @__PURE__ */ jsx7(Triangle, {
|
|
498
560
|
rotated: true
|
|
499
561
|
})
|
|
500
562
|
})
|
|
@@ -503,21 +565,32 @@ var Counter = ({
|
|
|
503
565
|
]
|
|
504
566
|
});
|
|
505
567
|
};
|
|
568
|
+
// src/Input.tsx
|
|
569
|
+
import React5 from "react";
|
|
570
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
571
|
+
var Input = React5.forwardRef(({ className, ...props }, ref) => {
|
|
572
|
+
return /* @__PURE__ */ jsx8("input", {
|
|
573
|
+
ref,
|
|
574
|
+
className: cn("w-full dark:bg-[#121212] rounded-lg border-2 border-b-4 border-black outline-none h-14 px-3 fontbrand text-lg box-border", className),
|
|
575
|
+
...props
|
|
576
|
+
});
|
|
577
|
+
});
|
|
578
|
+
Input.displayName = "Input";
|
|
506
579
|
// src/PaperPlaneIcon.tsx
|
|
507
|
-
import { jsx as
|
|
580
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
508
581
|
var PlanePaperIcon = (props) => {
|
|
509
|
-
return /* @__PURE__ */
|
|
582
|
+
return /* @__PURE__ */ jsx9("svg", {
|
|
510
583
|
xmlns: "http://www.w3.org/2000/svg",
|
|
511
584
|
...props,
|
|
512
585
|
viewBox: "0 0 576 512",
|
|
513
|
-
children: /* @__PURE__ */
|
|
586
|
+
children: /* @__PURE__ */ jsx9("path", {
|
|
514
587
|
fill: "currentcolor",
|
|
515
588
|
d: "M169.9 280L94.9 448.6 461.2 280 169.9 280zm291.3-48L94.9 63.4 169.9 232 461.2 232zM34.8 465.6L128 256 34.8 46.4C33 42.2 32 37.6 32 33 32 14.8 46.7 0 64.8 0 69.5 0 74.2 1 78.5 3L554.2 222c13.3 6.1 21.8 19.4 21.8 34s-8.5 27.9-21.8 34L78.5 509c-4.3 2-9 3-13.7 3-18.1 0-32.8-14.8-32.8-33 0-4.6 1-9.2 2.8-13.4z"
|
|
516
589
|
})
|
|
517
590
|
});
|
|
518
591
|
};
|
|
519
592
|
// ../../node_modules/.bun/@radix-ui+react-select@2.1.1+676b3d28333f5d10/node_modules/@radix-ui/react-select/dist/index.mjs
|
|
520
|
-
import * as
|
|
593
|
+
import * as React34 from "react";
|
|
521
594
|
import * as ReactDOM4 from "react-dom";
|
|
522
595
|
|
|
523
596
|
// ../../node_modules/.bun/@radix-ui+number@1.1.0/node_modules/@radix-ui/number/dist/index.mjs
|
|
@@ -536,26 +609,26 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
536
609
|
}
|
|
537
610
|
|
|
538
611
|
// ../../node_modules/.bun/@radix-ui+react-collection@1.1.0+676b3d28333f5d10/node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
539
|
-
import
|
|
612
|
+
import React9 from "react";
|
|
540
613
|
|
|
541
614
|
// ../../node_modules/.bun/@radix-ui+react-context@1.1.0+143250c3c32ebfa0/node_modules/@radix-ui/react-context/dist/index.mjs
|
|
542
|
-
import * as
|
|
543
|
-
import { jsx as
|
|
615
|
+
import * as React6 from "react";
|
|
616
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
544
617
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
545
618
|
let defaultContexts = [];
|
|
546
619
|
function createContext3(rootComponentName, defaultContext) {
|
|
547
|
-
const BaseContext =
|
|
620
|
+
const BaseContext = React6.createContext(defaultContext);
|
|
548
621
|
const index = defaultContexts.length;
|
|
549
622
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
550
623
|
function Provider(props) {
|
|
551
624
|
const { scope, children, ...context } = props;
|
|
552
625
|
const Context = scope?.[scopeName][index] || BaseContext;
|
|
553
|
-
const value =
|
|
554
|
-
return /* @__PURE__ */
|
|
626
|
+
const value = React6.useMemo(() => context, Object.values(context));
|
|
627
|
+
return /* @__PURE__ */ jsx10(Context.Provider, { value, children });
|
|
555
628
|
}
|
|
556
629
|
function useContext2(consumerName, scope) {
|
|
557
630
|
const Context = scope?.[scopeName][index] || BaseContext;
|
|
558
|
-
const context =
|
|
631
|
+
const context = React6.useContext(Context);
|
|
559
632
|
if (context)
|
|
560
633
|
return context;
|
|
561
634
|
if (defaultContext !== undefined)
|
|
@@ -567,11 +640,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
567
640
|
}
|
|
568
641
|
const createScope = () => {
|
|
569
642
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
570
|
-
return
|
|
643
|
+
return React6.createContext(defaultContext);
|
|
571
644
|
});
|
|
572
645
|
return function useScope(scope) {
|
|
573
646
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
574
|
-
return
|
|
647
|
+
return React6.useMemo(() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }), [scope, contexts]);
|
|
575
648
|
};
|
|
576
649
|
};
|
|
577
650
|
createScope.scopeName = scopeName;
|
|
@@ -592,7 +665,7 @@ function composeContextScopes(...scopes) {
|
|
|
592
665
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
593
666
|
return { ...nextScopes2, ...currentScope };
|
|
594
667
|
}, {});
|
|
595
|
-
return
|
|
668
|
+
return React6.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
596
669
|
};
|
|
597
670
|
};
|
|
598
671
|
createScope.scopeName = baseScope.scopeName;
|
|
@@ -600,7 +673,7 @@ function composeContextScopes(...scopes) {
|
|
|
600
673
|
}
|
|
601
674
|
|
|
602
675
|
// ../../node_modules/.bun/@radix-ui+react-compose-refs@1.1.0+143250c3c32ebfa0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
603
|
-
import * as
|
|
676
|
+
import * as React7 from "react";
|
|
604
677
|
function setRef(ref, value) {
|
|
605
678
|
if (typeof ref === "function") {
|
|
606
679
|
ref(value);
|
|
@@ -612,49 +685,49 @@ function composeRefs(...refs) {
|
|
|
612
685
|
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
613
686
|
}
|
|
614
687
|
function useComposedRefs(...refs) {
|
|
615
|
-
return
|
|
688
|
+
return React7.useCallback(composeRefs(...refs), refs);
|
|
616
689
|
}
|
|
617
690
|
|
|
618
691
|
// ../../node_modules/.bun/@radix-ui+react-slot@1.1.0+143250c3c32ebfa0/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
619
|
-
import * as
|
|
620
|
-
import { Fragment as Fragment2, jsx as
|
|
621
|
-
var Slot =
|
|
692
|
+
import * as React8 from "react";
|
|
693
|
+
import { Fragment as Fragment2, jsx as jsx11 } from "react/jsx-runtime";
|
|
694
|
+
var Slot = React8.forwardRef((props, forwardedRef) => {
|
|
622
695
|
const { children, ...slotProps } = props;
|
|
623
|
-
const childrenArray =
|
|
696
|
+
const childrenArray = React8.Children.toArray(children);
|
|
624
697
|
const slottable = childrenArray.find(isSlottable);
|
|
625
698
|
if (slottable) {
|
|
626
699
|
const newElement = slottable.props.children;
|
|
627
700
|
const newChildren = childrenArray.map((child) => {
|
|
628
701
|
if (child === slottable) {
|
|
629
|
-
if (
|
|
630
|
-
return
|
|
631
|
-
return
|
|
702
|
+
if (React8.Children.count(newElement) > 1)
|
|
703
|
+
return React8.Children.only(null);
|
|
704
|
+
return React8.isValidElement(newElement) ? newElement.props.children : null;
|
|
632
705
|
} else {
|
|
633
706
|
return child;
|
|
634
707
|
}
|
|
635
708
|
});
|
|
636
|
-
return /* @__PURE__ */
|
|
709
|
+
return /* @__PURE__ */ jsx11(SlotClone, { ...slotProps, ref: forwardedRef, children: React8.isValidElement(newElement) ? React8.cloneElement(newElement, undefined, newChildren) : null });
|
|
637
710
|
}
|
|
638
|
-
return /* @__PURE__ */
|
|
711
|
+
return /* @__PURE__ */ jsx11(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
639
712
|
});
|
|
640
713
|
Slot.displayName = "Slot";
|
|
641
|
-
var SlotClone =
|
|
714
|
+
var SlotClone = React8.forwardRef((props, forwardedRef) => {
|
|
642
715
|
const { children, ...slotProps } = props;
|
|
643
|
-
if (
|
|
716
|
+
if (React8.isValidElement(children)) {
|
|
644
717
|
const childrenRef = getElementRef(children);
|
|
645
|
-
return
|
|
718
|
+
return React8.cloneElement(children, {
|
|
646
719
|
...mergeProps(slotProps, children.props),
|
|
647
720
|
ref: forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef
|
|
648
721
|
});
|
|
649
722
|
}
|
|
650
|
-
return
|
|
723
|
+
return React8.Children.count(children) > 1 ? React8.Children.only(null) : null;
|
|
651
724
|
});
|
|
652
725
|
SlotClone.displayName = "SlotClone";
|
|
653
726
|
var Slottable = ({ children }) => {
|
|
654
|
-
return /* @__PURE__ */
|
|
727
|
+
return /* @__PURE__ */ jsx11(Fragment2, { children });
|
|
655
728
|
};
|
|
656
729
|
function isSlottable(child) {
|
|
657
|
-
return
|
|
730
|
+
return React8.isValidElement(child) && child.type === Slottable;
|
|
658
731
|
}
|
|
659
732
|
function mergeProps(slotProps, childProps) {
|
|
660
733
|
const overrideProps = { ...childProps };
|
|
@@ -694,7 +767,7 @@ function getElementRef(element) {
|
|
|
694
767
|
}
|
|
695
768
|
|
|
696
769
|
// ../../node_modules/.bun/@radix-ui+react-collection@1.1.0+676b3d28333f5d10/node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
697
|
-
import { jsx as
|
|
770
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
698
771
|
"use client";
|
|
699
772
|
function createCollection(name) {
|
|
700
773
|
const PROVIDER_NAME = name + "CollectionProvider";
|
|
@@ -702,36 +775,36 @@ function createCollection(name) {
|
|
|
702
775
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map });
|
|
703
776
|
const CollectionProvider = (props) => {
|
|
704
777
|
const { scope, children } = props;
|
|
705
|
-
const ref =
|
|
706
|
-
const itemMap =
|
|
707
|
-
return /* @__PURE__ */
|
|
778
|
+
const ref = React9.useRef(null);
|
|
779
|
+
const itemMap = React9.useRef(/* @__PURE__ */ new Map).current;
|
|
780
|
+
return /* @__PURE__ */ jsx12(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
708
781
|
};
|
|
709
782
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
710
783
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
711
|
-
const CollectionSlot =
|
|
784
|
+
const CollectionSlot = React9.forwardRef((props, forwardedRef) => {
|
|
712
785
|
const { scope, children } = props;
|
|
713
786
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
714
787
|
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
715
|
-
return /* @__PURE__ */
|
|
788
|
+
return /* @__PURE__ */ jsx12(Slot, { ref: composedRefs, children });
|
|
716
789
|
});
|
|
717
790
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
718
791
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
719
792
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
720
|
-
const CollectionItemSlot =
|
|
793
|
+
const CollectionItemSlot = React9.forwardRef((props, forwardedRef) => {
|
|
721
794
|
const { scope, children, ...itemData } = props;
|
|
722
|
-
const ref =
|
|
795
|
+
const ref = React9.useRef(null);
|
|
723
796
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
724
797
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
725
|
-
|
|
798
|
+
React9.useEffect(() => {
|
|
726
799
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
727
800
|
return () => void context.itemMap.delete(ref);
|
|
728
801
|
});
|
|
729
|
-
return /* @__PURE__ */
|
|
802
|
+
return /* @__PURE__ */ jsx12(Slot, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
730
803
|
});
|
|
731
804
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
732
805
|
function useCollection(scope) {
|
|
733
806
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
734
|
-
const getItems =
|
|
807
|
+
const getItems = React9.useCallback(() => {
|
|
735
808
|
const collectionNode = context.collectionRef.current;
|
|
736
809
|
if (!collectionNode)
|
|
737
810
|
return [];
|
|
@@ -750,21 +823,21 @@ function createCollection(name) {
|
|
|
750
823
|
}
|
|
751
824
|
|
|
752
825
|
// ../../node_modules/.bun/@radix-ui+react-direction@1.1.0+143250c3c32ebfa0/node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
753
|
-
import * as
|
|
754
|
-
import { jsx as
|
|
755
|
-
var DirectionContext =
|
|
826
|
+
import * as React10 from "react";
|
|
827
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
828
|
+
var DirectionContext = React10.createContext(undefined);
|
|
756
829
|
function useDirection(localDir) {
|
|
757
|
-
const globalDir =
|
|
830
|
+
const globalDir = React10.useContext(DirectionContext);
|
|
758
831
|
return localDir || globalDir || "ltr";
|
|
759
832
|
}
|
|
760
833
|
|
|
761
834
|
// ../../node_modules/.bun/@radix-ui+react-dismissable-layer@1.1.0+676b3d28333f5d10/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
762
|
-
import * as
|
|
835
|
+
import * as React14 from "react";
|
|
763
836
|
|
|
764
837
|
// ../../node_modules/.bun/@radix-ui+react-primitive@2.0.0+676b3d28333f5d10/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
765
|
-
import * as
|
|
838
|
+
import * as React11 from "react";
|
|
766
839
|
import * as ReactDOM from "react-dom";
|
|
767
|
-
import { jsx as
|
|
840
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
768
841
|
var NODES = [
|
|
769
842
|
"a",
|
|
770
843
|
"button",
|
|
@@ -784,13 +857,13 @@ var NODES = [
|
|
|
784
857
|
"ul"
|
|
785
858
|
];
|
|
786
859
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
787
|
-
const Node2 =
|
|
860
|
+
const Node2 = React11.forwardRef((props, forwardedRef) => {
|
|
788
861
|
const { asChild, ...primitiveProps } = props;
|
|
789
862
|
const Comp = asChild ? Slot : node;
|
|
790
863
|
if (typeof window !== "undefined") {
|
|
791
864
|
window[Symbol.for("radix-ui")] = true;
|
|
792
865
|
}
|
|
793
|
-
return /* @__PURE__ */
|
|
866
|
+
return /* @__PURE__ */ jsx14(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
794
867
|
});
|
|
795
868
|
Node2.displayName = `Primitive.${node}`;
|
|
796
869
|
return { ...primitive, [node]: Node2 };
|
|
@@ -801,20 +874,20 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
801
874
|
}
|
|
802
875
|
|
|
803
876
|
// ../../node_modules/.bun/@radix-ui+react-use-callback-ref@1.1.0+143250c3c32ebfa0/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
804
|
-
import * as
|
|
877
|
+
import * as React12 from "react";
|
|
805
878
|
function useCallbackRef(callback) {
|
|
806
|
-
const callbackRef =
|
|
807
|
-
|
|
879
|
+
const callbackRef = React12.useRef(callback);
|
|
880
|
+
React12.useEffect(() => {
|
|
808
881
|
callbackRef.current = callback;
|
|
809
882
|
});
|
|
810
|
-
return
|
|
883
|
+
return React12.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
811
884
|
}
|
|
812
885
|
|
|
813
886
|
// ../../node_modules/.bun/@radix-ui+react-use-escape-keydown@1.1.0+143250c3c32ebfa0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
|
|
814
|
-
import * as
|
|
887
|
+
import * as React13 from "react";
|
|
815
888
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
816
889
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
817
|
-
|
|
890
|
+
React13.useEffect(() => {
|
|
818
891
|
const handleKeyDown = (event) => {
|
|
819
892
|
if (event.key === "Escape") {
|
|
820
893
|
onEscapeKeyDown(event);
|
|
@@ -826,19 +899,19 @@ function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.docum
|
|
|
826
899
|
}
|
|
827
900
|
|
|
828
901
|
// ../../node_modules/.bun/@radix-ui+react-dismissable-layer@1.1.0+676b3d28333f5d10/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
829
|
-
import { jsx as
|
|
902
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
830
903
|
"use client";
|
|
831
904
|
var DISMISSABLE_LAYER_NAME = "DismissableLayer";
|
|
832
905
|
var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
833
906
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
834
907
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
835
908
|
var originalBodyPointerEvents;
|
|
836
|
-
var DismissableLayerContext =
|
|
909
|
+
var DismissableLayerContext = React14.createContext({
|
|
837
910
|
layers: /* @__PURE__ */ new Set,
|
|
838
911
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set,
|
|
839
912
|
branches: /* @__PURE__ */ new Set
|
|
840
913
|
});
|
|
841
|
-
var DismissableLayer =
|
|
914
|
+
var DismissableLayer = React14.forwardRef((props, forwardedRef) => {
|
|
842
915
|
const {
|
|
843
916
|
disableOutsidePointerEvents = false,
|
|
844
917
|
onEscapeKeyDown,
|
|
@@ -848,10 +921,10 @@ var DismissableLayer = React12.forwardRef((props, forwardedRef) => {
|
|
|
848
921
|
onDismiss,
|
|
849
922
|
...layerProps
|
|
850
923
|
} = props;
|
|
851
|
-
const context =
|
|
852
|
-
const [node, setNode] =
|
|
924
|
+
const context = React14.useContext(DismissableLayerContext);
|
|
925
|
+
const [node, setNode] = React14.useState(null);
|
|
853
926
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
854
|
-
const [, force] =
|
|
927
|
+
const [, force] = React14.useState({});
|
|
855
928
|
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
856
929
|
const layers = Array.from(context.layers);
|
|
857
930
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
@@ -889,7 +962,7 @@ var DismissableLayer = React12.forwardRef((props, forwardedRef) => {
|
|
|
889
962
|
onDismiss();
|
|
890
963
|
}
|
|
891
964
|
}, ownerDocument);
|
|
892
|
-
|
|
965
|
+
React14.useEffect(() => {
|
|
893
966
|
if (!node)
|
|
894
967
|
return;
|
|
895
968
|
if (disableOutsidePointerEvents) {
|
|
@@ -907,7 +980,7 @@ var DismissableLayer = React12.forwardRef((props, forwardedRef) => {
|
|
|
907
980
|
}
|
|
908
981
|
};
|
|
909
982
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
910
|
-
|
|
983
|
+
React14.useEffect(() => {
|
|
911
984
|
return () => {
|
|
912
985
|
if (!node)
|
|
913
986
|
return;
|
|
@@ -916,12 +989,12 @@ var DismissableLayer = React12.forwardRef((props, forwardedRef) => {
|
|
|
916
989
|
dispatchUpdate();
|
|
917
990
|
};
|
|
918
991
|
}, [node, context]);
|
|
919
|
-
|
|
992
|
+
React14.useEffect(() => {
|
|
920
993
|
const handleUpdate = () => force({});
|
|
921
994
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
922
995
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
923
996
|
}, []);
|
|
924
|
-
return /* @__PURE__ */
|
|
997
|
+
return /* @__PURE__ */ jsx15(Primitive.div, {
|
|
925
998
|
...layerProps,
|
|
926
999
|
ref: composedRefs,
|
|
927
1000
|
style: {
|
|
@@ -935,11 +1008,11 @@ var DismissableLayer = React12.forwardRef((props, forwardedRef) => {
|
|
|
935
1008
|
});
|
|
936
1009
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
937
1010
|
var BRANCH_NAME = "DismissableLayerBranch";
|
|
938
|
-
var DismissableLayerBranch =
|
|
939
|
-
const context =
|
|
940
|
-
const ref =
|
|
1011
|
+
var DismissableLayerBranch = React14.forwardRef((props, forwardedRef) => {
|
|
1012
|
+
const context = React14.useContext(DismissableLayerContext);
|
|
1013
|
+
const ref = React14.useRef(null);
|
|
941
1014
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
942
|
-
|
|
1015
|
+
React14.useEffect(() => {
|
|
943
1016
|
const node = ref.current;
|
|
944
1017
|
if (node) {
|
|
945
1018
|
context.branches.add(node);
|
|
@@ -948,14 +1021,14 @@ var DismissableLayerBranch = React12.forwardRef((props, forwardedRef) => {
|
|
|
948
1021
|
};
|
|
949
1022
|
}
|
|
950
1023
|
}, [context.branches]);
|
|
951
|
-
return /* @__PURE__ */
|
|
1024
|
+
return /* @__PURE__ */ jsx15(Primitive.div, { ...props, ref: composedRefs });
|
|
952
1025
|
});
|
|
953
1026
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
954
1027
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
955
1028
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
956
|
-
const isPointerInsideReactTreeRef =
|
|
957
|
-
const handleClickRef =
|
|
958
|
-
|
|
1029
|
+
const isPointerInsideReactTreeRef = React14.useRef(false);
|
|
1030
|
+
const handleClickRef = React14.useRef(() => {});
|
|
1031
|
+
React14.useEffect(() => {
|
|
959
1032
|
const handlePointerDown = (event) => {
|
|
960
1033
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
961
1034
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
@@ -990,8 +1063,8 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?
|
|
|
990
1063
|
}
|
|
991
1064
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
992
1065
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
993
|
-
const isFocusInsideReactTreeRef =
|
|
994
|
-
|
|
1066
|
+
const isFocusInsideReactTreeRef = React14.useRef(false);
|
|
1067
|
+
React14.useEffect(() => {
|
|
995
1068
|
const handleFocus = (event) => {
|
|
996
1069
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
997
1070
|
const eventDetail = { originalEvent: event };
|
|
@@ -1025,11 +1098,11 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
1025
1098
|
}
|
|
1026
1099
|
|
|
1027
1100
|
// ../../node_modules/.bun/@radix-ui+react-focus-guards@1.1.0+143250c3c32ebfa0/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
|
|
1028
|
-
import * as
|
|
1101
|
+
import * as React15 from "react";
|
|
1029
1102
|
"use client";
|
|
1030
1103
|
var count = 0;
|
|
1031
1104
|
function useFocusGuards() {
|
|
1032
|
-
|
|
1105
|
+
React15.useEffect(() => {
|
|
1033
1106
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
1034
1107
|
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
1035
1108
|
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
@@ -1051,14 +1124,14 @@ function createFocusGuard() {
|
|
|
1051
1124
|
}
|
|
1052
1125
|
|
|
1053
1126
|
// ../../node_modules/.bun/@radix-ui+react-focus-scope@1.1.0+676b3d28333f5d10/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
1054
|
-
import * as
|
|
1055
|
-
import { jsx as
|
|
1127
|
+
import * as React16 from "react";
|
|
1128
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1056
1129
|
"use client";
|
|
1057
1130
|
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
1058
1131
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
1059
1132
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
1060
1133
|
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
1061
|
-
var FocusScope =
|
|
1134
|
+
var FocusScope = React16.forwardRef((props, forwardedRef) => {
|
|
1062
1135
|
const {
|
|
1063
1136
|
loop = false,
|
|
1064
1137
|
trapped = false,
|
|
@@ -1066,12 +1139,12 @@ var FocusScope = React14.forwardRef((props, forwardedRef) => {
|
|
|
1066
1139
|
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
1067
1140
|
...scopeProps
|
|
1068
1141
|
} = props;
|
|
1069
|
-
const [container2, setContainer] =
|
|
1142
|
+
const [container2, setContainer] = React16.useState(null);
|
|
1070
1143
|
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
1071
1144
|
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
1072
|
-
const lastFocusedElementRef =
|
|
1145
|
+
const lastFocusedElementRef = React16.useRef(null);
|
|
1073
1146
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
1074
|
-
const focusScope =
|
|
1147
|
+
const focusScope = React16.useRef({
|
|
1075
1148
|
paused: false,
|
|
1076
1149
|
pause() {
|
|
1077
1150
|
this.paused = true;
|
|
@@ -1080,7 +1153,7 @@ var FocusScope = React14.forwardRef((props, forwardedRef) => {
|
|
|
1080
1153
|
this.paused = false;
|
|
1081
1154
|
}
|
|
1082
1155
|
}).current;
|
|
1083
|
-
|
|
1156
|
+
React16.useEffect(() => {
|
|
1084
1157
|
if (trapped) {
|
|
1085
1158
|
let handleFocusIn2 = function(event) {
|
|
1086
1159
|
if (focusScope.paused || !container2)
|
|
@@ -1122,7 +1195,7 @@ var FocusScope = React14.forwardRef((props, forwardedRef) => {
|
|
|
1122
1195
|
};
|
|
1123
1196
|
}
|
|
1124
1197
|
}, [trapped, container2, focusScope.paused]);
|
|
1125
|
-
|
|
1198
|
+
React16.useEffect(() => {
|
|
1126
1199
|
if (container2) {
|
|
1127
1200
|
focusScopesStack.add(focusScope);
|
|
1128
1201
|
const previouslyFocusedElement = document.activeElement;
|
|
@@ -1153,7 +1226,7 @@ var FocusScope = React14.forwardRef((props, forwardedRef) => {
|
|
|
1153
1226
|
};
|
|
1154
1227
|
}
|
|
1155
1228
|
}, [container2, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
1156
|
-
const handleKeyDown =
|
|
1229
|
+
const handleKeyDown = React16.useCallback((event) => {
|
|
1157
1230
|
if (!loop && !trapped)
|
|
1158
1231
|
return;
|
|
1159
1232
|
if (focusScope.paused)
|
|
@@ -1180,7 +1253,7 @@ var FocusScope = React14.forwardRef((props, forwardedRef) => {
|
|
|
1180
1253
|
}
|
|
1181
1254
|
}
|
|
1182
1255
|
}, [loop, trapped, focusScope.paused]);
|
|
1183
|
-
return /* @__PURE__ */
|
|
1256
|
+
return /* @__PURE__ */ jsx16(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
1184
1257
|
});
|
|
1185
1258
|
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
1186
1259
|
function focusFirst(candidates, { select = false } = {}) {
|
|
@@ -1271,19 +1344,19 @@ function removeLinks(items) {
|
|
|
1271
1344
|
}
|
|
1272
1345
|
|
|
1273
1346
|
// ../../node_modules/.bun/@radix-ui+react-id@1.1.0+143250c3c32ebfa0/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
1274
|
-
import * as
|
|
1347
|
+
import * as React18 from "react";
|
|
1275
1348
|
|
|
1276
1349
|
// ../../node_modules/.bun/@radix-ui+react-use-layout-effect@1.1.0+143250c3c32ebfa0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
1277
|
-
import * as
|
|
1278
|
-
var useLayoutEffect2 = Boolean(globalThis?.document) ?
|
|
1350
|
+
import * as React17 from "react";
|
|
1351
|
+
var useLayoutEffect2 = Boolean(globalThis?.document) ? React17.useLayoutEffect : () => {};
|
|
1279
1352
|
|
|
1280
1353
|
// ../../node_modules/.bun/@radix-ui+react-id@1.1.0+143250c3c32ebfa0/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
1281
|
-
var useReactId =
|
|
1354
|
+
var useReactId = React18["useId".toString()] || (() => {
|
|
1282
1355
|
return;
|
|
1283
1356
|
});
|
|
1284
1357
|
var count2 = 0;
|
|
1285
1358
|
function useId(deterministicId) {
|
|
1286
|
-
const [id, setId] =
|
|
1359
|
+
const [id, setId] = React18.useState(useReactId());
|
|
1287
1360
|
useLayoutEffect2(() => {
|
|
1288
1361
|
if (!deterministicId)
|
|
1289
1362
|
setId((reactId) => reactId ?? String(count2++));
|
|
@@ -1292,7 +1365,7 @@ function useId(deterministicId) {
|
|
|
1292
1365
|
}
|
|
1293
1366
|
|
|
1294
1367
|
// ../../node_modules/.bun/@radix-ui+react-popper@1.2.0+676b3d28333f5d10/node_modules/@radix-ui/react-popper/dist/index.mjs
|
|
1295
|
-
import * as
|
|
1368
|
+
import * as React22 from "react";
|
|
1296
1369
|
|
|
1297
1370
|
// ../../node_modules/.bun/@floating-ui+utils@0.2.7/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
1298
1371
|
var sides = ["top", "right", "bottom", "left"];
|
|
@@ -2814,10 +2887,10 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
2814
2887
|
};
|
|
2815
2888
|
|
|
2816
2889
|
// ../../node_modules/.bun/@floating-ui+react-dom@2.1.1+1eeaf37cadfdd01a/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
|
|
2817
|
-
import * as
|
|
2818
|
-
import { useLayoutEffect as useLayoutEffect3, useEffect as
|
|
2890
|
+
import * as React19 from "react";
|
|
2891
|
+
import { useLayoutEffect as useLayoutEffect3, useEffect as useEffect8 } from "react";
|
|
2819
2892
|
import * as ReactDOM2 from "react-dom";
|
|
2820
|
-
var index = typeof document !== "undefined" ? useLayoutEffect3 :
|
|
2893
|
+
var index = typeof document !== "undefined" ? useLayoutEffect3 : useEffect8;
|
|
2821
2894
|
function deepEqual(a, b) {
|
|
2822
2895
|
if (a === b) {
|
|
2823
2896
|
return true;
|
|
@@ -2878,7 +2951,7 @@ function roundByDPR(element, value) {
|
|
|
2878
2951
|
return Math.round(value * dpr) / dpr;
|
|
2879
2952
|
}
|
|
2880
2953
|
function useLatestRef(value) {
|
|
2881
|
-
const ref =
|
|
2954
|
+
const ref = React19.useRef(value);
|
|
2882
2955
|
index(() => {
|
|
2883
2956
|
ref.current = value;
|
|
2884
2957
|
});
|
|
@@ -2901,7 +2974,7 @@ function useFloating(options) {
|
|
|
2901
2974
|
whileElementsMounted,
|
|
2902
2975
|
open
|
|
2903
2976
|
} = options;
|
|
2904
|
-
const [data, setData] =
|
|
2977
|
+
const [data, setData] = React19.useState({
|
|
2905
2978
|
x: 0,
|
|
2906
2979
|
y: 0,
|
|
2907
2980
|
strategy,
|
|
@@ -2909,19 +2982,19 @@ function useFloating(options) {
|
|
|
2909
2982
|
middlewareData: {},
|
|
2910
2983
|
isPositioned: false
|
|
2911
2984
|
});
|
|
2912
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
2985
|
+
const [latestMiddleware, setLatestMiddleware] = React19.useState(middleware);
|
|
2913
2986
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
2914
2987
|
setLatestMiddleware(middleware);
|
|
2915
2988
|
}
|
|
2916
|
-
const [_reference, _setReference] =
|
|
2917
|
-
const [_floating, _setFloating] =
|
|
2918
|
-
const setReference =
|
|
2989
|
+
const [_reference, _setReference] = React19.useState(null);
|
|
2990
|
+
const [_floating, _setFloating] = React19.useState(null);
|
|
2991
|
+
const setReference = React19.useCallback((node) => {
|
|
2919
2992
|
if (node !== referenceRef.current) {
|
|
2920
2993
|
referenceRef.current = node;
|
|
2921
2994
|
_setReference(node);
|
|
2922
2995
|
}
|
|
2923
2996
|
}, []);
|
|
2924
|
-
const setFloating =
|
|
2997
|
+
const setFloating = React19.useCallback((node) => {
|
|
2925
2998
|
if (node !== floatingRef.current) {
|
|
2926
2999
|
floatingRef.current = node;
|
|
2927
3000
|
_setFloating(node);
|
|
@@ -2929,13 +3002,13 @@ function useFloating(options) {
|
|
|
2929
3002
|
}, []);
|
|
2930
3003
|
const referenceEl = externalReference || _reference;
|
|
2931
3004
|
const floatingEl = externalFloating || _floating;
|
|
2932
|
-
const referenceRef =
|
|
2933
|
-
const floatingRef =
|
|
2934
|
-
const dataRef =
|
|
3005
|
+
const referenceRef = React19.useRef(null);
|
|
3006
|
+
const floatingRef = React19.useRef(null);
|
|
3007
|
+
const dataRef = React19.useRef(data);
|
|
2935
3008
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
2936
3009
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
2937
3010
|
const platformRef = useLatestRef(platform2);
|
|
2938
|
-
const update =
|
|
3011
|
+
const update = React19.useCallback(() => {
|
|
2939
3012
|
if (!referenceRef.current || !floatingRef.current) {
|
|
2940
3013
|
return;
|
|
2941
3014
|
}
|
|
@@ -2969,7 +3042,7 @@ function useFloating(options) {
|
|
|
2969
3042
|
}));
|
|
2970
3043
|
}
|
|
2971
3044
|
}, [open]);
|
|
2972
|
-
const isMountedRef =
|
|
3045
|
+
const isMountedRef = React19.useRef(false);
|
|
2973
3046
|
index(() => {
|
|
2974
3047
|
isMountedRef.current = true;
|
|
2975
3048
|
return () => {
|
|
@@ -2988,17 +3061,17 @@ function useFloating(options) {
|
|
|
2988
3061
|
update();
|
|
2989
3062
|
}
|
|
2990
3063
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
2991
|
-
const refs =
|
|
3064
|
+
const refs = React19.useMemo(() => ({
|
|
2992
3065
|
reference: referenceRef,
|
|
2993
3066
|
floating: floatingRef,
|
|
2994
3067
|
setReference,
|
|
2995
3068
|
setFloating
|
|
2996
3069
|
}), [setReference, setFloating]);
|
|
2997
|
-
const elements =
|
|
3070
|
+
const elements = React19.useMemo(() => ({
|
|
2998
3071
|
reference: referenceEl,
|
|
2999
3072
|
floating: floatingEl
|
|
3000
3073
|
}), [referenceEl, floatingEl]);
|
|
3001
|
-
const floatingStyles =
|
|
3074
|
+
const floatingStyles = React19.useMemo(() => {
|
|
3002
3075
|
const initialStyles = {
|
|
3003
3076
|
position: strategy,
|
|
3004
3077
|
left: 0,
|
|
@@ -3024,7 +3097,7 @@ function useFloating(options) {
|
|
|
3024
3097
|
top: y
|
|
3025
3098
|
};
|
|
3026
3099
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
3027
|
-
return
|
|
3100
|
+
return React19.useMemo(() => ({
|
|
3028
3101
|
...data,
|
|
3029
3102
|
update,
|
|
3030
3103
|
refs,
|
|
@@ -3093,28 +3166,28 @@ var arrow3 = (options, deps) => ({
|
|
|
3093
3166
|
});
|
|
3094
3167
|
|
|
3095
3168
|
// ../../node_modules/.bun/@radix-ui+react-arrow@1.1.0+676b3d28333f5d10/node_modules/@radix-ui/react-arrow/dist/index.mjs
|
|
3096
|
-
import * as
|
|
3097
|
-
import { jsx as
|
|
3169
|
+
import * as React20 from "react";
|
|
3170
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
3098
3171
|
var NAME = "Arrow";
|
|
3099
|
-
var Arrow =
|
|
3172
|
+
var Arrow = React20.forwardRef((props, forwardedRef) => {
|
|
3100
3173
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
3101
|
-
return /* @__PURE__ */
|
|
3174
|
+
return /* @__PURE__ */ jsx17(Primitive.svg, {
|
|
3102
3175
|
...arrowProps,
|
|
3103
3176
|
ref: forwardedRef,
|
|
3104
3177
|
width,
|
|
3105
3178
|
height,
|
|
3106
3179
|
viewBox: "0 0 30 10",
|
|
3107
3180
|
preserveAspectRatio: "none",
|
|
3108
|
-
children: props.asChild ? children : /* @__PURE__ */
|
|
3181
|
+
children: props.asChild ? children : /* @__PURE__ */ jsx17("polygon", { points: "0,0 30,0 15,10" })
|
|
3109
3182
|
});
|
|
3110
3183
|
});
|
|
3111
3184
|
Arrow.displayName = NAME;
|
|
3112
3185
|
var Root = Arrow;
|
|
3113
3186
|
|
|
3114
3187
|
// ../../node_modules/.bun/@radix-ui+react-use-size@1.1.0+143250c3c32ebfa0/node_modules/@radix-ui/react-use-size/dist/index.mjs
|
|
3115
|
-
import * as
|
|
3188
|
+
import * as React21 from "react";
|
|
3116
3189
|
function useSize(element) {
|
|
3117
|
-
const [size4, setSize] =
|
|
3190
|
+
const [size4, setSize] = React21.useState(undefined);
|
|
3118
3191
|
useLayoutEffect2(() => {
|
|
3119
3192
|
if (element) {
|
|
3120
3193
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
@@ -3149,32 +3222,32 @@ function useSize(element) {
|
|
|
3149
3222
|
}
|
|
3150
3223
|
|
|
3151
3224
|
// ../../node_modules/.bun/@radix-ui+react-popper@1.2.0+676b3d28333f5d10/node_modules/@radix-ui/react-popper/dist/index.mjs
|
|
3152
|
-
import { jsx as
|
|
3225
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
3153
3226
|
"use client";
|
|
3154
3227
|
var POPPER_NAME = "Popper";
|
|
3155
3228
|
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
3156
3229
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
3157
3230
|
var Popper = (props) => {
|
|
3158
3231
|
const { __scopePopper, children } = props;
|
|
3159
|
-
const [anchor, setAnchor] =
|
|
3160
|
-
return /* @__PURE__ */
|
|
3232
|
+
const [anchor, setAnchor] = React22.useState(null);
|
|
3233
|
+
return /* @__PURE__ */ jsx18(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
3161
3234
|
};
|
|
3162
3235
|
Popper.displayName = POPPER_NAME;
|
|
3163
3236
|
var ANCHOR_NAME = "PopperAnchor";
|
|
3164
|
-
var PopperAnchor =
|
|
3237
|
+
var PopperAnchor = React22.forwardRef((props, forwardedRef) => {
|
|
3165
3238
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
3166
3239
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
3167
|
-
const ref =
|
|
3240
|
+
const ref = React22.useRef(null);
|
|
3168
3241
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
3169
|
-
|
|
3242
|
+
React22.useEffect(() => {
|
|
3170
3243
|
context.onAnchorChange(virtualRef?.current || ref.current);
|
|
3171
3244
|
});
|
|
3172
|
-
return virtualRef ? null : /* @__PURE__ */
|
|
3245
|
+
return virtualRef ? null : /* @__PURE__ */ jsx18(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
3173
3246
|
});
|
|
3174
3247
|
PopperAnchor.displayName = ANCHOR_NAME;
|
|
3175
3248
|
var CONTENT_NAME = "PopperContent";
|
|
3176
3249
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
|
3177
|
-
var PopperContent =
|
|
3250
|
+
var PopperContent = React22.forwardRef((props, forwardedRef) => {
|
|
3178
3251
|
const {
|
|
3179
3252
|
__scopePopper,
|
|
3180
3253
|
side = "bottom",
|
|
@@ -3192,9 +3265,9 @@ var PopperContent = React20.forwardRef((props, forwardedRef) => {
|
|
|
3192
3265
|
...contentProps
|
|
3193
3266
|
} = props;
|
|
3194
3267
|
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
|
3195
|
-
const [content, setContent] =
|
|
3268
|
+
const [content, setContent] = React22.useState(null);
|
|
3196
3269
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
3197
|
-
const [arrow4, setArrow] =
|
|
3270
|
+
const [arrow4, setArrow] = React22.useState(null);
|
|
3198
3271
|
const arrowSize = useSize(arrow4);
|
|
3199
3272
|
const arrowWidth = arrowSize?.width ?? 0;
|
|
3200
3273
|
const arrowHeight = arrowSize?.height ?? 0;
|
|
@@ -3254,12 +3327,12 @@ var PopperContent = React20.forwardRef((props, forwardedRef) => {
|
|
|
3254
3327
|
const arrowX = middlewareData.arrow?.x;
|
|
3255
3328
|
const arrowY = middlewareData.arrow?.y;
|
|
3256
3329
|
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
3257
|
-
const [contentZIndex, setContentZIndex] =
|
|
3330
|
+
const [contentZIndex, setContentZIndex] = React22.useState();
|
|
3258
3331
|
useLayoutEffect2(() => {
|
|
3259
3332
|
if (content)
|
|
3260
3333
|
setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
3261
3334
|
}, [content]);
|
|
3262
|
-
return /* @__PURE__ */
|
|
3335
|
+
return /* @__PURE__ */ jsx18("div", {
|
|
3263
3336
|
ref: refs.setFloating,
|
|
3264
3337
|
"data-radix-popper-content-wrapper": "",
|
|
3265
3338
|
style: {
|
|
@@ -3277,14 +3350,14 @@ var PopperContent = React20.forwardRef((props, forwardedRef) => {
|
|
|
3277
3350
|
}
|
|
3278
3351
|
},
|
|
3279
3352
|
dir: props.dir,
|
|
3280
|
-
children: /* @__PURE__ */
|
|
3353
|
+
children: /* @__PURE__ */ jsx18(PopperContentProvider, {
|
|
3281
3354
|
scope: __scopePopper,
|
|
3282
3355
|
placedSide,
|
|
3283
3356
|
onArrowChange: setArrow,
|
|
3284
3357
|
arrowX,
|
|
3285
3358
|
arrowY,
|
|
3286
3359
|
shouldHideArrow: cannotCenterArrow,
|
|
3287
|
-
children: /* @__PURE__ */
|
|
3360
|
+
children: /* @__PURE__ */ jsx18(Primitive.div, {
|
|
3288
3361
|
"data-side": placedSide,
|
|
3289
3362
|
"data-align": placedAlign,
|
|
3290
3363
|
...contentProps,
|
|
@@ -3305,11 +3378,11 @@ var OPPOSITE_SIDE = {
|
|
|
3305
3378
|
bottom: "top",
|
|
3306
3379
|
left: "right"
|
|
3307
3380
|
};
|
|
3308
|
-
var PopperArrow =
|
|
3381
|
+
var PopperArrow = React22.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
3309
3382
|
const { __scopePopper, ...arrowProps } = props;
|
|
3310
3383
|
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
3311
3384
|
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
3312
|
-
return /* @__PURE__ */
|
|
3385
|
+
return /* @__PURE__ */ jsx18("span", {
|
|
3313
3386
|
ref: contentContext.onArrowChange,
|
|
3314
3387
|
style: {
|
|
3315
3388
|
position: "absolute",
|
|
@@ -3330,7 +3403,7 @@ var PopperArrow = React20.forwardRef(function PopperArrow2(props, forwardedRef)
|
|
|
3330
3403
|
}[contentContext.placedSide],
|
|
3331
3404
|
visibility: contentContext.shouldHideArrow ? "hidden" : undefined
|
|
3332
3405
|
},
|
|
3333
|
-
children: /* @__PURE__ */
|
|
3406
|
+
children: /* @__PURE__ */ jsx18(Root, {
|
|
3334
3407
|
...arrowProps,
|
|
3335
3408
|
ref: forwardedRef,
|
|
3336
3409
|
style: {
|
|
@@ -3385,22 +3458,22 @@ var Content = PopperContent;
|
|
|
3385
3458
|
var Arrow2 = PopperArrow;
|
|
3386
3459
|
|
|
3387
3460
|
// ../../node_modules/.bun/@radix-ui+react-portal@1.1.1+676b3d28333f5d10/node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
3388
|
-
import * as
|
|
3461
|
+
import * as React23 from "react";
|
|
3389
3462
|
import ReactDOM3 from "react-dom";
|
|
3390
|
-
import { jsx as
|
|
3463
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
3391
3464
|
"use client";
|
|
3392
3465
|
var PORTAL_NAME = "Portal";
|
|
3393
|
-
var Portal =
|
|
3466
|
+
var Portal = React23.forwardRef((props, forwardedRef) => {
|
|
3394
3467
|
const { container: containerProp, ...portalProps } = props;
|
|
3395
|
-
const [mounted, setMounted] =
|
|
3468
|
+
const [mounted, setMounted] = React23.useState(false);
|
|
3396
3469
|
useLayoutEffect2(() => setMounted(true), []);
|
|
3397
3470
|
const container2 = containerProp || mounted && globalThis?.document?.body;
|
|
3398
|
-
return container2 ? ReactDOM3.createPortal(/* @__PURE__ */
|
|
3471
|
+
return container2 ? ReactDOM3.createPortal(/* @__PURE__ */ jsx19(Primitive.div, { ...portalProps, ref: forwardedRef }), container2) : null;
|
|
3399
3472
|
});
|
|
3400
3473
|
Portal.displayName = PORTAL_NAME;
|
|
3401
3474
|
|
|
3402
3475
|
// ../../node_modules/.bun/@radix-ui+react-use-controllable-state@1.1.0+143250c3c32ebfa0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
3403
|
-
import * as
|
|
3476
|
+
import * as React24 from "react";
|
|
3404
3477
|
function useControllableState({
|
|
3405
3478
|
prop,
|
|
3406
3479
|
defaultProp,
|
|
@@ -3410,7 +3483,7 @@ function useControllableState({
|
|
|
3410
3483
|
const isControlled = prop !== undefined;
|
|
3411
3484
|
const value = isControlled ? prop : uncontrolledProp;
|
|
3412
3485
|
const handleChange = useCallbackRef(onChange);
|
|
3413
|
-
const setValue =
|
|
3486
|
+
const setValue = React24.useCallback((nextValue) => {
|
|
3414
3487
|
if (isControlled) {
|
|
3415
3488
|
const setter = nextValue;
|
|
3416
3489
|
const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
|
|
@@ -3426,11 +3499,11 @@ function useUncontrolledState({
|
|
|
3426
3499
|
defaultProp,
|
|
3427
3500
|
onChange
|
|
3428
3501
|
}) {
|
|
3429
|
-
const uncontrolledState =
|
|
3502
|
+
const uncontrolledState = React24.useState(defaultProp);
|
|
3430
3503
|
const [value] = uncontrolledState;
|
|
3431
|
-
const prevValueRef =
|
|
3504
|
+
const prevValueRef = React24.useRef(value);
|
|
3432
3505
|
const handleChange = useCallbackRef(onChange);
|
|
3433
|
-
|
|
3506
|
+
React24.useEffect(() => {
|
|
3434
3507
|
if (prevValueRef.current !== value) {
|
|
3435
3508
|
handleChange(value);
|
|
3436
3509
|
prevValueRef.current = value;
|
|
@@ -3440,10 +3513,10 @@ function useUncontrolledState({
|
|
|
3440
3513
|
}
|
|
3441
3514
|
|
|
3442
3515
|
// ../../node_modules/.bun/@radix-ui+react-use-previous@1.1.0+143250c3c32ebfa0/node_modules/@radix-ui/react-use-previous/dist/index.mjs
|
|
3443
|
-
import * as
|
|
3516
|
+
import * as React25 from "react";
|
|
3444
3517
|
function usePrevious(value) {
|
|
3445
|
-
const ref =
|
|
3446
|
-
return
|
|
3518
|
+
const ref = React25.useRef({ value, previous: value });
|
|
3519
|
+
return React25.useMemo(() => {
|
|
3447
3520
|
if (ref.current.value !== value) {
|
|
3448
3521
|
ref.current.previous = ref.current.value;
|
|
3449
3522
|
ref.current.value = value;
|
|
@@ -3453,11 +3526,11 @@ function usePrevious(value) {
|
|
|
3453
3526
|
}
|
|
3454
3527
|
|
|
3455
3528
|
// ../../node_modules/.bun/@radix-ui+react-visually-hidden@1.1.0+676b3d28333f5d10/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
|
|
3456
|
-
import * as
|
|
3457
|
-
import { jsx as
|
|
3529
|
+
import * as React26 from "react";
|
|
3530
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
3458
3531
|
var NAME2 = "VisuallyHidden";
|
|
3459
|
-
var VisuallyHidden =
|
|
3460
|
-
return /* @__PURE__ */
|
|
3532
|
+
var VisuallyHidden = React26.forwardRef((props, forwardedRef) => {
|
|
3533
|
+
return /* @__PURE__ */ jsx20(Primitive.span, {
|
|
3461
3534
|
...props,
|
|
3462
3535
|
ref: forwardedRef,
|
|
3463
3536
|
style: {
|
|
@@ -3636,10 +3709,10 @@ function __spreadArray(to, from, pack) {
|
|
|
3636
3709
|
}
|
|
3637
3710
|
|
|
3638
3711
|
// ../../node_modules/.bun/react-remove-scroll@2.5.7+143250c3c32ebfa0/node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
3639
|
-
import * as
|
|
3712
|
+
import * as React33 from "react";
|
|
3640
3713
|
|
|
3641
3714
|
// ../../node_modules/.bun/react-remove-scroll@2.5.7+143250c3c32ebfa0/node_modules/react-remove-scroll/dist/es2015/UI.js
|
|
3642
|
-
import * as
|
|
3715
|
+
import * as React29 from "react";
|
|
3643
3716
|
|
|
3644
3717
|
// ../../node_modules/.bun/react-remove-scroll-bar@2.3.8+143250c3c32ebfa0/node_modules/react-remove-scroll-bar/dist/es2015/constants.js
|
|
3645
3718
|
var zeroRightClassName = "right-scroll-bar-position";
|
|
@@ -3683,8 +3756,8 @@ function useCallbackRef2(initialValue, callback) {
|
|
|
3683
3756
|
}
|
|
3684
3757
|
|
|
3685
3758
|
// ../../node_modules/.bun/use-callback-ref@1.3.3+143250c3c32ebfa0/node_modules/use-callback-ref/dist/es2015/useMergeRef.js
|
|
3686
|
-
import * as
|
|
3687
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
3759
|
+
import * as React27 from "react";
|
|
3760
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React27.useLayoutEffect : React27.useEffect;
|
|
3688
3761
|
var currentValues = new WeakMap;
|
|
3689
3762
|
function useMergeRefs(refs, defaultValue) {
|
|
3690
3763
|
var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
|
|
@@ -3799,7 +3872,7 @@ function createSidecarMedium(options) {
|
|
|
3799
3872
|
return medium;
|
|
3800
3873
|
}
|
|
3801
3874
|
// ../../node_modules/.bun/use-sidecar@1.1.3+143250c3c32ebfa0/node_modules/use-sidecar/dist/es2015/exports.js
|
|
3802
|
-
import * as
|
|
3875
|
+
import * as React28 from "react";
|
|
3803
3876
|
var SideCar = function(_a) {
|
|
3804
3877
|
var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
|
|
3805
3878
|
if (!sideCar) {
|
|
@@ -3809,7 +3882,7 @@ var SideCar = function(_a) {
|
|
|
3809
3882
|
if (!Target) {
|
|
3810
3883
|
throw new Error("Sidecar medium not found");
|
|
3811
3884
|
}
|
|
3812
|
-
return
|
|
3885
|
+
return React28.createElement(Target, __assign({}, rest));
|
|
3813
3886
|
};
|
|
3814
3887
|
SideCar.isSideCarExport = true;
|
|
3815
3888
|
function exportSidecar(medium, exported) {
|
|
@@ -3823,9 +3896,9 @@ var effectCar = createSidecarMedium();
|
|
|
3823
3896
|
var nothing = function() {
|
|
3824
3897
|
return;
|
|
3825
3898
|
};
|
|
3826
|
-
var RemoveScroll =
|
|
3827
|
-
var ref =
|
|
3828
|
-
var _a =
|
|
3899
|
+
var RemoveScroll = React29.forwardRef(function(props, parentRef) {
|
|
3900
|
+
var ref = React29.useRef(null);
|
|
3901
|
+
var _a = React29.useState({
|
|
3829
3902
|
onScrollCapture: nothing,
|
|
3830
3903
|
onWheelCapture: nothing,
|
|
3831
3904
|
onTouchMoveCapture: nothing
|
|
@@ -3834,7 +3907,7 @@ var RemoveScroll = React27.forwardRef(function(props, parentRef) {
|
|
|
3834
3907
|
var SideCar2 = sideCar;
|
|
3835
3908
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
3836
3909
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
3837
|
-
return
|
|
3910
|
+
return React29.createElement(React29.Fragment, null, enabled && React29.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }), forwardProps ? React29.cloneElement(React29.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React29.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children));
|
|
3838
3911
|
});
|
|
3839
3912
|
RemoveScroll.defaultProps = {
|
|
3840
3913
|
enabled: true,
|
|
@@ -3847,13 +3920,13 @@ RemoveScroll.classNames = {
|
|
|
3847
3920
|
};
|
|
3848
3921
|
|
|
3849
3922
|
// ../../node_modules/.bun/react-remove-scroll@2.5.7+143250c3c32ebfa0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
|
|
3850
|
-
import * as
|
|
3923
|
+
import * as React32 from "react";
|
|
3851
3924
|
|
|
3852
3925
|
// ../../node_modules/.bun/react-remove-scroll-bar@2.3.8+143250c3c32ebfa0/node_modules/react-remove-scroll-bar/dist/es2015/component.js
|
|
3853
|
-
import * as
|
|
3926
|
+
import * as React31 from "react";
|
|
3854
3927
|
|
|
3855
3928
|
// ../../node_modules/.bun/react-style-singleton@2.2.3+143250c3c32ebfa0/node_modules/react-style-singleton/dist/es2015/hook.js
|
|
3856
|
-
import * as
|
|
3929
|
+
import * as React30 from "react";
|
|
3857
3930
|
|
|
3858
3931
|
// ../../node_modules/.bun/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js
|
|
3859
3932
|
var currentNonce;
|
|
@@ -3917,7 +3990,7 @@ var stylesheetSingleton = function() {
|
|
|
3917
3990
|
var styleHookSingleton = function() {
|
|
3918
3991
|
var sheet = stylesheetSingleton();
|
|
3919
3992
|
return function(styles, isDynamic) {
|
|
3920
|
-
|
|
3993
|
+
React30.useEffect(function() {
|
|
3921
3994
|
sheet.add(styles);
|
|
3922
3995
|
return function() {
|
|
3923
3996
|
sheet.remove();
|
|
@@ -4027,7 +4100,7 @@ var getCurrentUseCounter = function() {
|
|
|
4027
4100
|
return isFinite(counter) ? counter : 0;
|
|
4028
4101
|
};
|
|
4029
4102
|
var useLockAttribute = function() {
|
|
4030
|
-
|
|
4103
|
+
React31.useEffect(function() {
|
|
4031
4104
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
4032
4105
|
return function() {
|
|
4033
4106
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -4042,10 +4115,10 @@ var useLockAttribute = function() {
|
|
|
4042
4115
|
var RemoveScrollBar = function(_a) {
|
|
4043
4116
|
var { noRelative, noImportant, gapMode: _b } = _a, gapMode = _b === undefined ? "margin" : _b;
|
|
4044
4117
|
useLockAttribute();
|
|
4045
|
-
var gap =
|
|
4118
|
+
var gap = React31.useMemo(function() {
|
|
4046
4119
|
return getGapWidth(gapMode);
|
|
4047
4120
|
}, [gapMode]);
|
|
4048
|
-
return
|
|
4121
|
+
return React31.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
4049
4122
|
};
|
|
4050
4123
|
|
|
4051
4124
|
// ../../node_modules/.bun/react-remove-scroll@2.5.7+143250c3c32ebfa0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
|
|
@@ -4178,16 +4251,16 @@ var generateStyle = function(id) {
|
|
|
4178
4251
|
var idCounter = 0;
|
|
4179
4252
|
var lockStack = [];
|
|
4180
4253
|
function RemoveScrollSideCar(props) {
|
|
4181
|
-
var shouldPreventQueue =
|
|
4182
|
-
var touchStartRef =
|
|
4183
|
-
var activeAxis =
|
|
4184
|
-
var id =
|
|
4185
|
-
var Style2 =
|
|
4186
|
-
var lastProps =
|
|
4187
|
-
|
|
4254
|
+
var shouldPreventQueue = React32.useRef([]);
|
|
4255
|
+
var touchStartRef = React32.useRef([0, 0]);
|
|
4256
|
+
var activeAxis = React32.useRef();
|
|
4257
|
+
var id = React32.useState(idCounter++)[0];
|
|
4258
|
+
var Style2 = React32.useState(styleSingleton)[0];
|
|
4259
|
+
var lastProps = React32.useRef(props);
|
|
4260
|
+
React32.useEffect(function() {
|
|
4188
4261
|
lastProps.current = props;
|
|
4189
4262
|
}, [props]);
|
|
4190
|
-
|
|
4263
|
+
React32.useEffect(function() {
|
|
4191
4264
|
if (props.inert) {
|
|
4192
4265
|
document.body.classList.add("block-interactivity-".concat(id));
|
|
4193
4266
|
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
@@ -4203,7 +4276,7 @@ function RemoveScrollSideCar(props) {
|
|
|
4203
4276
|
}
|
|
4204
4277
|
return;
|
|
4205
4278
|
}, [props.inert, props.lockRef.current, props.shards]);
|
|
4206
|
-
var shouldCancelEvent =
|
|
4279
|
+
var shouldCancelEvent = React32.useCallback(function(event, parent) {
|
|
4207
4280
|
if ("touches" in event && event.touches.length === 2) {
|
|
4208
4281
|
return !lastProps.current.allowPinchZoom;
|
|
4209
4282
|
}
|
|
@@ -4239,7 +4312,7 @@ function RemoveScrollSideCar(props) {
|
|
|
4239
4312
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
4240
4313
|
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
|
|
4241
4314
|
}, []);
|
|
4242
|
-
var shouldPrevent =
|
|
4315
|
+
var shouldPrevent = React32.useCallback(function(_event) {
|
|
4243
4316
|
var event = _event;
|
|
4244
4317
|
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
4245
4318
|
return;
|
|
@@ -4266,7 +4339,7 @@ function RemoveScrollSideCar(props) {
|
|
|
4266
4339
|
}
|
|
4267
4340
|
}
|
|
4268
4341
|
}, []);
|
|
4269
|
-
var shouldCancel =
|
|
4342
|
+
var shouldCancel = React32.useCallback(function(name, delta, target, should) {
|
|
4270
4343
|
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
4271
4344
|
shouldPreventQueue.current.push(event);
|
|
4272
4345
|
setTimeout(function() {
|
|
@@ -4275,17 +4348,17 @@ function RemoveScrollSideCar(props) {
|
|
|
4275
4348
|
});
|
|
4276
4349
|
}, 1);
|
|
4277
4350
|
}, []);
|
|
4278
|
-
var scrollTouchStart =
|
|
4351
|
+
var scrollTouchStart = React32.useCallback(function(event) {
|
|
4279
4352
|
touchStartRef.current = getTouchXY(event);
|
|
4280
4353
|
activeAxis.current = undefined;
|
|
4281
4354
|
}, []);
|
|
4282
|
-
var scrollWheel =
|
|
4355
|
+
var scrollWheel = React32.useCallback(function(event) {
|
|
4283
4356
|
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
4284
4357
|
}, []);
|
|
4285
|
-
var scrollTouchMove =
|
|
4358
|
+
var scrollTouchMove = React32.useCallback(function(event) {
|
|
4286
4359
|
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
4287
4360
|
}, []);
|
|
4288
|
-
|
|
4361
|
+
React32.useEffect(function() {
|
|
4289
4362
|
lockStack.push(Style2);
|
|
4290
4363
|
props.setCallbacks({
|
|
4291
4364
|
onScrollCapture: scrollWheel,
|
|
@@ -4305,7 +4378,7 @@ function RemoveScrollSideCar(props) {
|
|
|
4305
4378
|
};
|
|
4306
4379
|
}, []);
|
|
4307
4380
|
var { removeScrollBar, inert } = props;
|
|
4308
|
-
return
|
|
4381
|
+
return React32.createElement(React32.Fragment, null, inert ? React32.createElement(Style2, { styles: generateStyle(id) }) : null, removeScrollBar ? React32.createElement(RemoveScrollBar, { gapMode: props.gapMode }) : null);
|
|
4309
4382
|
}
|
|
4310
4383
|
function getOutermostShadowParent(node) {
|
|
4311
4384
|
var shadowParent = null;
|
|
@@ -4323,14 +4396,14 @@ function getOutermostShadowParent(node) {
|
|
|
4323
4396
|
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
4324
4397
|
|
|
4325
4398
|
// ../../node_modules/.bun/react-remove-scroll@2.5.7+143250c3c32ebfa0/node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
4326
|
-
var ReactRemoveScroll =
|
|
4327
|
-
return
|
|
4399
|
+
var ReactRemoveScroll = React33.forwardRef(function(props, ref) {
|
|
4400
|
+
return React33.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
|
|
4328
4401
|
});
|
|
4329
4402
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
4330
4403
|
var Combination_default = ReactRemoveScroll;
|
|
4331
4404
|
|
|
4332
4405
|
// ../../node_modules/.bun/@radix-ui+react-select@2.1.1+676b3d28333f5d10/node_modules/@radix-ui/react-select/dist/index.mjs
|
|
4333
|
-
import { Fragment as Fragment5, jsx as
|
|
4406
|
+
import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
4334
4407
|
"use client";
|
|
4335
4408
|
var OPEN_KEYS = [" ", "Enter", "ArrowUp", "ArrowDown"];
|
|
4336
4409
|
var SELECTION_KEYS = [" ", "Enter"];
|
|
@@ -4360,9 +4433,9 @@ var Select = (props) => {
|
|
|
4360
4433
|
required
|
|
4361
4434
|
} = props;
|
|
4362
4435
|
const popperScope = usePopperScope(__scopeSelect);
|
|
4363
|
-
const [trigger, setTrigger] =
|
|
4364
|
-
const [valueNode, setValueNode] =
|
|
4365
|
-
const [valueNodeHasChildren, setValueNodeHasChildren] =
|
|
4436
|
+
const [trigger, setTrigger] = React34.useState(null);
|
|
4437
|
+
const [valueNode, setValueNode] = React34.useState(null);
|
|
4438
|
+
const [valueNodeHasChildren, setValueNodeHasChildren] = React34.useState(false);
|
|
4366
4439
|
const direction = useDirection(dir);
|
|
4367
4440
|
const [open = false, setOpen] = useControllableState({
|
|
4368
4441
|
prop: openProp,
|
|
@@ -4374,11 +4447,11 @@ var Select = (props) => {
|
|
|
4374
4447
|
defaultProp: defaultValue,
|
|
4375
4448
|
onChange: onValueChange
|
|
4376
4449
|
});
|
|
4377
|
-
const triggerPointerDownPosRef =
|
|
4450
|
+
const triggerPointerDownPosRef = React34.useRef(null);
|
|
4378
4451
|
const isFormControl = trigger ? Boolean(trigger.closest("form")) : true;
|
|
4379
|
-
const [nativeOptionsSet, setNativeOptionsSet] =
|
|
4452
|
+
const [nativeOptionsSet, setNativeOptionsSet] = React34.useState(/* @__PURE__ */ new Set);
|
|
4380
4453
|
const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";");
|
|
4381
|
-
return /* @__PURE__ */
|
|
4454
|
+
return /* @__PURE__ */ jsx21(Root2, { ...popperScope, children: /* @__PURE__ */ jsxs4(SelectProvider, {
|
|
4382
4455
|
required,
|
|
4383
4456
|
scope: __scopeSelect,
|
|
4384
4457
|
trigger,
|
|
@@ -4396,12 +4469,12 @@ var Select = (props) => {
|
|
|
4396
4469
|
triggerPointerDownPosRef,
|
|
4397
4470
|
disabled,
|
|
4398
4471
|
children: [
|
|
4399
|
-
/* @__PURE__ */
|
|
4472
|
+
/* @__PURE__ */ jsx21(Collection.Provider, { scope: __scopeSelect, children: /* @__PURE__ */ jsx21(SelectNativeOptionsProvider, {
|
|
4400
4473
|
scope: props.__scopeSelect,
|
|
4401
|
-
onNativeOptionAdd:
|
|
4474
|
+
onNativeOptionAdd: React34.useCallback((option) => {
|
|
4402
4475
|
setNativeOptionsSet((prev) => new Set(prev).add(option));
|
|
4403
4476
|
}, []),
|
|
4404
|
-
onNativeOptionRemove:
|
|
4477
|
+
onNativeOptionRemove: React34.useCallback((option) => {
|
|
4405
4478
|
setNativeOptionsSet((prev) => {
|
|
4406
4479
|
const optionsSet = new Set(prev);
|
|
4407
4480
|
optionsSet.delete(option);
|
|
@@ -4410,7 +4483,7 @@ var Select = (props) => {
|
|
|
4410
4483
|
}, []),
|
|
4411
4484
|
children
|
|
4412
4485
|
}) }),
|
|
4413
|
-
isFormControl ? /* @__PURE__ */
|
|
4486
|
+
isFormControl ? /* @__PURE__ */ jsxs4(BubbleSelect, {
|
|
4414
4487
|
"aria-hidden": true,
|
|
4415
4488
|
required,
|
|
4416
4489
|
tabIndex: -1,
|
|
@@ -4420,7 +4493,7 @@ var Select = (props) => {
|
|
|
4420
4493
|
onChange: (event) => setValue(event.target.value),
|
|
4421
4494
|
disabled,
|
|
4422
4495
|
children: [
|
|
4423
|
-
value === undefined ? /* @__PURE__ */
|
|
4496
|
+
value === undefined ? /* @__PURE__ */ jsx21("option", { value: "" }) : null,
|
|
4424
4497
|
Array.from(nativeOptionsSet)
|
|
4425
4498
|
]
|
|
4426
4499
|
}, nativeSelectKey) : null
|
|
@@ -4429,7 +4502,7 @@ var Select = (props) => {
|
|
|
4429
4502
|
};
|
|
4430
4503
|
Select.displayName = SELECT_NAME;
|
|
4431
4504
|
var TRIGGER_NAME = "SelectTrigger";
|
|
4432
|
-
var SelectTrigger =
|
|
4505
|
+
var SelectTrigger = React34.forwardRef((props, forwardedRef) => {
|
|
4433
4506
|
const { __scopeSelect, disabled = false, ...triggerProps } = props;
|
|
4434
4507
|
const popperScope = usePopperScope(__scopeSelect);
|
|
4435
4508
|
const context = useSelectContext(TRIGGER_NAME, __scopeSelect);
|
|
@@ -4450,7 +4523,7 @@ var SelectTrigger = React32.forwardRef((props, forwardedRef) => {
|
|
|
4450
4523
|
resetTypeahead();
|
|
4451
4524
|
}
|
|
4452
4525
|
};
|
|
4453
|
-
return /* @__PURE__ */
|
|
4526
|
+
return /* @__PURE__ */ jsx21(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx21(Primitive.button, {
|
|
4454
4527
|
type: "button",
|
|
4455
4528
|
role: "combobox",
|
|
4456
4529
|
"aria-controls": context.contentId,
|
|
@@ -4497,7 +4570,7 @@ var SelectTrigger = React32.forwardRef((props, forwardedRef) => {
|
|
|
4497
4570
|
});
|
|
4498
4571
|
SelectTrigger.displayName = TRIGGER_NAME;
|
|
4499
4572
|
var VALUE_NAME = "SelectValue";
|
|
4500
|
-
var SelectValue =
|
|
4573
|
+
var SelectValue = React34.forwardRef((props, forwardedRef) => {
|
|
4501
4574
|
const { __scopeSelect, className, style, children, placeholder = "", ...valueProps } = props;
|
|
4502
4575
|
const context = useSelectContext(VALUE_NAME, __scopeSelect);
|
|
4503
4576
|
const { onValueNodeHasChildrenChange } = context;
|
|
@@ -4506,43 +4579,43 @@ var SelectValue = React32.forwardRef((props, forwardedRef) => {
|
|
|
4506
4579
|
useLayoutEffect2(() => {
|
|
4507
4580
|
onValueNodeHasChildrenChange(hasChildren);
|
|
4508
4581
|
}, [onValueNodeHasChildrenChange, hasChildren]);
|
|
4509
|
-
return /* @__PURE__ */
|
|
4582
|
+
return /* @__PURE__ */ jsx21(Primitive.span, {
|
|
4510
4583
|
...valueProps,
|
|
4511
4584
|
ref: composedRefs,
|
|
4512
4585
|
style: { pointerEvents: "none" },
|
|
4513
|
-
children: shouldShowPlaceholder(context.value) ? /* @__PURE__ */
|
|
4586
|
+
children: shouldShowPlaceholder(context.value) ? /* @__PURE__ */ jsx21(Fragment5, { children: placeholder }) : children
|
|
4514
4587
|
});
|
|
4515
4588
|
});
|
|
4516
4589
|
SelectValue.displayName = VALUE_NAME;
|
|
4517
4590
|
var ICON_NAME = "SelectIcon";
|
|
4518
|
-
var SelectIcon =
|
|
4591
|
+
var SelectIcon = React34.forwardRef((props, forwardedRef) => {
|
|
4519
4592
|
const { __scopeSelect, children, ...iconProps } = props;
|
|
4520
|
-
return /* @__PURE__ */
|
|
4593
|
+
return /* @__PURE__ */ jsx21(Primitive.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "▼" });
|
|
4521
4594
|
});
|
|
4522
4595
|
SelectIcon.displayName = ICON_NAME;
|
|
4523
4596
|
var PORTAL_NAME2 = "SelectPortal";
|
|
4524
4597
|
var SelectPortal = (props) => {
|
|
4525
|
-
return /* @__PURE__ */
|
|
4598
|
+
return /* @__PURE__ */ jsx21(Portal, { asChild: true, ...props });
|
|
4526
4599
|
};
|
|
4527
4600
|
SelectPortal.displayName = PORTAL_NAME2;
|
|
4528
4601
|
var CONTENT_NAME2 = "SelectContent";
|
|
4529
|
-
var SelectContent =
|
|
4602
|
+
var SelectContent = React34.forwardRef((props, forwardedRef) => {
|
|
4530
4603
|
const context = useSelectContext(CONTENT_NAME2, props.__scopeSelect);
|
|
4531
|
-
const [fragment, setFragment] =
|
|
4604
|
+
const [fragment, setFragment] = React34.useState();
|
|
4532
4605
|
useLayoutEffect2(() => {
|
|
4533
4606
|
setFragment(new DocumentFragment);
|
|
4534
4607
|
}, []);
|
|
4535
4608
|
if (!context.open) {
|
|
4536
4609
|
const frag = fragment;
|
|
4537
|
-
return frag ? ReactDOM4.createPortal(/* @__PURE__ */
|
|
4610
|
+
return frag ? ReactDOM4.createPortal(/* @__PURE__ */ jsx21(SelectContentProvider, { scope: props.__scopeSelect, children: /* @__PURE__ */ jsx21(Collection.Slot, { scope: props.__scopeSelect, children: /* @__PURE__ */ jsx21("div", { children: props.children }) }) }), frag) : null;
|
|
4538
4611
|
}
|
|
4539
|
-
return /* @__PURE__ */
|
|
4612
|
+
return /* @__PURE__ */ jsx21(SelectContentImpl, { ...props, ref: forwardedRef });
|
|
4540
4613
|
});
|
|
4541
4614
|
SelectContent.displayName = CONTENT_NAME2;
|
|
4542
4615
|
var CONTENT_MARGIN = 10;
|
|
4543
4616
|
var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME2);
|
|
4544
4617
|
var CONTENT_IMPL_NAME = "SelectContentImpl";
|
|
4545
|
-
var SelectContentImpl =
|
|
4618
|
+
var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
|
|
4546
4619
|
const {
|
|
4547
4620
|
__scopeSelect,
|
|
4548
4621
|
position = "item-aligned",
|
|
@@ -4562,20 +4635,20 @@ var SelectContentImpl = React32.forwardRef((props, forwardedRef) => {
|
|
|
4562
4635
|
...contentProps
|
|
4563
4636
|
} = props;
|
|
4564
4637
|
const context = useSelectContext(CONTENT_NAME2, __scopeSelect);
|
|
4565
|
-
const [content, setContent] =
|
|
4566
|
-
const [viewport, setViewport] =
|
|
4638
|
+
const [content, setContent] = React34.useState(null);
|
|
4639
|
+
const [viewport, setViewport] = React34.useState(null);
|
|
4567
4640
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
4568
|
-
const [selectedItem, setSelectedItem] =
|
|
4569
|
-
const [selectedItemText, setSelectedItemText] =
|
|
4641
|
+
const [selectedItem, setSelectedItem] = React34.useState(null);
|
|
4642
|
+
const [selectedItemText, setSelectedItemText] = React34.useState(null);
|
|
4570
4643
|
const getItems = useCollection(__scopeSelect);
|
|
4571
|
-
const [isPositioned, setIsPositioned] =
|
|
4572
|
-
const firstValidItemFoundRef =
|
|
4573
|
-
|
|
4644
|
+
const [isPositioned, setIsPositioned] = React34.useState(false);
|
|
4645
|
+
const firstValidItemFoundRef = React34.useRef(false);
|
|
4646
|
+
React34.useEffect(() => {
|
|
4574
4647
|
if (content)
|
|
4575
4648
|
return hideOthers(content);
|
|
4576
4649
|
}, [content]);
|
|
4577
4650
|
useFocusGuards();
|
|
4578
|
-
const focusFirst2 =
|
|
4651
|
+
const focusFirst2 = React34.useCallback((candidates) => {
|
|
4579
4652
|
const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);
|
|
4580
4653
|
const [lastItem] = restItems.slice(-1);
|
|
4581
4654
|
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
@@ -4592,14 +4665,14 @@ var SelectContentImpl = React32.forwardRef((props, forwardedRef) => {
|
|
|
4592
4665
|
return;
|
|
4593
4666
|
}
|
|
4594
4667
|
}, [getItems, viewport]);
|
|
4595
|
-
const focusSelectedItem =
|
|
4596
|
-
|
|
4668
|
+
const focusSelectedItem = React34.useCallback(() => focusFirst2([selectedItem, content]), [focusFirst2, selectedItem, content]);
|
|
4669
|
+
React34.useEffect(() => {
|
|
4597
4670
|
if (isPositioned) {
|
|
4598
4671
|
focusSelectedItem();
|
|
4599
4672
|
}
|
|
4600
4673
|
}, [isPositioned, focusSelectedItem]);
|
|
4601
4674
|
const { onOpenChange, triggerPointerDownPosRef } = context;
|
|
4602
|
-
|
|
4675
|
+
React34.useEffect(() => {
|
|
4603
4676
|
if (content) {
|
|
4604
4677
|
let pointerMoveDelta = { x: 0, y: 0 };
|
|
4605
4678
|
const handlePointerMove = (event) => {
|
|
@@ -4629,7 +4702,7 @@ var SelectContentImpl = React32.forwardRef((props, forwardedRef) => {
|
|
|
4629
4702
|
};
|
|
4630
4703
|
}
|
|
4631
4704
|
}, [content, onOpenChange, triggerPointerDownPosRef]);
|
|
4632
|
-
|
|
4705
|
+
React34.useEffect(() => {
|
|
4633
4706
|
const close = () => onOpenChange(false);
|
|
4634
4707
|
window.addEventListener("blur", close);
|
|
4635
4708
|
window.addEventListener("resize", close);
|
|
@@ -4646,7 +4719,7 @@ var SelectContentImpl = React32.forwardRef((props, forwardedRef) => {
|
|
|
4646
4719
|
setTimeout(() => nextItem.ref.current.focus());
|
|
4647
4720
|
}
|
|
4648
4721
|
});
|
|
4649
|
-
const itemRefCallback =
|
|
4722
|
+
const itemRefCallback = React34.useCallback((node, value, disabled) => {
|
|
4650
4723
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
4651
4724
|
const isSelectedItem = context.value !== undefined && context.value === value;
|
|
4652
4725
|
if (isSelectedItem || isFirstValidItem) {
|
|
@@ -4655,8 +4728,8 @@ var SelectContentImpl = React32.forwardRef((props, forwardedRef) => {
|
|
|
4655
4728
|
firstValidItemFoundRef.current = true;
|
|
4656
4729
|
}
|
|
4657
4730
|
}, [context.value]);
|
|
4658
|
-
const handleItemLeave =
|
|
4659
|
-
const itemTextRefCallback =
|
|
4731
|
+
const handleItemLeave = React34.useCallback(() => content?.focus(), [content]);
|
|
4732
|
+
const itemTextRefCallback = React34.useCallback((node, value, disabled) => {
|
|
4660
4733
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
4661
4734
|
const isSelectedItem = context.value !== undefined && context.value === value;
|
|
4662
4735
|
if (isSelectedItem || isFirstValidItem) {
|
|
@@ -4676,7 +4749,7 @@ var SelectContentImpl = React32.forwardRef((props, forwardedRef) => {
|
|
|
4676
4749
|
hideWhenDetached,
|
|
4677
4750
|
avoidCollisions
|
|
4678
4751
|
} : {};
|
|
4679
|
-
return /* @__PURE__ */
|
|
4752
|
+
return /* @__PURE__ */ jsx21(SelectContentProvider, {
|
|
4680
4753
|
scope: __scopeSelect,
|
|
4681
4754
|
content,
|
|
4682
4755
|
viewport,
|
|
@@ -4690,7 +4763,7 @@ var SelectContentImpl = React32.forwardRef((props, forwardedRef) => {
|
|
|
4690
4763
|
position,
|
|
4691
4764
|
isPositioned,
|
|
4692
4765
|
searchRef,
|
|
4693
|
-
children: /* @__PURE__ */
|
|
4766
|
+
children: /* @__PURE__ */ jsx21(Combination_default, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx21(FocusScope, {
|
|
4694
4767
|
asChild: true,
|
|
4695
4768
|
trapped: context.open,
|
|
4696
4769
|
onMountAutoFocus: (event) => {
|
|
@@ -4700,14 +4773,14 @@ var SelectContentImpl = React32.forwardRef((props, forwardedRef) => {
|
|
|
4700
4773
|
context.trigger?.focus({ preventScroll: true });
|
|
4701
4774
|
event.preventDefault();
|
|
4702
4775
|
}),
|
|
4703
|
-
children: /* @__PURE__ */
|
|
4776
|
+
children: /* @__PURE__ */ jsx21(DismissableLayer, {
|
|
4704
4777
|
asChild: true,
|
|
4705
4778
|
disableOutsidePointerEvents: true,
|
|
4706
4779
|
onEscapeKeyDown,
|
|
4707
4780
|
onPointerDownOutside,
|
|
4708
4781
|
onFocusOutside: (event) => event.preventDefault(),
|
|
4709
4782
|
onDismiss: () => context.onOpenChange(false),
|
|
4710
|
-
children: /* @__PURE__ */
|
|
4783
|
+
children: /* @__PURE__ */ jsx21(SelectPosition, {
|
|
4711
4784
|
role: "listbox",
|
|
4712
4785
|
id: context.contentId,
|
|
4713
4786
|
"data-state": context.open ? "open" : "closed",
|
|
@@ -4751,18 +4824,18 @@ var SelectContentImpl = React32.forwardRef((props, forwardedRef) => {
|
|
|
4751
4824
|
});
|
|
4752
4825
|
SelectContentImpl.displayName = CONTENT_IMPL_NAME;
|
|
4753
4826
|
var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition";
|
|
4754
|
-
var SelectItemAlignedPosition =
|
|
4827
|
+
var SelectItemAlignedPosition = React34.forwardRef((props, forwardedRef) => {
|
|
4755
4828
|
const { __scopeSelect, onPlaced, ...popperProps } = props;
|
|
4756
4829
|
const context = useSelectContext(CONTENT_NAME2, __scopeSelect);
|
|
4757
4830
|
const contentContext = useSelectContentContext(CONTENT_NAME2, __scopeSelect);
|
|
4758
|
-
const [contentWrapper, setContentWrapper] =
|
|
4759
|
-
const [content, setContent] =
|
|
4831
|
+
const [contentWrapper, setContentWrapper] = React34.useState(null);
|
|
4832
|
+
const [content, setContent] = React34.useState(null);
|
|
4760
4833
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
4761
4834
|
const getItems = useCollection(__scopeSelect);
|
|
4762
|
-
const shouldExpandOnScrollRef =
|
|
4763
|
-
const shouldRepositionRef =
|
|
4835
|
+
const shouldExpandOnScrollRef = React34.useRef(false);
|
|
4836
|
+
const shouldRepositionRef = React34.useRef(true);
|
|
4764
4837
|
const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;
|
|
4765
|
-
const position =
|
|
4838
|
+
const position = React34.useCallback(() => {
|
|
4766
4839
|
if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
|
|
4767
4840
|
const triggerRect = context.trigger.getBoundingClientRect();
|
|
4768
4841
|
const contentRect = content.getBoundingClientRect();
|
|
@@ -4843,24 +4916,24 @@ var SelectItemAlignedPosition = React32.forwardRef((props, forwardedRef) => {
|
|
|
4843
4916
|
onPlaced
|
|
4844
4917
|
]);
|
|
4845
4918
|
useLayoutEffect2(() => position(), [position]);
|
|
4846
|
-
const [contentZIndex, setContentZIndex] =
|
|
4919
|
+
const [contentZIndex, setContentZIndex] = React34.useState();
|
|
4847
4920
|
useLayoutEffect2(() => {
|
|
4848
4921
|
if (content)
|
|
4849
4922
|
setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
4850
4923
|
}, [content]);
|
|
4851
|
-
const handleScrollButtonChange =
|
|
4924
|
+
const handleScrollButtonChange = React34.useCallback((node) => {
|
|
4852
4925
|
if (node && shouldRepositionRef.current === true) {
|
|
4853
4926
|
position();
|
|
4854
4927
|
focusSelectedItem?.();
|
|
4855
4928
|
shouldRepositionRef.current = false;
|
|
4856
4929
|
}
|
|
4857
4930
|
}, [position, focusSelectedItem]);
|
|
4858
|
-
return /* @__PURE__ */
|
|
4931
|
+
return /* @__PURE__ */ jsx21(SelectViewportProvider, {
|
|
4859
4932
|
scope: __scopeSelect,
|
|
4860
4933
|
contentWrapper,
|
|
4861
4934
|
shouldExpandOnScrollRef,
|
|
4862
4935
|
onScrollButtonChange: handleScrollButtonChange,
|
|
4863
|
-
children: /* @__PURE__ */
|
|
4936
|
+
children: /* @__PURE__ */ jsx21("div", {
|
|
4864
4937
|
ref: setContentWrapper,
|
|
4865
4938
|
style: {
|
|
4866
4939
|
display: "flex",
|
|
@@ -4868,7 +4941,7 @@ var SelectItemAlignedPosition = React32.forwardRef((props, forwardedRef) => {
|
|
|
4868
4941
|
position: "fixed",
|
|
4869
4942
|
zIndex: contentZIndex
|
|
4870
4943
|
},
|
|
4871
|
-
children: /* @__PURE__ */
|
|
4944
|
+
children: /* @__PURE__ */ jsx21(Primitive.div, {
|
|
4872
4945
|
...popperProps,
|
|
4873
4946
|
ref: composedRefs,
|
|
4874
4947
|
style: {
|
|
@@ -4882,7 +4955,7 @@ var SelectItemAlignedPosition = React32.forwardRef((props, forwardedRef) => {
|
|
|
4882
4955
|
});
|
|
4883
4956
|
SelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;
|
|
4884
4957
|
var POPPER_POSITION_NAME = "SelectPopperPosition";
|
|
4885
|
-
var SelectPopperPosition =
|
|
4958
|
+
var SelectPopperPosition = React34.forwardRef((props, forwardedRef) => {
|
|
4886
4959
|
const {
|
|
4887
4960
|
__scopeSelect,
|
|
4888
4961
|
align = "start",
|
|
@@ -4890,7 +4963,7 @@ var SelectPopperPosition = React32.forwardRef((props, forwardedRef) => {
|
|
|
4890
4963
|
...popperProps
|
|
4891
4964
|
} = props;
|
|
4892
4965
|
const popperScope = usePopperScope(__scopeSelect);
|
|
4893
|
-
return /* @__PURE__ */
|
|
4966
|
+
return /* @__PURE__ */ jsx21(Content, {
|
|
4894
4967
|
...popperScope,
|
|
4895
4968
|
...popperProps,
|
|
4896
4969
|
ref: forwardedRef,
|
|
@@ -4912,20 +4985,20 @@ var SelectPopperPosition = React32.forwardRef((props, forwardedRef) => {
|
|
|
4912
4985
|
SelectPopperPosition.displayName = POPPER_POSITION_NAME;
|
|
4913
4986
|
var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME2, {});
|
|
4914
4987
|
var VIEWPORT_NAME = "SelectViewport";
|
|
4915
|
-
var SelectViewport =
|
|
4988
|
+
var SelectViewport = React34.forwardRef((props, forwardedRef) => {
|
|
4916
4989
|
const { __scopeSelect, nonce, ...viewportProps } = props;
|
|
4917
4990
|
const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);
|
|
4918
4991
|
const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);
|
|
4919
4992
|
const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);
|
|
4920
|
-
const prevScrollTopRef =
|
|
4921
|
-
return /* @__PURE__ */
|
|
4922
|
-
/* @__PURE__ */
|
|
4993
|
+
const prevScrollTopRef = React34.useRef(0);
|
|
4994
|
+
return /* @__PURE__ */ jsxs4(Fragment5, { children: [
|
|
4995
|
+
/* @__PURE__ */ jsx21("style", {
|
|
4923
4996
|
dangerouslySetInnerHTML: {
|
|
4924
4997
|
__html: `[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`
|
|
4925
4998
|
},
|
|
4926
4999
|
nonce
|
|
4927
5000
|
}),
|
|
4928
|
-
/* @__PURE__ */
|
|
5001
|
+
/* @__PURE__ */ jsx21(Collection.Slot, { scope: __scopeSelect, children: /* @__PURE__ */ jsx21(Primitive.div, {
|
|
4929
5002
|
"data-radix-select-viewport": "",
|
|
4930
5003
|
role: "presentation",
|
|
4931
5004
|
...viewportProps,
|
|
@@ -4966,22 +5039,22 @@ var SelectViewport = React32.forwardRef((props, forwardedRef) => {
|
|
|
4966
5039
|
SelectViewport.displayName = VIEWPORT_NAME;
|
|
4967
5040
|
var GROUP_NAME = "SelectGroup";
|
|
4968
5041
|
var [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME);
|
|
4969
|
-
var SelectGroup =
|
|
5042
|
+
var SelectGroup = React34.forwardRef((props, forwardedRef) => {
|
|
4970
5043
|
const { __scopeSelect, ...groupProps } = props;
|
|
4971
5044
|
const groupId = useId();
|
|
4972
|
-
return /* @__PURE__ */
|
|
5045
|
+
return /* @__PURE__ */ jsx21(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsx21(Primitive.div, { role: "group", "aria-labelledby": groupId, ...groupProps, ref: forwardedRef }) });
|
|
4973
5046
|
});
|
|
4974
5047
|
SelectGroup.displayName = GROUP_NAME;
|
|
4975
5048
|
var LABEL_NAME = "SelectLabel";
|
|
4976
|
-
var SelectLabel =
|
|
5049
|
+
var SelectLabel = React34.forwardRef((props, forwardedRef) => {
|
|
4977
5050
|
const { __scopeSelect, ...labelProps } = props;
|
|
4978
5051
|
const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);
|
|
4979
|
-
return /* @__PURE__ */
|
|
5052
|
+
return /* @__PURE__ */ jsx21(Primitive.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });
|
|
4980
5053
|
});
|
|
4981
5054
|
SelectLabel.displayName = LABEL_NAME;
|
|
4982
5055
|
var ITEM_NAME = "SelectItem";
|
|
4983
5056
|
var [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME);
|
|
4984
|
-
var SelectItem =
|
|
5057
|
+
var SelectItem = React34.forwardRef((props, forwardedRef) => {
|
|
4985
5058
|
const {
|
|
4986
5059
|
__scopeSelect,
|
|
4987
5060
|
value,
|
|
@@ -4992,8 +5065,8 @@ var SelectItem = React32.forwardRef((props, forwardedRef) => {
|
|
|
4992
5065
|
const context = useSelectContext(ITEM_NAME, __scopeSelect);
|
|
4993
5066
|
const contentContext = useSelectContentContext(ITEM_NAME, __scopeSelect);
|
|
4994
5067
|
const isSelected = context.value === value;
|
|
4995
|
-
const [textValue, setTextValue] =
|
|
4996
|
-
const [isFocused, setIsFocused] =
|
|
5068
|
+
const [textValue, setTextValue] = React34.useState(textValueProp ?? "");
|
|
5069
|
+
const [isFocused, setIsFocused] = React34.useState(false);
|
|
4997
5070
|
const composedRefs = useComposedRefs(forwardedRef, (node) => contentContext.itemRefCallback?.(node, value, disabled));
|
|
4998
5071
|
const textId = useId();
|
|
4999
5072
|
const handleSelect = () => {
|
|
@@ -5005,21 +5078,21 @@ var SelectItem = React32.forwardRef((props, forwardedRef) => {
|
|
|
5005
5078
|
if (value === "") {
|
|
5006
5079
|
throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");
|
|
5007
5080
|
}
|
|
5008
|
-
return /* @__PURE__ */
|
|
5081
|
+
return /* @__PURE__ */ jsx21(SelectItemContextProvider, {
|
|
5009
5082
|
scope: __scopeSelect,
|
|
5010
5083
|
value,
|
|
5011
5084
|
disabled,
|
|
5012
5085
|
textId,
|
|
5013
5086
|
isSelected,
|
|
5014
|
-
onItemTextChange:
|
|
5087
|
+
onItemTextChange: React34.useCallback((node) => {
|
|
5015
5088
|
setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
|
|
5016
5089
|
}, []),
|
|
5017
|
-
children: /* @__PURE__ */
|
|
5090
|
+
children: /* @__PURE__ */ jsx21(Collection.ItemSlot, {
|
|
5018
5091
|
scope: __scopeSelect,
|
|
5019
5092
|
value,
|
|
5020
5093
|
disabled,
|
|
5021
5094
|
textValue,
|
|
5022
|
-
children: /* @__PURE__ */
|
|
5095
|
+
children: /* @__PURE__ */ jsx21(Primitive.div, {
|
|
5023
5096
|
role: "option",
|
|
5024
5097
|
"aria-labelledby": textId,
|
|
5025
5098
|
"data-highlighted": isFocused ? "" : undefined,
|
|
@@ -5060,39 +5133,39 @@ var SelectItem = React32.forwardRef((props, forwardedRef) => {
|
|
|
5060
5133
|
});
|
|
5061
5134
|
SelectItem.displayName = ITEM_NAME;
|
|
5062
5135
|
var ITEM_TEXT_NAME = "SelectItemText";
|
|
5063
|
-
var SelectItemText =
|
|
5136
|
+
var SelectItemText = React34.forwardRef((props, forwardedRef) => {
|
|
5064
5137
|
const { __scopeSelect, className, style, ...itemTextProps } = props;
|
|
5065
5138
|
const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
5066
5139
|
const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
5067
5140
|
const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
5068
5141
|
const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
5069
|
-
const [itemTextNode, setItemTextNode] =
|
|
5142
|
+
const [itemTextNode, setItemTextNode] = React34.useState(null);
|
|
5070
5143
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setItemTextNode(node), itemContext.onItemTextChange, (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled));
|
|
5071
5144
|
const textContent = itemTextNode?.textContent;
|
|
5072
|
-
const nativeOption =
|
|
5145
|
+
const nativeOption = React34.useMemo(() => /* @__PURE__ */ jsx21("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value), [itemContext.disabled, itemContext.value, textContent]);
|
|
5073
5146
|
const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;
|
|
5074
5147
|
useLayoutEffect2(() => {
|
|
5075
5148
|
onNativeOptionAdd(nativeOption);
|
|
5076
5149
|
return () => onNativeOptionRemove(nativeOption);
|
|
5077
5150
|
}, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);
|
|
5078
|
-
return /* @__PURE__ */
|
|
5079
|
-
/* @__PURE__ */
|
|
5151
|
+
return /* @__PURE__ */ jsxs4(Fragment5, { children: [
|
|
5152
|
+
/* @__PURE__ */ jsx21(Primitive.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }),
|
|
5080
5153
|
itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? ReactDOM4.createPortal(itemTextProps.children, context.valueNode) : null
|
|
5081
5154
|
] });
|
|
5082
5155
|
});
|
|
5083
5156
|
SelectItemText.displayName = ITEM_TEXT_NAME;
|
|
5084
5157
|
var ITEM_INDICATOR_NAME = "SelectItemIndicator";
|
|
5085
|
-
var SelectItemIndicator =
|
|
5158
|
+
var SelectItemIndicator = React34.forwardRef((props, forwardedRef) => {
|
|
5086
5159
|
const { __scopeSelect, ...itemIndicatorProps } = props;
|
|
5087
5160
|
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);
|
|
5088
|
-
return itemContext.isSelected ? /* @__PURE__ */
|
|
5161
|
+
return itemContext.isSelected ? /* @__PURE__ */ jsx21(Primitive.span, { "aria-hidden": true, ...itemIndicatorProps, ref: forwardedRef }) : null;
|
|
5089
5162
|
});
|
|
5090
5163
|
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
5091
5164
|
var SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
|
|
5092
|
-
var SelectScrollUpButton =
|
|
5165
|
+
var SelectScrollUpButton = React34.forwardRef((props, forwardedRef) => {
|
|
5093
5166
|
const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
5094
5167
|
const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
5095
|
-
const [canScrollUp, setCanScrollUp] =
|
|
5168
|
+
const [canScrollUp, setCanScrollUp] = React34.useState(false);
|
|
5096
5169
|
const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
|
5097
5170
|
useLayoutEffect2(() => {
|
|
5098
5171
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -5107,7 +5180,7 @@ var SelectScrollUpButton = React32.forwardRef((props, forwardedRef) => {
|
|
|
5107
5180
|
return () => viewport.removeEventListener("scroll", handleScroll22);
|
|
5108
5181
|
}
|
|
5109
5182
|
}, [contentContext.viewport, contentContext.isPositioned]);
|
|
5110
|
-
return canScrollUp ? /* @__PURE__ */
|
|
5183
|
+
return canScrollUp ? /* @__PURE__ */ jsx21(SelectScrollButtonImpl, {
|
|
5111
5184
|
...props,
|
|
5112
5185
|
ref: composedRefs,
|
|
5113
5186
|
onAutoScroll: () => {
|
|
@@ -5120,10 +5193,10 @@ var SelectScrollUpButton = React32.forwardRef((props, forwardedRef) => {
|
|
|
5120
5193
|
});
|
|
5121
5194
|
SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;
|
|
5122
5195
|
var SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
|
|
5123
|
-
var SelectScrollDownButton =
|
|
5196
|
+
var SelectScrollDownButton = React34.forwardRef((props, forwardedRef) => {
|
|
5124
5197
|
const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
5125
5198
|
const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
5126
|
-
const [canScrollDown, setCanScrollDown] =
|
|
5199
|
+
const [canScrollDown, setCanScrollDown] = React34.useState(false);
|
|
5127
5200
|
const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
|
5128
5201
|
useLayoutEffect2(() => {
|
|
5129
5202
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -5139,7 +5212,7 @@ var SelectScrollDownButton = React32.forwardRef((props, forwardedRef) => {
|
|
|
5139
5212
|
return () => viewport.removeEventListener("scroll", handleScroll22);
|
|
5140
5213
|
}
|
|
5141
5214
|
}, [contentContext.viewport, contentContext.isPositioned]);
|
|
5142
|
-
return canScrollDown ? /* @__PURE__ */
|
|
5215
|
+
return canScrollDown ? /* @__PURE__ */ jsx21(SelectScrollButtonImpl, {
|
|
5143
5216
|
...props,
|
|
5144
5217
|
ref: composedRefs,
|
|
5145
5218
|
onAutoScroll: () => {
|
|
@@ -5151,25 +5224,25 @@ var SelectScrollDownButton = React32.forwardRef((props, forwardedRef) => {
|
|
|
5151
5224
|
}) : null;
|
|
5152
5225
|
});
|
|
5153
5226
|
SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
|
|
5154
|
-
var SelectScrollButtonImpl =
|
|
5227
|
+
var SelectScrollButtonImpl = React34.forwardRef((props, forwardedRef) => {
|
|
5155
5228
|
const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;
|
|
5156
5229
|
const contentContext = useSelectContentContext("SelectScrollButton", __scopeSelect);
|
|
5157
|
-
const autoScrollTimerRef =
|
|
5230
|
+
const autoScrollTimerRef = React34.useRef(null);
|
|
5158
5231
|
const getItems = useCollection(__scopeSelect);
|
|
5159
|
-
const clearAutoScrollTimer =
|
|
5232
|
+
const clearAutoScrollTimer = React34.useCallback(() => {
|
|
5160
5233
|
if (autoScrollTimerRef.current !== null) {
|
|
5161
5234
|
window.clearInterval(autoScrollTimerRef.current);
|
|
5162
5235
|
autoScrollTimerRef.current = null;
|
|
5163
5236
|
}
|
|
5164
5237
|
}, []);
|
|
5165
|
-
|
|
5238
|
+
React34.useEffect(() => {
|
|
5166
5239
|
return () => clearAutoScrollTimer();
|
|
5167
5240
|
}, [clearAutoScrollTimer]);
|
|
5168
5241
|
useLayoutEffect2(() => {
|
|
5169
5242
|
const activeItem = getItems().find((item) => item.ref.current === document.activeElement);
|
|
5170
5243
|
activeItem?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
5171
5244
|
}, [getItems]);
|
|
5172
|
-
return /* @__PURE__ */
|
|
5245
|
+
return /* @__PURE__ */ jsx21(Primitive.div, {
|
|
5173
5246
|
"aria-hidden": true,
|
|
5174
5247
|
...scrollIndicatorProps,
|
|
5175
5248
|
ref: forwardedRef,
|
|
@@ -5191,29 +5264,29 @@ var SelectScrollButtonImpl = React32.forwardRef((props, forwardedRef) => {
|
|
|
5191
5264
|
});
|
|
5192
5265
|
});
|
|
5193
5266
|
var SEPARATOR_NAME = "SelectSeparator";
|
|
5194
|
-
var SelectSeparator =
|
|
5267
|
+
var SelectSeparator = React34.forwardRef((props, forwardedRef) => {
|
|
5195
5268
|
const { __scopeSelect, ...separatorProps } = props;
|
|
5196
|
-
return /* @__PURE__ */
|
|
5269
|
+
return /* @__PURE__ */ jsx21(Primitive.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
|
|
5197
5270
|
});
|
|
5198
5271
|
SelectSeparator.displayName = SEPARATOR_NAME;
|
|
5199
5272
|
var ARROW_NAME2 = "SelectArrow";
|
|
5200
|
-
var SelectArrow =
|
|
5273
|
+
var SelectArrow = React34.forwardRef((props, forwardedRef) => {
|
|
5201
5274
|
const { __scopeSelect, ...arrowProps } = props;
|
|
5202
5275
|
const popperScope = usePopperScope(__scopeSelect);
|
|
5203
5276
|
const context = useSelectContext(ARROW_NAME2, __scopeSelect);
|
|
5204
5277
|
const contentContext = useSelectContentContext(ARROW_NAME2, __scopeSelect);
|
|
5205
|
-
return context.open && contentContext.position === "popper" ? /* @__PURE__ */
|
|
5278
|
+
return context.open && contentContext.position === "popper" ? /* @__PURE__ */ jsx21(Arrow2, { ...popperScope, ...arrowProps, ref: forwardedRef }) : null;
|
|
5206
5279
|
});
|
|
5207
5280
|
SelectArrow.displayName = ARROW_NAME2;
|
|
5208
5281
|
function shouldShowPlaceholder(value) {
|
|
5209
5282
|
return value === "" || value === undefined;
|
|
5210
5283
|
}
|
|
5211
|
-
var BubbleSelect =
|
|
5284
|
+
var BubbleSelect = React34.forwardRef((props, forwardedRef) => {
|
|
5212
5285
|
const { value, ...selectProps } = props;
|
|
5213
|
-
const ref =
|
|
5286
|
+
const ref = React34.useRef(null);
|
|
5214
5287
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
5215
5288
|
const prevValue = usePrevious(value);
|
|
5216
|
-
|
|
5289
|
+
React34.useEffect(() => {
|
|
5217
5290
|
const select = ref.current;
|
|
5218
5291
|
const selectProto = window.HTMLSelectElement.prototype;
|
|
5219
5292
|
const descriptor = Object.getOwnPropertyDescriptor(selectProto, "value");
|
|
@@ -5224,14 +5297,14 @@ var BubbleSelect = React32.forwardRef((props, forwardedRef) => {
|
|
|
5224
5297
|
select.dispatchEvent(event);
|
|
5225
5298
|
}
|
|
5226
5299
|
}, [prevValue, value]);
|
|
5227
|
-
return /* @__PURE__ */
|
|
5300
|
+
return /* @__PURE__ */ jsx21(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsx21("select", { ...selectProps, ref: composedRefs, defaultValue: value }) });
|
|
5228
5301
|
});
|
|
5229
5302
|
BubbleSelect.displayName = "BubbleSelect";
|
|
5230
5303
|
function useTypeaheadSearch(onSearchChange) {
|
|
5231
5304
|
const handleSearchChange = useCallbackRef(onSearchChange);
|
|
5232
|
-
const searchRef =
|
|
5233
|
-
const timerRef =
|
|
5234
|
-
const handleTypeaheadSearch =
|
|
5305
|
+
const searchRef = React34.useRef("");
|
|
5306
|
+
const timerRef = React34.useRef(0);
|
|
5307
|
+
const handleTypeaheadSearch = React34.useCallback((key) => {
|
|
5235
5308
|
const search = searchRef.current + key;
|
|
5236
5309
|
handleSearchChange(search);
|
|
5237
5310
|
(function updateSearch(value) {
|
|
@@ -5241,11 +5314,11 @@ function useTypeaheadSearch(onSearchChange) {
|
|
|
5241
5314
|
timerRef.current = window.setTimeout(() => updateSearch(""), 1000);
|
|
5242
5315
|
})(search);
|
|
5243
5316
|
}, [handleSearchChange]);
|
|
5244
|
-
const resetTypeahead =
|
|
5317
|
+
const resetTypeahead = React34.useCallback(() => {
|
|
5245
5318
|
searchRef.current = "";
|
|
5246
5319
|
window.clearTimeout(timerRef.current);
|
|
5247
5320
|
}, []);
|
|
5248
|
-
|
|
5321
|
+
React34.useEffect(() => {
|
|
5249
5322
|
return () => window.clearTimeout(timerRef.current);
|
|
5250
5323
|
}, []);
|
|
5251
5324
|
return [searchRef, handleTypeaheadSearch, resetTypeahead];
|
|
@@ -5354,113 +5427,113 @@ var ChevronDown = createLucideIcon("ChevronDown", [
|
|
|
5354
5427
|
// ../../node_modules/.bun/lucide-react@0.439.0+aa8600d4a927d95f/node_modules/lucide-react/dist/esm/icons/chevron-up.js
|
|
5355
5428
|
var ChevronUp = createLucideIcon("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
|
|
5356
5429
|
// src/Select.tsx
|
|
5357
|
-
import * as
|
|
5358
|
-
import { jsx as
|
|
5430
|
+
import * as React35 from "react";
|
|
5431
|
+
import { jsx as jsx22, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
5359
5432
|
var Select2 = Root22;
|
|
5360
5433
|
var SelectGroup2 = Group;
|
|
5361
5434
|
var SelectValue2 = Value;
|
|
5362
|
-
var SelectTrigger2 =
|
|
5435
|
+
var SelectTrigger2 = React35.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs5(Trigger, {
|
|
5363
5436
|
ref,
|
|
5364
5437
|
className: cn("flex h-10 w-full items-center justify-between rounded-md border-black border-2 border-b-4 bg-card-bg px-3 py-5 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 font-brand", className),
|
|
5365
5438
|
...props,
|
|
5366
5439
|
children: [
|
|
5367
5440
|
children,
|
|
5368
|
-
/* @__PURE__ */
|
|
5441
|
+
/* @__PURE__ */ jsx22(Icon, {
|
|
5369
5442
|
asChild: true,
|
|
5370
|
-
children: /* @__PURE__ */
|
|
5443
|
+
children: /* @__PURE__ */ jsx22(ChevronDown, {
|
|
5371
5444
|
className: "h-4 w-4 opacity-50"
|
|
5372
5445
|
})
|
|
5373
5446
|
})
|
|
5374
5447
|
]
|
|
5375
5448
|
}));
|
|
5376
5449
|
SelectTrigger2.displayName = Trigger.displayName;
|
|
5377
|
-
var SelectScrollUpButton2 =
|
|
5450
|
+
var SelectScrollUpButton2 = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(ScrollUpButton, {
|
|
5378
5451
|
ref,
|
|
5379
5452
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
5380
5453
|
...props,
|
|
5381
|
-
children: /* @__PURE__ */
|
|
5454
|
+
children: /* @__PURE__ */ jsx22(ChevronUp, {
|
|
5382
5455
|
className: "h-4 w-4"
|
|
5383
5456
|
})
|
|
5384
5457
|
}));
|
|
5385
5458
|
SelectScrollUpButton2.displayName = ScrollUpButton.displayName;
|
|
5386
|
-
var SelectScrollDownButton2 =
|
|
5459
|
+
var SelectScrollDownButton2 = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(ScrollDownButton, {
|
|
5387
5460
|
ref,
|
|
5388
5461
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
5389
5462
|
...props,
|
|
5390
|
-
children: /* @__PURE__ */
|
|
5463
|
+
children: /* @__PURE__ */ jsx22(ChevronDown, {
|
|
5391
5464
|
className: "h-4 w-4"
|
|
5392
5465
|
})
|
|
5393
5466
|
}));
|
|
5394
5467
|
SelectScrollDownButton2.displayName = ScrollDownButton.displayName;
|
|
5395
|
-
var SelectContent2 =
|
|
5396
|
-
children: /* @__PURE__ */
|
|
5468
|
+
var SelectContent2 = React35.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx22(Portal2, {
|
|
5469
|
+
children: /* @__PURE__ */ jsxs5(Content2, {
|
|
5397
5470
|
ref,
|
|
5398
5471
|
className: cn(" border-2 border-black relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md font-brand bg-card-bg text-text shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
5399
5472
|
position,
|
|
5400
5473
|
...props,
|
|
5401
5474
|
children: [
|
|
5402
|
-
/* @__PURE__ */
|
|
5403
|
-
/* @__PURE__ */
|
|
5475
|
+
/* @__PURE__ */ jsx22(SelectScrollUpButton2, {}),
|
|
5476
|
+
/* @__PURE__ */ jsx22(Viewport, {
|
|
5404
5477
|
className: cn("p-1", position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),
|
|
5405
5478
|
children
|
|
5406
5479
|
}),
|
|
5407
|
-
/* @__PURE__ */
|
|
5480
|
+
/* @__PURE__ */ jsx22(SelectScrollDownButton2, {})
|
|
5408
5481
|
]
|
|
5409
5482
|
})
|
|
5410
5483
|
}));
|
|
5411
5484
|
SelectContent2.displayName = Content2.displayName;
|
|
5412
|
-
var SelectLabel2 =
|
|
5485
|
+
var SelectLabel2 = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(Label, {
|
|
5413
5486
|
ref,
|
|
5414
5487
|
className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className),
|
|
5415
5488
|
...props
|
|
5416
5489
|
}));
|
|
5417
5490
|
SelectLabel2.displayName = Label.displayName;
|
|
5418
|
-
var SelectItem2 =
|
|
5491
|
+
var SelectItem2 = React35.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs5(Item, {
|
|
5419
5492
|
ref,
|
|
5420
5493
|
className: cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-slate-200 dark:focus:bg-white/10 data-disabled:pointer-events-none data-disabled:opacity-50 font-brand", className),
|
|
5421
5494
|
...props,
|
|
5422
5495
|
children: [
|
|
5423
|
-
/* @__PURE__ */
|
|
5496
|
+
/* @__PURE__ */ jsx22("span", {
|
|
5424
5497
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
5425
|
-
children: /* @__PURE__ */
|
|
5426
|
-
children: /* @__PURE__ */
|
|
5498
|
+
children: /* @__PURE__ */ jsx22(ItemIndicator, {
|
|
5499
|
+
children: /* @__PURE__ */ jsx22(Check, {
|
|
5427
5500
|
className: "h-4 w-4"
|
|
5428
5501
|
})
|
|
5429
5502
|
})
|
|
5430
5503
|
}),
|
|
5431
|
-
/* @__PURE__ */
|
|
5504
|
+
/* @__PURE__ */ jsx22(ItemText, {
|
|
5432
5505
|
children
|
|
5433
5506
|
})
|
|
5434
5507
|
]
|
|
5435
5508
|
}));
|
|
5436
5509
|
SelectItem2.displayName = Item.displayName;
|
|
5437
|
-
var SelectSeparator2 =
|
|
5510
|
+
var SelectSeparator2 = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(Separator, {
|
|
5438
5511
|
ref,
|
|
5439
5512
|
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
5440
5513
|
...props
|
|
5441
5514
|
}));
|
|
5442
5515
|
SelectSeparator2.displayName = Separator.displayName;
|
|
5443
5516
|
// src/Switch.tsx
|
|
5444
|
-
import { jsx as
|
|
5517
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
5445
5518
|
var Switch = ({ active, onToggle }) => {
|
|
5446
|
-
return /* @__PURE__ */
|
|
5519
|
+
return /* @__PURE__ */ jsx23("div", {
|
|
5447
5520
|
"data-active": active,
|
|
5448
5521
|
className: "h-8 transition-all rounded-full w-14 border-2 border-b-4 bg-gray-200 p-[2px] cursor-pointer data-[active=true]:bg-brand border-black relative",
|
|
5449
5522
|
onClick: onToggle,
|
|
5450
|
-
children: /* @__PURE__ */
|
|
5523
|
+
children: /* @__PURE__ */ jsx23("div", {
|
|
5451
5524
|
"data-active": active,
|
|
5452
5525
|
className: "h-4 w-4 box-content left-[4px] top-[3px] transition-all rounded-full bg-white border-2 border-black absolute data-[active=true]:left-[calc(100%-24px)]"
|
|
5453
5526
|
})
|
|
5454
5527
|
});
|
|
5455
5528
|
};
|
|
5456
5529
|
// src/Triangle.tsx
|
|
5457
|
-
import { jsx as
|
|
5530
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
5458
5531
|
var Triangle2 = (props) => {
|
|
5459
|
-
return /* @__PURE__ */
|
|
5532
|
+
return /* @__PURE__ */ jsx24("svg", {
|
|
5460
5533
|
viewBox: "0 0 127 131",
|
|
5461
5534
|
fill: "none",
|
|
5462
5535
|
...props,
|
|
5463
|
-
children: /* @__PURE__ */
|
|
5536
|
+
children: /* @__PURE__ */ jsx24("path", {
|
|
5464
5537
|
d: "M28.5644 0.011261C25.8196 0.159241 23.6077 0.591782 21.3786 1.43413C20.2669 1.84959 18.4446 2.75455 17.4418 3.38062C13.2472 5.993 10.0496 9.9201 8.38209 14.4903C8.04973 15.3953 7.15007 18.2809 6.5713 20.2672C2.71476 33.5453 0.525761 48.0643 0.0558711 63.4312C-0.0186237 65.8785 -0.0186237 71.7066 0.0558711 74.1141C0.371041 84.3018 1.35093 93.4992 3.12735 102.879C3.84937 106.675 5.00691 111.774 5.67736 114.091C7.04692 118.798 9.84334 122.805 13.8202 125.741C16.4848 127.711 19.5105 129.031 22.8627 129.68C24.4787 129.993 26.6104 130.135 28.1805 130.033C30.3523 129.89 34.6616 129.316 38.1628 128.695C53.9442 125.901 68.5223 120.898 81.7422 113.738C90.1143 109.202 97.2715 104.29 104.177 98.3312C111.059 92.4007 116.927 86.0206 122.09 78.8608C123.287 77.2045 123.889 76.237 124.491 75.019C126.038 71.8773 126.766 68.7527 126.76 65.2582C126.76 62.0027 126.141 59.1114 124.806 56.1518C124.164 54.7233 123.551 53.6988 122.176 51.7523C117.11 44.5868 111.489 38.3433 104.635 32.2762C94.011 22.8739 81.3927 15.1619 67.3017 9.45339C64.2474 8.21835 61.239 7.13128 57.6174 5.95315C49.9502 3.46598 40.4607 1.30891 32.4324 0.233231C31.1718 0.0624847 29.4584 -0.0342712 28.5644 0.011261Z",
|
|
5465
5538
|
fill: "currentcolor"
|
|
5466
5539
|
})
|
|
@@ -5480,6 +5553,7 @@ export {
|
|
|
5480
5553
|
SelectContent2 as SelectContent,
|
|
5481
5554
|
Select2 as Select,
|
|
5482
5555
|
PlanePaperIcon,
|
|
5556
|
+
Input,
|
|
5483
5557
|
Counter,
|
|
5484
5558
|
CheckIcon,
|
|
5485
5559
|
Card,
|