@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.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
2
|
+
import * as React37 from 'react';
|
|
3
3
|
import { useRef, useEffect, useState } from 'react';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -305,9 +305,10 @@ var SUBMENU_CONTAINER_VARIANTS = {
|
|
|
305
305
|
transition: FAST_EFFECTS_TRANSITION
|
|
306
306
|
}
|
|
307
307
|
};
|
|
308
|
-
var MenuContext =
|
|
308
|
+
var MenuContext = React37.createContext({
|
|
309
309
|
variant: "baseline",
|
|
310
310
|
colorVariant: "standard",
|
|
311
|
+
density: 0,
|
|
311
312
|
menuPrimitive: "dropdown",
|
|
312
313
|
open: false,
|
|
313
314
|
onOpenChange: () => {
|
|
@@ -316,29 +317,46 @@ var MenuContext = React36.createContext({
|
|
|
316
317
|
function MenuProvider({
|
|
317
318
|
variant = "baseline",
|
|
318
319
|
colorVariant = "standard",
|
|
320
|
+
density = 0,
|
|
319
321
|
menuPrimitive = "dropdown",
|
|
320
322
|
open,
|
|
321
323
|
onOpenChange,
|
|
322
324
|
children
|
|
323
325
|
}) {
|
|
324
|
-
const value =
|
|
325
|
-
() => ({
|
|
326
|
-
|
|
326
|
+
const value = React37.useMemo(
|
|
327
|
+
() => ({
|
|
328
|
+
variant,
|
|
329
|
+
colorVariant,
|
|
330
|
+
density,
|
|
331
|
+
menuPrimitive,
|
|
332
|
+
open,
|
|
333
|
+
onOpenChange
|
|
334
|
+
}),
|
|
335
|
+
[variant, colorVariant, density, menuPrimitive, open, onOpenChange]
|
|
327
336
|
);
|
|
328
337
|
return /* @__PURE__ */ jsx(MenuContext.Provider, { value, children });
|
|
329
338
|
}
|
|
330
339
|
function useMenuContext() {
|
|
331
|
-
const ctx =
|
|
332
|
-
return
|
|
333
|
-
() =>
|
|
334
|
-
isStatic
|
|
335
|
-
|
|
340
|
+
const ctx = React37.useContext(MenuContext);
|
|
341
|
+
return React37.useMemo(
|
|
342
|
+
() => Object.assign(ctx, {
|
|
343
|
+
get isStatic() {
|
|
344
|
+
return ctx.menuPrimitive === "static";
|
|
345
|
+
},
|
|
346
|
+
get menuVariant() {
|
|
347
|
+
return ctx.variant;
|
|
348
|
+
}
|
|
336
349
|
}),
|
|
337
350
|
[ctx]
|
|
338
351
|
);
|
|
339
352
|
}
|
|
340
353
|
var MENU_BASELINE_ITEM_HORIZONTAL_PADDING = "px-3";
|
|
341
354
|
var MENU_ITEM_MIN_HEIGHT = "min-h-11";
|
|
355
|
+
var DENSITY_MIN_HEIGHT = {
|
|
356
|
+
0: "min-h-12",
|
|
357
|
+
"-2": "min-h-10",
|
|
358
|
+
"-4": "min-h-8"
|
|
359
|
+
};
|
|
342
360
|
var MENU_MIN_WIDTH = "min-w-28";
|
|
343
361
|
var MENU_MAX_WIDTH = "max-w-70";
|
|
344
362
|
var MENU_GROUP_GAP = "gap-0.5";
|
|
@@ -371,7 +389,7 @@ var ITEM_SHAPE_CLASSES = {
|
|
|
371
389
|
leading: "rounded-t-[12px] rounded-b-[4px]",
|
|
372
390
|
middle: "rounded-[4px]",
|
|
373
391
|
trailing: "rounded-t-[4px] rounded-b-[12px]",
|
|
374
|
-
standalone: "rounded-[
|
|
392
|
+
standalone: "rounded-[12px]",
|
|
375
393
|
selected: "rounded-[12px]"
|
|
376
394
|
};
|
|
377
395
|
var STANDARD_COLORS = {
|
|
@@ -388,9 +406,9 @@ var STANDARD_COLORS = {
|
|
|
388
406
|
/** Trailing icon color (StandardMenuTokens.ItemTrailingIconColor) */
|
|
389
407
|
trailingIconColor: "text-m3-on-surface-variant",
|
|
390
408
|
/** Hover state layer (OnSurface @ 8% opacity) */
|
|
391
|
-
hoverLayer: "hover:bg-m3-on-surface/8",
|
|
409
|
+
hoverLayer: "hover:bg-m3-on-surface/8 data-[highlighted]:bg-m3-on-surface/8",
|
|
392
410
|
/** Focus state layer (OnSurface @ 12% opacity) */
|
|
393
|
-
focusLayer: "focus:bg-m3-on-surface/12",
|
|
411
|
+
focusLayer: "focus:bg-m3-on-surface/12 data-[highlighted]:bg-m3-on-surface/8",
|
|
394
412
|
/** Selected item background (StandardMenuTokens.ItemSelectedContainerColor) */
|
|
395
413
|
selectedBg: "bg-m3-tertiary-container",
|
|
396
414
|
/** Selected item text (StandardMenuTokens.ItemSelectedLabelTextColor) */
|
|
@@ -406,8 +424,8 @@ var BASELINE_COLORS = {
|
|
|
406
424
|
iconColor: "text-m3-on-surface-variant",
|
|
407
425
|
supportingTextColor: "text-m3-on-surface-variant",
|
|
408
426
|
trailingIconColor: "text-m3-on-surface-variant",
|
|
409
|
-
hoverLayer: "hover:bg-m3-on-surface/8",
|
|
410
|
-
focusLayer: "focus:bg-m3-on-surface/12",
|
|
427
|
+
hoverLayer: "hover:bg-m3-on-surface/8 data-[highlighted]:bg-m3-on-surface/8",
|
|
428
|
+
focusLayer: "focus:bg-m3-on-surface/12 data-[highlighted]:bg-m3-on-surface/8",
|
|
411
429
|
selectedBg: "bg-m3-secondary-container",
|
|
412
430
|
selectedText: "text-m3-on-secondary-container",
|
|
413
431
|
selectedIcon: "text-m3-on-secondary-container"};
|
|
@@ -425,9 +443,9 @@ var VIBRANT_COLORS = {
|
|
|
425
443
|
/** Trailing icon color (VibrantMenuTokens.ItemTrailingIconColor) */
|
|
426
444
|
trailingIconColor: "text-m3-on-tertiary-container",
|
|
427
445
|
/** Hover state layer (OnTertiaryContainer @ 8% opacity) */
|
|
428
|
-
hoverLayer: "hover:bg-m3-on-tertiary-container/8",
|
|
446
|
+
hoverLayer: "hover:bg-m3-on-tertiary-container/8 data-[highlighted]:bg-m3-on-tertiary-container/8",
|
|
429
447
|
/** Focus state layer (OnTertiaryContainer @ 12% opacity) */
|
|
430
|
-
focusLayer: "focus:bg-m3-on-tertiary-container/12",
|
|
448
|
+
focusLayer: "focus:bg-m3-on-tertiary-container/12 data-[highlighted]:bg-m3-on-tertiary-container/8",
|
|
431
449
|
/** Selected item background (VibrantMenuTokens.ItemSelectedContainerColor = Tertiary) */
|
|
432
450
|
selectedBg: "bg-m3-tertiary",
|
|
433
451
|
/** Selected item text (VibrantMenuTokens.ItemSelectedLabelTextColor = OnTertiary) */
|
|
@@ -439,12 +457,29 @@ var VIBRANT_COLORS = {
|
|
|
439
457
|
};
|
|
440
458
|
var DIVIDER_PADDING = "mx-3 my-0.5";
|
|
441
459
|
var DIVIDER_COLOR = "bg-m3-outline-variant";
|
|
460
|
+
function flattenChildren(nodes) {
|
|
461
|
+
return React37.Children.toArray(nodes).reduce(
|
|
462
|
+
(acc, child) => {
|
|
463
|
+
if (!React37.isValidElement(child)) return acc;
|
|
464
|
+
if (child.type === React37.Fragment) {
|
|
465
|
+
return acc.concat(
|
|
466
|
+
flattenChildren(
|
|
467
|
+
child.props.children
|
|
468
|
+
)
|
|
469
|
+
);
|
|
470
|
+
}
|
|
471
|
+
acc.push(child);
|
|
472
|
+
return acc;
|
|
473
|
+
},
|
|
474
|
+
[]
|
|
475
|
+
);
|
|
476
|
+
}
|
|
442
477
|
function ContextMenu({
|
|
443
478
|
children,
|
|
444
479
|
variant = "baseline",
|
|
445
480
|
colorVariant = "standard"
|
|
446
481
|
}) {
|
|
447
|
-
const [open, setOpen] =
|
|
482
|
+
const [open, setOpen] = React37.useState(false);
|
|
448
483
|
return /* @__PURE__ */ jsx(
|
|
449
484
|
MenuProvider,
|
|
450
485
|
{
|
|
@@ -458,12 +493,12 @@ function ContextMenu({
|
|
|
458
493
|
);
|
|
459
494
|
}
|
|
460
495
|
ContextMenu.displayName = "ContextMenu";
|
|
461
|
-
var ContextMenuTrigger =
|
|
496
|
+
var ContextMenuTrigger = React37.forwardRef((_a, ref) => {
|
|
462
497
|
var _b = _a, { children, asChild = true } = _b, props = __objRest(_b, ["children", "asChild"]);
|
|
463
498
|
return /* @__PURE__ */ jsx(RxContextMenu.Trigger, __spreadProps(__spreadValues({ ref, asChild }, props), { children }));
|
|
464
499
|
});
|
|
465
500
|
ContextMenuTrigger.displayName = "ContextMenuTrigger";
|
|
466
|
-
var ContextMenuContent =
|
|
501
|
+
var ContextMenuContent = React37.forwardRef(
|
|
467
502
|
(_a, ref) => {
|
|
468
503
|
var _b = _a, {
|
|
469
504
|
children,
|
|
@@ -486,71 +521,51 @@ var ContextMenuContent = React36.forwardRef(
|
|
|
486
521
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
487
522
|
const colors = variant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
488
523
|
const isExpressiveGap = variant === "expressive" && separatorStyle === "gap";
|
|
489
|
-
const containerClassName =
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
524
|
+
const containerClassName = React37.useMemo(
|
|
525
|
+
() => variant === "expressive" ? cn(
|
|
526
|
+
"z-50 flex flex-col w-full",
|
|
527
|
+
MENU_MIN_WIDTH,
|
|
528
|
+
MENU_MAX_WIDTH,
|
|
529
|
+
isExpressiveGap ? MENU_GROUP_GAP : "",
|
|
530
|
+
isExpressiveGap ? "bg-transparent" : colors.containerBg,
|
|
531
|
+
isExpressiveGap ? "" : "rounded-2xl",
|
|
532
|
+
isExpressiveGap ? "" : "elevation-2",
|
|
533
|
+
hasOverflow || isExpressiveGap ? "overflow-visible" : "overflow-hidden",
|
|
534
|
+
"outline-none",
|
|
535
|
+
className
|
|
536
|
+
) : cn(
|
|
537
|
+
"z-50 flex flex-col",
|
|
538
|
+
MENU_MIN_WIDTH,
|
|
539
|
+
MENU_MAX_WIDTH,
|
|
540
|
+
MENU_POPUP_PADDING_Y,
|
|
541
|
+
MENU_GROUP_GAP,
|
|
542
|
+
colors.containerBg,
|
|
543
|
+
MENU_CONTAINER_SHAPE,
|
|
544
|
+
"elevation-2",
|
|
545
|
+
hasOverflow ? "overflow-visible" : "overflow-hidden",
|
|
546
|
+
"outline-none",
|
|
547
|
+
className
|
|
548
|
+
),
|
|
549
|
+
[variant, isExpressiveGap, hasOverflow, className, colors.containerBg]
|
|
512
550
|
);
|
|
513
|
-
const
|
|
514
|
-
|
|
515
|
-
(acc, child) => {
|
|
516
|
-
if (React36.isValidElement(child)) {
|
|
517
|
-
if (child.type === React36.Fragment) {
|
|
518
|
-
return acc.concat(
|
|
519
|
-
flattenChildren(
|
|
520
|
-
child.props.children
|
|
521
|
-
)
|
|
522
|
-
);
|
|
523
|
-
}
|
|
524
|
-
acc.push(child);
|
|
525
|
-
}
|
|
526
|
-
return acc;
|
|
527
|
-
},
|
|
528
|
-
[]
|
|
529
|
-
);
|
|
530
|
-
};
|
|
531
|
-
let renderedChildren = children;
|
|
532
|
-
if (variant === "expressive") {
|
|
551
|
+
const renderedChildren = React37.useMemo(() => {
|
|
552
|
+
if (variant !== "expressive") return children;
|
|
533
553
|
const validChildren = flattenChildren(children);
|
|
534
554
|
const groupCount = validChildren.length;
|
|
535
|
-
const
|
|
536
|
-
(child, i) =>
|
|
555
|
+
const enhanced = validChildren.map(
|
|
556
|
+
(child, i) => React37.cloneElement(
|
|
537
557
|
child,
|
|
538
|
-
{
|
|
539
|
-
index: i,
|
|
540
|
-
count: groupCount,
|
|
541
|
-
isGapVariant: isExpressiveGap
|
|
542
|
-
}
|
|
558
|
+
{ index: i, count: groupCount, isGapVariant: isExpressiveGap }
|
|
543
559
|
)
|
|
544
560
|
);
|
|
545
|
-
|
|
561
|
+
if (separatorStyle !== "divider") return enhanced;
|
|
562
|
+
return enhanced.reduce((acc, child, i) => {
|
|
546
563
|
if (i > 0) {
|
|
547
564
|
acc.push(
|
|
548
565
|
/* @__PURE__ */ jsx(
|
|
549
566
|
"hr",
|
|
550
567
|
{
|
|
551
|
-
className: cn(
|
|
552
|
-
"mx-3 my-0.5 h-px border-0 bg-m3-outline-variant"
|
|
553
|
-
)
|
|
568
|
+
className: cn("mx-3 my-0.5 h-px border-0 bg-m3-outline-variant")
|
|
554
569
|
},
|
|
555
570
|
`divider-${child.key || i}`
|
|
556
571
|
)
|
|
@@ -558,8 +573,8 @@ var ContextMenuContent = React36.forwardRef(
|
|
|
558
573
|
}
|
|
559
574
|
acc.push(child);
|
|
560
575
|
return acc;
|
|
561
|
-
}, [])
|
|
562
|
-
}
|
|
576
|
+
}, []);
|
|
577
|
+
}, [children, variant, isExpressiveGap, separatorStyle]);
|
|
563
578
|
return /* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsx(RxContextMenu.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(RxContextMenu.Content, __spreadProps(__spreadValues({ ref, asChild: true, forceMount: true }, props), { children: /* @__PURE__ */ jsx(
|
|
564
579
|
m.div,
|
|
565
580
|
{
|
|
@@ -583,6 +598,7 @@ function Menu(_a) {
|
|
|
583
598
|
variant,
|
|
584
599
|
menuVariant,
|
|
585
600
|
colorVariant = "standard",
|
|
601
|
+
density = 0,
|
|
586
602
|
open: controlledOpen,
|
|
587
603
|
onOpenChange: controlledOnOpenChange,
|
|
588
604
|
defaultOpen
|
|
@@ -591,18 +607,19 @@ function Menu(_a) {
|
|
|
591
607
|
"variant",
|
|
592
608
|
"menuVariant",
|
|
593
609
|
"colorVariant",
|
|
610
|
+
"density",
|
|
594
611
|
"open",
|
|
595
612
|
"onOpenChange",
|
|
596
613
|
"defaultOpen"
|
|
597
614
|
]);
|
|
598
615
|
var _a2;
|
|
599
616
|
const resolvedVariant = (_a2 = variant != null ? variant : menuVariant) != null ? _a2 : "baseline";
|
|
600
|
-
const [internalOpen, setInternalOpen] =
|
|
617
|
+
const [internalOpen, setInternalOpen] = React37.useState(
|
|
601
618
|
() => defaultOpen != null ? defaultOpen : false
|
|
602
619
|
);
|
|
603
620
|
const isControlled = controlledOpen !== void 0;
|
|
604
621
|
const open = isControlled ? controlledOpen : internalOpen;
|
|
605
|
-
const handleOpenChange =
|
|
622
|
+
const handleOpenChange = React37.useCallback(
|
|
606
623
|
(next) => {
|
|
607
624
|
if (!isControlled) setInternalOpen(next);
|
|
608
625
|
controlledOnOpenChange == null ? void 0 : controlledOnOpenChange(next);
|
|
@@ -614,6 +631,7 @@ function Menu(_a) {
|
|
|
614
631
|
{
|
|
615
632
|
variant: resolvedVariant,
|
|
616
633
|
colorVariant,
|
|
634
|
+
density,
|
|
617
635
|
open,
|
|
618
636
|
onOpenChange: handleOpenChange,
|
|
619
637
|
children: /* @__PURE__ */ jsx(
|
|
@@ -629,12 +647,12 @@ function Menu(_a) {
|
|
|
629
647
|
);
|
|
630
648
|
}
|
|
631
649
|
Menu.displayName = "Menu";
|
|
632
|
-
var MenuTrigger =
|
|
650
|
+
var MenuTrigger = React37.forwardRef((_a, ref) => {
|
|
633
651
|
var _b = _a, { children, asChild = true } = _b, props = __objRest(_b, ["children", "asChild"]);
|
|
634
652
|
return /* @__PURE__ */ jsx(DropdownMenu.Trigger, __spreadProps(__spreadValues({ ref, asChild }, props), { children }));
|
|
635
653
|
});
|
|
636
654
|
MenuTrigger.displayName = "MenuTrigger";
|
|
637
|
-
var MenuContent =
|
|
655
|
+
var MenuContent = React37.forwardRef(
|
|
638
656
|
(_a, ref) => {
|
|
639
657
|
var _b = _a, {
|
|
640
658
|
children,
|
|
@@ -644,6 +662,7 @@ var MenuContent = React36.forwardRef(
|
|
|
644
662
|
hasOverflow = false,
|
|
645
663
|
colorVariant: propColorVariant,
|
|
646
664
|
separatorStyle = "gap",
|
|
665
|
+
matchTriggerWidth = false,
|
|
647
666
|
className
|
|
648
667
|
} = _b, props = __objRest(_b, [
|
|
649
668
|
"children",
|
|
@@ -653,6 +672,7 @@ var MenuContent = React36.forwardRef(
|
|
|
653
672
|
"hasOverflow",
|
|
654
673
|
"colorVariant",
|
|
655
674
|
"separatorStyle",
|
|
675
|
+
"matchTriggerWidth",
|
|
656
676
|
"className"
|
|
657
677
|
]);
|
|
658
678
|
const {
|
|
@@ -663,68 +683,66 @@ var MenuContent = React36.forwardRef(
|
|
|
663
683
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
664
684
|
const colors = variant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
665
685
|
const isExpressiveGap = variant === "expressive" && separatorStyle === "gap";
|
|
666
|
-
const containerClassName =
|
|
667
|
-
"
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
const flattenChildren = (nodes) => {
|
|
691
|
-
return React36.Children.toArray(nodes).reduce(
|
|
692
|
-
(acc, child) => {
|
|
693
|
-
if (React36.isValidElement(child)) {
|
|
694
|
-
if (child.type === React36.Fragment) {
|
|
695
|
-
return acc.concat(
|
|
696
|
-
flattenChildren(
|
|
697
|
-
child.props.children
|
|
698
|
-
)
|
|
699
|
-
);
|
|
700
|
-
}
|
|
701
|
-
acc.push(child);
|
|
702
|
-
}
|
|
703
|
-
return acc;
|
|
704
|
-
},
|
|
705
|
-
[]
|
|
686
|
+
const containerClassName = React37.useMemo(() => {
|
|
687
|
+
const widthClass = matchTriggerWidth ? "w-[var(--radix-dropdown-menu-trigger-width)]" : cn(MENU_MIN_WIDTH, MENU_MAX_WIDTH);
|
|
688
|
+
return variant === "expressive" ? cn(
|
|
689
|
+
"z-50 flex flex-col",
|
|
690
|
+
widthClass,
|
|
691
|
+
isExpressiveGap ? MENU_GROUP_GAP : "",
|
|
692
|
+
isExpressiveGap ? "bg-transparent" : colors.containerBg,
|
|
693
|
+
isExpressiveGap ? "" : "p-1",
|
|
694
|
+
isExpressiveGap ? "" : "rounded-2xl",
|
|
695
|
+
isExpressiveGap ? "" : "elevation-2",
|
|
696
|
+
hasOverflow || isExpressiveGap ? "overflow-visible" : "overflow-hidden",
|
|
697
|
+
"outline-none",
|
|
698
|
+
className
|
|
699
|
+
) : cn(
|
|
700
|
+
"z-50 flex flex-col",
|
|
701
|
+
widthClass,
|
|
702
|
+
MENU_POPUP_PADDING_Y,
|
|
703
|
+
MENU_GROUP_GAP,
|
|
704
|
+
colors.containerBg,
|
|
705
|
+
MENU_CONTAINER_SHAPE,
|
|
706
|
+
"elevation-2",
|
|
707
|
+
hasOverflow ? "overflow-visible" : "overflow-hidden",
|
|
708
|
+
"outline-none",
|
|
709
|
+
className
|
|
706
710
|
);
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
|
|
711
|
+
}, [
|
|
712
|
+
variant,
|
|
713
|
+
isExpressiveGap,
|
|
714
|
+
hasOverflow,
|
|
715
|
+
matchTriggerWidth,
|
|
716
|
+
className,
|
|
717
|
+
colors.containerBg
|
|
718
|
+
]);
|
|
719
|
+
const renderedChildren = React37.useMemo(() => {
|
|
720
|
+
if (variant !== "expressive") return children;
|
|
710
721
|
const validChildren = flattenChildren(children);
|
|
711
722
|
const groupCount = validChildren.length;
|
|
712
|
-
const
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
723
|
+
const enhanced = validChildren.map((child, i) => {
|
|
724
|
+
var _a2;
|
|
725
|
+
if (typeof child.type === "string") return child;
|
|
726
|
+
const defaultItemPosition = groupCount === 1 ? "standalone" : i === 0 ? "leading" : i === groupCount - 1 ? "trailing" : "middle";
|
|
727
|
+
const itemPosition = (_a2 = child.props.itemPosition) != null ? _a2 : defaultItemPosition;
|
|
728
|
+
return React37.cloneElement(
|
|
729
|
+
child,
|
|
730
|
+
{
|
|
731
|
+
index: i,
|
|
732
|
+
count: groupCount,
|
|
733
|
+
itemPosition,
|
|
734
|
+
isGapVariant: isExpressiveGap
|
|
735
|
+
}
|
|
736
|
+
);
|
|
737
|
+
});
|
|
738
|
+
if (separatorStyle !== "divider") return enhanced;
|
|
739
|
+
return enhanced.reduce((acc, child, i) => {
|
|
720
740
|
if (i > 0) {
|
|
721
741
|
acc.push(
|
|
722
742
|
/* @__PURE__ */ jsx(
|
|
723
743
|
"hr",
|
|
724
744
|
{
|
|
725
|
-
className: cn(
|
|
726
|
-
"mx-3 my-0.5 h-px border-0 bg-m3-outline-variant"
|
|
727
|
-
)
|
|
745
|
+
className: cn("mx-3 my-0.5 h-px border-0 bg-m3-outline-variant")
|
|
728
746
|
},
|
|
729
747
|
`divider-${child.key || i}`
|
|
730
748
|
)
|
|
@@ -732,8 +750,8 @@ var MenuContent = React36.forwardRef(
|
|
|
732
750
|
}
|
|
733
751
|
acc.push(child);
|
|
734
752
|
return acc;
|
|
735
|
-
}, [])
|
|
736
|
-
}
|
|
753
|
+
}, []);
|
|
754
|
+
}, [children, variant, isExpressiveGap, separatorStyle]);
|
|
737
755
|
return /* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsx(DropdownMenu.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(
|
|
738
756
|
DropdownMenu.Content,
|
|
739
757
|
__spreadProps(__spreadValues({
|
|
@@ -765,9 +783,9 @@ var MenuContent = React36.forwardRef(
|
|
|
765
783
|
}
|
|
766
784
|
);
|
|
767
785
|
MenuContent.displayName = "MenuContent";
|
|
768
|
-
var MenuDivider =
|
|
786
|
+
var MenuDivider = React37.forwardRef(
|
|
769
787
|
(_a, ref) => {
|
|
770
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
788
|
+
var _b = _a, { className, isGapVariant: _isGapVariant } = _b, props = __objRest(_b, ["className", "isGapVariant"]);
|
|
771
789
|
const { menuVariant } = useMenuContext();
|
|
772
790
|
return /* @__PURE__ */ jsx(DropdownMenu.Separator, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
773
791
|
"hr",
|
|
@@ -796,7 +814,7 @@ function getGroupPosition(index, count) {
|
|
|
796
814
|
function getGroupActiveShape(position) {
|
|
797
815
|
return GROUP_SHAPES[`${position}Active`];
|
|
798
816
|
}
|
|
799
|
-
var MenuGroup =
|
|
817
|
+
var MenuGroup = React37.forwardRef(
|
|
800
818
|
(_a, ref) => {
|
|
801
819
|
var _b = _a, {
|
|
802
820
|
children,
|
|
@@ -817,46 +835,25 @@ var MenuGroup = React36.forwardRef(
|
|
|
817
835
|
"itemPosition",
|
|
818
836
|
"className"
|
|
819
837
|
]);
|
|
820
|
-
const {
|
|
821
|
-
menuVariant,
|
|
822
|
-
colorVariant: contextColorVariant,
|
|
823
|
-
isStatic
|
|
824
|
-
} = useMenuContext();
|
|
838
|
+
const { menuVariant, colorVariant: contextColorVariant } = useMenuContext();
|
|
825
839
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
826
840
|
const colors = menuVariant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
827
841
|
const position = getGroupPosition(index, count);
|
|
828
|
-
const
|
|
829
|
-
const
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
)
|
|
842
|
-
);
|
|
843
|
-
}
|
|
844
|
-
acc.push(child);
|
|
845
|
-
}
|
|
846
|
-
return acc;
|
|
847
|
-
},
|
|
848
|
-
[]
|
|
849
|
-
);
|
|
850
|
-
};
|
|
851
|
-
const validChildren = flattenChildren(children);
|
|
852
|
-
const itemCount = validChildren.length;
|
|
853
|
-
const enhancedChildren = validChildren.map((child, i) => {
|
|
854
|
-
const itemPosition2 = itemCount === 1 ? "standalone" : i === 0 ? "leading" : i === itemCount - 1 ? "trailing" : "middle";
|
|
855
|
-
return React36.cloneElement(child, {
|
|
856
|
-
itemPosition: itemPosition2,
|
|
857
|
-
colorVariant
|
|
842
|
+
const currentShape = getGroupActiveShape(position);
|
|
843
|
+
const enhancedChildren = React37.useMemo(() => {
|
|
844
|
+
const valid = flattenChildren(children);
|
|
845
|
+
const itemCount = valid.length;
|
|
846
|
+
return valid.map((child, i) => {
|
|
847
|
+
var _a2;
|
|
848
|
+
if (typeof child.type === "string") return child;
|
|
849
|
+
const defaultItemPosition = itemCount === 1 ? "standalone" : i === 0 ? "leading" : i === itemCount - 1 ? "trailing" : "middle";
|
|
850
|
+
const itemPosition2 = (_a2 = child.props.itemPosition) != null ? _a2 : defaultItemPosition;
|
|
851
|
+
return React37.cloneElement(child, {
|
|
852
|
+
itemPosition: itemPosition2,
|
|
853
|
+
colorVariant
|
|
854
|
+
});
|
|
858
855
|
});
|
|
859
|
-
});
|
|
856
|
+
}, [children, colorVariant]);
|
|
860
857
|
return /* @__PURE__ */ jsxs(
|
|
861
858
|
m.div,
|
|
862
859
|
__spreadProps(__spreadValues({
|
|
@@ -868,10 +865,8 @@ var MenuGroup = React36.forwardRef(
|
|
|
868
865
|
// In baseline variant, MenuGroup is transparent so it shouldn't clip.
|
|
869
866
|
// In expressive variant, it needs overflow-hidden to clip hover states to its morphing shape.
|
|
870
867
|
menuVariant === "baseline" ? "" : "overflow-hidden",
|
|
871
|
-
//
|
|
872
|
-
|
|
873
|
-
// Horizontal padding: 4dp for expressive menus (both static and popup), 0 for baseline
|
|
874
|
-
menuVariant === "expressive" ? "px-1" : "",
|
|
868
|
+
// Padding: uniform 4dp (p-1) for expressive menus (matches 12px inner item corners inside 16px outer corners)
|
|
869
|
+
menuVariant === "expressive" ? "p-1" : MENU_GROUP_PADDING_Y,
|
|
875
870
|
// Gap variant has floating segments, so each group manages its own shadow
|
|
876
871
|
isGapVariant ? "elevation-2" : "",
|
|
877
872
|
// Background based on color variant (transparent for baseline to avoid double-layering)
|
|
@@ -879,9 +874,7 @@ var MenuGroup = React36.forwardRef(
|
|
|
879
874
|
className
|
|
880
875
|
),
|
|
881
876
|
animate: { borderRadius: currentShape },
|
|
882
|
-
transition: FAST_SPATIAL_SPRING
|
|
883
|
-
onPointerEnter: handlePointerEnter,
|
|
884
|
-
onPointerLeave: handlePointerLeave
|
|
877
|
+
transition: FAST_SPATIAL_SPRING
|
|
885
878
|
}, rest), {
|
|
886
879
|
children: [
|
|
887
880
|
label && /* @__PURE__ */ jsx(
|
|
@@ -918,7 +911,7 @@ var VARIANT_FONT = {
|
|
|
918
911
|
rounded: "'Material Symbols Rounded'",
|
|
919
912
|
sharp: "'Material Symbols Sharp'"
|
|
920
913
|
};
|
|
921
|
-
var IconComponent =
|
|
914
|
+
var IconComponent = React37.forwardRef(
|
|
922
915
|
(_a, ref) => {
|
|
923
916
|
var _b = _a, {
|
|
924
917
|
name,
|
|
@@ -984,14 +977,14 @@ var IconComponent = React36.forwardRef(
|
|
|
984
977
|
}
|
|
985
978
|
);
|
|
986
979
|
IconComponent.displayName = "Icon";
|
|
987
|
-
var Icon =
|
|
980
|
+
var Icon = React37.memo(IconComponent);
|
|
988
981
|
function getItemShapeClass(position, selected, isStatic = false, menuVariant = "expressive") {
|
|
989
982
|
if (menuVariant === "baseline") return BASELINE_ITEM_SHAPE;
|
|
990
983
|
if (selected) return ITEM_SHAPE_CLASSES.selected;
|
|
991
984
|
if (isStatic && position === "standalone") return "rounded-[12px]";
|
|
992
985
|
return ITEM_SHAPE_CLASSES[position];
|
|
993
986
|
}
|
|
994
|
-
var MenuItem =
|
|
987
|
+
var MenuItem = React37.forwardRef(
|
|
995
988
|
(_a, ref) => {
|
|
996
989
|
var _b = _a, {
|
|
997
990
|
children,
|
|
@@ -1004,11 +997,13 @@ var MenuItem = React36.forwardRef(
|
|
|
1004
997
|
disabled = false,
|
|
1005
998
|
itemPosition = "standalone",
|
|
1006
999
|
colorVariant: propColorVariant,
|
|
1000
|
+
density: propDensity,
|
|
1007
1001
|
keepOpen = false,
|
|
1008
1002
|
className,
|
|
1009
1003
|
isSubTrigger,
|
|
1010
1004
|
value,
|
|
1011
|
-
role
|
|
1005
|
+
role,
|
|
1006
|
+
isGapVariant: _isGapVariant
|
|
1012
1007
|
} = _b, rest = __objRest(_b, [
|
|
1013
1008
|
"children",
|
|
1014
1009
|
"onClick",
|
|
@@ -1020,18 +1015,24 @@ var MenuItem = React36.forwardRef(
|
|
|
1020
1015
|
"disabled",
|
|
1021
1016
|
"itemPosition",
|
|
1022
1017
|
"colorVariant",
|
|
1018
|
+
"density",
|
|
1023
1019
|
"keepOpen",
|
|
1024
1020
|
"className",
|
|
1025
1021
|
"isSubTrigger",
|
|
1026
1022
|
"value",
|
|
1027
|
-
"role"
|
|
1023
|
+
"role",
|
|
1024
|
+
"isGapVariant"
|
|
1028
1025
|
]);
|
|
1026
|
+
var _a2;
|
|
1029
1027
|
const {
|
|
1030
1028
|
menuVariant,
|
|
1031
1029
|
colorVariant: contextColorVariant,
|
|
1030
|
+
density: contextDensity,
|
|
1032
1031
|
menuPrimitive
|
|
1033
1032
|
} = useMenuContext();
|
|
1034
1033
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1034
|
+
const density = (_a2 = propDensity != null ? propDensity : contextDensity) != null ? _a2 : 0;
|
|
1035
|
+
const minHeightClass = DENSITY_MIN_HEIGHT[density];
|
|
1035
1036
|
const colors = menuVariant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1036
1037
|
const isStaticMenu = menuPrimitive === "static";
|
|
1037
1038
|
const shapeClass = getItemShapeClass(
|
|
@@ -1073,12 +1074,11 @@ var MenuItem = React36.forwardRef(
|
|
|
1073
1074
|
className: cn(
|
|
1074
1075
|
// Layout
|
|
1075
1076
|
"relative flex w-full cursor-pointer select-none items-center outline-none",
|
|
1076
|
-
// Sizing: min-h 48dp,
|
|
1077
|
-
|
|
1077
|
+
// Sizing: min-h based on density (48dp, 40dp, 32dp), min-w 112dp
|
|
1078
|
+
minHeightClass,
|
|
1079
|
+
"min-w-28",
|
|
1078
1080
|
// Horizontal padding
|
|
1079
1081
|
menuVariant === "baseline" ? MENU_BASELINE_ITEM_HORIZONTAL_PADDING : "px-4",
|
|
1080
|
-
// Spacing between items
|
|
1081
|
-
isStaticMenu ? "my-0.5" : "",
|
|
1082
1082
|
// Shape morphing (position-based + selected override)
|
|
1083
1083
|
shapeClass,
|
|
1084
1084
|
// Animate border-radius AND background-color together (FastEffects: 150ms)
|
|
@@ -1090,7 +1090,7 @@ var MenuItem = React36.forwardRef(
|
|
|
1090
1090
|
!selected && colors.focusLayer,
|
|
1091
1091
|
// Focus visible ring (WCAG 2.4.11 — visible focus indicator)
|
|
1092
1092
|
// Uses ring-inset so the ring doesn't overflow the item bounds.
|
|
1093
|
-
"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-m3-
|
|
1093
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-m3-secondary data-highlighted:ring-0",
|
|
1094
1094
|
// Disabled
|
|
1095
1095
|
disabled && "pointer-events-none opacity-[0.38]",
|
|
1096
1096
|
className
|
|
@@ -1193,31 +1193,31 @@ function SubMenu({
|
|
|
1193
1193
|
}) {
|
|
1194
1194
|
const { colorVariant: contextColorVariant, menuPrimitive } = useMenuContext();
|
|
1195
1195
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1196
|
-
const [open, setOpen] =
|
|
1197
|
-
const openTimerRef =
|
|
1198
|
-
const closeTimerRef =
|
|
1196
|
+
const [open, setOpen] = React37.useState(false);
|
|
1197
|
+
const openTimerRef = React37.useRef(null);
|
|
1198
|
+
const closeTimerRef = React37.useRef(
|
|
1199
1199
|
null
|
|
1200
1200
|
);
|
|
1201
|
-
const clearTimers =
|
|
1201
|
+
const clearTimers = React37.useCallback(() => {
|
|
1202
1202
|
if (openTimerRef.current) clearTimeout(openTimerRef.current);
|
|
1203
1203
|
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
1204
1204
|
}, []);
|
|
1205
|
-
const handleTriggerPointerEnter =
|
|
1205
|
+
const handleTriggerPointerEnter = React37.useCallback(() => {
|
|
1206
1206
|
clearTimers();
|
|
1207
1207
|
openTimerRef.current = setTimeout(() => setOpen(true), hoverOpenDelay);
|
|
1208
1208
|
}, [hoverOpenDelay, clearTimers]);
|
|
1209
|
-
const handleTriggerPointerLeave =
|
|
1209
|
+
const handleTriggerPointerLeave = React37.useCallback(() => {
|
|
1210
1210
|
clearTimers();
|
|
1211
1211
|
closeTimerRef.current = setTimeout(() => setOpen(false), hoverCloseDelay);
|
|
1212
1212
|
}, [hoverCloseDelay, clearTimers]);
|
|
1213
|
-
const handleContentPointerEnter =
|
|
1213
|
+
const handleContentPointerEnter = React37.useCallback(() => {
|
|
1214
1214
|
clearTimers();
|
|
1215
1215
|
}, [clearTimers]);
|
|
1216
|
-
const handleContentPointerLeave =
|
|
1216
|
+
const handleContentPointerLeave = React37.useCallback(() => {
|
|
1217
1217
|
clearTimers();
|
|
1218
1218
|
closeTimerRef.current = setTimeout(() => setOpen(false), hoverCloseDelay);
|
|
1219
1219
|
}, [hoverCloseDelay, clearTimers]);
|
|
1220
|
-
|
|
1220
|
+
React37.useEffect(() => () => clearTimers(), [clearTimers]);
|
|
1221
1221
|
const Sub3 = menuPrimitive === "context" ? RxContextMenu.Sub : DropdownMenu.Sub;
|
|
1222
1222
|
const SubTrigger3 = menuPrimitive === "context" ? RxContextMenu.SubTrigger : DropdownMenu.SubTrigger;
|
|
1223
1223
|
const SubContent3 = menuPrimitive === "context" ? RxContextMenu.SubContent : DropdownMenu.SubContent;
|
|
@@ -1229,7 +1229,7 @@ function SubMenu({
|
|
|
1229
1229
|
className: "w-full outline-none",
|
|
1230
1230
|
onPointerEnter: handleTriggerPointerEnter,
|
|
1231
1231
|
onPointerLeave: handleTriggerPointerLeave,
|
|
1232
|
-
children:
|
|
1232
|
+
children: React37.isValidElement(trigger) ? React37.cloneElement(trigger, {
|
|
1233
1233
|
isSubTrigger: true,
|
|
1234
1234
|
// Auto-add chevron if missing
|
|
1235
1235
|
trailingIcon: trigger.props.trailingIcon || /* @__PURE__ */ jsx(Icon, { name: "chevron_right", size: 20 })
|
|
@@ -1306,7 +1306,7 @@ function SubMenuContent({
|
|
|
1306
1306
|
);
|
|
1307
1307
|
}
|
|
1308
1308
|
SubMenuContent.displayName = "SubMenuContent";
|
|
1309
|
-
var VerticalMenuDivider =
|
|
1309
|
+
var VerticalMenuDivider = React37.forwardRef((_a, ref) => {
|
|
1310
1310
|
var _b = _a, { className, index, count, isGapVariant } = _b, props = __objRest(_b, ["className", "index", "count", "isGapVariant"]);
|
|
1311
1311
|
return /* @__PURE__ */ jsx(
|
|
1312
1312
|
"hr",
|
|
@@ -1326,7 +1326,7 @@ var VerticalMenuDivider = React36.forwardRef((_a, ref) => {
|
|
|
1326
1326
|
});
|
|
1327
1327
|
VerticalMenuDivider.displayName = "VerticalMenuDivider";
|
|
1328
1328
|
var VerticalMenuGroup = MenuGroup;
|
|
1329
|
-
var VerticalMenuContent =
|
|
1329
|
+
var VerticalMenuContent = React37.forwardRef(
|
|
1330
1330
|
(_a, ref) => {
|
|
1331
1331
|
var _b = _a, {
|
|
1332
1332
|
children,
|
|
@@ -1342,46 +1342,39 @@ var VerticalMenuContent = React36.forwardRef(
|
|
|
1342
1342
|
const { colorVariant: contextColorVariant } = useMenuContext();
|
|
1343
1343
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1344
1344
|
const colors = colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1345
|
-
const
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1345
|
+
const renderedChildren = React37.useMemo(() => {
|
|
1346
|
+
const valid = flattenChildren(children);
|
|
1347
|
+
const groupCount = valid.length;
|
|
1348
|
+
const enhanced = valid.map((child, i) => {
|
|
1349
|
+
var _a2;
|
|
1350
|
+
if (typeof child.type === "string") return child;
|
|
1351
|
+
const defaultItemPosition = groupCount === 1 ? "standalone" : i === 0 ? "leading" : i === groupCount - 1 ? "trailing" : "middle";
|
|
1352
|
+
const itemPosition = (_a2 = child.props.itemPosition) != null ? _a2 : defaultItemPosition;
|
|
1353
|
+
return React37.cloneElement(
|
|
1354
|
+
child,
|
|
1355
|
+
{
|
|
1356
|
+
index: i,
|
|
1357
|
+
count: groupCount,
|
|
1358
|
+
itemPosition,
|
|
1359
|
+
isGapVariant: separatorStyle === "gap"
|
|
1357
1360
|
}
|
|
1358
|
-
return acc;
|
|
1359
|
-
},
|
|
1360
|
-
[]
|
|
1361
|
-
);
|
|
1362
|
-
};
|
|
1363
|
-
const validChildren = flattenChildren(children);
|
|
1364
|
-
const groupCount = validChildren.length;
|
|
1365
|
-
const enhancedChildren = validChildren.map(
|
|
1366
|
-
(child, i) => React36.cloneElement(child, {
|
|
1367
|
-
index: i,
|
|
1368
|
-
count: groupCount,
|
|
1369
|
-
isGapVariant: separatorStyle === "gap"
|
|
1370
|
-
})
|
|
1371
|
-
);
|
|
1372
|
-
const renderedChildren = separatorStyle === "divider" ? enhancedChildren.reduce((acc, child, i) => {
|
|
1373
|
-
if (i > 0) {
|
|
1374
|
-
acc.push(
|
|
1375
|
-
/* @__PURE__ */ jsx(
|
|
1376
|
-
VerticalMenuDivider,
|
|
1377
|
-
{},
|
|
1378
|
-
`divider-${child.key || i}`
|
|
1379
|
-
)
|
|
1380
1361
|
);
|
|
1381
|
-
}
|
|
1382
|
-
|
|
1383
|
-
return acc
|
|
1384
|
-
|
|
1362
|
+
});
|
|
1363
|
+
if (separatorStyle !== "divider") return enhanced;
|
|
1364
|
+
return enhanced.reduce((acc, child, i) => {
|
|
1365
|
+
if (i > 0) {
|
|
1366
|
+
acc.push(
|
|
1367
|
+
/* @__PURE__ */ jsx(
|
|
1368
|
+
VerticalMenuDivider,
|
|
1369
|
+
{},
|
|
1370
|
+
`divider-${child.key || i}`
|
|
1371
|
+
)
|
|
1372
|
+
);
|
|
1373
|
+
}
|
|
1374
|
+
acc.push(child);
|
|
1375
|
+
return acc;
|
|
1376
|
+
}, []);
|
|
1377
|
+
}, [children, separatorStyle]);
|
|
1385
1378
|
return /* @__PURE__ */ jsx(
|
|
1386
1379
|
"div",
|
|
1387
1380
|
__spreadProps(__spreadValues({
|
|
@@ -1400,13 +1393,13 @@ var VerticalMenuContent = React36.forwardRef(
|
|
|
1400
1393
|
}
|
|
1401
1394
|
);
|
|
1402
1395
|
VerticalMenuContent.displayName = "VerticalMenuContent";
|
|
1403
|
-
var VerticalMenu =
|
|
1396
|
+
var VerticalMenu = React37.forwardRef((_a, ref) => {
|
|
1404
1397
|
var _b = _a, { children, colorVariant = "standard", className } = _b, props = __objRest(_b, ["children", "colorVariant", "className"]);
|
|
1405
|
-
const noop =
|
|
1398
|
+
const noop = React37.useCallback(() => {
|
|
1406
1399
|
}, []);
|
|
1407
1400
|
const colors = colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1408
|
-
const containerRef =
|
|
1409
|
-
const mergedRef =
|
|
1401
|
+
const containerRef = React37.useRef(null);
|
|
1402
|
+
const mergedRef = React37.useCallback(
|
|
1410
1403
|
(node) => {
|
|
1411
1404
|
containerRef.current = node;
|
|
1412
1405
|
if (typeof ref === "function") ref(node);
|
|
@@ -1415,7 +1408,7 @@ var VerticalMenu = React36.forwardRef((_a, ref) => {
|
|
|
1415
1408
|
},
|
|
1416
1409
|
[ref]
|
|
1417
1410
|
);
|
|
1418
|
-
const handleKeyDown =
|
|
1411
|
+
const handleKeyDown = React37.useCallback(
|
|
1419
1412
|
(e) => {
|
|
1420
1413
|
var _a2;
|
|
1421
1414
|
if (!containerRef.current) return;
|
|
@@ -1498,7 +1491,7 @@ var VerticalMenu = React36.forwardRef((_a, ref) => {
|
|
|
1498
1491
|
});
|
|
1499
1492
|
VerticalMenu.displayName = "VerticalMenu";
|
|
1500
1493
|
function detectSeparatorStyle(children) {
|
|
1501
|
-
const child =
|
|
1494
|
+
const child = React37.Children.toArray(children).find(React37.isValidElement);
|
|
1502
1495
|
if (child) {
|
|
1503
1496
|
const style = child.props.separatorStyle;
|
|
1504
1497
|
if (style) return style;
|
|
@@ -1579,11 +1572,11 @@ function AppBarColumn({
|
|
|
1579
1572
|
maxItemCount,
|
|
1580
1573
|
className
|
|
1581
1574
|
}) {
|
|
1582
|
-
const containerRef =
|
|
1583
|
-
const [visibleCount, setVisibleCount] =
|
|
1575
|
+
const containerRef = React37.useRef(null);
|
|
1576
|
+
const [visibleCount, setVisibleCount] = React37.useState(
|
|
1584
1577
|
maxItemCount != null ? maxItemCount : items.length
|
|
1585
1578
|
);
|
|
1586
|
-
|
|
1579
|
+
React37.useEffect(() => {
|
|
1587
1580
|
if (maxItemCount !== void 0) {
|
|
1588
1581
|
setVisibleCount(Math.min(maxItemCount, items.length));
|
|
1589
1582
|
return;
|
|
@@ -1631,11 +1624,11 @@ function AppBarColumn({
|
|
|
1631
1624
|
);
|
|
1632
1625
|
}
|
|
1633
1626
|
function AppBarRow({ items, maxItemCount, className }) {
|
|
1634
|
-
const containerRef =
|
|
1635
|
-
const [visibleCount, setVisibleCount] =
|
|
1627
|
+
const containerRef = React37.useRef(null);
|
|
1628
|
+
const [visibleCount, setVisibleCount] = React37.useState(
|
|
1636
1629
|
maxItemCount != null ? maxItemCount : items.length
|
|
1637
1630
|
);
|
|
1638
|
-
|
|
1631
|
+
React37.useEffect(() => {
|
|
1639
1632
|
if (maxItemCount !== void 0) {
|
|
1640
1633
|
setVisibleCount(Math.min(maxItemCount, items.length));
|
|
1641
1634
|
return;
|
|
@@ -1689,12 +1682,12 @@ function useAppBarScroll({
|
|
|
1689
1682
|
collapsedHeight = 64,
|
|
1690
1683
|
expandedHeight = 112
|
|
1691
1684
|
} = {}) {
|
|
1692
|
-
const [isScrolled, setIsScrolled] =
|
|
1693
|
-
const [collapsedFraction, setCollapsedFraction] =
|
|
1694
|
-
const [isHidden, setIsHidden] =
|
|
1695
|
-
const prevScrollYRef =
|
|
1685
|
+
const [isScrolled, setIsScrolled] = React37.useState(false);
|
|
1686
|
+
const [collapsedFraction, setCollapsedFraction] = React37.useState(0);
|
|
1687
|
+
const [isHidden, setIsHidden] = React37.useState(false);
|
|
1688
|
+
const prevScrollYRef = React37.useRef(0);
|
|
1696
1689
|
const hideThreshold = 64;
|
|
1697
|
-
|
|
1690
|
+
React37.useEffect(() => {
|
|
1698
1691
|
var _a;
|
|
1699
1692
|
const scrollDistance = expandedHeight - collapsedHeight;
|
|
1700
1693
|
const getScrollY = () => {
|
|
@@ -1815,7 +1808,7 @@ function useFlexibleAppBar({
|
|
|
1815
1808
|
expandedHeight
|
|
1816
1809
|
});
|
|
1817
1810
|
const scrollProgress = useMotionValue(0);
|
|
1818
|
-
|
|
1811
|
+
React37.useEffect(() => {
|
|
1819
1812
|
scrollProgress.set(
|
|
1820
1813
|
shouldReduceMotion ? collapsedFraction > 0.5 ? 1 : 0 : collapsedFraction
|
|
1821
1814
|
);
|
|
@@ -2156,7 +2149,7 @@ function SearchAppBar({
|
|
|
2156
2149
|
}) {
|
|
2157
2150
|
var _a, _b;
|
|
2158
2151
|
const shouldReduceMotion = useReducedMotion();
|
|
2159
|
-
const [isSearchOpen, setIsSearchOpen] =
|
|
2152
|
+
const [isSearchOpen, setIsSearchOpen] = React37.useState(false);
|
|
2160
2153
|
const { isScrolled } = useAppBarScroll({
|
|
2161
2154
|
scrollElement,
|
|
2162
2155
|
behavior: scrollBehavior === "exitUntilCollapsed" ? "pinned" : scrollBehavior
|
|
@@ -2270,8 +2263,8 @@ function SearchView({
|
|
|
2270
2263
|
className
|
|
2271
2264
|
}) {
|
|
2272
2265
|
const shouldReduceMotion = useReducedMotion();
|
|
2273
|
-
const inputRef =
|
|
2274
|
-
|
|
2266
|
+
const inputRef = React37.useRef(null);
|
|
2267
|
+
React37.useEffect(() => {
|
|
2275
2268
|
const timer = window.setTimeout(() => {
|
|
2276
2269
|
var _a;
|
|
2277
2270
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
@@ -2527,7 +2520,7 @@ function SmallAppBar({
|
|
|
2527
2520
|
"small-app-bar"
|
|
2528
2521
|
) });
|
|
2529
2522
|
}
|
|
2530
|
-
var RippleItem =
|
|
2523
|
+
var RippleItem = React37.memo(function RippleItem2({
|
|
2531
2524
|
ripple,
|
|
2532
2525
|
onDone
|
|
2533
2526
|
}) {
|
|
@@ -2571,8 +2564,8 @@ function Ripple({
|
|
|
2571
2564
|
}
|
|
2572
2565
|
function useRippleState(options = {}) {
|
|
2573
2566
|
const { disabled = false } = options;
|
|
2574
|
-
const [ripples, setRipples] =
|
|
2575
|
-
const onPointerDown =
|
|
2567
|
+
const [ripples, setRipples] = React37.useState([]);
|
|
2568
|
+
const onPointerDown = React37.useCallback(
|
|
2576
2569
|
(e) => {
|
|
2577
2570
|
if (disabled) return;
|
|
2578
2571
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -2589,7 +2582,7 @@ function useRippleState(options = {}) {
|
|
|
2589
2582
|
},
|
|
2590
2583
|
[disabled]
|
|
2591
2584
|
);
|
|
2592
|
-
const removeRipple =
|
|
2585
|
+
const removeRipple = React37.useCallback((id) => {
|
|
2593
2586
|
setRipples((prev) => prev.filter((r) => r.id !== id));
|
|
2594
2587
|
}, []);
|
|
2595
2588
|
return { ripples, onPointerDown, removeRipple };
|
|
@@ -4519,11 +4512,11 @@ function getNavigationShapeStyle(shape, width = 56, height = 56) {
|
|
|
4519
4512
|
function isSquareShape(shape) {
|
|
4520
4513
|
return Boolean(shape && shape !== "pill");
|
|
4521
4514
|
}
|
|
4522
|
-
var NavigationBarContext =
|
|
4515
|
+
var NavigationBarContext = React37.createContext({ variant: "flexible" });
|
|
4523
4516
|
function cloneIconWithFill(icon, selected) {
|
|
4524
|
-
if (!
|
|
4517
|
+
if (!React37.isValidElement(icon)) return icon;
|
|
4525
4518
|
if (icon.type === Icon) {
|
|
4526
|
-
return
|
|
4519
|
+
return React37.cloneElement(
|
|
4527
4520
|
icon,
|
|
4528
4521
|
{ fill: selected ? 1 : 0, animateFill: true }
|
|
4529
4522
|
);
|
|
@@ -4535,7 +4528,7 @@ function ActivePill({
|
|
|
4535
4528
|
width = 56,
|
|
4536
4529
|
height = 32
|
|
4537
4530
|
}) {
|
|
4538
|
-
const { activeIndicatorTransition } =
|
|
4531
|
+
const { activeIndicatorTransition } = React37.useContext(NavigationBarContext);
|
|
4539
4532
|
const shapeStyle = getNavigationShapeStyle(shape, width, height);
|
|
4540
4533
|
return /* @__PURE__ */ jsx(
|
|
4541
4534
|
m.div,
|
|
@@ -4607,7 +4600,7 @@ function IconContainer({ selected, badge, children }) {
|
|
|
4607
4600
|
}
|
|
4608
4601
|
);
|
|
4609
4602
|
}
|
|
4610
|
-
var NavigationBarItemComponent =
|
|
4603
|
+
var NavigationBarItemComponent = React37.forwardRef(
|
|
4611
4604
|
({
|
|
4612
4605
|
selected,
|
|
4613
4606
|
icon,
|
|
@@ -4631,7 +4624,7 @@ var NavigationBarItemComponent = React36.forwardRef(
|
|
|
4631
4624
|
labelVisibility: contextLabelVisibility,
|
|
4632
4625
|
shapeSize: contextShapeSize,
|
|
4633
4626
|
itemClassName: contextItemClassName
|
|
4634
|
-
} =
|
|
4627
|
+
} = React37.useContext(NavigationBarContext);
|
|
4635
4628
|
const activeShape = (_a = shapeProp != null ? shapeProp : contextShape) != null ? _a : "pill";
|
|
4636
4629
|
const isSquare = isSquareShape(activeShape);
|
|
4637
4630
|
const resolvedShapeSize = (_b = shapeSizeProp != null ? shapeSizeProp : contextShapeSize) != null ? _b : 56;
|
|
@@ -4645,7 +4638,7 @@ var NavigationBarItemComponent = React36.forwardRef(
|
|
|
4645
4638
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
4646
4639
|
disabled
|
|
4647
4640
|
});
|
|
4648
|
-
const handleClick =
|
|
4641
|
+
const handleClick = React37.useCallback(
|
|
4649
4642
|
(e) => {
|
|
4650
4643
|
if (disabled) {
|
|
4651
4644
|
e.preventDefault();
|
|
@@ -4672,7 +4665,7 @@ var NavigationBarItemComponent = React36.forwardRef(
|
|
|
4672
4665
|
const iconPillWidth = isSquare ? resolvedShapeSize : 56;
|
|
4673
4666
|
const iconPillHeight = isSquare ? resolvedShapeSize : 32;
|
|
4674
4667
|
if (asChild && children) {
|
|
4675
|
-
const child =
|
|
4668
|
+
const child = React37.Children.only(children);
|
|
4676
4669
|
const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4677
4670
|
/* @__PURE__ */ jsxs(
|
|
4678
4671
|
"div",
|
|
@@ -4797,7 +4790,7 @@ var NavigationBarItemComponent = React36.forwardRef(
|
|
|
4797
4790
|
onClick: handleClick,
|
|
4798
4791
|
onPointerDown,
|
|
4799
4792
|
className: itemClassName,
|
|
4800
|
-
children:
|
|
4793
|
+
children: React37.cloneElement(child, { children: innerContent })
|
|
4801
4794
|
}
|
|
4802
4795
|
);
|
|
4803
4796
|
}
|
|
@@ -4931,7 +4924,7 @@ var NavigationBarItemComponent = React36.forwardRef(
|
|
|
4931
4924
|
}
|
|
4932
4925
|
);
|
|
4933
4926
|
NavigationBarItemComponent.displayName = "NavigationBarItem";
|
|
4934
|
-
var NavigationBarItem =
|
|
4927
|
+
var NavigationBarItem = React37.memo(NavigationBarItemComponent);
|
|
4935
4928
|
var navContainerVariants = cva(
|
|
4936
4929
|
"flex items-center justify-center select-none transition-transform duration-300 z-50",
|
|
4937
4930
|
{
|
|
@@ -4957,7 +4950,7 @@ var navContainerVariants = cva(
|
|
|
4957
4950
|
}
|
|
4958
4951
|
}
|
|
4959
4952
|
);
|
|
4960
|
-
var NavigationBarComponent =
|
|
4953
|
+
var NavigationBarComponent = React37.forwardRef(
|
|
4961
4954
|
({
|
|
4962
4955
|
variant = "flexible",
|
|
4963
4956
|
itemLayout,
|
|
@@ -4974,18 +4967,18 @@ var NavigationBarComponent = React36.forwardRef(
|
|
|
4974
4967
|
className,
|
|
4975
4968
|
style
|
|
4976
4969
|
}, ref) => {
|
|
4977
|
-
const [isVisible, setIsVisible] =
|
|
4978
|
-
const lastScrollY =
|
|
4970
|
+
const [isVisible, setIsVisible] = React37.useState(true);
|
|
4971
|
+
const lastScrollY = React37.useRef(
|
|
4979
4972
|
typeof window !== "undefined" ? window.scrollY : 0
|
|
4980
4973
|
);
|
|
4981
4974
|
const isSquare = isSquareShape(shape);
|
|
4982
4975
|
const effectiveShapeSize = shapeSize != null ? shapeSize : isSquare ? 56 : 32;
|
|
4983
|
-
const computedMinHeight =
|
|
4976
|
+
const computedMinHeight = React37.useMemo(() => {
|
|
4984
4977
|
const baseHeight = variant === "baseline" ? 80 : 64;
|
|
4985
4978
|
const requiredHeight = itemLayout === "horizontal" || labelVisibility === "unlabeled" ? effectiveShapeSize + 16 : effectiveShapeSize + 32;
|
|
4986
4979
|
return Math.max(baseHeight, requiredHeight);
|
|
4987
4980
|
}, [variant, itemLayout, labelVisibility, effectiveShapeSize]);
|
|
4988
|
-
|
|
4981
|
+
React37.useEffect(() => {
|
|
4989
4982
|
if (typeof window === "undefined" || !hideOnScroll) {
|
|
4990
4983
|
setIsVisible(true);
|
|
4991
4984
|
return;
|
|
@@ -5069,8 +5062,8 @@ var NavigationBarComponent = React36.forwardRef(
|
|
|
5069
5062
|
}
|
|
5070
5063
|
);
|
|
5071
5064
|
NavigationBarComponent.displayName = "NavigationBar";
|
|
5072
|
-
var NavigationBar =
|
|
5073
|
-
var NavigationRailContext =
|
|
5065
|
+
var NavigationBar = React37.memo(NavigationBarComponent);
|
|
5066
|
+
var NavigationRailContext = React37.createContext({
|
|
5074
5067
|
variant: "collapsed",
|
|
5075
5068
|
labelVisibility: "labeled",
|
|
5076
5069
|
activeIndicatorWidth: "hug"
|
|
@@ -5106,9 +5099,9 @@ var railContainerVariants = cva(
|
|
|
5106
5099
|
}
|
|
5107
5100
|
);
|
|
5108
5101
|
function cloneIconWithFill2(icon, selected) {
|
|
5109
|
-
if (!
|
|
5102
|
+
if (!React37.isValidElement(icon)) return icon;
|
|
5110
5103
|
if (icon.type === Icon) {
|
|
5111
|
-
return
|
|
5104
|
+
return React37.cloneElement(
|
|
5112
5105
|
icon,
|
|
5113
5106
|
{ fill: selected ? 1 : 0, animateFill: true }
|
|
5114
5107
|
);
|
|
@@ -5137,7 +5130,7 @@ function ActivePill2({
|
|
|
5137
5130
|
width = 56,
|
|
5138
5131
|
height = 32
|
|
5139
5132
|
}) {
|
|
5140
|
-
const { activeIndicatorTransition } =
|
|
5133
|
+
const { activeIndicatorTransition } = React37.useContext(NavigationRailContext);
|
|
5141
5134
|
const shapeStyle = getNavigationShapeStyle(shape, width, height);
|
|
5142
5135
|
return /* @__PURE__ */ jsx(
|
|
5143
5136
|
m.div,
|
|
@@ -5212,7 +5205,7 @@ function IconContainer2({ selected, badge, children }) {
|
|
|
5212
5205
|
}
|
|
5213
5206
|
);
|
|
5214
5207
|
}
|
|
5215
|
-
var NavigationRailItemComponent =
|
|
5208
|
+
var NavigationRailItemComponent = React37.forwardRef(
|
|
5216
5209
|
({
|
|
5217
5210
|
selected,
|
|
5218
5211
|
icon,
|
|
@@ -5235,7 +5228,7 @@ var NavigationRailItemComponent = React36.forwardRef(
|
|
|
5235
5228
|
shape: contextShape,
|
|
5236
5229
|
shapeSize: contextShapeSize,
|
|
5237
5230
|
activeIndicatorWidth: contextActiveIndicatorWidth
|
|
5238
|
-
} =
|
|
5231
|
+
} = React37.useContext(NavigationRailContext);
|
|
5239
5232
|
const activeShape = (_a = shapeProp != null ? shapeProp : contextShape) != null ? _a : "pill";
|
|
5240
5233
|
const isSquare = isSquareShape(activeShape);
|
|
5241
5234
|
const resolvedShapeSize = (_b = shapeSizeProp != null ? shapeSizeProp : contextShapeSize) != null ? _b : 56;
|
|
@@ -5245,12 +5238,12 @@ var NavigationRailItemComponent = React36.forwardRef(
|
|
|
5245
5238
|
const enableLayout = !isModal;
|
|
5246
5239
|
const isExpandedPill = isExpanded && !isSquare;
|
|
5247
5240
|
const expandedPillWidthClass = activeIndicatorWidth === "fill" ? "w-full" : "w-fit";
|
|
5248
|
-
const activePillId = `rail-pill-${
|
|
5241
|
+
const activePillId = `rail-pill-${React37.useId()}`;
|
|
5249
5242
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
5250
5243
|
disabled
|
|
5251
5244
|
});
|
|
5252
5245
|
const showLabel = isExpanded || labelVisibility === "labeled" || labelVisibility === "auto" && selected;
|
|
5253
|
-
const handleClick =
|
|
5246
|
+
const handleClick = React37.useCallback(
|
|
5254
5247
|
(e) => {
|
|
5255
5248
|
if (disabled) {
|
|
5256
5249
|
e.preventDefault();
|
|
@@ -5272,7 +5265,7 @@ var NavigationRailItemComponent = React36.forwardRef(
|
|
|
5272
5265
|
const iconPillWidth = isSquare ? resolvedShapeSize : 56;
|
|
5273
5266
|
const iconPillHeight = isSquare ? resolvedShapeSize : 32;
|
|
5274
5267
|
if (asChild && children) {
|
|
5275
|
-
const child =
|
|
5268
|
+
const child = React37.Children.only(children);
|
|
5276
5269
|
const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5277
5270
|
/* @__PURE__ */ jsxs(
|
|
5278
5271
|
m.div,
|
|
@@ -5390,7 +5383,7 @@ var NavigationRailItemComponent = React36.forwardRef(
|
|
|
5390
5383
|
onPointerDown,
|
|
5391
5384
|
className: itemClassName,
|
|
5392
5385
|
tabIndex: -1,
|
|
5393
|
-
children:
|
|
5386
|
+
children: React37.cloneElement(child, { children: innerContent })
|
|
5394
5387
|
}
|
|
5395
5388
|
) });
|
|
5396
5389
|
}
|
|
@@ -5518,9 +5511,9 @@ var NavigationRailItemComponent = React36.forwardRef(
|
|
|
5518
5511
|
}
|
|
5519
5512
|
);
|
|
5520
5513
|
NavigationRailItemComponent.displayName = "NavigationRailItem";
|
|
5521
|
-
var NavigationRailItem =
|
|
5514
|
+
var NavigationRailItem = React37.memo(NavigationRailItemComponent);
|
|
5522
5515
|
function useRoving(navRef) {
|
|
5523
|
-
|
|
5516
|
+
React37.useEffect(() => {
|
|
5524
5517
|
if (!navRef.current) return;
|
|
5525
5518
|
const items = getMenuItems(navRef.current);
|
|
5526
5519
|
const selected = items.find(
|
|
@@ -5530,7 +5523,7 @@ function useRoving(navRef) {
|
|
|
5530
5523
|
const firstFocusable = selected != null ? selected : items[0];
|
|
5531
5524
|
if (firstFocusable) firstFocusable.tabIndex = 0;
|
|
5532
5525
|
}, [navRef]);
|
|
5533
|
-
return
|
|
5526
|
+
return React37.useCallback(
|
|
5534
5527
|
(e) => {
|
|
5535
5528
|
if (!navRef.current) return;
|
|
5536
5529
|
const items = getMenuItems(navRef.current);
|
|
@@ -5558,7 +5551,7 @@ function useRoving(navRef) {
|
|
|
5558
5551
|
[navRef]
|
|
5559
5552
|
);
|
|
5560
5553
|
}
|
|
5561
|
-
var NavigationRailComponent =
|
|
5554
|
+
var NavigationRailComponent = React37.forwardRef(
|
|
5562
5555
|
({
|
|
5563
5556
|
variant = "collapsed",
|
|
5564
5557
|
labelVisibility = "labeled",
|
|
@@ -5582,9 +5575,9 @@ var NavigationRailComponent = React36.forwardRef(
|
|
|
5582
5575
|
const isXr = variant === "xr";
|
|
5583
5576
|
const isSpatial = isXr && fabPlacement === "spatialized";
|
|
5584
5577
|
const applyAnimation = !isXr || !isSpatial;
|
|
5585
|
-
const navRef =
|
|
5578
|
+
const navRef = React37.useRef(null);
|
|
5586
5579
|
const handleKeyDown = useRoving(navRef);
|
|
5587
|
-
const setRefs =
|
|
5580
|
+
const setRefs = React37.useCallback(
|
|
5588
5581
|
(node) => {
|
|
5589
5582
|
navRef.current = node;
|
|
5590
5583
|
if (typeof ref === "function") ref(node);
|
|
@@ -5677,7 +5670,7 @@ var NavigationRailComponent = React36.forwardRef(
|
|
|
5677
5670
|
children: fab
|
|
5678
5671
|
}
|
|
5679
5672
|
),
|
|
5680
|
-
|
|
5673
|
+
React37.cloneElement(
|
|
5681
5674
|
navElement,
|
|
5682
5675
|
{
|
|
5683
5676
|
className: cn(navBaseClasses, "pointer-events-auto")
|
|
@@ -5722,7 +5715,7 @@ var NavigationRailComponent = React36.forwardRef(
|
|
|
5722
5715
|
}
|
|
5723
5716
|
);
|
|
5724
5717
|
NavigationRailComponent.displayName = "NavigationRail";
|
|
5725
|
-
var NavigationRail =
|
|
5718
|
+
var NavigationRail = React37.memo(NavigationRailComponent);
|
|
5726
5719
|
function useSearchKeyboard({
|
|
5727
5720
|
active,
|
|
5728
5721
|
onActiveChange,
|
|
@@ -5731,14 +5724,14 @@ function useSearchKeyboard({
|
|
|
5731
5724
|
itemCount,
|
|
5732
5725
|
onSelectSuggestion
|
|
5733
5726
|
}) {
|
|
5734
|
-
const [activeIndex, setActiveIndex] =
|
|
5735
|
-
const resetKeyRef =
|
|
5727
|
+
const [activeIndex, setActiveIndex] = React37.useState(-1);
|
|
5728
|
+
const resetKeyRef = React37.useRef(`${active}:${query}`);
|
|
5736
5729
|
const currentKey = `${active}:${query}`;
|
|
5737
5730
|
if (resetKeyRef.current !== currentKey) {
|
|
5738
5731
|
resetKeyRef.current = currentKey;
|
|
5739
5732
|
setActiveIndex(-1);
|
|
5740
5733
|
}
|
|
5741
|
-
const handleKeyDown =
|
|
5734
|
+
const handleKeyDown = React37.useCallback(
|
|
5742
5735
|
(e) => {
|
|
5743
5736
|
if (!active) return;
|
|
5744
5737
|
switch (e.key) {
|
|
@@ -5778,7 +5771,7 @@ function useSearchKeyboard({
|
|
|
5778
5771
|
query
|
|
5779
5772
|
]
|
|
5780
5773
|
);
|
|
5781
|
-
const resetActiveIndex =
|
|
5774
|
+
const resetActiveIndex = React37.useCallback(() => {
|
|
5782
5775
|
setActiveIndex(-1);
|
|
5783
5776
|
}, []);
|
|
5784
5777
|
return { activeIndex, handleKeyDown, resetActiveIndex };
|
|
@@ -5846,10 +5839,10 @@ function AnimatedPlaceholder({
|
|
|
5846
5839
|
className
|
|
5847
5840
|
}) {
|
|
5848
5841
|
const shouldReduceMotion = useReducedMotion();
|
|
5849
|
-
const containerRef =
|
|
5850
|
-
const spanRef =
|
|
5851
|
-
const [xOffset, setXOffset] =
|
|
5852
|
-
const recalculate =
|
|
5842
|
+
const containerRef = React37.useRef(null);
|
|
5843
|
+
const spanRef = React37.useRef(null);
|
|
5844
|
+
const [xOffset, setXOffset] = React37.useState(0);
|
|
5845
|
+
const recalculate = React37.useCallback(() => {
|
|
5853
5846
|
const container = containerRef.current;
|
|
5854
5847
|
const span = spanRef.current;
|
|
5855
5848
|
if (!container || !span || textAlign === "left") {
|
|
@@ -5864,10 +5857,10 @@ function AnimatedPlaceholder({
|
|
|
5864
5857
|
setXOffset(Math.max(0, containerWidth - textWidth));
|
|
5865
5858
|
}
|
|
5866
5859
|
}, [textAlign]);
|
|
5867
|
-
|
|
5860
|
+
React37.useLayoutEffect(() => {
|
|
5868
5861
|
recalculate();
|
|
5869
5862
|
}, [recalculate]);
|
|
5870
|
-
|
|
5863
|
+
React37.useEffect(() => {
|
|
5871
5864
|
const container = containerRef.current;
|
|
5872
5865
|
if (!container) return;
|
|
5873
5866
|
const observer = new ResizeObserver(recalculate);
|
|
@@ -5936,10 +5929,10 @@ function SearchBar({
|
|
|
5936
5929
|
activeIndex
|
|
5937
5930
|
}) {
|
|
5938
5931
|
const shouldReduceMotion = useReducedMotion();
|
|
5939
|
-
const inputRef =
|
|
5940
|
-
const prevActiveRef =
|
|
5941
|
-
const isRestoringFocusRef =
|
|
5942
|
-
|
|
5932
|
+
const inputRef = React37.useRef(null);
|
|
5933
|
+
const prevActiveRef = React37.useRef(active);
|
|
5934
|
+
const isRestoringFocusRef = React37.useRef(false);
|
|
5935
|
+
React37.useEffect(() => {
|
|
5943
5936
|
var _a;
|
|
5944
5937
|
let rafId;
|
|
5945
5938
|
if (prevActiveRef.current === true && active === false) {
|
|
@@ -6058,7 +6051,7 @@ function SearchBar({
|
|
|
6058
6051
|
) })
|
|
6059
6052
|
);
|
|
6060
6053
|
}
|
|
6061
|
-
var SearchContext =
|
|
6054
|
+
var SearchContext = React37.createContext(null);
|
|
6062
6055
|
function SearchProvider({
|
|
6063
6056
|
children,
|
|
6064
6057
|
value
|
|
@@ -6066,7 +6059,7 @@ function SearchProvider({
|
|
|
6066
6059
|
return /* @__PURE__ */ jsx(SearchContext.Provider, { value, children });
|
|
6067
6060
|
}
|
|
6068
6061
|
function useSearch() {
|
|
6069
|
-
const context =
|
|
6062
|
+
const context = React37.useContext(SearchContext);
|
|
6070
6063
|
if (!context) {
|
|
6071
6064
|
return { listboxId: "", activeIndex: -1 };
|
|
6072
6065
|
}
|
|
@@ -6093,7 +6086,7 @@ function useClickOutside(handler, enabled = true) {
|
|
|
6093
6086
|
return ref;
|
|
6094
6087
|
}
|
|
6095
6088
|
function useSearchViewFocus(inputRef, active) {
|
|
6096
|
-
|
|
6089
|
+
React37.useEffect(() => {
|
|
6097
6090
|
if (!active) return;
|
|
6098
6091
|
let raf2;
|
|
6099
6092
|
const raf1 = requestAnimationFrame(() => {
|
|
@@ -6153,11 +6146,11 @@ var ROTATE_KEY_SPLINES = [
|
|
|
6153
6146
|
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";
|
|
6154
6147
|
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";
|
|
6155
6148
|
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";
|
|
6156
|
-
var IndeterminateSvg =
|
|
6149
|
+
var IndeterminateSvg = React37.memo(function IndeterminateSvg2({
|
|
6157
6150
|
size
|
|
6158
6151
|
}) {
|
|
6159
|
-
const [ready, setReady] =
|
|
6160
|
-
|
|
6152
|
+
const [ready, setReady] = React37.useState(false);
|
|
6153
|
+
React37.useEffect(() => {
|
|
6161
6154
|
const raf = requestAnimationFrame(() => setReady(true));
|
|
6162
6155
|
return () => cancelAnimationFrame(raf);
|
|
6163
6156
|
}, []);
|
|
@@ -6202,7 +6195,7 @@ var IndeterminateSvg = React36.memo(function IndeterminateSvg2({
|
|
|
6202
6195
|
}
|
|
6203
6196
|
);
|
|
6204
6197
|
});
|
|
6205
|
-
var DeterminateSvg =
|
|
6198
|
+
var DeterminateSvg = React37.memo(function DeterminateSvg2({
|
|
6206
6199
|
size,
|
|
6207
6200
|
progress
|
|
6208
6201
|
}) {
|
|
@@ -6227,7 +6220,7 @@ var DeterminateSvg = React36.memo(function DeterminateSvg2({
|
|
|
6227
6220
|
}
|
|
6228
6221
|
);
|
|
6229
6222
|
});
|
|
6230
|
-
var LoadingIndicator =
|
|
6223
|
+
var LoadingIndicator = React37.forwardRef(
|
|
6231
6224
|
(_a, ref) => {
|
|
6232
6225
|
var _b = _a, {
|
|
6233
6226
|
variant = "uncontained",
|
|
@@ -6342,7 +6335,7 @@ function getSinePath(startX, endX, phase, wl, amp) {
|
|
|
6342
6335
|
d += ` L ${endX.toFixed(2)} ${yEnd.toFixed(2)}`;
|
|
6343
6336
|
return d;
|
|
6344
6337
|
}
|
|
6345
|
-
var CircularProgress =
|
|
6338
|
+
var CircularProgress = React37.forwardRef(
|
|
6346
6339
|
(_a, ref) => {
|
|
6347
6340
|
var _b = _a, {
|
|
6348
6341
|
value,
|
|
@@ -6380,15 +6373,15 @@ var CircularProgress = React36.forwardRef(
|
|
|
6380
6373
|
const isWavy = shape === "wavy";
|
|
6381
6374
|
const BASELINE_SIZE = 48;
|
|
6382
6375
|
const scaleFactor = size / BASELINE_SIZE;
|
|
6383
|
-
const effectiveAmplitude =
|
|
6376
|
+
const effectiveAmplitude = React37.useMemo(
|
|
6384
6377
|
() => amplitude != null ? amplitude : 1.6 * scaleFactor,
|
|
6385
6378
|
[amplitude, scaleFactor]
|
|
6386
6379
|
);
|
|
6387
|
-
const effectiveWavelength =
|
|
6380
|
+
const effectiveWavelength = React37.useMemo(
|
|
6388
6381
|
() => wavelength != null ? wavelength : 15 * scaleFactor,
|
|
6389
6382
|
[wavelength, scaleFactor]
|
|
6390
6383
|
);
|
|
6391
|
-
const wavyActivePath =
|
|
6384
|
+
const wavyActivePath = React37.useMemo(
|
|
6392
6385
|
() => isWavy ? generateWavyCircularPath(
|
|
6393
6386
|
center,
|
|
6394
6387
|
radius,
|
|
@@ -6397,8 +6390,8 @@ var CircularProgress = React36.forwardRef(
|
|
|
6397
6390
|
) : null,
|
|
6398
6391
|
[isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
|
|
6399
6392
|
);
|
|
6400
|
-
const circumference =
|
|
6401
|
-
const gapForTrack =
|
|
6393
|
+
const circumference = React37.useMemo(() => 2 * Math.PI * radius, [radius]);
|
|
6394
|
+
const gapForTrack = React37.useMemo(
|
|
6402
6395
|
() => (gapSize + trackHeight) / circumference,
|
|
6403
6396
|
[gapSize, trackHeight, circumference]
|
|
6404
6397
|
);
|
|
@@ -6587,9 +6580,9 @@ var CircularProgress = React36.forwardRef(
|
|
|
6587
6580
|
);
|
|
6588
6581
|
CircularProgress.displayName = "CircularProgress";
|
|
6589
6582
|
function useContainerWidth() {
|
|
6590
|
-
const [width, setWidth] =
|
|
6591
|
-
const observerRef =
|
|
6592
|
-
const ref =
|
|
6583
|
+
const [width, setWidth] = React37.useState(0);
|
|
6584
|
+
const observerRef = React37.useRef(null);
|
|
6585
|
+
const ref = React37.useCallback((node) => {
|
|
6593
6586
|
if (observerRef.current) {
|
|
6594
6587
|
observerRef.current.disconnect();
|
|
6595
6588
|
observerRef.current = null;
|
|
@@ -6603,7 +6596,7 @@ function useContainerWidth() {
|
|
|
6603
6596
|
observerRef.current = obs;
|
|
6604
6597
|
}
|
|
6605
6598
|
}, []);
|
|
6606
|
-
|
|
6599
|
+
React37.useEffect(() => {
|
|
6607
6600
|
return () => {
|
|
6608
6601
|
if (observerRef.current) {
|
|
6609
6602
|
observerRef.current.disconnect();
|
|
@@ -6613,7 +6606,7 @@ function useContainerWidth() {
|
|
|
6613
6606
|
return [ref, width];
|
|
6614
6607
|
}
|
|
6615
6608
|
function useMergedRef(...refs) {
|
|
6616
|
-
return
|
|
6609
|
+
return React37.useCallback(
|
|
6617
6610
|
(node) => {
|
|
6618
6611
|
for (const ref of refs) {
|
|
6619
6612
|
if (typeof ref === "function") {
|
|
@@ -6627,7 +6620,7 @@ function useMergedRef(...refs) {
|
|
|
6627
6620
|
[refs]
|
|
6628
6621
|
);
|
|
6629
6622
|
}
|
|
6630
|
-
var FlatLinearTrack =
|
|
6623
|
+
var FlatLinearTrack = React37.memo(function FlatLinearTrack2({
|
|
6631
6624
|
trackHeight,
|
|
6632
6625
|
activeColor,
|
|
6633
6626
|
trackColor,
|
|
@@ -6703,7 +6696,7 @@ var FlatLinearTrack = React36.memo(function FlatLinearTrack2({
|
|
|
6703
6696
|
}
|
|
6704
6697
|
);
|
|
6705
6698
|
});
|
|
6706
|
-
var WavyLinearTrack =
|
|
6699
|
+
var WavyLinearTrack = React37.memo(function WavyLinearTrack2({
|
|
6707
6700
|
trackHeight,
|
|
6708
6701
|
svgHeight,
|
|
6709
6702
|
amplitude,
|
|
@@ -6722,13 +6715,13 @@ var WavyLinearTrack = React36.memo(function WavyLinearTrack2({
|
|
|
6722
6715
|
}) {
|
|
6723
6716
|
const isDeterminate = typeof value === "number";
|
|
6724
6717
|
const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
|
|
6725
|
-
const titleId =
|
|
6718
|
+
const titleId = React37.useId();
|
|
6726
6719
|
const [containerRef, width] = useContainerWidth();
|
|
6727
|
-
const activePathRef =
|
|
6728
|
-
const trackPathRef =
|
|
6720
|
+
const activePathRef = React37.useRef(null);
|
|
6721
|
+
const trackPathRef = React37.useRef(null);
|
|
6729
6722
|
const amplitudeMV = useMotionValue(amplitude);
|
|
6730
6723
|
const fractionMV = useMotionValue(isDeterminate ? clampedValue / 100 : 1);
|
|
6731
|
-
|
|
6724
|
+
React37.useEffect(() => {
|
|
6732
6725
|
if (isDeterminate) {
|
|
6733
6726
|
const fraction = clampedValue / 100;
|
|
6734
6727
|
let targetAmp = amplitude;
|
|
@@ -6899,7 +6892,7 @@ var WavyLinearTrack = React36.memo(function WavyLinearTrack2({
|
|
|
6899
6892
|
}
|
|
6900
6893
|
);
|
|
6901
6894
|
});
|
|
6902
|
-
var LinearProgress =
|
|
6895
|
+
var LinearProgress = React37.forwardRef(
|
|
6903
6896
|
(_a, ref) => {
|
|
6904
6897
|
var _b = _a, {
|
|
6905
6898
|
value,
|
|
@@ -6940,10 +6933,10 @@ var LinearProgress = React36.forwardRef(
|
|
|
6940
6933
|
]);
|
|
6941
6934
|
const isDeterminate = value !== void 0;
|
|
6942
6935
|
const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
|
|
6943
|
-
const containerRef =
|
|
6936
|
+
const containerRef = React37.useRef(null);
|
|
6944
6937
|
const mergedRef = useMergedRef(ref, containerRef);
|
|
6945
|
-
const [isRtl, setIsRtl] =
|
|
6946
|
-
|
|
6938
|
+
const [isRtl, setIsRtl] = React37.useState(false);
|
|
6939
|
+
React37.useEffect(() => {
|
|
6947
6940
|
if (containerRef.current) {
|
|
6948
6941
|
const dir = getComputedStyle(containerRef.current).direction;
|
|
6949
6942
|
setIsRtl(dir === "rtl");
|
|
@@ -6951,16 +6944,16 @@ var LinearProgress = React36.forwardRef(
|
|
|
6951
6944
|
}, []);
|
|
6952
6945
|
const isWavy = shape === "wavy";
|
|
6953
6946
|
const resolvedTrackShape = trackShape != null ? trackShape : shape;
|
|
6954
|
-
const effectiveAmplitude =
|
|
6955
|
-
const svgHeight =
|
|
6947
|
+
const effectiveAmplitude = React37.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
|
|
6948
|
+
const svgHeight = React37.useMemo(
|
|
6956
6949
|
() => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
|
|
6957
6950
|
[isWavy, trackHeight, effectiveAmplitude]
|
|
6958
6951
|
);
|
|
6959
|
-
const shouldShowStop =
|
|
6952
|
+
const shouldShowStop = React37.useMemo(
|
|
6960
6953
|
() => isDeterminate && resolvedTrackShape === "flat" && (showStopIndicator === true || showStopIndicator === "auto" && isDeterminate),
|
|
6961
6954
|
[isDeterminate, resolvedTrackShape, showStopIndicator]
|
|
6962
6955
|
);
|
|
6963
|
-
const stopSize =
|
|
6956
|
+
const stopSize = React37.useMemo(
|
|
6964
6957
|
() => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
|
|
6965
6958
|
[trackHeight]
|
|
6966
6959
|
);
|
|
@@ -7033,7 +7026,7 @@ var LinearProgress = React36.forwardRef(
|
|
|
7033
7026
|
}
|
|
7034
7027
|
);
|
|
7035
7028
|
LinearProgress.displayName = "LinearProgress";
|
|
7036
|
-
var ProgressIndicator =
|
|
7029
|
+
var ProgressIndicator = React37.forwardRef((props, ref) => {
|
|
7037
7030
|
if (props.variant === "circular") {
|
|
7038
7031
|
return /* @__PURE__ */ jsx(CircularProgress, __spreadValues({ ref }, props));
|
|
7039
7032
|
}
|
|
@@ -7165,7 +7158,7 @@ function resolveDisabledBgClass(colorStyle) {
|
|
|
7165
7158
|
}
|
|
7166
7159
|
return "disabled:text-m3-on-surface/[0.38]";
|
|
7167
7160
|
}
|
|
7168
|
-
var IconButtonComponent =
|
|
7161
|
+
var IconButtonComponent = React37.forwardRef(
|
|
7169
7162
|
(_a, ref) => {
|
|
7170
7163
|
var _b = _a, {
|
|
7171
7164
|
className,
|
|
@@ -7207,18 +7200,18 @@ var IconButtonComponent = React36.forwardRef(
|
|
|
7207
7200
|
var _a2, _b2, _c, _d, _e;
|
|
7208
7201
|
const isToggle = variant === "toggle";
|
|
7209
7202
|
const isSelected = isToggle && !!selected;
|
|
7210
|
-
const resolvedColorClass =
|
|
7203
|
+
const resolvedColorClass = React37.useMemo(
|
|
7211
7204
|
() => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
|
|
7212
7205
|
[isSelected, colorStyle]
|
|
7213
7206
|
);
|
|
7214
|
-
const outlineWidthClass =
|
|
7207
|
+
const outlineWidthClass = React37.useMemo(
|
|
7215
7208
|
() => {
|
|
7216
7209
|
var _a3;
|
|
7217
7210
|
return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
|
|
7218
7211
|
},
|
|
7219
7212
|
[colorStyle, isSelected, size]
|
|
7220
7213
|
);
|
|
7221
|
-
const disabledBgClass =
|
|
7214
|
+
const disabledBgClass = React37.useMemo(
|
|
7222
7215
|
() => resolveDisabledBgClass(colorStyle),
|
|
7223
7216
|
[colorStyle]
|
|
7224
7217
|
);
|
|
@@ -7241,7 +7234,7 @@ var IconButtonComponent = React36.forwardRef(
|
|
|
7241
7234
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
7242
7235
|
disabled: loading
|
|
7243
7236
|
});
|
|
7244
|
-
const handleClick =
|
|
7237
|
+
const handleClick = React37.useCallback(
|
|
7245
7238
|
(e) => {
|
|
7246
7239
|
if (loading) {
|
|
7247
7240
|
e.preventDefault();
|
|
@@ -7251,7 +7244,7 @@ var IconButtonComponent = React36.forwardRef(
|
|
|
7251
7244
|
},
|
|
7252
7245
|
[loading, onClick]
|
|
7253
7246
|
);
|
|
7254
|
-
const handleKeyDown =
|
|
7247
|
+
const handleKeyDown = React37.useCallback(
|
|
7255
7248
|
(e) => {
|
|
7256
7249
|
if (loading) return;
|
|
7257
7250
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -7307,7 +7300,7 @@ var IconButtonComponent = React36.forwardRef(
|
|
|
7307
7300
|
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
7308
7301
|
height: isCustomSize ? `${iconSize}px` : void 0
|
|
7309
7302
|
},
|
|
7310
|
-
children: isSelected && selectedIcon ? selectedIcon : asChild ?
|
|
7303
|
+
children: isSelected && selectedIcon ? selectedIcon : asChild ? React37.Children.only(children).props.children : children
|
|
7311
7304
|
}),
|
|
7312
7305
|
isSelected && selectedIcon ? "selected-content" : "content"
|
|
7313
7306
|
) })
|
|
@@ -7324,7 +7317,7 @@ var IconButtonComponent = React36.forwardRef(
|
|
|
7324
7317
|
className
|
|
7325
7318
|
);
|
|
7326
7319
|
if (asChild) {
|
|
7327
|
-
const child =
|
|
7320
|
+
const child = React37.Children.only(children);
|
|
7328
7321
|
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
|
|
7329
7322
|
Slot,
|
|
7330
7323
|
__spreadProps(__spreadValues({
|
|
@@ -7341,7 +7334,7 @@ var IconButtonComponent = React36.forwardRef(
|
|
|
7341
7334
|
}),
|
|
7342
7335
|
className: containerClassName
|
|
7343
7336
|
}, restProps), {
|
|
7344
|
-
children:
|
|
7337
|
+
children: React37.cloneElement(child, { children: innerContent })
|
|
7345
7338
|
})
|
|
7346
7339
|
) });
|
|
7347
7340
|
}
|
|
@@ -7369,7 +7362,7 @@ var IconButtonComponent = React36.forwardRef(
|
|
|
7369
7362
|
}
|
|
7370
7363
|
);
|
|
7371
7364
|
IconButtonComponent.displayName = "IconButton";
|
|
7372
|
-
var IconButton =
|
|
7365
|
+
var IconButton = React37.memo(IconButtonComponent);
|
|
7373
7366
|
function TrailingAction({
|
|
7374
7367
|
query,
|
|
7375
7368
|
trailingIcon,
|
|
@@ -7429,7 +7422,7 @@ function SearchViewDocked({
|
|
|
7429
7422
|
activeIndex
|
|
7430
7423
|
}) {
|
|
7431
7424
|
const shouldReduceMotion = useReducedMotion();
|
|
7432
|
-
const inputRef =
|
|
7425
|
+
const inputRef = React37.useRef(null);
|
|
7433
7426
|
useSearchViewFocus(inputRef, active);
|
|
7434
7427
|
const dropdownRef = useClickOutside(() => {
|
|
7435
7428
|
onActiveChange(false);
|
|
@@ -7575,10 +7568,10 @@ function SearchViewFullScreen({
|
|
|
7575
7568
|
activeIndex
|
|
7576
7569
|
}) {
|
|
7577
7570
|
const shouldReduceMotion = useReducedMotion();
|
|
7578
|
-
const inputRef =
|
|
7571
|
+
const inputRef = React37.useRef(null);
|
|
7579
7572
|
useSearchViewFocus(inputRef, active);
|
|
7580
|
-
const [mounted, setMounted] =
|
|
7581
|
-
|
|
7573
|
+
const [mounted, setMounted] = React37.useState(false);
|
|
7574
|
+
React37.useEffect(() => {
|
|
7582
7575
|
setMounted(true);
|
|
7583
7576
|
}, []);
|
|
7584
7577
|
const handleFormSubmit = (e) => {
|
|
@@ -7736,10 +7729,10 @@ function SearchComponent({
|
|
|
7736
7729
|
className,
|
|
7737
7730
|
viewClassName
|
|
7738
7731
|
}) {
|
|
7739
|
-
const generatedId =
|
|
7732
|
+
const generatedId = React37.useId();
|
|
7740
7733
|
const searchId = id != null ? id : generatedId;
|
|
7741
7734
|
const listboxId = `${searchId}-listbox`;
|
|
7742
|
-
const itemCount =
|
|
7735
|
+
const itemCount = React37.Children.count(children);
|
|
7743
7736
|
const { activeIndex, handleKeyDown } = useSearchKeyboard({
|
|
7744
7737
|
active,
|
|
7745
7738
|
onActiveChange,
|
|
@@ -7798,9 +7791,9 @@ function formatBadgeLabel(children, max) {
|
|
|
7798
7791
|
return "";
|
|
7799
7792
|
}
|
|
7800
7793
|
function detectBadgeHasContent(badge) {
|
|
7801
|
-
return
|
|
7794
|
+
return React37.isValidElement(badge) && badge.props.children != null;
|
|
7802
7795
|
}
|
|
7803
|
-
var BadgeImpl =
|
|
7796
|
+
var BadgeImpl = React37.forwardRef(
|
|
7804
7797
|
(_a, ref) => {
|
|
7805
7798
|
var _b = _a, {
|
|
7806
7799
|
children,
|
|
@@ -7854,7 +7847,7 @@ var BadgeImpl = React36.forwardRef(
|
|
|
7854
7847
|
}
|
|
7855
7848
|
);
|
|
7856
7849
|
BadgeImpl.displayName = "Badge";
|
|
7857
|
-
|
|
7850
|
+
React37.memo(BadgeImpl);
|
|
7858
7851
|
function BadgedBox({
|
|
7859
7852
|
badge,
|
|
7860
7853
|
children,
|
|
@@ -7875,9 +7868,9 @@ function BadgedBox({
|
|
|
7875
7868
|
)
|
|
7876
7869
|
] });
|
|
7877
7870
|
}
|
|
7878
|
-
var TabsContext =
|
|
7871
|
+
var TabsContext = React37.createContext(null);
|
|
7879
7872
|
function useTabsContext() {
|
|
7880
|
-
const ctx =
|
|
7873
|
+
const ctx = React37.useContext(TabsContext);
|
|
7881
7874
|
if (!ctx) {
|
|
7882
7875
|
throw new Error(
|
|
7883
7876
|
"[MD3 Tabs] Component must be used within a <Tabs> root. Ensure <TabsList>, <Tab>, and <TabsContent> are descendants of <Tabs>."
|
|
@@ -7885,7 +7878,7 @@ function useTabsContext() {
|
|
|
7885
7878
|
}
|
|
7886
7879
|
return ctx;
|
|
7887
7880
|
}
|
|
7888
|
-
var TabsComponent =
|
|
7881
|
+
var TabsComponent = React37.forwardRef(
|
|
7889
7882
|
({
|
|
7890
7883
|
value: controlledValue,
|
|
7891
7884
|
defaultValue = "",
|
|
@@ -7894,35 +7887,35 @@ var TabsComponent = React36.forwardRef(
|
|
|
7894
7887
|
children,
|
|
7895
7888
|
className
|
|
7896
7889
|
}, ref) => {
|
|
7897
|
-
const [internalValue, setInternalValue] =
|
|
7890
|
+
const [internalValue, setInternalValue] = React37.useState(defaultValue);
|
|
7898
7891
|
const isControlled = controlledValue !== void 0;
|
|
7899
7892
|
const value = isControlled ? controlledValue : internalValue;
|
|
7900
|
-
const handleValueChange =
|
|
7893
|
+
const handleValueChange = React37.useCallback(
|
|
7901
7894
|
(newValue) => {
|
|
7902
7895
|
if (!isControlled) setInternalValue(newValue);
|
|
7903
7896
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
7904
7897
|
},
|
|
7905
7898
|
[isControlled, onValueChange]
|
|
7906
7899
|
);
|
|
7907
|
-
const [focusedValue, setFocusedValue] =
|
|
7908
|
-
|
|
7900
|
+
const [focusedValue, setFocusedValue] = React37.useState(value);
|
|
7901
|
+
React37.useEffect(() => {
|
|
7909
7902
|
setFocusedValue(value);
|
|
7910
7903
|
}, [value]);
|
|
7911
|
-
const [tabValues, setTabValues] =
|
|
7912
|
-
const registerTab =
|
|
7904
|
+
const [tabValues, setTabValues] = React37.useState([]);
|
|
7905
|
+
const registerTab = React37.useCallback((tabValue) => {
|
|
7913
7906
|
setTabValues((prev) => {
|
|
7914
7907
|
if (prev.includes(tabValue)) return prev;
|
|
7915
7908
|
return [...prev, tabValue];
|
|
7916
7909
|
});
|
|
7917
7910
|
}, []);
|
|
7918
|
-
const unregisterTab =
|
|
7911
|
+
const unregisterTab = React37.useCallback((tabValue) => {
|
|
7919
7912
|
setTabValues((prev) => prev.filter((v) => v !== tabValue));
|
|
7920
7913
|
}, []);
|
|
7921
|
-
const hasAutoSelected =
|
|
7922
|
-
const [disabledValues, setDisabledValues] =
|
|
7914
|
+
const hasAutoSelected = React37.useRef(false);
|
|
7915
|
+
const [disabledValues, setDisabledValues] = React37.useState(
|
|
7923
7916
|
/* @__PURE__ */ new Set()
|
|
7924
7917
|
);
|
|
7925
|
-
const markTabDisabled =
|
|
7918
|
+
const markTabDisabled = React37.useCallback(
|
|
7926
7919
|
(tabValue, disabled) => {
|
|
7927
7920
|
setDisabledValues((prev) => {
|
|
7928
7921
|
const next = new Set(prev);
|
|
@@ -7936,7 +7929,7 @@ var TabsComponent = React36.forwardRef(
|
|
|
7936
7929
|
},
|
|
7937
7930
|
[]
|
|
7938
7931
|
);
|
|
7939
|
-
|
|
7932
|
+
React37.useEffect(() => {
|
|
7940
7933
|
if (isControlled || hasAutoSelected.current || tabValues.length === 0) {
|
|
7941
7934
|
return;
|
|
7942
7935
|
}
|
|
@@ -7951,9 +7944,9 @@ var TabsComponent = React36.forwardRef(
|
|
|
7951
7944
|
setFocusedValue(firstEnabled);
|
|
7952
7945
|
}
|
|
7953
7946
|
}, [tabValues, disabledValues, isControlled, value]);
|
|
7954
|
-
const id =
|
|
7947
|
+
const id = React37.useId();
|
|
7955
7948
|
const layoutGroupId = `tabs-${id}`;
|
|
7956
|
-
const contextValue =
|
|
7949
|
+
const contextValue = React37.useMemo(
|
|
7957
7950
|
() => ({
|
|
7958
7951
|
value,
|
|
7959
7952
|
onValueChange: handleValueChange,
|
|
@@ -7984,12 +7977,12 @@ var TabsComponent = React36.forwardRef(
|
|
|
7984
7977
|
}
|
|
7985
7978
|
);
|
|
7986
7979
|
TabsComponent.displayName = "Tabs";
|
|
7987
|
-
var Tabs =
|
|
7988
|
-
var TabsListContext =
|
|
7980
|
+
var Tabs = React37.memo(TabsComponent);
|
|
7981
|
+
var TabsListContext = React37.createContext(
|
|
7989
7982
|
null
|
|
7990
7983
|
);
|
|
7991
7984
|
function useTabsListContext() {
|
|
7992
|
-
const ctx =
|
|
7985
|
+
const ctx = React37.useContext(TabsListContext);
|
|
7993
7986
|
return ctx != null ? ctx : { variant: "primary", scrollable: false };
|
|
7994
7987
|
}
|
|
7995
7988
|
|
|
@@ -8073,7 +8066,7 @@ var TABS_CONTENT_TRANSITION = {
|
|
|
8073
8066
|
ease: "easeInOut"
|
|
8074
8067
|
};
|
|
8075
8068
|
var INDICATOR_MIN_WIDTH = 24;
|
|
8076
|
-
var TabComponent =
|
|
8069
|
+
var TabComponent = React37.forwardRef(
|
|
8077
8070
|
({
|
|
8078
8071
|
value,
|
|
8079
8072
|
icon,
|
|
@@ -8103,9 +8096,9 @@ var TabComponent = React36.forwardRef(
|
|
|
8103
8096
|
const isFocused = focusedValue === value;
|
|
8104
8097
|
const hasIcon = icon != null;
|
|
8105
8098
|
const isStackedIcon = hasIcon && !inlineIcon;
|
|
8106
|
-
const buttonRef =
|
|
8107
|
-
const isFirstMount =
|
|
8108
|
-
const mergedRef =
|
|
8099
|
+
const buttonRef = React37.useRef(null);
|
|
8100
|
+
const isFirstMount = React37.useRef(true);
|
|
8101
|
+
const mergedRef = React37.useCallback(
|
|
8109
8102
|
(node) => {
|
|
8110
8103
|
buttonRef.current = node;
|
|
8111
8104
|
if (typeof ref === "function") ref(node);
|
|
@@ -8113,15 +8106,15 @@ var TabComponent = React36.forwardRef(
|
|
|
8113
8106
|
},
|
|
8114
8107
|
[ref]
|
|
8115
8108
|
);
|
|
8116
|
-
|
|
8109
|
+
React37.useEffect(() => {
|
|
8117
8110
|
registerTab(value);
|
|
8118
8111
|
return () => unregisterTab(value);
|
|
8119
8112
|
}, [value, registerTab, unregisterTab]);
|
|
8120
|
-
|
|
8113
|
+
React37.useEffect(() => {
|
|
8121
8114
|
markTabDisabled(value, disabled);
|
|
8122
8115
|
return () => markTabDisabled(value, false);
|
|
8123
8116
|
}, [value, disabled, markTabDisabled]);
|
|
8124
|
-
const handleKeyDown =
|
|
8117
|
+
const handleKeyDown = React37.useCallback(
|
|
8125
8118
|
(e) => {
|
|
8126
8119
|
const isRtl = buttonRef.current ? getComputedStyle(buttonRef.current).direction === "rtl" : false;
|
|
8127
8120
|
const enabledValues = tabValues.filter((v) => !disabledValues.has(v));
|
|
@@ -8175,7 +8168,7 @@ var TabComponent = React36.forwardRef(
|
|
|
8175
8168
|
autoActivate
|
|
8176
8169
|
]
|
|
8177
8170
|
);
|
|
8178
|
-
|
|
8171
|
+
React37.useEffect(() => {
|
|
8179
8172
|
if (isFirstMount.current) {
|
|
8180
8173
|
isFirstMount.current = false;
|
|
8181
8174
|
return;
|
|
@@ -8184,7 +8177,7 @@ var TabComponent = React36.forwardRef(
|
|
|
8184
8177
|
buttonRef.current.focus({ preventScroll: true });
|
|
8185
8178
|
}
|
|
8186
8179
|
}, [isFocused]);
|
|
8187
|
-
|
|
8180
|
+
React37.useEffect(() => {
|
|
8188
8181
|
if (!isActive || !scrollable || !buttonRef.current) return;
|
|
8189
8182
|
const btn = buttonRef.current;
|
|
8190
8183
|
let container = btn.parentElement;
|
|
@@ -8321,8 +8314,8 @@ var TabComponent = React36.forwardRef(
|
|
|
8321
8314
|
}
|
|
8322
8315
|
);
|
|
8323
8316
|
TabComponent.displayName = "Tab";
|
|
8324
|
-
var Tab =
|
|
8325
|
-
var TabsContentComponent =
|
|
8317
|
+
var Tab = React37.memo(TabComponent);
|
|
8318
|
+
var TabsContentComponent = React37.forwardRef(
|
|
8326
8319
|
({ value, className, children }, ref) => {
|
|
8327
8320
|
var _a;
|
|
8328
8321
|
const { value: selectedValue, layoutGroupId } = useTabsContext();
|
|
@@ -8356,8 +8349,8 @@ var TabsContentComponent = React36.forwardRef(
|
|
|
8356
8349
|
}
|
|
8357
8350
|
);
|
|
8358
8351
|
TabsContentComponent.displayName = "TabsContent";
|
|
8359
|
-
var TabsContent =
|
|
8360
|
-
var TabsListComponent =
|
|
8352
|
+
var TabsContent = React37.memo(TabsContentComponent);
|
|
8353
|
+
var TabsListComponent = React37.forwardRef(
|
|
8361
8354
|
({
|
|
8362
8355
|
variant,
|
|
8363
8356
|
scrollable = false,
|
|
@@ -8368,12 +8361,12 @@ var TabsListComponent = React36.forwardRef(
|
|
|
8368
8361
|
}, ref) => {
|
|
8369
8362
|
const { layoutGroupId, value, setFocusedValue } = useTabsContext();
|
|
8370
8363
|
const listLayoutId = `${layoutGroupId}-list`;
|
|
8371
|
-
const listContextValue =
|
|
8364
|
+
const listContextValue = React37.useMemo(
|
|
8372
8365
|
() => ({ variant, scrollable }),
|
|
8373
8366
|
[variant, scrollable]
|
|
8374
8367
|
);
|
|
8375
8368
|
const bgColor = backgroundColor != null ? backgroundColor : "var(--md-sys-color-surface)";
|
|
8376
|
-
const handleBlur =
|
|
8369
|
+
const handleBlur = React37.useCallback(
|
|
8377
8370
|
(e) => {
|
|
8378
8371
|
const listEl = e.currentTarget;
|
|
8379
8372
|
if (listEl.contains(e.relatedTarget)) return;
|
|
@@ -8422,7 +8415,7 @@ var TabsListComponent = React36.forwardRef(
|
|
|
8422
8415
|
}
|
|
8423
8416
|
);
|
|
8424
8417
|
TabsListComponent.displayName = "TabsList";
|
|
8425
|
-
var TabsList =
|
|
8418
|
+
var TabsList = React37.memo(TabsListComponent);
|
|
8426
8419
|
|
|
8427
8420
|
// src/ui/toolbar/toolbar-colors.ts
|
|
8428
8421
|
var standardFloatingToolbarColors = {
|
|
@@ -8478,13 +8471,13 @@ function getToolbarColors(variant = "standard", customColors) {
|
|
|
8478
8471
|
return standardFloatingToolbarColors;
|
|
8479
8472
|
}
|
|
8480
8473
|
}
|
|
8481
|
-
var ToolbarContext =
|
|
8474
|
+
var ToolbarContext = React37.createContext(
|
|
8482
8475
|
null
|
|
8483
8476
|
);
|
|
8484
8477
|
function useToolbarContext() {
|
|
8485
|
-
return
|
|
8478
|
+
return React37.useContext(ToolbarContext);
|
|
8486
8479
|
}
|
|
8487
|
-
var BottomDockedToolbar =
|
|
8480
|
+
var BottomDockedToolbar = React37.forwardRef(
|
|
8488
8481
|
(_a, ref) => {
|
|
8489
8482
|
var _b = _a, {
|
|
8490
8483
|
variant = "standard",
|
|
@@ -8517,8 +8510,8 @@ var BottomDockedToolbar = React36.forwardRef(
|
|
|
8517
8510
|
const { scrollY } = useScroll(
|
|
8518
8511
|
scrollContainerRef ? { container: scrollContainerRef } : void 0
|
|
8519
8512
|
);
|
|
8520
|
-
const [isHidden, setIsHidden] =
|
|
8521
|
-
const lastScrollY =
|
|
8513
|
+
const [isHidden, setIsHidden] = React37.useState(false);
|
|
8514
|
+
const lastScrollY = React37.useRef(0);
|
|
8522
8515
|
useMotionValueEvent(scrollY, "change", (latest) => {
|
|
8523
8516
|
if (!hideOnScroll) return;
|
|
8524
8517
|
const diff = latest - lastScrollY.current;
|
|
@@ -8677,15 +8670,15 @@ function buildSlotVariants(xHidden, yHidden, isHorizontal) {
|
|
|
8677
8670
|
};
|
|
8678
8671
|
}
|
|
8679
8672
|
function applyItemClassName(nodes, itemClassName) {
|
|
8680
|
-
return
|
|
8681
|
-
if (!
|
|
8673
|
+
return React37.Children.map(nodes, (child) => {
|
|
8674
|
+
if (!React37.isValidElement(child)) return child;
|
|
8682
8675
|
const element = child;
|
|
8683
|
-
return
|
|
8676
|
+
return React37.cloneElement(element, {
|
|
8684
8677
|
className: cn(element.props.className, itemClassName)
|
|
8685
8678
|
});
|
|
8686
8679
|
});
|
|
8687
8680
|
}
|
|
8688
|
-
var FloatingToolbarBase =
|
|
8681
|
+
var FloatingToolbarBase = React37.forwardRef(
|
|
8689
8682
|
(_a, ref) => {
|
|
8690
8683
|
var _b = _a, {
|
|
8691
8684
|
expanded,
|
|
@@ -8857,11 +8850,11 @@ var FloatingToolbarBase = React36.forwardRef(
|
|
|
8857
8850
|
}
|
|
8858
8851
|
);
|
|
8859
8852
|
FloatingToolbarBase.displayName = "FloatingToolbarBase";
|
|
8860
|
-
var HorizontalFloatingToolbar =
|
|
8853
|
+
var HorizontalFloatingToolbar = React37.forwardRef((props, ref) => /* @__PURE__ */ jsx(FloatingToolbarBase, __spreadValues({ ref, orientation: "horizontal" }, props)));
|
|
8861
8854
|
HorizontalFloatingToolbar.displayName = "HorizontalFloatingToolbar";
|
|
8862
|
-
var VerticalFloatingToolbar =
|
|
8855
|
+
var VerticalFloatingToolbar = React37.forwardRef((props, ref) => /* @__PURE__ */ jsx(FloatingToolbarBase, __spreadValues({ ref, orientation: "vertical" }, props)));
|
|
8863
8856
|
VerticalFloatingToolbar.displayName = "VerticalFloatingToolbar";
|
|
8864
|
-
var FloatingToolbarWithFabBase =
|
|
8857
|
+
var FloatingToolbarWithFabBase = React37.forwardRef(
|
|
8865
8858
|
(_a, ref) => {
|
|
8866
8859
|
var _b = _a, {
|
|
8867
8860
|
expanded,
|
|
@@ -8989,9 +8982,9 @@ var FloatingToolbarWithFabBase = React36.forwardRef(
|
|
|
8989
8982
|
}
|
|
8990
8983
|
);
|
|
8991
8984
|
FloatingToolbarWithFabBase.displayName = "FloatingToolbarWithFabBase";
|
|
8992
|
-
var HorizontalFloatingToolbarWithFab =
|
|
8985
|
+
var HorizontalFloatingToolbarWithFab = React37.forwardRef((props, ref) => /* @__PURE__ */ jsx(FloatingToolbarWithFabBase, __spreadValues({ ref, orientation: "horizontal" }, props)));
|
|
8993
8986
|
HorizontalFloatingToolbarWithFab.displayName = "HorizontalFloatingToolbarWithFab";
|
|
8994
|
-
var VerticalFloatingToolbarWithFab =
|
|
8987
|
+
var VerticalFloatingToolbarWithFab = React37.forwardRef((props, ref) => /* @__PURE__ */ jsx(FloatingToolbarWithFabBase, __spreadValues({ ref, orientation: "vertical" }, props)));
|
|
8995
8988
|
VerticalFloatingToolbarWithFab.displayName = "VerticalFloatingToolbarWithFab";
|
|
8996
8989
|
var ToolbarDivider = ({
|
|
8997
8990
|
orientation: propsOrientation,
|
|
@@ -9027,7 +9020,7 @@ var VARIANT_TO_COLOR_STYLE = {
|
|
|
9027
9020
|
tonal: "tonal",
|
|
9028
9021
|
filled: "filled"
|
|
9029
9022
|
};
|
|
9030
|
-
var ToolbarIconButton =
|
|
9023
|
+
var ToolbarIconButton = React37.forwardRef(
|
|
9031
9024
|
(_a, ref) => {
|
|
9032
9025
|
var _b = _a, {
|
|
9033
9026
|
emphasis = "standard",
|
|
@@ -9199,7 +9192,7 @@ var MOTION_PROP_KEYS = [
|
|
|
9199
9192
|
"layoutId",
|
|
9200
9193
|
"onLayoutAnimationComplete"
|
|
9201
9194
|
];
|
|
9202
|
-
var ToolbarToggleButton =
|
|
9195
|
+
var ToolbarToggleButton = React37.forwardRef(
|
|
9203
9196
|
(_a, ref) => {
|
|
9204
9197
|
var _b = _a, {
|
|
9205
9198
|
emphasis = "standard",
|
|
@@ -9233,7 +9226,7 @@ var ToolbarToggleButton = React36.forwardRef(
|
|
|
9233
9226
|
"onPointerLeave"
|
|
9234
9227
|
]);
|
|
9235
9228
|
const context = useToolbarContext();
|
|
9236
|
-
const [isPressed, setIsPressed] =
|
|
9229
|
+
const [isPressed, setIsPressed] = React37.useState(false);
|
|
9237
9230
|
const {
|
|
9238
9231
|
ripples,
|
|
9239
9232
|
onPointerDown: handleRipplePointerDown,
|
|
@@ -9241,7 +9234,7 @@ var ToolbarToggleButton = React36.forwardRef(
|
|
|
9241
9234
|
} = useRippleState({
|
|
9242
9235
|
disabled: Boolean(disabled) || !ripple
|
|
9243
9236
|
});
|
|
9244
|
-
const handlePointerDown =
|
|
9237
|
+
const handlePointerDown = React37.useCallback(
|
|
9245
9238
|
(e) => {
|
|
9246
9239
|
setIsPressed(true);
|
|
9247
9240
|
if (!disabled && ripple) {
|
|
@@ -9251,14 +9244,14 @@ var ToolbarToggleButton = React36.forwardRef(
|
|
|
9251
9244
|
},
|
|
9252
9245
|
[disabled, ripple, handleRipplePointerDown, onPointerDownProp]
|
|
9253
9246
|
);
|
|
9254
|
-
const handlePointerUp =
|
|
9247
|
+
const handlePointerUp = React37.useCallback(
|
|
9255
9248
|
(e) => {
|
|
9256
9249
|
setIsPressed(false);
|
|
9257
9250
|
onPointerUpProp == null ? void 0 : onPointerUpProp(e);
|
|
9258
9251
|
},
|
|
9259
9252
|
[onPointerUpProp]
|
|
9260
9253
|
);
|
|
9261
|
-
const handlePointerLeave =
|
|
9254
|
+
const handlePointerLeave = React37.useCallback(
|
|
9262
9255
|
(e) => {
|
|
9263
9256
|
setIsPressed(false);
|
|
9264
9257
|
onPointerLeaveProp == null ? void 0 : onPointerLeaveProp(e);
|
|
@@ -9277,14 +9270,14 @@ var ToolbarToggleButton = React36.forwardRef(
|
|
|
9277
9270
|
context == null ? void 0 : context.itemClassName,
|
|
9278
9271
|
className
|
|
9279
9272
|
);
|
|
9280
|
-
const animateConfig =
|
|
9273
|
+
const animateConfig = React37.useMemo(
|
|
9281
9274
|
() => ({
|
|
9282
9275
|
scaleX: pressExpand && isPressed ? 1 + pressExpandRatio : 1,
|
|
9283
9276
|
borderRadius: isPressed ? ToolbarToggleButtonRadiusTokens.pressedRadius : ToolbarToggleButtonRadiusTokens.pillRadius
|
|
9284
9277
|
}),
|
|
9285
9278
|
[pressExpand, pressExpandRatio, isPressed]
|
|
9286
9279
|
);
|
|
9287
|
-
const transitionConfig =
|
|
9280
|
+
const transitionConfig = React37.useMemo(
|
|
9288
9281
|
() => ({
|
|
9289
9282
|
scaleX: FAST_SPATIAL_SPRING,
|
|
9290
9283
|
borderRadius: BUTTON_RADIUS_SPRING
|
|
@@ -9306,7 +9299,7 @@ var ToolbarToggleButton = React36.forwardRef(
|
|
|
9306
9299
|
children && (typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx("span", { children }) : children)
|
|
9307
9300
|
] });
|
|
9308
9301
|
if (asChild) {
|
|
9309
|
-
const child =
|
|
9302
|
+
const child = React37.Children.only(children);
|
|
9310
9303
|
const childContent = child.props.children;
|
|
9311
9304
|
const innerChildContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9312
9305
|
ripple && /* @__PURE__ */ jsx(
|
|
@@ -9345,7 +9338,7 @@ var ToolbarToggleButton = React36.forwardRef(
|
|
|
9345
9338
|
onPointerUp: handlePointerUp,
|
|
9346
9339
|
onPointerLeave: handlePointerLeave
|
|
9347
9340
|
}, strippedProps), {
|
|
9348
|
-
children:
|
|
9341
|
+
children: React37.cloneElement(child, { children: innerChildContent })
|
|
9349
9342
|
})
|
|
9350
9343
|
) });
|
|
9351
9344
|
}
|