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