@bug-on/m3-expressive 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +128 -41
- package/dist/buttons.d.mts +1 -1
- package/dist/buttons.d.ts +1 -1
- package/dist/buttons.js +6 -6
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +6 -6
- package/dist/buttons.mjs.map +1 -1
- package/dist/forms.d.mts +2 -2
- package/dist/forms.d.ts +2 -2
- package/dist/index.d.mts +77 -6
- package/dist/index.d.ts +77 -6
- package/dist/index.js +5541 -5377
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5460 -5297
- package/dist/index.mjs.map +1 -1
- package/dist/layout.js +6 -6
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +6 -6
- package/dist/layout.mjs.map +1 -1
- package/dist/navigation.d.mts +27 -7
- package/dist/navigation.d.ts +27 -7
- package/dist/navigation.js +428 -435
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +420 -427
- 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-Bd5Qqvp9.d.ts → side-sheet-modal-DdEZR6Vl.d.ts} +1 -1
- package/dist/{side-sheet-modal-64FGhDxL.d.mts → side-sheet-modal-Dgjt739k.d.mts} +1 -1
- package/dist/{split-button-trailing-uncheckable-DtxrcLxH.d.ts → split-button-trailing-uncheckable--BhNTEJw.d.ts} +5 -5
- package/dist/{split-button-trailing-uncheckable-BTWfIN2k.d.mts → split-button-trailing-uncheckable-DPJL3bO6.d.mts} +5 -5
- package/dist/{text-field-T4Rg-9Bw.d.mts → text-field-DWC7qOvp.d.mts} +128 -128
- package/dist/{text-field-T4Rg-9Bw.d.ts → text-field-DWC7qOvp.d.ts} +128 -128
- package/package.json +3 -3
package/dist/navigation.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var React37 = require('react');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -31,7 +31,7 @@ function _interopNamespace(e) {
|
|
|
31
31
|
return Object.freeze(n);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var React37__namespace = /*#__PURE__*/_interopNamespace(React37);
|
|
35
35
|
var RxContextMenu__namespace = /*#__PURE__*/_interopNamespace(RxContextMenu);
|
|
36
36
|
var DropdownMenu__namespace = /*#__PURE__*/_interopNamespace(DropdownMenu);
|
|
37
37
|
|
|
@@ -328,9 +328,10 @@ var SUBMENU_CONTAINER_VARIANTS = {
|
|
|
328
328
|
transition: FAST_EFFECTS_TRANSITION
|
|
329
329
|
}
|
|
330
330
|
};
|
|
331
|
-
var MenuContext =
|
|
331
|
+
var MenuContext = React37__namespace.createContext({
|
|
332
332
|
variant: "baseline",
|
|
333
333
|
colorVariant: "standard",
|
|
334
|
+
density: 0,
|
|
334
335
|
menuPrimitive: "dropdown",
|
|
335
336
|
open: false,
|
|
336
337
|
onOpenChange: () => {
|
|
@@ -339,29 +340,46 @@ var MenuContext = React36__namespace.createContext({
|
|
|
339
340
|
function MenuProvider({
|
|
340
341
|
variant = "baseline",
|
|
341
342
|
colorVariant = "standard",
|
|
343
|
+
density = 0,
|
|
342
344
|
menuPrimitive = "dropdown",
|
|
343
345
|
open,
|
|
344
346
|
onOpenChange,
|
|
345
347
|
children
|
|
346
348
|
}) {
|
|
347
|
-
const value =
|
|
348
|
-
() => ({
|
|
349
|
-
|
|
349
|
+
const value = React37__namespace.useMemo(
|
|
350
|
+
() => ({
|
|
351
|
+
variant,
|
|
352
|
+
colorVariant,
|
|
353
|
+
density,
|
|
354
|
+
menuPrimitive,
|
|
355
|
+
open,
|
|
356
|
+
onOpenChange
|
|
357
|
+
}),
|
|
358
|
+
[variant, colorVariant, density, menuPrimitive, open, onOpenChange]
|
|
350
359
|
);
|
|
351
360
|
return /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value, children });
|
|
352
361
|
}
|
|
353
362
|
function useMenuContext() {
|
|
354
|
-
const ctx =
|
|
355
|
-
return
|
|
356
|
-
() =>
|
|
357
|
-
isStatic
|
|
358
|
-
|
|
363
|
+
const ctx = React37__namespace.useContext(MenuContext);
|
|
364
|
+
return React37__namespace.useMemo(
|
|
365
|
+
() => Object.assign(ctx, {
|
|
366
|
+
get isStatic() {
|
|
367
|
+
return ctx.menuPrimitive === "static";
|
|
368
|
+
},
|
|
369
|
+
get menuVariant() {
|
|
370
|
+
return ctx.variant;
|
|
371
|
+
}
|
|
359
372
|
}),
|
|
360
373
|
[ctx]
|
|
361
374
|
);
|
|
362
375
|
}
|
|
363
376
|
var MENU_BASELINE_ITEM_HORIZONTAL_PADDING = "px-3";
|
|
364
377
|
var MENU_ITEM_MIN_HEIGHT = "min-h-11";
|
|
378
|
+
var DENSITY_MIN_HEIGHT = {
|
|
379
|
+
0: "min-h-12",
|
|
380
|
+
"-2": "min-h-10",
|
|
381
|
+
"-4": "min-h-8"
|
|
382
|
+
};
|
|
365
383
|
var MENU_MIN_WIDTH = "min-w-28";
|
|
366
384
|
var MENU_MAX_WIDTH = "max-w-70";
|
|
367
385
|
var MENU_GROUP_GAP = "gap-0.5";
|
|
@@ -394,7 +412,7 @@ var ITEM_SHAPE_CLASSES = {
|
|
|
394
412
|
leading: "rounded-t-[12px] rounded-b-[4px]",
|
|
395
413
|
middle: "rounded-[4px]",
|
|
396
414
|
trailing: "rounded-t-[4px] rounded-b-[12px]",
|
|
397
|
-
standalone: "rounded-[
|
|
415
|
+
standalone: "rounded-[12px]",
|
|
398
416
|
selected: "rounded-[12px]"
|
|
399
417
|
};
|
|
400
418
|
var STANDARD_COLORS = {
|
|
@@ -411,9 +429,9 @@ var STANDARD_COLORS = {
|
|
|
411
429
|
/** Trailing icon color (StandardMenuTokens.ItemTrailingIconColor) */
|
|
412
430
|
trailingIconColor: "text-m3-on-surface-variant",
|
|
413
431
|
/** Hover state layer (OnSurface @ 8% opacity) */
|
|
414
|
-
hoverLayer: "hover:bg-m3-on-surface/8",
|
|
432
|
+
hoverLayer: "hover:bg-m3-on-surface/8 data-[highlighted]:bg-m3-on-surface/8",
|
|
415
433
|
/** Focus state layer (OnSurface @ 12% opacity) */
|
|
416
|
-
focusLayer: "focus:bg-m3-on-surface/12",
|
|
434
|
+
focusLayer: "focus:bg-m3-on-surface/12 data-[highlighted]:bg-m3-on-surface/8",
|
|
417
435
|
/** Selected item background (StandardMenuTokens.ItemSelectedContainerColor) */
|
|
418
436
|
selectedBg: "bg-m3-tertiary-container",
|
|
419
437
|
/** Selected item text (StandardMenuTokens.ItemSelectedLabelTextColor) */
|
|
@@ -429,8 +447,8 @@ var BASELINE_COLORS = {
|
|
|
429
447
|
iconColor: "text-m3-on-surface-variant",
|
|
430
448
|
supportingTextColor: "text-m3-on-surface-variant",
|
|
431
449
|
trailingIconColor: "text-m3-on-surface-variant",
|
|
432
|
-
hoverLayer: "hover:bg-m3-on-surface/8",
|
|
433
|
-
focusLayer: "focus:bg-m3-on-surface/12",
|
|
450
|
+
hoverLayer: "hover:bg-m3-on-surface/8 data-[highlighted]:bg-m3-on-surface/8",
|
|
451
|
+
focusLayer: "focus:bg-m3-on-surface/12 data-[highlighted]:bg-m3-on-surface/8",
|
|
434
452
|
selectedBg: "bg-m3-secondary-container",
|
|
435
453
|
selectedText: "text-m3-on-secondary-container",
|
|
436
454
|
selectedIcon: "text-m3-on-secondary-container"};
|
|
@@ -448,9 +466,9 @@ var VIBRANT_COLORS = {
|
|
|
448
466
|
/** Trailing icon color (VibrantMenuTokens.ItemTrailingIconColor) */
|
|
449
467
|
trailingIconColor: "text-m3-on-tertiary-container",
|
|
450
468
|
/** Hover state layer (OnTertiaryContainer @ 8% opacity) */
|
|
451
|
-
hoverLayer: "hover:bg-m3-on-tertiary-container/8",
|
|
469
|
+
hoverLayer: "hover:bg-m3-on-tertiary-container/8 data-[highlighted]:bg-m3-on-tertiary-container/8",
|
|
452
470
|
/** Focus state layer (OnTertiaryContainer @ 12% opacity) */
|
|
453
|
-
focusLayer: "focus:bg-m3-on-tertiary-container/12",
|
|
471
|
+
focusLayer: "focus:bg-m3-on-tertiary-container/12 data-[highlighted]:bg-m3-on-tertiary-container/8",
|
|
454
472
|
/** Selected item background (VibrantMenuTokens.ItemSelectedContainerColor = Tertiary) */
|
|
455
473
|
selectedBg: "bg-m3-tertiary",
|
|
456
474
|
/** Selected item text (VibrantMenuTokens.ItemSelectedLabelTextColor = OnTertiary) */
|
|
@@ -462,12 +480,29 @@ var VIBRANT_COLORS = {
|
|
|
462
480
|
};
|
|
463
481
|
var DIVIDER_PADDING = "mx-3 my-0.5";
|
|
464
482
|
var DIVIDER_COLOR = "bg-m3-outline-variant";
|
|
483
|
+
function flattenChildren(nodes) {
|
|
484
|
+
return React37__namespace.Children.toArray(nodes).reduce(
|
|
485
|
+
(acc, child) => {
|
|
486
|
+
if (!React37__namespace.isValidElement(child)) return acc;
|
|
487
|
+
if (child.type === React37__namespace.Fragment) {
|
|
488
|
+
return acc.concat(
|
|
489
|
+
flattenChildren(
|
|
490
|
+
child.props.children
|
|
491
|
+
)
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
acc.push(child);
|
|
495
|
+
return acc;
|
|
496
|
+
},
|
|
497
|
+
[]
|
|
498
|
+
);
|
|
499
|
+
}
|
|
465
500
|
function ContextMenu({
|
|
466
501
|
children,
|
|
467
502
|
variant = "baseline",
|
|
468
503
|
colorVariant = "standard"
|
|
469
504
|
}) {
|
|
470
|
-
const [open, setOpen] =
|
|
505
|
+
const [open, setOpen] = React37__namespace.useState(false);
|
|
471
506
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
472
507
|
MenuProvider,
|
|
473
508
|
{
|
|
@@ -481,12 +516,12 @@ function ContextMenu({
|
|
|
481
516
|
);
|
|
482
517
|
}
|
|
483
518
|
ContextMenu.displayName = "ContextMenu";
|
|
484
|
-
var ContextMenuTrigger =
|
|
519
|
+
var ContextMenuTrigger = React37__namespace.forwardRef((_a, ref) => {
|
|
485
520
|
var _b = _a, { children, asChild = true } = _b, props = __objRest(_b, ["children", "asChild"]);
|
|
486
521
|
return /* @__PURE__ */ jsxRuntime.jsx(RxContextMenu__namespace.Trigger, __spreadProps(__spreadValues({ ref, asChild }, props), { children }));
|
|
487
522
|
});
|
|
488
523
|
ContextMenuTrigger.displayName = "ContextMenuTrigger";
|
|
489
|
-
var ContextMenuContent =
|
|
524
|
+
var ContextMenuContent = React37__namespace.forwardRef(
|
|
490
525
|
(_a, ref) => {
|
|
491
526
|
var _b = _a, {
|
|
492
527
|
children,
|
|
@@ -509,71 +544,51 @@ var ContextMenuContent = React36__namespace.forwardRef(
|
|
|
509
544
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
510
545
|
const colors = variant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
511
546
|
const isExpressiveGap = variant === "expressive" && separatorStyle === "gap";
|
|
512
|
-
const containerClassName =
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
547
|
+
const containerClassName = React37__namespace.useMemo(
|
|
548
|
+
() => variant === "expressive" ? cn(
|
|
549
|
+
"z-50 flex flex-col w-full",
|
|
550
|
+
MENU_MIN_WIDTH,
|
|
551
|
+
MENU_MAX_WIDTH,
|
|
552
|
+
isExpressiveGap ? MENU_GROUP_GAP : "",
|
|
553
|
+
isExpressiveGap ? "bg-transparent" : colors.containerBg,
|
|
554
|
+
isExpressiveGap ? "" : "rounded-2xl",
|
|
555
|
+
isExpressiveGap ? "" : "elevation-2",
|
|
556
|
+
hasOverflow || isExpressiveGap ? "overflow-visible" : "overflow-hidden",
|
|
557
|
+
"outline-none",
|
|
558
|
+
className
|
|
559
|
+
) : cn(
|
|
560
|
+
"z-50 flex flex-col",
|
|
561
|
+
MENU_MIN_WIDTH,
|
|
562
|
+
MENU_MAX_WIDTH,
|
|
563
|
+
MENU_POPUP_PADDING_Y,
|
|
564
|
+
MENU_GROUP_GAP,
|
|
565
|
+
colors.containerBg,
|
|
566
|
+
MENU_CONTAINER_SHAPE,
|
|
567
|
+
"elevation-2",
|
|
568
|
+
hasOverflow ? "overflow-visible" : "overflow-hidden",
|
|
569
|
+
"outline-none",
|
|
570
|
+
className
|
|
571
|
+
),
|
|
572
|
+
[variant, isExpressiveGap, hasOverflow, className, colors.containerBg]
|
|
535
573
|
);
|
|
536
|
-
const
|
|
537
|
-
|
|
538
|
-
(acc, child) => {
|
|
539
|
-
if (React36__namespace.isValidElement(child)) {
|
|
540
|
-
if (child.type === React36__namespace.Fragment) {
|
|
541
|
-
return acc.concat(
|
|
542
|
-
flattenChildren(
|
|
543
|
-
child.props.children
|
|
544
|
-
)
|
|
545
|
-
);
|
|
546
|
-
}
|
|
547
|
-
acc.push(child);
|
|
548
|
-
}
|
|
549
|
-
return acc;
|
|
550
|
-
},
|
|
551
|
-
[]
|
|
552
|
-
);
|
|
553
|
-
};
|
|
554
|
-
let renderedChildren = children;
|
|
555
|
-
if (variant === "expressive") {
|
|
574
|
+
const renderedChildren = React37__namespace.useMemo(() => {
|
|
575
|
+
if (variant !== "expressive") return children;
|
|
556
576
|
const validChildren = flattenChildren(children);
|
|
557
577
|
const groupCount = validChildren.length;
|
|
558
|
-
const
|
|
559
|
-
(child, i) =>
|
|
578
|
+
const enhanced = validChildren.map(
|
|
579
|
+
(child, i) => React37__namespace.cloneElement(
|
|
560
580
|
child,
|
|
561
|
-
{
|
|
562
|
-
index: i,
|
|
563
|
-
count: groupCount,
|
|
564
|
-
isGapVariant: isExpressiveGap
|
|
565
|
-
}
|
|
581
|
+
{ index: i, count: groupCount, isGapVariant: isExpressiveGap }
|
|
566
582
|
)
|
|
567
583
|
);
|
|
568
|
-
|
|
584
|
+
if (separatorStyle !== "divider") return enhanced;
|
|
585
|
+
return enhanced.reduce((acc, child, i) => {
|
|
569
586
|
if (i > 0) {
|
|
570
587
|
acc.push(
|
|
571
588
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
572
589
|
"hr",
|
|
573
590
|
{
|
|
574
|
-
className: cn(
|
|
575
|
-
"mx-3 my-0.5 h-px border-0 bg-m3-outline-variant"
|
|
576
|
-
)
|
|
591
|
+
className: cn("mx-3 my-0.5 h-px border-0 bg-m3-outline-variant")
|
|
577
592
|
},
|
|
578
593
|
`divider-${child.key || i}`
|
|
579
594
|
)
|
|
@@ -581,8 +596,8 @@ var ContextMenuContent = React36__namespace.forwardRef(
|
|
|
581
596
|
}
|
|
582
597
|
acc.push(child);
|
|
583
598
|
return acc;
|
|
584
|
-
}, [])
|
|
585
|
-
}
|
|
599
|
+
}, []);
|
|
600
|
+
}, [children, variant, isExpressiveGap, separatorStyle]);
|
|
586
601
|
return /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: open && /* @__PURE__ */ jsxRuntime.jsx(RxContextMenu__namespace.Portal, { forceMount: true, children: /* @__PURE__ */ jsxRuntime.jsx(RxContextMenu__namespace.Content, __spreadProps(__spreadValues({ ref, asChild: true, forceMount: true }, props), { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
587
602
|
react.m.div,
|
|
588
603
|
{
|
|
@@ -606,6 +621,7 @@ function Menu(_a) {
|
|
|
606
621
|
variant,
|
|
607
622
|
menuVariant,
|
|
608
623
|
colorVariant = "standard",
|
|
624
|
+
density = 0,
|
|
609
625
|
open: controlledOpen,
|
|
610
626
|
onOpenChange: controlledOnOpenChange,
|
|
611
627
|
defaultOpen
|
|
@@ -614,18 +630,19 @@ function Menu(_a) {
|
|
|
614
630
|
"variant",
|
|
615
631
|
"menuVariant",
|
|
616
632
|
"colorVariant",
|
|
633
|
+
"density",
|
|
617
634
|
"open",
|
|
618
635
|
"onOpenChange",
|
|
619
636
|
"defaultOpen"
|
|
620
637
|
]);
|
|
621
638
|
var _a2;
|
|
622
639
|
const resolvedVariant = (_a2 = variant != null ? variant : menuVariant) != null ? _a2 : "baseline";
|
|
623
|
-
const [internalOpen, setInternalOpen] =
|
|
640
|
+
const [internalOpen, setInternalOpen] = React37__namespace.useState(
|
|
624
641
|
() => defaultOpen != null ? defaultOpen : false
|
|
625
642
|
);
|
|
626
643
|
const isControlled = controlledOpen !== void 0;
|
|
627
644
|
const open = isControlled ? controlledOpen : internalOpen;
|
|
628
|
-
const handleOpenChange =
|
|
645
|
+
const handleOpenChange = React37__namespace.useCallback(
|
|
629
646
|
(next) => {
|
|
630
647
|
if (!isControlled) setInternalOpen(next);
|
|
631
648
|
controlledOnOpenChange == null ? void 0 : controlledOnOpenChange(next);
|
|
@@ -637,6 +654,7 @@ function Menu(_a) {
|
|
|
637
654
|
{
|
|
638
655
|
variant: resolvedVariant,
|
|
639
656
|
colorVariant,
|
|
657
|
+
density,
|
|
640
658
|
open,
|
|
641
659
|
onOpenChange: handleOpenChange,
|
|
642
660
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -652,12 +670,12 @@ function Menu(_a) {
|
|
|
652
670
|
);
|
|
653
671
|
}
|
|
654
672
|
Menu.displayName = "Menu";
|
|
655
|
-
var MenuTrigger =
|
|
673
|
+
var MenuTrigger = React37__namespace.forwardRef((_a, ref) => {
|
|
656
674
|
var _b = _a, { children, asChild = true } = _b, props = __objRest(_b, ["children", "asChild"]);
|
|
657
675
|
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Trigger, __spreadProps(__spreadValues({ ref, asChild }, props), { children }));
|
|
658
676
|
});
|
|
659
677
|
MenuTrigger.displayName = "MenuTrigger";
|
|
660
|
-
var MenuContent =
|
|
678
|
+
var MenuContent = React37__namespace.forwardRef(
|
|
661
679
|
(_a, ref) => {
|
|
662
680
|
var _b = _a, {
|
|
663
681
|
children,
|
|
@@ -667,6 +685,7 @@ var MenuContent = React36__namespace.forwardRef(
|
|
|
667
685
|
hasOverflow = false,
|
|
668
686
|
colorVariant: propColorVariant,
|
|
669
687
|
separatorStyle = "gap",
|
|
688
|
+
matchTriggerWidth = false,
|
|
670
689
|
className
|
|
671
690
|
} = _b, props = __objRest(_b, [
|
|
672
691
|
"children",
|
|
@@ -676,6 +695,7 @@ var MenuContent = React36__namespace.forwardRef(
|
|
|
676
695
|
"hasOverflow",
|
|
677
696
|
"colorVariant",
|
|
678
697
|
"separatorStyle",
|
|
698
|
+
"matchTriggerWidth",
|
|
679
699
|
"className"
|
|
680
700
|
]);
|
|
681
701
|
const {
|
|
@@ -686,68 +706,66 @@ var MenuContent = React36__namespace.forwardRef(
|
|
|
686
706
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
687
707
|
const colors = variant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
688
708
|
const isExpressiveGap = variant === "expressive" && separatorStyle === "gap";
|
|
689
|
-
const containerClassName =
|
|
690
|
-
"
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
const flattenChildren = (nodes) => {
|
|
714
|
-
return React36__namespace.Children.toArray(nodes).reduce(
|
|
715
|
-
(acc, child) => {
|
|
716
|
-
if (React36__namespace.isValidElement(child)) {
|
|
717
|
-
if (child.type === React36__namespace.Fragment) {
|
|
718
|
-
return acc.concat(
|
|
719
|
-
flattenChildren(
|
|
720
|
-
child.props.children
|
|
721
|
-
)
|
|
722
|
-
);
|
|
723
|
-
}
|
|
724
|
-
acc.push(child);
|
|
725
|
-
}
|
|
726
|
-
return acc;
|
|
727
|
-
},
|
|
728
|
-
[]
|
|
709
|
+
const containerClassName = React37__namespace.useMemo(() => {
|
|
710
|
+
const widthClass = matchTriggerWidth ? "w-[var(--radix-dropdown-menu-trigger-width)]" : cn(MENU_MIN_WIDTH, MENU_MAX_WIDTH);
|
|
711
|
+
return variant === "expressive" ? cn(
|
|
712
|
+
"z-50 flex flex-col",
|
|
713
|
+
widthClass,
|
|
714
|
+
isExpressiveGap ? MENU_GROUP_GAP : "",
|
|
715
|
+
isExpressiveGap ? "bg-transparent" : colors.containerBg,
|
|
716
|
+
isExpressiveGap ? "" : "p-1",
|
|
717
|
+
isExpressiveGap ? "" : "rounded-2xl",
|
|
718
|
+
isExpressiveGap ? "" : "elevation-2",
|
|
719
|
+
hasOverflow || isExpressiveGap ? "overflow-visible" : "overflow-hidden",
|
|
720
|
+
"outline-none",
|
|
721
|
+
className
|
|
722
|
+
) : cn(
|
|
723
|
+
"z-50 flex flex-col",
|
|
724
|
+
widthClass,
|
|
725
|
+
MENU_POPUP_PADDING_Y,
|
|
726
|
+
MENU_GROUP_GAP,
|
|
727
|
+
colors.containerBg,
|
|
728
|
+
MENU_CONTAINER_SHAPE,
|
|
729
|
+
"elevation-2",
|
|
730
|
+
hasOverflow ? "overflow-visible" : "overflow-hidden",
|
|
731
|
+
"outline-none",
|
|
732
|
+
className
|
|
729
733
|
);
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
|
|
734
|
+
}, [
|
|
735
|
+
variant,
|
|
736
|
+
isExpressiveGap,
|
|
737
|
+
hasOverflow,
|
|
738
|
+
matchTriggerWidth,
|
|
739
|
+
className,
|
|
740
|
+
colors.containerBg
|
|
741
|
+
]);
|
|
742
|
+
const renderedChildren = React37__namespace.useMemo(() => {
|
|
743
|
+
if (variant !== "expressive") return children;
|
|
733
744
|
const validChildren = flattenChildren(children);
|
|
734
745
|
const groupCount = validChildren.length;
|
|
735
|
-
const
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
746
|
+
const enhanced = validChildren.map((child, i) => {
|
|
747
|
+
var _a2;
|
|
748
|
+
if (typeof child.type === "string") return child;
|
|
749
|
+
const defaultItemPosition = groupCount === 1 ? "standalone" : i === 0 ? "leading" : i === groupCount - 1 ? "trailing" : "middle";
|
|
750
|
+
const itemPosition = (_a2 = child.props.itemPosition) != null ? _a2 : defaultItemPosition;
|
|
751
|
+
return React37__namespace.cloneElement(
|
|
752
|
+
child,
|
|
753
|
+
{
|
|
754
|
+
index: i,
|
|
755
|
+
count: groupCount,
|
|
756
|
+
itemPosition,
|
|
757
|
+
isGapVariant: isExpressiveGap
|
|
758
|
+
}
|
|
759
|
+
);
|
|
760
|
+
});
|
|
761
|
+
if (separatorStyle !== "divider") return enhanced;
|
|
762
|
+
return enhanced.reduce((acc, child, i) => {
|
|
743
763
|
if (i > 0) {
|
|
744
764
|
acc.push(
|
|
745
765
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
746
766
|
"hr",
|
|
747
767
|
{
|
|
748
|
-
className: cn(
|
|
749
|
-
"mx-3 my-0.5 h-px border-0 bg-m3-outline-variant"
|
|
750
|
-
)
|
|
768
|
+
className: cn("mx-3 my-0.5 h-px border-0 bg-m3-outline-variant")
|
|
751
769
|
},
|
|
752
770
|
`divider-${child.key || i}`
|
|
753
771
|
)
|
|
@@ -755,8 +773,8 @@ var MenuContent = React36__namespace.forwardRef(
|
|
|
755
773
|
}
|
|
756
774
|
acc.push(child);
|
|
757
775
|
return acc;
|
|
758
|
-
}, [])
|
|
759
|
-
}
|
|
776
|
+
}, []);
|
|
777
|
+
}, [children, variant, isExpressiveGap, separatorStyle]);
|
|
760
778
|
return /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: open && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Portal, { forceMount: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
761
779
|
DropdownMenu__namespace.Content,
|
|
762
780
|
__spreadProps(__spreadValues({
|
|
@@ -788,9 +806,9 @@ var MenuContent = React36__namespace.forwardRef(
|
|
|
788
806
|
}
|
|
789
807
|
);
|
|
790
808
|
MenuContent.displayName = "MenuContent";
|
|
791
|
-
var MenuDivider =
|
|
809
|
+
var MenuDivider = React37__namespace.forwardRef(
|
|
792
810
|
(_a, ref) => {
|
|
793
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
811
|
+
var _b = _a, { className, isGapVariant: _isGapVariant } = _b, props = __objRest(_b, ["className", "isGapVariant"]);
|
|
794
812
|
const { menuVariant } = useMenuContext();
|
|
795
813
|
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Separator, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
796
814
|
"hr",
|
|
@@ -819,7 +837,7 @@ function getGroupPosition(index, count) {
|
|
|
819
837
|
function getGroupActiveShape(position) {
|
|
820
838
|
return GROUP_SHAPES[`${position}Active`];
|
|
821
839
|
}
|
|
822
|
-
var MenuGroup =
|
|
840
|
+
var MenuGroup = React37__namespace.forwardRef(
|
|
823
841
|
(_a, ref) => {
|
|
824
842
|
var _b = _a, {
|
|
825
843
|
children,
|
|
@@ -840,46 +858,25 @@ var MenuGroup = React36__namespace.forwardRef(
|
|
|
840
858
|
"itemPosition",
|
|
841
859
|
"className"
|
|
842
860
|
]);
|
|
843
|
-
const {
|
|
844
|
-
menuVariant,
|
|
845
|
-
colorVariant: contextColorVariant,
|
|
846
|
-
isStatic
|
|
847
|
-
} = useMenuContext();
|
|
861
|
+
const { menuVariant, colorVariant: contextColorVariant } = useMenuContext();
|
|
848
862
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
849
863
|
const colors = menuVariant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
850
864
|
const position = getGroupPosition(index, count);
|
|
851
|
-
const
|
|
852
|
-
const
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
)
|
|
865
|
-
);
|
|
866
|
-
}
|
|
867
|
-
acc.push(child);
|
|
868
|
-
}
|
|
869
|
-
return acc;
|
|
870
|
-
},
|
|
871
|
-
[]
|
|
872
|
-
);
|
|
873
|
-
};
|
|
874
|
-
const validChildren = flattenChildren(children);
|
|
875
|
-
const itemCount = validChildren.length;
|
|
876
|
-
const enhancedChildren = validChildren.map((child, i) => {
|
|
877
|
-
const itemPosition2 = itemCount === 1 ? "standalone" : i === 0 ? "leading" : i === itemCount - 1 ? "trailing" : "middle";
|
|
878
|
-
return React36__namespace.cloneElement(child, {
|
|
879
|
-
itemPosition: itemPosition2,
|
|
880
|
-
colorVariant
|
|
865
|
+
const currentShape = getGroupActiveShape(position);
|
|
866
|
+
const enhancedChildren = React37__namespace.useMemo(() => {
|
|
867
|
+
const valid = flattenChildren(children);
|
|
868
|
+
const itemCount = valid.length;
|
|
869
|
+
return valid.map((child, i) => {
|
|
870
|
+
var _a2;
|
|
871
|
+
if (typeof child.type === "string") return child;
|
|
872
|
+
const defaultItemPosition = itemCount === 1 ? "standalone" : i === 0 ? "leading" : i === itemCount - 1 ? "trailing" : "middle";
|
|
873
|
+
const itemPosition2 = (_a2 = child.props.itemPosition) != null ? _a2 : defaultItemPosition;
|
|
874
|
+
return React37__namespace.cloneElement(child, {
|
|
875
|
+
itemPosition: itemPosition2,
|
|
876
|
+
colorVariant
|
|
877
|
+
});
|
|
881
878
|
});
|
|
882
|
-
});
|
|
879
|
+
}, [children, colorVariant]);
|
|
883
880
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
884
881
|
react.m.div,
|
|
885
882
|
__spreadProps(__spreadValues({
|
|
@@ -891,10 +888,8 @@ var MenuGroup = React36__namespace.forwardRef(
|
|
|
891
888
|
// In baseline variant, MenuGroup is transparent so it shouldn't clip.
|
|
892
889
|
// In expressive variant, it needs overflow-hidden to clip hover states to its morphing shape.
|
|
893
890
|
menuVariant === "baseline" ? "" : "overflow-hidden",
|
|
894
|
-
//
|
|
895
|
-
|
|
896
|
-
// Horizontal padding: 4dp for expressive menus (both static and popup), 0 for baseline
|
|
897
|
-
menuVariant === "expressive" ? "px-1" : "",
|
|
891
|
+
// Padding: uniform 4dp (p-1) for expressive menus (matches 12px inner item corners inside 16px outer corners)
|
|
892
|
+
menuVariant === "expressive" ? "p-1" : MENU_GROUP_PADDING_Y,
|
|
898
893
|
// Gap variant has floating segments, so each group manages its own shadow
|
|
899
894
|
isGapVariant ? "elevation-2" : "",
|
|
900
895
|
// Background based on color variant (transparent for baseline to avoid double-layering)
|
|
@@ -902,9 +897,7 @@ var MenuGroup = React36__namespace.forwardRef(
|
|
|
902
897
|
className
|
|
903
898
|
),
|
|
904
899
|
animate: { borderRadius: currentShape },
|
|
905
|
-
transition: FAST_SPATIAL_SPRING
|
|
906
|
-
onPointerEnter: handlePointerEnter,
|
|
907
|
-
onPointerLeave: handlePointerLeave
|
|
900
|
+
transition: FAST_SPATIAL_SPRING
|
|
908
901
|
}, rest), {
|
|
909
902
|
children: [
|
|
910
903
|
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -941,7 +934,7 @@ var VARIANT_FONT = {
|
|
|
941
934
|
rounded: "'Material Symbols Rounded'",
|
|
942
935
|
sharp: "'Material Symbols Sharp'"
|
|
943
936
|
};
|
|
944
|
-
var IconComponent =
|
|
937
|
+
var IconComponent = React37__namespace.forwardRef(
|
|
945
938
|
(_a, ref) => {
|
|
946
939
|
var _b = _a, {
|
|
947
940
|
name,
|
|
@@ -1007,14 +1000,14 @@ var IconComponent = React36__namespace.forwardRef(
|
|
|
1007
1000
|
}
|
|
1008
1001
|
);
|
|
1009
1002
|
IconComponent.displayName = "Icon";
|
|
1010
|
-
var Icon =
|
|
1003
|
+
var Icon = React37__namespace.memo(IconComponent);
|
|
1011
1004
|
function getItemShapeClass(position, selected, isStatic = false, menuVariant = "expressive") {
|
|
1012
1005
|
if (menuVariant === "baseline") return BASELINE_ITEM_SHAPE;
|
|
1013
1006
|
if (selected) return ITEM_SHAPE_CLASSES.selected;
|
|
1014
1007
|
if (isStatic && position === "standalone") return "rounded-[12px]";
|
|
1015
1008
|
return ITEM_SHAPE_CLASSES[position];
|
|
1016
1009
|
}
|
|
1017
|
-
var MenuItem =
|
|
1010
|
+
var MenuItem = React37__namespace.forwardRef(
|
|
1018
1011
|
(_a, ref) => {
|
|
1019
1012
|
var _b = _a, {
|
|
1020
1013
|
children,
|
|
@@ -1027,11 +1020,13 @@ var MenuItem = React36__namespace.forwardRef(
|
|
|
1027
1020
|
disabled = false,
|
|
1028
1021
|
itemPosition = "standalone",
|
|
1029
1022
|
colorVariant: propColorVariant,
|
|
1023
|
+
density: propDensity,
|
|
1030
1024
|
keepOpen = false,
|
|
1031
1025
|
className,
|
|
1032
1026
|
isSubTrigger,
|
|
1033
1027
|
value,
|
|
1034
|
-
role
|
|
1028
|
+
role,
|
|
1029
|
+
isGapVariant: _isGapVariant
|
|
1035
1030
|
} = _b, rest = __objRest(_b, [
|
|
1036
1031
|
"children",
|
|
1037
1032
|
"onClick",
|
|
@@ -1043,18 +1038,24 @@ var MenuItem = React36__namespace.forwardRef(
|
|
|
1043
1038
|
"disabled",
|
|
1044
1039
|
"itemPosition",
|
|
1045
1040
|
"colorVariant",
|
|
1041
|
+
"density",
|
|
1046
1042
|
"keepOpen",
|
|
1047
1043
|
"className",
|
|
1048
1044
|
"isSubTrigger",
|
|
1049
1045
|
"value",
|
|
1050
|
-
"role"
|
|
1046
|
+
"role",
|
|
1047
|
+
"isGapVariant"
|
|
1051
1048
|
]);
|
|
1049
|
+
var _a2;
|
|
1052
1050
|
const {
|
|
1053
1051
|
menuVariant,
|
|
1054
1052
|
colorVariant: contextColorVariant,
|
|
1053
|
+
density: contextDensity,
|
|
1055
1054
|
menuPrimitive
|
|
1056
1055
|
} = useMenuContext();
|
|
1057
1056
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1057
|
+
const density = (_a2 = propDensity != null ? propDensity : contextDensity) != null ? _a2 : 0;
|
|
1058
|
+
const minHeightClass = DENSITY_MIN_HEIGHT[density];
|
|
1058
1059
|
const colors = menuVariant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1059
1060
|
const isStaticMenu = menuPrimitive === "static";
|
|
1060
1061
|
const shapeClass = getItemShapeClass(
|
|
@@ -1096,12 +1097,11 @@ var MenuItem = React36__namespace.forwardRef(
|
|
|
1096
1097
|
className: cn(
|
|
1097
1098
|
// Layout
|
|
1098
1099
|
"relative flex w-full cursor-pointer select-none items-center outline-none",
|
|
1099
|
-
// Sizing: min-h 48dp,
|
|
1100
|
-
|
|
1100
|
+
// Sizing: min-h based on density (48dp, 40dp, 32dp), min-w 112dp
|
|
1101
|
+
minHeightClass,
|
|
1102
|
+
"min-w-28",
|
|
1101
1103
|
// Horizontal padding
|
|
1102
1104
|
menuVariant === "baseline" ? MENU_BASELINE_ITEM_HORIZONTAL_PADDING : "px-4",
|
|
1103
|
-
// Spacing between items
|
|
1104
|
-
isStaticMenu ? "my-0.5" : "",
|
|
1105
1105
|
// Shape morphing (position-based + selected override)
|
|
1106
1106
|
shapeClass,
|
|
1107
1107
|
// Animate border-radius AND background-color together (FastEffects: 150ms)
|
|
@@ -1113,7 +1113,7 @@ var MenuItem = React36__namespace.forwardRef(
|
|
|
1113
1113
|
!selected && colors.focusLayer,
|
|
1114
1114
|
// Focus visible ring (WCAG 2.4.11 — visible focus indicator)
|
|
1115
1115
|
// Uses ring-inset so the ring doesn't overflow the item bounds.
|
|
1116
|
-
"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-m3-
|
|
1116
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-m3-secondary data-highlighted:ring-0",
|
|
1117
1117
|
// Disabled
|
|
1118
1118
|
disabled && "pointer-events-none opacity-[0.38]",
|
|
1119
1119
|
className
|
|
@@ -1216,31 +1216,31 @@ function SubMenu({
|
|
|
1216
1216
|
}) {
|
|
1217
1217
|
const { colorVariant: contextColorVariant, menuPrimitive } = useMenuContext();
|
|
1218
1218
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1219
|
-
const [open, setOpen] =
|
|
1220
|
-
const openTimerRef =
|
|
1221
|
-
const closeTimerRef =
|
|
1219
|
+
const [open, setOpen] = React37__namespace.useState(false);
|
|
1220
|
+
const openTimerRef = React37__namespace.useRef(null);
|
|
1221
|
+
const closeTimerRef = React37__namespace.useRef(
|
|
1222
1222
|
null
|
|
1223
1223
|
);
|
|
1224
|
-
const clearTimers =
|
|
1224
|
+
const clearTimers = React37__namespace.useCallback(() => {
|
|
1225
1225
|
if (openTimerRef.current) clearTimeout(openTimerRef.current);
|
|
1226
1226
|
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
1227
1227
|
}, []);
|
|
1228
|
-
const handleTriggerPointerEnter =
|
|
1228
|
+
const handleTriggerPointerEnter = React37__namespace.useCallback(() => {
|
|
1229
1229
|
clearTimers();
|
|
1230
1230
|
openTimerRef.current = setTimeout(() => setOpen(true), hoverOpenDelay);
|
|
1231
1231
|
}, [hoverOpenDelay, clearTimers]);
|
|
1232
|
-
const handleTriggerPointerLeave =
|
|
1232
|
+
const handleTriggerPointerLeave = React37__namespace.useCallback(() => {
|
|
1233
1233
|
clearTimers();
|
|
1234
1234
|
closeTimerRef.current = setTimeout(() => setOpen(false), hoverCloseDelay);
|
|
1235
1235
|
}, [hoverCloseDelay, clearTimers]);
|
|
1236
|
-
const handleContentPointerEnter =
|
|
1236
|
+
const handleContentPointerEnter = React37__namespace.useCallback(() => {
|
|
1237
1237
|
clearTimers();
|
|
1238
1238
|
}, [clearTimers]);
|
|
1239
|
-
const handleContentPointerLeave =
|
|
1239
|
+
const handleContentPointerLeave = React37__namespace.useCallback(() => {
|
|
1240
1240
|
clearTimers();
|
|
1241
1241
|
closeTimerRef.current = setTimeout(() => setOpen(false), hoverCloseDelay);
|
|
1242
1242
|
}, [hoverCloseDelay, clearTimers]);
|
|
1243
|
-
|
|
1243
|
+
React37__namespace.useEffect(() => () => clearTimers(), [clearTimers]);
|
|
1244
1244
|
const Sub3 = menuPrimitive === "context" ? RxContextMenu__namespace.Sub : DropdownMenu__namespace.Sub;
|
|
1245
1245
|
const SubTrigger3 = menuPrimitive === "context" ? RxContextMenu__namespace.SubTrigger : DropdownMenu__namespace.SubTrigger;
|
|
1246
1246
|
const SubContent3 = menuPrimitive === "context" ? RxContextMenu__namespace.SubContent : DropdownMenu__namespace.SubContent;
|
|
@@ -1252,7 +1252,7 @@ function SubMenu({
|
|
|
1252
1252
|
className: "w-full outline-none",
|
|
1253
1253
|
onPointerEnter: handleTriggerPointerEnter,
|
|
1254
1254
|
onPointerLeave: handleTriggerPointerLeave,
|
|
1255
|
-
children:
|
|
1255
|
+
children: React37__namespace.isValidElement(trigger) ? React37__namespace.cloneElement(trigger, {
|
|
1256
1256
|
isSubTrigger: true,
|
|
1257
1257
|
// Auto-add chevron if missing
|
|
1258
1258
|
trailingIcon: trigger.props.trailingIcon || /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron_right", size: 20 })
|
|
@@ -1329,7 +1329,7 @@ function SubMenuContent({
|
|
|
1329
1329
|
);
|
|
1330
1330
|
}
|
|
1331
1331
|
SubMenuContent.displayName = "SubMenuContent";
|
|
1332
|
-
var VerticalMenuDivider =
|
|
1332
|
+
var VerticalMenuDivider = React37__namespace.forwardRef((_a, ref) => {
|
|
1333
1333
|
var _b = _a, { className, index, count, isGapVariant } = _b, props = __objRest(_b, ["className", "index", "count", "isGapVariant"]);
|
|
1334
1334
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1335
1335
|
"hr",
|
|
@@ -1349,7 +1349,7 @@ var VerticalMenuDivider = React36__namespace.forwardRef((_a, ref) => {
|
|
|
1349
1349
|
});
|
|
1350
1350
|
VerticalMenuDivider.displayName = "VerticalMenuDivider";
|
|
1351
1351
|
var VerticalMenuGroup = MenuGroup;
|
|
1352
|
-
var VerticalMenuContent =
|
|
1352
|
+
var VerticalMenuContent = React37__namespace.forwardRef(
|
|
1353
1353
|
(_a, ref) => {
|
|
1354
1354
|
var _b = _a, {
|
|
1355
1355
|
children,
|
|
@@ -1365,46 +1365,39 @@ var VerticalMenuContent = React36__namespace.forwardRef(
|
|
|
1365
1365
|
const { colorVariant: contextColorVariant } = useMenuContext();
|
|
1366
1366
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1367
1367
|
const colors = colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1368
|
-
const
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1368
|
+
const renderedChildren = React37__namespace.useMemo(() => {
|
|
1369
|
+
const valid = flattenChildren(children);
|
|
1370
|
+
const groupCount = valid.length;
|
|
1371
|
+
const enhanced = valid.map((child, i) => {
|
|
1372
|
+
var _a2;
|
|
1373
|
+
if (typeof child.type === "string") return child;
|
|
1374
|
+
const defaultItemPosition = groupCount === 1 ? "standalone" : i === 0 ? "leading" : i === groupCount - 1 ? "trailing" : "middle";
|
|
1375
|
+
const itemPosition = (_a2 = child.props.itemPosition) != null ? _a2 : defaultItemPosition;
|
|
1376
|
+
return React37__namespace.cloneElement(
|
|
1377
|
+
child,
|
|
1378
|
+
{
|
|
1379
|
+
index: i,
|
|
1380
|
+
count: groupCount,
|
|
1381
|
+
itemPosition,
|
|
1382
|
+
isGapVariant: separatorStyle === "gap"
|
|
1380
1383
|
}
|
|
1381
|
-
return acc;
|
|
1382
|
-
},
|
|
1383
|
-
[]
|
|
1384
|
-
);
|
|
1385
|
-
};
|
|
1386
|
-
const validChildren = flattenChildren(children);
|
|
1387
|
-
const groupCount = validChildren.length;
|
|
1388
|
-
const enhancedChildren = validChildren.map(
|
|
1389
|
-
(child, i) => React36__namespace.cloneElement(child, {
|
|
1390
|
-
index: i,
|
|
1391
|
-
count: groupCount,
|
|
1392
|
-
isGapVariant: separatorStyle === "gap"
|
|
1393
|
-
})
|
|
1394
|
-
);
|
|
1395
|
-
const renderedChildren = separatorStyle === "divider" ? enhancedChildren.reduce((acc, child, i) => {
|
|
1396
|
-
if (i > 0) {
|
|
1397
|
-
acc.push(
|
|
1398
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1399
|
-
VerticalMenuDivider,
|
|
1400
|
-
{},
|
|
1401
|
-
`divider-${child.key || i}`
|
|
1402
|
-
)
|
|
1403
1384
|
);
|
|
1404
|
-
}
|
|
1405
|
-
|
|
1406
|
-
return acc
|
|
1407
|
-
|
|
1385
|
+
});
|
|
1386
|
+
if (separatorStyle !== "divider") return enhanced;
|
|
1387
|
+
return enhanced.reduce((acc, child, i) => {
|
|
1388
|
+
if (i > 0) {
|
|
1389
|
+
acc.push(
|
|
1390
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1391
|
+
VerticalMenuDivider,
|
|
1392
|
+
{},
|
|
1393
|
+
`divider-${child.key || i}`
|
|
1394
|
+
)
|
|
1395
|
+
);
|
|
1396
|
+
}
|
|
1397
|
+
acc.push(child);
|
|
1398
|
+
return acc;
|
|
1399
|
+
}, []);
|
|
1400
|
+
}, [children, separatorStyle]);
|
|
1408
1401
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1409
1402
|
"div",
|
|
1410
1403
|
__spreadProps(__spreadValues({
|
|
@@ -1423,13 +1416,13 @@ var VerticalMenuContent = React36__namespace.forwardRef(
|
|
|
1423
1416
|
}
|
|
1424
1417
|
);
|
|
1425
1418
|
VerticalMenuContent.displayName = "VerticalMenuContent";
|
|
1426
|
-
var VerticalMenu =
|
|
1419
|
+
var VerticalMenu = React37__namespace.forwardRef((_a, ref) => {
|
|
1427
1420
|
var _b = _a, { children, colorVariant = "standard", className } = _b, props = __objRest(_b, ["children", "colorVariant", "className"]);
|
|
1428
|
-
const noop =
|
|
1421
|
+
const noop = React37__namespace.useCallback(() => {
|
|
1429
1422
|
}, []);
|
|
1430
1423
|
const colors = colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1431
|
-
const containerRef =
|
|
1432
|
-
const mergedRef =
|
|
1424
|
+
const containerRef = React37__namespace.useRef(null);
|
|
1425
|
+
const mergedRef = React37__namespace.useCallback(
|
|
1433
1426
|
(node) => {
|
|
1434
1427
|
containerRef.current = node;
|
|
1435
1428
|
if (typeof ref === "function") ref(node);
|
|
@@ -1438,7 +1431,7 @@ var VerticalMenu = React36__namespace.forwardRef((_a, ref) => {
|
|
|
1438
1431
|
},
|
|
1439
1432
|
[ref]
|
|
1440
1433
|
);
|
|
1441
|
-
const handleKeyDown =
|
|
1434
|
+
const handleKeyDown = React37__namespace.useCallback(
|
|
1442
1435
|
(e) => {
|
|
1443
1436
|
var _a2;
|
|
1444
1437
|
if (!containerRef.current) return;
|
|
@@ -1521,7 +1514,7 @@ var VerticalMenu = React36__namespace.forwardRef((_a, ref) => {
|
|
|
1521
1514
|
});
|
|
1522
1515
|
VerticalMenu.displayName = "VerticalMenu";
|
|
1523
1516
|
function detectSeparatorStyle(children) {
|
|
1524
|
-
const child =
|
|
1517
|
+
const child = React37__namespace.Children.toArray(children).find(React37__namespace.isValidElement);
|
|
1525
1518
|
if (child) {
|
|
1526
1519
|
const style = child.props.separatorStyle;
|
|
1527
1520
|
if (style) return style;
|
|
@@ -1602,11 +1595,11 @@ function AppBarColumn({
|
|
|
1602
1595
|
maxItemCount,
|
|
1603
1596
|
className
|
|
1604
1597
|
}) {
|
|
1605
|
-
const containerRef =
|
|
1606
|
-
const [visibleCount, setVisibleCount] =
|
|
1598
|
+
const containerRef = React37__namespace.useRef(null);
|
|
1599
|
+
const [visibleCount, setVisibleCount] = React37__namespace.useState(
|
|
1607
1600
|
maxItemCount != null ? maxItemCount : items.length
|
|
1608
1601
|
);
|
|
1609
|
-
|
|
1602
|
+
React37__namespace.useEffect(() => {
|
|
1610
1603
|
if (maxItemCount !== void 0) {
|
|
1611
1604
|
setVisibleCount(Math.min(maxItemCount, items.length));
|
|
1612
1605
|
return;
|
|
@@ -1654,11 +1647,11 @@ function AppBarColumn({
|
|
|
1654
1647
|
);
|
|
1655
1648
|
}
|
|
1656
1649
|
function AppBarRow({ items, maxItemCount, className }) {
|
|
1657
|
-
const containerRef =
|
|
1658
|
-
const [visibleCount, setVisibleCount] =
|
|
1650
|
+
const containerRef = React37__namespace.useRef(null);
|
|
1651
|
+
const [visibleCount, setVisibleCount] = React37__namespace.useState(
|
|
1659
1652
|
maxItemCount != null ? maxItemCount : items.length
|
|
1660
1653
|
);
|
|
1661
|
-
|
|
1654
|
+
React37__namespace.useEffect(() => {
|
|
1662
1655
|
if (maxItemCount !== void 0) {
|
|
1663
1656
|
setVisibleCount(Math.min(maxItemCount, items.length));
|
|
1664
1657
|
return;
|
|
@@ -1712,12 +1705,12 @@ function useAppBarScroll({
|
|
|
1712
1705
|
collapsedHeight = 64,
|
|
1713
1706
|
expandedHeight = 112
|
|
1714
1707
|
} = {}) {
|
|
1715
|
-
const [isScrolled, setIsScrolled] =
|
|
1716
|
-
const [collapsedFraction, setCollapsedFraction] =
|
|
1717
|
-
const [isHidden, setIsHidden] =
|
|
1718
|
-
const prevScrollYRef =
|
|
1708
|
+
const [isScrolled, setIsScrolled] = React37__namespace.useState(false);
|
|
1709
|
+
const [collapsedFraction, setCollapsedFraction] = React37__namespace.useState(0);
|
|
1710
|
+
const [isHidden, setIsHidden] = React37__namespace.useState(false);
|
|
1711
|
+
const prevScrollYRef = React37__namespace.useRef(0);
|
|
1719
1712
|
const hideThreshold = 64;
|
|
1720
|
-
|
|
1713
|
+
React37__namespace.useEffect(() => {
|
|
1721
1714
|
var _a;
|
|
1722
1715
|
const scrollDistance = expandedHeight - collapsedHeight;
|
|
1723
1716
|
const getScrollY = () => {
|
|
@@ -1838,7 +1831,7 @@ function useFlexibleAppBar({
|
|
|
1838
1831
|
expandedHeight
|
|
1839
1832
|
});
|
|
1840
1833
|
const scrollProgress = react.useMotionValue(0);
|
|
1841
|
-
|
|
1834
|
+
React37__namespace.useEffect(() => {
|
|
1842
1835
|
scrollProgress.set(
|
|
1843
1836
|
shouldReduceMotion ? collapsedFraction > 0.5 ? 1 : 0 : collapsedFraction
|
|
1844
1837
|
);
|
|
@@ -2179,7 +2172,7 @@ function SearchAppBar({
|
|
|
2179
2172
|
}) {
|
|
2180
2173
|
var _a, _b;
|
|
2181
2174
|
const shouldReduceMotion = react.useReducedMotion();
|
|
2182
|
-
const [isSearchOpen, setIsSearchOpen] =
|
|
2175
|
+
const [isSearchOpen, setIsSearchOpen] = React37__namespace.useState(false);
|
|
2183
2176
|
const { isScrolled } = useAppBarScroll({
|
|
2184
2177
|
scrollElement,
|
|
2185
2178
|
behavior: scrollBehavior === "exitUntilCollapsed" ? "pinned" : scrollBehavior
|
|
@@ -2293,8 +2286,8 @@ function SearchView({
|
|
|
2293
2286
|
className
|
|
2294
2287
|
}) {
|
|
2295
2288
|
const shouldReduceMotion = react.useReducedMotion();
|
|
2296
|
-
const inputRef =
|
|
2297
|
-
|
|
2289
|
+
const inputRef = React37__namespace.useRef(null);
|
|
2290
|
+
React37__namespace.useEffect(() => {
|
|
2298
2291
|
const timer = window.setTimeout(() => {
|
|
2299
2292
|
var _a;
|
|
2300
2293
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
@@ -2550,7 +2543,7 @@ function SmallAppBar({
|
|
|
2550
2543
|
"small-app-bar"
|
|
2551
2544
|
) });
|
|
2552
2545
|
}
|
|
2553
|
-
var RippleItem =
|
|
2546
|
+
var RippleItem = React37__namespace.memo(function RippleItem2({
|
|
2554
2547
|
ripple,
|
|
2555
2548
|
onDone
|
|
2556
2549
|
}) {
|
|
@@ -2594,8 +2587,8 @@ function Ripple({
|
|
|
2594
2587
|
}
|
|
2595
2588
|
function useRippleState(options = {}) {
|
|
2596
2589
|
const { disabled = false } = options;
|
|
2597
|
-
const [ripples, setRipples] =
|
|
2598
|
-
const onPointerDown =
|
|
2590
|
+
const [ripples, setRipples] = React37__namespace.useState([]);
|
|
2591
|
+
const onPointerDown = React37__namespace.useCallback(
|
|
2599
2592
|
(e) => {
|
|
2600
2593
|
if (disabled) return;
|
|
2601
2594
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -2612,7 +2605,7 @@ function useRippleState(options = {}) {
|
|
|
2612
2605
|
},
|
|
2613
2606
|
[disabled]
|
|
2614
2607
|
);
|
|
2615
|
-
const removeRipple =
|
|
2608
|
+
const removeRipple = React37__namespace.useCallback((id) => {
|
|
2616
2609
|
setRipples((prev) => prev.filter((r) => r.id !== id));
|
|
2617
2610
|
}, []);
|
|
2618
2611
|
return { ripples, onPointerDown, removeRipple };
|
|
@@ -4542,11 +4535,11 @@ function getNavigationShapeStyle(shape, width = 56, height = 56) {
|
|
|
4542
4535
|
function isSquareShape(shape) {
|
|
4543
4536
|
return Boolean(shape && shape !== "pill");
|
|
4544
4537
|
}
|
|
4545
|
-
var NavigationBarContext =
|
|
4538
|
+
var NavigationBarContext = React37__namespace.createContext({ variant: "flexible" });
|
|
4546
4539
|
function cloneIconWithFill(icon, selected) {
|
|
4547
|
-
if (!
|
|
4540
|
+
if (!React37__namespace.isValidElement(icon)) return icon;
|
|
4548
4541
|
if (icon.type === Icon) {
|
|
4549
|
-
return
|
|
4542
|
+
return React37__namespace.cloneElement(
|
|
4550
4543
|
icon,
|
|
4551
4544
|
{ fill: selected ? 1 : 0, animateFill: true }
|
|
4552
4545
|
);
|
|
@@ -4558,7 +4551,7 @@ function ActivePill({
|
|
|
4558
4551
|
width = 56,
|
|
4559
4552
|
height = 32
|
|
4560
4553
|
}) {
|
|
4561
|
-
const { activeIndicatorTransition } =
|
|
4554
|
+
const { activeIndicatorTransition } = React37__namespace.useContext(NavigationBarContext);
|
|
4562
4555
|
const shapeStyle = getNavigationShapeStyle(shape, width, height);
|
|
4563
4556
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4564
4557
|
react.m.div,
|
|
@@ -4630,7 +4623,7 @@ function IconContainer({ selected, badge, children }) {
|
|
|
4630
4623
|
}
|
|
4631
4624
|
);
|
|
4632
4625
|
}
|
|
4633
|
-
var NavigationBarItemComponent =
|
|
4626
|
+
var NavigationBarItemComponent = React37__namespace.forwardRef(
|
|
4634
4627
|
({
|
|
4635
4628
|
selected,
|
|
4636
4629
|
icon,
|
|
@@ -4654,7 +4647,7 @@ var NavigationBarItemComponent = React36__namespace.forwardRef(
|
|
|
4654
4647
|
labelVisibility: contextLabelVisibility,
|
|
4655
4648
|
shapeSize: contextShapeSize,
|
|
4656
4649
|
itemClassName: contextItemClassName
|
|
4657
|
-
} =
|
|
4650
|
+
} = React37__namespace.useContext(NavigationBarContext);
|
|
4658
4651
|
const activeShape = (_a = shapeProp != null ? shapeProp : contextShape) != null ? _a : "pill";
|
|
4659
4652
|
const isSquare = isSquareShape(activeShape);
|
|
4660
4653
|
const resolvedShapeSize = (_b = shapeSizeProp != null ? shapeSizeProp : contextShapeSize) != null ? _b : 56;
|
|
@@ -4668,7 +4661,7 @@ var NavigationBarItemComponent = React36__namespace.forwardRef(
|
|
|
4668
4661
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
4669
4662
|
disabled
|
|
4670
4663
|
});
|
|
4671
|
-
const handleClick =
|
|
4664
|
+
const handleClick = React37__namespace.useCallback(
|
|
4672
4665
|
(e) => {
|
|
4673
4666
|
if (disabled) {
|
|
4674
4667
|
e.preventDefault();
|
|
@@ -4695,7 +4688,7 @@ var NavigationBarItemComponent = React36__namespace.forwardRef(
|
|
|
4695
4688
|
const iconPillWidth = isSquare ? resolvedShapeSize : 56;
|
|
4696
4689
|
const iconPillHeight = isSquare ? resolvedShapeSize : 32;
|
|
4697
4690
|
if (asChild && children) {
|
|
4698
|
-
const child =
|
|
4691
|
+
const child = React37__namespace.Children.only(children);
|
|
4699
4692
|
const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4700
4693
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4701
4694
|
"div",
|
|
@@ -4820,7 +4813,7 @@ var NavigationBarItemComponent = React36__namespace.forwardRef(
|
|
|
4820
4813
|
onClick: handleClick,
|
|
4821
4814
|
onPointerDown,
|
|
4822
4815
|
className: itemClassName,
|
|
4823
|
-
children:
|
|
4816
|
+
children: React37__namespace.cloneElement(child, { children: innerContent })
|
|
4824
4817
|
}
|
|
4825
4818
|
);
|
|
4826
4819
|
}
|
|
@@ -4954,7 +4947,7 @@ var NavigationBarItemComponent = React36__namespace.forwardRef(
|
|
|
4954
4947
|
}
|
|
4955
4948
|
);
|
|
4956
4949
|
NavigationBarItemComponent.displayName = "NavigationBarItem";
|
|
4957
|
-
var NavigationBarItem =
|
|
4950
|
+
var NavigationBarItem = React37__namespace.memo(NavigationBarItemComponent);
|
|
4958
4951
|
var navContainerVariants = classVarianceAuthority.cva(
|
|
4959
4952
|
"flex items-center justify-center select-none transition-transform duration-300 z-50",
|
|
4960
4953
|
{
|
|
@@ -4980,7 +4973,7 @@ var navContainerVariants = classVarianceAuthority.cva(
|
|
|
4980
4973
|
}
|
|
4981
4974
|
}
|
|
4982
4975
|
);
|
|
4983
|
-
var NavigationBarComponent =
|
|
4976
|
+
var NavigationBarComponent = React37__namespace.forwardRef(
|
|
4984
4977
|
({
|
|
4985
4978
|
variant = "flexible",
|
|
4986
4979
|
itemLayout,
|
|
@@ -4997,18 +4990,18 @@ var NavigationBarComponent = React36__namespace.forwardRef(
|
|
|
4997
4990
|
className,
|
|
4998
4991
|
style
|
|
4999
4992
|
}, ref) => {
|
|
5000
|
-
const [isVisible, setIsVisible] =
|
|
5001
|
-
const lastScrollY =
|
|
4993
|
+
const [isVisible, setIsVisible] = React37__namespace.useState(true);
|
|
4994
|
+
const lastScrollY = React37__namespace.useRef(
|
|
5002
4995
|
typeof window !== "undefined" ? window.scrollY : 0
|
|
5003
4996
|
);
|
|
5004
4997
|
const isSquare = isSquareShape(shape);
|
|
5005
4998
|
const effectiveShapeSize = shapeSize != null ? shapeSize : isSquare ? 56 : 32;
|
|
5006
|
-
const computedMinHeight =
|
|
4999
|
+
const computedMinHeight = React37__namespace.useMemo(() => {
|
|
5007
5000
|
const baseHeight = variant === "baseline" ? 80 : 64;
|
|
5008
5001
|
const requiredHeight = itemLayout === "horizontal" || labelVisibility === "unlabeled" ? effectiveShapeSize + 16 : effectiveShapeSize + 32;
|
|
5009
5002
|
return Math.max(baseHeight, requiredHeight);
|
|
5010
5003
|
}, [variant, itemLayout, labelVisibility, effectiveShapeSize]);
|
|
5011
|
-
|
|
5004
|
+
React37__namespace.useEffect(() => {
|
|
5012
5005
|
if (typeof window === "undefined" || !hideOnScroll) {
|
|
5013
5006
|
setIsVisible(true);
|
|
5014
5007
|
return;
|
|
@@ -5092,8 +5085,8 @@ var NavigationBarComponent = React36__namespace.forwardRef(
|
|
|
5092
5085
|
}
|
|
5093
5086
|
);
|
|
5094
5087
|
NavigationBarComponent.displayName = "NavigationBar";
|
|
5095
|
-
var NavigationBar =
|
|
5096
|
-
var NavigationRailContext =
|
|
5088
|
+
var NavigationBar = React37__namespace.memo(NavigationBarComponent);
|
|
5089
|
+
var NavigationRailContext = React37__namespace.createContext({
|
|
5097
5090
|
variant: "collapsed",
|
|
5098
5091
|
labelVisibility: "labeled",
|
|
5099
5092
|
activeIndicatorWidth: "hug"
|
|
@@ -5129,9 +5122,9 @@ var railContainerVariants = classVarianceAuthority.cva(
|
|
|
5129
5122
|
}
|
|
5130
5123
|
);
|
|
5131
5124
|
function cloneIconWithFill2(icon, selected) {
|
|
5132
|
-
if (!
|
|
5125
|
+
if (!React37__namespace.isValidElement(icon)) return icon;
|
|
5133
5126
|
if (icon.type === Icon) {
|
|
5134
|
-
return
|
|
5127
|
+
return React37__namespace.cloneElement(
|
|
5135
5128
|
icon,
|
|
5136
5129
|
{ fill: selected ? 1 : 0, animateFill: true }
|
|
5137
5130
|
);
|
|
@@ -5160,7 +5153,7 @@ function ActivePill2({
|
|
|
5160
5153
|
width = 56,
|
|
5161
5154
|
height = 32
|
|
5162
5155
|
}) {
|
|
5163
|
-
const { activeIndicatorTransition } =
|
|
5156
|
+
const { activeIndicatorTransition } = React37__namespace.useContext(NavigationRailContext);
|
|
5164
5157
|
const shapeStyle = getNavigationShapeStyle(shape, width, height);
|
|
5165
5158
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5166
5159
|
react.m.div,
|
|
@@ -5235,7 +5228,7 @@ function IconContainer2({ selected, badge, children }) {
|
|
|
5235
5228
|
}
|
|
5236
5229
|
);
|
|
5237
5230
|
}
|
|
5238
|
-
var NavigationRailItemComponent =
|
|
5231
|
+
var NavigationRailItemComponent = React37__namespace.forwardRef(
|
|
5239
5232
|
({
|
|
5240
5233
|
selected,
|
|
5241
5234
|
icon,
|
|
@@ -5258,7 +5251,7 @@ var NavigationRailItemComponent = React36__namespace.forwardRef(
|
|
|
5258
5251
|
shape: contextShape,
|
|
5259
5252
|
shapeSize: contextShapeSize,
|
|
5260
5253
|
activeIndicatorWidth: contextActiveIndicatorWidth
|
|
5261
|
-
} =
|
|
5254
|
+
} = React37__namespace.useContext(NavigationRailContext);
|
|
5262
5255
|
const activeShape = (_a = shapeProp != null ? shapeProp : contextShape) != null ? _a : "pill";
|
|
5263
5256
|
const isSquare = isSquareShape(activeShape);
|
|
5264
5257
|
const resolvedShapeSize = (_b = shapeSizeProp != null ? shapeSizeProp : contextShapeSize) != null ? _b : 56;
|
|
@@ -5268,12 +5261,12 @@ var NavigationRailItemComponent = React36__namespace.forwardRef(
|
|
|
5268
5261
|
const enableLayout = !isModal;
|
|
5269
5262
|
const isExpandedPill = isExpanded && !isSquare;
|
|
5270
5263
|
const expandedPillWidthClass = activeIndicatorWidth === "fill" ? "w-full" : "w-fit";
|
|
5271
|
-
const activePillId = `rail-pill-${
|
|
5264
|
+
const activePillId = `rail-pill-${React37__namespace.useId()}`;
|
|
5272
5265
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
5273
5266
|
disabled
|
|
5274
5267
|
});
|
|
5275
5268
|
const showLabel = isExpanded || labelVisibility === "labeled" || labelVisibility === "auto" && selected;
|
|
5276
|
-
const handleClick =
|
|
5269
|
+
const handleClick = React37__namespace.useCallback(
|
|
5277
5270
|
(e) => {
|
|
5278
5271
|
if (disabled) {
|
|
5279
5272
|
e.preventDefault();
|
|
@@ -5295,7 +5288,7 @@ var NavigationRailItemComponent = React36__namespace.forwardRef(
|
|
|
5295
5288
|
const iconPillWidth = isSquare ? resolvedShapeSize : 56;
|
|
5296
5289
|
const iconPillHeight = isSquare ? resolvedShapeSize : 32;
|
|
5297
5290
|
if (asChild && children) {
|
|
5298
|
-
const child =
|
|
5291
|
+
const child = React37__namespace.Children.only(children);
|
|
5299
5292
|
const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5300
5293
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5301
5294
|
react.m.div,
|
|
@@ -5413,7 +5406,7 @@ var NavigationRailItemComponent = React36__namespace.forwardRef(
|
|
|
5413
5406
|
onPointerDown,
|
|
5414
5407
|
className: itemClassName,
|
|
5415
5408
|
tabIndex: -1,
|
|
5416
|
-
children:
|
|
5409
|
+
children: React37__namespace.cloneElement(child, { children: innerContent })
|
|
5417
5410
|
}
|
|
5418
5411
|
) });
|
|
5419
5412
|
}
|
|
@@ -5541,9 +5534,9 @@ var NavigationRailItemComponent = React36__namespace.forwardRef(
|
|
|
5541
5534
|
}
|
|
5542
5535
|
);
|
|
5543
5536
|
NavigationRailItemComponent.displayName = "NavigationRailItem";
|
|
5544
|
-
var NavigationRailItem =
|
|
5537
|
+
var NavigationRailItem = React37__namespace.memo(NavigationRailItemComponent);
|
|
5545
5538
|
function useRoving(navRef) {
|
|
5546
|
-
|
|
5539
|
+
React37__namespace.useEffect(() => {
|
|
5547
5540
|
if (!navRef.current) return;
|
|
5548
5541
|
const items = getMenuItems(navRef.current);
|
|
5549
5542
|
const selected = items.find(
|
|
@@ -5553,7 +5546,7 @@ function useRoving(navRef) {
|
|
|
5553
5546
|
const firstFocusable = selected != null ? selected : items[0];
|
|
5554
5547
|
if (firstFocusable) firstFocusable.tabIndex = 0;
|
|
5555
5548
|
}, [navRef]);
|
|
5556
|
-
return
|
|
5549
|
+
return React37__namespace.useCallback(
|
|
5557
5550
|
(e) => {
|
|
5558
5551
|
if (!navRef.current) return;
|
|
5559
5552
|
const items = getMenuItems(navRef.current);
|
|
@@ -5581,7 +5574,7 @@ function useRoving(navRef) {
|
|
|
5581
5574
|
[navRef]
|
|
5582
5575
|
);
|
|
5583
5576
|
}
|
|
5584
|
-
var NavigationRailComponent =
|
|
5577
|
+
var NavigationRailComponent = React37__namespace.forwardRef(
|
|
5585
5578
|
({
|
|
5586
5579
|
variant = "collapsed",
|
|
5587
5580
|
labelVisibility = "labeled",
|
|
@@ -5605,9 +5598,9 @@ var NavigationRailComponent = React36__namespace.forwardRef(
|
|
|
5605
5598
|
const isXr = variant === "xr";
|
|
5606
5599
|
const isSpatial = isXr && fabPlacement === "spatialized";
|
|
5607
5600
|
const applyAnimation = !isXr || !isSpatial;
|
|
5608
|
-
const navRef =
|
|
5601
|
+
const navRef = React37__namespace.useRef(null);
|
|
5609
5602
|
const handleKeyDown = useRoving(navRef);
|
|
5610
|
-
const setRefs =
|
|
5603
|
+
const setRefs = React37__namespace.useCallback(
|
|
5611
5604
|
(node) => {
|
|
5612
5605
|
navRef.current = node;
|
|
5613
5606
|
if (typeof ref === "function") ref(node);
|
|
@@ -5700,7 +5693,7 @@ var NavigationRailComponent = React36__namespace.forwardRef(
|
|
|
5700
5693
|
children: fab
|
|
5701
5694
|
}
|
|
5702
5695
|
),
|
|
5703
|
-
|
|
5696
|
+
React37__namespace.cloneElement(
|
|
5704
5697
|
navElement,
|
|
5705
5698
|
{
|
|
5706
5699
|
className: cn(navBaseClasses, "pointer-events-auto")
|
|
@@ -5745,7 +5738,7 @@ var NavigationRailComponent = React36__namespace.forwardRef(
|
|
|
5745
5738
|
}
|
|
5746
5739
|
);
|
|
5747
5740
|
NavigationRailComponent.displayName = "NavigationRail";
|
|
5748
|
-
var NavigationRail =
|
|
5741
|
+
var NavigationRail = React37__namespace.memo(NavigationRailComponent);
|
|
5749
5742
|
function useSearchKeyboard({
|
|
5750
5743
|
active,
|
|
5751
5744
|
onActiveChange,
|
|
@@ -5754,14 +5747,14 @@ function useSearchKeyboard({
|
|
|
5754
5747
|
itemCount,
|
|
5755
5748
|
onSelectSuggestion
|
|
5756
5749
|
}) {
|
|
5757
|
-
const [activeIndex, setActiveIndex] =
|
|
5758
|
-
const resetKeyRef =
|
|
5750
|
+
const [activeIndex, setActiveIndex] = React37__namespace.useState(-1);
|
|
5751
|
+
const resetKeyRef = React37__namespace.useRef(`${active}:${query}`);
|
|
5759
5752
|
const currentKey = `${active}:${query}`;
|
|
5760
5753
|
if (resetKeyRef.current !== currentKey) {
|
|
5761
5754
|
resetKeyRef.current = currentKey;
|
|
5762
5755
|
setActiveIndex(-1);
|
|
5763
5756
|
}
|
|
5764
|
-
const handleKeyDown =
|
|
5757
|
+
const handleKeyDown = React37__namespace.useCallback(
|
|
5765
5758
|
(e) => {
|
|
5766
5759
|
if (!active) return;
|
|
5767
5760
|
switch (e.key) {
|
|
@@ -5801,7 +5794,7 @@ function useSearchKeyboard({
|
|
|
5801
5794
|
query
|
|
5802
5795
|
]
|
|
5803
5796
|
);
|
|
5804
|
-
const resetActiveIndex =
|
|
5797
|
+
const resetActiveIndex = React37__namespace.useCallback(() => {
|
|
5805
5798
|
setActiveIndex(-1);
|
|
5806
5799
|
}, []);
|
|
5807
5800
|
return { activeIndex, handleKeyDown, resetActiveIndex };
|
|
@@ -5869,10 +5862,10 @@ function AnimatedPlaceholder({
|
|
|
5869
5862
|
className
|
|
5870
5863
|
}) {
|
|
5871
5864
|
const shouldReduceMotion = react.useReducedMotion();
|
|
5872
|
-
const containerRef =
|
|
5873
|
-
const spanRef =
|
|
5874
|
-
const [xOffset, setXOffset] =
|
|
5875
|
-
const recalculate =
|
|
5865
|
+
const containerRef = React37__namespace.useRef(null);
|
|
5866
|
+
const spanRef = React37__namespace.useRef(null);
|
|
5867
|
+
const [xOffset, setXOffset] = React37__namespace.useState(0);
|
|
5868
|
+
const recalculate = React37__namespace.useCallback(() => {
|
|
5876
5869
|
const container = containerRef.current;
|
|
5877
5870
|
const span = spanRef.current;
|
|
5878
5871
|
if (!container || !span || textAlign === "left") {
|
|
@@ -5887,10 +5880,10 @@ function AnimatedPlaceholder({
|
|
|
5887
5880
|
setXOffset(Math.max(0, containerWidth - textWidth));
|
|
5888
5881
|
}
|
|
5889
5882
|
}, [textAlign]);
|
|
5890
|
-
|
|
5883
|
+
React37__namespace.useLayoutEffect(() => {
|
|
5891
5884
|
recalculate();
|
|
5892
5885
|
}, [recalculate]);
|
|
5893
|
-
|
|
5886
|
+
React37__namespace.useEffect(() => {
|
|
5894
5887
|
const container = containerRef.current;
|
|
5895
5888
|
if (!container) return;
|
|
5896
5889
|
const observer = new ResizeObserver(recalculate);
|
|
@@ -5959,10 +5952,10 @@ function SearchBar({
|
|
|
5959
5952
|
activeIndex
|
|
5960
5953
|
}) {
|
|
5961
5954
|
const shouldReduceMotion = react.useReducedMotion();
|
|
5962
|
-
const inputRef =
|
|
5963
|
-
const prevActiveRef =
|
|
5964
|
-
const isRestoringFocusRef =
|
|
5965
|
-
|
|
5955
|
+
const inputRef = React37__namespace.useRef(null);
|
|
5956
|
+
const prevActiveRef = React37__namespace.useRef(active);
|
|
5957
|
+
const isRestoringFocusRef = React37__namespace.useRef(false);
|
|
5958
|
+
React37__namespace.useEffect(() => {
|
|
5966
5959
|
var _a;
|
|
5967
5960
|
let rafId;
|
|
5968
5961
|
if (prevActiveRef.current === true && active === false) {
|
|
@@ -6081,7 +6074,7 @@ function SearchBar({
|
|
|
6081
6074
|
) })
|
|
6082
6075
|
);
|
|
6083
6076
|
}
|
|
6084
|
-
var SearchContext =
|
|
6077
|
+
var SearchContext = React37__namespace.createContext(null);
|
|
6085
6078
|
function SearchProvider({
|
|
6086
6079
|
children,
|
|
6087
6080
|
value
|
|
@@ -6089,15 +6082,15 @@ function SearchProvider({
|
|
|
6089
6082
|
return /* @__PURE__ */ jsxRuntime.jsx(SearchContext.Provider, { value, children });
|
|
6090
6083
|
}
|
|
6091
6084
|
function useSearch() {
|
|
6092
|
-
const context =
|
|
6085
|
+
const context = React37__namespace.useContext(SearchContext);
|
|
6093
6086
|
if (!context) {
|
|
6094
6087
|
return { listboxId: "", activeIndex: -1 };
|
|
6095
6088
|
}
|
|
6096
6089
|
return context;
|
|
6097
6090
|
}
|
|
6098
6091
|
function useClickOutside(handler, enabled = true) {
|
|
6099
|
-
const ref =
|
|
6100
|
-
|
|
6092
|
+
const ref = React37.useRef(null);
|
|
6093
|
+
React37.useEffect(() => {
|
|
6101
6094
|
if (!enabled) return;
|
|
6102
6095
|
const listener = (event) => {
|
|
6103
6096
|
const el = ref.current;
|
|
@@ -6116,7 +6109,7 @@ function useClickOutside(handler, enabled = true) {
|
|
|
6116
6109
|
return ref;
|
|
6117
6110
|
}
|
|
6118
6111
|
function useSearchViewFocus(inputRef, active) {
|
|
6119
|
-
|
|
6112
|
+
React37__namespace.useEffect(() => {
|
|
6120
6113
|
if (!active) return;
|
|
6121
6114
|
let raf2;
|
|
6122
6115
|
const raf1 = requestAnimationFrame(() => {
|
|
@@ -6176,11 +6169,11 @@ var ROTATE_KEY_SPLINES = [
|
|
|
6176
6169
|
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";
|
|
6177
6170
|
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";
|
|
6178
6171
|
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";
|
|
6179
|
-
var IndeterminateSvg =
|
|
6172
|
+
var IndeterminateSvg = React37__namespace.memo(function IndeterminateSvg2({
|
|
6180
6173
|
size
|
|
6181
6174
|
}) {
|
|
6182
|
-
const [ready, setReady] =
|
|
6183
|
-
|
|
6175
|
+
const [ready, setReady] = React37__namespace.useState(false);
|
|
6176
|
+
React37__namespace.useEffect(() => {
|
|
6184
6177
|
const raf = requestAnimationFrame(() => setReady(true));
|
|
6185
6178
|
return () => cancelAnimationFrame(raf);
|
|
6186
6179
|
}, []);
|
|
@@ -6225,7 +6218,7 @@ var IndeterminateSvg = React36__namespace.memo(function IndeterminateSvg2({
|
|
|
6225
6218
|
}
|
|
6226
6219
|
);
|
|
6227
6220
|
});
|
|
6228
|
-
var DeterminateSvg =
|
|
6221
|
+
var DeterminateSvg = React37__namespace.memo(function DeterminateSvg2({
|
|
6229
6222
|
size,
|
|
6230
6223
|
progress
|
|
6231
6224
|
}) {
|
|
@@ -6250,7 +6243,7 @@ var DeterminateSvg = React36__namespace.memo(function DeterminateSvg2({
|
|
|
6250
6243
|
}
|
|
6251
6244
|
);
|
|
6252
6245
|
});
|
|
6253
|
-
var LoadingIndicator =
|
|
6246
|
+
var LoadingIndicator = React37__namespace.forwardRef(
|
|
6254
6247
|
(_a, ref) => {
|
|
6255
6248
|
var _b = _a, {
|
|
6256
6249
|
variant = "uncontained",
|
|
@@ -6365,7 +6358,7 @@ function getSinePath(startX, endX, phase, wl, amp) {
|
|
|
6365
6358
|
d += ` L ${endX.toFixed(2)} ${yEnd.toFixed(2)}`;
|
|
6366
6359
|
return d;
|
|
6367
6360
|
}
|
|
6368
|
-
var CircularProgress =
|
|
6361
|
+
var CircularProgress = React37__namespace.forwardRef(
|
|
6369
6362
|
(_a, ref) => {
|
|
6370
6363
|
var _b = _a, {
|
|
6371
6364
|
value,
|
|
@@ -6403,15 +6396,15 @@ var CircularProgress = React36__namespace.forwardRef(
|
|
|
6403
6396
|
const isWavy = shape === "wavy";
|
|
6404
6397
|
const BASELINE_SIZE = 48;
|
|
6405
6398
|
const scaleFactor = size / BASELINE_SIZE;
|
|
6406
|
-
const effectiveAmplitude =
|
|
6399
|
+
const effectiveAmplitude = React37__namespace.useMemo(
|
|
6407
6400
|
() => amplitude != null ? amplitude : 1.6 * scaleFactor,
|
|
6408
6401
|
[amplitude, scaleFactor]
|
|
6409
6402
|
);
|
|
6410
|
-
const effectiveWavelength =
|
|
6403
|
+
const effectiveWavelength = React37__namespace.useMemo(
|
|
6411
6404
|
() => wavelength != null ? wavelength : 15 * scaleFactor,
|
|
6412
6405
|
[wavelength, scaleFactor]
|
|
6413
6406
|
);
|
|
6414
|
-
const wavyActivePath =
|
|
6407
|
+
const wavyActivePath = React37__namespace.useMemo(
|
|
6415
6408
|
() => isWavy ? generateWavyCircularPath(
|
|
6416
6409
|
center,
|
|
6417
6410
|
radius,
|
|
@@ -6420,8 +6413,8 @@ var CircularProgress = React36__namespace.forwardRef(
|
|
|
6420
6413
|
) : null,
|
|
6421
6414
|
[isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
|
|
6422
6415
|
);
|
|
6423
|
-
const circumference =
|
|
6424
|
-
const gapForTrack =
|
|
6416
|
+
const circumference = React37__namespace.useMemo(() => 2 * Math.PI * radius, [radius]);
|
|
6417
|
+
const gapForTrack = React37__namespace.useMemo(
|
|
6425
6418
|
() => (gapSize + trackHeight) / circumference,
|
|
6426
6419
|
[gapSize, trackHeight, circumference]
|
|
6427
6420
|
);
|
|
@@ -6610,9 +6603,9 @@ var CircularProgress = React36__namespace.forwardRef(
|
|
|
6610
6603
|
);
|
|
6611
6604
|
CircularProgress.displayName = "CircularProgress";
|
|
6612
6605
|
function useContainerWidth() {
|
|
6613
|
-
const [width, setWidth] =
|
|
6614
|
-
const observerRef =
|
|
6615
|
-
const ref =
|
|
6606
|
+
const [width, setWidth] = React37__namespace.useState(0);
|
|
6607
|
+
const observerRef = React37__namespace.useRef(null);
|
|
6608
|
+
const ref = React37__namespace.useCallback((node) => {
|
|
6616
6609
|
if (observerRef.current) {
|
|
6617
6610
|
observerRef.current.disconnect();
|
|
6618
6611
|
observerRef.current = null;
|
|
@@ -6626,7 +6619,7 @@ function useContainerWidth() {
|
|
|
6626
6619
|
observerRef.current = obs;
|
|
6627
6620
|
}
|
|
6628
6621
|
}, []);
|
|
6629
|
-
|
|
6622
|
+
React37__namespace.useEffect(() => {
|
|
6630
6623
|
return () => {
|
|
6631
6624
|
if (observerRef.current) {
|
|
6632
6625
|
observerRef.current.disconnect();
|
|
@@ -6636,7 +6629,7 @@ function useContainerWidth() {
|
|
|
6636
6629
|
return [ref, width];
|
|
6637
6630
|
}
|
|
6638
6631
|
function useMergedRef(...refs) {
|
|
6639
|
-
return
|
|
6632
|
+
return React37__namespace.useCallback(
|
|
6640
6633
|
(node) => {
|
|
6641
6634
|
for (const ref of refs) {
|
|
6642
6635
|
if (typeof ref === "function") {
|
|
@@ -6650,7 +6643,7 @@ function useMergedRef(...refs) {
|
|
|
6650
6643
|
[refs]
|
|
6651
6644
|
);
|
|
6652
6645
|
}
|
|
6653
|
-
var FlatLinearTrack =
|
|
6646
|
+
var FlatLinearTrack = React37__namespace.memo(function FlatLinearTrack2({
|
|
6654
6647
|
trackHeight,
|
|
6655
6648
|
activeColor,
|
|
6656
6649
|
trackColor,
|
|
@@ -6726,7 +6719,7 @@ var FlatLinearTrack = React36__namespace.memo(function FlatLinearTrack2({
|
|
|
6726
6719
|
}
|
|
6727
6720
|
);
|
|
6728
6721
|
});
|
|
6729
|
-
var WavyLinearTrack =
|
|
6722
|
+
var WavyLinearTrack = React37__namespace.memo(function WavyLinearTrack2({
|
|
6730
6723
|
trackHeight,
|
|
6731
6724
|
svgHeight,
|
|
6732
6725
|
amplitude,
|
|
@@ -6745,13 +6738,13 @@ var WavyLinearTrack = React36__namespace.memo(function WavyLinearTrack2({
|
|
|
6745
6738
|
}) {
|
|
6746
6739
|
const isDeterminate = typeof value === "number";
|
|
6747
6740
|
const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
|
|
6748
|
-
const titleId =
|
|
6741
|
+
const titleId = React37__namespace.useId();
|
|
6749
6742
|
const [containerRef, width] = useContainerWidth();
|
|
6750
|
-
const activePathRef =
|
|
6751
|
-
const trackPathRef =
|
|
6743
|
+
const activePathRef = React37__namespace.useRef(null);
|
|
6744
|
+
const trackPathRef = React37__namespace.useRef(null);
|
|
6752
6745
|
const amplitudeMV = react.useMotionValue(amplitude);
|
|
6753
6746
|
const fractionMV = react.useMotionValue(isDeterminate ? clampedValue / 100 : 1);
|
|
6754
|
-
|
|
6747
|
+
React37__namespace.useEffect(() => {
|
|
6755
6748
|
if (isDeterminate) {
|
|
6756
6749
|
const fraction = clampedValue / 100;
|
|
6757
6750
|
let targetAmp = amplitude;
|
|
@@ -6922,7 +6915,7 @@ var WavyLinearTrack = React36__namespace.memo(function WavyLinearTrack2({
|
|
|
6922
6915
|
}
|
|
6923
6916
|
);
|
|
6924
6917
|
});
|
|
6925
|
-
var LinearProgress =
|
|
6918
|
+
var LinearProgress = React37__namespace.forwardRef(
|
|
6926
6919
|
(_a, ref) => {
|
|
6927
6920
|
var _b = _a, {
|
|
6928
6921
|
value,
|
|
@@ -6963,10 +6956,10 @@ var LinearProgress = React36__namespace.forwardRef(
|
|
|
6963
6956
|
]);
|
|
6964
6957
|
const isDeterminate = value !== void 0;
|
|
6965
6958
|
const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
|
|
6966
|
-
const containerRef =
|
|
6959
|
+
const containerRef = React37__namespace.useRef(null);
|
|
6967
6960
|
const mergedRef = useMergedRef(ref, containerRef);
|
|
6968
|
-
const [isRtl, setIsRtl] =
|
|
6969
|
-
|
|
6961
|
+
const [isRtl, setIsRtl] = React37__namespace.useState(false);
|
|
6962
|
+
React37__namespace.useEffect(() => {
|
|
6970
6963
|
if (containerRef.current) {
|
|
6971
6964
|
const dir = getComputedStyle(containerRef.current).direction;
|
|
6972
6965
|
setIsRtl(dir === "rtl");
|
|
@@ -6974,16 +6967,16 @@ var LinearProgress = React36__namespace.forwardRef(
|
|
|
6974
6967
|
}, []);
|
|
6975
6968
|
const isWavy = shape === "wavy";
|
|
6976
6969
|
const resolvedTrackShape = trackShape != null ? trackShape : shape;
|
|
6977
|
-
const effectiveAmplitude =
|
|
6978
|
-
const svgHeight =
|
|
6970
|
+
const effectiveAmplitude = React37__namespace.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
|
|
6971
|
+
const svgHeight = React37__namespace.useMemo(
|
|
6979
6972
|
() => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
|
|
6980
6973
|
[isWavy, trackHeight, effectiveAmplitude]
|
|
6981
6974
|
);
|
|
6982
|
-
const shouldShowStop =
|
|
6975
|
+
const shouldShowStop = React37__namespace.useMemo(
|
|
6983
6976
|
() => isDeterminate && resolvedTrackShape === "flat" && (showStopIndicator === true || showStopIndicator === "auto" && isDeterminate),
|
|
6984
6977
|
[isDeterminate, resolvedTrackShape, showStopIndicator]
|
|
6985
6978
|
);
|
|
6986
|
-
const stopSize =
|
|
6979
|
+
const stopSize = React37__namespace.useMemo(
|
|
6987
6980
|
() => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
|
|
6988
6981
|
[trackHeight]
|
|
6989
6982
|
);
|
|
@@ -7056,7 +7049,7 @@ var LinearProgress = React36__namespace.forwardRef(
|
|
|
7056
7049
|
}
|
|
7057
7050
|
);
|
|
7058
7051
|
LinearProgress.displayName = "LinearProgress";
|
|
7059
|
-
var ProgressIndicator =
|
|
7052
|
+
var ProgressIndicator = React37__namespace.forwardRef((props, ref) => {
|
|
7060
7053
|
if (props.variant === "circular") {
|
|
7061
7054
|
return /* @__PURE__ */ jsxRuntime.jsx(CircularProgress, __spreadValues({ ref }, props));
|
|
7062
7055
|
}
|
|
@@ -7188,7 +7181,7 @@ function resolveDisabledBgClass(colorStyle) {
|
|
|
7188
7181
|
}
|
|
7189
7182
|
return "disabled:text-m3-on-surface/[0.38]";
|
|
7190
7183
|
}
|
|
7191
|
-
var IconButtonComponent =
|
|
7184
|
+
var IconButtonComponent = React37__namespace.forwardRef(
|
|
7192
7185
|
(_a, ref) => {
|
|
7193
7186
|
var _b = _a, {
|
|
7194
7187
|
className,
|
|
@@ -7230,18 +7223,18 @@ var IconButtonComponent = React36__namespace.forwardRef(
|
|
|
7230
7223
|
var _a2, _b2, _c, _d, _e;
|
|
7231
7224
|
const isToggle = variant === "toggle";
|
|
7232
7225
|
const isSelected = isToggle && !!selected;
|
|
7233
|
-
const resolvedColorClass =
|
|
7226
|
+
const resolvedColorClass = React37__namespace.useMemo(
|
|
7234
7227
|
() => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
|
|
7235
7228
|
[isSelected, colorStyle]
|
|
7236
7229
|
);
|
|
7237
|
-
const outlineWidthClass =
|
|
7230
|
+
const outlineWidthClass = React37__namespace.useMemo(
|
|
7238
7231
|
() => {
|
|
7239
7232
|
var _a3;
|
|
7240
7233
|
return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
|
|
7241
7234
|
},
|
|
7242
7235
|
[colorStyle, isSelected, size]
|
|
7243
7236
|
);
|
|
7244
|
-
const disabledBgClass =
|
|
7237
|
+
const disabledBgClass = React37__namespace.useMemo(
|
|
7245
7238
|
() => resolveDisabledBgClass(colorStyle),
|
|
7246
7239
|
[colorStyle]
|
|
7247
7240
|
);
|
|
@@ -7264,7 +7257,7 @@ var IconButtonComponent = React36__namespace.forwardRef(
|
|
|
7264
7257
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
7265
7258
|
disabled: loading
|
|
7266
7259
|
});
|
|
7267
|
-
const handleClick =
|
|
7260
|
+
const handleClick = React37__namespace.useCallback(
|
|
7268
7261
|
(e) => {
|
|
7269
7262
|
if (loading) {
|
|
7270
7263
|
e.preventDefault();
|
|
@@ -7274,7 +7267,7 @@ var IconButtonComponent = React36__namespace.forwardRef(
|
|
|
7274
7267
|
},
|
|
7275
7268
|
[loading, onClick]
|
|
7276
7269
|
);
|
|
7277
|
-
const handleKeyDown =
|
|
7270
|
+
const handleKeyDown = React37__namespace.useCallback(
|
|
7278
7271
|
(e) => {
|
|
7279
7272
|
if (loading) return;
|
|
7280
7273
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -7330,7 +7323,7 @@ var IconButtonComponent = React36__namespace.forwardRef(
|
|
|
7330
7323
|
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
7331
7324
|
height: isCustomSize ? `${iconSize}px` : void 0
|
|
7332
7325
|
},
|
|
7333
|
-
children: isSelected && selectedIcon ? selectedIcon : asChild ?
|
|
7326
|
+
children: isSelected && selectedIcon ? selectedIcon : asChild ? React37__namespace.Children.only(children).props.children : children
|
|
7334
7327
|
}),
|
|
7335
7328
|
isSelected && selectedIcon ? "selected-content" : "content"
|
|
7336
7329
|
) })
|
|
@@ -7347,7 +7340,7 @@ var IconButtonComponent = React36__namespace.forwardRef(
|
|
|
7347
7340
|
className
|
|
7348
7341
|
);
|
|
7349
7342
|
if (asChild) {
|
|
7350
|
-
const child =
|
|
7343
|
+
const child = React37__namespace.Children.only(children);
|
|
7351
7344
|
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7352
7345
|
reactSlot.Slot,
|
|
7353
7346
|
__spreadProps(__spreadValues({
|
|
@@ -7364,7 +7357,7 @@ var IconButtonComponent = React36__namespace.forwardRef(
|
|
|
7364
7357
|
}),
|
|
7365
7358
|
className: containerClassName
|
|
7366
7359
|
}, restProps), {
|
|
7367
|
-
children:
|
|
7360
|
+
children: React37__namespace.cloneElement(child, { children: innerContent })
|
|
7368
7361
|
})
|
|
7369
7362
|
) });
|
|
7370
7363
|
}
|
|
@@ -7392,7 +7385,7 @@ var IconButtonComponent = React36__namespace.forwardRef(
|
|
|
7392
7385
|
}
|
|
7393
7386
|
);
|
|
7394
7387
|
IconButtonComponent.displayName = "IconButton";
|
|
7395
|
-
var IconButton =
|
|
7388
|
+
var IconButton = React37__namespace.memo(IconButtonComponent);
|
|
7396
7389
|
function TrailingAction({
|
|
7397
7390
|
query,
|
|
7398
7391
|
trailingIcon,
|
|
@@ -7452,7 +7445,7 @@ function SearchViewDocked({
|
|
|
7452
7445
|
activeIndex
|
|
7453
7446
|
}) {
|
|
7454
7447
|
const shouldReduceMotion = react.useReducedMotion();
|
|
7455
|
-
const inputRef =
|
|
7448
|
+
const inputRef = React37__namespace.useRef(null);
|
|
7456
7449
|
useSearchViewFocus(inputRef, active);
|
|
7457
7450
|
const dropdownRef = useClickOutside(() => {
|
|
7458
7451
|
onActiveChange(false);
|
|
@@ -7598,10 +7591,10 @@ function SearchViewFullScreen({
|
|
|
7598
7591
|
activeIndex
|
|
7599
7592
|
}) {
|
|
7600
7593
|
const shouldReduceMotion = react.useReducedMotion();
|
|
7601
|
-
const inputRef =
|
|
7594
|
+
const inputRef = React37__namespace.useRef(null);
|
|
7602
7595
|
useSearchViewFocus(inputRef, active);
|
|
7603
|
-
const [mounted, setMounted] =
|
|
7604
|
-
|
|
7596
|
+
const [mounted, setMounted] = React37__namespace.useState(false);
|
|
7597
|
+
React37__namespace.useEffect(() => {
|
|
7605
7598
|
setMounted(true);
|
|
7606
7599
|
}, []);
|
|
7607
7600
|
const handleFormSubmit = (e) => {
|
|
@@ -7759,10 +7752,10 @@ function SearchComponent({
|
|
|
7759
7752
|
className,
|
|
7760
7753
|
viewClassName
|
|
7761
7754
|
}) {
|
|
7762
|
-
const generatedId =
|
|
7755
|
+
const generatedId = React37__namespace.useId();
|
|
7763
7756
|
const searchId = id != null ? id : generatedId;
|
|
7764
7757
|
const listboxId = `${searchId}-listbox`;
|
|
7765
|
-
const itemCount =
|
|
7758
|
+
const itemCount = React37__namespace.Children.count(children);
|
|
7766
7759
|
const { activeIndex, handleKeyDown } = useSearchKeyboard({
|
|
7767
7760
|
active,
|
|
7768
7761
|
onActiveChange,
|
|
@@ -7821,9 +7814,9 @@ function formatBadgeLabel(children, max) {
|
|
|
7821
7814
|
return "";
|
|
7822
7815
|
}
|
|
7823
7816
|
function detectBadgeHasContent(badge) {
|
|
7824
|
-
return
|
|
7817
|
+
return React37__namespace.isValidElement(badge) && badge.props.children != null;
|
|
7825
7818
|
}
|
|
7826
|
-
var BadgeImpl =
|
|
7819
|
+
var BadgeImpl = React37__namespace.forwardRef(
|
|
7827
7820
|
(_a, ref) => {
|
|
7828
7821
|
var _b = _a, {
|
|
7829
7822
|
children,
|
|
@@ -7877,7 +7870,7 @@ var BadgeImpl = React36__namespace.forwardRef(
|
|
|
7877
7870
|
}
|
|
7878
7871
|
);
|
|
7879
7872
|
BadgeImpl.displayName = "Badge";
|
|
7880
|
-
|
|
7873
|
+
React37__namespace.memo(BadgeImpl);
|
|
7881
7874
|
function BadgedBox({
|
|
7882
7875
|
badge,
|
|
7883
7876
|
children,
|
|
@@ -7898,9 +7891,9 @@ function BadgedBox({
|
|
|
7898
7891
|
)
|
|
7899
7892
|
] });
|
|
7900
7893
|
}
|
|
7901
|
-
var TabsContext =
|
|
7894
|
+
var TabsContext = React37__namespace.createContext(null);
|
|
7902
7895
|
function useTabsContext() {
|
|
7903
|
-
const ctx =
|
|
7896
|
+
const ctx = React37__namespace.useContext(TabsContext);
|
|
7904
7897
|
if (!ctx) {
|
|
7905
7898
|
throw new Error(
|
|
7906
7899
|
"[MD3 Tabs] Component must be used within a <Tabs> root. Ensure <TabsList>, <Tab>, and <TabsContent> are descendants of <Tabs>."
|
|
@@ -7908,7 +7901,7 @@ function useTabsContext() {
|
|
|
7908
7901
|
}
|
|
7909
7902
|
return ctx;
|
|
7910
7903
|
}
|
|
7911
|
-
var TabsComponent =
|
|
7904
|
+
var TabsComponent = React37__namespace.forwardRef(
|
|
7912
7905
|
({
|
|
7913
7906
|
value: controlledValue,
|
|
7914
7907
|
defaultValue = "",
|
|
@@ -7917,35 +7910,35 @@ var TabsComponent = React36__namespace.forwardRef(
|
|
|
7917
7910
|
children,
|
|
7918
7911
|
className
|
|
7919
7912
|
}, ref) => {
|
|
7920
|
-
const [internalValue, setInternalValue] =
|
|
7913
|
+
const [internalValue, setInternalValue] = React37__namespace.useState(defaultValue);
|
|
7921
7914
|
const isControlled = controlledValue !== void 0;
|
|
7922
7915
|
const value = isControlled ? controlledValue : internalValue;
|
|
7923
|
-
const handleValueChange =
|
|
7916
|
+
const handleValueChange = React37__namespace.useCallback(
|
|
7924
7917
|
(newValue) => {
|
|
7925
7918
|
if (!isControlled) setInternalValue(newValue);
|
|
7926
7919
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
7927
7920
|
},
|
|
7928
7921
|
[isControlled, onValueChange]
|
|
7929
7922
|
);
|
|
7930
|
-
const [focusedValue, setFocusedValue] =
|
|
7931
|
-
|
|
7923
|
+
const [focusedValue, setFocusedValue] = React37__namespace.useState(value);
|
|
7924
|
+
React37__namespace.useEffect(() => {
|
|
7932
7925
|
setFocusedValue(value);
|
|
7933
7926
|
}, [value]);
|
|
7934
|
-
const [tabValues, setTabValues] =
|
|
7935
|
-
const registerTab =
|
|
7927
|
+
const [tabValues, setTabValues] = React37__namespace.useState([]);
|
|
7928
|
+
const registerTab = React37__namespace.useCallback((tabValue) => {
|
|
7936
7929
|
setTabValues((prev) => {
|
|
7937
7930
|
if (prev.includes(tabValue)) return prev;
|
|
7938
7931
|
return [...prev, tabValue];
|
|
7939
7932
|
});
|
|
7940
7933
|
}, []);
|
|
7941
|
-
const unregisterTab =
|
|
7934
|
+
const unregisterTab = React37__namespace.useCallback((tabValue) => {
|
|
7942
7935
|
setTabValues((prev) => prev.filter((v) => v !== tabValue));
|
|
7943
7936
|
}, []);
|
|
7944
|
-
const hasAutoSelected =
|
|
7945
|
-
const [disabledValues, setDisabledValues] =
|
|
7937
|
+
const hasAutoSelected = React37__namespace.useRef(false);
|
|
7938
|
+
const [disabledValues, setDisabledValues] = React37__namespace.useState(
|
|
7946
7939
|
/* @__PURE__ */ new Set()
|
|
7947
7940
|
);
|
|
7948
|
-
const markTabDisabled =
|
|
7941
|
+
const markTabDisabled = React37__namespace.useCallback(
|
|
7949
7942
|
(tabValue, disabled) => {
|
|
7950
7943
|
setDisabledValues((prev) => {
|
|
7951
7944
|
const next = new Set(prev);
|
|
@@ -7959,7 +7952,7 @@ var TabsComponent = React36__namespace.forwardRef(
|
|
|
7959
7952
|
},
|
|
7960
7953
|
[]
|
|
7961
7954
|
);
|
|
7962
|
-
|
|
7955
|
+
React37__namespace.useEffect(() => {
|
|
7963
7956
|
if (isControlled || hasAutoSelected.current || tabValues.length === 0) {
|
|
7964
7957
|
return;
|
|
7965
7958
|
}
|
|
@@ -7974,9 +7967,9 @@ var TabsComponent = React36__namespace.forwardRef(
|
|
|
7974
7967
|
setFocusedValue(firstEnabled);
|
|
7975
7968
|
}
|
|
7976
7969
|
}, [tabValues, disabledValues, isControlled, value]);
|
|
7977
|
-
const id =
|
|
7970
|
+
const id = React37__namespace.useId();
|
|
7978
7971
|
const layoutGroupId = `tabs-${id}`;
|
|
7979
|
-
const contextValue =
|
|
7972
|
+
const contextValue = React37__namespace.useMemo(
|
|
7980
7973
|
() => ({
|
|
7981
7974
|
value,
|
|
7982
7975
|
onValueChange: handleValueChange,
|
|
@@ -8007,12 +8000,12 @@ var TabsComponent = React36__namespace.forwardRef(
|
|
|
8007
8000
|
}
|
|
8008
8001
|
);
|
|
8009
8002
|
TabsComponent.displayName = "Tabs";
|
|
8010
|
-
var Tabs =
|
|
8011
|
-
var TabsListContext =
|
|
8003
|
+
var Tabs = React37__namespace.memo(TabsComponent);
|
|
8004
|
+
var TabsListContext = React37__namespace.createContext(
|
|
8012
8005
|
null
|
|
8013
8006
|
);
|
|
8014
8007
|
function useTabsListContext() {
|
|
8015
|
-
const ctx =
|
|
8008
|
+
const ctx = React37__namespace.useContext(TabsListContext);
|
|
8016
8009
|
return ctx != null ? ctx : { variant: "primary", scrollable: false };
|
|
8017
8010
|
}
|
|
8018
8011
|
|
|
@@ -8096,7 +8089,7 @@ var TABS_CONTENT_TRANSITION = {
|
|
|
8096
8089
|
ease: "easeInOut"
|
|
8097
8090
|
};
|
|
8098
8091
|
var INDICATOR_MIN_WIDTH = 24;
|
|
8099
|
-
var TabComponent =
|
|
8092
|
+
var TabComponent = React37__namespace.forwardRef(
|
|
8100
8093
|
({
|
|
8101
8094
|
value,
|
|
8102
8095
|
icon,
|
|
@@ -8126,9 +8119,9 @@ var TabComponent = React36__namespace.forwardRef(
|
|
|
8126
8119
|
const isFocused = focusedValue === value;
|
|
8127
8120
|
const hasIcon = icon != null;
|
|
8128
8121
|
const isStackedIcon = hasIcon && !inlineIcon;
|
|
8129
|
-
const buttonRef =
|
|
8130
|
-
const isFirstMount =
|
|
8131
|
-
const mergedRef =
|
|
8122
|
+
const buttonRef = React37__namespace.useRef(null);
|
|
8123
|
+
const isFirstMount = React37__namespace.useRef(true);
|
|
8124
|
+
const mergedRef = React37__namespace.useCallback(
|
|
8132
8125
|
(node) => {
|
|
8133
8126
|
buttonRef.current = node;
|
|
8134
8127
|
if (typeof ref === "function") ref(node);
|
|
@@ -8136,15 +8129,15 @@ var TabComponent = React36__namespace.forwardRef(
|
|
|
8136
8129
|
},
|
|
8137
8130
|
[ref]
|
|
8138
8131
|
);
|
|
8139
|
-
|
|
8132
|
+
React37__namespace.useEffect(() => {
|
|
8140
8133
|
registerTab(value);
|
|
8141
8134
|
return () => unregisterTab(value);
|
|
8142
8135
|
}, [value, registerTab, unregisterTab]);
|
|
8143
|
-
|
|
8136
|
+
React37__namespace.useEffect(() => {
|
|
8144
8137
|
markTabDisabled(value, disabled);
|
|
8145
8138
|
return () => markTabDisabled(value, false);
|
|
8146
8139
|
}, [value, disabled, markTabDisabled]);
|
|
8147
|
-
const handleKeyDown =
|
|
8140
|
+
const handleKeyDown = React37__namespace.useCallback(
|
|
8148
8141
|
(e) => {
|
|
8149
8142
|
const isRtl = buttonRef.current ? getComputedStyle(buttonRef.current).direction === "rtl" : false;
|
|
8150
8143
|
const enabledValues = tabValues.filter((v) => !disabledValues.has(v));
|
|
@@ -8198,7 +8191,7 @@ var TabComponent = React36__namespace.forwardRef(
|
|
|
8198
8191
|
autoActivate
|
|
8199
8192
|
]
|
|
8200
8193
|
);
|
|
8201
|
-
|
|
8194
|
+
React37__namespace.useEffect(() => {
|
|
8202
8195
|
if (isFirstMount.current) {
|
|
8203
8196
|
isFirstMount.current = false;
|
|
8204
8197
|
return;
|
|
@@ -8207,7 +8200,7 @@ var TabComponent = React36__namespace.forwardRef(
|
|
|
8207
8200
|
buttonRef.current.focus({ preventScroll: true });
|
|
8208
8201
|
}
|
|
8209
8202
|
}, [isFocused]);
|
|
8210
|
-
|
|
8203
|
+
React37__namespace.useEffect(() => {
|
|
8211
8204
|
if (!isActive || !scrollable || !buttonRef.current) return;
|
|
8212
8205
|
const btn = buttonRef.current;
|
|
8213
8206
|
let container = btn.parentElement;
|
|
@@ -8344,8 +8337,8 @@ var TabComponent = React36__namespace.forwardRef(
|
|
|
8344
8337
|
}
|
|
8345
8338
|
);
|
|
8346
8339
|
TabComponent.displayName = "Tab";
|
|
8347
|
-
var Tab =
|
|
8348
|
-
var TabsContentComponent =
|
|
8340
|
+
var Tab = React37__namespace.memo(TabComponent);
|
|
8341
|
+
var TabsContentComponent = React37__namespace.forwardRef(
|
|
8349
8342
|
({ value, className, children }, ref) => {
|
|
8350
8343
|
var _a;
|
|
8351
8344
|
const { value: selectedValue, layoutGroupId } = useTabsContext();
|
|
@@ -8379,8 +8372,8 @@ var TabsContentComponent = React36__namespace.forwardRef(
|
|
|
8379
8372
|
}
|
|
8380
8373
|
);
|
|
8381
8374
|
TabsContentComponent.displayName = "TabsContent";
|
|
8382
|
-
var TabsContent =
|
|
8383
|
-
var TabsListComponent =
|
|
8375
|
+
var TabsContent = React37__namespace.memo(TabsContentComponent);
|
|
8376
|
+
var TabsListComponent = React37__namespace.forwardRef(
|
|
8384
8377
|
({
|
|
8385
8378
|
variant,
|
|
8386
8379
|
scrollable = false,
|
|
@@ -8391,12 +8384,12 @@ var TabsListComponent = React36__namespace.forwardRef(
|
|
|
8391
8384
|
}, ref) => {
|
|
8392
8385
|
const { layoutGroupId, value, setFocusedValue } = useTabsContext();
|
|
8393
8386
|
const listLayoutId = `${layoutGroupId}-list`;
|
|
8394
|
-
const listContextValue =
|
|
8387
|
+
const listContextValue = React37__namespace.useMemo(
|
|
8395
8388
|
() => ({ variant, scrollable }),
|
|
8396
8389
|
[variant, scrollable]
|
|
8397
8390
|
);
|
|
8398
8391
|
const bgColor = backgroundColor != null ? backgroundColor : "var(--md-sys-color-surface)";
|
|
8399
|
-
const handleBlur =
|
|
8392
|
+
const handleBlur = React37__namespace.useCallback(
|
|
8400
8393
|
(e) => {
|
|
8401
8394
|
const listEl = e.currentTarget;
|
|
8402
8395
|
if (listEl.contains(e.relatedTarget)) return;
|
|
@@ -8445,7 +8438,7 @@ var TabsListComponent = React36__namespace.forwardRef(
|
|
|
8445
8438
|
}
|
|
8446
8439
|
);
|
|
8447
8440
|
TabsListComponent.displayName = "TabsList";
|
|
8448
|
-
var TabsList =
|
|
8441
|
+
var TabsList = React37__namespace.memo(TabsListComponent);
|
|
8449
8442
|
|
|
8450
8443
|
// src/ui/toolbar/toolbar-colors.ts
|
|
8451
8444
|
var standardFloatingToolbarColors = {
|
|
@@ -8501,13 +8494,13 @@ function getToolbarColors(variant = "standard", customColors) {
|
|
|
8501
8494
|
return standardFloatingToolbarColors;
|
|
8502
8495
|
}
|
|
8503
8496
|
}
|
|
8504
|
-
var ToolbarContext =
|
|
8497
|
+
var ToolbarContext = React37__namespace.createContext(
|
|
8505
8498
|
null
|
|
8506
8499
|
);
|
|
8507
8500
|
function useToolbarContext() {
|
|
8508
|
-
return
|
|
8501
|
+
return React37__namespace.useContext(ToolbarContext);
|
|
8509
8502
|
}
|
|
8510
|
-
var BottomDockedToolbar =
|
|
8503
|
+
var BottomDockedToolbar = React37__namespace.forwardRef(
|
|
8511
8504
|
(_a, ref) => {
|
|
8512
8505
|
var _b = _a, {
|
|
8513
8506
|
variant = "standard",
|
|
@@ -8540,8 +8533,8 @@ var BottomDockedToolbar = React36__namespace.forwardRef(
|
|
|
8540
8533
|
const { scrollY } = react.useScroll(
|
|
8541
8534
|
scrollContainerRef ? { container: scrollContainerRef } : void 0
|
|
8542
8535
|
);
|
|
8543
|
-
const [isHidden, setIsHidden] =
|
|
8544
|
-
const lastScrollY =
|
|
8536
|
+
const [isHidden, setIsHidden] = React37__namespace.useState(false);
|
|
8537
|
+
const lastScrollY = React37__namespace.useRef(0);
|
|
8545
8538
|
react.useMotionValueEvent(scrollY, "change", (latest) => {
|
|
8546
8539
|
if (!hideOnScroll) return;
|
|
8547
8540
|
const diff = latest - lastScrollY.current;
|
|
@@ -8700,15 +8693,15 @@ function buildSlotVariants(xHidden, yHidden, isHorizontal) {
|
|
|
8700
8693
|
};
|
|
8701
8694
|
}
|
|
8702
8695
|
function applyItemClassName(nodes, itemClassName) {
|
|
8703
|
-
return
|
|
8704
|
-
if (!
|
|
8696
|
+
return React37__namespace.Children.map(nodes, (child) => {
|
|
8697
|
+
if (!React37__namespace.isValidElement(child)) return child;
|
|
8705
8698
|
const element = child;
|
|
8706
|
-
return
|
|
8699
|
+
return React37__namespace.cloneElement(element, {
|
|
8707
8700
|
className: cn(element.props.className, itemClassName)
|
|
8708
8701
|
});
|
|
8709
8702
|
});
|
|
8710
8703
|
}
|
|
8711
|
-
var FloatingToolbarBase =
|
|
8704
|
+
var FloatingToolbarBase = React37__namespace.forwardRef(
|
|
8712
8705
|
(_a, ref) => {
|
|
8713
8706
|
var _b = _a, {
|
|
8714
8707
|
expanded,
|
|
@@ -8880,11 +8873,11 @@ var FloatingToolbarBase = React36__namespace.forwardRef(
|
|
|
8880
8873
|
}
|
|
8881
8874
|
);
|
|
8882
8875
|
FloatingToolbarBase.displayName = "FloatingToolbarBase";
|
|
8883
|
-
var HorizontalFloatingToolbar =
|
|
8876
|
+
var HorizontalFloatingToolbar = React37__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(FloatingToolbarBase, __spreadValues({ ref, orientation: "horizontal" }, props)));
|
|
8884
8877
|
HorizontalFloatingToolbar.displayName = "HorizontalFloatingToolbar";
|
|
8885
|
-
var VerticalFloatingToolbar =
|
|
8878
|
+
var VerticalFloatingToolbar = React37__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(FloatingToolbarBase, __spreadValues({ ref, orientation: "vertical" }, props)));
|
|
8886
8879
|
VerticalFloatingToolbar.displayName = "VerticalFloatingToolbar";
|
|
8887
|
-
var FloatingToolbarWithFabBase =
|
|
8880
|
+
var FloatingToolbarWithFabBase = React37__namespace.forwardRef(
|
|
8888
8881
|
(_a, ref) => {
|
|
8889
8882
|
var _b = _a, {
|
|
8890
8883
|
expanded,
|
|
@@ -9012,9 +9005,9 @@ var FloatingToolbarWithFabBase = React36__namespace.forwardRef(
|
|
|
9012
9005
|
}
|
|
9013
9006
|
);
|
|
9014
9007
|
FloatingToolbarWithFabBase.displayName = "FloatingToolbarWithFabBase";
|
|
9015
|
-
var HorizontalFloatingToolbarWithFab =
|
|
9008
|
+
var HorizontalFloatingToolbarWithFab = React37__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(FloatingToolbarWithFabBase, __spreadValues({ ref, orientation: "horizontal" }, props)));
|
|
9016
9009
|
HorizontalFloatingToolbarWithFab.displayName = "HorizontalFloatingToolbarWithFab";
|
|
9017
|
-
var VerticalFloatingToolbarWithFab =
|
|
9010
|
+
var VerticalFloatingToolbarWithFab = React37__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(FloatingToolbarWithFabBase, __spreadValues({ ref, orientation: "vertical" }, props)));
|
|
9018
9011
|
VerticalFloatingToolbarWithFab.displayName = "VerticalFloatingToolbarWithFab";
|
|
9019
9012
|
var ToolbarDivider = ({
|
|
9020
9013
|
orientation: propsOrientation,
|
|
@@ -9050,7 +9043,7 @@ var VARIANT_TO_COLOR_STYLE = {
|
|
|
9050
9043
|
tonal: "tonal",
|
|
9051
9044
|
filled: "filled"
|
|
9052
9045
|
};
|
|
9053
|
-
var ToolbarIconButton =
|
|
9046
|
+
var ToolbarIconButton = React37__namespace.forwardRef(
|
|
9054
9047
|
(_a, ref) => {
|
|
9055
9048
|
var _b = _a, {
|
|
9056
9049
|
emphasis = "standard",
|
|
@@ -9112,13 +9105,13 @@ function useFloatingToolbarScrollBehavior(options = {}) {
|
|
|
9112
9105
|
expandThreshold = 10,
|
|
9113
9106
|
scrollContainerRef
|
|
9114
9107
|
} = options;
|
|
9115
|
-
const [isExpanded, setIsExpanded] =
|
|
9116
|
-
const [offset, setOffset] =
|
|
9108
|
+
const [isExpanded, setIsExpanded] = React37.useState(true);
|
|
9109
|
+
const [offset, setOffset] = React37.useState(0);
|
|
9117
9110
|
const { scrollY } = react.useScroll({
|
|
9118
9111
|
container: scrollContainerRef
|
|
9119
9112
|
});
|
|
9120
|
-
const lastScrollY =
|
|
9121
|
-
const accumulatedScroll =
|
|
9113
|
+
const lastScrollY = React37.useRef(0);
|
|
9114
|
+
const accumulatedScroll = React37.useRef(0);
|
|
9122
9115
|
react.useMotionValueEvent(scrollY, "change", (currentScrollY) => {
|
|
9123
9116
|
const deltaY = currentScrollY - lastScrollY.current;
|
|
9124
9117
|
if (currentScrollY < 0) return;
|
|
@@ -9140,7 +9133,7 @@ function useFloatingToolbarScrollBehavior(options = {}) {
|
|
|
9140
9133
|
}
|
|
9141
9134
|
}
|
|
9142
9135
|
});
|
|
9143
|
-
|
|
9136
|
+
React37.useEffect(() => {
|
|
9144
9137
|
if (typeof window !== "undefined") {
|
|
9145
9138
|
const matchMedia = window.matchMedia("(forced-colors: active)");
|
|
9146
9139
|
if (matchMedia.matches) {
|
|
@@ -9222,7 +9215,7 @@ var MOTION_PROP_KEYS = [
|
|
|
9222
9215
|
"layoutId",
|
|
9223
9216
|
"onLayoutAnimationComplete"
|
|
9224
9217
|
];
|
|
9225
|
-
var ToolbarToggleButton =
|
|
9218
|
+
var ToolbarToggleButton = React37__namespace.forwardRef(
|
|
9226
9219
|
(_a, ref) => {
|
|
9227
9220
|
var _b = _a, {
|
|
9228
9221
|
emphasis = "standard",
|
|
@@ -9256,7 +9249,7 @@ var ToolbarToggleButton = React36__namespace.forwardRef(
|
|
|
9256
9249
|
"onPointerLeave"
|
|
9257
9250
|
]);
|
|
9258
9251
|
const context = useToolbarContext();
|
|
9259
|
-
const [isPressed, setIsPressed] =
|
|
9252
|
+
const [isPressed, setIsPressed] = React37__namespace.useState(false);
|
|
9260
9253
|
const {
|
|
9261
9254
|
ripples,
|
|
9262
9255
|
onPointerDown: handleRipplePointerDown,
|
|
@@ -9264,7 +9257,7 @@ var ToolbarToggleButton = React36__namespace.forwardRef(
|
|
|
9264
9257
|
} = useRippleState({
|
|
9265
9258
|
disabled: Boolean(disabled) || !ripple
|
|
9266
9259
|
});
|
|
9267
|
-
const handlePointerDown =
|
|
9260
|
+
const handlePointerDown = React37__namespace.useCallback(
|
|
9268
9261
|
(e) => {
|
|
9269
9262
|
setIsPressed(true);
|
|
9270
9263
|
if (!disabled && ripple) {
|
|
@@ -9274,14 +9267,14 @@ var ToolbarToggleButton = React36__namespace.forwardRef(
|
|
|
9274
9267
|
},
|
|
9275
9268
|
[disabled, ripple, handleRipplePointerDown, onPointerDownProp]
|
|
9276
9269
|
);
|
|
9277
|
-
const handlePointerUp =
|
|
9270
|
+
const handlePointerUp = React37__namespace.useCallback(
|
|
9278
9271
|
(e) => {
|
|
9279
9272
|
setIsPressed(false);
|
|
9280
9273
|
onPointerUpProp == null ? void 0 : onPointerUpProp(e);
|
|
9281
9274
|
},
|
|
9282
9275
|
[onPointerUpProp]
|
|
9283
9276
|
);
|
|
9284
|
-
const handlePointerLeave =
|
|
9277
|
+
const handlePointerLeave = React37__namespace.useCallback(
|
|
9285
9278
|
(e) => {
|
|
9286
9279
|
setIsPressed(false);
|
|
9287
9280
|
onPointerLeaveProp == null ? void 0 : onPointerLeaveProp(e);
|
|
@@ -9300,14 +9293,14 @@ var ToolbarToggleButton = React36__namespace.forwardRef(
|
|
|
9300
9293
|
context == null ? void 0 : context.itemClassName,
|
|
9301
9294
|
className
|
|
9302
9295
|
);
|
|
9303
|
-
const animateConfig =
|
|
9296
|
+
const animateConfig = React37__namespace.useMemo(
|
|
9304
9297
|
() => ({
|
|
9305
9298
|
scaleX: pressExpand && isPressed ? 1 + pressExpandRatio : 1,
|
|
9306
9299
|
borderRadius: isPressed ? ToolbarToggleButtonRadiusTokens.pressedRadius : ToolbarToggleButtonRadiusTokens.pillRadius
|
|
9307
9300
|
}),
|
|
9308
9301
|
[pressExpand, pressExpandRatio, isPressed]
|
|
9309
9302
|
);
|
|
9310
|
-
const transitionConfig =
|
|
9303
|
+
const transitionConfig = React37__namespace.useMemo(
|
|
9311
9304
|
() => ({
|
|
9312
9305
|
scaleX: FAST_SPATIAL_SPRING,
|
|
9313
9306
|
borderRadius: BUTTON_RADIUS_SPRING
|
|
@@ -9329,7 +9322,7 @@ var ToolbarToggleButton = React36__namespace.forwardRef(
|
|
|
9329
9322
|
children && (typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsxRuntime.jsx("span", { children }) : children)
|
|
9330
9323
|
] });
|
|
9331
9324
|
if (asChild) {
|
|
9332
|
-
const child =
|
|
9325
|
+
const child = React37__namespace.Children.only(children);
|
|
9333
9326
|
const childContent = child.props.children;
|
|
9334
9327
|
const innerChildContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9335
9328
|
ripple && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9368,7 +9361,7 @@ var ToolbarToggleButton = React36__namespace.forwardRef(
|
|
|
9368
9361
|
onPointerUp: handlePointerUp,
|
|
9369
9362
|
onPointerLeave: handlePointerLeave
|
|
9370
9363
|
}, strippedProps), {
|
|
9371
|
-
children:
|
|
9364
|
+
children: React37__namespace.cloneElement(child, { children: innerChildContent })
|
|
9372
9365
|
})
|
|
9373
9366
|
) });
|
|
9374
9367
|
}
|