@tinybigui/react 0.22.0 → 0.24.0
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/README.md +16 -16
- package/dist/index.cjs +970 -546
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +440 -106
- package/dist/index.d.ts +440 -106
- package/dist/index.js +955 -546
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -19
- package/dist/styles.css.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -9,8 +9,8 @@ var classVarianceAuthority = require('class-variance-authority');
|
|
|
9
9
|
var reactAria = require('react-aria');
|
|
10
10
|
var utils = require('@react-aria/utils');
|
|
11
11
|
var reactStately = require('react-stately');
|
|
12
|
-
var reactAriaComponents = require('react-aria-components');
|
|
13
12
|
var reactDom = require('react-dom');
|
|
13
|
+
var reactAriaComponents = require('react-aria-components');
|
|
14
14
|
var date = require('@internationalized/date');
|
|
15
15
|
|
|
16
16
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -472,6 +472,10 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
472
472
|
* Filled/Tonal hover→level-1, focus/pressed→level-0
|
|
473
473
|
* Elevated base→level-1, hover→level-2, focus/pressed→level-1
|
|
474
474
|
* Outlined/Text no elevation
|
|
475
|
+
*
|
|
476
|
+
* Self-targeting `data-[x]:` is used for elevation because these classes
|
|
477
|
+
* sit on the root element (the group host) — group-data descendant
|
|
478
|
+
* selectors cannot match an element against itself.
|
|
475
479
|
*/
|
|
476
480
|
variant: {
|
|
477
481
|
/**
|
|
@@ -480,17 +484,17 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
480
484
|
* Elevation: 0 base → 1 hover → 0 focus → 0 pressed
|
|
481
485
|
*/
|
|
482
486
|
filled: [
|
|
483
|
-
"
|
|
487
|
+
"text-on-primary shadow-none",
|
|
484
488
|
// Hover: gains level-1 elevation
|
|
485
|
-
"
|
|
489
|
+
"data-[hovered]:shadow-elevation-1",
|
|
486
490
|
// Focus/pressed: shadow must explicitly return to level-0
|
|
487
491
|
// (doubled attribute selector → higher specificity than hover)
|
|
488
|
-
"
|
|
489
|
-
"
|
|
490
|
-
// Disabled overrides
|
|
491
|
-
|
|
492
|
-
"
|
|
493
|
-
"
|
|
492
|
+
"data-[focus-visible]:data-[focus-visible]:shadow-none",
|
|
493
|
+
"data-[pressed]:data-[pressed]:data-[pressed]:shadow-none",
|
|
494
|
+
// Disabled overrides — root owns text color + shadow only;
|
|
495
|
+
// disabled bg override lives on buttonContainerVariants (filled variant)
|
|
496
|
+
"data-[disabled]:text-on-surface/38",
|
|
497
|
+
"data-[disabled]:shadow-none"
|
|
494
498
|
],
|
|
495
499
|
/**
|
|
496
500
|
* Outlined — medium emphasis. Transparent with border.
|
|
@@ -498,10 +502,10 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
498
502
|
* Elevation: always 0
|
|
499
503
|
*/
|
|
500
504
|
outlined: [
|
|
501
|
-
"
|
|
505
|
+
"border border-outline text-primary",
|
|
502
506
|
// Disabled overrides
|
|
503
|
-
"
|
|
504
|
-
"
|
|
507
|
+
"data-[disabled]:border-on-surface/12",
|
|
508
|
+
"data-[disabled]:text-on-surface/38"
|
|
505
509
|
],
|
|
506
510
|
/**
|
|
507
511
|
* Tonal — secondary emphasis.
|
|
@@ -509,16 +513,15 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
509
513
|
* Elevation: 0 base → 1 hover → 0 focus → 0 pressed
|
|
510
514
|
*/
|
|
511
515
|
tonal: [
|
|
512
|
-
"
|
|
516
|
+
"text-on-secondary-container shadow-none",
|
|
513
517
|
// Hover: gains level-1 elevation (same as filled)
|
|
514
|
-
"
|
|
518
|
+
"data-[hovered]:shadow-elevation-1",
|
|
515
519
|
// Focus/pressed: return to level-0
|
|
516
|
-
"
|
|
517
|
-
"
|
|
520
|
+
"data-[focus-visible]:data-[focus-visible]:shadow-none",
|
|
521
|
+
"data-[pressed]:data-[pressed]:data-[pressed]:shadow-none",
|
|
518
522
|
// Disabled overrides
|
|
519
|
-
"
|
|
520
|
-
"
|
|
521
|
-
"group-data-[disabled]/button:shadow-none"
|
|
523
|
+
"data-[disabled]:text-on-surface/38",
|
|
524
|
+
"data-[disabled]:shadow-none"
|
|
522
525
|
],
|
|
523
526
|
/**
|
|
524
527
|
* Elevated — separation via shadow.
|
|
@@ -526,17 +529,16 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
526
529
|
* Elevation: 1 base → 2 hover → 1 focus → 1 pressed
|
|
527
530
|
*/
|
|
528
531
|
elevated: [
|
|
529
|
-
"
|
|
532
|
+
"text-primary shadow-elevation-1",
|
|
530
533
|
// Hover: gains extra elevation
|
|
531
|
-
"
|
|
534
|
+
"data-[hovered]:shadow-elevation-2",
|
|
532
535
|
// Focus/pressed: return to base level-1
|
|
533
536
|
// (doubled selector wins over single hover selector at same cascade position)
|
|
534
|
-
"
|
|
535
|
-
"
|
|
537
|
+
"data-[focus-visible]:data-[focus-visible]:shadow-elevation-1",
|
|
538
|
+
"data-[pressed]:data-[pressed]:data-[pressed]:shadow-elevation-1",
|
|
536
539
|
// Disabled overrides
|
|
537
|
-
"
|
|
538
|
-
"
|
|
539
|
-
"group-data-[disabled]/button:shadow-none"
|
|
540
|
+
"data-[disabled]:text-on-surface/38",
|
|
541
|
+
"data-[disabled]:shadow-none"
|
|
540
542
|
],
|
|
541
543
|
/**
|
|
542
544
|
* Text — lowest emphasis.
|
|
@@ -544,9 +546,9 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
544
546
|
* Elevation: always 0
|
|
545
547
|
*/
|
|
546
548
|
text: [
|
|
547
|
-
"
|
|
549
|
+
"text-primary",
|
|
548
550
|
// Disabled overrides
|
|
549
|
-
"
|
|
551
|
+
"data-[disabled]:text-on-surface/38"
|
|
550
552
|
]
|
|
551
553
|
},
|
|
552
554
|
/**
|
|
@@ -584,6 +586,29 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
584
586
|
}
|
|
585
587
|
}
|
|
586
588
|
);
|
|
589
|
+
var buttonContainerVariants = classVarianceAuthority.cva(
|
|
590
|
+
[
|
|
591
|
+
"absolute inset-0 rounded-[inherit] pointer-events-none",
|
|
592
|
+
// Effects transition for background-color — no overshoot
|
|
593
|
+
"transition-[background-color] duration-spring-standard-fast-effects ease-spring-standard-fast-effects"
|
|
594
|
+
],
|
|
595
|
+
{
|
|
596
|
+
variants: {
|
|
597
|
+
variant: {
|
|
598
|
+
// MD3 disabled: filled containers replace bg with on-surface/12.
|
|
599
|
+
// group-data descendant selector targets this child span (not the root host).
|
|
600
|
+
filled: "bg-primary group-data-[disabled]/button:bg-on-surface/12",
|
|
601
|
+
// outlined/text: container stays transparent when disabled — only border + label fade.
|
|
602
|
+
outlined: "bg-transparent",
|
|
603
|
+
// MD3 disabled: tonal and elevated containers also replace bg with on-surface/12.
|
|
604
|
+
tonal: "bg-secondary-container group-data-[disabled]/button:bg-on-surface/12",
|
|
605
|
+
elevated: "bg-surface-container-low group-data-[disabled]/button:bg-on-surface/12",
|
|
606
|
+
text: "bg-transparent"
|
|
607
|
+
}
|
|
608
|
+
},
|
|
609
|
+
defaultVariants: { variant: "filled" }
|
|
610
|
+
}
|
|
611
|
+
);
|
|
587
612
|
var buttonStateLayerVariants = classVarianceAuthority.cva(
|
|
588
613
|
[
|
|
589
614
|
"absolute inset-0 rounded-[inherit] overflow-hidden pointer-events-none opacity-0",
|
|
@@ -886,6 +911,7 @@ var Button = React.forwardRef(
|
|
|
886
911
|
className
|
|
887
912
|
),
|
|
888
913
|
children: [
|
|
914
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(buttonContainerVariants({ variant })), "aria-hidden": "true" }),
|
|
889
915
|
ripples,
|
|
890
916
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(buttonStateLayerVariants({ variant })), "aria-hidden": "true" }),
|
|
891
917
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(buttonFocusRingVariants()), "aria-hidden": "true" }),
|
|
@@ -4393,7 +4419,51 @@ var NavigationBarItem = React.forwardRef(
|
|
|
4393
4419
|
);
|
|
4394
4420
|
NavigationBarItem.displayName = "NavigationBarItem";
|
|
4395
4421
|
var DrawerContext = React.createContext(null);
|
|
4396
|
-
var
|
|
4422
|
+
var ModalDrawerPanel = ({
|
|
4423
|
+
ariaLabel,
|
|
4424
|
+
onClose,
|
|
4425
|
+
className,
|
|
4426
|
+
animationState,
|
|
4427
|
+
getAnimationClassName,
|
|
4428
|
+
onTransitionEnd,
|
|
4429
|
+
forwardedRef,
|
|
4430
|
+
children
|
|
4431
|
+
}) => {
|
|
4432
|
+
const panelRef = React.useRef(null);
|
|
4433
|
+
reactAria.usePreventScroll();
|
|
4434
|
+
const { dialogProps } = reactAria.useDialog(
|
|
4435
|
+
{ "aria-label": ariaLabel },
|
|
4436
|
+
panelRef
|
|
4437
|
+
);
|
|
4438
|
+
const { overlayProps } = reactAria.useOverlay(
|
|
4439
|
+
{ isOpen: true, onClose, isDismissable: true, shouldCloseOnBlur: false },
|
|
4440
|
+
panelRef
|
|
4441
|
+
);
|
|
4442
|
+
const setRef = React.useCallback(
|
|
4443
|
+
(node) => {
|
|
4444
|
+
panelRef.current = node;
|
|
4445
|
+
if (typeof forwardedRef === "function") {
|
|
4446
|
+
forwardedRef(node);
|
|
4447
|
+
} else if (forwardedRef !== null && forwardedRef !== void 0) {
|
|
4448
|
+
forwardedRef.current = node;
|
|
4449
|
+
}
|
|
4450
|
+
},
|
|
4451
|
+
[forwardedRef]
|
|
4452
|
+
);
|
|
4453
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4454
|
+
"div",
|
|
4455
|
+
{
|
|
4456
|
+
...utils.mergeProps(overlayProps, dialogProps),
|
|
4457
|
+
ref: setRef,
|
|
4458
|
+
"aria-modal": "true",
|
|
4459
|
+
className: cn(className, getAnimationClassName?.(animationState)),
|
|
4460
|
+
"data-animation-state": animationState,
|
|
4461
|
+
onTransitionEnd,
|
|
4462
|
+
children
|
|
4463
|
+
}
|
|
4464
|
+
);
|
|
4465
|
+
};
|
|
4466
|
+
ModalDrawerPanel.displayName = "ModalDrawerPanel";
|
|
4397
4467
|
var HeadlessDrawer = React.forwardRef(
|
|
4398
4468
|
({
|
|
4399
4469
|
variant = "standard",
|
|
@@ -4404,8 +4474,9 @@ var HeadlessDrawer = React.forwardRef(
|
|
|
4404
4474
|
children,
|
|
4405
4475
|
className,
|
|
4406
4476
|
scrimClassName,
|
|
4407
|
-
|
|
4408
|
-
|
|
4477
|
+
getAnimationClassName,
|
|
4478
|
+
getScrimAnimationClassName,
|
|
4479
|
+
disableRipple = false
|
|
4409
4480
|
}, ref) => {
|
|
4410
4481
|
const state = reactStately.useOverlayTriggerState({
|
|
4411
4482
|
...open !== void 0 ? { isOpen: open } : {},
|
|
@@ -4416,77 +4487,99 @@ var HeadlessDrawer = React.forwardRef(
|
|
|
4416
4487
|
const close = React.useCallback(() => {
|
|
4417
4488
|
state.close();
|
|
4418
4489
|
}, [state]);
|
|
4490
|
+
const [animationState, setAnimationState] = React.useState("exited");
|
|
4491
|
+
const closedRef = React.useRef(false);
|
|
4492
|
+
const exitFallbackRef = React.useRef(null);
|
|
4493
|
+
React.useEffect(() => {
|
|
4494
|
+
if (!isOpen) return;
|
|
4495
|
+
closedRef.current = false;
|
|
4496
|
+
setAnimationState("entering");
|
|
4497
|
+
const id = setTimeout(() => {
|
|
4498
|
+
setAnimationState("visible");
|
|
4499
|
+
}, 0);
|
|
4500
|
+
return () => clearTimeout(id);
|
|
4501
|
+
}, [isOpen]);
|
|
4502
|
+
React.useEffect(() => {
|
|
4503
|
+
if (isOpen) return;
|
|
4504
|
+
if (animationState === "exited" || animationState === "entering") return;
|
|
4505
|
+
if (animationState === "visible") {
|
|
4506
|
+
setAnimationState("exiting");
|
|
4507
|
+
exitFallbackRef.current = setTimeout(() => {
|
|
4508
|
+
if (!closedRef.current) {
|
|
4509
|
+
closedRef.current = true;
|
|
4510
|
+
setAnimationState("exited");
|
|
4511
|
+
}
|
|
4512
|
+
}, 500);
|
|
4513
|
+
}
|
|
4514
|
+
}, [isOpen, animationState]);
|
|
4515
|
+
React.useEffect(
|
|
4516
|
+
() => () => {
|
|
4517
|
+
if (exitFallbackRef.current !== null) {
|
|
4518
|
+
clearTimeout(exitFallbackRef.current);
|
|
4519
|
+
}
|
|
4520
|
+
},
|
|
4521
|
+
[]
|
|
4522
|
+
);
|
|
4523
|
+
const handleTransitionEnd = React.useCallback(() => {
|
|
4524
|
+
if (animationState === "exiting" && !closedRef.current) {
|
|
4525
|
+
if (exitFallbackRef.current !== null) {
|
|
4526
|
+
clearTimeout(exitFallbackRef.current);
|
|
4527
|
+
exitFallbackRef.current = null;
|
|
4528
|
+
}
|
|
4529
|
+
closedRef.current = true;
|
|
4530
|
+
setAnimationState("exited");
|
|
4531
|
+
}
|
|
4532
|
+
}, [animationState]);
|
|
4419
4533
|
const contextValue = {
|
|
4420
4534
|
isOpen,
|
|
4421
4535
|
close,
|
|
4422
|
-
disableRipple
|
|
4423
|
-
iconOnly
|
|
4536
|
+
disableRipple
|
|
4424
4537
|
};
|
|
4425
|
-
if (variant === "
|
|
4426
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DrawerContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactAria.FocusScope, { contain: true, restoreFocus: true, autoFocus: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4437
|
-
ModalDrawerPanel,
|
|
4438
|
-
{
|
|
4439
|
-
ariaLabel,
|
|
4440
|
-
onClose: () => state.close(),
|
|
4441
|
-
className,
|
|
4442
|
-
children
|
|
4443
|
-
}
|
|
4444
|
-
) })
|
|
4445
|
-
] }) }) });
|
|
4538
|
+
if (variant === "standard") {
|
|
4539
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DrawerContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4540
|
+
"nav",
|
|
4541
|
+
{
|
|
4542
|
+
ref,
|
|
4543
|
+
role: "navigation",
|
|
4544
|
+
"aria-label": ariaLabel,
|
|
4545
|
+
className,
|
|
4546
|
+
children
|
|
4547
|
+
}
|
|
4548
|
+
) });
|
|
4446
4549
|
}
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4550
|
+
if (!isOpen && animationState === "exited") {
|
|
4551
|
+
return null;
|
|
4552
|
+
}
|
|
4553
|
+
if (typeof document === "undefined") return null;
|
|
4554
|
+
const content = /* @__PURE__ */ jsxRuntime.jsx(DrawerContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(reactAria.FocusScope, { contain: true, restoreFocus: true, autoFocus: true, children: [
|
|
4555
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4556
|
+
"div",
|
|
4557
|
+
{
|
|
4558
|
+
"data-testid": "drawer-scrim",
|
|
4559
|
+
className: cn(scrimClassName, getScrimAnimationClassName?.(animationState)),
|
|
4560
|
+
"data-animation-state": animationState,
|
|
4561
|
+
onClick: close,
|
|
4562
|
+
"aria-hidden": "true"
|
|
4563
|
+
}
|
|
4564
|
+
),
|
|
4565
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4566
|
+
ModalDrawerPanel,
|
|
4567
|
+
{
|
|
4568
|
+
ariaLabel,
|
|
4569
|
+
onClose: close,
|
|
4570
|
+
className,
|
|
4571
|
+
animationState,
|
|
4572
|
+
getAnimationClassName,
|
|
4573
|
+
onTransitionEnd: handleTransitionEnd,
|
|
4574
|
+
forwardedRef: ref,
|
|
4575
|
+
children
|
|
4576
|
+
}
|
|
4577
|
+
)
|
|
4578
|
+
] }) });
|
|
4579
|
+
return reactDom.createPortal(content, document.body);
|
|
4457
4580
|
}
|
|
4458
4581
|
);
|
|
4459
4582
|
HeadlessDrawer.displayName = "HeadlessDrawer";
|
|
4460
|
-
var ModalDrawerPanel = ({
|
|
4461
|
-
ariaLabel,
|
|
4462
|
-
onClose,
|
|
4463
|
-
className,
|
|
4464
|
-
children
|
|
4465
|
-
}) => {
|
|
4466
|
-
const panelRef = React.useRef(null);
|
|
4467
|
-
reactAria.usePreventScroll();
|
|
4468
|
-
const { dialogProps } = reactAria.useDialog({ "aria-label": ariaLabel }, panelRef);
|
|
4469
|
-
const { overlayProps } = reactAria.useOverlay(
|
|
4470
|
-
{
|
|
4471
|
-
isOpen: true,
|
|
4472
|
-
onClose,
|
|
4473
|
-
isDismissable: true,
|
|
4474
|
-
shouldCloseOnBlur: false
|
|
4475
|
-
},
|
|
4476
|
-
panelRef
|
|
4477
|
-
);
|
|
4478
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4479
|
-
"div",
|
|
4480
|
-
{
|
|
4481
|
-
...utils.mergeProps(overlayProps, dialogProps),
|
|
4482
|
-
ref: panelRef,
|
|
4483
|
-
className,
|
|
4484
|
-
"aria-modal": "true",
|
|
4485
|
-
children
|
|
4486
|
-
}
|
|
4487
|
-
);
|
|
4488
|
-
};
|
|
4489
|
-
ModalDrawerPanel.displayName = "ModalDrawerPanel";
|
|
4490
4583
|
var HeadlessDrawerItem = React.forwardRef(
|
|
4491
4584
|
({
|
|
4492
4585
|
href,
|
|
@@ -4504,7 +4597,6 @@ var HeadlessDrawerItem = React.forwardRef(
|
|
|
4504
4597
|
...restProps
|
|
4505
4598
|
}, forwardedRef) => {
|
|
4506
4599
|
const internalRef = React.useRef(null);
|
|
4507
|
-
const { isFocusVisible, focusProps } = reactAria.useFocusRing();
|
|
4508
4600
|
if (href) {
|
|
4509
4601
|
const linkRef = forwardedRef ?? internalRef;
|
|
4510
4602
|
const { linkProps } = reactAria.useLink(
|
|
@@ -4518,14 +4610,12 @@ var HeadlessDrawerItem = React.forwardRef(
|
|
|
4518
4610
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4519
4611
|
"a",
|
|
4520
4612
|
{
|
|
4521
|
-
...utils.mergeProps(linkProps,
|
|
4613
|
+
...utils.mergeProps(linkProps, { onMouseDown }),
|
|
4522
4614
|
ref: linkRef,
|
|
4523
4615
|
href,
|
|
4524
4616
|
className,
|
|
4525
4617
|
title,
|
|
4526
4618
|
"aria-current": isActive ? "page" : void 0,
|
|
4527
|
-
"data-focus-visible": isFocusVisible || void 0,
|
|
4528
|
-
"data-active": isActive || void 0,
|
|
4529
4619
|
children
|
|
4530
4620
|
}
|
|
4531
4621
|
);
|
|
@@ -4548,13 +4638,11 @@ var HeadlessDrawerItem = React.forwardRef(
|
|
|
4548
4638
|
"button",
|
|
4549
4639
|
{
|
|
4550
4640
|
type: "button",
|
|
4551
|
-
...utils.mergeProps(buttonProps,
|
|
4641
|
+
...utils.mergeProps(buttonProps, { onMouseDown }),
|
|
4552
4642
|
ref: buttonRef,
|
|
4553
4643
|
className,
|
|
4554
4644
|
title,
|
|
4555
4645
|
"aria-current": isActive ? "page" : void 0,
|
|
4556
|
-
"data-focus-visible": isFocusVisible || void 0,
|
|
4557
|
-
"data-active": isActive || void 0,
|
|
4558
4646
|
children
|
|
4559
4647
|
}
|
|
4560
4648
|
);
|
|
@@ -4649,120 +4737,195 @@ var drawerVariants = classVarianceAuthority.cva(
|
|
|
4649
4737
|
// Layout
|
|
4650
4738
|
"fixed top-0 left-0 h-full",
|
|
4651
4739
|
"flex flex-col overflow-y-auto",
|
|
4652
|
-
//
|
|
4740
|
+
// Width — 360dp per MD3 spec
|
|
4741
|
+
"w-drawer",
|
|
4742
|
+
// Stacking
|
|
4653
4743
|
"z-50",
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
"transition-transform duration-medium4 ease-emphasized-decelerate",
|
|
4744
|
+
// Container padding — 12dp per MD3 nav drawer spec
|
|
4745
|
+
"px-3 py-3",
|
|
4657
4746
|
// Focus outline removal (focus management handled by FocusScope / React Aria)
|
|
4658
|
-
"outline-none"
|
|
4659
|
-
// Padding for content spacing
|
|
4660
|
-
"px-3"
|
|
4747
|
+
"outline-none"
|
|
4661
4748
|
],
|
|
4662
4749
|
{
|
|
4663
4750
|
variants: {
|
|
4664
4751
|
/**
|
|
4665
|
-
* Structural variant — drives
|
|
4666
|
-
*
|
|
4667
|
-
* - `
|
|
4752
|
+
* Structural variant — drives shape and elevation.
|
|
4753
|
+
*
|
|
4754
|
+
* - `standard`: flush left panel, square trailing edge, flat surface.
|
|
4755
|
+
* - `modal`: overlay dialog, 16dp trailing corner, shadow-elevation-1.
|
|
4668
4756
|
*/
|
|
4669
4757
|
variant: {
|
|
4670
|
-
standard: ["bg-surface-container-low"],
|
|
4671
|
-
modal: ["bg-surface-container", "shadow-elevation-1"]
|
|
4758
|
+
standard: ["bg-surface-container-low", "rounded-none"],
|
|
4759
|
+
modal: ["bg-surface-container-low", "rounded-r-lg", "shadow-elevation-1"]
|
|
4672
4760
|
},
|
|
4673
4761
|
/**
|
|
4674
|
-
* Open/closed state — drives translation.
|
|
4675
|
-
*
|
|
4676
|
-
*
|
|
4762
|
+
* Open/closed state — drives translation for the STANDARD variant only.
|
|
4763
|
+
*
|
|
4764
|
+
* Standard slide: spatial on-screen property → spring-standard-default-spatial.
|
|
4765
|
+
* Modal enter/exit is handled externally via drawerAnimationVariants + portal gate.
|
|
4766
|
+
*
|
|
4767
|
+
* - `true`: translate-x-0 (visible)
|
|
4768
|
+
* - `false`: -translate-x-full (off-screen to the left)
|
|
4677
4769
|
*/
|
|
4678
4770
|
open: {
|
|
4679
|
-
true: [
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4771
|
+
true: [
|
|
4772
|
+
"translate-x-0",
|
|
4773
|
+
"transition-transform",
|
|
4774
|
+
"duration-spring-standard-default-spatial",
|
|
4775
|
+
"ease-spring-standard-default-spatial"
|
|
4776
|
+
],
|
|
4777
|
+
false: [
|
|
4778
|
+
"-translate-x-full",
|
|
4779
|
+
"transition-transform",
|
|
4780
|
+
"duration-spring-standard-default-spatial",
|
|
4781
|
+
"ease-spring-standard-default-spatial"
|
|
4782
|
+
]
|
|
4690
4783
|
}
|
|
4691
4784
|
},
|
|
4692
4785
|
defaultVariants: {
|
|
4693
4786
|
variant: "standard",
|
|
4694
|
-
open: false
|
|
4695
|
-
iconOnly: false
|
|
4787
|
+
open: false
|
|
4696
4788
|
}
|
|
4697
4789
|
}
|
|
4698
4790
|
);
|
|
4699
|
-
var
|
|
4791
|
+
var drawerAnimationVariants = classVarianceAuthority.cva("", {
|
|
4792
|
+
variants: {
|
|
4793
|
+
animationState: {
|
|
4794
|
+
// Mount frame: invisible until animation starts
|
|
4795
|
+
entering: ["opacity-0"],
|
|
4796
|
+
// Entry animation: slide in from the left edge
|
|
4797
|
+
visible: ["animate-md-slide-in-left"],
|
|
4798
|
+
// Exit animation: slide out to the left
|
|
4799
|
+
exiting: ["animate-md-slide-out-left"],
|
|
4800
|
+
// Portal gate removes element; classes below act as a safety net
|
|
4801
|
+
exited: ["opacity-0", "pointer-events-none"]
|
|
4802
|
+
}
|
|
4803
|
+
},
|
|
4804
|
+
defaultVariants: {
|
|
4805
|
+
animationState: "entering"
|
|
4806
|
+
}
|
|
4807
|
+
});
|
|
4808
|
+
var drawerScrimAnimationVariants = classVarianceAuthority.cva(
|
|
4700
4809
|
[
|
|
4701
|
-
|
|
4702
|
-
"
|
|
4703
|
-
"
|
|
4704
|
-
"rounded-full",
|
|
4705
|
-
// Typography
|
|
4706
|
-
"text-label-large",
|
|
4707
|
-
// Interaction
|
|
4708
|
-
"cursor-pointer select-none outline-none",
|
|
4709
|
-
// State layer pseudo-element (z-[1] above active indicator)
|
|
4710
|
-
"before:absolute before:inset-0 before:rounded-full before:z-[1]",
|
|
4711
|
-
"before:transition-opacity before:duration-short2 before:ease-standard",
|
|
4712
|
-
"before:opacity-0",
|
|
4713
|
-
// Hover and focus visible state layers
|
|
4714
|
-
"hover:before:opacity-8",
|
|
4715
|
-
"focus-visible:before:opacity-12",
|
|
4716
|
-
// Active pressed state
|
|
4717
|
-
"active:before:opacity-12",
|
|
4718
|
-
// Transition for color changes
|
|
4719
|
-
"transition-colors duration-short2 ease-standard"
|
|
4810
|
+
"transition-opacity",
|
|
4811
|
+
"duration-spring-standard-fast-effects",
|
|
4812
|
+
"ease-spring-standard-fast-effects"
|
|
4720
4813
|
],
|
|
4721
4814
|
{
|
|
4722
4815
|
variants: {
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
*/
|
|
4729
|
-
isActive: {
|
|
4730
|
-
true: [
|
|
4731
|
-
"text-on-secondary-container",
|
|
4732
|
-
"before:bg-on-secondary-container",
|
|
4733
|
-
// Active indicator — 336dp pill via after: pseudo
|
|
4734
|
-
"after:absolute after:inset-0 after:mx-auto after:max-w-[336px]",
|
|
4735
|
-
"after:rounded-full after:bg-secondary-container"
|
|
4736
|
-
],
|
|
4737
|
-
false: ["bg-transparent", "text-on-surface-variant", "before:bg-on-surface-variant"]
|
|
4738
|
-
},
|
|
4739
|
-
/**
|
|
4740
|
-
* Whether the item is disabled.
|
|
4741
|
-
* Applies `opacity-38` per MD3 disabled state spec.
|
|
4742
|
-
*/
|
|
4743
|
-
isDisabled: {
|
|
4744
|
-
true: ["opacity-38 cursor-not-allowed pointer-events-none"],
|
|
4745
|
-
false: []
|
|
4816
|
+
animationState: {
|
|
4817
|
+
entering: ["opacity-0"],
|
|
4818
|
+
visible: ["opacity-32"],
|
|
4819
|
+
exiting: ["opacity-0"],
|
|
4820
|
+
exited: ["opacity-0", "pointer-events-none"]
|
|
4746
4821
|
}
|
|
4747
4822
|
},
|
|
4748
4823
|
defaultVariants: {
|
|
4749
|
-
|
|
4750
|
-
isDisabled: false
|
|
4824
|
+
animationState: "entering"
|
|
4751
4825
|
}
|
|
4752
4826
|
}
|
|
4753
4827
|
);
|
|
4754
|
-
var
|
|
4755
|
-
|
|
4756
|
-
"
|
|
4757
|
-
"
|
|
4828
|
+
var drawerItemVariants = classVarianceAuthority.cva([
|
|
4829
|
+
// Layout
|
|
4830
|
+
"relative flex w-full items-center",
|
|
4831
|
+
"h-14 pl-4 pr-6 gap-3",
|
|
4832
|
+
// Shape
|
|
4833
|
+
"rounded-full",
|
|
4834
|
+
// Typography — Label Large per MD3 spec (size via text-label-large, weight + tracking explicit)
|
|
4835
|
+
"text-label-large",
|
|
4836
|
+
"font-medium",
|
|
4837
|
+
"tracking-[0.1px]",
|
|
4838
|
+
// Interaction
|
|
4839
|
+
"cursor-pointer select-none outline-none",
|
|
4840
|
+
// Color transition (effects — no overshoot)
|
|
4841
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
4842
|
+
// Inactive content color (icon/label/badge inherit this via currentColor)
|
|
4843
|
+
"text-on-surface-variant",
|
|
4844
|
+
// Active content color — self-targeting data-[active]: (root is the group host)
|
|
4845
|
+
"data-[active]:text-on-secondary-container",
|
|
4846
|
+
// Disabled — self-targeting
|
|
4847
|
+
"data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed",
|
|
4848
|
+
"data-[disabled]:text-on-surface/38"
|
|
4758
4849
|
]);
|
|
4759
|
-
var
|
|
4760
|
-
|
|
4761
|
-
"
|
|
4762
|
-
|
|
4763
|
-
"
|
|
4850
|
+
var drawerItemActiveIndicatorVariants = classVarianceAuthority.cva([
|
|
4851
|
+
"absolute inset-0 rounded-[inherit] pointer-events-none",
|
|
4852
|
+
"bg-secondary-container",
|
|
4853
|
+
// Effects transition for opacity — no overshoot
|
|
4854
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
4855
|
+
// Hidden when inactive; shown when active
|
|
4856
|
+
"opacity-0",
|
|
4857
|
+
"group-data-[active]/draweritem:opacity-100",
|
|
4858
|
+
// z-0: below state layer (z-[1]) and content (z-10)
|
|
4859
|
+
"z-0"
|
|
4860
|
+
]);
|
|
4861
|
+
var drawerItemStateLayerVariants = classVarianceAuthority.cva([
|
|
4862
|
+
"absolute inset-0 rounded-[inherit] overflow-hidden pointer-events-none opacity-0",
|
|
4863
|
+
// Effects transition — opacity must NOT overshoot
|
|
4864
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
4865
|
+
// Color: inactive uses on-surface-variant; active switches to on-secondary-container
|
|
4866
|
+
"bg-on-surface-variant",
|
|
4867
|
+
"group-data-[active]/draweritem:bg-on-secondary-container",
|
|
4868
|
+
// Hover: 8%
|
|
4869
|
+
"group-data-[hovered]/draweritem:opacity-8",
|
|
4870
|
+
// Focus-visible: 10% (MD3 focus state layer)
|
|
4871
|
+
"group-data-[focus-visible]/draweritem:opacity-10",
|
|
4872
|
+
// Pressed: 10%, doubled selector wins over hover at same cascade position
|
|
4873
|
+
"group-data-[pressed]/draweritem:group-data-[pressed]/draweritem:opacity-10",
|
|
4874
|
+
// No state layer when disabled
|
|
4875
|
+
"group-data-[disabled]/draweritem:hidden",
|
|
4876
|
+
// z-[1]: above active indicator (z-0), below focus ring and content
|
|
4877
|
+
"z-[1]"
|
|
4878
|
+
]);
|
|
4879
|
+
var drawerItemFocusRingVariants = classVarianceAuthority.cva([
|
|
4880
|
+
"pointer-events-none absolute inset-0 rounded-[inherit]",
|
|
4881
|
+
"outline outline-2 -outline-offset-2 outline-secondary",
|
|
4882
|
+
// Effects transition — opacity must not overshoot
|
|
4883
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
4884
|
+
"opacity-0",
|
|
4885
|
+
"group-data-[focus-visible]/draweritem:opacity-100",
|
|
4886
|
+
// z-[2]: above state layer (z-[1]), below content (z-10)
|
|
4887
|
+
"z-[2]"
|
|
4888
|
+
]);
|
|
4889
|
+
var drawerItemIconVariants = classVarianceAuthority.cva([
|
|
4890
|
+
"relative z-10 flex shrink-0 items-center justify-center",
|
|
4891
|
+
"h-6 w-6",
|
|
4892
|
+
// Color and transition inherited via currentColor from root
|
|
4893
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
4894
|
+
// Explicit disabled override — mirrors Menu icon (on-surface/38)
|
|
4895
|
+
"group-data-[disabled]/draweritem:text-on-surface/38"
|
|
4896
|
+
]);
|
|
4897
|
+
var drawerItemLabelVariants = classVarianceAuthority.cva(["relative z-10 flex-1 min-w-0 truncate"]);
|
|
4898
|
+
var drawerItemBadgeVariants = classVarianceAuthority.cva([
|
|
4899
|
+
"relative z-10 shrink-0 ml-auto",
|
|
4900
|
+
"text-label-large",
|
|
4901
|
+
"font-medium",
|
|
4902
|
+
"tracking-[0.1px]",
|
|
4903
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects"
|
|
4904
|
+
]);
|
|
4905
|
+
var drawerHeadlineVariants = classVarianceAuthority.cva([
|
|
4906
|
+
"px-4 pt-4 pb-1",
|
|
4907
|
+
"text-title-small",
|
|
4908
|
+
"font-medium",
|
|
4909
|
+
"tracking-[0.1px]",
|
|
4910
|
+
"text-on-surface-variant",
|
|
4911
|
+
"select-none"
|
|
4912
|
+
]);
|
|
4913
|
+
var drawerScrimVariants = classVarianceAuthority.cva([
|
|
4914
|
+
"fixed inset-0 z-40",
|
|
4915
|
+
// NOTE: opacity is intentionally absent here — it is controlled per
|
|
4916
|
+
// animation state by drawerScrimAnimationVariants (opacity-0 / opacity-32)
|
|
4917
|
+
// to avoid tailwind-merge collapsing the classes during cn() composition.
|
|
4918
|
+
"bg-scrim"
|
|
4919
|
+
]);
|
|
4920
|
+
var drawerSectionVariants = classVarianceAuthority.cva(["flex flex-col w-full"]);
|
|
4921
|
+
var drawerSectionHeaderVariants = classVarianceAuthority.cva([
|
|
4922
|
+
"px-4 pt-4 pb-2",
|
|
4923
|
+
"text-title-small",
|
|
4924
|
+
"font-medium",
|
|
4925
|
+
"tracking-[0.1px]",
|
|
4926
|
+
"text-on-surface-variant",
|
|
4927
|
+
"select-none"
|
|
4764
4928
|
]);
|
|
4765
|
-
classVarianceAuthority.cva(["border-t border-outline-variant", "mx-4 my-2"]);
|
|
4766
4929
|
var DrawerSection = React.forwardRef(
|
|
4767
4930
|
({ header, children, showDivider = true, _isFirstSection = false, className }, ref) => {
|
|
4768
4931
|
const shouldShowDivider = showDivider && !_isFirstSection;
|
|
@@ -4784,19 +4947,19 @@ var Drawer = React.forwardRef(
|
|
|
4784
4947
|
children,
|
|
4785
4948
|
className,
|
|
4786
4949
|
disableRipple = false,
|
|
4787
|
-
iconOnly = false,
|
|
4788
4950
|
...restProps
|
|
4789
4951
|
}, ref) => {
|
|
4790
4952
|
const isOpen = open ?? defaultOpen;
|
|
4953
|
+
const reducedMotion = useReducedMotion();
|
|
4791
4954
|
const drawerPanelClass = cn(
|
|
4792
|
-
drawerVariants({
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
iconOnly
|
|
4796
|
-
}),
|
|
4955
|
+
drawerVariants({ variant, open: isOpen }),
|
|
4956
|
+
// Suppress spring transition when user has requested reduced motion
|
|
4957
|
+
reducedMotion && "transition-none",
|
|
4797
4958
|
className
|
|
4798
4959
|
);
|
|
4799
|
-
const scrimClass =
|
|
4960
|
+
const scrimClass = drawerScrimVariants();
|
|
4961
|
+
const getAnimationClassName = reducedMotion ? (_state) => "" : (state) => drawerAnimationVariants({ animationState: state });
|
|
4962
|
+
const getScrimAnimationClassName = reducedMotion ? (_state) => "" : (state) => drawerScrimAnimationVariants({ animationState: state });
|
|
4800
4963
|
let foundFirstSection = false;
|
|
4801
4964
|
const processedChildren = React__default.default.Children.map(children, (child) => {
|
|
4802
4965
|
if (React__default.default.isValidElement(child) && child.type === DrawerSection) {
|
|
@@ -4809,7 +4972,7 @@ var Drawer = React.forwardRef(
|
|
|
4809
4972
|
}
|
|
4810
4973
|
return child;
|
|
4811
4974
|
});
|
|
4812
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4975
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4813
4976
|
HeadlessDrawer,
|
|
4814
4977
|
{
|
|
4815
4978
|
ref,
|
|
@@ -4820,153 +4983,99 @@ var Drawer = React.forwardRef(
|
|
|
4820
4983
|
"aria-label": ariaLabel,
|
|
4821
4984
|
className: drawerPanelClass,
|
|
4822
4985
|
scrimClassName: scrimClass,
|
|
4986
|
+
getAnimationClassName,
|
|
4987
|
+
getScrimAnimationClassName,
|
|
4823
4988
|
disableRipple,
|
|
4824
|
-
iconOnly,
|
|
4825
4989
|
...restProps,
|
|
4826
4990
|
children: processedChildren
|
|
4827
4991
|
}
|
|
4828
|
-
)
|
|
4992
|
+
);
|
|
4829
4993
|
}
|
|
4830
4994
|
);
|
|
4831
4995
|
Drawer.displayName = "Drawer";
|
|
4832
|
-
var badgeAppearance = [
|
|
4833
|
-
// ── Shape ─────────────────────────────────────────────────────────────────────
|
|
4834
|
-
"flex items-center justify-center",
|
|
4835
|
-
"rounded-full",
|
|
4836
|
-
// ── Large (count) sizing — base defaults ──────────────────────────────────────
|
|
4837
|
-
// Height 16dp, min-width 16dp, horizontal padding 4dp
|
|
4838
|
-
"h-4 min-w-4 px-1",
|
|
4839
|
-
// ── Color — error role (only MD3-spec role for badges) ────────────────────────
|
|
4840
|
-
"bg-error text-on-error",
|
|
4841
|
-
// ── Typography — label-small, tight leading, tabular numbers ──────────────────
|
|
4842
|
-
"text-label-small leading-none tabular-nums",
|
|
4843
|
-
// ── Visibility (runtime flag) ──────────────────────────────────────────────────
|
|
4844
|
-
// Base: fully visible
|
|
4845
|
-
"scale-100",
|
|
4846
|
-
// data-invisible: scale to zero (visually hidden; aria-label still readable by SR)
|
|
4847
|
-
"data-[invisible]:scale-0",
|
|
4848
|
-
// ── Dot content flag overrides (placed last — cascade wins over base sizing) ───
|
|
4849
|
-
// Clear out the count-pill sizing, set 6dp circle
|
|
4850
|
-
"data-[dot]:size-1.5",
|
|
4851
|
-
"data-[dot]:min-w-0",
|
|
4852
|
-
"data-[dot]:p-0",
|
|
4853
|
-
"data-[dot]:text-[0]"
|
|
4854
|
-
// suppress any stray text rendering on dot
|
|
4855
|
-
];
|
|
4856
|
-
var badgeVariants2 = classVarianceAuthority.cva([
|
|
4857
|
-
// ── Anchored placement — badge center on host's top-right corner ──────────────
|
|
4858
|
-
// top-0 right-0 places the badge's own top-right at the host's top-right,
|
|
4859
|
-
// then the 1/2-element translate moves the badge center onto that corner.
|
|
4860
|
-
// Host-size-agnostic: works for any wrapped element (icon, avatar, nav chip).
|
|
4861
|
-
"absolute top-0 right-0 -translate-y-1/2 translate-x-1/2",
|
|
4862
|
-
...badgeAppearance
|
|
4863
|
-
]);
|
|
4864
|
-
var badgeStaticVariants = classVarianceAuthority.cva(["inline-flex", ...badgeAppearance]);
|
|
4865
|
-
function isBadgeConfig(badge) {
|
|
4866
|
-
return typeof badge === "object" && badge !== null && !React.isValidElement(badge) && "count" in badge;
|
|
4867
|
-
}
|
|
4868
|
-
function getBadgeDisplayValue(count, max) {
|
|
4869
|
-
if (count === void 0) return "";
|
|
4870
|
-
return count > max ? `${max}+` : count.toString();
|
|
4871
|
-
}
|
|
4872
|
-
function getBadgeAriaLabel(count) {
|
|
4873
|
-
return count === void 0 ? "New" : `${count} notifications`;
|
|
4874
|
-
}
|
|
4875
4996
|
var DrawerItem = React.forwardRef(
|
|
4876
4997
|
({
|
|
4877
4998
|
href,
|
|
4878
4999
|
icon,
|
|
4879
5000
|
label,
|
|
4880
5001
|
badge,
|
|
4881
|
-
secondaryText,
|
|
4882
5002
|
isActive = false,
|
|
4883
5003
|
isDisabled = false,
|
|
4884
5004
|
disableRipple = false,
|
|
4885
5005
|
className,
|
|
4886
|
-
onPress,
|
|
4887
|
-
|
|
4888
|
-
onPressEnd,
|
|
4889
|
-
onPressChange,
|
|
4890
|
-
onPressUp,
|
|
5006
|
+
// All remaining props (onPress, onPressStart, onPressEnd, etc.) stay in
|
|
5007
|
+
// restProps and are passed into mergeProps — mirrors the Button pattern.
|
|
4891
5008
|
...restProps
|
|
4892
5009
|
}, ref) => {
|
|
4893
|
-
const
|
|
4894
|
-
const
|
|
5010
|
+
const [isPressed, setIsPressed] = React.useState(false);
|
|
5011
|
+
const handlePressStart = React.useCallback(() => setIsPressed(true), []);
|
|
5012
|
+
const handlePressEnd = React.useCallback(() => setIsPressed(false), []);
|
|
5013
|
+
const { isHovered, hoverProps } = reactAria.useHover({ isDisabled });
|
|
5014
|
+
const { isFocusVisible, focusProps } = reactAria.useFocusRing();
|
|
4895
5015
|
const { onMouseDown: handleRipple, ripples } = useRipple({
|
|
4896
|
-
disabled:
|
|
5016
|
+
disabled: isDisabled || disableRipple
|
|
4897
5017
|
});
|
|
4898
|
-
const
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
const ariaLabel = getBadgeAriaLabel(badge.count);
|
|
4905
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative z-10 ml-auto flex shrink-0 items-center pr-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4906
|
-
"span",
|
|
4907
|
-
{
|
|
4908
|
-
role: "status",
|
|
4909
|
-
"aria-label": ariaLabel,
|
|
4910
|
-
"data-dot": isDot ? "" : void 0,
|
|
4911
|
-
className: cn(badgeStaticVariants()),
|
|
4912
|
-
children: displayValue
|
|
4913
|
-
}
|
|
4914
|
-
) });
|
|
4915
|
-
}
|
|
4916
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative z-10 ml-auto flex shrink-0 items-center pr-2", "aria-hidden": "true", children: badge });
|
|
4917
|
-
};
|
|
5018
|
+
const mergedInteractionProps = reactAria.mergeProps(
|
|
5019
|
+
hoverProps,
|
|
5020
|
+
focusProps,
|
|
5021
|
+
{ onPressStart: handlePressStart, onPressEnd: handlePressEnd },
|
|
5022
|
+
restProps
|
|
5023
|
+
);
|
|
4918
5024
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4919
5025
|
HeadlessDrawerItem,
|
|
4920
5026
|
{
|
|
4921
|
-
...
|
|
5027
|
+
...mergedInteractionProps,
|
|
4922
5028
|
ref,
|
|
4923
5029
|
...href !== void 0 ? { href } : {},
|
|
4924
5030
|
isActive,
|
|
4925
|
-
...
|
|
4926
|
-
...onPress !== void 0 ? { onPress } : {},
|
|
4927
|
-
...onPressStart !== void 0 ? { onPressStart } : {},
|
|
4928
|
-
...onPressEnd !== void 0 ? { onPressEnd } : {},
|
|
4929
|
-
...onPressChange !== void 0 ? { onPressChange } : {},
|
|
4930
|
-
...onPressUp !== void 0 ? { onPressUp } : {},
|
|
5031
|
+
...isDisabled !== void 0 ? { isDisabled } : {},
|
|
4931
5032
|
onMouseDown: handleRipple,
|
|
4932
|
-
|
|
5033
|
+
...getInteractionDataAttributes({
|
|
5034
|
+
isHovered,
|
|
5035
|
+
isFocusVisible,
|
|
5036
|
+
isPressed,
|
|
5037
|
+
isDisabled
|
|
5038
|
+
}),
|
|
5039
|
+
"data-active": isActive ? "" : void 0,
|
|
4933
5040
|
className: cn(
|
|
4934
|
-
drawerItemVariants(
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
}),
|
|
5041
|
+
drawerItemVariants(),
|
|
5042
|
+
// group/draweritem: enables group-data-[x]/draweritem selectors in all slots
|
|
5043
|
+
"group/draweritem",
|
|
4938
5044
|
className
|
|
4939
5045
|
),
|
|
4940
5046
|
children: [
|
|
4941
|
-
|
|
4942
|
-
|
|
5047
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: drawerItemActiveIndicatorVariants() }),
|
|
5048
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: drawerItemStateLayerVariants() }),
|
|
5049
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: drawerItemFocusRingVariants() }),
|
|
5050
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4943
5051
|
"span",
|
|
4944
5052
|
{
|
|
4945
|
-
className: "
|
|
5053
|
+
className: "pointer-events-none absolute inset-0 z-[3] overflow-hidden rounded-[inherit]",
|
|
4946
5054
|
"aria-hidden": "true",
|
|
4947
|
-
children:
|
|
5055
|
+
children: ripples
|
|
4948
5056
|
}
|
|
4949
5057
|
),
|
|
4950
|
-
/* @__PURE__ */ jsxRuntime.
|
|
5058
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: drawerItemIconVariants(), children: icon }),
|
|
5059
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: drawerItemLabelVariants(), children: label }),
|
|
5060
|
+
badge !== void 0 && badge !== null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4951
5061
|
"span",
|
|
4952
5062
|
{
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
children: [
|
|
4958
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: label }),
|
|
4959
|
-
secondaryText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-body-small truncate opacity-70", children: secondaryText })
|
|
4960
|
-
]
|
|
5063
|
+
role: "status",
|
|
5064
|
+
"aria-label": typeof badge === "number" ? `${badge} notifications` : String(badge),
|
|
5065
|
+
className: drawerItemBadgeVariants(),
|
|
5066
|
+
children: badge
|
|
4961
5067
|
}
|
|
4962
|
-
)
|
|
4963
|
-
!isIconOnly && renderBadge()
|
|
5068
|
+
)
|
|
4964
5069
|
]
|
|
4965
5070
|
}
|
|
4966
5071
|
);
|
|
4967
5072
|
}
|
|
4968
5073
|
);
|
|
4969
5074
|
DrawerItem.displayName = "DrawerItem";
|
|
5075
|
+
var DrawerHeadline = React.forwardRef(
|
|
5076
|
+
({ children, className, ...restProps }, ref) => /* @__PURE__ */ jsxRuntime.jsx("span", { ref, className: cn(drawerHeadlineVariants(), className), ...restProps, children })
|
|
5077
|
+
);
|
|
5078
|
+
DrawerHeadline.displayName = "DrawerHeadline";
|
|
4970
5079
|
var progressContainerVariants = classVarianceAuthority.cva(["inline-flex", "flex-col", "gap-1"], {
|
|
4971
5080
|
variants: {
|
|
4972
5081
|
type: {
|
|
@@ -5908,50 +6017,460 @@ var Card = React.forwardRef(function Card2({
|
|
|
5908
6017
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative z-10", children })
|
|
5909
6018
|
]
|
|
5910
6019
|
}
|
|
5911
|
-
);
|
|
5912
|
-
});
|
|
5913
|
-
Card.displayName = "Card";
|
|
5914
|
-
var cardMediaVariants = classVarianceAuthority.cva("w-full object-cover", {
|
|
5915
|
-
variants: {
|
|
5916
|
-
aspectRatio: {
|
|
5917
|
-
"16/9": "aspect-video",
|
|
5918
|
-
"4/3": "aspect-[4/3]",
|
|
5919
|
-
"1/1": "aspect-square",
|
|
5920
|
-
auto: ""
|
|
6020
|
+
);
|
|
6021
|
+
});
|
|
6022
|
+
Card.displayName = "Card";
|
|
6023
|
+
var cardMediaVariants = classVarianceAuthority.cva("w-full object-cover", {
|
|
6024
|
+
variants: {
|
|
6025
|
+
aspectRatio: {
|
|
6026
|
+
"16/9": "aspect-video",
|
|
6027
|
+
"4/3": "aspect-[4/3]",
|
|
6028
|
+
"1/1": "aspect-square",
|
|
6029
|
+
auto: ""
|
|
6030
|
+
}
|
|
6031
|
+
},
|
|
6032
|
+
defaultVariants: {
|
|
6033
|
+
aspectRatio: "auto"
|
|
6034
|
+
}
|
|
6035
|
+
});
|
|
6036
|
+
var CardMedia = React.forwardRef(function CardMedia2({ src, alt, aspectRatio = "auto", className }, ref) {
|
|
6037
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6038
|
+
"img",
|
|
6039
|
+
{
|
|
6040
|
+
ref,
|
|
6041
|
+
src,
|
|
6042
|
+
alt,
|
|
6043
|
+
...alt === "" && { role: "presentation" },
|
|
6044
|
+
className: cn(cardMediaVariants({ aspectRatio }), className)
|
|
6045
|
+
}
|
|
6046
|
+
);
|
|
6047
|
+
});
|
|
6048
|
+
CardMedia.displayName = "CardMedia";
|
|
6049
|
+
var CardHeader = React.forwardRef(function CardHeader2({ headline, subheader, className }, ref) {
|
|
6050
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("p-4", className), children: [
|
|
6051
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-on-surface text-title-medium", children: headline }),
|
|
6052
|
+
subheader !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-on-surface-variant text-body-medium mt-1", children: subheader })
|
|
6053
|
+
] });
|
|
6054
|
+
});
|
|
6055
|
+
CardHeader.displayName = "CardHeader";
|
|
6056
|
+
var CardContent = React.forwardRef(function CardContent2({ children, className }, ref) {
|
|
6057
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("p-4", className), children });
|
|
6058
|
+
});
|
|
6059
|
+
CardContent.displayName = "CardContent";
|
|
6060
|
+
var CardActions = React.forwardRef(function CardActions2({ children, className }, ref) {
|
|
6061
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex items-center justify-end gap-2 p-4 pt-0", className), children });
|
|
6062
|
+
});
|
|
6063
|
+
CardActions.displayName = "CardActions";
|
|
6064
|
+
var menuContainerVariants = classVarianceAuthority.cva(
|
|
6065
|
+
[
|
|
6066
|
+
// Width constraints: 112dp min / 280dp max per MD3 spec
|
|
6067
|
+
"min-w-28 max-w-70",
|
|
6068
|
+
"flex flex-col",
|
|
6069
|
+
// Scroll behaviour
|
|
6070
|
+
"max-h-[calc(var(--visual-viewport-height,100vh)-2rem)]",
|
|
6071
|
+
// Stacking
|
|
6072
|
+
"z-50",
|
|
6073
|
+
"gap-0.5",
|
|
6074
|
+
// Focus outline delegated to React Aria
|
|
6075
|
+
"outline-none"
|
|
6076
|
+
],
|
|
6077
|
+
{
|
|
6078
|
+
variants: {
|
|
6079
|
+
/**
|
|
6080
|
+
* Color scheme — drives item/segment background and content colors.
|
|
6081
|
+
* standard: surface-container-low item background.
|
|
6082
|
+
* vibrant: tertiary-container item background.
|
|
6083
|
+
*/
|
|
6084
|
+
colorScheme: {
|
|
6085
|
+
standard: [],
|
|
6086
|
+
vibrant: []
|
|
6087
|
+
},
|
|
6088
|
+
/**
|
|
6089
|
+
* Visual style — drives corner radius and container background.
|
|
6090
|
+
*
|
|
6091
|
+
* baseline: solid surface-container, 4dp corners, 8dp vertical padding.
|
|
6092
|
+
* vertical: transparent container, 16dp corners, no container padding —
|
|
6093
|
+
* items own their segment surface, gaps reveal the page background.
|
|
6094
|
+
*/
|
|
6095
|
+
menuStyle: {
|
|
6096
|
+
baseline: ["rounded-xs", "bg-surface-container", "py-2"],
|
|
6097
|
+
vertical: ["bg-transparent"]
|
|
6098
|
+
}
|
|
6099
|
+
},
|
|
6100
|
+
defaultVariants: {
|
|
6101
|
+
colorScheme: "standard",
|
|
6102
|
+
menuStyle: "baseline"
|
|
6103
|
+
}
|
|
6104
|
+
}
|
|
6105
|
+
);
|
|
6106
|
+
var menuPopoverVariants = classVarianceAuthority.cva([
|
|
6107
|
+
"will-change-[transform,opacity]",
|
|
6108
|
+
"data-[entering]:pointer-events-none data-[exiting]:pointer-events-none",
|
|
6109
|
+
"data-[entering]:animate-md-scale-in",
|
|
6110
|
+
"data-[exiting]:animate-md-scale-out",
|
|
6111
|
+
"origin-top",
|
|
6112
|
+
"data-[placement=top]:origin-bottom",
|
|
6113
|
+
"data-[placement=left]:origin-right",
|
|
6114
|
+
"data-[placement=right]:origin-left",
|
|
6115
|
+
"motion-reduce:data-[entering]:animate-none motion-reduce:data-[exiting]:animate-none"
|
|
6116
|
+
]);
|
|
6117
|
+
var menuItemVariants = classVarianceAuthority.cva(
|
|
6118
|
+
[
|
|
6119
|
+
// Layout — height set by density context in MenuItem component
|
|
6120
|
+
// gap is style-specific: baseline = 12dp (gap-3), vertical = 8dp (gap-2)
|
|
6121
|
+
"relative flex w-full items-center",
|
|
6122
|
+
// Typography: Label Large per MD3 menu spec
|
|
6123
|
+
"text-label-large",
|
|
6124
|
+
// Interaction
|
|
6125
|
+
"cursor-pointer select-none outline-none",
|
|
6126
|
+
// Color transition (effects — no overshoot)
|
|
6127
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
6128
|
+
// Disabled — self-targeting data-[x]: selectors (RAC emits data-disabled)
|
|
6129
|
+
"data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed"
|
|
6130
|
+
],
|
|
6131
|
+
{
|
|
6132
|
+
variants: {
|
|
6133
|
+
/**
|
|
6134
|
+
* Color scheme — drives item bg, default text/icon color, and selection colors.
|
|
6135
|
+
*
|
|
6136
|
+
* standard: surface-container-low bg, on-surface text, on-surface-variant icons.
|
|
6137
|
+
* Selected/open: tertiary-container bg highlight, on-tertiary-container content.
|
|
6138
|
+
* vibrant: tertiary-container bg, on-tertiary-container text AND icons.
|
|
6139
|
+
* Selected/open: tertiary bg highlight, on-tertiary content.
|
|
6140
|
+
*/
|
|
6141
|
+
colorScheme: {
|
|
6142
|
+
standard: ["text-on-surface"],
|
|
6143
|
+
vibrant: ["text-on-tertiary-container"]
|
|
6144
|
+
},
|
|
6145
|
+
/**
|
|
6146
|
+
* Visual style — drives padding, gap, segment surface, and corner rounding.
|
|
6147
|
+
*
|
|
6148
|
+
* baseline: 12dp h-padding, 12dp icon-to-label gap, no item background (container provides it).
|
|
6149
|
+
* vertical: 12dp h-padding, 8dp icon-to-label gap, item owns segment surface, segmented rounding
|
|
6150
|
+
* via first/last + adjacent-sibling gap selectors.
|
|
6151
|
+
*/
|
|
6152
|
+
menuStyle: {
|
|
6153
|
+
baseline: ["px-3", "gap-3"],
|
|
6154
|
+
vertical: [
|
|
6155
|
+
"px-3",
|
|
6156
|
+
"gap-2",
|
|
6157
|
+
// Default: inner item (4dp all corners)
|
|
6158
|
+
"rounded-md"
|
|
6159
|
+
// Last item in the whole menu → 16dp bottom corners
|
|
6160
|
+
]
|
|
6161
|
+
}
|
|
6162
|
+
},
|
|
6163
|
+
compoundVariants: [
|
|
6164
|
+
// vertical + standard: selected/open text → on-tertiary-container
|
|
6165
|
+
{
|
|
6166
|
+
menuStyle: "vertical",
|
|
6167
|
+
colorScheme: "standard",
|
|
6168
|
+
class: [
|
|
6169
|
+
"data-[selected]:text-on-tertiary-container",
|
|
6170
|
+
"data-[open]:text-on-tertiary-container"
|
|
6171
|
+
]
|
|
6172
|
+
},
|
|
6173
|
+
// vertical + vibrant: selected/open text → on-tertiary
|
|
6174
|
+
{
|
|
6175
|
+
menuStyle: "vertical",
|
|
6176
|
+
colorScheme: "vibrant",
|
|
6177
|
+
class: ["data-[selected]:text-on-tertiary", "data-[open]:text-on-tertiary"]
|
|
6178
|
+
}
|
|
6179
|
+
],
|
|
6180
|
+
defaultVariants: {
|
|
6181
|
+
colorScheme: "standard",
|
|
6182
|
+
menuStyle: "baseline"
|
|
6183
|
+
}
|
|
6184
|
+
}
|
|
6185
|
+
);
|
|
6186
|
+
var menuItemHighlightVariants = classVarianceAuthority.cva(
|
|
6187
|
+
[
|
|
6188
|
+
"absolute inset-0 pointer-events-none",
|
|
6189
|
+
// Inherit the item's own corner radius (inner 4dp or outer 16dp)
|
|
6190
|
+
"rounded-[inherit]",
|
|
6191
|
+
// Effects transition for background-color — no overshoot
|
|
6192
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
6193
|
+
// z-0: below state layer (z-[1]) and content (z-10)
|
|
6194
|
+
"z-0"
|
|
6195
|
+
],
|
|
6196
|
+
{
|
|
6197
|
+
variants: {
|
|
6198
|
+
menuStyle: {
|
|
6199
|
+
baseline: [],
|
|
6200
|
+
vertical: []
|
|
6201
|
+
},
|
|
6202
|
+
colorScheme: {
|
|
6203
|
+
standard: [
|
|
6204
|
+
// baseline selected bg
|
|
6205
|
+
"group-data-[selected]/menuitem:bg-surface-container-highest"
|
|
6206
|
+
],
|
|
6207
|
+
vibrant: [
|
|
6208
|
+
// baseline + vibrant: use surface-container-highest as fallback
|
|
6209
|
+
"group-data-[selected]/menuitem:bg-surface-container-highest"
|
|
6210
|
+
]
|
|
6211
|
+
}
|
|
6212
|
+
},
|
|
6213
|
+
compoundVariants: [
|
|
6214
|
+
// vertical + standard: selected/open highlight → tertiary-container
|
|
6215
|
+
{
|
|
6216
|
+
menuStyle: "vertical",
|
|
6217
|
+
colorScheme: "standard",
|
|
6218
|
+
class: [
|
|
6219
|
+
"group-data-[selected]/menuitem:bg-tertiary-container",
|
|
6220
|
+
"group-data-[open]/menuitem:bg-tertiary-container"
|
|
6221
|
+
]
|
|
6222
|
+
},
|
|
6223
|
+
// vertical + vibrant: selected/open highlight → tertiary
|
|
6224
|
+
{
|
|
6225
|
+
menuStyle: "vertical",
|
|
6226
|
+
colorScheme: "vibrant",
|
|
6227
|
+
class: [
|
|
6228
|
+
"group-data-[selected]/menuitem:bg-tertiary",
|
|
6229
|
+
"group-data-[open]/menuitem:bg-tertiary"
|
|
6230
|
+
]
|
|
6231
|
+
}
|
|
6232
|
+
],
|
|
6233
|
+
defaultVariants: {
|
|
6234
|
+
menuStyle: "baseline",
|
|
6235
|
+
colorScheme: "standard"
|
|
6236
|
+
}
|
|
6237
|
+
}
|
|
6238
|
+
);
|
|
6239
|
+
var menuItemStateLayerVariants = classVarianceAuthority.cva(
|
|
6240
|
+
[
|
|
6241
|
+
"absolute inset-0 rounded-[inherit] overflow-hidden pointer-events-none opacity-0",
|
|
6242
|
+
// Effects transition — opacity must NOT overshoot
|
|
6243
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
6244
|
+
// Hover: 8%
|
|
6245
|
+
"group-data-[hovered]/menuitem:opacity-8",
|
|
6246
|
+
// Pressed: 10%, doubled selector wins over hover at same cascade position
|
|
6247
|
+
"group-data-[pressed]/menuitem:group-data-[pressed]/menuitem:opacity-10",
|
|
6248
|
+
// No state layer when disabled
|
|
6249
|
+
"group-data-[disabled]/menuitem:hidden",
|
|
6250
|
+
// z-[1]: above highlight layer (z-0), below content (z-10)
|
|
6251
|
+
"z-[1]"
|
|
6252
|
+
],
|
|
6253
|
+
{
|
|
6254
|
+
variants: {
|
|
6255
|
+
colorScheme: {
|
|
6256
|
+
standard: ["bg-on-surface"],
|
|
6257
|
+
vibrant: ["bg-on-tertiary-container"]
|
|
6258
|
+
},
|
|
6259
|
+
menuStyle: {
|
|
6260
|
+
baseline: [],
|
|
6261
|
+
vertical: []
|
|
6262
|
+
}
|
|
6263
|
+
},
|
|
6264
|
+
compoundVariants: [
|
|
6265
|
+
// vertical + standard: selected/open state layer → on-tertiary-container
|
|
6266
|
+
{
|
|
6267
|
+
menuStyle: "vertical",
|
|
6268
|
+
colorScheme: "standard",
|
|
6269
|
+
class: [
|
|
6270
|
+
"group-data-[selected]/menuitem:bg-on-tertiary-container",
|
|
6271
|
+
"group-data-[open]/menuitem:bg-on-tertiary-container"
|
|
6272
|
+
]
|
|
6273
|
+
},
|
|
6274
|
+
// vertical + vibrant: selected/open state layer → on-tertiary
|
|
6275
|
+
{
|
|
6276
|
+
menuStyle: "vertical",
|
|
6277
|
+
colorScheme: "vibrant",
|
|
6278
|
+
class: [
|
|
6279
|
+
"group-data-[selected]/menuitem:bg-on-tertiary",
|
|
6280
|
+
"group-data-[open]/menuitem:bg-on-tertiary"
|
|
6281
|
+
]
|
|
6282
|
+
}
|
|
6283
|
+
],
|
|
6284
|
+
defaultVariants: {
|
|
6285
|
+
colorScheme: "standard",
|
|
6286
|
+
menuStyle: "baseline"
|
|
6287
|
+
}
|
|
6288
|
+
}
|
|
6289
|
+
);
|
|
6290
|
+
var menuItemFocusRingVariants = classVarianceAuthority.cva([
|
|
6291
|
+
"pointer-events-none absolute inset-0 rounded-[inherit]",
|
|
6292
|
+
"outline outline-2 -outline-offset-2 outline-secondary",
|
|
6293
|
+
// Effects transition — opacity must not overshoot
|
|
6294
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
6295
|
+
"opacity-0",
|
|
6296
|
+
"group-data-[focus-visible]/menuitem:opacity-100",
|
|
6297
|
+
// z-[2]: above state layer (z-[1]) and highlight (z-0), below content (z-10)
|
|
6298
|
+
"z-[2]"
|
|
6299
|
+
]);
|
|
6300
|
+
var menuItemIconVariants = classVarianceAuthority.cva(
|
|
6301
|
+
[
|
|
6302
|
+
"relative z-10 shrink-0 flex items-center justify-center",
|
|
6303
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
6304
|
+
// Disabled: 38% opacity on icon color
|
|
6305
|
+
"group-data-[disabled]/menuitem:text-on-surface/38"
|
|
6306
|
+
],
|
|
6307
|
+
{
|
|
6308
|
+
variants: {
|
|
6309
|
+
colorScheme: {
|
|
6310
|
+
standard: ["text-on-surface-variant"],
|
|
6311
|
+
vibrant: ["text-on-tertiary-container"]
|
|
6312
|
+
},
|
|
6313
|
+
menuStyle: {
|
|
6314
|
+
baseline: ["h-6 w-6"],
|
|
6315
|
+
vertical: ["h-5 w-5"]
|
|
6316
|
+
}
|
|
6317
|
+
},
|
|
6318
|
+
compoundVariants: [
|
|
6319
|
+
// vertical + standard: selected/open icon → on-tertiary-container
|
|
6320
|
+
{
|
|
6321
|
+
menuStyle: "vertical",
|
|
6322
|
+
colorScheme: "standard",
|
|
6323
|
+
class: [
|
|
6324
|
+
"group-data-[selected]/menuitem:text-on-tertiary-container",
|
|
6325
|
+
"group-data-[open]/menuitem:text-on-tertiary-container"
|
|
6326
|
+
]
|
|
6327
|
+
},
|
|
6328
|
+
// vertical + vibrant: selected/open icon → on-tertiary
|
|
6329
|
+
{
|
|
6330
|
+
menuStyle: "vertical",
|
|
6331
|
+
colorScheme: "vibrant",
|
|
6332
|
+
class: [
|
|
6333
|
+
"group-data-[selected]/menuitem:text-on-tertiary",
|
|
6334
|
+
"group-data-[open]/menuitem:text-on-tertiary"
|
|
6335
|
+
]
|
|
6336
|
+
}
|
|
6337
|
+
],
|
|
6338
|
+
defaultVariants: {
|
|
6339
|
+
colorScheme: "standard",
|
|
6340
|
+
menuStyle: "baseline"
|
|
6341
|
+
}
|
|
6342
|
+
}
|
|
6343
|
+
);
|
|
6344
|
+
var menuSectionVariants = classVarianceAuthority.cva(["flex flex-col w-full"]);
|
|
6345
|
+
var menuSectionHeaderVariants = classVarianceAuthority.cva(
|
|
6346
|
+
[
|
|
6347
|
+
// 32dp tall region, content vertically centred, 12dp leading padding aligned with items
|
|
6348
|
+
"px-3 h-8 flex items-center",
|
|
6349
|
+
"text-title-small",
|
|
6350
|
+
"select-none"
|
|
6351
|
+
],
|
|
6352
|
+
{
|
|
6353
|
+
variants: {
|
|
6354
|
+
colorScheme: {
|
|
6355
|
+
standard: ["text-on-surface-variant"],
|
|
6356
|
+
vibrant: ["text-on-tertiary-container"]
|
|
6357
|
+
}
|
|
6358
|
+
},
|
|
6359
|
+
defaultVariants: {
|
|
6360
|
+
colorScheme: "standard"
|
|
6361
|
+
}
|
|
6362
|
+
}
|
|
6363
|
+
);
|
|
6364
|
+
var menuDividerVariants = classVarianceAuthority.cva(["border-t border-outline-variant", "my-0.5 mx-3"]);
|
|
6365
|
+
classVarianceAuthority.cva(["h-0.5 w-full"]);
|
|
6366
|
+
var menuItemTrailingTextVariants = classVarianceAuthority.cva(
|
|
6367
|
+
[
|
|
6368
|
+
"ml-auto shrink-0 text-label-large",
|
|
6369
|
+
"select-none",
|
|
6370
|
+
"group-data-[disabled]/menuitem:text-on-surface/38"
|
|
6371
|
+
],
|
|
6372
|
+
{
|
|
6373
|
+
variants: {
|
|
6374
|
+
colorScheme: {
|
|
6375
|
+
standard: ["text-on-surface-variant"],
|
|
6376
|
+
vibrant: ["text-on-tertiary-container"]
|
|
6377
|
+
},
|
|
6378
|
+
menuStyle: {
|
|
6379
|
+
baseline: [],
|
|
6380
|
+
vertical: [
|
|
6381
|
+
"group-data-[selected]/menuitem:text-on-tertiary-container",
|
|
6382
|
+
"group-data-[open]/menuitem:text-on-tertiary-container"
|
|
6383
|
+
]
|
|
6384
|
+
}
|
|
6385
|
+
},
|
|
6386
|
+
compoundVariants: [
|
|
6387
|
+
// vertical + vibrant: selected/open trailing text → on-tertiary
|
|
6388
|
+
{
|
|
6389
|
+
menuStyle: "vertical",
|
|
6390
|
+
colorScheme: "vibrant",
|
|
6391
|
+
class: [
|
|
6392
|
+
"group-data-[selected]/menuitem:text-on-tertiary",
|
|
6393
|
+
"group-data-[open]/menuitem:text-on-tertiary"
|
|
6394
|
+
]
|
|
6395
|
+
}
|
|
6396
|
+
],
|
|
6397
|
+
defaultVariants: {
|
|
6398
|
+
colorScheme: "standard",
|
|
6399
|
+
menuStyle: "baseline"
|
|
6400
|
+
}
|
|
6401
|
+
}
|
|
6402
|
+
);
|
|
6403
|
+
var menuItemDescriptionVariants = classVarianceAuthority.cva(
|
|
6404
|
+
["text-body-medium", "select-none", "group-data-[disabled]/menuitem:text-on-surface/38"],
|
|
6405
|
+
{
|
|
6406
|
+
variants: {
|
|
6407
|
+
colorScheme: {
|
|
6408
|
+
standard: ["text-on-surface-variant"],
|
|
6409
|
+
vibrant: ["text-on-tertiary-container"]
|
|
6410
|
+
},
|
|
6411
|
+
menuStyle: {
|
|
6412
|
+
baseline: [],
|
|
6413
|
+
vertical: [
|
|
6414
|
+
"group-data-[selected]/menuitem:text-on-tertiary-container",
|
|
6415
|
+
"group-data-[open]/menuitem:text-on-tertiary-container"
|
|
6416
|
+
]
|
|
6417
|
+
}
|
|
6418
|
+
},
|
|
6419
|
+
compoundVariants: [
|
|
6420
|
+
// vertical + vibrant: selected/open description → on-tertiary
|
|
6421
|
+
{
|
|
6422
|
+
menuStyle: "vertical",
|
|
6423
|
+
colorScheme: "vibrant",
|
|
6424
|
+
class: [
|
|
6425
|
+
"group-data-[selected]/menuitem:text-on-tertiary",
|
|
6426
|
+
"group-data-[open]/menuitem:text-on-tertiary"
|
|
6427
|
+
]
|
|
6428
|
+
}
|
|
6429
|
+
],
|
|
6430
|
+
defaultVariants: {
|
|
6431
|
+
colorScheme: "standard",
|
|
6432
|
+
menuStyle: "baseline"
|
|
5921
6433
|
}
|
|
5922
|
-
},
|
|
5923
|
-
defaultVariants: {
|
|
5924
|
-
aspectRatio: "auto"
|
|
5925
6434
|
}
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
"
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
6435
|
+
);
|
|
6436
|
+
classVarianceAuthority.cva(
|
|
6437
|
+
[
|
|
6438
|
+
"flex flex-col w-full",
|
|
6439
|
+
"px-1 py-0.5 gap-0.5",
|
|
6440
|
+
"rounded-lg first:rounded-b-sm last:rounded-t-sm",
|
|
6441
|
+
"shadow-elevation-1"
|
|
6442
|
+
],
|
|
6443
|
+
{
|
|
6444
|
+
variants: {
|
|
6445
|
+
menuStyle: {
|
|
6446
|
+
vertical: ["bg-surface-container-low"],
|
|
6447
|
+
baseline: []
|
|
6448
|
+
},
|
|
6449
|
+
colorScheme: {
|
|
6450
|
+
standard: ["bg-surface-container-low"],
|
|
6451
|
+
vibrant: ["bg-tertiary-container"]
|
|
6452
|
+
}
|
|
6453
|
+
},
|
|
6454
|
+
compoundVariants: [
|
|
6455
|
+
// vertical + standard: item background = surface-container-low
|
|
6456
|
+
{
|
|
6457
|
+
menuStyle: "vertical",
|
|
6458
|
+
colorScheme: "standard",
|
|
6459
|
+
class: ["bg-surface-container-low"]
|
|
6460
|
+
},
|
|
6461
|
+
// vertical + vibrant: item background = tertiary-container
|
|
6462
|
+
{
|
|
6463
|
+
menuStyle: "vertical",
|
|
6464
|
+
colorScheme: "vibrant",
|
|
6465
|
+
class: ["bg-tertiary-container"]
|
|
6466
|
+
}
|
|
6467
|
+
],
|
|
6468
|
+
defaultVariants: {
|
|
6469
|
+
menuStyle: "vertical",
|
|
6470
|
+
colorScheme: "standard"
|
|
5936
6471
|
}
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
CardMedia.displayName = "CardMedia";
|
|
5940
|
-
var CardHeader = React.forwardRef(function CardHeader2({ headline, subheader, className }, ref) {
|
|
5941
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("p-4", className), children: [
|
|
5942
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-on-surface text-title-medium", children: headline }),
|
|
5943
|
-
subheader !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-on-surface-variant text-body-medium mt-1", children: subheader })
|
|
5944
|
-
] });
|
|
5945
|
-
});
|
|
5946
|
-
CardHeader.displayName = "CardHeader";
|
|
5947
|
-
var CardContent = React.forwardRef(function CardContent2({ children, className }, ref) {
|
|
5948
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("p-4", className), children });
|
|
5949
|
-
});
|
|
5950
|
-
CardContent.displayName = "CardContent";
|
|
5951
|
-
var CardActions = React.forwardRef(function CardActions2({ children, className }, ref) {
|
|
5952
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex items-center justify-end gap-2 p-4 pt-0", className), children });
|
|
5953
|
-
});
|
|
5954
|
-
CardActions.displayName = "CardActions";
|
|
6472
|
+
}
|
|
6473
|
+
);
|
|
5955
6474
|
var MenuContext = React.createContext(null);
|
|
5956
6475
|
function useMenuContext() {
|
|
5957
6476
|
return React.useContext(MenuContext);
|
|
@@ -5989,7 +6508,16 @@ function HeadlessMenuTrigger({
|
|
|
5989
6508
|
const [triggerChild, menuChild] = childrenArray;
|
|
5990
6509
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.MenuTrigger, { ...rest, children: [
|
|
5991
6510
|
/* @__PURE__ */ jsxRuntime.jsx(TriggerBridge, { children: triggerChild }),
|
|
5992
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6511
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6512
|
+
reactAriaComponents.Popover,
|
|
6513
|
+
{
|
|
6514
|
+
placement,
|
|
6515
|
+
shouldFlip,
|
|
6516
|
+
offset: 4,
|
|
6517
|
+
className: menuPopoverVariants(),
|
|
6518
|
+
children: menuChild
|
|
6519
|
+
}
|
|
6520
|
+
)
|
|
5993
6521
|
] });
|
|
5994
6522
|
}
|
|
5995
6523
|
function HeadlessMenu({
|
|
@@ -6041,192 +6569,6 @@ function HeadlessMenuDivider({
|
|
|
6041
6569
|
}) {
|
|
6042
6570
|
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Separator, { ...props, className: className ?? "" });
|
|
6043
6571
|
}
|
|
6044
|
-
var menuContainerVariants = classVarianceAuthority.cva(
|
|
6045
|
-
[
|
|
6046
|
-
// Elevation
|
|
6047
|
-
"shadow-elevation-2",
|
|
6048
|
-
// Width constraints per MD3 spec (112dp min / 280dp max)
|
|
6049
|
-
"min-w-28 max-w-70",
|
|
6050
|
-
// Layout
|
|
6051
|
-
"py-2",
|
|
6052
|
-
// Scroll: show scrollbar when content overflows; max height avoids clipping
|
|
6053
|
-
"overflow-y-auto",
|
|
6054
|
-
"max-h-[calc(var(--visual-viewport-height,100vh)-2rem)]",
|
|
6055
|
-
// Stacking
|
|
6056
|
-
"z-50",
|
|
6057
|
-
// Focus outline handled by React Aria
|
|
6058
|
-
"outline-none",
|
|
6059
|
-
// GPU compositing — promotes menu to its own compositor layer so
|
|
6060
|
-
// scale + opacity animations run without triggering layout reflow.
|
|
6061
|
-
"will-change-[transform,opacity]",
|
|
6062
|
-
// Pointer events blocked during animation to prevent accidental clicks
|
|
6063
|
-
// on menu items while the panel is still animating in or out.
|
|
6064
|
-
"data-[entering]:pointer-events-none data-[exiting]:pointer-events-none",
|
|
6065
|
-
// ── Enter animation ────────────────────────────────────────────────────
|
|
6066
|
-
// @keyframes menu-enter (defined in styles.css): scale(0.8)+opacity:0 →
|
|
6067
|
-
// scale(1)+opacity:1 in 120ms with cubic-bezier(0,0,0.2,1) (standard
|
|
6068
|
-
// decelerate — matches Angular Material's _mat-menu-enter keyframe).
|
|
6069
|
-
"data-[entering]:animate-[menu-enter_120ms_cubic-bezier(0,0,0.2,1)_both]",
|
|
6070
|
-
// ── Exit animation ─────────────────────────────────────────────────────
|
|
6071
|
-
// @keyframes menu-exit (defined in styles.css): opacity:1 → opacity:0
|
|
6072
|
-
// in 100ms after 25ms delay, linear — matches Angular Material's
|
|
6073
|
-
// _mat-menu-exit keyframe (fade-only, no reverse scale).
|
|
6074
|
-
"data-[exiting]:animate-[menu-exit_100ms_25ms_linear_both]",
|
|
6075
|
-
// ── Transform origin (placement-aware) ────────────────────────────────
|
|
6076
|
-
// RAC sets data-placement="bottom|top|left|right" on the Popover element.
|
|
6077
|
-
// Default (bottom): origin at top edge (menu expands downward).
|
|
6078
|
-
"origin-top",
|
|
6079
|
-
// top: origin at bottom edge (menu expands upward)
|
|
6080
|
-
"data-[placement=top]:origin-bottom",
|
|
6081
|
-
// left: origin at right edge
|
|
6082
|
-
"data-[placement=left]:origin-right",
|
|
6083
|
-
// right: origin at left edge
|
|
6084
|
-
"data-[placement=right]:origin-left",
|
|
6085
|
-
// ── Reduced motion ────────────────────────────────────────────────────
|
|
6086
|
-
// Skip both animations entirely for users who prefer reduced motion.
|
|
6087
|
-
"motion-reduce:data-[entering]:animate-none motion-reduce:data-[exiting]:animate-none"
|
|
6088
|
-
],
|
|
6089
|
-
{
|
|
6090
|
-
variants: {
|
|
6091
|
-
/**
|
|
6092
|
-
* Color scheme — drives the container background.
|
|
6093
|
-
* baseline+standard uses a separate compound variant.
|
|
6094
|
-
*/
|
|
6095
|
-
colorScheme: {
|
|
6096
|
-
standard: [],
|
|
6097
|
-
vibrant: []
|
|
6098
|
-
},
|
|
6099
|
-
/**
|
|
6100
|
-
* Visual style — drives corner radius and baseline vs vertical background.
|
|
6101
|
-
*/
|
|
6102
|
-
menuStyle: {
|
|
6103
|
-
baseline: ["rounded-xs", "bg-surface-container"],
|
|
6104
|
-
vertical: ["rounded-lg", "bg-surface-container-low"]
|
|
6105
|
-
}
|
|
6106
|
-
},
|
|
6107
|
-
compoundVariants: [
|
|
6108
|
-
// Vertical + vibrant: tertiary container background
|
|
6109
|
-
{
|
|
6110
|
-
menuStyle: "vertical",
|
|
6111
|
-
colorScheme: "vibrant",
|
|
6112
|
-
class: ["bg-tertiary-container"]
|
|
6113
|
-
}
|
|
6114
|
-
],
|
|
6115
|
-
defaultVariants: {
|
|
6116
|
-
colorScheme: "standard",
|
|
6117
|
-
menuStyle: "baseline"
|
|
6118
|
-
}
|
|
6119
|
-
}
|
|
6120
|
-
);
|
|
6121
|
-
var menuItemVariants = classVarianceAuthority.cva(
|
|
6122
|
-
[
|
|
6123
|
-
// Layout — height set by density context in MenuItem component
|
|
6124
|
-
"relative flex w-full items-center",
|
|
6125
|
-
"px-3 gap-3",
|
|
6126
|
-
// Typography: Body Large per MD3 baseline spec
|
|
6127
|
-
"text-body-large",
|
|
6128
|
-
// Interaction
|
|
6129
|
-
"cursor-pointer select-none outline-none",
|
|
6130
|
-
// State layer pseudo-element
|
|
6131
|
-
"before:absolute before:inset-0 before:rounded-[inherit]",
|
|
6132
|
-
"before:transition-opacity before:duration-short2 before:ease-standard",
|
|
6133
|
-
"before:opacity-0",
|
|
6134
|
-
// Hover state layer
|
|
6135
|
-
"hover:before:opacity-8",
|
|
6136
|
-
// Focus visible state layer
|
|
6137
|
-
"focus-visible:before:opacity-12",
|
|
6138
|
-
// Active pressed state layer
|
|
6139
|
-
"active:before:opacity-12",
|
|
6140
|
-
// Color transition for selection
|
|
6141
|
-
"transition-colors duration-short2 ease-standard"
|
|
6142
|
-
],
|
|
6143
|
-
{
|
|
6144
|
-
variants: {
|
|
6145
|
-
/**
|
|
6146
|
-
* Disabled state: reduces opacity and blocks interaction.
|
|
6147
|
-
*/
|
|
6148
|
-
isDisabled: {
|
|
6149
|
-
true: ["opacity-38 cursor-not-allowed pointer-events-none"],
|
|
6150
|
-
false: []
|
|
6151
|
-
},
|
|
6152
|
-
/**
|
|
6153
|
-
* Selected state: background and text color driven by compound variants.
|
|
6154
|
-
*/
|
|
6155
|
-
isSelected: {
|
|
6156
|
-
true: [],
|
|
6157
|
-
false: []
|
|
6158
|
-
},
|
|
6159
|
-
/**
|
|
6160
|
-
* Color scheme: drives default text and state layer colors.
|
|
6161
|
-
* - standard: on-surface text, on-surface state layer
|
|
6162
|
-
* - vibrant (vertical only): on-tertiary-container text + state layer
|
|
6163
|
-
*/
|
|
6164
|
-
colorScheme: {
|
|
6165
|
-
standard: ["text-on-surface", "before:bg-on-surface"],
|
|
6166
|
-
vibrant: ["text-on-tertiary-container", "before:bg-on-tertiary-container"]
|
|
6167
|
-
},
|
|
6168
|
-
/**
|
|
6169
|
-
* Visual style: drives corner radius on items (vertical uses rounded-lg
|
|
6170
|
-
* inherited from container, items stay flat inside).
|
|
6171
|
-
*/
|
|
6172
|
-
menuStyle: {
|
|
6173
|
-
baseline: [],
|
|
6174
|
-
vertical: []
|
|
6175
|
-
}
|
|
6176
|
-
},
|
|
6177
|
-
compoundVariants: [
|
|
6178
|
-
// ── Baseline selection (both colorSchemes) ──────────────────────────
|
|
6179
|
-
{
|
|
6180
|
-
isSelected: true,
|
|
6181
|
-
menuStyle: "baseline",
|
|
6182
|
-
class: [
|
|
6183
|
-
"bg-surface-container-highest"
|
|
6184
|
-
// text-on-surface already applied by standard colorScheme variant
|
|
6185
|
-
]
|
|
6186
|
-
},
|
|
6187
|
-
// ── Vertical + Standard selection ───────────────────────────────────
|
|
6188
|
-
{
|
|
6189
|
-
isSelected: true,
|
|
6190
|
-
menuStyle: "vertical",
|
|
6191
|
-
colorScheme: "standard",
|
|
6192
|
-
class: [
|
|
6193
|
-
"bg-tertiary-container",
|
|
6194
|
-
"text-on-tertiary-container",
|
|
6195
|
-
"before:bg-on-tertiary-container"
|
|
6196
|
-
]
|
|
6197
|
-
},
|
|
6198
|
-
// ── Vertical + Vibrant selection ─────────────────────────────────────
|
|
6199
|
-
{
|
|
6200
|
-
isSelected: true,
|
|
6201
|
-
menuStyle: "vertical",
|
|
6202
|
-
colorScheme: "vibrant",
|
|
6203
|
-
class: ["bg-tertiary", "text-on-tertiary", "before:bg-on-tertiary"]
|
|
6204
|
-
}
|
|
6205
|
-
],
|
|
6206
|
-
defaultVariants: {
|
|
6207
|
-
isDisabled: false,
|
|
6208
|
-
isSelected: false,
|
|
6209
|
-
colorScheme: "standard",
|
|
6210
|
-
menuStyle: "baseline"
|
|
6211
|
-
}
|
|
6212
|
-
}
|
|
6213
|
-
);
|
|
6214
|
-
var menuSectionVariants = classVarianceAuthority.cva(["flex flex-col w-full"]);
|
|
6215
|
-
var menuSectionHeaderVariants = classVarianceAuthority.cva([
|
|
6216
|
-
"px-3 pt-2 pb-1",
|
|
6217
|
-
"text-title-small text-on-surface-variant",
|
|
6218
|
-
"select-none"
|
|
6219
|
-
]);
|
|
6220
|
-
var menuDividerVariants = classVarianceAuthority.cva(["border-t border-outline-variant", "my-2 mx-0"]);
|
|
6221
|
-
classVarianceAuthority.cva(["h-2 w-full"]);
|
|
6222
|
-
var menuItemTrailingTextVariants = classVarianceAuthority.cva([
|
|
6223
|
-
"ml-auto shrink-0 text-label-large text-on-surface-variant",
|
|
6224
|
-
"select-none"
|
|
6225
|
-
]);
|
|
6226
|
-
var menuItemDescriptionVariants = classVarianceAuthority.cva([
|
|
6227
|
-
"text-body-medium text-on-surface-variant",
|
|
6228
|
-
"select-none"
|
|
6229
|
-
]);
|
|
6230
6572
|
var Menu = React.forwardRef(function Menu2({
|
|
6231
6573
|
children,
|
|
6232
6574
|
className,
|
|
@@ -6286,7 +6628,13 @@ function CheckIcon() {
|
|
|
6286
6628
|
}
|
|
6287
6629
|
);
|
|
6288
6630
|
}
|
|
6289
|
-
var
|
|
6631
|
+
var BASELINE_DENSITY_HEIGHT = {
|
|
6632
|
+
0: "h-12",
|
|
6633
|
+
[-1]: "h-11",
|
|
6634
|
+
[-2]: "h-10",
|
|
6635
|
+
[-3]: "h-9"
|
|
6636
|
+
};
|
|
6637
|
+
var VERTICAL_DENSITY_HEIGHT = {
|
|
6290
6638
|
0: "h-12",
|
|
6291
6639
|
[-1]: "h-11",
|
|
6292
6640
|
[-2]: "h-10",
|
|
@@ -6309,19 +6657,18 @@ var MenuItem = React.forwardRef(function MenuItem2({
|
|
|
6309
6657
|
const menuStyle = ctx?.menuStyle ?? "baseline";
|
|
6310
6658
|
const density = ctx?.density ?? 0;
|
|
6311
6659
|
const selectionMode = ctx?.selectionMode;
|
|
6312
|
-
const heightClass =
|
|
6660
|
+
const heightClass = menuStyle === "vertical" ? VERTICAL_DENSITY_HEIGHT[density] : BASELINE_DENSITY_HEIGHT[density];
|
|
6313
6661
|
const isSelectionMenu = selectionMode != null;
|
|
6314
6662
|
const { ripples, onMouseDown } = useRipple({ disabled: disableRipple });
|
|
6315
|
-
const computeClassName = ({
|
|
6316
|
-
menuItemVariants({
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
colorScheme,
|
|
6320
|
-
menuStyle
|
|
6321
|
-
}),
|
|
6663
|
+
const computeClassName = ({ isSelected }) => cn(
|
|
6664
|
+
menuItemVariants({ colorScheme, menuStyle }),
|
|
6665
|
+
// group/menuitem scope: all slot children read state via group-data-[x]/menuitem
|
|
6666
|
+
"group/menuitem",
|
|
6322
6667
|
// Height: auto when description is present (multi-line), otherwise density
|
|
6323
6668
|
description ? "min-h-12 py-2 h-auto items-start" : heightClass,
|
|
6324
|
-
className
|
|
6669
|
+
className,
|
|
6670
|
+
// Silence the isSelected lint — value consumed in render-prop below
|
|
6671
|
+
isSelected ? "" : ""
|
|
6325
6672
|
);
|
|
6326
6673
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6327
6674
|
HeadlessMenuItem,
|
|
@@ -6331,24 +6678,48 @@ var MenuItem = React.forwardRef(function MenuItem2({
|
|
|
6331
6678
|
className: computeClassName,
|
|
6332
6679
|
onMouseDown,
|
|
6333
6680
|
children: ({ isSelected }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6334
|
-
|
|
6335
|
-
|
|
6681
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6682
|
+
"span",
|
|
6683
|
+
{
|
|
6684
|
+
"aria-hidden": "true",
|
|
6685
|
+
"data-testid": "menuitem-highlight",
|
|
6686
|
+
className: menuItemHighlightVariants({ colorScheme, menuStyle })
|
|
6687
|
+
}
|
|
6688
|
+
),
|
|
6689
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6690
|
+
"span",
|
|
6691
|
+
{
|
|
6692
|
+
"aria-hidden": "true",
|
|
6693
|
+
className: menuItemStateLayerVariants({ colorScheme, menuStyle })
|
|
6694
|
+
}
|
|
6695
|
+
),
|
|
6696
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6336
6697
|
"span",
|
|
6337
6698
|
{
|
|
6338
|
-
className: "text-on-surface-variant relative z-10 flex h-6 w-6 shrink-0 items-center justify-center",
|
|
6339
6699
|
"aria-hidden": "true",
|
|
6340
|
-
|
|
6700
|
+
"data-testid": "menuitem-focus-ring",
|
|
6701
|
+
className: menuItemFocusRingVariants()
|
|
6702
|
+
}
|
|
6703
|
+
),
|
|
6704
|
+
!disableRipple && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6705
|
+
"span",
|
|
6706
|
+
{
|
|
6707
|
+
className: cn(
|
|
6708
|
+
"pointer-events-none absolute inset-0 z-[3] overflow-hidden rounded-[inherit]"
|
|
6709
|
+
),
|
|
6710
|
+
children: ripples
|
|
6341
6711
|
}
|
|
6342
6712
|
),
|
|
6713
|
+
(leadingIcon != null || isSelectionMenu) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: menuItemIconVariants({ colorScheme, menuStyle }), "aria-hidden": "true", children: isSelectionMenu && leadingIcon == null ? isSelected ? /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, {}) : null : leadingIcon }),
|
|
6343
6714
|
description != null ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative z-10 flex min-w-0 flex-1 flex-col", children: [
|
|
6344
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-
|
|
6345
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: menuItemDescriptionVariants(), children: description })
|
|
6346
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-
|
|
6715
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-label-large group-data-[disabled]/menuitem:text-on-surface/38", children }),
|
|
6716
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: menuItemDescriptionVariants({ colorScheme, menuStyle }), children: description })
|
|
6717
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-label-large group-data-[disabled]/menuitem:text-on-surface/38 relative z-10 min-w-0 flex-1", children }),
|
|
6347
6718
|
badge != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative z-10 shrink-0", children: badge }),
|
|
6348
6719
|
trailingIcon != null && trailingText == null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6349
6720
|
"span",
|
|
6350
6721
|
{
|
|
6351
|
-
className:
|
|
6722
|
+
className: cn(menuItemIconVariants({ colorScheme, menuStyle }), "ml-auto"),
|
|
6352
6723
|
"aria-hidden": "true",
|
|
6353
6724
|
children: trailingIcon
|
|
6354
6725
|
}
|
|
@@ -6356,7 +6727,10 @@ var MenuItem = React.forwardRef(function MenuItem2({
|
|
|
6356
6727
|
trailingText != null && trailingIcon == null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6357
6728
|
"span",
|
|
6358
6729
|
{
|
|
6359
|
-
className: cn(
|
|
6730
|
+
className: cn(
|
|
6731
|
+
menuItemTrailingTextVariants({ colorScheme, menuStyle }),
|
|
6732
|
+
"relative z-10"
|
|
6733
|
+
),
|
|
6360
6734
|
"aria-keyshortcuts": trailingText,
|
|
6361
6735
|
children: trailingText
|
|
6362
6736
|
}
|
|
@@ -6372,6 +6746,8 @@ function MenuSection({
|
|
|
6372
6746
|
className,
|
|
6373
6747
|
"aria-label": ariaLabel
|
|
6374
6748
|
}) {
|
|
6749
|
+
const ctx = useMenuContext();
|
|
6750
|
+
const colorScheme = ctx?.colorScheme ?? "standard";
|
|
6375
6751
|
const sectionAriaLabel = ariaLabel ?? header;
|
|
6376
6752
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6377
6753
|
showDivider && /* @__PURE__ */ jsxRuntime.jsx(HeadlessMenuDivider, { className: menuDividerVariants() }),
|
|
@@ -6381,7 +6757,7 @@ function MenuSection({
|
|
|
6381
6757
|
"aria-label": sectionAriaLabel,
|
|
6382
6758
|
className: cn(menuSectionVariants(), className),
|
|
6383
6759
|
children: [
|
|
6384
|
-
header && /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Header, { className: menuSectionHeaderVariants(), "aria-hidden": "true", children: header }),
|
|
6760
|
+
header && /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Header, { className: menuSectionHeaderVariants({ colorScheme }), "aria-hidden": "true", children: header }),
|
|
6385
6761
|
children
|
|
6386
6762
|
]
|
|
6387
6763
|
}
|
|
@@ -9737,6 +10113,39 @@ var BadgeHeadless = React.forwardRef(
|
|
|
9737
10113
|
}
|
|
9738
10114
|
);
|
|
9739
10115
|
BadgeHeadless.displayName = "BadgeHeadless";
|
|
10116
|
+
var badgeAppearance = [
|
|
10117
|
+
// ── Shape ─────────────────────────────────────────────────────────────────────
|
|
10118
|
+
"flex items-center justify-center",
|
|
10119
|
+
"rounded-full",
|
|
10120
|
+
// ── Large (count) sizing — base defaults ──────────────────────────────────────
|
|
10121
|
+
// Height 16dp, min-width 16dp, horizontal padding 4dp
|
|
10122
|
+
"h-4 min-w-4 px-1",
|
|
10123
|
+
// ── Color — error role (only MD3-spec role for badges) ────────────────────────
|
|
10124
|
+
"bg-error text-on-error",
|
|
10125
|
+
// ── Typography — label-small, tight leading, tabular numbers ──────────────────
|
|
10126
|
+
"text-label-small leading-none tabular-nums",
|
|
10127
|
+
// ── Visibility (runtime flag) ──────────────────────────────────────────────────
|
|
10128
|
+
// Base: fully visible
|
|
10129
|
+
"scale-100",
|
|
10130
|
+
// data-invisible: scale to zero (visually hidden; aria-label still readable by SR)
|
|
10131
|
+
"data-[invisible]:scale-0",
|
|
10132
|
+
// ── Dot content flag overrides (placed last — cascade wins over base sizing) ───
|
|
10133
|
+
// Clear out the count-pill sizing, set 6dp circle
|
|
10134
|
+
"data-[dot]:size-1.5",
|
|
10135
|
+
"data-[dot]:min-w-0",
|
|
10136
|
+
"data-[dot]:p-0",
|
|
10137
|
+
"data-[dot]:text-[0]"
|
|
10138
|
+
// suppress any stray text rendering on dot
|
|
10139
|
+
];
|
|
10140
|
+
var badgeVariants2 = classVarianceAuthority.cva([
|
|
10141
|
+
// ── Anchored placement — badge center on host's top-right corner ──────────────
|
|
10142
|
+
// top-0 right-0 places the badge's own top-right at the host's top-right,
|
|
10143
|
+
// then the 1/2-element translate moves the badge center onto that corner.
|
|
10144
|
+
// Host-size-agnostic: works for any wrapped element (icon, avatar, nav chip).
|
|
10145
|
+
"absolute top-0 right-0 -translate-y-1/2 translate-x-1/2",
|
|
10146
|
+
...badgeAppearance
|
|
10147
|
+
]);
|
|
10148
|
+
classVarianceAuthority.cva(["inline-flex", ...badgeAppearance]);
|
|
9740
10149
|
var getDisplayValue = (count, max) => {
|
|
9741
10150
|
if (count === void 0) return "";
|
|
9742
10151
|
return count > max ? `${max}+` : count.toString();
|
|
@@ -15284,7 +15693,7 @@ var modeToggleStateLayerVariants = classVarianceAuthority.cva([
|
|
|
15284
15693
|
"group-data-[focus-visible]/mode-toggle:opacity-10",
|
|
15285
15694
|
"group-data-[pressed]/mode-toggle:opacity-10"
|
|
15286
15695
|
]);
|
|
15287
|
-
var
|
|
15696
|
+
var scrimVariants = classVarianceAuthority.cva([
|
|
15288
15697
|
"fixed inset-0 z-40",
|
|
15289
15698
|
"bg-scrim opacity-32",
|
|
15290
15699
|
"transition-opacity duration-medium2 ease-standard"
|
|
@@ -16027,7 +16436,7 @@ var DatePickerModalStyled = React.forwardRef(
|
|
|
16027
16436
|
!reducedMotion && MODAL_DIALOG_MOTION,
|
|
16028
16437
|
className
|
|
16029
16438
|
),
|
|
16030
|
-
scrimClassName: cn(
|
|
16439
|
+
scrimClassName: cn(scrimVariants()),
|
|
16031
16440
|
slots: {
|
|
16032
16441
|
CellComponent: StyledCalendarCell,
|
|
16033
16442
|
NavButtonComponent: StyledNavButton,
|
|
@@ -16477,7 +16886,7 @@ var DatePickerModalInputStyled = React.forwardRef(
|
|
|
16477
16886
|
MODAL_INPUT_CONTENT_STRUCTURAL,
|
|
16478
16887
|
className
|
|
16479
16888
|
),
|
|
16480
|
-
scrimClassName: cn(
|
|
16889
|
+
scrimClassName: cn(scrimVariants()),
|
|
16481
16890
|
ActionButtonComponent: StyledActionButton
|
|
16482
16891
|
}
|
|
16483
16892
|
);
|
|
@@ -16635,7 +17044,8 @@ exports.DialogHeadline = DialogHeadline;
|
|
|
16635
17044
|
exports.Divider = Divider;
|
|
16636
17045
|
exports.DividerHeadless = DividerHeadless;
|
|
16637
17046
|
exports.Drawer = Drawer;
|
|
16638
|
-
exports.
|
|
17047
|
+
exports.DrawerContext = DrawerContext;
|
|
17048
|
+
exports.DrawerHeadline = DrawerHeadline;
|
|
16639
17049
|
exports.DrawerItem = DrawerItem;
|
|
16640
17050
|
exports.DrawerSection = DrawerSection;
|
|
16641
17051
|
exports.FAB = FAB;
|
|
@@ -16758,6 +17168,20 @@ exports.dockedFieldGroupVariants = dockedFieldGroupVariants;
|
|
|
16758
17168
|
exports.dockedLabelVariants = dockedLabelVariants;
|
|
16759
17169
|
exports.dockedTriggerStateLayerVariants = dockedTriggerStateLayerVariants;
|
|
16760
17170
|
exports.dockedTriggerVariants = dockedTriggerVariants;
|
|
17171
|
+
exports.drawerAnimationVariants = drawerAnimationVariants;
|
|
17172
|
+
exports.drawerHeadlineVariants = drawerHeadlineVariants;
|
|
17173
|
+
exports.drawerItemActiveIndicatorVariants = drawerItemActiveIndicatorVariants;
|
|
17174
|
+
exports.drawerItemBadgeVariants = drawerItemBadgeVariants;
|
|
17175
|
+
exports.drawerItemFocusRingVariants = drawerItemFocusRingVariants;
|
|
17176
|
+
exports.drawerItemIconVariants = drawerItemIconVariants;
|
|
17177
|
+
exports.drawerItemLabelVariants = drawerItemLabelVariants;
|
|
17178
|
+
exports.drawerItemStateLayerVariants = drawerItemStateLayerVariants;
|
|
17179
|
+
exports.drawerItemVariants = drawerItemVariants;
|
|
17180
|
+
exports.drawerScrimAnimationVariants = drawerScrimAnimationVariants;
|
|
17181
|
+
exports.drawerScrimVariants = drawerScrimVariants;
|
|
17182
|
+
exports.drawerSectionHeaderVariants = drawerSectionHeaderVariants;
|
|
17183
|
+
exports.drawerSectionVariants = drawerSectionVariants;
|
|
17184
|
+
exports.drawerVariants = drawerVariants;
|
|
16761
17185
|
exports.fabMenuItemFocusRingVariants = fabMenuItemFocusRingVariants;
|
|
16762
17186
|
exports.fabMenuItemIconVariants = fabMenuItemIconVariants;
|
|
16763
17187
|
exports.fabMenuItemLabelVariants = fabMenuItemLabelVariants;
|
|
@@ -16793,7 +17217,7 @@ exports.pxToRem = pxToRem;
|
|
|
16793
17217
|
exports.remToPx = remToPx;
|
|
16794
17218
|
exports.rgbToHex = rgbToHex;
|
|
16795
17219
|
exports.richTooltipVariants = richTooltipVariants;
|
|
16796
|
-
exports.scrimVariants =
|
|
17220
|
+
exports.scrimVariants = scrimVariants;
|
|
16797
17221
|
exports.searchBarAvatarVariants = searchBarAvatarVariants;
|
|
16798
17222
|
exports.searchBarFocusRingVariants = searchBarFocusRingVariants;
|
|
16799
17223
|
exports.searchBarInputVariants = searchBarInputVariants;
|