@bug-on/m3-expressive 1.3.1 → 1.3.3
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 +15 -0
- package/README.md +113 -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/core.js +9 -7
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +9 -7
- package/dist/core.mjs.map +1 -1
- package/dist/feedback.d.mts +2 -1
- package/dist/feedback.d.ts +2 -1
- package/dist/feedback.js +11 -8
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs +11 -9
- 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 +13 -83
- package/dist/index.d.ts +13 -83
- package/dist/index.js +2843 -1210
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2692 -1072
- package/dist/index.mjs.map +1 -1
- package/dist/layout.d.mts +496 -37
- package/dist/layout.d.ts +496 -37
- package/dist/layout.js +1537 -238
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +1509 -226
- 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 +28 -296
- package/dist/navigation.d.ts +28 -296
- package/dist/navigation.js +584 -288
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +576 -282
- 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/llms-full.txt +255 -0
- package/llms.txt +102 -0
- package/package.json +10 -5
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 React39 = 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 React39__namespace = /*#__PURE__*/_interopNamespace(React39);
|
|
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 = React39__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] = React39__namespace.useState(false);
|
|
343
|
+
React39__namespace.useEffect(() => {
|
|
344
|
+
if (typeof window !== "undefined") {
|
|
345
|
+
setIsTouchDevice(
|
|
346
|
+
"ontouchstart" in window || navigator.maxTouchPoints > 0
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
}, []);
|
|
350
|
+
const resolvedType = React39__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 = React39__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 = React39__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 = React39__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 = React39__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 = React39__namespace.useContext(MenuContext);
|
|
533
|
+
return React39__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 React39__namespace.Children.toArray(nodes).reduce(
|
|
531
654
|
(acc, child) => {
|
|
532
|
-
if (!
|
|
533
|
-
if (child.type ===
|
|
655
|
+
if (!React39__namespace.isValidElement(child)) return acc;
|
|
656
|
+
if (child.type === React39__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] = React39__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 = React39__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 = React39__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 = React39__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 = React39__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 = React39__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) => React39__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] = React39__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 = React39__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 = React39__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 = React39__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 = React39__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 = React39__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 = React39__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 React39__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 = React39__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 = React39__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 = React39__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 React39__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 = React39__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 = React39__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 = React39__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] = React39__namespace.useState(false);
|
|
1439
|
+
const openTimerRef = React39__namespace.useRef(null);
|
|
1440
|
+
const closeTimerRef = React39__namespace.useRef(
|
|
1268
1441
|
null
|
|
1269
1442
|
);
|
|
1270
|
-
const clearTimers =
|
|
1443
|
+
const clearTimers = React39__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 = React39__namespace.useCallback(() => {
|
|
1275
1448
|
clearTimers();
|
|
1276
1449
|
openTimerRef.current = setTimeout(() => setOpen(true), hoverOpenDelay);
|
|
1277
1450
|
}, [hoverOpenDelay, clearTimers]);
|
|
1278
|
-
const handleTriggerPointerLeave =
|
|
1451
|
+
const handleTriggerPointerLeave = React39__namespace.useCallback(() => {
|
|
1279
1452
|
clearTimers();
|
|
1280
1453
|
closeTimerRef.current = setTimeout(() => setOpen(false), hoverCloseDelay);
|
|
1281
1454
|
}, [hoverCloseDelay, clearTimers]);
|
|
1282
|
-
const handleContentPointerEnter =
|
|
1455
|
+
const handleContentPointerEnter = React39__namespace.useCallback(() => {
|
|
1283
1456
|
clearTimers();
|
|
1284
1457
|
}, [clearTimers]);
|
|
1285
|
-
const handleContentPointerLeave =
|
|
1458
|
+
const handleContentPointerLeave = React39__namespace.useCallback(() => {
|
|
1286
1459
|
clearTimers();
|
|
1287
1460
|
closeTimerRef.current = setTimeout(() => setOpen(false), hoverCloseDelay);
|
|
1288
1461
|
}, [hoverCloseDelay, clearTimers]);
|
|
1289
|
-
|
|
1462
|
+
React39__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: React39__namespace.isValidElement(trigger) ? React39__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 = React39__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 = React39__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 = React39__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 React39__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 = React39__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 = React39__namespace.useCallback(() => {
|
|
1468
1641
|
}, []);
|
|
1469
1642
|
const colors = colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1470
|
-
const containerRef =
|
|
1471
|
-
const mergedRef =
|
|
1643
|
+
const containerRef = React39__namespace.useRef(null);
|
|
1644
|
+
const mergedRef = React39__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 = React39__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 = React39__namespace.Children.toArray(children).find(React39__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 = React39__namespace.useRef(null);
|
|
1818
|
+
const [visibleCount, setVisibleCount] = React39__namespace.useState(
|
|
1646
1819
|
maxItemCount != null ? maxItemCount : items.length
|
|
1647
1820
|
);
|
|
1648
|
-
|
|
1821
|
+
React39__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 = React39__namespace.useRef(null);
|
|
1870
|
+
const [visibleCount, setVisibleCount] = React39__namespace.useState(
|
|
1698
1871
|
maxItemCount != null ? maxItemCount : items.length
|
|
1699
1872
|
);
|
|
1700
|
-
|
|
1873
|
+
React39__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] = React39__namespace.useState(false);
|
|
1928
|
+
const [collapsedFraction, setCollapsedFraction] = React39__namespace.useState(0);
|
|
1929
|
+
const [isHidden, setIsHidden] = React39__namespace.useState(false);
|
|
1930
|
+
const prevScrollYRef = React39__namespace.useRef(0);
|
|
1758
1931
|
const hideThreshold = 64;
|
|
1759
|
-
|
|
1932
|
+
React39__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
|
+
React39__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] = React39__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 = React39__namespace.useRef(null);
|
|
2587
|
+
React39__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 = React39__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] = React39__namespace.useState([]);
|
|
2923
|
+
const onPointerDown = React39__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 = React39__namespace.useCallback((id) => {
|
|
2768
2941
|
setRipples((prev) => prev.filter((r) => r.id !== id));
|
|
2769
2942
|
}, []);
|
|
2770
2943
|
return { ripples, onPointerDown, removeRipple };
|
|
@@ -3477,8 +3650,8 @@ var RoundedPolygon = class _RoundedPolygon {
|
|
|
3477
3650
|
);
|
|
3478
3651
|
const mid = c.pointOnCurve(0.5);
|
|
3479
3652
|
const md = distanceSquared(mid.x - this.centerX, mid.y - this.centerY);
|
|
3480
|
-
const
|
|
3481
|
-
if (
|
|
3653
|
+
const m33 = Math.max(ad, md);
|
|
3654
|
+
if (m33 > maxDistSq) maxDistSq = m33;
|
|
3482
3655
|
}
|
|
3483
3656
|
const d = Math.sqrt(maxDistSq);
|
|
3484
3657
|
return [
|
|
@@ -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 = React39__namespace.createContext({ variant: "flexible" });
|
|
4698
4871
|
function cloneIconWithFill(icon, selected) {
|
|
4699
|
-
if (!
|
|
4872
|
+
if (!React39__namespace.isValidElement(icon)) return icon;
|
|
4700
4873
|
if (icon.type === Icon) {
|
|
4701
|
-
return
|
|
4874
|
+
return React39__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 } = React39__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 = React39__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
|
+
} = React39__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 = React39__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 = React39__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: React39__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 = React39__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 = React39__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] = React39__namespace.useState(true);
|
|
5326
|
+
const lastScrollY = React39__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 = React39__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
|
+
React39__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 = React39__namespace.memo(NavigationBarComponent);
|
|
5421
|
+
var NavigationRailContext = React39__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 (!React39__namespace.isValidElement(icon)) return icon;
|
|
5285
5458
|
if (icon.type === Icon) {
|
|
5286
|
-
return
|
|
5459
|
+
return React39__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 } = React39__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 = React39__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
|
+
} = React39__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-${React39__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 = React39__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 = React39__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: React39__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 = React39__namespace.memo(NavigationRailItemComponent);
|
|
5697
5870
|
function useRoving(navRef) {
|
|
5698
|
-
|
|
5871
|
+
React39__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 React39__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 = React39__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 = React39__namespace.useRef(null);
|
|
5761
5934
|
const handleKeyDown = useRoving(navRef);
|
|
5762
|
-
const setRefs =
|
|
5935
|
+
const setRefs = React39__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
|
+
React39__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 = React39__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] = React39__namespace.useState(-1);
|
|
6083
|
+
const resetKeyRef = React39__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 = React39__namespace.useCallback(
|
|
5917
6090
|
(e) => {
|
|
5918
6091
|
if (!active) return;
|
|
5919
6092
|
switch (e.key) {
|
|
@@ -5953,11 +6126,39 @@ function useSearchKeyboard({
|
|
|
5953
6126
|
query
|
|
5954
6127
|
]
|
|
5955
6128
|
);
|
|
5956
|
-
const resetActiveIndex =
|
|
6129
|
+
const resetActiveIndex = React39__namespace.useCallback(() => {
|
|
5957
6130
|
setActiveIndex(-1);
|
|
5958
6131
|
}, []);
|
|
5959
6132
|
return { activeIndex, handleKeyDown, resetActiveIndex };
|
|
5960
6133
|
}
|
|
6134
|
+
var StateLayer = React39__namespace.forwardRef(
|
|
6135
|
+
(_a, ref) => {
|
|
6136
|
+
var _b = _a, { className, hovered, focused, pressed } = _b, props = __objRest(_b, ["className", "hovered", "focused", "pressed"]);
|
|
6137
|
+
let opacity = 0;
|
|
6138
|
+
if (pressed) {
|
|
6139
|
+
opacity = 0.12;
|
|
6140
|
+
} else if (focused) {
|
|
6141
|
+
opacity = 0.1;
|
|
6142
|
+
} else if (hovered) {
|
|
6143
|
+
opacity = 0.08;
|
|
6144
|
+
}
|
|
6145
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6146
|
+
react.m.div,
|
|
6147
|
+
__spreadValues({
|
|
6148
|
+
ref,
|
|
6149
|
+
className: cn(
|
|
6150
|
+
"absolute inset-0 bg-current pointer-events-none rounded-[inherit]",
|
|
6151
|
+
className
|
|
6152
|
+
),
|
|
6153
|
+
initial: false,
|
|
6154
|
+
animate: { opacity },
|
|
6155
|
+
transition: { duration: 0.2 },
|
|
6156
|
+
"aria-hidden": "true"
|
|
6157
|
+
}, props)
|
|
6158
|
+
) });
|
|
6159
|
+
}
|
|
6160
|
+
);
|
|
6161
|
+
StateLayer.displayName = "StateLayer";
|
|
5961
6162
|
|
|
5962
6163
|
// src/ui/search/search.tokens.ts
|
|
5963
6164
|
var SearchTokens = {
|
|
@@ -5996,7 +6197,12 @@ var SEARCH_COLORS = {
|
|
|
5996
6197
|
/** SearchViewTokens.DividerColor → outline */
|
|
5997
6198
|
divider: "var(--md-sys-color-outline)",
|
|
5998
6199
|
/** Focus indicator → secondary */
|
|
5999
|
-
focusIndicator: "var(--md-sys-color-secondary)"
|
|
6200
|
+
focusIndicator: "var(--md-sys-color-secondary)",
|
|
6201
|
+
/** State layer overlay for interactive hover/press */
|
|
6202
|
+
stateLayer: "var(--md-sys-color-on-surface)"
|
|
6203
|
+
};
|
|
6204
|
+
var SEARCH_ELEVATION = {
|
|
6205
|
+
level3: "elevation-3"
|
|
6000
6206
|
};
|
|
6001
6207
|
var SEARCH_TYPOGRAPHY = {
|
|
6002
6208
|
/** BodyLarge — used for input text and placeholder. */
|
|
@@ -6021,10 +6227,10 @@ function AnimatedPlaceholder({
|
|
|
6021
6227
|
className
|
|
6022
6228
|
}) {
|
|
6023
6229
|
const shouldReduceMotion = react.useReducedMotion();
|
|
6024
|
-
const containerRef =
|
|
6025
|
-
const spanRef =
|
|
6026
|
-
const [xOffset, setXOffset] =
|
|
6027
|
-
const recalculate =
|
|
6230
|
+
const containerRef = React39__namespace.useRef(null);
|
|
6231
|
+
const spanRef = React39__namespace.useRef(null);
|
|
6232
|
+
const [xOffset, setXOffset] = React39__namespace.useState(0);
|
|
6233
|
+
const recalculate = React39__namespace.useCallback(() => {
|
|
6028
6234
|
const container = containerRef.current;
|
|
6029
6235
|
const span = spanRef.current;
|
|
6030
6236
|
if (!container || !span || textAlign === "left") {
|
|
@@ -6039,10 +6245,10 @@ function AnimatedPlaceholder({
|
|
|
6039
6245
|
setXOffset(Math.max(0, containerWidth - textWidth));
|
|
6040
6246
|
}
|
|
6041
6247
|
}, [textAlign]);
|
|
6042
|
-
|
|
6248
|
+
React39__namespace.useLayoutEffect(() => {
|
|
6043
6249
|
recalculate();
|
|
6044
6250
|
}, [recalculate]);
|
|
6045
|
-
|
|
6251
|
+
React39__namespace.useEffect(() => {
|
|
6046
6252
|
const container = containerRef.current;
|
|
6047
6253
|
if (!container) return;
|
|
6048
6254
|
const observer = new ResizeObserver(recalculate);
|
|
@@ -6101,6 +6307,7 @@ function SearchBar({
|
|
|
6101
6307
|
onActiveChange,
|
|
6102
6308
|
leadingIcon,
|
|
6103
6309
|
trailingIcon,
|
|
6310
|
+
avatar,
|
|
6104
6311
|
placeholder = "Search",
|
|
6105
6312
|
textAlign = "left",
|
|
6106
6313
|
className,
|
|
@@ -6111,10 +6318,13 @@ function SearchBar({
|
|
|
6111
6318
|
activeIndex
|
|
6112
6319
|
}) {
|
|
6113
6320
|
const shouldReduceMotion = react.useReducedMotion();
|
|
6114
|
-
const inputRef =
|
|
6115
|
-
const prevActiveRef =
|
|
6116
|
-
const isRestoringFocusRef =
|
|
6117
|
-
|
|
6321
|
+
const inputRef = React39__namespace.useRef(null);
|
|
6322
|
+
const prevActiveRef = React39__namespace.useRef(active);
|
|
6323
|
+
const isRestoringFocusRef = React39__namespace.useRef(false);
|
|
6324
|
+
const [isHovered, setIsHovered] = React39__namespace.useState(false);
|
|
6325
|
+
const [isPressed, setIsPressed] = React39__namespace.useState(false);
|
|
6326
|
+
const [isFocused, setIsFocused] = React39__namespace.useState(false);
|
|
6327
|
+
React39__namespace.useEffect(() => {
|
|
6118
6328
|
var _a;
|
|
6119
6329
|
let rafId;
|
|
6120
6330
|
if (prevActiveRef.current === true && active === false) {
|
|
@@ -6130,10 +6340,14 @@ function SearchBar({
|
|
|
6130
6340
|
};
|
|
6131
6341
|
}, [active]);
|
|
6132
6342
|
const handleFocus = () => {
|
|
6343
|
+
setIsFocused(true);
|
|
6133
6344
|
if (!active && !isRestoringFocusRef.current) {
|
|
6134
6345
|
onActiveChange(true);
|
|
6135
6346
|
}
|
|
6136
6347
|
};
|
|
6348
|
+
const handleBlur = () => {
|
|
6349
|
+
setIsFocused(false);
|
|
6350
|
+
};
|
|
6137
6351
|
const handleFormSubmit = (e) => {
|
|
6138
6352
|
e.preventDefault();
|
|
6139
6353
|
onSearch(query);
|
|
@@ -6152,18 +6366,39 @@ function SearchBar({
|
|
|
6152
6366
|
layout: !shouldReduceMotion,
|
|
6153
6367
|
layoutId: shouldReduceMotion ? void 0 : searchId,
|
|
6154
6368
|
transition: shouldReduceMotion ? void 0 : SEARCH_BAR_EXPAND_SPRING,
|
|
6155
|
-
className: cn(
|
|
6369
|
+
className: cn(
|
|
6370
|
+
"relative group select-none",
|
|
6371
|
+
SEARCH_ELEVATION.level3,
|
|
6372
|
+
className
|
|
6373
|
+
),
|
|
6156
6374
|
style: { height: SearchTokens.heights.bar },
|
|
6157
6375
|
initial: shouldReduceMotion ? false : { opacity: 0, scale: 0.95 },
|
|
6158
6376
|
animate: { opacity: 1, scale: 1 },
|
|
6159
6377
|
exit: shouldReduceMotion ? {} : { opacity: 0, scale: 0.95, transition: SEARCH_BAR_EXIT_SPRING },
|
|
6378
|
+
onPointerEnter: () => setIsHovered(true),
|
|
6379
|
+
onPointerLeave: () => {
|
|
6380
|
+
setIsHovered(false);
|
|
6381
|
+
setIsPressed(false);
|
|
6382
|
+
},
|
|
6383
|
+
onPointerDown: () => setIsPressed(true),
|
|
6384
|
+
onPointerUp: () => setIsPressed(false),
|
|
6385
|
+
onPointerCancel: () => setIsPressed(false),
|
|
6160
6386
|
children: [
|
|
6161
6387
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6162
6388
|
"div",
|
|
6163
6389
|
{
|
|
6164
|
-
className: "absolute inset-0 rounded-full",
|
|
6390
|
+
className: "absolute inset-0 rounded-full overflow-hidden",
|
|
6165
6391
|
style: { backgroundColor: SEARCH_COLORS.container },
|
|
6166
|
-
"aria-hidden": "true"
|
|
6392
|
+
"aria-hidden": "true",
|
|
6393
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6394
|
+
StateLayer,
|
|
6395
|
+
{
|
|
6396
|
+
hovered: isHovered,
|
|
6397
|
+
focused: isFocused,
|
|
6398
|
+
pressed: isPressed,
|
|
6399
|
+
style: { color: SEARCH_COLORS.stateLayer }
|
|
6400
|
+
}
|
|
6401
|
+
)
|
|
6167
6402
|
}
|
|
6168
6403
|
),
|
|
6169
6404
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6209,21 +6444,36 @@ function SearchBar({
|
|
|
6209
6444
|
),
|
|
6210
6445
|
style: { color: SEARCH_COLORS.inputText },
|
|
6211
6446
|
onFocus: handleFocus,
|
|
6447
|
+
onBlur: handleBlur,
|
|
6212
6448
|
onChange: (e) => onQueryChange(e.target.value),
|
|
6213
6449
|
onKeyDown
|
|
6214
6450
|
}
|
|
6215
6451
|
)
|
|
6216
6452
|
}
|
|
6217
6453
|
),
|
|
6218
|
-
trailingIcon && /* @__PURE__ */ jsxRuntime.
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6454
|
+
(trailingIcon || avatar) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
6455
|
+
trailingIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6456
|
+
"span",
|
|
6457
|
+
{
|
|
6458
|
+
className: "flex shrink-0 items-center justify-center",
|
|
6459
|
+
style: { color: SEARCH_COLORS.trailingIcon },
|
|
6460
|
+
"aria-hidden": "true",
|
|
6461
|
+
children: trailingIcon
|
|
6462
|
+
}
|
|
6463
|
+
),
|
|
6464
|
+
avatar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6465
|
+
"span",
|
|
6466
|
+
{
|
|
6467
|
+
className: "flex shrink-0 items-center justify-center rounded-full overflow-hidden",
|
|
6468
|
+
style: {
|
|
6469
|
+
width: SearchTokens.avatarSize,
|
|
6470
|
+
height: SearchTokens.avatarSize
|
|
6471
|
+
},
|
|
6472
|
+
"aria-hidden": "true",
|
|
6473
|
+
children: avatar
|
|
6474
|
+
}
|
|
6475
|
+
)
|
|
6476
|
+
] })
|
|
6227
6477
|
] })
|
|
6228
6478
|
}
|
|
6229
6479
|
)
|
|
@@ -6233,7 +6483,7 @@ function SearchBar({
|
|
|
6233
6483
|
) })
|
|
6234
6484
|
);
|
|
6235
6485
|
}
|
|
6236
|
-
var SearchContext =
|
|
6486
|
+
var SearchContext = React39__namespace.createContext(null);
|
|
6237
6487
|
function SearchProvider({
|
|
6238
6488
|
children,
|
|
6239
6489
|
value
|
|
@@ -6241,15 +6491,15 @@ function SearchProvider({
|
|
|
6241
6491
|
return /* @__PURE__ */ jsxRuntime.jsx(SearchContext.Provider, { value, children });
|
|
6242
6492
|
}
|
|
6243
6493
|
function useSearch() {
|
|
6244
|
-
const context =
|
|
6494
|
+
const context = React39__namespace.useContext(SearchContext);
|
|
6245
6495
|
if (!context) {
|
|
6246
6496
|
return { listboxId: "", activeIndex: -1 };
|
|
6247
6497
|
}
|
|
6248
6498
|
return context;
|
|
6249
6499
|
}
|
|
6250
6500
|
function useClickOutside(handler, enabled = true) {
|
|
6251
|
-
const ref =
|
|
6252
|
-
|
|
6501
|
+
const ref = React39.useRef(null);
|
|
6502
|
+
React39.useEffect(() => {
|
|
6253
6503
|
if (!enabled) return;
|
|
6254
6504
|
const listener = (event) => {
|
|
6255
6505
|
const el = ref.current;
|
|
@@ -6268,7 +6518,7 @@ function useClickOutside(handler, enabled = true) {
|
|
|
6268
6518
|
return ref;
|
|
6269
6519
|
}
|
|
6270
6520
|
function useSearchViewFocus(inputRef, active) {
|
|
6271
|
-
|
|
6521
|
+
React39__namespace.useEffect(() => {
|
|
6272
6522
|
if (!active) return;
|
|
6273
6523
|
let raf2;
|
|
6274
6524
|
const raf1 = requestAnimationFrame(() => {
|
|
@@ -6328,11 +6578,11 @@ var ROTATE_KEY_SPLINES = [
|
|
|
6328
6578
|
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
6579
|
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
6580
|
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 =
|
|
6581
|
+
var IndeterminateSvg = React39__namespace.memo(function IndeterminateSvg2({
|
|
6332
6582
|
size
|
|
6333
6583
|
}) {
|
|
6334
|
-
const [ready, setReady] =
|
|
6335
|
-
|
|
6584
|
+
const [ready, setReady] = React39__namespace.useState(false);
|
|
6585
|
+
React39__namespace.useEffect(() => {
|
|
6336
6586
|
const raf = requestAnimationFrame(() => setReady(true));
|
|
6337
6587
|
return () => cancelAnimationFrame(raf);
|
|
6338
6588
|
}, []);
|
|
@@ -6377,7 +6627,7 @@ var IndeterminateSvg = React37__namespace.memo(function IndeterminateSvg2({
|
|
|
6377
6627
|
}
|
|
6378
6628
|
);
|
|
6379
6629
|
});
|
|
6380
|
-
var DeterminateSvg =
|
|
6630
|
+
var DeterminateSvg = React39__namespace.memo(function DeterminateSvg2({
|
|
6381
6631
|
size,
|
|
6382
6632
|
progress
|
|
6383
6633
|
}) {
|
|
@@ -6402,7 +6652,7 @@ var DeterminateSvg = React37__namespace.memo(function DeterminateSvg2({
|
|
|
6402
6652
|
}
|
|
6403
6653
|
);
|
|
6404
6654
|
});
|
|
6405
|
-
var LoadingIndicator =
|
|
6655
|
+
var LoadingIndicator = React39__namespace.forwardRef(
|
|
6406
6656
|
(_a, ref) => {
|
|
6407
6657
|
var _b = _a, {
|
|
6408
6658
|
variant = "uncontained",
|
|
@@ -6537,7 +6787,7 @@ var ADDITIONAL_ROTATION_EASE_DURATION = 500;
|
|
|
6537
6787
|
var DEFAULT_MIN_PROGRESS = 0.1;
|
|
6538
6788
|
var DEFAULT_MAX_PROGRESS = 0.8;
|
|
6539
6789
|
var PROGRESS_CYCLE_DURATION = 1500;
|
|
6540
|
-
var CircularProgress =
|
|
6790
|
+
var CircularProgress = React39__namespace.forwardRef(
|
|
6541
6791
|
(_a, ref) => {
|
|
6542
6792
|
var _b = _a, {
|
|
6543
6793
|
value,
|
|
@@ -6591,19 +6841,19 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
6591
6841
|
const shouldShowDeterminateTrack = showTrack === "auto" ? true : showTrack;
|
|
6592
6842
|
const BASELINE_SIZE = 48;
|
|
6593
6843
|
const scaleFactor = size / BASELINE_SIZE;
|
|
6594
|
-
const effectiveAmplitude =
|
|
6844
|
+
const effectiveAmplitude = React39__namespace.useMemo(
|
|
6595
6845
|
() => amplitude != null ? amplitude : 1.6 * scaleFactor,
|
|
6596
6846
|
[amplitude, scaleFactor]
|
|
6597
6847
|
);
|
|
6598
|
-
const effectiveWavelength =
|
|
6848
|
+
const effectiveWavelength = React39__namespace.useMemo(
|
|
6599
6849
|
() => wavelength != null ? wavelength : 15 * scaleFactor,
|
|
6600
6850
|
[wavelength, scaleFactor]
|
|
6601
6851
|
);
|
|
6602
|
-
const resolvedAmplitudeRange =
|
|
6852
|
+
const resolvedAmplitudeRange = React39__namespace.useMemo(
|
|
6603
6853
|
() => amplitudeRange != null ? amplitudeRange : [0, effectiveAmplitude],
|
|
6604
6854
|
[amplitudeRange, effectiveAmplitude]
|
|
6605
6855
|
);
|
|
6606
|
-
const wavyActivePath =
|
|
6856
|
+
const wavyActivePath = React39__namespace.useMemo(
|
|
6607
6857
|
() => isWavy ? generateWavyCircularPath(
|
|
6608
6858
|
center,
|
|
6609
6859
|
radius,
|
|
@@ -6612,8 +6862,8 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
6612
6862
|
) : null,
|
|
6613
6863
|
[isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
|
|
6614
6864
|
);
|
|
6615
|
-
const circumference =
|
|
6616
|
-
const gapForTrack =
|
|
6865
|
+
const circumference = React39__namespace.useMemo(() => 2 * Math.PI * radius, [radius]);
|
|
6866
|
+
const gapForTrack = React39__namespace.useMemo(
|
|
6617
6867
|
() => (gapSize + trackHeight) / circumference,
|
|
6618
6868
|
[gapSize, trackHeight, circumference]
|
|
6619
6869
|
);
|
|
@@ -6621,17 +6871,17 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
6621
6871
|
const trackOffset = isDeterminate ? activeAngularFraction + gapForTrack : 0;
|
|
6622
6872
|
const trackLength = isDeterminate ? Math.max(1e-3, 1 - activeAngularFraction - 2 * gapForTrack) : 1;
|
|
6623
6873
|
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 =
|
|
6874
|
+
const indeterminateSvgRef = React39__namespace.useRef(null);
|
|
6875
|
+
const indeterminateTrackRef = React39__namespace.useRef(null);
|
|
6876
|
+
const indeterminateActiveRef = React39__namespace.useRef(null);
|
|
6877
|
+
const indeterminateWavyTrackPathRef = React39__namespace.useRef(null);
|
|
6878
|
+
const indeterminateWavyActivePathRef = React39__namespace.useRef(null);
|
|
6879
|
+
const determinateWavyActivePathRef = React39__namespace.useRef(null);
|
|
6880
|
+
const determinateWavyTrackPathRef = React39__namespace.useRef(null);
|
|
6881
|
+
const cachedPathLengthRef = React39__namespace.useRef(0);
|
|
6632
6882
|
const fractionMV = react.useMotionValue(isDeterminate ? clampedValue / 100 : 0);
|
|
6633
6883
|
const amplitudeMV = react.useMotionValue(isWavy ? effectiveAmplitude : 0);
|
|
6634
|
-
|
|
6884
|
+
React39__namespace.useEffect(() => {
|
|
6635
6885
|
if (isDeterminate) {
|
|
6636
6886
|
react.animate(fractionMV, clampedValue / 100, {
|
|
6637
6887
|
duration: 0.4,
|
|
@@ -6639,7 +6889,7 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
6639
6889
|
});
|
|
6640
6890
|
}
|
|
6641
6891
|
}, [clampedValue, isDeterminate, fractionMV]);
|
|
6642
|
-
|
|
6892
|
+
React39__namespace.useEffect(() => {
|
|
6643
6893
|
if (!isDeterminate || !isWavy) return;
|
|
6644
6894
|
const fraction = clampedValue / 100;
|
|
6645
6895
|
let targetAmp = effectiveAmplitude;
|
|
@@ -6659,7 +6909,7 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
6659
6909
|
amplitudeMV,
|
|
6660
6910
|
determinateAnimation
|
|
6661
6911
|
]);
|
|
6662
|
-
|
|
6912
|
+
React39__namespace.useLayoutEffect(() => {
|
|
6663
6913
|
if (!isWavy || !wavyActivePath) {
|
|
6664
6914
|
cachedPathLengthRef.current = circumference;
|
|
6665
6915
|
return;
|
|
@@ -7036,9 +7286,9 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
7036
7286
|
);
|
|
7037
7287
|
CircularProgress.displayName = "CircularProgress";
|
|
7038
7288
|
function useContainerWidth() {
|
|
7039
|
-
const [width, setWidth] =
|
|
7040
|
-
const observerRef =
|
|
7041
|
-
const ref =
|
|
7289
|
+
const [width, setWidth] = React39__namespace.useState(0);
|
|
7290
|
+
const observerRef = React39__namespace.useRef(null);
|
|
7291
|
+
const ref = React39__namespace.useCallback((node) => {
|
|
7042
7292
|
if (observerRef.current) {
|
|
7043
7293
|
observerRef.current.disconnect();
|
|
7044
7294
|
observerRef.current = null;
|
|
@@ -7052,7 +7302,7 @@ function useContainerWidth() {
|
|
|
7052
7302
|
observerRef.current = obs;
|
|
7053
7303
|
}
|
|
7054
7304
|
}, []);
|
|
7055
|
-
|
|
7305
|
+
React39__namespace.useEffect(() => {
|
|
7056
7306
|
return () => {
|
|
7057
7307
|
if (observerRef.current) {
|
|
7058
7308
|
observerRef.current.disconnect();
|
|
@@ -7062,7 +7312,7 @@ function useContainerWidth() {
|
|
|
7062
7312
|
return [ref, width];
|
|
7063
7313
|
}
|
|
7064
7314
|
function useMergedRef(...refs) {
|
|
7065
|
-
return
|
|
7315
|
+
return React39__namespace.useCallback(
|
|
7066
7316
|
(node) => {
|
|
7067
7317
|
for (const ref of refs) {
|
|
7068
7318
|
if (typeof ref === "function") {
|
|
@@ -7076,7 +7326,7 @@ function useMergedRef(...refs) {
|
|
|
7076
7326
|
[refs]
|
|
7077
7327
|
);
|
|
7078
7328
|
}
|
|
7079
|
-
var FlatLinearTrack =
|
|
7329
|
+
var FlatLinearTrack = React39__namespace.memo(function FlatLinearTrack2({
|
|
7080
7330
|
trackHeight,
|
|
7081
7331
|
activeColor,
|
|
7082
7332
|
trackColor,
|
|
@@ -7152,7 +7402,7 @@ var FlatLinearTrack = React37__namespace.memo(function FlatLinearTrack2({
|
|
|
7152
7402
|
}
|
|
7153
7403
|
);
|
|
7154
7404
|
});
|
|
7155
|
-
var WavyLinearTrack =
|
|
7405
|
+
var WavyLinearTrack = React39__namespace.memo(function WavyLinearTrack2({
|
|
7156
7406
|
trackHeight,
|
|
7157
7407
|
svgHeight,
|
|
7158
7408
|
amplitude,
|
|
@@ -7171,13 +7421,13 @@ var WavyLinearTrack = React37__namespace.memo(function WavyLinearTrack2({
|
|
|
7171
7421
|
}) {
|
|
7172
7422
|
const isDeterminate = typeof value === "number";
|
|
7173
7423
|
const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
|
|
7174
|
-
const titleId =
|
|
7424
|
+
const titleId = React39__namespace.useId();
|
|
7175
7425
|
const [containerRef, width] = useContainerWidth();
|
|
7176
|
-
const activePathRef =
|
|
7177
|
-
const trackPathRef =
|
|
7426
|
+
const activePathRef = React39__namespace.useRef(null);
|
|
7427
|
+
const trackPathRef = React39__namespace.useRef(null);
|
|
7178
7428
|
const amplitudeMV = react.useMotionValue(amplitude);
|
|
7179
7429
|
const fractionMV = react.useMotionValue(isDeterminate ? clampedValue / 100 : 1);
|
|
7180
|
-
|
|
7430
|
+
React39__namespace.useEffect(() => {
|
|
7181
7431
|
if (isDeterminate) {
|
|
7182
7432
|
const fraction = clampedValue / 100;
|
|
7183
7433
|
let targetAmp = amplitude;
|
|
@@ -7365,7 +7615,7 @@ var WavyLinearTrack = React37__namespace.memo(function WavyLinearTrack2({
|
|
|
7365
7615
|
}
|
|
7366
7616
|
);
|
|
7367
7617
|
});
|
|
7368
|
-
var LinearProgress =
|
|
7618
|
+
var LinearProgress = React39__namespace.forwardRef(
|
|
7369
7619
|
(_a, ref) => {
|
|
7370
7620
|
var _b = _a, {
|
|
7371
7621
|
value,
|
|
@@ -7406,10 +7656,10 @@ var LinearProgress = React37__namespace.forwardRef(
|
|
|
7406
7656
|
]);
|
|
7407
7657
|
const isDeterminate = value !== void 0;
|
|
7408
7658
|
const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
|
|
7409
|
-
const containerRef =
|
|
7659
|
+
const containerRef = React39__namespace.useRef(null);
|
|
7410
7660
|
const mergedRef = useMergedRef(ref, containerRef);
|
|
7411
|
-
const [isRtl, setIsRtl] =
|
|
7412
|
-
|
|
7661
|
+
const [isRtl, setIsRtl] = React39__namespace.useState(false);
|
|
7662
|
+
React39__namespace.useEffect(() => {
|
|
7413
7663
|
if (containerRef.current) {
|
|
7414
7664
|
const dir = getComputedStyle(containerRef.current).direction;
|
|
7415
7665
|
setIsRtl(dir === "rtl");
|
|
@@ -7417,16 +7667,16 @@ var LinearProgress = React37__namespace.forwardRef(
|
|
|
7417
7667
|
}, []);
|
|
7418
7668
|
const resolvedTrackShape = trackShape != null ? trackShape : shape;
|
|
7419
7669
|
const isWavy = shape === "wavy" || resolvedTrackShape === "wavy";
|
|
7420
|
-
const effectiveAmplitude =
|
|
7421
|
-
const svgHeight =
|
|
7670
|
+
const effectiveAmplitude = React39__namespace.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
|
|
7671
|
+
const svgHeight = React39__namespace.useMemo(
|
|
7422
7672
|
() => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
|
|
7423
7673
|
[isWavy, trackHeight, effectiveAmplitude]
|
|
7424
7674
|
);
|
|
7425
|
-
const shouldShowStop =
|
|
7675
|
+
const shouldShowStop = React39__namespace.useMemo(
|
|
7426
7676
|
() => isDeterminate && resolvedTrackShape === "flat" && showStopIndicator !== false,
|
|
7427
7677
|
[isDeterminate, resolvedTrackShape, showStopIndicator]
|
|
7428
7678
|
);
|
|
7429
|
-
const stopSize =
|
|
7679
|
+
const stopSize = React39__namespace.useMemo(
|
|
7430
7680
|
() => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
|
|
7431
7681
|
[trackHeight]
|
|
7432
7682
|
);
|
|
@@ -7501,7 +7751,7 @@ var LinearProgress = React37__namespace.forwardRef(
|
|
|
7501
7751
|
}
|
|
7502
7752
|
);
|
|
7503
7753
|
LinearProgress.displayName = "LinearProgress";
|
|
7504
|
-
var ProgressIndicator =
|
|
7754
|
+
var ProgressIndicator = React39__namespace.forwardRef((props, ref) => {
|
|
7505
7755
|
if (props.variant === "circular") {
|
|
7506
7756
|
return /* @__PURE__ */ jsxRuntime.jsx(CircularProgress, __spreadValues({ ref }, props));
|
|
7507
7757
|
}
|
|
@@ -7633,7 +7883,7 @@ function resolveDisabledBgClass(colorStyle) {
|
|
|
7633
7883
|
}
|
|
7634
7884
|
return "disabled:text-m3-on-surface/[0.38]";
|
|
7635
7885
|
}
|
|
7636
|
-
var IconButtonComponent =
|
|
7886
|
+
var IconButtonComponent = React39__namespace.forwardRef(
|
|
7637
7887
|
(_a, ref) => {
|
|
7638
7888
|
var _b = _a, {
|
|
7639
7889
|
className,
|
|
@@ -7675,18 +7925,18 @@ var IconButtonComponent = React37__namespace.forwardRef(
|
|
|
7675
7925
|
var _a2, _b2, _c, _d, _e;
|
|
7676
7926
|
const isToggle = variant === "toggle";
|
|
7677
7927
|
const isSelected = isToggle && !!selected;
|
|
7678
|
-
const resolvedColorClass =
|
|
7928
|
+
const resolvedColorClass = React39__namespace.useMemo(
|
|
7679
7929
|
() => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
|
|
7680
7930
|
[isSelected, colorStyle]
|
|
7681
7931
|
);
|
|
7682
|
-
const outlineWidthClass =
|
|
7932
|
+
const outlineWidthClass = React39__namespace.useMemo(
|
|
7683
7933
|
() => {
|
|
7684
7934
|
var _a3;
|
|
7685
7935
|
return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
|
|
7686
7936
|
},
|
|
7687
7937
|
[colorStyle, isSelected, size]
|
|
7688
7938
|
);
|
|
7689
|
-
const disabledBgClass =
|
|
7939
|
+
const disabledBgClass = React39__namespace.useMemo(
|
|
7690
7940
|
() => resolveDisabledBgClass(colorStyle),
|
|
7691
7941
|
[colorStyle]
|
|
7692
7942
|
);
|
|
@@ -7709,7 +7959,7 @@ var IconButtonComponent = React37__namespace.forwardRef(
|
|
|
7709
7959
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
7710
7960
|
disabled: loading
|
|
7711
7961
|
});
|
|
7712
|
-
const handleClick =
|
|
7962
|
+
const handleClick = React39__namespace.useCallback(
|
|
7713
7963
|
(e) => {
|
|
7714
7964
|
if (loading) {
|
|
7715
7965
|
e.preventDefault();
|
|
@@ -7719,7 +7969,7 @@ var IconButtonComponent = React37__namespace.forwardRef(
|
|
|
7719
7969
|
},
|
|
7720
7970
|
[loading, onClick]
|
|
7721
7971
|
);
|
|
7722
|
-
const handleKeyDown =
|
|
7972
|
+
const handleKeyDown = React39__namespace.useCallback(
|
|
7723
7973
|
(e) => {
|
|
7724
7974
|
if (loading) return;
|
|
7725
7975
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -7775,7 +8025,7 @@ var IconButtonComponent = React37__namespace.forwardRef(
|
|
|
7775
8025
|
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
7776
8026
|
height: isCustomSize ? `${iconSize}px` : void 0
|
|
7777
8027
|
},
|
|
7778
|
-
children: isSelected && selectedIcon ? selectedIcon : asChild ?
|
|
8028
|
+
children: isSelected && selectedIcon ? selectedIcon : asChild ? React39__namespace.Children.only(children).props.children : children
|
|
7779
8029
|
}),
|
|
7780
8030
|
isSelected && selectedIcon ? "selected-content" : "content"
|
|
7781
8031
|
) })
|
|
@@ -7792,7 +8042,7 @@ var IconButtonComponent = React37__namespace.forwardRef(
|
|
|
7792
8042
|
className
|
|
7793
8043
|
);
|
|
7794
8044
|
if (asChild) {
|
|
7795
|
-
const child =
|
|
8045
|
+
const child = React39__namespace.Children.only(children);
|
|
7796
8046
|
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7797
8047
|
reactSlot.Slot,
|
|
7798
8048
|
__spreadProps(__spreadValues({
|
|
@@ -7809,7 +8059,7 @@ var IconButtonComponent = React37__namespace.forwardRef(
|
|
|
7809
8059
|
}),
|
|
7810
8060
|
className: containerClassName
|
|
7811
8061
|
}, restProps), {
|
|
7812
|
-
children:
|
|
8062
|
+
children: React39__namespace.cloneElement(child, { children: innerContent })
|
|
7813
8063
|
})
|
|
7814
8064
|
) });
|
|
7815
8065
|
}
|
|
@@ -7837,44 +8087,81 @@ var IconButtonComponent = React37__namespace.forwardRef(
|
|
|
7837
8087
|
}
|
|
7838
8088
|
);
|
|
7839
8089
|
IconButtonComponent.displayName = "IconButton";
|
|
7840
|
-
var IconButton =
|
|
8090
|
+
var IconButton = React39__namespace.memo(IconButtonComponent);
|
|
7841
8091
|
function TrailingAction({
|
|
7842
8092
|
query,
|
|
7843
8093
|
trailingIcon,
|
|
8094
|
+
avatar,
|
|
7844
8095
|
onClear
|
|
7845
8096
|
}) {
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
8097
|
+
const shouldReduceMotion = react.useReducedMotion();
|
|
8098
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
8099
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: query ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8100
|
+
react.m.div,
|
|
7849
8101
|
{
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
8102
|
+
initial: shouldReduceMotion ? false : { opacity: 0, scale: 0.8 },
|
|
8103
|
+
animate: { opacity: 1, scale: 1 },
|
|
8104
|
+
exit: shouldReduceMotion ? {} : { opacity: 0, scale: 0.8 },
|
|
8105
|
+
transition: { duration: 0.15 },
|
|
8106
|
+
className: "flex items-center justify-center",
|
|
7854
8107
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7855
|
-
|
|
8108
|
+
IconButton,
|
|
7856
8109
|
{
|
|
7857
|
-
|
|
7858
|
-
style: {
|
|
7859
|
-
"aria-
|
|
7860
|
-
|
|
8110
|
+
size: "sm",
|
|
8111
|
+
style: { color: SEARCH_COLORS.trailingIcon },
|
|
8112
|
+
"aria-label": "Clear search",
|
|
8113
|
+
onClick: onClear,
|
|
8114
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8115
|
+
"span",
|
|
8116
|
+
{
|
|
8117
|
+
className: "material-symbols-rounded select-none leading-none",
|
|
8118
|
+
style: { fontSize: 20 },
|
|
8119
|
+
"aria-hidden": "true",
|
|
8120
|
+
children: "close"
|
|
8121
|
+
}
|
|
8122
|
+
)
|
|
7861
8123
|
}
|
|
7862
8124
|
)
|
|
7863
|
-
}
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
|
|
7867
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7868
|
-
"span",
|
|
8125
|
+
},
|
|
8126
|
+
"clear-action"
|
|
8127
|
+
) : trailingIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8128
|
+
react.m.span,
|
|
7869
8129
|
{
|
|
8130
|
+
initial: shouldReduceMotion ? false : { opacity: 0, scale: 0.8 },
|
|
8131
|
+
animate: { opacity: 1, scale: 1 },
|
|
8132
|
+
exit: shouldReduceMotion ? {} : { opacity: 0, scale: 0.8 },
|
|
8133
|
+
transition: { duration: 0.15 },
|
|
7870
8134
|
className: "flex shrink-0 items-center justify-center",
|
|
7871
8135
|
style: { color: SEARCH_COLORS.trailingIcon },
|
|
7872
8136
|
"aria-hidden": "true",
|
|
7873
8137
|
children: trailingIcon
|
|
8138
|
+
},
|
|
8139
|
+
"trailing-icon"
|
|
8140
|
+
) }),
|
|
8141
|
+
avatar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8142
|
+
"span",
|
|
8143
|
+
{
|
|
8144
|
+
className: "flex shrink-0 items-center justify-center rounded-full overflow-hidden",
|
|
8145
|
+
style: {
|
|
8146
|
+
width: SearchTokens.avatarSize,
|
|
8147
|
+
height: SearchTokens.avatarSize
|
|
8148
|
+
},
|
|
8149
|
+
"aria-hidden": "true",
|
|
8150
|
+
children: avatar
|
|
7874
8151
|
}
|
|
7875
|
-
)
|
|
7876
|
-
}
|
|
7877
|
-
|
|
8152
|
+
)
|
|
8153
|
+
] });
|
|
8154
|
+
}
|
|
8155
|
+
function DefaultSearchIcon2() {
|
|
8156
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8157
|
+
"span",
|
|
8158
|
+
{
|
|
8159
|
+
className: "material-symbols-rounded select-none leading-none",
|
|
8160
|
+
style: { fontSize: SearchTokens.iconSize },
|
|
8161
|
+
"aria-hidden": "true",
|
|
8162
|
+
children: "search"
|
|
8163
|
+
}
|
|
8164
|
+
);
|
|
7878
8165
|
}
|
|
7879
8166
|
function SearchViewDocked({
|
|
7880
8167
|
query,
|
|
@@ -7884,6 +8171,7 @@ function SearchViewDocked({
|
|
|
7884
8171
|
onActiveChange,
|
|
7885
8172
|
leadingIcon,
|
|
7886
8173
|
trailingIcon,
|
|
8174
|
+
avatar,
|
|
7887
8175
|
placeholder = "Search",
|
|
7888
8176
|
textAlign = "left",
|
|
7889
8177
|
styleType = "contained",
|
|
@@ -7897,7 +8185,7 @@ function SearchViewDocked({
|
|
|
7897
8185
|
activeIndex
|
|
7898
8186
|
}) {
|
|
7899
8187
|
const shouldReduceMotion = react.useReducedMotion();
|
|
7900
|
-
const inputRef =
|
|
8188
|
+
const inputRef = React39__namespace.useRef(null);
|
|
7901
8189
|
useSearchViewFocus(inputRef, active);
|
|
7902
8190
|
const dropdownRef = useClickOutside(() => {
|
|
7903
8191
|
onActiveChange(false);
|
|
@@ -7916,10 +8204,12 @@ function SearchViewDocked({
|
|
|
7916
8204
|
react.m.div,
|
|
7917
8205
|
{
|
|
7918
8206
|
ref: dropdownRef,
|
|
8207
|
+
layout: !shouldReduceMotion,
|
|
7919
8208
|
layoutId: shouldReduceMotion ? void 0 : searchId,
|
|
7920
8209
|
className: cn(
|
|
7921
8210
|
// DockedContainerShape = CornerExtraLarge = 28dp radius
|
|
7922
8211
|
"rounded-[28px] overflow-hidden",
|
|
8212
|
+
SEARCH_ELEVATION.level3,
|
|
7923
8213
|
viewClassName
|
|
7924
8214
|
),
|
|
7925
8215
|
style: { backgroundColor: SEARCH_COLORS.container },
|
|
@@ -7941,7 +8231,7 @@ function SearchViewDocked({
|
|
|
7941
8231
|
className: "flex shrink-0 items-center justify-center",
|
|
7942
8232
|
style: { color: SEARCH_COLORS.leadingIcon },
|
|
7943
8233
|
"aria-hidden": "true",
|
|
7944
|
-
children: leadingIcon
|
|
8234
|
+
children: leadingIcon != null ? leadingIcon : /* @__PURE__ */ jsxRuntime.jsx(DefaultSearchIcon2, {})
|
|
7945
8235
|
}
|
|
7946
8236
|
),
|
|
7947
8237
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7982,6 +8272,7 @@ function SearchViewDocked({
|
|
|
7982
8272
|
{
|
|
7983
8273
|
query,
|
|
7984
8274
|
trailingIcon,
|
|
8275
|
+
avatar,
|
|
7985
8276
|
onClear: () => onQueryChange("")
|
|
7986
8277
|
}
|
|
7987
8278
|
)
|
|
@@ -8002,7 +8293,7 @@ function SearchViewDocked({
|
|
|
8002
8293
|
id: listboxId,
|
|
8003
8294
|
role: "listbox",
|
|
8004
8295
|
"aria-label": `${ariaLabel} results`,
|
|
8005
|
-
className: "min-h-
|
|
8296
|
+
className: "min-h-[120px]",
|
|
8006
8297
|
children
|
|
8007
8298
|
}
|
|
8008
8299
|
)
|
|
@@ -8031,6 +8322,7 @@ function SearchViewFullScreen({
|
|
|
8031
8322
|
onActiveChange,
|
|
8032
8323
|
leadingIcon,
|
|
8033
8324
|
trailingIcon,
|
|
8325
|
+
avatar,
|
|
8034
8326
|
placeholder = "Search",
|
|
8035
8327
|
textAlign = "left",
|
|
8036
8328
|
styleType = "contained",
|
|
@@ -8043,10 +8335,10 @@ function SearchViewFullScreen({
|
|
|
8043
8335
|
activeIndex
|
|
8044
8336
|
}) {
|
|
8045
8337
|
const shouldReduceMotion = react.useReducedMotion();
|
|
8046
|
-
const inputRef =
|
|
8338
|
+
const inputRef = React39__namespace.useRef(null);
|
|
8047
8339
|
useSearchViewFocus(inputRef, active);
|
|
8048
|
-
const [mounted, setMounted] =
|
|
8049
|
-
|
|
8340
|
+
const [mounted, setMounted] = React39__namespace.useState(false);
|
|
8341
|
+
React39__namespace.useEffect(() => {
|
|
8050
8342
|
setMounted(true);
|
|
8051
8343
|
}, []);
|
|
8052
8344
|
const handleFormSubmit = (e) => {
|
|
@@ -8145,6 +8437,7 @@ function SearchViewFullScreen({
|
|
|
8145
8437
|
{
|
|
8146
8438
|
query,
|
|
8147
8439
|
trailingIcon,
|
|
8440
|
+
avatar,
|
|
8148
8441
|
onClear: () => onQueryChange("")
|
|
8149
8442
|
}
|
|
8150
8443
|
)
|
|
@@ -8196,6 +8489,7 @@ function SearchComponent({
|
|
|
8196
8489
|
hasGap = false,
|
|
8197
8490
|
leadingIcon,
|
|
8198
8491
|
trailingIcon,
|
|
8492
|
+
avatar,
|
|
8199
8493
|
placeholder = "Search",
|
|
8200
8494
|
textAlign = "left",
|
|
8201
8495
|
children,
|
|
@@ -8204,10 +8498,10 @@ function SearchComponent({
|
|
|
8204
8498
|
className,
|
|
8205
8499
|
viewClassName
|
|
8206
8500
|
}) {
|
|
8207
|
-
const generatedId =
|
|
8501
|
+
const generatedId = React39__namespace.useId();
|
|
8208
8502
|
const searchId = id != null ? id : generatedId;
|
|
8209
8503
|
const listboxId = `${searchId}-listbox`;
|
|
8210
|
-
const itemCount =
|
|
8504
|
+
const itemCount = React39__namespace.Children.count(children);
|
|
8211
8505
|
const { activeIndex, handleKeyDown } = useSearchKeyboard({
|
|
8212
8506
|
active,
|
|
8213
8507
|
onActiveChange,
|
|
@@ -8223,6 +8517,7 @@ function SearchComponent({
|
|
|
8223
8517
|
onActiveChange,
|
|
8224
8518
|
leadingIcon,
|
|
8225
8519
|
trailingIcon,
|
|
8520
|
+
avatar,
|
|
8226
8521
|
placeholder,
|
|
8227
8522
|
textAlign,
|
|
8228
8523
|
"aria-label": ariaLabel,
|
|
@@ -8266,9 +8561,9 @@ function formatBadgeLabel(children, max) {
|
|
|
8266
8561
|
return "";
|
|
8267
8562
|
}
|
|
8268
8563
|
function detectBadgeHasContent(badge) {
|
|
8269
|
-
return
|
|
8564
|
+
return React39__namespace.isValidElement(badge) && badge.props.children != null;
|
|
8270
8565
|
}
|
|
8271
|
-
var BadgeImpl =
|
|
8566
|
+
var BadgeImpl = React39__namespace.forwardRef(
|
|
8272
8567
|
(_a, ref) => {
|
|
8273
8568
|
var _b = _a, {
|
|
8274
8569
|
children,
|
|
@@ -8305,7 +8600,7 @@ var BadgeImpl = React37__namespace.forwardRef(
|
|
|
8305
8600
|
exit: { scale: 0, opacity: 0 },
|
|
8306
8601
|
transition: springTransition,
|
|
8307
8602
|
className: cn(
|
|
8308
|
-
"rounded-full ring-[1.5px] ring-m3-surface",
|
|
8603
|
+
"rounded-full ring-[1.5px] ring-m3-surface shrink-0",
|
|
8309
8604
|
!containerColor && "bg-m3-error",
|
|
8310
8605
|
hasContent ? cn(
|
|
8311
8606
|
"inline-flex items-center justify-center",
|
|
@@ -8322,7 +8617,7 @@ var BadgeImpl = React37__namespace.forwardRef(
|
|
|
8322
8617
|
}
|
|
8323
8618
|
);
|
|
8324
8619
|
BadgeImpl.displayName = "Badge";
|
|
8325
|
-
|
|
8620
|
+
React39__namespace.memo(BadgeImpl);
|
|
8326
8621
|
function BadgedBox({
|
|
8327
8622
|
badge,
|
|
8328
8623
|
children,
|
|
@@ -8343,9 +8638,9 @@ function BadgedBox({
|
|
|
8343
8638
|
)
|
|
8344
8639
|
] });
|
|
8345
8640
|
}
|
|
8346
|
-
var TabsContext =
|
|
8641
|
+
var TabsContext = React39__namespace.createContext(null);
|
|
8347
8642
|
function useTabsContext() {
|
|
8348
|
-
const ctx =
|
|
8643
|
+
const ctx = React39__namespace.useContext(TabsContext);
|
|
8349
8644
|
if (!ctx) {
|
|
8350
8645
|
throw new Error(
|
|
8351
8646
|
"[MD3 Tabs] Component must be used within a <Tabs> root. Ensure <TabsList>, <Tab>, and <TabsContent> are descendants of <Tabs>."
|
|
@@ -8353,7 +8648,7 @@ function useTabsContext() {
|
|
|
8353
8648
|
}
|
|
8354
8649
|
return ctx;
|
|
8355
8650
|
}
|
|
8356
|
-
var TabsComponent =
|
|
8651
|
+
var TabsComponent = React39__namespace.forwardRef(
|
|
8357
8652
|
({
|
|
8358
8653
|
value: controlledValue,
|
|
8359
8654
|
defaultValue = "",
|
|
@@ -8362,35 +8657,35 @@ var TabsComponent = React37__namespace.forwardRef(
|
|
|
8362
8657
|
children,
|
|
8363
8658
|
className
|
|
8364
8659
|
}, ref) => {
|
|
8365
|
-
const [internalValue, setInternalValue] =
|
|
8660
|
+
const [internalValue, setInternalValue] = React39__namespace.useState(defaultValue);
|
|
8366
8661
|
const isControlled = controlledValue !== void 0;
|
|
8367
8662
|
const value = isControlled ? controlledValue : internalValue;
|
|
8368
|
-
const handleValueChange =
|
|
8663
|
+
const handleValueChange = React39__namespace.useCallback(
|
|
8369
8664
|
(newValue) => {
|
|
8370
8665
|
if (!isControlled) setInternalValue(newValue);
|
|
8371
8666
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
8372
8667
|
},
|
|
8373
8668
|
[isControlled, onValueChange]
|
|
8374
8669
|
);
|
|
8375
|
-
const [focusedValue, setFocusedValue] =
|
|
8376
|
-
|
|
8670
|
+
const [focusedValue, setFocusedValue] = React39__namespace.useState(value);
|
|
8671
|
+
React39__namespace.useEffect(() => {
|
|
8377
8672
|
setFocusedValue(value);
|
|
8378
8673
|
}, [value]);
|
|
8379
|
-
const [tabValues, setTabValues] =
|
|
8380
|
-
const registerTab =
|
|
8674
|
+
const [tabValues, setTabValues] = React39__namespace.useState([]);
|
|
8675
|
+
const registerTab = React39__namespace.useCallback((tabValue) => {
|
|
8381
8676
|
setTabValues((prev) => {
|
|
8382
8677
|
if (prev.includes(tabValue)) return prev;
|
|
8383
8678
|
return [...prev, tabValue];
|
|
8384
8679
|
});
|
|
8385
8680
|
}, []);
|
|
8386
|
-
const unregisterTab =
|
|
8681
|
+
const unregisterTab = React39__namespace.useCallback((tabValue) => {
|
|
8387
8682
|
setTabValues((prev) => prev.filter((v) => v !== tabValue));
|
|
8388
8683
|
}, []);
|
|
8389
|
-
const hasAutoSelected =
|
|
8390
|
-
const [disabledValues, setDisabledValues] =
|
|
8684
|
+
const hasAutoSelected = React39__namespace.useRef(false);
|
|
8685
|
+
const [disabledValues, setDisabledValues] = React39__namespace.useState(
|
|
8391
8686
|
/* @__PURE__ */ new Set()
|
|
8392
8687
|
);
|
|
8393
|
-
const markTabDisabled =
|
|
8688
|
+
const markTabDisabled = React39__namespace.useCallback(
|
|
8394
8689
|
(tabValue, disabled) => {
|
|
8395
8690
|
setDisabledValues((prev) => {
|
|
8396
8691
|
const next = new Set(prev);
|
|
@@ -8404,7 +8699,7 @@ var TabsComponent = React37__namespace.forwardRef(
|
|
|
8404
8699
|
},
|
|
8405
8700
|
[]
|
|
8406
8701
|
);
|
|
8407
|
-
|
|
8702
|
+
React39__namespace.useEffect(() => {
|
|
8408
8703
|
if (isControlled || hasAutoSelected.current || tabValues.length === 0) {
|
|
8409
8704
|
return;
|
|
8410
8705
|
}
|
|
@@ -8419,9 +8714,9 @@ var TabsComponent = React37__namespace.forwardRef(
|
|
|
8419
8714
|
setFocusedValue(firstEnabled);
|
|
8420
8715
|
}
|
|
8421
8716
|
}, [tabValues, disabledValues, isControlled, value]);
|
|
8422
|
-
const id =
|
|
8717
|
+
const id = React39__namespace.useId();
|
|
8423
8718
|
const layoutGroupId = `tabs-${id}`;
|
|
8424
|
-
const contextValue =
|
|
8719
|
+
const contextValue = React39__namespace.useMemo(
|
|
8425
8720
|
() => ({
|
|
8426
8721
|
value,
|
|
8427
8722
|
onValueChange: handleValueChange,
|
|
@@ -8452,12 +8747,12 @@ var TabsComponent = React37__namespace.forwardRef(
|
|
|
8452
8747
|
}
|
|
8453
8748
|
);
|
|
8454
8749
|
TabsComponent.displayName = "Tabs";
|
|
8455
|
-
var Tabs =
|
|
8456
|
-
var TabsListContext =
|
|
8750
|
+
var Tabs = React39__namespace.memo(TabsComponent);
|
|
8751
|
+
var TabsListContext = React39__namespace.createContext(
|
|
8457
8752
|
null
|
|
8458
8753
|
);
|
|
8459
8754
|
function useTabsListContext() {
|
|
8460
|
-
const ctx =
|
|
8755
|
+
const ctx = React39__namespace.useContext(TabsListContext);
|
|
8461
8756
|
return ctx != null ? ctx : { variant: "primary", scrollable: false };
|
|
8462
8757
|
}
|
|
8463
8758
|
|
|
@@ -8541,7 +8836,7 @@ var TABS_CONTENT_TRANSITION = {
|
|
|
8541
8836
|
ease: "easeInOut"
|
|
8542
8837
|
};
|
|
8543
8838
|
var INDICATOR_MIN_WIDTH = 24;
|
|
8544
|
-
var TabComponent =
|
|
8839
|
+
var TabComponent = React39__namespace.forwardRef(
|
|
8545
8840
|
({
|
|
8546
8841
|
value,
|
|
8547
8842
|
icon,
|
|
@@ -8571,9 +8866,9 @@ var TabComponent = React37__namespace.forwardRef(
|
|
|
8571
8866
|
const isFocused = focusedValue === value;
|
|
8572
8867
|
const hasIcon = icon != null;
|
|
8573
8868
|
const isStackedIcon = hasIcon && !inlineIcon;
|
|
8574
|
-
const buttonRef =
|
|
8575
|
-
const isFirstMount =
|
|
8576
|
-
const mergedRef =
|
|
8869
|
+
const buttonRef = React39__namespace.useRef(null);
|
|
8870
|
+
const isFirstMount = React39__namespace.useRef(true);
|
|
8871
|
+
const mergedRef = React39__namespace.useCallback(
|
|
8577
8872
|
(node) => {
|
|
8578
8873
|
buttonRef.current = node;
|
|
8579
8874
|
if (typeof ref === "function") ref(node);
|
|
@@ -8581,15 +8876,15 @@ var TabComponent = React37__namespace.forwardRef(
|
|
|
8581
8876
|
},
|
|
8582
8877
|
[ref]
|
|
8583
8878
|
);
|
|
8584
|
-
|
|
8879
|
+
React39__namespace.useEffect(() => {
|
|
8585
8880
|
registerTab(value);
|
|
8586
8881
|
return () => unregisterTab(value);
|
|
8587
8882
|
}, [value, registerTab, unregisterTab]);
|
|
8588
|
-
|
|
8883
|
+
React39__namespace.useEffect(() => {
|
|
8589
8884
|
markTabDisabled(value, disabled);
|
|
8590
8885
|
return () => markTabDisabled(value, false);
|
|
8591
8886
|
}, [value, disabled, markTabDisabled]);
|
|
8592
|
-
const handleKeyDown =
|
|
8887
|
+
const handleKeyDown = React39__namespace.useCallback(
|
|
8593
8888
|
(e) => {
|
|
8594
8889
|
const isRtl = buttonRef.current ? getComputedStyle(buttonRef.current).direction === "rtl" : false;
|
|
8595
8890
|
const enabledValues = tabValues.filter((v) => !disabledValues.has(v));
|
|
@@ -8643,7 +8938,7 @@ var TabComponent = React37__namespace.forwardRef(
|
|
|
8643
8938
|
autoActivate
|
|
8644
8939
|
]
|
|
8645
8940
|
);
|
|
8646
|
-
|
|
8941
|
+
React39__namespace.useEffect(() => {
|
|
8647
8942
|
if (isFirstMount.current) {
|
|
8648
8943
|
isFirstMount.current = false;
|
|
8649
8944
|
return;
|
|
@@ -8652,7 +8947,7 @@ var TabComponent = React37__namespace.forwardRef(
|
|
|
8652
8947
|
buttonRef.current.focus({ preventScroll: true });
|
|
8653
8948
|
}
|
|
8654
8949
|
}, [isFocused]);
|
|
8655
|
-
|
|
8950
|
+
React39__namespace.useEffect(() => {
|
|
8656
8951
|
if (!isActive || !scrollable || !buttonRef.current) return;
|
|
8657
8952
|
const btn = buttonRef.current;
|
|
8658
8953
|
let container = btn.parentElement;
|
|
@@ -8789,8 +9084,8 @@ var TabComponent = React37__namespace.forwardRef(
|
|
|
8789
9084
|
}
|
|
8790
9085
|
);
|
|
8791
9086
|
TabComponent.displayName = "Tab";
|
|
8792
|
-
var Tab =
|
|
8793
|
-
var TabsContentComponent =
|
|
9087
|
+
var Tab = React39__namespace.memo(TabComponent);
|
|
9088
|
+
var TabsContentComponent = React39__namespace.forwardRef(
|
|
8794
9089
|
({ value, className, children }, ref) => {
|
|
8795
9090
|
var _a;
|
|
8796
9091
|
const { value: selectedValue, layoutGroupId } = useTabsContext();
|
|
@@ -8824,8 +9119,8 @@ var TabsContentComponent = React37__namespace.forwardRef(
|
|
|
8824
9119
|
}
|
|
8825
9120
|
);
|
|
8826
9121
|
TabsContentComponent.displayName = "TabsContent";
|
|
8827
|
-
var TabsContent =
|
|
8828
|
-
var TabsListComponent =
|
|
9122
|
+
var TabsContent = React39__namespace.memo(TabsContentComponent);
|
|
9123
|
+
var TabsListComponent = React39__namespace.forwardRef(
|
|
8829
9124
|
({
|
|
8830
9125
|
variant,
|
|
8831
9126
|
scrollable = false,
|
|
@@ -8836,12 +9131,12 @@ var TabsListComponent = React37__namespace.forwardRef(
|
|
|
8836
9131
|
}, ref) => {
|
|
8837
9132
|
const { layoutGroupId, value, setFocusedValue } = useTabsContext();
|
|
8838
9133
|
const listLayoutId = `${layoutGroupId}-list`;
|
|
8839
|
-
const listContextValue =
|
|
9134
|
+
const listContextValue = React39__namespace.useMemo(
|
|
8840
9135
|
() => ({ variant, scrollable }),
|
|
8841
9136
|
[variant, scrollable]
|
|
8842
9137
|
);
|
|
8843
9138
|
const bgColor = backgroundColor != null ? backgroundColor : "var(--md-sys-color-surface)";
|
|
8844
|
-
const handleBlur =
|
|
9139
|
+
const handleBlur = React39__namespace.useCallback(
|
|
8845
9140
|
(e) => {
|
|
8846
9141
|
const listEl = e.currentTarget;
|
|
8847
9142
|
if (listEl.contains(e.relatedTarget)) return;
|
|
@@ -8890,7 +9185,7 @@ var TabsListComponent = React37__namespace.forwardRef(
|
|
|
8890
9185
|
}
|
|
8891
9186
|
);
|
|
8892
9187
|
TabsListComponent.displayName = "TabsList";
|
|
8893
|
-
var TabsList =
|
|
9188
|
+
var TabsList = React39__namespace.memo(TabsListComponent);
|
|
8894
9189
|
|
|
8895
9190
|
// src/ui/toolbar/toolbar-colors.ts
|
|
8896
9191
|
var standardFloatingToolbarColors = {
|
|
@@ -8946,13 +9241,13 @@ function getToolbarColors(variant = "standard", customColors) {
|
|
|
8946
9241
|
return standardFloatingToolbarColors;
|
|
8947
9242
|
}
|
|
8948
9243
|
}
|
|
8949
|
-
var ToolbarContext =
|
|
9244
|
+
var ToolbarContext = React39__namespace.createContext(
|
|
8950
9245
|
null
|
|
8951
9246
|
);
|
|
8952
9247
|
function useToolbarContext() {
|
|
8953
|
-
return
|
|
9248
|
+
return React39__namespace.useContext(ToolbarContext);
|
|
8954
9249
|
}
|
|
8955
|
-
var BottomDockedToolbar =
|
|
9250
|
+
var BottomDockedToolbar = React39__namespace.forwardRef(
|
|
8956
9251
|
(_a, ref) => {
|
|
8957
9252
|
var _b = _a, {
|
|
8958
9253
|
variant = "standard",
|
|
@@ -8985,8 +9280,8 @@ var BottomDockedToolbar = React37__namespace.forwardRef(
|
|
|
8985
9280
|
const { scrollY } = react.useScroll(
|
|
8986
9281
|
scrollContainerRef ? { container: scrollContainerRef } : void 0
|
|
8987
9282
|
);
|
|
8988
|
-
const [isHidden, setIsHidden] =
|
|
8989
|
-
const lastScrollY =
|
|
9283
|
+
const [isHidden, setIsHidden] = React39__namespace.useState(false);
|
|
9284
|
+
const lastScrollY = React39__namespace.useRef(0);
|
|
8990
9285
|
react.useMotionValueEvent(scrollY, "change", (latest) => {
|
|
8991
9286
|
if (!hideOnScroll) return;
|
|
8992
9287
|
const diff = latest - lastScrollY.current;
|
|
@@ -9145,15 +9440,15 @@ function buildSlotVariants(xHidden, yHidden, isHorizontal) {
|
|
|
9145
9440
|
};
|
|
9146
9441
|
}
|
|
9147
9442
|
function applyItemClassName(nodes, itemClassName) {
|
|
9148
|
-
return
|
|
9149
|
-
if (!
|
|
9443
|
+
return React39__namespace.Children.map(nodes, (child) => {
|
|
9444
|
+
if (!React39__namespace.isValidElement(child)) return child;
|
|
9150
9445
|
const element = child;
|
|
9151
|
-
return
|
|
9446
|
+
return React39__namespace.cloneElement(element, {
|
|
9152
9447
|
className: cn(element.props.className, itemClassName)
|
|
9153
9448
|
});
|
|
9154
9449
|
});
|
|
9155
9450
|
}
|
|
9156
|
-
var FloatingToolbarBase =
|
|
9451
|
+
var FloatingToolbarBase = React39__namespace.forwardRef(
|
|
9157
9452
|
(_a, ref) => {
|
|
9158
9453
|
var _b = _a, {
|
|
9159
9454
|
expanded,
|
|
@@ -9325,11 +9620,11 @@ var FloatingToolbarBase = React37__namespace.forwardRef(
|
|
|
9325
9620
|
}
|
|
9326
9621
|
);
|
|
9327
9622
|
FloatingToolbarBase.displayName = "FloatingToolbarBase";
|
|
9328
|
-
var HorizontalFloatingToolbar =
|
|
9623
|
+
var HorizontalFloatingToolbar = React39__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(FloatingToolbarBase, __spreadValues({ ref, orientation: "horizontal" }, props)));
|
|
9329
9624
|
HorizontalFloatingToolbar.displayName = "HorizontalFloatingToolbar";
|
|
9330
|
-
var VerticalFloatingToolbar =
|
|
9625
|
+
var VerticalFloatingToolbar = React39__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(FloatingToolbarBase, __spreadValues({ ref, orientation: "vertical" }, props)));
|
|
9331
9626
|
VerticalFloatingToolbar.displayName = "VerticalFloatingToolbar";
|
|
9332
|
-
var FloatingToolbarWithFabBase =
|
|
9627
|
+
var FloatingToolbarWithFabBase = React39__namespace.forwardRef(
|
|
9333
9628
|
(_a, ref) => {
|
|
9334
9629
|
var _b = _a, {
|
|
9335
9630
|
expanded,
|
|
@@ -9457,9 +9752,9 @@ var FloatingToolbarWithFabBase = React37__namespace.forwardRef(
|
|
|
9457
9752
|
}
|
|
9458
9753
|
);
|
|
9459
9754
|
FloatingToolbarWithFabBase.displayName = "FloatingToolbarWithFabBase";
|
|
9460
|
-
var HorizontalFloatingToolbarWithFab =
|
|
9755
|
+
var HorizontalFloatingToolbarWithFab = React39__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(FloatingToolbarWithFabBase, __spreadValues({ ref, orientation: "horizontal" }, props)));
|
|
9461
9756
|
HorizontalFloatingToolbarWithFab.displayName = "HorizontalFloatingToolbarWithFab";
|
|
9462
|
-
var VerticalFloatingToolbarWithFab =
|
|
9757
|
+
var VerticalFloatingToolbarWithFab = React39__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(FloatingToolbarWithFabBase, __spreadValues({ ref, orientation: "vertical" }, props)));
|
|
9463
9758
|
VerticalFloatingToolbarWithFab.displayName = "VerticalFloatingToolbarWithFab";
|
|
9464
9759
|
var ToolbarDivider = ({
|
|
9465
9760
|
orientation: propsOrientation,
|
|
@@ -9495,7 +9790,7 @@ var VARIANT_TO_COLOR_STYLE = {
|
|
|
9495
9790
|
tonal: "tonal",
|
|
9496
9791
|
filled: "filled"
|
|
9497
9792
|
};
|
|
9498
|
-
var ToolbarIconButton =
|
|
9793
|
+
var ToolbarIconButton = React39__namespace.forwardRef(
|
|
9499
9794
|
(_a, ref) => {
|
|
9500
9795
|
var _b = _a, {
|
|
9501
9796
|
emphasis = "standard",
|
|
@@ -9557,13 +9852,13 @@ function useFloatingToolbarScrollBehavior(options = {}) {
|
|
|
9557
9852
|
expandThreshold = 10,
|
|
9558
9853
|
scrollContainerRef
|
|
9559
9854
|
} = options;
|
|
9560
|
-
const [isExpanded, setIsExpanded] =
|
|
9561
|
-
const [offset, setOffset] =
|
|
9855
|
+
const [isExpanded, setIsExpanded] = React39.useState(true);
|
|
9856
|
+
const [offset, setOffset] = React39.useState(0);
|
|
9562
9857
|
const { scrollY } = react.useScroll({
|
|
9563
9858
|
container: scrollContainerRef
|
|
9564
9859
|
});
|
|
9565
|
-
const lastScrollY =
|
|
9566
|
-
const accumulatedScroll =
|
|
9860
|
+
const lastScrollY = React39.useRef(0);
|
|
9861
|
+
const accumulatedScroll = React39.useRef(0);
|
|
9567
9862
|
react.useMotionValueEvent(scrollY, "change", (currentScrollY) => {
|
|
9568
9863
|
const deltaY = currentScrollY - lastScrollY.current;
|
|
9569
9864
|
if (currentScrollY < 0) return;
|
|
@@ -9585,7 +9880,7 @@ function useFloatingToolbarScrollBehavior(options = {}) {
|
|
|
9585
9880
|
}
|
|
9586
9881
|
}
|
|
9587
9882
|
});
|
|
9588
|
-
|
|
9883
|
+
React39.useEffect(() => {
|
|
9589
9884
|
if (typeof window !== "undefined") {
|
|
9590
9885
|
const matchMedia = window.matchMedia("(forced-colors: active)");
|
|
9591
9886
|
if (matchMedia.matches) {
|
|
@@ -9667,7 +9962,7 @@ var MOTION_PROP_KEYS = [
|
|
|
9667
9962
|
"layoutId",
|
|
9668
9963
|
"onLayoutAnimationComplete"
|
|
9669
9964
|
];
|
|
9670
|
-
var ToolbarToggleButton =
|
|
9965
|
+
var ToolbarToggleButton = React39__namespace.forwardRef(
|
|
9671
9966
|
(_a, ref) => {
|
|
9672
9967
|
var _b = _a, {
|
|
9673
9968
|
emphasis = "standard",
|
|
@@ -9701,7 +9996,7 @@ var ToolbarToggleButton = React37__namespace.forwardRef(
|
|
|
9701
9996
|
"onPointerLeave"
|
|
9702
9997
|
]);
|
|
9703
9998
|
const context = useToolbarContext();
|
|
9704
|
-
const [isPressed, setIsPressed] =
|
|
9999
|
+
const [isPressed, setIsPressed] = React39__namespace.useState(false);
|
|
9705
10000
|
const {
|
|
9706
10001
|
ripples,
|
|
9707
10002
|
onPointerDown: handleRipplePointerDown,
|
|
@@ -9709,7 +10004,7 @@ var ToolbarToggleButton = React37__namespace.forwardRef(
|
|
|
9709
10004
|
} = useRippleState({
|
|
9710
10005
|
disabled: Boolean(disabled) || !ripple
|
|
9711
10006
|
});
|
|
9712
|
-
const handlePointerDown =
|
|
10007
|
+
const handlePointerDown = React39__namespace.useCallback(
|
|
9713
10008
|
(e) => {
|
|
9714
10009
|
setIsPressed(true);
|
|
9715
10010
|
if (!disabled && ripple) {
|
|
@@ -9719,14 +10014,14 @@ var ToolbarToggleButton = React37__namespace.forwardRef(
|
|
|
9719
10014
|
},
|
|
9720
10015
|
[disabled, ripple, handleRipplePointerDown, onPointerDownProp]
|
|
9721
10016
|
);
|
|
9722
|
-
const handlePointerUp =
|
|
10017
|
+
const handlePointerUp = React39__namespace.useCallback(
|
|
9723
10018
|
(e) => {
|
|
9724
10019
|
setIsPressed(false);
|
|
9725
10020
|
onPointerUpProp == null ? void 0 : onPointerUpProp(e);
|
|
9726
10021
|
},
|
|
9727
10022
|
[onPointerUpProp]
|
|
9728
10023
|
);
|
|
9729
|
-
const handlePointerLeave =
|
|
10024
|
+
const handlePointerLeave = React39__namespace.useCallback(
|
|
9730
10025
|
(e) => {
|
|
9731
10026
|
setIsPressed(false);
|
|
9732
10027
|
onPointerLeaveProp == null ? void 0 : onPointerLeaveProp(e);
|
|
@@ -9745,14 +10040,14 @@ var ToolbarToggleButton = React37__namespace.forwardRef(
|
|
|
9745
10040
|
context == null ? void 0 : context.itemClassName,
|
|
9746
10041
|
className
|
|
9747
10042
|
);
|
|
9748
|
-
const animateConfig =
|
|
10043
|
+
const animateConfig = React39__namespace.useMemo(
|
|
9749
10044
|
() => ({
|
|
9750
10045
|
scaleX: pressExpand && isPressed ? 1 + pressExpandRatio : 1,
|
|
9751
10046
|
borderRadius: isPressed ? ToolbarToggleButtonRadiusTokens.pressedRadius : ToolbarToggleButtonRadiusTokens.pillRadius
|
|
9752
10047
|
}),
|
|
9753
10048
|
[pressExpand, pressExpandRatio, isPressed]
|
|
9754
10049
|
);
|
|
9755
|
-
const transitionConfig =
|
|
10050
|
+
const transitionConfig = React39__namespace.useMemo(
|
|
9756
10051
|
() => ({
|
|
9757
10052
|
scaleX: FAST_SPATIAL_SPRING,
|
|
9758
10053
|
borderRadius: BUTTON_RADIUS_SPRING
|
|
@@ -9774,7 +10069,7 @@ var ToolbarToggleButton = React37__namespace.forwardRef(
|
|
|
9774
10069
|
children && (typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsxRuntime.jsx("span", { children }) : children)
|
|
9775
10070
|
] });
|
|
9776
10071
|
if (asChild) {
|
|
9777
|
-
const child =
|
|
10072
|
+
const child = React39__namespace.Children.only(children);
|
|
9778
10073
|
const childContent = child.props.children;
|
|
9779
10074
|
const innerChildContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9780
10075
|
ripple && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9813,7 +10108,7 @@ var ToolbarToggleButton = React37__namespace.forwardRef(
|
|
|
9813
10108
|
onPointerUp: handlePointerUp,
|
|
9814
10109
|
onPointerLeave: handlePointerLeave
|
|
9815
10110
|
}, strippedProps), {
|
|
9816
|
-
children:
|
|
10111
|
+
children: React39__namespace.cloneElement(child, { children: innerChildContent })
|
|
9817
10112
|
})
|
|
9818
10113
|
) });
|
|
9819
10114
|
}
|
|
@@ -9900,6 +10195,7 @@ exports.SEARCH_BAR_EXIT_SPRING = SEARCH_BAR_EXIT_SPRING;
|
|
|
9900
10195
|
exports.SEARCH_BAR_EXPAND_SPRING = SEARCH_BAR_EXPAND_SPRING;
|
|
9901
10196
|
exports.SEARCH_COLORS = SEARCH_COLORS;
|
|
9902
10197
|
exports.SEARCH_DOCKED_REVEAL_SPRING = SEARCH_DOCKED_REVEAL_SPRING;
|
|
10198
|
+
exports.SEARCH_ELEVATION = SEARCH_ELEVATION;
|
|
9903
10199
|
exports.SEARCH_FULLSCREEN_SPRING = SEARCH_FULLSCREEN_SPRING;
|
|
9904
10200
|
exports.SEARCH_TYPOGRAPHY = SEARCH_TYPOGRAPHY;
|
|
9905
10201
|
exports.SEARCH_VIEW_SPRING = SEARCH_VIEW_SPRING;
|