@bug-on/m3-expressive 1.3.1 → 1.3.2
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/CHANGELOG.md +9 -0
- package/README.md +88 -60
- package/dist/buttons.d.mts +3 -3
- package/dist/buttons.d.ts +3 -3
- package/dist/{core-CAU8g2HY.d.mts → core-D8FdHY6I.d.mts} +1 -1
- package/dist/{core-DRrLnsnJ.d.ts → core-DyEy8H9Z.d.ts} +1 -1
- package/dist/core.d.mts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/feedback.js +1 -1
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs +1 -1
- package/dist/feedback.mjs.map +1 -1
- package/dist/forms.d.mts +4 -3
- package/dist/forms.d.ts +4 -3
- package/dist/forms.js +5084 -2987
- package/dist/forms.js.map +1 -1
- package/dist/forms.mjs +5083 -2989
- package/dist/forms.mjs.map +1 -1
- package/dist/{icon-button-USJo7AqO.d.mts → icon-button-CxyJv7UV.d.mts} +1 -1
- package/dist/{icon-button-CqdQBsRe.d.ts → icon-button-Di8VX6ou.d.ts} +1 -1
- package/dist/index.d.mts +12 -82
- package/dist/index.d.ts +12 -82
- package/dist/index.js +2635 -1119
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2483 -979
- package/dist/index.mjs.map +1 -1
- package/dist/layout.d.mts +481 -33
- package/dist/layout.d.ts +481 -33
- package/dist/layout.js +1499 -220
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +1471 -208
- package/dist/layout.mjs.map +1 -1
- package/dist/{md3-D0_Z7IXj.d.mts → md3-BQhRygSi.d.mts} +1 -1
- package/dist/{md3-D0_Z7IXj.d.ts → md3-BQhRygSi.d.ts} +1 -1
- package/dist/menu-types-rZNQFO7Y.d.mts +315 -0
- package/dist/menu-types-rZNQFO7Y.d.ts +315 -0
- package/dist/navigation.d.mts +5 -289
- package/dist/navigation.d.ts +5 -289
- package/dist/navigation.js +423 -250
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +415 -243
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.d.mts +2 -2
- package/dist/overlays.d.ts +2 -2
- package/dist/{side-sheet-modal-Dgjt739k.d.mts → side-sheet-modal-64FGhDxL.d.mts} +1 -1
- package/dist/{side-sheet-modal-DdEZR6Vl.d.ts → side-sheet-modal-Bd5Qqvp9.d.ts} +1 -1
- package/dist/{split-button-trailing-uncheckable-DTQJjzsB.d.ts → split-button-trailing-uncheckable-CGzk7KcG.d.ts} +1 -1
- package/dist/{split-button-trailing-uncheckable-CIVEYgjY.d.mts → split-button-trailing-uncheckable-gAz6OAIi.d.mts} +1 -1
- package/dist/{text-field-Ear3hCSq.d.mts → text-field-4OlT9o8s.d.mts} +155 -5
- package/dist/{text-field-CiOmDM_8.d.ts → text-field-DARNdj14.d.ts} +155 -5
- package/package.json +3 -3
package/dist/navigation.js
CHANGED
|
@@ -5,8 +5,9 @@ var react = require('motion/react');
|
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
var
|
|
8
|
+
var React38 = require('react');
|
|
9
9
|
var RxContextMenu = require('@radix-ui/react-context-menu');
|
|
10
|
+
var RadixScrollArea = require('@radix-ui/react-scroll-area');
|
|
10
11
|
var m3Tokens = require('@bug-on/m3-tokens');
|
|
11
12
|
var DropdownMenu = require('@radix-ui/react-dropdown-menu');
|
|
12
13
|
var reactSlot = require('@radix-ui/react-slot');
|
|
@@ -31,8 +32,9 @@ function _interopNamespace(e) {
|
|
|
31
32
|
return Object.freeze(n);
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
var
|
|
35
|
+
var React38__namespace = /*#__PURE__*/_interopNamespace(React38);
|
|
35
36
|
var RxContextMenu__namespace = /*#__PURE__*/_interopNamespace(RxContextMenu);
|
|
37
|
+
var RadixScrollArea__namespace = /*#__PURE__*/_interopNamespace(RadixScrollArea);
|
|
36
38
|
var DropdownMenu__namespace = /*#__PURE__*/_interopNamespace(DropdownMenu);
|
|
37
39
|
|
|
38
40
|
var __defProp = Object.defineProperty;
|
|
@@ -316,6 +318,127 @@ function AppBarItemButton({ item }) {
|
|
|
316
318
|
}
|
|
317
319
|
);
|
|
318
320
|
}
|
|
321
|
+
var ScrollArea = React38__namespace.forwardRef(
|
|
322
|
+
(_a, ref) => {
|
|
323
|
+
var _b = _a, {
|
|
324
|
+
className,
|
|
325
|
+
viewportClassName,
|
|
326
|
+
children,
|
|
327
|
+
type = "hover",
|
|
328
|
+
orientation = "vertical",
|
|
329
|
+
scrollHideDelay = 600,
|
|
330
|
+
viewportRef,
|
|
331
|
+
viewportProps
|
|
332
|
+
} = _b, props = __objRest(_b, [
|
|
333
|
+
"className",
|
|
334
|
+
"viewportClassName",
|
|
335
|
+
"children",
|
|
336
|
+
"type",
|
|
337
|
+
"orientation",
|
|
338
|
+
"scrollHideDelay",
|
|
339
|
+
"viewportRef",
|
|
340
|
+
"viewportProps"
|
|
341
|
+
]);
|
|
342
|
+
const [isTouchDevice, setIsTouchDevice] = React38__namespace.useState(false);
|
|
343
|
+
React38__namespace.useEffect(() => {
|
|
344
|
+
if (typeof window !== "undefined") {
|
|
345
|
+
setIsTouchDevice(
|
|
346
|
+
"ontouchstart" in window || navigator.maxTouchPoints > 0
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
}, []);
|
|
350
|
+
const resolvedType = React38__namespace.useMemo(() => {
|
|
351
|
+
if (type === "hover" && isTouchDevice) {
|
|
352
|
+
return "scroll";
|
|
353
|
+
}
|
|
354
|
+
return type;
|
|
355
|
+
}, [type, isTouchDevice]);
|
|
356
|
+
const radixType = resolvedType === "none" ? "always" : resolvedType;
|
|
357
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
358
|
+
RadixScrollArea__namespace.Root,
|
|
359
|
+
__spreadProps(__spreadValues({
|
|
360
|
+
ref,
|
|
361
|
+
type: radixType,
|
|
362
|
+
scrollHideDelay,
|
|
363
|
+
className: cn("relative overflow-hidden flex flex-col", className)
|
|
364
|
+
}, props), {
|
|
365
|
+
children: [
|
|
366
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
367
|
+
RadixScrollArea__namespace.Viewport,
|
|
368
|
+
__spreadProps(__spreadValues({
|
|
369
|
+
ref: viewportRef
|
|
370
|
+
}, viewportProps), {
|
|
371
|
+
className: cn(
|
|
372
|
+
"h-full w-full flex-1 min-h-0 min-w-0 rounded-[inherit]",
|
|
373
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-1",
|
|
374
|
+
viewportClassName,
|
|
375
|
+
viewportProps == null ? void 0 : viewportProps.className
|
|
376
|
+
),
|
|
377
|
+
children
|
|
378
|
+
})
|
|
379
|
+
),
|
|
380
|
+
(orientation === "vertical" || orientation === "both") && /* @__PURE__ */ jsxRuntime.jsx(
|
|
381
|
+
ScrollAreaScrollbar,
|
|
382
|
+
{
|
|
383
|
+
orientation: "vertical",
|
|
384
|
+
className: resolvedType === "none" ? "hidden" : void 0
|
|
385
|
+
}
|
|
386
|
+
),
|
|
387
|
+
(orientation === "horizontal" || orientation === "both") && /* @__PURE__ */ jsxRuntime.jsx(
|
|
388
|
+
ScrollAreaScrollbar,
|
|
389
|
+
{
|
|
390
|
+
orientation: "horizontal",
|
|
391
|
+
className: resolvedType === "none" ? "hidden" : void 0
|
|
392
|
+
}
|
|
393
|
+
),
|
|
394
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixScrollArea__namespace.Corner, { className: "bg-m3-surface-container" })
|
|
395
|
+
]
|
|
396
|
+
})
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
);
|
|
400
|
+
ScrollArea.displayName = "ScrollArea";
|
|
401
|
+
var ScrollAreaScrollbar = React38__namespace.forwardRef((_a, ref) => {
|
|
402
|
+
var _b = _a, { className, orientation = "vertical" } = _b, props = __objRest(_b, ["className", "orientation"]);
|
|
403
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
404
|
+
RadixScrollArea__namespace.Scrollbar,
|
|
405
|
+
__spreadProps(__spreadValues({
|
|
406
|
+
ref,
|
|
407
|
+
orientation,
|
|
408
|
+
className: cn(
|
|
409
|
+
"flex touch-none select-none transition-all duration-300 ease-in-out",
|
|
410
|
+
"absolute z-50",
|
|
411
|
+
orientation === "vertical" && "right-0 top-0 bottom-0 w-2.5 border-l border-l-transparent p-px",
|
|
412
|
+
orientation === "horizontal" && "bottom-0 left-0 right-0 h-2.5 flex-col border-t border-t-transparent p-px",
|
|
413
|
+
"data-[state=hidden]:opacity-0 data-[state=visible]:opacity-100",
|
|
414
|
+
className
|
|
415
|
+
)
|
|
416
|
+
}, props), {
|
|
417
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
418
|
+
RadixScrollArea__namespace.Thumb,
|
|
419
|
+
{
|
|
420
|
+
className: cn(
|
|
421
|
+
"relative flex-1 rounded-full bg-m3-on-surface/25 transition-colors duration-200",
|
|
422
|
+
"hover:bg-m3-on-surface/40 active:bg-m3-on-surface/55",
|
|
423
|
+
"before:absolute before:left-1/2 before:top-1/2 before:min-h-11 before:min-w-11 before:-translate-x-1/2 before:-translate-y-1/2"
|
|
424
|
+
)
|
|
425
|
+
}
|
|
426
|
+
)
|
|
427
|
+
})
|
|
428
|
+
);
|
|
429
|
+
});
|
|
430
|
+
ScrollAreaScrollbar.displayName = RadixScrollArea__namespace.Scrollbar.displayName;
|
|
431
|
+
var ScrollAreaCorner = React38__namespace.forwardRef((_a, ref) => {
|
|
432
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
433
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
434
|
+
RadixScrollArea__namespace.Corner,
|
|
435
|
+
__spreadValues({
|
|
436
|
+
ref,
|
|
437
|
+
className: cn("bg-m3-surface-container", className)
|
|
438
|
+
}, props)
|
|
439
|
+
);
|
|
440
|
+
});
|
|
441
|
+
ScrollAreaCorner.displayName = "ScrollAreaCorner";
|
|
319
442
|
|
|
320
443
|
// src/ui/menu/menu-animations.ts
|
|
321
444
|
var FAST_EFFECTS_TRANSITION = {
|
|
@@ -374,7 +497,7 @@ var SUBMENU_CONTAINER_VARIANTS = {
|
|
|
374
497
|
transition: FAST_EFFECTS_TRANSITION
|
|
375
498
|
}
|
|
376
499
|
};
|
|
377
|
-
var MenuContext =
|
|
500
|
+
var MenuContext = React38__namespace.createContext({
|
|
378
501
|
variant: "baseline",
|
|
379
502
|
colorVariant: "standard",
|
|
380
503
|
density: 0,
|
|
@@ -392,7 +515,7 @@ function MenuProvider({
|
|
|
392
515
|
onOpenChange,
|
|
393
516
|
children
|
|
394
517
|
}) {
|
|
395
|
-
const value =
|
|
518
|
+
const value = React38__namespace.useMemo(
|
|
396
519
|
() => ({
|
|
397
520
|
variant,
|
|
398
521
|
colorVariant,
|
|
@@ -406,8 +529,8 @@ function MenuProvider({
|
|
|
406
529
|
return /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value, children });
|
|
407
530
|
}
|
|
408
531
|
function useMenuContext() {
|
|
409
|
-
const ctx =
|
|
410
|
-
return
|
|
532
|
+
const ctx = React38__namespace.useContext(MenuContext);
|
|
533
|
+
return React38__namespace.useMemo(
|
|
411
534
|
() => Object.assign(ctx, {
|
|
412
535
|
get isStatic() {
|
|
413
536
|
return ctx.menuPrimitive === "static";
|
|
@@ -527,10 +650,10 @@ var VIBRANT_COLORS = {
|
|
|
527
650
|
var DIVIDER_PADDING = "mx-3 my-0.5";
|
|
528
651
|
var DIVIDER_COLOR = "bg-m3-outline-variant";
|
|
529
652
|
function flattenChildren(nodes) {
|
|
530
|
-
return
|
|
653
|
+
return React38__namespace.Children.toArray(nodes).reduce(
|
|
531
654
|
(acc, child) => {
|
|
532
|
-
if (!
|
|
533
|
-
if (child.type ===
|
|
655
|
+
if (!React38__namespace.isValidElement(child)) return acc;
|
|
656
|
+
if (child.type === React38__namespace.Fragment) {
|
|
534
657
|
return acc.concat(
|
|
535
658
|
flattenChildren(
|
|
536
659
|
child.props.children
|
|
@@ -548,7 +671,7 @@ function ContextMenu({
|
|
|
548
671
|
variant = "baseline",
|
|
549
672
|
colorVariant = "standard"
|
|
550
673
|
}) {
|
|
551
|
-
const [open, setOpen] =
|
|
674
|
+
const [open, setOpen] = React38__namespace.useState(false);
|
|
552
675
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
553
676
|
MenuProvider,
|
|
554
677
|
{
|
|
@@ -562,24 +685,30 @@ function ContextMenu({
|
|
|
562
685
|
);
|
|
563
686
|
}
|
|
564
687
|
ContextMenu.displayName = "ContextMenu";
|
|
565
|
-
var ContextMenuTrigger =
|
|
688
|
+
var ContextMenuTrigger = React38__namespace.forwardRef((_a, ref) => {
|
|
566
689
|
var _b = _a, { children, asChild = true } = _b, props = __objRest(_b, ["children", "asChild"]);
|
|
567
690
|
return /* @__PURE__ */ jsxRuntime.jsx(RxContextMenu__namespace.Trigger, __spreadProps(__spreadValues({ ref, asChild }, props), { children }));
|
|
568
691
|
});
|
|
569
692
|
ContextMenuTrigger.displayName = "ContextMenuTrigger";
|
|
570
|
-
var ContextMenuContent =
|
|
693
|
+
var ContextMenuContent = React38__namespace.forwardRef(
|
|
571
694
|
(_a, ref) => {
|
|
572
695
|
var _b = _a, {
|
|
573
696
|
children,
|
|
574
697
|
hasOverflow = false,
|
|
575
698
|
colorVariant: propColorVariant,
|
|
576
699
|
separatorStyle = "gap",
|
|
700
|
+
maxHeight = "360px",
|
|
701
|
+
viewportRef,
|
|
702
|
+
onViewportRef,
|
|
577
703
|
className
|
|
578
704
|
} = _b, props = __objRest(_b, [
|
|
579
705
|
"children",
|
|
580
706
|
"hasOverflow",
|
|
581
707
|
"colorVariant",
|
|
582
708
|
"separatorStyle",
|
|
709
|
+
"maxHeight",
|
|
710
|
+
"viewportRef",
|
|
711
|
+
"onViewportRef",
|
|
583
712
|
"className"
|
|
584
713
|
]);
|
|
585
714
|
const {
|
|
@@ -590,7 +719,18 @@ var ContextMenuContent = React37__namespace.forwardRef(
|
|
|
590
719
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
591
720
|
const colors = variant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
592
721
|
const isExpressiveGap = variant === "expressive" && separatorStyle === "gap";
|
|
593
|
-
const
|
|
722
|
+
const setViewportNode = React38__namespace.useCallback(
|
|
723
|
+
(node) => {
|
|
724
|
+
if (typeof viewportRef === "function") {
|
|
725
|
+
viewportRef(node);
|
|
726
|
+
} else if (viewportRef && typeof viewportRef === "object") {
|
|
727
|
+
viewportRef.current = node;
|
|
728
|
+
}
|
|
729
|
+
onViewportRef == null ? void 0 : onViewportRef(node);
|
|
730
|
+
},
|
|
731
|
+
[viewportRef, onViewportRef]
|
|
732
|
+
);
|
|
733
|
+
const containerClassName = React38__namespace.useMemo(
|
|
594
734
|
() => variant === "expressive" ? cn(
|
|
595
735
|
"z-50 flex flex-col w-full",
|
|
596
736
|
MENU_MIN_WIDTH,
|
|
@@ -617,12 +757,12 @@ var ContextMenuContent = React37__namespace.forwardRef(
|
|
|
617
757
|
),
|
|
618
758
|
[variant, isExpressiveGap, hasOverflow, className, colors.containerBg]
|
|
619
759
|
);
|
|
620
|
-
const renderedChildren =
|
|
760
|
+
const renderedChildren = React38__namespace.useMemo(() => {
|
|
621
761
|
if (variant !== "expressive") return children;
|
|
622
762
|
const validChildren = flattenChildren(children);
|
|
623
763
|
const groupCount = validChildren.length;
|
|
624
764
|
const enhanced = validChildren.map(
|
|
625
|
-
(child, i) =>
|
|
765
|
+
(child, i) => React38__namespace.cloneElement(
|
|
626
766
|
child,
|
|
627
767
|
{ index: i, count: groupCount, isGapVariant: isExpressiveGap }
|
|
628
768
|
)
|
|
@@ -655,7 +795,15 @@ var ContextMenuContent = React37__namespace.forwardRef(
|
|
|
655
795
|
style: __spreadProps(__spreadValues({}, props.style), {
|
|
656
796
|
transformOrigin: "var(--radix-context-menu-content-transform-origin)"
|
|
657
797
|
}),
|
|
658
|
-
children: renderedChildren
|
|
798
|
+
children: hasOverflow || !maxHeight ? renderedChildren : /* @__PURE__ */ jsxRuntime.jsx(
|
|
799
|
+
ScrollArea,
|
|
800
|
+
{
|
|
801
|
+
style: { maxHeight },
|
|
802
|
+
className: "w-full flex-1 min-h-0",
|
|
803
|
+
viewportRef: setViewportNode,
|
|
804
|
+
children: renderedChildren
|
|
805
|
+
}
|
|
806
|
+
)
|
|
659
807
|
}
|
|
660
808
|
) })) }) });
|
|
661
809
|
}
|
|
@@ -683,12 +831,12 @@ function Menu(_a) {
|
|
|
683
831
|
]);
|
|
684
832
|
var _a2;
|
|
685
833
|
const resolvedVariant = (_a2 = variant != null ? variant : menuVariant) != null ? _a2 : "baseline";
|
|
686
|
-
const [internalOpen, setInternalOpen] =
|
|
834
|
+
const [internalOpen, setInternalOpen] = React38__namespace.useState(
|
|
687
835
|
() => defaultOpen != null ? defaultOpen : false
|
|
688
836
|
);
|
|
689
837
|
const isControlled = controlledOpen !== void 0;
|
|
690
838
|
const open = isControlled ? controlledOpen : internalOpen;
|
|
691
|
-
const handleOpenChange =
|
|
839
|
+
const handleOpenChange = React38__namespace.useCallback(
|
|
692
840
|
(next) => {
|
|
693
841
|
if (!isControlled) setInternalOpen(next);
|
|
694
842
|
controlledOnOpenChange == null ? void 0 : controlledOnOpenChange(next);
|
|
@@ -716,12 +864,12 @@ function Menu(_a) {
|
|
|
716
864
|
);
|
|
717
865
|
}
|
|
718
866
|
Menu.displayName = "Menu";
|
|
719
|
-
var MenuTrigger =
|
|
867
|
+
var MenuTrigger = React38__namespace.forwardRef((_a, ref) => {
|
|
720
868
|
var _b = _a, { children, asChild = true } = _b, props = __objRest(_b, ["children", "asChild"]);
|
|
721
869
|
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Trigger, __spreadProps(__spreadValues({ ref, asChild }, props), { children }));
|
|
722
870
|
});
|
|
723
871
|
MenuTrigger.displayName = "MenuTrigger";
|
|
724
|
-
var MenuContent =
|
|
872
|
+
var MenuContent = React38__namespace.forwardRef(
|
|
725
873
|
(_a, ref) => {
|
|
726
874
|
var _b = _a, {
|
|
727
875
|
children,
|
|
@@ -732,6 +880,9 @@ var MenuContent = React37__namespace.forwardRef(
|
|
|
732
880
|
colorVariant: propColorVariant,
|
|
733
881
|
separatorStyle = "gap",
|
|
734
882
|
matchTriggerWidth = false,
|
|
883
|
+
maxHeight = "360px",
|
|
884
|
+
viewportRef,
|
|
885
|
+
onViewportRef,
|
|
735
886
|
className
|
|
736
887
|
} = _b, props = __objRest(_b, [
|
|
737
888
|
"children",
|
|
@@ -742,6 +893,9 @@ var MenuContent = React37__namespace.forwardRef(
|
|
|
742
893
|
"colorVariant",
|
|
743
894
|
"separatorStyle",
|
|
744
895
|
"matchTriggerWidth",
|
|
896
|
+
"maxHeight",
|
|
897
|
+
"viewportRef",
|
|
898
|
+
"onViewportRef",
|
|
745
899
|
"className"
|
|
746
900
|
]);
|
|
747
901
|
const {
|
|
@@ -752,7 +906,18 @@ var MenuContent = React37__namespace.forwardRef(
|
|
|
752
906
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
753
907
|
const colors = variant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
754
908
|
const isExpressiveGap = variant === "expressive" && separatorStyle === "gap";
|
|
755
|
-
const
|
|
909
|
+
const setViewportNode = React38__namespace.useCallback(
|
|
910
|
+
(node) => {
|
|
911
|
+
if (typeof viewportRef === "function") {
|
|
912
|
+
viewportRef(node);
|
|
913
|
+
} else if (viewportRef && typeof viewportRef === "object") {
|
|
914
|
+
viewportRef.current = node;
|
|
915
|
+
}
|
|
916
|
+
onViewportRef == null ? void 0 : onViewportRef(node);
|
|
917
|
+
},
|
|
918
|
+
[viewportRef, onViewportRef]
|
|
919
|
+
);
|
|
920
|
+
const containerClassName = React38__namespace.useMemo(() => {
|
|
756
921
|
const widthClass = matchTriggerWidth ? "w-[var(--radix-dropdown-menu-trigger-width)]" : cn(MENU_MIN_WIDTH, MENU_MAX_WIDTH);
|
|
757
922
|
return variant === "expressive" ? cn(
|
|
758
923
|
"z-50 flex flex-col",
|
|
@@ -785,7 +950,7 @@ var MenuContent = React37__namespace.forwardRef(
|
|
|
785
950
|
className,
|
|
786
951
|
colors.containerBg
|
|
787
952
|
]);
|
|
788
|
-
const renderedChildren =
|
|
953
|
+
const renderedChildren = React38__namespace.useMemo(() => {
|
|
789
954
|
if (variant !== "expressive") return children;
|
|
790
955
|
const validChildren = flattenChildren(children);
|
|
791
956
|
const groupCount = validChildren.length;
|
|
@@ -794,7 +959,7 @@ var MenuContent = React37__namespace.forwardRef(
|
|
|
794
959
|
if (typeof child.type === "string") return child;
|
|
795
960
|
const defaultItemPosition = groupCount === 1 ? "standalone" : i === 0 ? "leading" : i === groupCount - 1 ? "trailing" : "middle";
|
|
796
961
|
const itemPosition = (_a2 = child.props.itemPosition) != null ? _a2 : defaultItemPosition;
|
|
797
|
-
return
|
|
962
|
+
return React38__namespace.cloneElement(
|
|
798
963
|
child,
|
|
799
964
|
{
|
|
800
965
|
index: i,
|
|
@@ -844,7 +1009,15 @@ var MenuContent = React37__namespace.forwardRef(
|
|
|
844
1009
|
style: __spreadProps(__spreadValues({}, props.style), {
|
|
845
1010
|
transformOrigin: "var(--radix-dropdown-menu-content-transform-origin)"
|
|
846
1011
|
}),
|
|
847
|
-
children: renderedChildren
|
|
1012
|
+
children: hasOverflow || !maxHeight ? renderedChildren : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1013
|
+
ScrollArea,
|
|
1014
|
+
{
|
|
1015
|
+
style: { maxHeight },
|
|
1016
|
+
className: "w-full flex-1 min-h-0",
|
|
1017
|
+
viewportRef: setViewportNode,
|
|
1018
|
+
children: renderedChildren
|
|
1019
|
+
}
|
|
1020
|
+
)
|
|
848
1021
|
}
|
|
849
1022
|
)
|
|
850
1023
|
})
|
|
@@ -852,7 +1025,7 @@ var MenuContent = React37__namespace.forwardRef(
|
|
|
852
1025
|
}
|
|
853
1026
|
);
|
|
854
1027
|
MenuContent.displayName = "MenuContent";
|
|
855
|
-
var MenuDivider =
|
|
1028
|
+
var MenuDivider = React38__namespace.forwardRef(
|
|
856
1029
|
(_a, ref) => {
|
|
857
1030
|
var _b = _a, { className, isGapVariant: _isGapVariant } = _b, props = __objRest(_b, ["className", "isGapVariant"]);
|
|
858
1031
|
const { menuVariant } = useMenuContext();
|
|
@@ -883,7 +1056,7 @@ function getGroupPosition(index, count) {
|
|
|
883
1056
|
function getGroupActiveShape(position) {
|
|
884
1057
|
return GROUP_SHAPES[`${position}Active`];
|
|
885
1058
|
}
|
|
886
|
-
var MenuGroup =
|
|
1059
|
+
var MenuGroup = React38__namespace.forwardRef(
|
|
887
1060
|
(_a, ref) => {
|
|
888
1061
|
var _b = _a, {
|
|
889
1062
|
children,
|
|
@@ -909,7 +1082,7 @@ var MenuGroup = React37__namespace.forwardRef(
|
|
|
909
1082
|
const colors = menuVariant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
910
1083
|
const position = getGroupPosition(index, count);
|
|
911
1084
|
const currentShape = getGroupActiveShape(position);
|
|
912
|
-
const enhancedChildren =
|
|
1085
|
+
const enhancedChildren = React38__namespace.useMemo(() => {
|
|
913
1086
|
const valid = flattenChildren(children);
|
|
914
1087
|
const itemCount = valid.length;
|
|
915
1088
|
return valid.map((child, i) => {
|
|
@@ -917,7 +1090,7 @@ var MenuGroup = React37__namespace.forwardRef(
|
|
|
917
1090
|
if (typeof child.type === "string") return child;
|
|
918
1091
|
const defaultItemPosition = itemCount === 1 ? "standalone" : i === 0 ? "leading" : i === itemCount - 1 ? "trailing" : "middle";
|
|
919
1092
|
const itemPosition2 = (_a2 = child.props.itemPosition) != null ? _a2 : defaultItemPosition;
|
|
920
|
-
return
|
|
1093
|
+
return React38__namespace.cloneElement(child, {
|
|
921
1094
|
itemPosition: itemPosition2,
|
|
922
1095
|
colorVariant
|
|
923
1096
|
});
|
|
@@ -980,7 +1153,7 @@ var VARIANT_FONT = {
|
|
|
980
1153
|
rounded: "'Material Symbols Rounded'",
|
|
981
1154
|
sharp: "'Material Symbols Sharp'"
|
|
982
1155
|
};
|
|
983
|
-
var IconComponent =
|
|
1156
|
+
var IconComponent = React38__namespace.forwardRef(
|
|
984
1157
|
(_a, ref) => {
|
|
985
1158
|
var _b = _a, {
|
|
986
1159
|
name,
|
|
@@ -1046,14 +1219,14 @@ var IconComponent = React37__namespace.forwardRef(
|
|
|
1046
1219
|
}
|
|
1047
1220
|
);
|
|
1048
1221
|
IconComponent.displayName = "Icon";
|
|
1049
|
-
var Icon =
|
|
1222
|
+
var Icon = React38__namespace.memo(IconComponent);
|
|
1050
1223
|
function getItemShapeClass(position, selected, isStatic = false, menuVariant = "expressive") {
|
|
1051
1224
|
if (menuVariant === "baseline") return BASELINE_ITEM_SHAPE;
|
|
1052
1225
|
if (selected) return ITEM_SHAPE_CLASSES.selected;
|
|
1053
1226
|
if (isStatic && position === "standalone") return "rounded-[12px]";
|
|
1054
1227
|
return ITEM_SHAPE_CLASSES[position];
|
|
1055
1228
|
}
|
|
1056
|
-
var MenuItem =
|
|
1229
|
+
var MenuItem = React38__namespace.forwardRef(
|
|
1057
1230
|
(_a, ref) => {
|
|
1058
1231
|
var _b = _a, {
|
|
1059
1232
|
children,
|
|
@@ -1262,31 +1435,31 @@ function SubMenu({
|
|
|
1262
1435
|
}) {
|
|
1263
1436
|
const { colorVariant: contextColorVariant, menuPrimitive } = useMenuContext();
|
|
1264
1437
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1265
|
-
const [open, setOpen] =
|
|
1266
|
-
const openTimerRef =
|
|
1267
|
-
const closeTimerRef =
|
|
1438
|
+
const [open, setOpen] = React38__namespace.useState(false);
|
|
1439
|
+
const openTimerRef = React38__namespace.useRef(null);
|
|
1440
|
+
const closeTimerRef = React38__namespace.useRef(
|
|
1268
1441
|
null
|
|
1269
1442
|
);
|
|
1270
|
-
const clearTimers =
|
|
1443
|
+
const clearTimers = React38__namespace.useCallback(() => {
|
|
1271
1444
|
if (openTimerRef.current) clearTimeout(openTimerRef.current);
|
|
1272
1445
|
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
1273
1446
|
}, []);
|
|
1274
|
-
const handleTriggerPointerEnter =
|
|
1447
|
+
const handleTriggerPointerEnter = React38__namespace.useCallback(() => {
|
|
1275
1448
|
clearTimers();
|
|
1276
1449
|
openTimerRef.current = setTimeout(() => setOpen(true), hoverOpenDelay);
|
|
1277
1450
|
}, [hoverOpenDelay, clearTimers]);
|
|
1278
|
-
const handleTriggerPointerLeave =
|
|
1451
|
+
const handleTriggerPointerLeave = React38__namespace.useCallback(() => {
|
|
1279
1452
|
clearTimers();
|
|
1280
1453
|
closeTimerRef.current = setTimeout(() => setOpen(false), hoverCloseDelay);
|
|
1281
1454
|
}, [hoverCloseDelay, clearTimers]);
|
|
1282
|
-
const handleContentPointerEnter =
|
|
1455
|
+
const handleContentPointerEnter = React38__namespace.useCallback(() => {
|
|
1283
1456
|
clearTimers();
|
|
1284
1457
|
}, [clearTimers]);
|
|
1285
|
-
const handleContentPointerLeave =
|
|
1458
|
+
const handleContentPointerLeave = React38__namespace.useCallback(() => {
|
|
1286
1459
|
clearTimers();
|
|
1287
1460
|
closeTimerRef.current = setTimeout(() => setOpen(false), hoverCloseDelay);
|
|
1288
1461
|
}, [hoverCloseDelay, clearTimers]);
|
|
1289
|
-
|
|
1462
|
+
React38__namespace.useEffect(() => () => clearTimers(), [clearTimers]);
|
|
1290
1463
|
const Sub3 = menuPrimitive === "context" ? RxContextMenu__namespace.Sub : DropdownMenu__namespace.Sub;
|
|
1291
1464
|
const SubTrigger3 = menuPrimitive === "context" ? RxContextMenu__namespace.SubTrigger : DropdownMenu__namespace.SubTrigger;
|
|
1292
1465
|
const SubContent3 = menuPrimitive === "context" ? RxContextMenu__namespace.SubContent : DropdownMenu__namespace.SubContent;
|
|
@@ -1298,7 +1471,7 @@ function SubMenu({
|
|
|
1298
1471
|
className: "w-full outline-none",
|
|
1299
1472
|
onPointerEnter: handleTriggerPointerEnter,
|
|
1300
1473
|
onPointerLeave: handleTriggerPointerLeave,
|
|
1301
|
-
children:
|
|
1474
|
+
children: React38__namespace.isValidElement(trigger) ? React38__namespace.cloneElement(trigger, {
|
|
1302
1475
|
isSubTrigger: true,
|
|
1303
1476
|
// Auto-add chevron if missing
|
|
1304
1477
|
trailingIcon: trigger.props.trailingIcon || /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron_right", size: 20 })
|
|
@@ -1375,7 +1548,7 @@ function SubMenuContent({
|
|
|
1375
1548
|
);
|
|
1376
1549
|
}
|
|
1377
1550
|
SubMenuContent.displayName = "SubMenuContent";
|
|
1378
|
-
var VerticalMenuDivider =
|
|
1551
|
+
var VerticalMenuDivider = React38__namespace.forwardRef((_a, ref) => {
|
|
1379
1552
|
var _b = _a, { className, index, count, isGapVariant } = _b, props = __objRest(_b, ["className", "index", "count", "isGapVariant"]);
|
|
1380
1553
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1381
1554
|
"hr",
|
|
@@ -1395,7 +1568,7 @@ var VerticalMenuDivider = React37__namespace.forwardRef((_a, ref) => {
|
|
|
1395
1568
|
});
|
|
1396
1569
|
VerticalMenuDivider.displayName = "VerticalMenuDivider";
|
|
1397
1570
|
var VerticalMenuGroup = MenuGroup;
|
|
1398
|
-
var VerticalMenuContent =
|
|
1571
|
+
var VerticalMenuContent = React38__namespace.forwardRef(
|
|
1399
1572
|
(_a, ref) => {
|
|
1400
1573
|
var _b = _a, {
|
|
1401
1574
|
children,
|
|
@@ -1411,7 +1584,7 @@ var VerticalMenuContent = React37__namespace.forwardRef(
|
|
|
1411
1584
|
const { colorVariant: contextColorVariant } = useMenuContext();
|
|
1412
1585
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1413
1586
|
const colors = colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1414
|
-
const renderedChildren =
|
|
1587
|
+
const renderedChildren = React38__namespace.useMemo(() => {
|
|
1415
1588
|
const valid = flattenChildren(children);
|
|
1416
1589
|
const groupCount = valid.length;
|
|
1417
1590
|
const enhanced = valid.map((child, i) => {
|
|
@@ -1419,7 +1592,7 @@ var VerticalMenuContent = React37__namespace.forwardRef(
|
|
|
1419
1592
|
if (typeof child.type === "string") return child;
|
|
1420
1593
|
const defaultItemPosition = groupCount === 1 ? "standalone" : i === 0 ? "leading" : i === groupCount - 1 ? "trailing" : "middle";
|
|
1421
1594
|
const itemPosition = (_a2 = child.props.itemPosition) != null ? _a2 : defaultItemPosition;
|
|
1422
|
-
return
|
|
1595
|
+
return React38__namespace.cloneElement(
|
|
1423
1596
|
child,
|
|
1424
1597
|
{
|
|
1425
1598
|
index: i,
|
|
@@ -1462,13 +1635,13 @@ var VerticalMenuContent = React37__namespace.forwardRef(
|
|
|
1462
1635
|
}
|
|
1463
1636
|
);
|
|
1464
1637
|
VerticalMenuContent.displayName = "VerticalMenuContent";
|
|
1465
|
-
var VerticalMenu =
|
|
1638
|
+
var VerticalMenu = React38__namespace.forwardRef((_a, ref) => {
|
|
1466
1639
|
var _b = _a, { children, colorVariant = "standard", className } = _b, props = __objRest(_b, ["children", "colorVariant", "className"]);
|
|
1467
|
-
const noop =
|
|
1640
|
+
const noop = React38__namespace.useCallback(() => {
|
|
1468
1641
|
}, []);
|
|
1469
1642
|
const colors = colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1470
|
-
const containerRef =
|
|
1471
|
-
const mergedRef =
|
|
1643
|
+
const containerRef = React38__namespace.useRef(null);
|
|
1644
|
+
const mergedRef = React38__namespace.useCallback(
|
|
1472
1645
|
(node) => {
|
|
1473
1646
|
containerRef.current = node;
|
|
1474
1647
|
if (typeof ref === "function") ref(node);
|
|
@@ -1477,7 +1650,7 @@ var VerticalMenu = React37__namespace.forwardRef((_a, ref) => {
|
|
|
1477
1650
|
},
|
|
1478
1651
|
[ref]
|
|
1479
1652
|
);
|
|
1480
|
-
const handleKeyDown =
|
|
1653
|
+
const handleKeyDown = React38__namespace.useCallback(
|
|
1481
1654
|
(e) => {
|
|
1482
1655
|
var _a2;
|
|
1483
1656
|
if (!containerRef.current) return;
|
|
@@ -1560,7 +1733,7 @@ var VerticalMenu = React37__namespace.forwardRef((_a, ref) => {
|
|
|
1560
1733
|
});
|
|
1561
1734
|
VerticalMenu.displayName = "VerticalMenu";
|
|
1562
1735
|
function detectSeparatorStyle(children) {
|
|
1563
|
-
const child =
|
|
1736
|
+
const child = React38__namespace.Children.toArray(children).find(React38__namespace.isValidElement);
|
|
1564
1737
|
if (child) {
|
|
1565
1738
|
const style = child.props.separatorStyle;
|
|
1566
1739
|
if (style) return style;
|
|
@@ -1641,11 +1814,11 @@ function AppBarColumn({
|
|
|
1641
1814
|
maxItemCount,
|
|
1642
1815
|
className
|
|
1643
1816
|
}) {
|
|
1644
|
-
const containerRef =
|
|
1645
|
-
const [visibleCount, setVisibleCount] =
|
|
1817
|
+
const containerRef = React38__namespace.useRef(null);
|
|
1818
|
+
const [visibleCount, setVisibleCount] = React38__namespace.useState(
|
|
1646
1819
|
maxItemCount != null ? maxItemCount : items.length
|
|
1647
1820
|
);
|
|
1648
|
-
|
|
1821
|
+
React38__namespace.useEffect(() => {
|
|
1649
1822
|
if (maxItemCount !== void 0) {
|
|
1650
1823
|
setVisibleCount(Math.min(maxItemCount, items.length));
|
|
1651
1824
|
return;
|
|
@@ -1693,11 +1866,11 @@ function AppBarColumn({
|
|
|
1693
1866
|
);
|
|
1694
1867
|
}
|
|
1695
1868
|
function AppBarRow({ items, maxItemCount, className }) {
|
|
1696
|
-
const containerRef =
|
|
1697
|
-
const [visibleCount, setVisibleCount] =
|
|
1869
|
+
const containerRef = React38__namespace.useRef(null);
|
|
1870
|
+
const [visibleCount, setVisibleCount] = React38__namespace.useState(
|
|
1698
1871
|
maxItemCount != null ? maxItemCount : items.length
|
|
1699
1872
|
);
|
|
1700
|
-
|
|
1873
|
+
React38__namespace.useEffect(() => {
|
|
1701
1874
|
if (maxItemCount !== void 0) {
|
|
1702
1875
|
setVisibleCount(Math.min(maxItemCount, items.length));
|
|
1703
1876
|
return;
|
|
@@ -1751,12 +1924,12 @@ function useAppBarScroll({
|
|
|
1751
1924
|
collapsedHeight = 64,
|
|
1752
1925
|
expandedHeight = 112
|
|
1753
1926
|
} = {}) {
|
|
1754
|
-
const [isScrolled, setIsScrolled] =
|
|
1755
|
-
const [collapsedFraction, setCollapsedFraction] =
|
|
1756
|
-
const [isHidden, setIsHidden] =
|
|
1757
|
-
const prevScrollYRef =
|
|
1927
|
+
const [isScrolled, setIsScrolled] = React38__namespace.useState(false);
|
|
1928
|
+
const [collapsedFraction, setCollapsedFraction] = React38__namespace.useState(0);
|
|
1929
|
+
const [isHidden, setIsHidden] = React38__namespace.useState(false);
|
|
1930
|
+
const prevScrollYRef = React38__namespace.useRef(0);
|
|
1758
1931
|
const hideThreshold = 64;
|
|
1759
|
-
|
|
1932
|
+
React38__namespace.useEffect(() => {
|
|
1760
1933
|
var _a;
|
|
1761
1934
|
const scrollDistance = expandedHeight - collapsedHeight;
|
|
1762
1935
|
const getScrollY = () => {
|
|
@@ -1891,7 +2064,7 @@ function useFlexibleAppBar({
|
|
|
1891
2064
|
expandedHeight
|
|
1892
2065
|
});
|
|
1893
2066
|
const scrollProgress = react.useMotionValue(0);
|
|
1894
|
-
|
|
2067
|
+
React38__namespace.useEffect(() => {
|
|
1895
2068
|
scrollProgress.set(
|
|
1896
2069
|
shouldReduceMotion ? collapsedFraction > 0.5 ? 1 : 0 : collapsedFraction
|
|
1897
2070
|
);
|
|
@@ -2269,7 +2442,7 @@ function SearchAppBar({
|
|
|
2269
2442
|
}) {
|
|
2270
2443
|
var _a, _b;
|
|
2271
2444
|
const shouldReduceMotion = react.useReducedMotion();
|
|
2272
|
-
const [isSearchOpen, setIsSearchOpen] =
|
|
2445
|
+
const [isSearchOpen, setIsSearchOpen] = React38__namespace.useState(false);
|
|
2273
2446
|
const { isScrolled } = useAppBarScroll({
|
|
2274
2447
|
scrollElement,
|
|
2275
2448
|
behavior: scrollBehavior === "exitUntilCollapsed" ? "pinned" : scrollBehavior
|
|
@@ -2410,8 +2583,8 @@ function SearchView({
|
|
|
2410
2583
|
className
|
|
2411
2584
|
}) {
|
|
2412
2585
|
const shouldReduceMotion = react.useReducedMotion();
|
|
2413
|
-
const inputRef =
|
|
2414
|
-
|
|
2586
|
+
const inputRef = React38__namespace.useRef(null);
|
|
2587
|
+
React38__namespace.useEffect(() => {
|
|
2415
2588
|
const timer = window.setTimeout(() => {
|
|
2416
2589
|
var _a;
|
|
2417
2590
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
@@ -2702,7 +2875,7 @@ function SmallAppBar({
|
|
|
2702
2875
|
"small-app-bar"
|
|
2703
2876
|
) });
|
|
2704
2877
|
}
|
|
2705
|
-
var RippleItem =
|
|
2878
|
+
var RippleItem = React38__namespace.memo(function RippleItem2({
|
|
2706
2879
|
ripple,
|
|
2707
2880
|
onDone
|
|
2708
2881
|
}) {
|
|
@@ -2746,8 +2919,8 @@ function Ripple({
|
|
|
2746
2919
|
}
|
|
2747
2920
|
function useRippleState(options = {}) {
|
|
2748
2921
|
const { disabled = false } = options;
|
|
2749
|
-
const [ripples, setRipples] =
|
|
2750
|
-
const onPointerDown =
|
|
2922
|
+
const [ripples, setRipples] = React38__namespace.useState([]);
|
|
2923
|
+
const onPointerDown = React38__namespace.useCallback(
|
|
2751
2924
|
(e) => {
|
|
2752
2925
|
if (disabled) return;
|
|
2753
2926
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -2764,7 +2937,7 @@ function useRippleState(options = {}) {
|
|
|
2764
2937
|
},
|
|
2765
2938
|
[disabled]
|
|
2766
2939
|
);
|
|
2767
|
-
const removeRipple =
|
|
2940
|
+
const removeRipple = React38__namespace.useCallback((id) => {
|
|
2768
2941
|
setRipples((prev) => prev.filter((r) => r.id !== id));
|
|
2769
2942
|
}, []);
|
|
2770
2943
|
return { ripples, onPointerDown, removeRipple };
|
|
@@ -4694,11 +4867,11 @@ function getNavigationShapeStyle(shape, width = 56, height = 56) {
|
|
|
4694
4867
|
function isSquareShape(shape) {
|
|
4695
4868
|
return Boolean(shape && shape !== "pill");
|
|
4696
4869
|
}
|
|
4697
|
-
var NavigationBarContext =
|
|
4870
|
+
var NavigationBarContext = React38__namespace.createContext({ variant: "flexible" });
|
|
4698
4871
|
function cloneIconWithFill(icon, selected) {
|
|
4699
|
-
if (!
|
|
4872
|
+
if (!React38__namespace.isValidElement(icon)) return icon;
|
|
4700
4873
|
if (icon.type === Icon) {
|
|
4701
|
-
return
|
|
4874
|
+
return React38__namespace.cloneElement(
|
|
4702
4875
|
icon,
|
|
4703
4876
|
{ fill: selected ? 1 : 0, animateFill: true }
|
|
4704
4877
|
);
|
|
@@ -4710,7 +4883,7 @@ function ActivePill({
|
|
|
4710
4883
|
width = 56,
|
|
4711
4884
|
height = 32
|
|
4712
4885
|
}) {
|
|
4713
|
-
const { activeIndicatorTransition } =
|
|
4886
|
+
const { activeIndicatorTransition } = React38__namespace.useContext(NavigationBarContext);
|
|
4714
4887
|
const shapeStyle = getNavigationShapeStyle(shape, width, height);
|
|
4715
4888
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4716
4889
|
react.m.div,
|
|
@@ -4782,7 +4955,7 @@ function IconContainer({ selected, badge, children }) {
|
|
|
4782
4955
|
}
|
|
4783
4956
|
);
|
|
4784
4957
|
}
|
|
4785
|
-
var NavigationBarItemComponent =
|
|
4958
|
+
var NavigationBarItemComponent = React38__namespace.forwardRef(
|
|
4786
4959
|
({
|
|
4787
4960
|
selected,
|
|
4788
4961
|
icon,
|
|
@@ -4806,7 +4979,7 @@ var NavigationBarItemComponent = React37__namespace.forwardRef(
|
|
|
4806
4979
|
labelVisibility: contextLabelVisibility,
|
|
4807
4980
|
shapeSize: contextShapeSize,
|
|
4808
4981
|
itemClassName: contextItemClassName
|
|
4809
|
-
} =
|
|
4982
|
+
} = React38__namespace.useContext(NavigationBarContext);
|
|
4810
4983
|
const activeShape = (_a = shapeProp != null ? shapeProp : contextShape) != null ? _a : "pill";
|
|
4811
4984
|
const isSquare = isSquareShape(activeShape);
|
|
4812
4985
|
const resolvedShapeSize = (_b = shapeSizeProp != null ? shapeSizeProp : contextShapeSize) != null ? _b : 56;
|
|
@@ -4820,7 +4993,7 @@ var NavigationBarItemComponent = React37__namespace.forwardRef(
|
|
|
4820
4993
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
4821
4994
|
disabled
|
|
4822
4995
|
});
|
|
4823
|
-
const handleClick =
|
|
4996
|
+
const handleClick = React38__namespace.useCallback(
|
|
4824
4997
|
(e) => {
|
|
4825
4998
|
if (disabled) {
|
|
4826
4999
|
e.preventDefault();
|
|
@@ -4847,7 +5020,7 @@ var NavigationBarItemComponent = React37__namespace.forwardRef(
|
|
|
4847
5020
|
const iconPillWidth = isSquare ? resolvedShapeSize : 56;
|
|
4848
5021
|
const iconPillHeight = isSquare ? resolvedShapeSize : 32;
|
|
4849
5022
|
if (asChild && children) {
|
|
4850
|
-
const child =
|
|
5023
|
+
const child = React38__namespace.Children.only(children);
|
|
4851
5024
|
const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4852
5025
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4853
5026
|
"div",
|
|
@@ -4972,7 +5145,7 @@ var NavigationBarItemComponent = React37__namespace.forwardRef(
|
|
|
4972
5145
|
onClick: handleClick,
|
|
4973
5146
|
onPointerDown,
|
|
4974
5147
|
className: itemClassName,
|
|
4975
|
-
children:
|
|
5148
|
+
children: React38__namespace.cloneElement(child, { children: innerContent })
|
|
4976
5149
|
}
|
|
4977
5150
|
);
|
|
4978
5151
|
}
|
|
@@ -5106,7 +5279,7 @@ var NavigationBarItemComponent = React37__namespace.forwardRef(
|
|
|
5106
5279
|
}
|
|
5107
5280
|
);
|
|
5108
5281
|
NavigationBarItemComponent.displayName = "NavigationBarItem";
|
|
5109
|
-
var NavigationBarItem =
|
|
5282
|
+
var NavigationBarItem = React38__namespace.memo(NavigationBarItemComponent);
|
|
5110
5283
|
var navContainerVariants = classVarianceAuthority.cva(
|
|
5111
5284
|
"flex items-center justify-center select-none transition-transform duration-300 z-50",
|
|
5112
5285
|
{
|
|
@@ -5132,7 +5305,7 @@ var navContainerVariants = classVarianceAuthority.cva(
|
|
|
5132
5305
|
}
|
|
5133
5306
|
}
|
|
5134
5307
|
);
|
|
5135
|
-
var NavigationBarComponent =
|
|
5308
|
+
var NavigationBarComponent = React38__namespace.forwardRef(
|
|
5136
5309
|
({
|
|
5137
5310
|
variant = "flexible",
|
|
5138
5311
|
itemLayout,
|
|
@@ -5149,18 +5322,18 @@ var NavigationBarComponent = React37__namespace.forwardRef(
|
|
|
5149
5322
|
className,
|
|
5150
5323
|
style
|
|
5151
5324
|
}, ref) => {
|
|
5152
|
-
const [isVisible, setIsVisible] =
|
|
5153
|
-
const lastScrollY =
|
|
5325
|
+
const [isVisible, setIsVisible] = React38__namespace.useState(true);
|
|
5326
|
+
const lastScrollY = React38__namespace.useRef(
|
|
5154
5327
|
typeof window !== "undefined" ? window.scrollY : 0
|
|
5155
5328
|
);
|
|
5156
5329
|
const isSquare = isSquareShape(shape);
|
|
5157
5330
|
const effectiveShapeSize = shapeSize != null ? shapeSize : isSquare ? 56 : 32;
|
|
5158
|
-
const computedMinHeight =
|
|
5331
|
+
const computedMinHeight = React38__namespace.useMemo(() => {
|
|
5159
5332
|
const baseHeight = variant === "baseline" ? 80 : 64;
|
|
5160
5333
|
const requiredHeight = itemLayout === "horizontal" || labelVisibility === "unlabeled" ? effectiveShapeSize + 16 : effectiveShapeSize + 32;
|
|
5161
5334
|
return Math.max(baseHeight, requiredHeight);
|
|
5162
5335
|
}, [variant, itemLayout, labelVisibility, effectiveShapeSize]);
|
|
5163
|
-
|
|
5336
|
+
React38__namespace.useEffect(() => {
|
|
5164
5337
|
if (typeof window === "undefined" || !hideOnScroll) {
|
|
5165
5338
|
setIsVisible(true);
|
|
5166
5339
|
return;
|
|
@@ -5244,8 +5417,8 @@ var NavigationBarComponent = React37__namespace.forwardRef(
|
|
|
5244
5417
|
}
|
|
5245
5418
|
);
|
|
5246
5419
|
NavigationBarComponent.displayName = "NavigationBar";
|
|
5247
|
-
var NavigationBar =
|
|
5248
|
-
var NavigationRailContext =
|
|
5420
|
+
var NavigationBar = React38__namespace.memo(NavigationBarComponent);
|
|
5421
|
+
var NavigationRailContext = React38__namespace.createContext({
|
|
5249
5422
|
variant: "collapsed",
|
|
5250
5423
|
labelVisibility: "labeled",
|
|
5251
5424
|
activeIndicatorWidth: "hug"
|
|
@@ -5281,9 +5454,9 @@ var railContainerVariants = classVarianceAuthority.cva(
|
|
|
5281
5454
|
}
|
|
5282
5455
|
);
|
|
5283
5456
|
function cloneIconWithFill2(icon, selected) {
|
|
5284
|
-
if (!
|
|
5457
|
+
if (!React38__namespace.isValidElement(icon)) return icon;
|
|
5285
5458
|
if (icon.type === Icon) {
|
|
5286
|
-
return
|
|
5459
|
+
return React38__namespace.cloneElement(
|
|
5287
5460
|
icon,
|
|
5288
5461
|
{ fill: selected ? 1 : 0, animateFill: true }
|
|
5289
5462
|
);
|
|
@@ -5312,7 +5485,7 @@ function ActivePill2({
|
|
|
5312
5485
|
width = 56,
|
|
5313
5486
|
height = 32
|
|
5314
5487
|
}) {
|
|
5315
|
-
const { activeIndicatorTransition } =
|
|
5488
|
+
const { activeIndicatorTransition } = React38__namespace.useContext(NavigationRailContext);
|
|
5316
5489
|
const shapeStyle = getNavigationShapeStyle(shape, width, height);
|
|
5317
5490
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5318
5491
|
react.m.div,
|
|
@@ -5387,7 +5560,7 @@ function IconContainer2({ selected, badge, children }) {
|
|
|
5387
5560
|
}
|
|
5388
5561
|
);
|
|
5389
5562
|
}
|
|
5390
|
-
var NavigationRailItemComponent =
|
|
5563
|
+
var NavigationRailItemComponent = React38__namespace.forwardRef(
|
|
5391
5564
|
({
|
|
5392
5565
|
selected,
|
|
5393
5566
|
icon,
|
|
@@ -5410,7 +5583,7 @@ var NavigationRailItemComponent = React37__namespace.forwardRef(
|
|
|
5410
5583
|
shape: contextShape,
|
|
5411
5584
|
shapeSize: contextShapeSize,
|
|
5412
5585
|
activeIndicatorWidth: contextActiveIndicatorWidth
|
|
5413
|
-
} =
|
|
5586
|
+
} = React38__namespace.useContext(NavigationRailContext);
|
|
5414
5587
|
const activeShape = (_a = shapeProp != null ? shapeProp : contextShape) != null ? _a : "pill";
|
|
5415
5588
|
const isSquare = isSquareShape(activeShape);
|
|
5416
5589
|
const resolvedShapeSize = (_b = shapeSizeProp != null ? shapeSizeProp : contextShapeSize) != null ? _b : 56;
|
|
@@ -5420,12 +5593,12 @@ var NavigationRailItemComponent = React37__namespace.forwardRef(
|
|
|
5420
5593
|
const enableLayout = !isModal;
|
|
5421
5594
|
const isExpandedPill = isExpanded && !isSquare;
|
|
5422
5595
|
const expandedPillWidthClass = activeIndicatorWidth === "fill" ? "w-full" : "w-fit";
|
|
5423
|
-
const activePillId = `rail-pill-${
|
|
5596
|
+
const activePillId = `rail-pill-${React38__namespace.useId()}`;
|
|
5424
5597
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
5425
5598
|
disabled
|
|
5426
5599
|
});
|
|
5427
5600
|
const showLabel = isExpanded || labelVisibility === "labeled" || labelVisibility === "auto" && selected;
|
|
5428
|
-
const handleClick =
|
|
5601
|
+
const handleClick = React38__namespace.useCallback(
|
|
5429
5602
|
(e) => {
|
|
5430
5603
|
if (disabled) {
|
|
5431
5604
|
e.preventDefault();
|
|
@@ -5447,7 +5620,7 @@ var NavigationRailItemComponent = React37__namespace.forwardRef(
|
|
|
5447
5620
|
const iconPillWidth = isSquare ? resolvedShapeSize : 56;
|
|
5448
5621
|
const iconPillHeight = isSquare ? resolvedShapeSize : 32;
|
|
5449
5622
|
if (asChild && children) {
|
|
5450
|
-
const child =
|
|
5623
|
+
const child = React38__namespace.Children.only(children);
|
|
5451
5624
|
const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5452
5625
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5453
5626
|
react.m.div,
|
|
@@ -5565,7 +5738,7 @@ var NavigationRailItemComponent = React37__namespace.forwardRef(
|
|
|
5565
5738
|
onPointerDown,
|
|
5566
5739
|
className: itemClassName,
|
|
5567
5740
|
tabIndex: -1,
|
|
5568
|
-
children:
|
|
5741
|
+
children: React38__namespace.cloneElement(child, { children: innerContent })
|
|
5569
5742
|
}
|
|
5570
5743
|
) });
|
|
5571
5744
|
}
|
|
@@ -5693,9 +5866,9 @@ var NavigationRailItemComponent = React37__namespace.forwardRef(
|
|
|
5693
5866
|
}
|
|
5694
5867
|
);
|
|
5695
5868
|
NavigationRailItemComponent.displayName = "NavigationRailItem";
|
|
5696
|
-
var NavigationRailItem =
|
|
5869
|
+
var NavigationRailItem = React38__namespace.memo(NavigationRailItemComponent);
|
|
5697
5870
|
function useRoving(navRef) {
|
|
5698
|
-
|
|
5871
|
+
React38__namespace.useEffect(() => {
|
|
5699
5872
|
if (!navRef.current) return;
|
|
5700
5873
|
const items = getMenuItems(navRef.current);
|
|
5701
5874
|
const selected = items.find(
|
|
@@ -5705,7 +5878,7 @@ function useRoving(navRef) {
|
|
|
5705
5878
|
const firstFocusable = selected != null ? selected : items[0];
|
|
5706
5879
|
if (firstFocusable) firstFocusable.tabIndex = 0;
|
|
5707
5880
|
}, [navRef]);
|
|
5708
|
-
return
|
|
5881
|
+
return React38__namespace.useCallback(
|
|
5709
5882
|
(e) => {
|
|
5710
5883
|
if (!navRef.current) return;
|
|
5711
5884
|
const items = getMenuItems(navRef.current);
|
|
@@ -5733,7 +5906,7 @@ function useRoving(navRef) {
|
|
|
5733
5906
|
[navRef]
|
|
5734
5907
|
);
|
|
5735
5908
|
}
|
|
5736
|
-
var NavigationRailComponent =
|
|
5909
|
+
var NavigationRailComponent = React38__namespace.forwardRef(
|
|
5737
5910
|
({
|
|
5738
5911
|
variant = "collapsed",
|
|
5739
5912
|
labelVisibility = "labeled",
|
|
@@ -5757,9 +5930,9 @@ var NavigationRailComponent = React37__namespace.forwardRef(
|
|
|
5757
5930
|
const isXr = variant === "xr";
|
|
5758
5931
|
const isSpatial = isXr && fabPlacement === "spatialized";
|
|
5759
5932
|
const applyAnimation = !isXr || !isSpatial;
|
|
5760
|
-
const navRef =
|
|
5933
|
+
const navRef = React38__namespace.useRef(null);
|
|
5761
5934
|
const handleKeyDown = useRoving(navRef);
|
|
5762
|
-
const setRefs =
|
|
5935
|
+
const setRefs = React38__namespace.useCallback(
|
|
5763
5936
|
(node) => {
|
|
5764
5937
|
navRef.current = node;
|
|
5765
5938
|
if (typeof ref === "function") ref(node);
|
|
@@ -5852,7 +6025,7 @@ var NavigationRailComponent = React37__namespace.forwardRef(
|
|
|
5852
6025
|
children: fab
|
|
5853
6026
|
}
|
|
5854
6027
|
),
|
|
5855
|
-
|
|
6028
|
+
React38__namespace.cloneElement(
|
|
5856
6029
|
navElement,
|
|
5857
6030
|
{
|
|
5858
6031
|
className: cn(navBaseClasses, "pointer-events-auto")
|
|
@@ -5897,7 +6070,7 @@ var NavigationRailComponent = React37__namespace.forwardRef(
|
|
|
5897
6070
|
}
|
|
5898
6071
|
);
|
|
5899
6072
|
NavigationRailComponent.displayName = "NavigationRail";
|
|
5900
|
-
var NavigationRail =
|
|
6073
|
+
var NavigationRail = React38__namespace.memo(NavigationRailComponent);
|
|
5901
6074
|
function useSearchKeyboard({
|
|
5902
6075
|
active,
|
|
5903
6076
|
onActiveChange,
|
|
@@ -5906,14 +6079,14 @@ function useSearchKeyboard({
|
|
|
5906
6079
|
itemCount,
|
|
5907
6080
|
onSelectSuggestion
|
|
5908
6081
|
}) {
|
|
5909
|
-
const [activeIndex, setActiveIndex] =
|
|
5910
|
-
const resetKeyRef =
|
|
6082
|
+
const [activeIndex, setActiveIndex] = React38__namespace.useState(-1);
|
|
6083
|
+
const resetKeyRef = React38__namespace.useRef(`${active}:${query}`);
|
|
5911
6084
|
const currentKey = `${active}:${query}`;
|
|
5912
6085
|
if (resetKeyRef.current !== currentKey) {
|
|
5913
6086
|
resetKeyRef.current = currentKey;
|
|
5914
6087
|
setActiveIndex(-1);
|
|
5915
6088
|
}
|
|
5916
|
-
const handleKeyDown =
|
|
6089
|
+
const handleKeyDown = React38__namespace.useCallback(
|
|
5917
6090
|
(e) => {
|
|
5918
6091
|
if (!active) return;
|
|
5919
6092
|
switch (e.key) {
|
|
@@ -5953,7 +6126,7 @@ function useSearchKeyboard({
|
|
|
5953
6126
|
query
|
|
5954
6127
|
]
|
|
5955
6128
|
);
|
|
5956
|
-
const resetActiveIndex =
|
|
6129
|
+
const resetActiveIndex = React38__namespace.useCallback(() => {
|
|
5957
6130
|
setActiveIndex(-1);
|
|
5958
6131
|
}, []);
|
|
5959
6132
|
return { activeIndex, handleKeyDown, resetActiveIndex };
|
|
@@ -6021,10 +6194,10 @@ function AnimatedPlaceholder({
|
|
|
6021
6194
|
className
|
|
6022
6195
|
}) {
|
|
6023
6196
|
const shouldReduceMotion = react.useReducedMotion();
|
|
6024
|
-
const containerRef =
|
|
6025
|
-
const spanRef =
|
|
6026
|
-
const [xOffset, setXOffset] =
|
|
6027
|
-
const recalculate =
|
|
6197
|
+
const containerRef = React38__namespace.useRef(null);
|
|
6198
|
+
const spanRef = React38__namespace.useRef(null);
|
|
6199
|
+
const [xOffset, setXOffset] = React38__namespace.useState(0);
|
|
6200
|
+
const recalculate = React38__namespace.useCallback(() => {
|
|
6028
6201
|
const container = containerRef.current;
|
|
6029
6202
|
const span = spanRef.current;
|
|
6030
6203
|
if (!container || !span || textAlign === "left") {
|
|
@@ -6039,10 +6212,10 @@ function AnimatedPlaceholder({
|
|
|
6039
6212
|
setXOffset(Math.max(0, containerWidth - textWidth));
|
|
6040
6213
|
}
|
|
6041
6214
|
}, [textAlign]);
|
|
6042
|
-
|
|
6215
|
+
React38__namespace.useLayoutEffect(() => {
|
|
6043
6216
|
recalculate();
|
|
6044
6217
|
}, [recalculate]);
|
|
6045
|
-
|
|
6218
|
+
React38__namespace.useEffect(() => {
|
|
6046
6219
|
const container = containerRef.current;
|
|
6047
6220
|
if (!container) return;
|
|
6048
6221
|
const observer = new ResizeObserver(recalculate);
|
|
@@ -6111,10 +6284,10 @@ function SearchBar({
|
|
|
6111
6284
|
activeIndex
|
|
6112
6285
|
}) {
|
|
6113
6286
|
const shouldReduceMotion = react.useReducedMotion();
|
|
6114
|
-
const inputRef =
|
|
6115
|
-
const prevActiveRef =
|
|
6116
|
-
const isRestoringFocusRef =
|
|
6117
|
-
|
|
6287
|
+
const inputRef = React38__namespace.useRef(null);
|
|
6288
|
+
const prevActiveRef = React38__namespace.useRef(active);
|
|
6289
|
+
const isRestoringFocusRef = React38__namespace.useRef(false);
|
|
6290
|
+
React38__namespace.useEffect(() => {
|
|
6118
6291
|
var _a;
|
|
6119
6292
|
let rafId;
|
|
6120
6293
|
if (prevActiveRef.current === true && active === false) {
|
|
@@ -6233,7 +6406,7 @@ function SearchBar({
|
|
|
6233
6406
|
) })
|
|
6234
6407
|
);
|
|
6235
6408
|
}
|
|
6236
|
-
var SearchContext =
|
|
6409
|
+
var SearchContext = React38__namespace.createContext(null);
|
|
6237
6410
|
function SearchProvider({
|
|
6238
6411
|
children,
|
|
6239
6412
|
value
|
|
@@ -6241,15 +6414,15 @@ function SearchProvider({
|
|
|
6241
6414
|
return /* @__PURE__ */ jsxRuntime.jsx(SearchContext.Provider, { value, children });
|
|
6242
6415
|
}
|
|
6243
6416
|
function useSearch() {
|
|
6244
|
-
const context =
|
|
6417
|
+
const context = React38__namespace.useContext(SearchContext);
|
|
6245
6418
|
if (!context) {
|
|
6246
6419
|
return { listboxId: "", activeIndex: -1 };
|
|
6247
6420
|
}
|
|
6248
6421
|
return context;
|
|
6249
6422
|
}
|
|
6250
6423
|
function useClickOutside(handler, enabled = true) {
|
|
6251
|
-
const ref =
|
|
6252
|
-
|
|
6424
|
+
const ref = React38.useRef(null);
|
|
6425
|
+
React38.useEffect(() => {
|
|
6253
6426
|
if (!enabled) return;
|
|
6254
6427
|
const listener = (event) => {
|
|
6255
6428
|
const el = ref.current;
|
|
@@ -6268,7 +6441,7 @@ function useClickOutside(handler, enabled = true) {
|
|
|
6268
6441
|
return ref;
|
|
6269
6442
|
}
|
|
6270
6443
|
function useSearchViewFocus(inputRef, active) {
|
|
6271
|
-
|
|
6444
|
+
React38__namespace.useEffect(() => {
|
|
6272
6445
|
if (!active) return;
|
|
6273
6446
|
let raf2;
|
|
6274
6447
|
const raf1 = requestAnimationFrame(() => {
|
|
@@ -6328,11 +6501,11 @@ var ROTATE_KEY_SPLINES = [
|
|
|
6328
6501
|
var ROTATE_VALUES = "0 24 24; 154 24 24; 309 24 24; 463 24 24; 617 24 24; 771 24 24; 926 24 24; 1080 24 24";
|
|
6329
6502
|
var DETERMINATE_CIRCLE = "M24 7 C34.49 7 41 13.51 41 24 C41 34.49 34.49 41 24 41 C13.51 41 7 34.49 7 24 C7 13.51 13.51 7 24 7 Z";
|
|
6330
6503
|
var DETERMINATE_SOFT_BURST = "M20.9 10.4 21.4 9.5 21.9 8.7 22.5 7.8 23.2 7.2 24.2 7 25.1 7.4 25.7 8.1 26.2 9 26.8 9.8 27.3 10.6 28.1 11.2 29 11.3 30 11 30.9 10.6 31.8 10.3 32.8 9.9 33.7 10 34.5 10.6 34.9 11.5 34.8 12.5 34.8 13.5 34.7 14.5 34.7 15.5 35.2 16.3 36 16.8 37 17.1 37.9 17.3 38.9 17.5 39.8 17.9 40.4 18.7 40.5 19.7 40 20.5 39.4 21.3 38.7 22 38.1 22.8 37.6 23.7 37.7 24.6 38.3 25.5 38.9 26.2 39.6 27 40.2 27.7 40.5 28.7 40.3 29.6 39.5 30.3 38.6 30.6 37.6 30.8 36.7 31 35.7 31.3 35 31.9 34.6 32.8 34.7 33.8 34.8 34.8 34.9 35.8 34.8 36.8 34.3 37.6 33.4 38.1 32.4 38 31.5 37.6 30.6 37.2 29.7 36.9 28.7 36.6 27.8 36.9 27.1 37.6 26.6 38.5 26.1 39.3 25.5 40.2 24.8 40.8 23.8 41 22.9 40.6 22.3 39.9 21.8 39 21.2 38.2 20.7 37.4 19.9 36.8 19 36.7 18 37 17.1 37.4 16.2 37.7 15.2 38.1 14.3 38 13.5 37.4 13.1 36.5 13.2 35.5 13.2 34.5 13.3 33.5 13.3 32.5 12.8 31.7 12 31.2 11 31 10.1 30.7 9.1 30.5 8.2 30.1 7.6 29.3 7.5 28.3 8 27.5 8.7 26.7 9.3 26 9.9 25.2 10.4 24.3 10.3 23.4 9.7 22.5 9.1 21.8 8.4 21 7.8 20.3 7.5 19.3 7.7 18.4 8.5 17.7 9.4 17.4 10.4 17.2 11.3 17 12.3 16.7 13 16.1 13.4 15.2 13.3 14.2 13.2 13.2 13.1 12.2 13.2 11.2 13.7 10.4 14.6 9.9 15.6 10 16.5 10.4 17.4 10.8 18.3 11.1 19.3 11.4 20.2 11.1Z";
|
|
6331
|
-
var IndeterminateSvg =
|
|
6504
|
+
var IndeterminateSvg = React38__namespace.memo(function IndeterminateSvg2({
|
|
6332
6505
|
size
|
|
6333
6506
|
}) {
|
|
6334
|
-
const [ready, setReady] =
|
|
6335
|
-
|
|
6507
|
+
const [ready, setReady] = React38__namespace.useState(false);
|
|
6508
|
+
React38__namespace.useEffect(() => {
|
|
6336
6509
|
const raf = requestAnimationFrame(() => setReady(true));
|
|
6337
6510
|
return () => cancelAnimationFrame(raf);
|
|
6338
6511
|
}, []);
|
|
@@ -6377,7 +6550,7 @@ var IndeterminateSvg = React37__namespace.memo(function IndeterminateSvg2({
|
|
|
6377
6550
|
}
|
|
6378
6551
|
);
|
|
6379
6552
|
});
|
|
6380
|
-
var DeterminateSvg =
|
|
6553
|
+
var DeterminateSvg = React38__namespace.memo(function DeterminateSvg2({
|
|
6381
6554
|
size,
|
|
6382
6555
|
progress
|
|
6383
6556
|
}) {
|
|
@@ -6402,7 +6575,7 @@ var DeterminateSvg = React37__namespace.memo(function DeterminateSvg2({
|
|
|
6402
6575
|
}
|
|
6403
6576
|
);
|
|
6404
6577
|
});
|
|
6405
|
-
var LoadingIndicator =
|
|
6578
|
+
var LoadingIndicator = React38__namespace.forwardRef(
|
|
6406
6579
|
(_a, ref) => {
|
|
6407
6580
|
var _b = _a, {
|
|
6408
6581
|
variant = "uncontained",
|
|
@@ -6537,7 +6710,7 @@ var ADDITIONAL_ROTATION_EASE_DURATION = 500;
|
|
|
6537
6710
|
var DEFAULT_MIN_PROGRESS = 0.1;
|
|
6538
6711
|
var DEFAULT_MAX_PROGRESS = 0.8;
|
|
6539
6712
|
var PROGRESS_CYCLE_DURATION = 1500;
|
|
6540
|
-
var CircularProgress =
|
|
6713
|
+
var CircularProgress = React38__namespace.forwardRef(
|
|
6541
6714
|
(_a, ref) => {
|
|
6542
6715
|
var _b = _a, {
|
|
6543
6716
|
value,
|
|
@@ -6591,19 +6764,19 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
6591
6764
|
const shouldShowDeterminateTrack = showTrack === "auto" ? true : showTrack;
|
|
6592
6765
|
const BASELINE_SIZE = 48;
|
|
6593
6766
|
const scaleFactor = size / BASELINE_SIZE;
|
|
6594
|
-
const effectiveAmplitude =
|
|
6767
|
+
const effectiveAmplitude = React38__namespace.useMemo(
|
|
6595
6768
|
() => amplitude != null ? amplitude : 1.6 * scaleFactor,
|
|
6596
6769
|
[amplitude, scaleFactor]
|
|
6597
6770
|
);
|
|
6598
|
-
const effectiveWavelength =
|
|
6771
|
+
const effectiveWavelength = React38__namespace.useMemo(
|
|
6599
6772
|
() => wavelength != null ? wavelength : 15 * scaleFactor,
|
|
6600
6773
|
[wavelength, scaleFactor]
|
|
6601
6774
|
);
|
|
6602
|
-
const resolvedAmplitudeRange =
|
|
6775
|
+
const resolvedAmplitudeRange = React38__namespace.useMemo(
|
|
6603
6776
|
() => amplitudeRange != null ? amplitudeRange : [0, effectiveAmplitude],
|
|
6604
6777
|
[amplitudeRange, effectiveAmplitude]
|
|
6605
6778
|
);
|
|
6606
|
-
const wavyActivePath =
|
|
6779
|
+
const wavyActivePath = React38__namespace.useMemo(
|
|
6607
6780
|
() => isWavy ? generateWavyCircularPath(
|
|
6608
6781
|
center,
|
|
6609
6782
|
radius,
|
|
@@ -6612,8 +6785,8 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
6612
6785
|
) : null,
|
|
6613
6786
|
[isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
|
|
6614
6787
|
);
|
|
6615
|
-
const circumference =
|
|
6616
|
-
const gapForTrack =
|
|
6788
|
+
const circumference = React38__namespace.useMemo(() => 2 * Math.PI * radius, [radius]);
|
|
6789
|
+
const gapForTrack = React38__namespace.useMemo(
|
|
6617
6790
|
() => (gapSize + trackHeight) / circumference,
|
|
6618
6791
|
[gapSize, trackHeight, circumference]
|
|
6619
6792
|
);
|
|
@@ -6621,17 +6794,17 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
6621
6794
|
const trackOffset = isDeterminate ? activeAngularFraction + gapForTrack : 0;
|
|
6622
6795
|
const trackLength = isDeterminate ? Math.max(1e-3, 1 - activeAngularFraction - 2 * gapForTrack) : 1;
|
|
6623
6796
|
const ActiveCircleElem = react.m.circle;
|
|
6624
|
-
const indeterminateSvgRef =
|
|
6625
|
-
const indeterminateTrackRef =
|
|
6626
|
-
const indeterminateActiveRef =
|
|
6627
|
-
const indeterminateWavyTrackPathRef =
|
|
6628
|
-
const indeterminateWavyActivePathRef =
|
|
6629
|
-
const determinateWavyActivePathRef =
|
|
6630
|
-
const determinateWavyTrackPathRef =
|
|
6631
|
-
const cachedPathLengthRef =
|
|
6797
|
+
const indeterminateSvgRef = React38__namespace.useRef(null);
|
|
6798
|
+
const indeterminateTrackRef = React38__namespace.useRef(null);
|
|
6799
|
+
const indeterminateActiveRef = React38__namespace.useRef(null);
|
|
6800
|
+
const indeterminateWavyTrackPathRef = React38__namespace.useRef(null);
|
|
6801
|
+
const indeterminateWavyActivePathRef = React38__namespace.useRef(null);
|
|
6802
|
+
const determinateWavyActivePathRef = React38__namespace.useRef(null);
|
|
6803
|
+
const determinateWavyTrackPathRef = React38__namespace.useRef(null);
|
|
6804
|
+
const cachedPathLengthRef = React38__namespace.useRef(0);
|
|
6632
6805
|
const fractionMV = react.useMotionValue(isDeterminate ? clampedValue / 100 : 0);
|
|
6633
6806
|
const amplitudeMV = react.useMotionValue(isWavy ? effectiveAmplitude : 0);
|
|
6634
|
-
|
|
6807
|
+
React38__namespace.useEffect(() => {
|
|
6635
6808
|
if (isDeterminate) {
|
|
6636
6809
|
react.animate(fractionMV, clampedValue / 100, {
|
|
6637
6810
|
duration: 0.4,
|
|
@@ -6639,7 +6812,7 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
6639
6812
|
});
|
|
6640
6813
|
}
|
|
6641
6814
|
}, [clampedValue, isDeterminate, fractionMV]);
|
|
6642
|
-
|
|
6815
|
+
React38__namespace.useEffect(() => {
|
|
6643
6816
|
if (!isDeterminate || !isWavy) return;
|
|
6644
6817
|
const fraction = clampedValue / 100;
|
|
6645
6818
|
let targetAmp = effectiveAmplitude;
|
|
@@ -6659,7 +6832,7 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
6659
6832
|
amplitudeMV,
|
|
6660
6833
|
determinateAnimation
|
|
6661
6834
|
]);
|
|
6662
|
-
|
|
6835
|
+
React38__namespace.useLayoutEffect(() => {
|
|
6663
6836
|
if (!isWavy || !wavyActivePath) {
|
|
6664
6837
|
cachedPathLengthRef.current = circumference;
|
|
6665
6838
|
return;
|
|
@@ -7036,9 +7209,9 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
7036
7209
|
);
|
|
7037
7210
|
CircularProgress.displayName = "CircularProgress";
|
|
7038
7211
|
function useContainerWidth() {
|
|
7039
|
-
const [width, setWidth] =
|
|
7040
|
-
const observerRef =
|
|
7041
|
-
const ref =
|
|
7212
|
+
const [width, setWidth] = React38__namespace.useState(0);
|
|
7213
|
+
const observerRef = React38__namespace.useRef(null);
|
|
7214
|
+
const ref = React38__namespace.useCallback((node) => {
|
|
7042
7215
|
if (observerRef.current) {
|
|
7043
7216
|
observerRef.current.disconnect();
|
|
7044
7217
|
observerRef.current = null;
|
|
@@ -7052,7 +7225,7 @@ function useContainerWidth() {
|
|
|
7052
7225
|
observerRef.current = obs;
|
|
7053
7226
|
}
|
|
7054
7227
|
}, []);
|
|
7055
|
-
|
|
7228
|
+
React38__namespace.useEffect(() => {
|
|
7056
7229
|
return () => {
|
|
7057
7230
|
if (observerRef.current) {
|
|
7058
7231
|
observerRef.current.disconnect();
|
|
@@ -7062,7 +7235,7 @@ function useContainerWidth() {
|
|
|
7062
7235
|
return [ref, width];
|
|
7063
7236
|
}
|
|
7064
7237
|
function useMergedRef(...refs) {
|
|
7065
|
-
return
|
|
7238
|
+
return React38__namespace.useCallback(
|
|
7066
7239
|
(node) => {
|
|
7067
7240
|
for (const ref of refs) {
|
|
7068
7241
|
if (typeof ref === "function") {
|
|
@@ -7076,7 +7249,7 @@ function useMergedRef(...refs) {
|
|
|
7076
7249
|
[refs]
|
|
7077
7250
|
);
|
|
7078
7251
|
}
|
|
7079
|
-
var FlatLinearTrack =
|
|
7252
|
+
var FlatLinearTrack = React38__namespace.memo(function FlatLinearTrack2({
|
|
7080
7253
|
trackHeight,
|
|
7081
7254
|
activeColor,
|
|
7082
7255
|
trackColor,
|
|
@@ -7152,7 +7325,7 @@ var FlatLinearTrack = React37__namespace.memo(function FlatLinearTrack2({
|
|
|
7152
7325
|
}
|
|
7153
7326
|
);
|
|
7154
7327
|
});
|
|
7155
|
-
var WavyLinearTrack =
|
|
7328
|
+
var WavyLinearTrack = React38__namespace.memo(function WavyLinearTrack2({
|
|
7156
7329
|
trackHeight,
|
|
7157
7330
|
svgHeight,
|
|
7158
7331
|
amplitude,
|
|
@@ -7171,13 +7344,13 @@ var WavyLinearTrack = React37__namespace.memo(function WavyLinearTrack2({
|
|
|
7171
7344
|
}) {
|
|
7172
7345
|
const isDeterminate = typeof value === "number";
|
|
7173
7346
|
const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
|
|
7174
|
-
const titleId =
|
|
7347
|
+
const titleId = React38__namespace.useId();
|
|
7175
7348
|
const [containerRef, width] = useContainerWidth();
|
|
7176
|
-
const activePathRef =
|
|
7177
|
-
const trackPathRef =
|
|
7349
|
+
const activePathRef = React38__namespace.useRef(null);
|
|
7350
|
+
const trackPathRef = React38__namespace.useRef(null);
|
|
7178
7351
|
const amplitudeMV = react.useMotionValue(amplitude);
|
|
7179
7352
|
const fractionMV = react.useMotionValue(isDeterminate ? clampedValue / 100 : 1);
|
|
7180
|
-
|
|
7353
|
+
React38__namespace.useEffect(() => {
|
|
7181
7354
|
if (isDeterminate) {
|
|
7182
7355
|
const fraction = clampedValue / 100;
|
|
7183
7356
|
let targetAmp = amplitude;
|
|
@@ -7365,7 +7538,7 @@ var WavyLinearTrack = React37__namespace.memo(function WavyLinearTrack2({
|
|
|
7365
7538
|
}
|
|
7366
7539
|
);
|
|
7367
7540
|
});
|
|
7368
|
-
var LinearProgress =
|
|
7541
|
+
var LinearProgress = React38__namespace.forwardRef(
|
|
7369
7542
|
(_a, ref) => {
|
|
7370
7543
|
var _b = _a, {
|
|
7371
7544
|
value,
|
|
@@ -7406,10 +7579,10 @@ var LinearProgress = React37__namespace.forwardRef(
|
|
|
7406
7579
|
]);
|
|
7407
7580
|
const isDeterminate = value !== void 0;
|
|
7408
7581
|
const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
|
|
7409
|
-
const containerRef =
|
|
7582
|
+
const containerRef = React38__namespace.useRef(null);
|
|
7410
7583
|
const mergedRef = useMergedRef(ref, containerRef);
|
|
7411
|
-
const [isRtl, setIsRtl] =
|
|
7412
|
-
|
|
7584
|
+
const [isRtl, setIsRtl] = React38__namespace.useState(false);
|
|
7585
|
+
React38__namespace.useEffect(() => {
|
|
7413
7586
|
if (containerRef.current) {
|
|
7414
7587
|
const dir = getComputedStyle(containerRef.current).direction;
|
|
7415
7588
|
setIsRtl(dir === "rtl");
|
|
@@ -7417,16 +7590,16 @@ var LinearProgress = React37__namespace.forwardRef(
|
|
|
7417
7590
|
}, []);
|
|
7418
7591
|
const resolvedTrackShape = trackShape != null ? trackShape : shape;
|
|
7419
7592
|
const isWavy = shape === "wavy" || resolvedTrackShape === "wavy";
|
|
7420
|
-
const effectiveAmplitude =
|
|
7421
|
-
const svgHeight =
|
|
7593
|
+
const effectiveAmplitude = React38__namespace.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
|
|
7594
|
+
const svgHeight = React38__namespace.useMemo(
|
|
7422
7595
|
() => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
|
|
7423
7596
|
[isWavy, trackHeight, effectiveAmplitude]
|
|
7424
7597
|
);
|
|
7425
|
-
const shouldShowStop =
|
|
7598
|
+
const shouldShowStop = React38__namespace.useMemo(
|
|
7426
7599
|
() => isDeterminate && resolvedTrackShape === "flat" && showStopIndicator !== false,
|
|
7427
7600
|
[isDeterminate, resolvedTrackShape, showStopIndicator]
|
|
7428
7601
|
);
|
|
7429
|
-
const stopSize =
|
|
7602
|
+
const stopSize = React38__namespace.useMemo(
|
|
7430
7603
|
() => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
|
|
7431
7604
|
[trackHeight]
|
|
7432
7605
|
);
|
|
@@ -7501,7 +7674,7 @@ var LinearProgress = React37__namespace.forwardRef(
|
|
|
7501
7674
|
}
|
|
7502
7675
|
);
|
|
7503
7676
|
LinearProgress.displayName = "LinearProgress";
|
|
7504
|
-
var ProgressIndicator =
|
|
7677
|
+
var ProgressIndicator = React38__namespace.forwardRef((props, ref) => {
|
|
7505
7678
|
if (props.variant === "circular") {
|
|
7506
7679
|
return /* @__PURE__ */ jsxRuntime.jsx(CircularProgress, __spreadValues({ ref }, props));
|
|
7507
7680
|
}
|
|
@@ -7633,7 +7806,7 @@ function resolveDisabledBgClass(colorStyle) {
|
|
|
7633
7806
|
}
|
|
7634
7807
|
return "disabled:text-m3-on-surface/[0.38]";
|
|
7635
7808
|
}
|
|
7636
|
-
var IconButtonComponent =
|
|
7809
|
+
var IconButtonComponent = React38__namespace.forwardRef(
|
|
7637
7810
|
(_a, ref) => {
|
|
7638
7811
|
var _b = _a, {
|
|
7639
7812
|
className,
|
|
@@ -7675,18 +7848,18 @@ var IconButtonComponent = React37__namespace.forwardRef(
|
|
|
7675
7848
|
var _a2, _b2, _c, _d, _e;
|
|
7676
7849
|
const isToggle = variant === "toggle";
|
|
7677
7850
|
const isSelected = isToggle && !!selected;
|
|
7678
|
-
const resolvedColorClass =
|
|
7851
|
+
const resolvedColorClass = React38__namespace.useMemo(
|
|
7679
7852
|
() => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
|
|
7680
7853
|
[isSelected, colorStyle]
|
|
7681
7854
|
);
|
|
7682
|
-
const outlineWidthClass =
|
|
7855
|
+
const outlineWidthClass = React38__namespace.useMemo(
|
|
7683
7856
|
() => {
|
|
7684
7857
|
var _a3;
|
|
7685
7858
|
return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
|
|
7686
7859
|
},
|
|
7687
7860
|
[colorStyle, isSelected, size]
|
|
7688
7861
|
);
|
|
7689
|
-
const disabledBgClass =
|
|
7862
|
+
const disabledBgClass = React38__namespace.useMemo(
|
|
7690
7863
|
() => resolveDisabledBgClass(colorStyle),
|
|
7691
7864
|
[colorStyle]
|
|
7692
7865
|
);
|
|
@@ -7709,7 +7882,7 @@ var IconButtonComponent = React37__namespace.forwardRef(
|
|
|
7709
7882
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
7710
7883
|
disabled: loading
|
|
7711
7884
|
});
|
|
7712
|
-
const handleClick =
|
|
7885
|
+
const handleClick = React38__namespace.useCallback(
|
|
7713
7886
|
(e) => {
|
|
7714
7887
|
if (loading) {
|
|
7715
7888
|
e.preventDefault();
|
|
@@ -7719,7 +7892,7 @@ var IconButtonComponent = React37__namespace.forwardRef(
|
|
|
7719
7892
|
},
|
|
7720
7893
|
[loading, onClick]
|
|
7721
7894
|
);
|
|
7722
|
-
const handleKeyDown =
|
|
7895
|
+
const handleKeyDown = React38__namespace.useCallback(
|
|
7723
7896
|
(e) => {
|
|
7724
7897
|
if (loading) return;
|
|
7725
7898
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -7775,7 +7948,7 @@ var IconButtonComponent = React37__namespace.forwardRef(
|
|
|
7775
7948
|
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
7776
7949
|
height: isCustomSize ? `${iconSize}px` : void 0
|
|
7777
7950
|
},
|
|
7778
|
-
children: isSelected && selectedIcon ? selectedIcon : asChild ?
|
|
7951
|
+
children: isSelected && selectedIcon ? selectedIcon : asChild ? React38__namespace.Children.only(children).props.children : children
|
|
7779
7952
|
}),
|
|
7780
7953
|
isSelected && selectedIcon ? "selected-content" : "content"
|
|
7781
7954
|
) })
|
|
@@ -7792,7 +7965,7 @@ var IconButtonComponent = React37__namespace.forwardRef(
|
|
|
7792
7965
|
className
|
|
7793
7966
|
);
|
|
7794
7967
|
if (asChild) {
|
|
7795
|
-
const child =
|
|
7968
|
+
const child = React38__namespace.Children.only(children);
|
|
7796
7969
|
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7797
7970
|
reactSlot.Slot,
|
|
7798
7971
|
__spreadProps(__spreadValues({
|
|
@@ -7809,7 +7982,7 @@ var IconButtonComponent = React37__namespace.forwardRef(
|
|
|
7809
7982
|
}),
|
|
7810
7983
|
className: containerClassName
|
|
7811
7984
|
}, restProps), {
|
|
7812
|
-
children:
|
|
7985
|
+
children: React38__namespace.cloneElement(child, { children: innerContent })
|
|
7813
7986
|
})
|
|
7814
7987
|
) });
|
|
7815
7988
|
}
|
|
@@ -7837,7 +8010,7 @@ var IconButtonComponent = React37__namespace.forwardRef(
|
|
|
7837
8010
|
}
|
|
7838
8011
|
);
|
|
7839
8012
|
IconButtonComponent.displayName = "IconButton";
|
|
7840
|
-
var IconButton =
|
|
8013
|
+
var IconButton = React38__namespace.memo(IconButtonComponent);
|
|
7841
8014
|
function TrailingAction({
|
|
7842
8015
|
query,
|
|
7843
8016
|
trailingIcon,
|
|
@@ -7897,7 +8070,7 @@ function SearchViewDocked({
|
|
|
7897
8070
|
activeIndex
|
|
7898
8071
|
}) {
|
|
7899
8072
|
const shouldReduceMotion = react.useReducedMotion();
|
|
7900
|
-
const inputRef =
|
|
8073
|
+
const inputRef = React38__namespace.useRef(null);
|
|
7901
8074
|
useSearchViewFocus(inputRef, active);
|
|
7902
8075
|
const dropdownRef = useClickOutside(() => {
|
|
7903
8076
|
onActiveChange(false);
|
|
@@ -8043,10 +8216,10 @@ function SearchViewFullScreen({
|
|
|
8043
8216
|
activeIndex
|
|
8044
8217
|
}) {
|
|
8045
8218
|
const shouldReduceMotion = react.useReducedMotion();
|
|
8046
|
-
const inputRef =
|
|
8219
|
+
const inputRef = React38__namespace.useRef(null);
|
|
8047
8220
|
useSearchViewFocus(inputRef, active);
|
|
8048
|
-
const [mounted, setMounted] =
|
|
8049
|
-
|
|
8221
|
+
const [mounted, setMounted] = React38__namespace.useState(false);
|
|
8222
|
+
React38__namespace.useEffect(() => {
|
|
8050
8223
|
setMounted(true);
|
|
8051
8224
|
}, []);
|
|
8052
8225
|
const handleFormSubmit = (e) => {
|
|
@@ -8204,10 +8377,10 @@ function SearchComponent({
|
|
|
8204
8377
|
className,
|
|
8205
8378
|
viewClassName
|
|
8206
8379
|
}) {
|
|
8207
|
-
const generatedId =
|
|
8380
|
+
const generatedId = React38__namespace.useId();
|
|
8208
8381
|
const searchId = id != null ? id : generatedId;
|
|
8209
8382
|
const listboxId = `${searchId}-listbox`;
|
|
8210
|
-
const itemCount =
|
|
8383
|
+
const itemCount = React38__namespace.Children.count(children);
|
|
8211
8384
|
const { activeIndex, handleKeyDown } = useSearchKeyboard({
|
|
8212
8385
|
active,
|
|
8213
8386
|
onActiveChange,
|
|
@@ -8266,9 +8439,9 @@ function formatBadgeLabel(children, max) {
|
|
|
8266
8439
|
return "";
|
|
8267
8440
|
}
|
|
8268
8441
|
function detectBadgeHasContent(badge) {
|
|
8269
|
-
return
|
|
8442
|
+
return React38__namespace.isValidElement(badge) && badge.props.children != null;
|
|
8270
8443
|
}
|
|
8271
|
-
var BadgeImpl =
|
|
8444
|
+
var BadgeImpl = React38__namespace.forwardRef(
|
|
8272
8445
|
(_a, ref) => {
|
|
8273
8446
|
var _b = _a, {
|
|
8274
8447
|
children,
|
|
@@ -8305,7 +8478,7 @@ var BadgeImpl = React37__namespace.forwardRef(
|
|
|
8305
8478
|
exit: { scale: 0, opacity: 0 },
|
|
8306
8479
|
transition: springTransition,
|
|
8307
8480
|
className: cn(
|
|
8308
|
-
"rounded-full ring-[1.5px] ring-m3-surface",
|
|
8481
|
+
"rounded-full ring-[1.5px] ring-m3-surface shrink-0",
|
|
8309
8482
|
!containerColor && "bg-m3-error",
|
|
8310
8483
|
hasContent ? cn(
|
|
8311
8484
|
"inline-flex items-center justify-center",
|
|
@@ -8322,7 +8495,7 @@ var BadgeImpl = React37__namespace.forwardRef(
|
|
|
8322
8495
|
}
|
|
8323
8496
|
);
|
|
8324
8497
|
BadgeImpl.displayName = "Badge";
|
|
8325
|
-
|
|
8498
|
+
React38__namespace.memo(BadgeImpl);
|
|
8326
8499
|
function BadgedBox({
|
|
8327
8500
|
badge,
|
|
8328
8501
|
children,
|
|
@@ -8343,9 +8516,9 @@ function BadgedBox({
|
|
|
8343
8516
|
)
|
|
8344
8517
|
] });
|
|
8345
8518
|
}
|
|
8346
|
-
var TabsContext =
|
|
8519
|
+
var TabsContext = React38__namespace.createContext(null);
|
|
8347
8520
|
function useTabsContext() {
|
|
8348
|
-
const ctx =
|
|
8521
|
+
const ctx = React38__namespace.useContext(TabsContext);
|
|
8349
8522
|
if (!ctx) {
|
|
8350
8523
|
throw new Error(
|
|
8351
8524
|
"[MD3 Tabs] Component must be used within a <Tabs> root. Ensure <TabsList>, <Tab>, and <TabsContent> are descendants of <Tabs>."
|
|
@@ -8353,7 +8526,7 @@ function useTabsContext() {
|
|
|
8353
8526
|
}
|
|
8354
8527
|
return ctx;
|
|
8355
8528
|
}
|
|
8356
|
-
var TabsComponent =
|
|
8529
|
+
var TabsComponent = React38__namespace.forwardRef(
|
|
8357
8530
|
({
|
|
8358
8531
|
value: controlledValue,
|
|
8359
8532
|
defaultValue = "",
|
|
@@ -8362,35 +8535,35 @@ var TabsComponent = React37__namespace.forwardRef(
|
|
|
8362
8535
|
children,
|
|
8363
8536
|
className
|
|
8364
8537
|
}, ref) => {
|
|
8365
|
-
const [internalValue, setInternalValue] =
|
|
8538
|
+
const [internalValue, setInternalValue] = React38__namespace.useState(defaultValue);
|
|
8366
8539
|
const isControlled = controlledValue !== void 0;
|
|
8367
8540
|
const value = isControlled ? controlledValue : internalValue;
|
|
8368
|
-
const handleValueChange =
|
|
8541
|
+
const handleValueChange = React38__namespace.useCallback(
|
|
8369
8542
|
(newValue) => {
|
|
8370
8543
|
if (!isControlled) setInternalValue(newValue);
|
|
8371
8544
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
8372
8545
|
},
|
|
8373
8546
|
[isControlled, onValueChange]
|
|
8374
8547
|
);
|
|
8375
|
-
const [focusedValue, setFocusedValue] =
|
|
8376
|
-
|
|
8548
|
+
const [focusedValue, setFocusedValue] = React38__namespace.useState(value);
|
|
8549
|
+
React38__namespace.useEffect(() => {
|
|
8377
8550
|
setFocusedValue(value);
|
|
8378
8551
|
}, [value]);
|
|
8379
|
-
const [tabValues, setTabValues] =
|
|
8380
|
-
const registerTab =
|
|
8552
|
+
const [tabValues, setTabValues] = React38__namespace.useState([]);
|
|
8553
|
+
const registerTab = React38__namespace.useCallback((tabValue) => {
|
|
8381
8554
|
setTabValues((prev) => {
|
|
8382
8555
|
if (prev.includes(tabValue)) return prev;
|
|
8383
8556
|
return [...prev, tabValue];
|
|
8384
8557
|
});
|
|
8385
8558
|
}, []);
|
|
8386
|
-
const unregisterTab =
|
|
8559
|
+
const unregisterTab = React38__namespace.useCallback((tabValue) => {
|
|
8387
8560
|
setTabValues((prev) => prev.filter((v) => v !== tabValue));
|
|
8388
8561
|
}, []);
|
|
8389
|
-
const hasAutoSelected =
|
|
8390
|
-
const [disabledValues, setDisabledValues] =
|
|
8562
|
+
const hasAutoSelected = React38__namespace.useRef(false);
|
|
8563
|
+
const [disabledValues, setDisabledValues] = React38__namespace.useState(
|
|
8391
8564
|
/* @__PURE__ */ new Set()
|
|
8392
8565
|
);
|
|
8393
|
-
const markTabDisabled =
|
|
8566
|
+
const markTabDisabled = React38__namespace.useCallback(
|
|
8394
8567
|
(tabValue, disabled) => {
|
|
8395
8568
|
setDisabledValues((prev) => {
|
|
8396
8569
|
const next = new Set(prev);
|
|
@@ -8404,7 +8577,7 @@ var TabsComponent = React37__namespace.forwardRef(
|
|
|
8404
8577
|
},
|
|
8405
8578
|
[]
|
|
8406
8579
|
);
|
|
8407
|
-
|
|
8580
|
+
React38__namespace.useEffect(() => {
|
|
8408
8581
|
if (isControlled || hasAutoSelected.current || tabValues.length === 0) {
|
|
8409
8582
|
return;
|
|
8410
8583
|
}
|
|
@@ -8419,9 +8592,9 @@ var TabsComponent = React37__namespace.forwardRef(
|
|
|
8419
8592
|
setFocusedValue(firstEnabled);
|
|
8420
8593
|
}
|
|
8421
8594
|
}, [tabValues, disabledValues, isControlled, value]);
|
|
8422
|
-
const id =
|
|
8595
|
+
const id = React38__namespace.useId();
|
|
8423
8596
|
const layoutGroupId = `tabs-${id}`;
|
|
8424
|
-
const contextValue =
|
|
8597
|
+
const contextValue = React38__namespace.useMemo(
|
|
8425
8598
|
() => ({
|
|
8426
8599
|
value,
|
|
8427
8600
|
onValueChange: handleValueChange,
|
|
@@ -8452,12 +8625,12 @@ var TabsComponent = React37__namespace.forwardRef(
|
|
|
8452
8625
|
}
|
|
8453
8626
|
);
|
|
8454
8627
|
TabsComponent.displayName = "Tabs";
|
|
8455
|
-
var Tabs =
|
|
8456
|
-
var TabsListContext =
|
|
8628
|
+
var Tabs = React38__namespace.memo(TabsComponent);
|
|
8629
|
+
var TabsListContext = React38__namespace.createContext(
|
|
8457
8630
|
null
|
|
8458
8631
|
);
|
|
8459
8632
|
function useTabsListContext() {
|
|
8460
|
-
const ctx =
|
|
8633
|
+
const ctx = React38__namespace.useContext(TabsListContext);
|
|
8461
8634
|
return ctx != null ? ctx : { variant: "primary", scrollable: false };
|
|
8462
8635
|
}
|
|
8463
8636
|
|
|
@@ -8541,7 +8714,7 @@ var TABS_CONTENT_TRANSITION = {
|
|
|
8541
8714
|
ease: "easeInOut"
|
|
8542
8715
|
};
|
|
8543
8716
|
var INDICATOR_MIN_WIDTH = 24;
|
|
8544
|
-
var TabComponent =
|
|
8717
|
+
var TabComponent = React38__namespace.forwardRef(
|
|
8545
8718
|
({
|
|
8546
8719
|
value,
|
|
8547
8720
|
icon,
|
|
@@ -8571,9 +8744,9 @@ var TabComponent = React37__namespace.forwardRef(
|
|
|
8571
8744
|
const isFocused = focusedValue === value;
|
|
8572
8745
|
const hasIcon = icon != null;
|
|
8573
8746
|
const isStackedIcon = hasIcon && !inlineIcon;
|
|
8574
|
-
const buttonRef =
|
|
8575
|
-
const isFirstMount =
|
|
8576
|
-
const mergedRef =
|
|
8747
|
+
const buttonRef = React38__namespace.useRef(null);
|
|
8748
|
+
const isFirstMount = React38__namespace.useRef(true);
|
|
8749
|
+
const mergedRef = React38__namespace.useCallback(
|
|
8577
8750
|
(node) => {
|
|
8578
8751
|
buttonRef.current = node;
|
|
8579
8752
|
if (typeof ref === "function") ref(node);
|
|
@@ -8581,15 +8754,15 @@ var TabComponent = React37__namespace.forwardRef(
|
|
|
8581
8754
|
},
|
|
8582
8755
|
[ref]
|
|
8583
8756
|
);
|
|
8584
|
-
|
|
8757
|
+
React38__namespace.useEffect(() => {
|
|
8585
8758
|
registerTab(value);
|
|
8586
8759
|
return () => unregisterTab(value);
|
|
8587
8760
|
}, [value, registerTab, unregisterTab]);
|
|
8588
|
-
|
|
8761
|
+
React38__namespace.useEffect(() => {
|
|
8589
8762
|
markTabDisabled(value, disabled);
|
|
8590
8763
|
return () => markTabDisabled(value, false);
|
|
8591
8764
|
}, [value, disabled, markTabDisabled]);
|
|
8592
|
-
const handleKeyDown =
|
|
8765
|
+
const handleKeyDown = React38__namespace.useCallback(
|
|
8593
8766
|
(e) => {
|
|
8594
8767
|
const isRtl = buttonRef.current ? getComputedStyle(buttonRef.current).direction === "rtl" : false;
|
|
8595
8768
|
const enabledValues = tabValues.filter((v) => !disabledValues.has(v));
|
|
@@ -8643,7 +8816,7 @@ var TabComponent = React37__namespace.forwardRef(
|
|
|
8643
8816
|
autoActivate
|
|
8644
8817
|
]
|
|
8645
8818
|
);
|
|
8646
|
-
|
|
8819
|
+
React38__namespace.useEffect(() => {
|
|
8647
8820
|
if (isFirstMount.current) {
|
|
8648
8821
|
isFirstMount.current = false;
|
|
8649
8822
|
return;
|
|
@@ -8652,7 +8825,7 @@ var TabComponent = React37__namespace.forwardRef(
|
|
|
8652
8825
|
buttonRef.current.focus({ preventScroll: true });
|
|
8653
8826
|
}
|
|
8654
8827
|
}, [isFocused]);
|
|
8655
|
-
|
|
8828
|
+
React38__namespace.useEffect(() => {
|
|
8656
8829
|
if (!isActive || !scrollable || !buttonRef.current) return;
|
|
8657
8830
|
const btn = buttonRef.current;
|
|
8658
8831
|
let container = btn.parentElement;
|
|
@@ -8789,8 +8962,8 @@ var TabComponent = React37__namespace.forwardRef(
|
|
|
8789
8962
|
}
|
|
8790
8963
|
);
|
|
8791
8964
|
TabComponent.displayName = "Tab";
|
|
8792
|
-
var Tab =
|
|
8793
|
-
var TabsContentComponent =
|
|
8965
|
+
var Tab = React38__namespace.memo(TabComponent);
|
|
8966
|
+
var TabsContentComponent = React38__namespace.forwardRef(
|
|
8794
8967
|
({ value, className, children }, ref) => {
|
|
8795
8968
|
var _a;
|
|
8796
8969
|
const { value: selectedValue, layoutGroupId } = useTabsContext();
|
|
@@ -8824,8 +8997,8 @@ var TabsContentComponent = React37__namespace.forwardRef(
|
|
|
8824
8997
|
}
|
|
8825
8998
|
);
|
|
8826
8999
|
TabsContentComponent.displayName = "TabsContent";
|
|
8827
|
-
var TabsContent =
|
|
8828
|
-
var TabsListComponent =
|
|
9000
|
+
var TabsContent = React38__namespace.memo(TabsContentComponent);
|
|
9001
|
+
var TabsListComponent = React38__namespace.forwardRef(
|
|
8829
9002
|
({
|
|
8830
9003
|
variant,
|
|
8831
9004
|
scrollable = false,
|
|
@@ -8836,12 +9009,12 @@ var TabsListComponent = React37__namespace.forwardRef(
|
|
|
8836
9009
|
}, ref) => {
|
|
8837
9010
|
const { layoutGroupId, value, setFocusedValue } = useTabsContext();
|
|
8838
9011
|
const listLayoutId = `${layoutGroupId}-list`;
|
|
8839
|
-
const listContextValue =
|
|
9012
|
+
const listContextValue = React38__namespace.useMemo(
|
|
8840
9013
|
() => ({ variant, scrollable }),
|
|
8841
9014
|
[variant, scrollable]
|
|
8842
9015
|
);
|
|
8843
9016
|
const bgColor = backgroundColor != null ? backgroundColor : "var(--md-sys-color-surface)";
|
|
8844
|
-
const handleBlur =
|
|
9017
|
+
const handleBlur = React38__namespace.useCallback(
|
|
8845
9018
|
(e) => {
|
|
8846
9019
|
const listEl = e.currentTarget;
|
|
8847
9020
|
if (listEl.contains(e.relatedTarget)) return;
|
|
@@ -8890,7 +9063,7 @@ var TabsListComponent = React37__namespace.forwardRef(
|
|
|
8890
9063
|
}
|
|
8891
9064
|
);
|
|
8892
9065
|
TabsListComponent.displayName = "TabsList";
|
|
8893
|
-
var TabsList =
|
|
9066
|
+
var TabsList = React38__namespace.memo(TabsListComponent);
|
|
8894
9067
|
|
|
8895
9068
|
// src/ui/toolbar/toolbar-colors.ts
|
|
8896
9069
|
var standardFloatingToolbarColors = {
|
|
@@ -8946,13 +9119,13 @@ function getToolbarColors(variant = "standard", customColors) {
|
|
|
8946
9119
|
return standardFloatingToolbarColors;
|
|
8947
9120
|
}
|
|
8948
9121
|
}
|
|
8949
|
-
var ToolbarContext =
|
|
9122
|
+
var ToolbarContext = React38__namespace.createContext(
|
|
8950
9123
|
null
|
|
8951
9124
|
);
|
|
8952
9125
|
function useToolbarContext() {
|
|
8953
|
-
return
|
|
9126
|
+
return React38__namespace.useContext(ToolbarContext);
|
|
8954
9127
|
}
|
|
8955
|
-
var BottomDockedToolbar =
|
|
9128
|
+
var BottomDockedToolbar = React38__namespace.forwardRef(
|
|
8956
9129
|
(_a, ref) => {
|
|
8957
9130
|
var _b = _a, {
|
|
8958
9131
|
variant = "standard",
|
|
@@ -8985,8 +9158,8 @@ var BottomDockedToolbar = React37__namespace.forwardRef(
|
|
|
8985
9158
|
const { scrollY } = react.useScroll(
|
|
8986
9159
|
scrollContainerRef ? { container: scrollContainerRef } : void 0
|
|
8987
9160
|
);
|
|
8988
|
-
const [isHidden, setIsHidden] =
|
|
8989
|
-
const lastScrollY =
|
|
9161
|
+
const [isHidden, setIsHidden] = React38__namespace.useState(false);
|
|
9162
|
+
const lastScrollY = React38__namespace.useRef(0);
|
|
8990
9163
|
react.useMotionValueEvent(scrollY, "change", (latest) => {
|
|
8991
9164
|
if (!hideOnScroll) return;
|
|
8992
9165
|
const diff = latest - lastScrollY.current;
|
|
@@ -9145,15 +9318,15 @@ function buildSlotVariants(xHidden, yHidden, isHorizontal) {
|
|
|
9145
9318
|
};
|
|
9146
9319
|
}
|
|
9147
9320
|
function applyItemClassName(nodes, itemClassName) {
|
|
9148
|
-
return
|
|
9149
|
-
if (!
|
|
9321
|
+
return React38__namespace.Children.map(nodes, (child) => {
|
|
9322
|
+
if (!React38__namespace.isValidElement(child)) return child;
|
|
9150
9323
|
const element = child;
|
|
9151
|
-
return
|
|
9324
|
+
return React38__namespace.cloneElement(element, {
|
|
9152
9325
|
className: cn(element.props.className, itemClassName)
|
|
9153
9326
|
});
|
|
9154
9327
|
});
|
|
9155
9328
|
}
|
|
9156
|
-
var FloatingToolbarBase =
|
|
9329
|
+
var FloatingToolbarBase = React38__namespace.forwardRef(
|
|
9157
9330
|
(_a, ref) => {
|
|
9158
9331
|
var _b = _a, {
|
|
9159
9332
|
expanded,
|
|
@@ -9325,11 +9498,11 @@ var FloatingToolbarBase = React37__namespace.forwardRef(
|
|
|
9325
9498
|
}
|
|
9326
9499
|
);
|
|
9327
9500
|
FloatingToolbarBase.displayName = "FloatingToolbarBase";
|
|
9328
|
-
var HorizontalFloatingToolbar =
|
|
9501
|
+
var HorizontalFloatingToolbar = React38__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(FloatingToolbarBase, __spreadValues({ ref, orientation: "horizontal" }, props)));
|
|
9329
9502
|
HorizontalFloatingToolbar.displayName = "HorizontalFloatingToolbar";
|
|
9330
|
-
var VerticalFloatingToolbar =
|
|
9503
|
+
var VerticalFloatingToolbar = React38__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(FloatingToolbarBase, __spreadValues({ ref, orientation: "vertical" }, props)));
|
|
9331
9504
|
VerticalFloatingToolbar.displayName = "VerticalFloatingToolbar";
|
|
9332
|
-
var FloatingToolbarWithFabBase =
|
|
9505
|
+
var FloatingToolbarWithFabBase = React38__namespace.forwardRef(
|
|
9333
9506
|
(_a, ref) => {
|
|
9334
9507
|
var _b = _a, {
|
|
9335
9508
|
expanded,
|
|
@@ -9457,9 +9630,9 @@ var FloatingToolbarWithFabBase = React37__namespace.forwardRef(
|
|
|
9457
9630
|
}
|
|
9458
9631
|
);
|
|
9459
9632
|
FloatingToolbarWithFabBase.displayName = "FloatingToolbarWithFabBase";
|
|
9460
|
-
var HorizontalFloatingToolbarWithFab =
|
|
9633
|
+
var HorizontalFloatingToolbarWithFab = React38__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(FloatingToolbarWithFabBase, __spreadValues({ ref, orientation: "horizontal" }, props)));
|
|
9461
9634
|
HorizontalFloatingToolbarWithFab.displayName = "HorizontalFloatingToolbarWithFab";
|
|
9462
|
-
var VerticalFloatingToolbarWithFab =
|
|
9635
|
+
var VerticalFloatingToolbarWithFab = React38__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(FloatingToolbarWithFabBase, __spreadValues({ ref, orientation: "vertical" }, props)));
|
|
9463
9636
|
VerticalFloatingToolbarWithFab.displayName = "VerticalFloatingToolbarWithFab";
|
|
9464
9637
|
var ToolbarDivider = ({
|
|
9465
9638
|
orientation: propsOrientation,
|
|
@@ -9495,7 +9668,7 @@ var VARIANT_TO_COLOR_STYLE = {
|
|
|
9495
9668
|
tonal: "tonal",
|
|
9496
9669
|
filled: "filled"
|
|
9497
9670
|
};
|
|
9498
|
-
var ToolbarIconButton =
|
|
9671
|
+
var ToolbarIconButton = React38__namespace.forwardRef(
|
|
9499
9672
|
(_a, ref) => {
|
|
9500
9673
|
var _b = _a, {
|
|
9501
9674
|
emphasis = "standard",
|
|
@@ -9557,13 +9730,13 @@ function useFloatingToolbarScrollBehavior(options = {}) {
|
|
|
9557
9730
|
expandThreshold = 10,
|
|
9558
9731
|
scrollContainerRef
|
|
9559
9732
|
} = options;
|
|
9560
|
-
const [isExpanded, setIsExpanded] =
|
|
9561
|
-
const [offset, setOffset] =
|
|
9733
|
+
const [isExpanded, setIsExpanded] = React38.useState(true);
|
|
9734
|
+
const [offset, setOffset] = React38.useState(0);
|
|
9562
9735
|
const { scrollY } = react.useScroll({
|
|
9563
9736
|
container: scrollContainerRef
|
|
9564
9737
|
});
|
|
9565
|
-
const lastScrollY =
|
|
9566
|
-
const accumulatedScroll =
|
|
9738
|
+
const lastScrollY = React38.useRef(0);
|
|
9739
|
+
const accumulatedScroll = React38.useRef(0);
|
|
9567
9740
|
react.useMotionValueEvent(scrollY, "change", (currentScrollY) => {
|
|
9568
9741
|
const deltaY = currentScrollY - lastScrollY.current;
|
|
9569
9742
|
if (currentScrollY < 0) return;
|
|
@@ -9585,7 +9758,7 @@ function useFloatingToolbarScrollBehavior(options = {}) {
|
|
|
9585
9758
|
}
|
|
9586
9759
|
}
|
|
9587
9760
|
});
|
|
9588
|
-
|
|
9761
|
+
React38.useEffect(() => {
|
|
9589
9762
|
if (typeof window !== "undefined") {
|
|
9590
9763
|
const matchMedia = window.matchMedia("(forced-colors: active)");
|
|
9591
9764
|
if (matchMedia.matches) {
|
|
@@ -9667,7 +9840,7 @@ var MOTION_PROP_KEYS = [
|
|
|
9667
9840
|
"layoutId",
|
|
9668
9841
|
"onLayoutAnimationComplete"
|
|
9669
9842
|
];
|
|
9670
|
-
var ToolbarToggleButton =
|
|
9843
|
+
var ToolbarToggleButton = React38__namespace.forwardRef(
|
|
9671
9844
|
(_a, ref) => {
|
|
9672
9845
|
var _b = _a, {
|
|
9673
9846
|
emphasis = "standard",
|
|
@@ -9701,7 +9874,7 @@ var ToolbarToggleButton = React37__namespace.forwardRef(
|
|
|
9701
9874
|
"onPointerLeave"
|
|
9702
9875
|
]);
|
|
9703
9876
|
const context = useToolbarContext();
|
|
9704
|
-
const [isPressed, setIsPressed] =
|
|
9877
|
+
const [isPressed, setIsPressed] = React38__namespace.useState(false);
|
|
9705
9878
|
const {
|
|
9706
9879
|
ripples,
|
|
9707
9880
|
onPointerDown: handleRipplePointerDown,
|
|
@@ -9709,7 +9882,7 @@ var ToolbarToggleButton = React37__namespace.forwardRef(
|
|
|
9709
9882
|
} = useRippleState({
|
|
9710
9883
|
disabled: Boolean(disabled) || !ripple
|
|
9711
9884
|
});
|
|
9712
|
-
const handlePointerDown =
|
|
9885
|
+
const handlePointerDown = React38__namespace.useCallback(
|
|
9713
9886
|
(e) => {
|
|
9714
9887
|
setIsPressed(true);
|
|
9715
9888
|
if (!disabled && ripple) {
|
|
@@ -9719,14 +9892,14 @@ var ToolbarToggleButton = React37__namespace.forwardRef(
|
|
|
9719
9892
|
},
|
|
9720
9893
|
[disabled, ripple, handleRipplePointerDown, onPointerDownProp]
|
|
9721
9894
|
);
|
|
9722
|
-
const handlePointerUp =
|
|
9895
|
+
const handlePointerUp = React38__namespace.useCallback(
|
|
9723
9896
|
(e) => {
|
|
9724
9897
|
setIsPressed(false);
|
|
9725
9898
|
onPointerUpProp == null ? void 0 : onPointerUpProp(e);
|
|
9726
9899
|
},
|
|
9727
9900
|
[onPointerUpProp]
|
|
9728
9901
|
);
|
|
9729
|
-
const handlePointerLeave =
|
|
9902
|
+
const handlePointerLeave = React38__namespace.useCallback(
|
|
9730
9903
|
(e) => {
|
|
9731
9904
|
setIsPressed(false);
|
|
9732
9905
|
onPointerLeaveProp == null ? void 0 : onPointerLeaveProp(e);
|
|
@@ -9745,14 +9918,14 @@ var ToolbarToggleButton = React37__namespace.forwardRef(
|
|
|
9745
9918
|
context == null ? void 0 : context.itemClassName,
|
|
9746
9919
|
className
|
|
9747
9920
|
);
|
|
9748
|
-
const animateConfig =
|
|
9921
|
+
const animateConfig = React38__namespace.useMemo(
|
|
9749
9922
|
() => ({
|
|
9750
9923
|
scaleX: pressExpand && isPressed ? 1 + pressExpandRatio : 1,
|
|
9751
9924
|
borderRadius: isPressed ? ToolbarToggleButtonRadiusTokens.pressedRadius : ToolbarToggleButtonRadiusTokens.pillRadius
|
|
9752
9925
|
}),
|
|
9753
9926
|
[pressExpand, pressExpandRatio, isPressed]
|
|
9754
9927
|
);
|
|
9755
|
-
const transitionConfig =
|
|
9928
|
+
const transitionConfig = React38__namespace.useMemo(
|
|
9756
9929
|
() => ({
|
|
9757
9930
|
scaleX: FAST_SPATIAL_SPRING,
|
|
9758
9931
|
borderRadius: BUTTON_RADIUS_SPRING
|
|
@@ -9774,7 +9947,7 @@ var ToolbarToggleButton = React37__namespace.forwardRef(
|
|
|
9774
9947
|
children && (typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsxRuntime.jsx("span", { children }) : children)
|
|
9775
9948
|
] });
|
|
9776
9949
|
if (asChild) {
|
|
9777
|
-
const child =
|
|
9950
|
+
const child = React38__namespace.Children.only(children);
|
|
9778
9951
|
const childContent = child.props.children;
|
|
9779
9952
|
const innerChildContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9780
9953
|
ripple && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9813,7 +9986,7 @@ var ToolbarToggleButton = React37__namespace.forwardRef(
|
|
|
9813
9986
|
onPointerUp: handlePointerUp,
|
|
9814
9987
|
onPointerLeave: handlePointerLeave
|
|
9815
9988
|
}, strippedProps), {
|
|
9816
|
-
children:
|
|
9989
|
+
children: React38__namespace.cloneElement(child, { children: innerChildContent })
|
|
9817
9990
|
})
|
|
9818
9991
|
) });
|
|
9819
9992
|
}
|