@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.js
CHANGED
|
@@ -5,11 +5,11 @@ export { argbFromHex, hexFromArgb } from '@material/material-color-utilities';
|
|
|
5
5
|
import React, { forwardRef, useRef, createContext, useState, useCallback, useId, useMemo, useEffect, useContext, useLayoutEffect, Children, isValidElement, cloneElement } from 'react';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
|
-
import { useButton, useHover, useFocusRing, mergeProps as mergeProps$1, useTextField, useCheckbox, VisuallyHidden, useSwitch, useRadioGroup, useRadio, useTabList, useTab, useTabPanel, FocusScope,
|
|
8
|
+
import { useButton, useHover, useFocusRing, mergeProps as mergeProps$1, useTextField, useCheckbox, VisuallyHidden, useSwitch, useRadioGroup, useRadio, useTabList, useTab, useTabPanel, FocusScope, useLink, useSeparator, useProgressBar, useToggleButton, useListBox, useOption, useSearchField, usePreventScroll, useOverlay, useSlider, useDatePicker, useDialog, useLocale, useDateField, useSliderThumb, useRangeCalendar, useCalendar, usePopover, DismissButton, usePress, useDateSegment, useCalendarGrid, useCalendarCell, useTooltipTrigger, useTooltip, useOverlayPosition } from 'react-aria';
|
|
9
9
|
import { mergeProps, filterDOMProps } from '@react-aria/utils';
|
|
10
10
|
import { useToggleState, useRadioGroupState, useTabListState, Item, useOverlayTriggerState, useListState, useSearchFieldState, useMenuTriggerState, useSliderState, useDatePickerState, useDateFieldState, useRangeCalendarState, useCalendarState, useTooltipTriggerState } from 'react-stately';
|
|
11
|
-
import { MenuItem as MenuItem$1, Menu as Menu$1, MenuTrigger as MenuTrigger$1, Popover, MenuSection as MenuSection$1, Separator, Header, useSlottedContext, ButtonContext } from 'react-aria-components';
|
|
12
11
|
import { createPortal } from 'react-dom';
|
|
12
|
+
import { MenuItem as MenuItem$1, Menu as Menu$1, MenuTrigger as MenuTrigger$1, Popover, MenuSection as MenuSection$1, Separator, Header, useSlottedContext, ButtonContext } from 'react-aria-components';
|
|
13
13
|
import { createCalendar, getWeeksInMonth, isSameDay, today, getLocalTimeZone } from '@internationalized/date';
|
|
14
14
|
|
|
15
15
|
// src/utils/cn.ts
|
|
@@ -467,6 +467,10 @@ var buttonVariants = cva(
|
|
|
467
467
|
* Filled/Tonal hover→level-1, focus/pressed→level-0
|
|
468
468
|
* Elevated base→level-1, hover→level-2, focus/pressed→level-1
|
|
469
469
|
* Outlined/Text no elevation
|
|
470
|
+
*
|
|
471
|
+
* Self-targeting `data-[x]:` is used for elevation because these classes
|
|
472
|
+
* sit on the root element (the group host) — group-data descendant
|
|
473
|
+
* selectors cannot match an element against itself.
|
|
470
474
|
*/
|
|
471
475
|
variant: {
|
|
472
476
|
/**
|
|
@@ -475,17 +479,17 @@ var buttonVariants = cva(
|
|
|
475
479
|
* Elevation: 0 base → 1 hover → 0 focus → 0 pressed
|
|
476
480
|
*/
|
|
477
481
|
filled: [
|
|
478
|
-
"
|
|
482
|
+
"text-on-primary shadow-none",
|
|
479
483
|
// Hover: gains level-1 elevation
|
|
480
|
-
"
|
|
484
|
+
"data-[hovered]:shadow-elevation-1",
|
|
481
485
|
// Focus/pressed: shadow must explicitly return to level-0
|
|
482
486
|
// (doubled attribute selector → higher specificity than hover)
|
|
483
|
-
"
|
|
484
|
-
"
|
|
485
|
-
// Disabled overrides
|
|
486
|
-
|
|
487
|
-
"
|
|
488
|
-
"
|
|
487
|
+
"data-[focus-visible]:data-[focus-visible]:shadow-none",
|
|
488
|
+
"data-[pressed]:data-[pressed]:data-[pressed]:shadow-none",
|
|
489
|
+
// Disabled overrides — root owns text color + shadow only;
|
|
490
|
+
// disabled bg override lives on buttonContainerVariants (filled variant)
|
|
491
|
+
"data-[disabled]:text-on-surface/38",
|
|
492
|
+
"data-[disabled]:shadow-none"
|
|
489
493
|
],
|
|
490
494
|
/**
|
|
491
495
|
* Outlined — medium emphasis. Transparent with border.
|
|
@@ -493,10 +497,10 @@ var buttonVariants = cva(
|
|
|
493
497
|
* Elevation: always 0
|
|
494
498
|
*/
|
|
495
499
|
outlined: [
|
|
496
|
-
"
|
|
500
|
+
"border border-outline text-primary",
|
|
497
501
|
// Disabled overrides
|
|
498
|
-
"
|
|
499
|
-
"
|
|
502
|
+
"data-[disabled]:border-on-surface/12",
|
|
503
|
+
"data-[disabled]:text-on-surface/38"
|
|
500
504
|
],
|
|
501
505
|
/**
|
|
502
506
|
* Tonal — secondary emphasis.
|
|
@@ -504,16 +508,15 @@ var buttonVariants = cva(
|
|
|
504
508
|
* Elevation: 0 base → 1 hover → 0 focus → 0 pressed
|
|
505
509
|
*/
|
|
506
510
|
tonal: [
|
|
507
|
-
"
|
|
511
|
+
"text-on-secondary-container shadow-none",
|
|
508
512
|
// Hover: gains level-1 elevation (same as filled)
|
|
509
|
-
"
|
|
513
|
+
"data-[hovered]:shadow-elevation-1",
|
|
510
514
|
// Focus/pressed: return to level-0
|
|
511
|
-
"
|
|
512
|
-
"
|
|
515
|
+
"data-[focus-visible]:data-[focus-visible]:shadow-none",
|
|
516
|
+
"data-[pressed]:data-[pressed]:data-[pressed]:shadow-none",
|
|
513
517
|
// Disabled overrides
|
|
514
|
-
"
|
|
515
|
-
"
|
|
516
|
-
"group-data-[disabled]/button:shadow-none"
|
|
518
|
+
"data-[disabled]:text-on-surface/38",
|
|
519
|
+
"data-[disabled]:shadow-none"
|
|
517
520
|
],
|
|
518
521
|
/**
|
|
519
522
|
* Elevated — separation via shadow.
|
|
@@ -521,17 +524,16 @@ var buttonVariants = cva(
|
|
|
521
524
|
* Elevation: 1 base → 2 hover → 1 focus → 1 pressed
|
|
522
525
|
*/
|
|
523
526
|
elevated: [
|
|
524
|
-
"
|
|
527
|
+
"text-primary shadow-elevation-1",
|
|
525
528
|
// Hover: gains extra elevation
|
|
526
|
-
"
|
|
529
|
+
"data-[hovered]:shadow-elevation-2",
|
|
527
530
|
// Focus/pressed: return to base level-1
|
|
528
531
|
// (doubled selector wins over single hover selector at same cascade position)
|
|
529
|
-
"
|
|
530
|
-
"
|
|
532
|
+
"data-[focus-visible]:data-[focus-visible]:shadow-elevation-1",
|
|
533
|
+
"data-[pressed]:data-[pressed]:data-[pressed]:shadow-elevation-1",
|
|
531
534
|
// Disabled overrides
|
|
532
|
-
"
|
|
533
|
-
"
|
|
534
|
-
"group-data-[disabled]/button:shadow-none"
|
|
535
|
+
"data-[disabled]:text-on-surface/38",
|
|
536
|
+
"data-[disabled]:shadow-none"
|
|
535
537
|
],
|
|
536
538
|
/**
|
|
537
539
|
* Text — lowest emphasis.
|
|
@@ -539,9 +541,9 @@ var buttonVariants = cva(
|
|
|
539
541
|
* Elevation: always 0
|
|
540
542
|
*/
|
|
541
543
|
text: [
|
|
542
|
-
"
|
|
544
|
+
"text-primary",
|
|
543
545
|
// Disabled overrides
|
|
544
|
-
"
|
|
546
|
+
"data-[disabled]:text-on-surface/38"
|
|
545
547
|
]
|
|
546
548
|
},
|
|
547
549
|
/**
|
|
@@ -579,6 +581,29 @@ var buttonVariants = cva(
|
|
|
579
581
|
}
|
|
580
582
|
}
|
|
581
583
|
);
|
|
584
|
+
var buttonContainerVariants = cva(
|
|
585
|
+
[
|
|
586
|
+
"absolute inset-0 rounded-[inherit] pointer-events-none",
|
|
587
|
+
// Effects transition for background-color — no overshoot
|
|
588
|
+
"transition-[background-color] duration-spring-standard-fast-effects ease-spring-standard-fast-effects"
|
|
589
|
+
],
|
|
590
|
+
{
|
|
591
|
+
variants: {
|
|
592
|
+
variant: {
|
|
593
|
+
// MD3 disabled: filled containers replace bg with on-surface/12.
|
|
594
|
+
// group-data descendant selector targets this child span (not the root host).
|
|
595
|
+
filled: "bg-primary group-data-[disabled]/button:bg-on-surface/12",
|
|
596
|
+
// outlined/text: container stays transparent when disabled — only border + label fade.
|
|
597
|
+
outlined: "bg-transparent",
|
|
598
|
+
// MD3 disabled: tonal and elevated containers also replace bg with on-surface/12.
|
|
599
|
+
tonal: "bg-secondary-container group-data-[disabled]/button:bg-on-surface/12",
|
|
600
|
+
elevated: "bg-surface-container-low group-data-[disabled]/button:bg-on-surface/12",
|
|
601
|
+
text: "bg-transparent"
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
defaultVariants: { variant: "filled" }
|
|
605
|
+
}
|
|
606
|
+
);
|
|
582
607
|
var buttonStateLayerVariants = cva(
|
|
583
608
|
[
|
|
584
609
|
"absolute inset-0 rounded-[inherit] overflow-hidden pointer-events-none opacity-0",
|
|
@@ -881,6 +906,7 @@ var Button = forwardRef(
|
|
|
881
906
|
className
|
|
882
907
|
),
|
|
883
908
|
children: [
|
|
909
|
+
/* @__PURE__ */ jsx("span", { className: cn(buttonContainerVariants({ variant })), "aria-hidden": "true" }),
|
|
884
910
|
ripples,
|
|
885
911
|
/* @__PURE__ */ jsx("span", { className: cn(buttonStateLayerVariants({ variant })), "aria-hidden": "true" }),
|
|
886
912
|
/* @__PURE__ */ jsx("span", { className: cn(buttonFocusRingVariants()), "aria-hidden": "true" }),
|
|
@@ -4388,7 +4414,51 @@ var NavigationBarItem = forwardRef(
|
|
|
4388
4414
|
);
|
|
4389
4415
|
NavigationBarItem.displayName = "NavigationBarItem";
|
|
4390
4416
|
var DrawerContext = createContext(null);
|
|
4391
|
-
var
|
|
4417
|
+
var ModalDrawerPanel = ({
|
|
4418
|
+
ariaLabel,
|
|
4419
|
+
onClose,
|
|
4420
|
+
className,
|
|
4421
|
+
animationState,
|
|
4422
|
+
getAnimationClassName,
|
|
4423
|
+
onTransitionEnd,
|
|
4424
|
+
forwardedRef,
|
|
4425
|
+
children
|
|
4426
|
+
}) => {
|
|
4427
|
+
const panelRef = useRef(null);
|
|
4428
|
+
usePreventScroll();
|
|
4429
|
+
const { dialogProps } = useDialog(
|
|
4430
|
+
{ "aria-label": ariaLabel },
|
|
4431
|
+
panelRef
|
|
4432
|
+
);
|
|
4433
|
+
const { overlayProps } = useOverlay(
|
|
4434
|
+
{ isOpen: true, onClose, isDismissable: true, shouldCloseOnBlur: false },
|
|
4435
|
+
panelRef
|
|
4436
|
+
);
|
|
4437
|
+
const setRef = useCallback(
|
|
4438
|
+
(node) => {
|
|
4439
|
+
panelRef.current = node;
|
|
4440
|
+
if (typeof forwardedRef === "function") {
|
|
4441
|
+
forwardedRef(node);
|
|
4442
|
+
} else if (forwardedRef !== null && forwardedRef !== void 0) {
|
|
4443
|
+
forwardedRef.current = node;
|
|
4444
|
+
}
|
|
4445
|
+
},
|
|
4446
|
+
[forwardedRef]
|
|
4447
|
+
);
|
|
4448
|
+
return /* @__PURE__ */ jsx(
|
|
4449
|
+
"div",
|
|
4450
|
+
{
|
|
4451
|
+
...mergeProps(overlayProps, dialogProps),
|
|
4452
|
+
ref: setRef,
|
|
4453
|
+
"aria-modal": "true",
|
|
4454
|
+
className: cn(className, getAnimationClassName?.(animationState)),
|
|
4455
|
+
"data-animation-state": animationState,
|
|
4456
|
+
onTransitionEnd,
|
|
4457
|
+
children
|
|
4458
|
+
}
|
|
4459
|
+
);
|
|
4460
|
+
};
|
|
4461
|
+
ModalDrawerPanel.displayName = "ModalDrawerPanel";
|
|
4392
4462
|
var HeadlessDrawer = forwardRef(
|
|
4393
4463
|
({
|
|
4394
4464
|
variant = "standard",
|
|
@@ -4399,8 +4469,9 @@ var HeadlessDrawer = forwardRef(
|
|
|
4399
4469
|
children,
|
|
4400
4470
|
className,
|
|
4401
4471
|
scrimClassName,
|
|
4402
|
-
|
|
4403
|
-
|
|
4472
|
+
getAnimationClassName,
|
|
4473
|
+
getScrimAnimationClassName,
|
|
4474
|
+
disableRipple = false
|
|
4404
4475
|
}, ref) => {
|
|
4405
4476
|
const state = useOverlayTriggerState({
|
|
4406
4477
|
...open !== void 0 ? { isOpen: open } : {},
|
|
@@ -4411,77 +4482,99 @@ var HeadlessDrawer = forwardRef(
|
|
|
4411
4482
|
const close = useCallback(() => {
|
|
4412
4483
|
state.close();
|
|
4413
4484
|
}, [state]);
|
|
4485
|
+
const [animationState, setAnimationState] = useState("exited");
|
|
4486
|
+
const closedRef = useRef(false);
|
|
4487
|
+
const exitFallbackRef = useRef(null);
|
|
4488
|
+
useEffect(() => {
|
|
4489
|
+
if (!isOpen) return;
|
|
4490
|
+
closedRef.current = false;
|
|
4491
|
+
setAnimationState("entering");
|
|
4492
|
+
const id = setTimeout(() => {
|
|
4493
|
+
setAnimationState("visible");
|
|
4494
|
+
}, 0);
|
|
4495
|
+
return () => clearTimeout(id);
|
|
4496
|
+
}, [isOpen]);
|
|
4497
|
+
useEffect(() => {
|
|
4498
|
+
if (isOpen) return;
|
|
4499
|
+
if (animationState === "exited" || animationState === "entering") return;
|
|
4500
|
+
if (animationState === "visible") {
|
|
4501
|
+
setAnimationState("exiting");
|
|
4502
|
+
exitFallbackRef.current = setTimeout(() => {
|
|
4503
|
+
if (!closedRef.current) {
|
|
4504
|
+
closedRef.current = true;
|
|
4505
|
+
setAnimationState("exited");
|
|
4506
|
+
}
|
|
4507
|
+
}, 500);
|
|
4508
|
+
}
|
|
4509
|
+
}, [isOpen, animationState]);
|
|
4510
|
+
useEffect(
|
|
4511
|
+
() => () => {
|
|
4512
|
+
if (exitFallbackRef.current !== null) {
|
|
4513
|
+
clearTimeout(exitFallbackRef.current);
|
|
4514
|
+
}
|
|
4515
|
+
},
|
|
4516
|
+
[]
|
|
4517
|
+
);
|
|
4518
|
+
const handleTransitionEnd = useCallback(() => {
|
|
4519
|
+
if (animationState === "exiting" && !closedRef.current) {
|
|
4520
|
+
if (exitFallbackRef.current !== null) {
|
|
4521
|
+
clearTimeout(exitFallbackRef.current);
|
|
4522
|
+
exitFallbackRef.current = null;
|
|
4523
|
+
}
|
|
4524
|
+
closedRef.current = true;
|
|
4525
|
+
setAnimationState("exited");
|
|
4526
|
+
}
|
|
4527
|
+
}, [animationState]);
|
|
4414
4528
|
const contextValue = {
|
|
4415
4529
|
isOpen,
|
|
4416
4530
|
close,
|
|
4417
|
-
disableRipple
|
|
4418
|
-
iconOnly
|
|
4531
|
+
disableRipple
|
|
4419
4532
|
};
|
|
4420
|
-
if (variant === "
|
|
4421
|
-
return /* @__PURE__ */ jsx(DrawerContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
/* @__PURE__ */ jsx(FocusScope, { contain: true, restoreFocus: true, autoFocus: true, children: /* @__PURE__ */ jsx(
|
|
4432
|
-
ModalDrawerPanel,
|
|
4433
|
-
{
|
|
4434
|
-
ariaLabel,
|
|
4435
|
-
onClose: () => state.close(),
|
|
4436
|
-
className,
|
|
4437
|
-
children
|
|
4438
|
-
}
|
|
4439
|
-
) })
|
|
4440
|
-
] }) }) });
|
|
4533
|
+
if (variant === "standard") {
|
|
4534
|
+
return /* @__PURE__ */ jsx(DrawerContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
4535
|
+
"nav",
|
|
4536
|
+
{
|
|
4537
|
+
ref,
|
|
4538
|
+
role: "navigation",
|
|
4539
|
+
"aria-label": ariaLabel,
|
|
4540
|
+
className,
|
|
4541
|
+
children
|
|
4542
|
+
}
|
|
4543
|
+
) });
|
|
4441
4544
|
}
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4545
|
+
if (!isOpen && animationState === "exited") {
|
|
4546
|
+
return null;
|
|
4547
|
+
}
|
|
4548
|
+
if (typeof document === "undefined") return null;
|
|
4549
|
+
const content = /* @__PURE__ */ jsx(DrawerContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(FocusScope, { contain: true, restoreFocus: true, autoFocus: true, children: [
|
|
4550
|
+
/* @__PURE__ */ jsx(
|
|
4551
|
+
"div",
|
|
4552
|
+
{
|
|
4553
|
+
"data-testid": "drawer-scrim",
|
|
4554
|
+
className: cn(scrimClassName, getScrimAnimationClassName?.(animationState)),
|
|
4555
|
+
"data-animation-state": animationState,
|
|
4556
|
+
onClick: close,
|
|
4557
|
+
"aria-hidden": "true"
|
|
4558
|
+
}
|
|
4559
|
+
),
|
|
4560
|
+
/* @__PURE__ */ jsx(
|
|
4561
|
+
ModalDrawerPanel,
|
|
4562
|
+
{
|
|
4563
|
+
ariaLabel,
|
|
4564
|
+
onClose: close,
|
|
4565
|
+
className,
|
|
4566
|
+
animationState,
|
|
4567
|
+
getAnimationClassName,
|
|
4568
|
+
onTransitionEnd: handleTransitionEnd,
|
|
4569
|
+
forwardedRef: ref,
|
|
4570
|
+
children
|
|
4571
|
+
}
|
|
4572
|
+
)
|
|
4573
|
+
] }) });
|
|
4574
|
+
return createPortal(content, document.body);
|
|
4452
4575
|
}
|
|
4453
4576
|
);
|
|
4454
4577
|
HeadlessDrawer.displayName = "HeadlessDrawer";
|
|
4455
|
-
var ModalDrawerPanel = ({
|
|
4456
|
-
ariaLabel,
|
|
4457
|
-
onClose,
|
|
4458
|
-
className,
|
|
4459
|
-
children
|
|
4460
|
-
}) => {
|
|
4461
|
-
const panelRef = useRef(null);
|
|
4462
|
-
usePreventScroll();
|
|
4463
|
-
const { dialogProps } = useDialog({ "aria-label": ariaLabel }, panelRef);
|
|
4464
|
-
const { overlayProps } = useOverlay(
|
|
4465
|
-
{
|
|
4466
|
-
isOpen: true,
|
|
4467
|
-
onClose,
|
|
4468
|
-
isDismissable: true,
|
|
4469
|
-
shouldCloseOnBlur: false
|
|
4470
|
-
},
|
|
4471
|
-
panelRef
|
|
4472
|
-
);
|
|
4473
|
-
return /* @__PURE__ */ jsx(
|
|
4474
|
-
"div",
|
|
4475
|
-
{
|
|
4476
|
-
...mergeProps(overlayProps, dialogProps),
|
|
4477
|
-
ref: panelRef,
|
|
4478
|
-
className,
|
|
4479
|
-
"aria-modal": "true",
|
|
4480
|
-
children
|
|
4481
|
-
}
|
|
4482
|
-
);
|
|
4483
|
-
};
|
|
4484
|
-
ModalDrawerPanel.displayName = "ModalDrawerPanel";
|
|
4485
4578
|
var HeadlessDrawerItem = forwardRef(
|
|
4486
4579
|
({
|
|
4487
4580
|
href,
|
|
@@ -4499,7 +4592,6 @@ var HeadlessDrawerItem = forwardRef(
|
|
|
4499
4592
|
...restProps
|
|
4500
4593
|
}, forwardedRef) => {
|
|
4501
4594
|
const internalRef = useRef(null);
|
|
4502
|
-
const { isFocusVisible, focusProps } = useFocusRing();
|
|
4503
4595
|
if (href) {
|
|
4504
4596
|
const linkRef = forwardedRef ?? internalRef;
|
|
4505
4597
|
const { linkProps } = useLink(
|
|
@@ -4513,14 +4605,12 @@ var HeadlessDrawerItem = forwardRef(
|
|
|
4513
4605
|
return /* @__PURE__ */ jsx(
|
|
4514
4606
|
"a",
|
|
4515
4607
|
{
|
|
4516
|
-
...mergeProps(linkProps,
|
|
4608
|
+
...mergeProps(linkProps, { onMouseDown }),
|
|
4517
4609
|
ref: linkRef,
|
|
4518
4610
|
href,
|
|
4519
4611
|
className,
|
|
4520
4612
|
title,
|
|
4521
4613
|
"aria-current": isActive ? "page" : void 0,
|
|
4522
|
-
"data-focus-visible": isFocusVisible || void 0,
|
|
4523
|
-
"data-active": isActive || void 0,
|
|
4524
4614
|
children
|
|
4525
4615
|
}
|
|
4526
4616
|
);
|
|
@@ -4543,13 +4633,11 @@ var HeadlessDrawerItem = forwardRef(
|
|
|
4543
4633
|
"button",
|
|
4544
4634
|
{
|
|
4545
4635
|
type: "button",
|
|
4546
|
-
...mergeProps(buttonProps,
|
|
4636
|
+
...mergeProps(buttonProps, { onMouseDown }),
|
|
4547
4637
|
ref: buttonRef,
|
|
4548
4638
|
className,
|
|
4549
4639
|
title,
|
|
4550
4640
|
"aria-current": isActive ? "page" : void 0,
|
|
4551
|
-
"data-focus-visible": isFocusVisible || void 0,
|
|
4552
|
-
"data-active": isActive || void 0,
|
|
4553
4641
|
children
|
|
4554
4642
|
}
|
|
4555
4643
|
);
|
|
@@ -4644,120 +4732,195 @@ var drawerVariants = cva(
|
|
|
4644
4732
|
// Layout
|
|
4645
4733
|
"fixed top-0 left-0 h-full",
|
|
4646
4734
|
"flex flex-col overflow-y-auto",
|
|
4647
|
-
//
|
|
4735
|
+
// Width — 360dp per MD3 spec
|
|
4736
|
+
"w-drawer",
|
|
4737
|
+
// Stacking
|
|
4648
4738
|
"z-50",
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
"transition-transform duration-medium4 ease-emphasized-decelerate",
|
|
4739
|
+
// Container padding — 12dp per MD3 nav drawer spec
|
|
4740
|
+
"px-3 py-3",
|
|
4652
4741
|
// Focus outline removal (focus management handled by FocusScope / React Aria)
|
|
4653
|
-
"outline-none"
|
|
4654
|
-
// Padding for content spacing
|
|
4655
|
-
"px-3"
|
|
4742
|
+
"outline-none"
|
|
4656
4743
|
],
|
|
4657
4744
|
{
|
|
4658
4745
|
variants: {
|
|
4659
4746
|
/**
|
|
4660
|
-
* Structural variant — drives
|
|
4661
|
-
*
|
|
4662
|
-
* - `
|
|
4747
|
+
* Structural variant — drives shape and elevation.
|
|
4748
|
+
*
|
|
4749
|
+
* - `standard`: flush left panel, square trailing edge, flat surface.
|
|
4750
|
+
* - `modal`: overlay dialog, 16dp trailing corner, shadow-elevation-1.
|
|
4663
4751
|
*/
|
|
4664
4752
|
variant: {
|
|
4665
|
-
standard: ["bg-surface-container-low"],
|
|
4666
|
-
modal: ["bg-surface-container", "shadow-elevation-1"]
|
|
4753
|
+
standard: ["bg-surface-container-low", "rounded-none"],
|
|
4754
|
+
modal: ["bg-surface-container-low", "rounded-r-lg", "shadow-elevation-1"]
|
|
4667
4755
|
},
|
|
4668
4756
|
/**
|
|
4669
|
-
* Open/closed state — drives translation.
|
|
4670
|
-
*
|
|
4671
|
-
*
|
|
4757
|
+
* Open/closed state — drives translation for the STANDARD variant only.
|
|
4758
|
+
*
|
|
4759
|
+
* Standard slide: spatial on-screen property → spring-standard-default-spatial.
|
|
4760
|
+
* Modal enter/exit is handled externally via drawerAnimationVariants + portal gate.
|
|
4761
|
+
*
|
|
4762
|
+
* - `true`: translate-x-0 (visible)
|
|
4763
|
+
* - `false`: -translate-x-full (off-screen to the left)
|
|
4672
4764
|
*/
|
|
4673
4765
|
open: {
|
|
4674
|
-
true: [
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4766
|
+
true: [
|
|
4767
|
+
"translate-x-0",
|
|
4768
|
+
"transition-transform",
|
|
4769
|
+
"duration-spring-standard-default-spatial",
|
|
4770
|
+
"ease-spring-standard-default-spatial"
|
|
4771
|
+
],
|
|
4772
|
+
false: [
|
|
4773
|
+
"-translate-x-full",
|
|
4774
|
+
"transition-transform",
|
|
4775
|
+
"duration-spring-standard-default-spatial",
|
|
4776
|
+
"ease-spring-standard-default-spatial"
|
|
4777
|
+
]
|
|
4685
4778
|
}
|
|
4686
4779
|
},
|
|
4687
4780
|
defaultVariants: {
|
|
4688
4781
|
variant: "standard",
|
|
4689
|
-
open: false
|
|
4690
|
-
iconOnly: false
|
|
4782
|
+
open: false
|
|
4691
4783
|
}
|
|
4692
4784
|
}
|
|
4693
4785
|
);
|
|
4694
|
-
var
|
|
4786
|
+
var drawerAnimationVariants = cva("", {
|
|
4787
|
+
variants: {
|
|
4788
|
+
animationState: {
|
|
4789
|
+
// Mount frame: invisible until animation starts
|
|
4790
|
+
entering: ["opacity-0"],
|
|
4791
|
+
// Entry animation: slide in from the left edge
|
|
4792
|
+
visible: ["animate-md-slide-in-left"],
|
|
4793
|
+
// Exit animation: slide out to the left
|
|
4794
|
+
exiting: ["animate-md-slide-out-left"],
|
|
4795
|
+
// Portal gate removes element; classes below act as a safety net
|
|
4796
|
+
exited: ["opacity-0", "pointer-events-none"]
|
|
4797
|
+
}
|
|
4798
|
+
},
|
|
4799
|
+
defaultVariants: {
|
|
4800
|
+
animationState: "entering"
|
|
4801
|
+
}
|
|
4802
|
+
});
|
|
4803
|
+
var drawerScrimAnimationVariants = cva(
|
|
4695
4804
|
[
|
|
4696
|
-
|
|
4697
|
-
"
|
|
4698
|
-
"
|
|
4699
|
-
"rounded-full",
|
|
4700
|
-
// Typography
|
|
4701
|
-
"text-label-large",
|
|
4702
|
-
// Interaction
|
|
4703
|
-
"cursor-pointer select-none outline-none",
|
|
4704
|
-
// State layer pseudo-element (z-[1] above active indicator)
|
|
4705
|
-
"before:absolute before:inset-0 before:rounded-full before:z-[1]",
|
|
4706
|
-
"before:transition-opacity before:duration-short2 before:ease-standard",
|
|
4707
|
-
"before:opacity-0",
|
|
4708
|
-
// Hover and focus visible state layers
|
|
4709
|
-
"hover:before:opacity-8",
|
|
4710
|
-
"focus-visible:before:opacity-12",
|
|
4711
|
-
// Active pressed state
|
|
4712
|
-
"active:before:opacity-12",
|
|
4713
|
-
// Transition for color changes
|
|
4714
|
-
"transition-colors duration-short2 ease-standard"
|
|
4805
|
+
"transition-opacity",
|
|
4806
|
+
"duration-spring-standard-fast-effects",
|
|
4807
|
+
"ease-spring-standard-fast-effects"
|
|
4715
4808
|
],
|
|
4716
4809
|
{
|
|
4717
4810
|
variants: {
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
*/
|
|
4724
|
-
isActive: {
|
|
4725
|
-
true: [
|
|
4726
|
-
"text-on-secondary-container",
|
|
4727
|
-
"before:bg-on-secondary-container",
|
|
4728
|
-
// Active indicator — 336dp pill via after: pseudo
|
|
4729
|
-
"after:absolute after:inset-0 after:mx-auto after:max-w-[336px]",
|
|
4730
|
-
"after:rounded-full after:bg-secondary-container"
|
|
4731
|
-
],
|
|
4732
|
-
false: ["bg-transparent", "text-on-surface-variant", "before:bg-on-surface-variant"]
|
|
4733
|
-
},
|
|
4734
|
-
/**
|
|
4735
|
-
* Whether the item is disabled.
|
|
4736
|
-
* Applies `opacity-38` per MD3 disabled state spec.
|
|
4737
|
-
*/
|
|
4738
|
-
isDisabled: {
|
|
4739
|
-
true: ["opacity-38 cursor-not-allowed pointer-events-none"],
|
|
4740
|
-
false: []
|
|
4811
|
+
animationState: {
|
|
4812
|
+
entering: ["opacity-0"],
|
|
4813
|
+
visible: ["opacity-32"],
|
|
4814
|
+
exiting: ["opacity-0"],
|
|
4815
|
+
exited: ["opacity-0", "pointer-events-none"]
|
|
4741
4816
|
}
|
|
4742
4817
|
},
|
|
4743
4818
|
defaultVariants: {
|
|
4744
|
-
|
|
4745
|
-
isDisabled: false
|
|
4819
|
+
animationState: "entering"
|
|
4746
4820
|
}
|
|
4747
4821
|
}
|
|
4748
4822
|
);
|
|
4749
|
-
var
|
|
4750
|
-
|
|
4751
|
-
"
|
|
4752
|
-
"
|
|
4823
|
+
var drawerItemVariants = cva([
|
|
4824
|
+
// Layout
|
|
4825
|
+
"relative flex w-full items-center",
|
|
4826
|
+
"h-14 pl-4 pr-6 gap-3",
|
|
4827
|
+
// Shape
|
|
4828
|
+
"rounded-full",
|
|
4829
|
+
// Typography — Label Large per MD3 spec (size via text-label-large, weight + tracking explicit)
|
|
4830
|
+
"text-label-large",
|
|
4831
|
+
"font-medium",
|
|
4832
|
+
"tracking-[0.1px]",
|
|
4833
|
+
// Interaction
|
|
4834
|
+
"cursor-pointer select-none outline-none",
|
|
4835
|
+
// Color transition (effects — no overshoot)
|
|
4836
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
4837
|
+
// Inactive content color (icon/label/badge inherit this via currentColor)
|
|
4838
|
+
"text-on-surface-variant",
|
|
4839
|
+
// Active content color — self-targeting data-[active]: (root is the group host)
|
|
4840
|
+
"data-[active]:text-on-secondary-container",
|
|
4841
|
+
// Disabled — self-targeting
|
|
4842
|
+
"data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed",
|
|
4843
|
+
"data-[disabled]:text-on-surface/38"
|
|
4753
4844
|
]);
|
|
4754
|
-
var
|
|
4755
|
-
|
|
4756
|
-
"
|
|
4757
|
-
|
|
4758
|
-
"
|
|
4845
|
+
var drawerItemActiveIndicatorVariants = cva([
|
|
4846
|
+
"absolute inset-0 rounded-[inherit] pointer-events-none",
|
|
4847
|
+
"bg-secondary-container",
|
|
4848
|
+
// Effects transition for opacity — no overshoot
|
|
4849
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
4850
|
+
// Hidden when inactive; shown when active
|
|
4851
|
+
"opacity-0",
|
|
4852
|
+
"group-data-[active]/draweritem:opacity-100",
|
|
4853
|
+
// z-0: below state layer (z-[1]) and content (z-10)
|
|
4854
|
+
"z-0"
|
|
4855
|
+
]);
|
|
4856
|
+
var drawerItemStateLayerVariants = cva([
|
|
4857
|
+
"absolute inset-0 rounded-[inherit] overflow-hidden pointer-events-none opacity-0",
|
|
4858
|
+
// Effects transition — opacity must NOT overshoot
|
|
4859
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
4860
|
+
// Color: inactive uses on-surface-variant; active switches to on-secondary-container
|
|
4861
|
+
"bg-on-surface-variant",
|
|
4862
|
+
"group-data-[active]/draweritem:bg-on-secondary-container",
|
|
4863
|
+
// Hover: 8%
|
|
4864
|
+
"group-data-[hovered]/draweritem:opacity-8",
|
|
4865
|
+
// Focus-visible: 10% (MD3 focus state layer)
|
|
4866
|
+
"group-data-[focus-visible]/draweritem:opacity-10",
|
|
4867
|
+
// Pressed: 10%, doubled selector wins over hover at same cascade position
|
|
4868
|
+
"group-data-[pressed]/draweritem:group-data-[pressed]/draweritem:opacity-10",
|
|
4869
|
+
// No state layer when disabled
|
|
4870
|
+
"group-data-[disabled]/draweritem:hidden",
|
|
4871
|
+
// z-[1]: above active indicator (z-0), below focus ring and content
|
|
4872
|
+
"z-[1]"
|
|
4873
|
+
]);
|
|
4874
|
+
var drawerItemFocusRingVariants = cva([
|
|
4875
|
+
"pointer-events-none absolute inset-0 rounded-[inherit]",
|
|
4876
|
+
"outline outline-2 -outline-offset-2 outline-secondary",
|
|
4877
|
+
// Effects transition — opacity must not overshoot
|
|
4878
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
4879
|
+
"opacity-0",
|
|
4880
|
+
"group-data-[focus-visible]/draweritem:opacity-100",
|
|
4881
|
+
// z-[2]: above state layer (z-[1]), below content (z-10)
|
|
4882
|
+
"z-[2]"
|
|
4883
|
+
]);
|
|
4884
|
+
var drawerItemIconVariants = cva([
|
|
4885
|
+
"relative z-10 flex shrink-0 items-center justify-center",
|
|
4886
|
+
"h-6 w-6",
|
|
4887
|
+
// Color and transition inherited via currentColor from root
|
|
4888
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
4889
|
+
// Explicit disabled override — mirrors Menu icon (on-surface/38)
|
|
4890
|
+
"group-data-[disabled]/draweritem:text-on-surface/38"
|
|
4891
|
+
]);
|
|
4892
|
+
var drawerItemLabelVariants = cva(["relative z-10 flex-1 min-w-0 truncate"]);
|
|
4893
|
+
var drawerItemBadgeVariants = cva([
|
|
4894
|
+
"relative z-10 shrink-0 ml-auto",
|
|
4895
|
+
"text-label-large",
|
|
4896
|
+
"font-medium",
|
|
4897
|
+
"tracking-[0.1px]",
|
|
4898
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects"
|
|
4899
|
+
]);
|
|
4900
|
+
var drawerHeadlineVariants = cva([
|
|
4901
|
+
"px-4 pt-4 pb-1",
|
|
4902
|
+
"text-title-small",
|
|
4903
|
+
"font-medium",
|
|
4904
|
+
"tracking-[0.1px]",
|
|
4905
|
+
"text-on-surface-variant",
|
|
4906
|
+
"select-none"
|
|
4907
|
+
]);
|
|
4908
|
+
var drawerScrimVariants = cva([
|
|
4909
|
+
"fixed inset-0 z-40",
|
|
4910
|
+
// NOTE: opacity is intentionally absent here — it is controlled per
|
|
4911
|
+
// animation state by drawerScrimAnimationVariants (opacity-0 / opacity-32)
|
|
4912
|
+
// to avoid tailwind-merge collapsing the classes during cn() composition.
|
|
4913
|
+
"bg-scrim"
|
|
4914
|
+
]);
|
|
4915
|
+
var drawerSectionVariants = cva(["flex flex-col w-full"]);
|
|
4916
|
+
var drawerSectionHeaderVariants = cva([
|
|
4917
|
+
"px-4 pt-4 pb-2",
|
|
4918
|
+
"text-title-small",
|
|
4919
|
+
"font-medium",
|
|
4920
|
+
"tracking-[0.1px]",
|
|
4921
|
+
"text-on-surface-variant",
|
|
4922
|
+
"select-none"
|
|
4759
4923
|
]);
|
|
4760
|
-
cva(["border-t border-outline-variant", "mx-4 my-2"]);
|
|
4761
4924
|
var DrawerSection = forwardRef(
|
|
4762
4925
|
({ header, children, showDivider = true, _isFirstSection = false, className }, ref) => {
|
|
4763
4926
|
const shouldShowDivider = showDivider && !_isFirstSection;
|
|
@@ -4779,19 +4942,19 @@ var Drawer = forwardRef(
|
|
|
4779
4942
|
children,
|
|
4780
4943
|
className,
|
|
4781
4944
|
disableRipple = false,
|
|
4782
|
-
iconOnly = false,
|
|
4783
4945
|
...restProps
|
|
4784
4946
|
}, ref) => {
|
|
4785
4947
|
const isOpen = open ?? defaultOpen;
|
|
4948
|
+
const reducedMotion = useReducedMotion();
|
|
4786
4949
|
const drawerPanelClass = cn(
|
|
4787
|
-
drawerVariants({
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
iconOnly
|
|
4791
|
-
}),
|
|
4950
|
+
drawerVariants({ variant, open: isOpen }),
|
|
4951
|
+
// Suppress spring transition when user has requested reduced motion
|
|
4952
|
+
reducedMotion && "transition-none",
|
|
4792
4953
|
className
|
|
4793
4954
|
);
|
|
4794
|
-
const scrimClass =
|
|
4955
|
+
const scrimClass = drawerScrimVariants();
|
|
4956
|
+
const getAnimationClassName = reducedMotion ? (_state) => "" : (state) => drawerAnimationVariants({ animationState: state });
|
|
4957
|
+
const getScrimAnimationClassName = reducedMotion ? (_state) => "" : (state) => drawerScrimAnimationVariants({ animationState: state });
|
|
4795
4958
|
let foundFirstSection = false;
|
|
4796
4959
|
const processedChildren = React.Children.map(children, (child) => {
|
|
4797
4960
|
if (React.isValidElement(child) && child.type === DrawerSection) {
|
|
@@ -4804,7 +4967,7 @@ var Drawer = forwardRef(
|
|
|
4804
4967
|
}
|
|
4805
4968
|
return child;
|
|
4806
4969
|
});
|
|
4807
|
-
return /* @__PURE__ */ jsx(
|
|
4970
|
+
return /* @__PURE__ */ jsx(
|
|
4808
4971
|
HeadlessDrawer,
|
|
4809
4972
|
{
|
|
4810
4973
|
ref,
|
|
@@ -4815,153 +4978,99 @@ var Drawer = forwardRef(
|
|
|
4815
4978
|
"aria-label": ariaLabel,
|
|
4816
4979
|
className: drawerPanelClass,
|
|
4817
4980
|
scrimClassName: scrimClass,
|
|
4981
|
+
getAnimationClassName,
|
|
4982
|
+
getScrimAnimationClassName,
|
|
4818
4983
|
disableRipple,
|
|
4819
|
-
iconOnly,
|
|
4820
4984
|
...restProps,
|
|
4821
4985
|
children: processedChildren
|
|
4822
4986
|
}
|
|
4823
|
-
)
|
|
4987
|
+
);
|
|
4824
4988
|
}
|
|
4825
4989
|
);
|
|
4826
4990
|
Drawer.displayName = "Drawer";
|
|
4827
|
-
var badgeAppearance = [
|
|
4828
|
-
// ── Shape ─────────────────────────────────────────────────────────────────────
|
|
4829
|
-
"flex items-center justify-center",
|
|
4830
|
-
"rounded-full",
|
|
4831
|
-
// ── Large (count) sizing — base defaults ──────────────────────────────────────
|
|
4832
|
-
// Height 16dp, min-width 16dp, horizontal padding 4dp
|
|
4833
|
-
"h-4 min-w-4 px-1",
|
|
4834
|
-
// ── Color — error role (only MD3-spec role for badges) ────────────────────────
|
|
4835
|
-
"bg-error text-on-error",
|
|
4836
|
-
// ── Typography — label-small, tight leading, tabular numbers ──────────────────
|
|
4837
|
-
"text-label-small leading-none tabular-nums",
|
|
4838
|
-
// ── Visibility (runtime flag) ──────────────────────────────────────────────────
|
|
4839
|
-
// Base: fully visible
|
|
4840
|
-
"scale-100",
|
|
4841
|
-
// data-invisible: scale to zero (visually hidden; aria-label still readable by SR)
|
|
4842
|
-
"data-[invisible]:scale-0",
|
|
4843
|
-
// ── Dot content flag overrides (placed last — cascade wins over base sizing) ───
|
|
4844
|
-
// Clear out the count-pill sizing, set 6dp circle
|
|
4845
|
-
"data-[dot]:size-1.5",
|
|
4846
|
-
"data-[dot]:min-w-0",
|
|
4847
|
-
"data-[dot]:p-0",
|
|
4848
|
-
"data-[dot]:text-[0]"
|
|
4849
|
-
// suppress any stray text rendering on dot
|
|
4850
|
-
];
|
|
4851
|
-
var badgeVariants2 = cva([
|
|
4852
|
-
// ── Anchored placement — badge center on host's top-right corner ──────────────
|
|
4853
|
-
// top-0 right-0 places the badge's own top-right at the host's top-right,
|
|
4854
|
-
// then the 1/2-element translate moves the badge center onto that corner.
|
|
4855
|
-
// Host-size-agnostic: works for any wrapped element (icon, avatar, nav chip).
|
|
4856
|
-
"absolute top-0 right-0 -translate-y-1/2 translate-x-1/2",
|
|
4857
|
-
...badgeAppearance
|
|
4858
|
-
]);
|
|
4859
|
-
var badgeStaticVariants = cva(["inline-flex", ...badgeAppearance]);
|
|
4860
|
-
function isBadgeConfig(badge) {
|
|
4861
|
-
return typeof badge === "object" && badge !== null && !isValidElement(badge) && "count" in badge;
|
|
4862
|
-
}
|
|
4863
|
-
function getBadgeDisplayValue(count, max) {
|
|
4864
|
-
if (count === void 0) return "";
|
|
4865
|
-
return count > max ? `${max}+` : count.toString();
|
|
4866
|
-
}
|
|
4867
|
-
function getBadgeAriaLabel(count) {
|
|
4868
|
-
return count === void 0 ? "New" : `${count} notifications`;
|
|
4869
|
-
}
|
|
4870
4991
|
var DrawerItem = forwardRef(
|
|
4871
4992
|
({
|
|
4872
4993
|
href,
|
|
4873
4994
|
icon,
|
|
4874
4995
|
label,
|
|
4875
4996
|
badge,
|
|
4876
|
-
secondaryText,
|
|
4877
4997
|
isActive = false,
|
|
4878
4998
|
isDisabled = false,
|
|
4879
4999
|
disableRipple = false,
|
|
4880
5000
|
className,
|
|
4881
|
-
onPress,
|
|
4882
|
-
|
|
4883
|
-
onPressEnd,
|
|
4884
|
-
onPressChange,
|
|
4885
|
-
onPressUp,
|
|
5001
|
+
// All remaining props (onPress, onPressStart, onPressEnd, etc.) stay in
|
|
5002
|
+
// restProps and are passed into mergeProps — mirrors the Button pattern.
|
|
4886
5003
|
...restProps
|
|
4887
5004
|
}, ref) => {
|
|
4888
|
-
const
|
|
4889
|
-
const
|
|
5005
|
+
const [isPressed, setIsPressed] = useState(false);
|
|
5006
|
+
const handlePressStart = useCallback(() => setIsPressed(true), []);
|
|
5007
|
+
const handlePressEnd = useCallback(() => setIsPressed(false), []);
|
|
5008
|
+
const { isHovered, hoverProps } = useHover({ isDisabled });
|
|
5009
|
+
const { isFocusVisible, focusProps } = useFocusRing();
|
|
4890
5010
|
const { onMouseDown: handleRipple, ripples } = useRipple({
|
|
4891
|
-
disabled:
|
|
5011
|
+
disabled: isDisabled || disableRipple
|
|
4892
5012
|
});
|
|
4893
|
-
const
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
const ariaLabel = getBadgeAriaLabel(badge.count);
|
|
4900
|
-
return /* @__PURE__ */ jsx("span", { className: "relative z-10 ml-auto flex shrink-0 items-center pr-2", children: /* @__PURE__ */ jsx(
|
|
4901
|
-
"span",
|
|
4902
|
-
{
|
|
4903
|
-
role: "status",
|
|
4904
|
-
"aria-label": ariaLabel,
|
|
4905
|
-
"data-dot": isDot ? "" : void 0,
|
|
4906
|
-
className: cn(badgeStaticVariants()),
|
|
4907
|
-
children: displayValue
|
|
4908
|
-
}
|
|
4909
|
-
) });
|
|
4910
|
-
}
|
|
4911
|
-
return /* @__PURE__ */ jsx("span", { className: "relative z-10 ml-auto flex shrink-0 items-center pr-2", "aria-hidden": "true", children: badge });
|
|
4912
|
-
};
|
|
5013
|
+
const mergedInteractionProps = mergeProps$1(
|
|
5014
|
+
hoverProps,
|
|
5015
|
+
focusProps,
|
|
5016
|
+
{ onPressStart: handlePressStart, onPressEnd: handlePressEnd },
|
|
5017
|
+
restProps
|
|
5018
|
+
);
|
|
4913
5019
|
return /* @__PURE__ */ jsxs(
|
|
4914
5020
|
HeadlessDrawerItem,
|
|
4915
5021
|
{
|
|
4916
|
-
...
|
|
5022
|
+
...mergedInteractionProps,
|
|
4917
5023
|
ref,
|
|
4918
5024
|
...href !== void 0 ? { href } : {},
|
|
4919
5025
|
isActive,
|
|
4920
|
-
...
|
|
4921
|
-
...onPress !== void 0 ? { onPress } : {},
|
|
4922
|
-
...onPressStart !== void 0 ? { onPressStart } : {},
|
|
4923
|
-
...onPressEnd !== void 0 ? { onPressEnd } : {},
|
|
4924
|
-
...onPressChange !== void 0 ? { onPressChange } : {},
|
|
4925
|
-
...onPressUp !== void 0 ? { onPressUp } : {},
|
|
5026
|
+
...isDisabled !== void 0 ? { isDisabled } : {},
|
|
4926
5027
|
onMouseDown: handleRipple,
|
|
4927
|
-
|
|
5028
|
+
...getInteractionDataAttributes({
|
|
5029
|
+
isHovered,
|
|
5030
|
+
isFocusVisible,
|
|
5031
|
+
isPressed,
|
|
5032
|
+
isDisabled
|
|
5033
|
+
}),
|
|
5034
|
+
"data-active": isActive ? "" : void 0,
|
|
4928
5035
|
className: cn(
|
|
4929
|
-
drawerItemVariants(
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
}),
|
|
5036
|
+
drawerItemVariants(),
|
|
5037
|
+
// group/draweritem: enables group-data-[x]/draweritem selectors in all slots
|
|
5038
|
+
"group/draweritem",
|
|
4933
5039
|
className
|
|
4934
5040
|
),
|
|
4935
5041
|
children: [
|
|
4936
|
-
|
|
4937
|
-
|
|
5042
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: drawerItemActiveIndicatorVariants() }),
|
|
5043
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: drawerItemStateLayerVariants() }),
|
|
5044
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: drawerItemFocusRingVariants() }),
|
|
5045
|
+
/* @__PURE__ */ jsx(
|
|
4938
5046
|
"span",
|
|
4939
5047
|
{
|
|
4940
|
-
className: "
|
|
5048
|
+
className: "pointer-events-none absolute inset-0 z-[3] overflow-hidden rounded-[inherit]",
|
|
4941
5049
|
"aria-hidden": "true",
|
|
4942
|
-
children:
|
|
5050
|
+
children: ripples
|
|
4943
5051
|
}
|
|
4944
5052
|
),
|
|
4945
|
-
/* @__PURE__ */
|
|
5053
|
+
icon && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: drawerItemIconVariants(), children: icon }),
|
|
5054
|
+
/* @__PURE__ */ jsx("span", { className: drawerItemLabelVariants(), children: label }),
|
|
5055
|
+
badge !== void 0 && badge !== null && /* @__PURE__ */ jsx(
|
|
4946
5056
|
"span",
|
|
4947
5057
|
{
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
children: [
|
|
4953
|
-
/* @__PURE__ */ jsx("span", { className: "truncate", children: label }),
|
|
4954
|
-
secondaryText && /* @__PURE__ */ jsx("span", { className: "text-body-small truncate opacity-70", children: secondaryText })
|
|
4955
|
-
]
|
|
5058
|
+
role: "status",
|
|
5059
|
+
"aria-label": typeof badge === "number" ? `${badge} notifications` : String(badge),
|
|
5060
|
+
className: drawerItemBadgeVariants(),
|
|
5061
|
+
children: badge
|
|
4956
5062
|
}
|
|
4957
|
-
)
|
|
4958
|
-
!isIconOnly && renderBadge()
|
|
5063
|
+
)
|
|
4959
5064
|
]
|
|
4960
5065
|
}
|
|
4961
5066
|
);
|
|
4962
5067
|
}
|
|
4963
5068
|
);
|
|
4964
5069
|
DrawerItem.displayName = "DrawerItem";
|
|
5070
|
+
var DrawerHeadline = forwardRef(
|
|
5071
|
+
({ children, className, ...restProps }, ref) => /* @__PURE__ */ jsx("span", { ref, className: cn(drawerHeadlineVariants(), className), ...restProps, children })
|
|
5072
|
+
);
|
|
5073
|
+
DrawerHeadline.displayName = "DrawerHeadline";
|
|
4965
5074
|
var progressContainerVariants = cva(["inline-flex", "flex-col", "gap-1"], {
|
|
4966
5075
|
variants: {
|
|
4967
5076
|
type: {
|
|
@@ -5903,50 +6012,460 @@ var Card = forwardRef(function Card2({
|
|
|
5903
6012
|
/* @__PURE__ */ jsx("div", { className: "relative z-10", children })
|
|
5904
6013
|
]
|
|
5905
6014
|
}
|
|
5906
|
-
);
|
|
5907
|
-
});
|
|
5908
|
-
Card.displayName = "Card";
|
|
5909
|
-
var cardMediaVariants = cva("w-full object-cover", {
|
|
5910
|
-
variants: {
|
|
5911
|
-
aspectRatio: {
|
|
5912
|
-
"16/9": "aspect-video",
|
|
5913
|
-
"4/3": "aspect-[4/3]",
|
|
5914
|
-
"1/1": "aspect-square",
|
|
5915
|
-
auto: ""
|
|
6015
|
+
);
|
|
6016
|
+
});
|
|
6017
|
+
Card.displayName = "Card";
|
|
6018
|
+
var cardMediaVariants = cva("w-full object-cover", {
|
|
6019
|
+
variants: {
|
|
6020
|
+
aspectRatio: {
|
|
6021
|
+
"16/9": "aspect-video",
|
|
6022
|
+
"4/3": "aspect-[4/3]",
|
|
6023
|
+
"1/1": "aspect-square",
|
|
6024
|
+
auto: ""
|
|
6025
|
+
}
|
|
6026
|
+
},
|
|
6027
|
+
defaultVariants: {
|
|
6028
|
+
aspectRatio: "auto"
|
|
6029
|
+
}
|
|
6030
|
+
});
|
|
6031
|
+
var CardMedia = forwardRef(function CardMedia2({ src, alt, aspectRatio = "auto", className }, ref) {
|
|
6032
|
+
return /* @__PURE__ */ jsx(
|
|
6033
|
+
"img",
|
|
6034
|
+
{
|
|
6035
|
+
ref,
|
|
6036
|
+
src,
|
|
6037
|
+
alt,
|
|
6038
|
+
...alt === "" && { role: "presentation" },
|
|
6039
|
+
className: cn(cardMediaVariants({ aspectRatio }), className)
|
|
6040
|
+
}
|
|
6041
|
+
);
|
|
6042
|
+
});
|
|
6043
|
+
CardMedia.displayName = "CardMedia";
|
|
6044
|
+
var CardHeader = forwardRef(function CardHeader2({ headline, subheader, className }, ref) {
|
|
6045
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("p-4", className), children: [
|
|
6046
|
+
/* @__PURE__ */ jsx("h3", { className: "text-on-surface text-title-medium", children: headline }),
|
|
6047
|
+
subheader !== void 0 && /* @__PURE__ */ jsx("p", { className: "text-on-surface-variant text-body-medium mt-1", children: subheader })
|
|
6048
|
+
] });
|
|
6049
|
+
});
|
|
6050
|
+
CardHeader.displayName = "CardHeader";
|
|
6051
|
+
var CardContent = forwardRef(function CardContent2({ children, className }, ref) {
|
|
6052
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("p-4", className), children });
|
|
6053
|
+
});
|
|
6054
|
+
CardContent.displayName = "CardContent";
|
|
6055
|
+
var CardActions = forwardRef(function CardActions2({ children, className }, ref) {
|
|
6056
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center justify-end gap-2 p-4 pt-0", className), children });
|
|
6057
|
+
});
|
|
6058
|
+
CardActions.displayName = "CardActions";
|
|
6059
|
+
var menuContainerVariants = cva(
|
|
6060
|
+
[
|
|
6061
|
+
// Width constraints: 112dp min / 280dp max per MD3 spec
|
|
6062
|
+
"min-w-28 max-w-70",
|
|
6063
|
+
"flex flex-col",
|
|
6064
|
+
// Scroll behaviour
|
|
6065
|
+
"max-h-[calc(var(--visual-viewport-height,100vh)-2rem)]",
|
|
6066
|
+
// Stacking
|
|
6067
|
+
"z-50",
|
|
6068
|
+
"gap-0.5",
|
|
6069
|
+
// Focus outline delegated to React Aria
|
|
6070
|
+
"outline-none"
|
|
6071
|
+
],
|
|
6072
|
+
{
|
|
6073
|
+
variants: {
|
|
6074
|
+
/**
|
|
6075
|
+
* Color scheme — drives item/segment background and content colors.
|
|
6076
|
+
* standard: surface-container-low item background.
|
|
6077
|
+
* vibrant: tertiary-container item background.
|
|
6078
|
+
*/
|
|
6079
|
+
colorScheme: {
|
|
6080
|
+
standard: [],
|
|
6081
|
+
vibrant: []
|
|
6082
|
+
},
|
|
6083
|
+
/**
|
|
6084
|
+
* Visual style — drives corner radius and container background.
|
|
6085
|
+
*
|
|
6086
|
+
* baseline: solid surface-container, 4dp corners, 8dp vertical padding.
|
|
6087
|
+
* vertical: transparent container, 16dp corners, no container padding —
|
|
6088
|
+
* items own their segment surface, gaps reveal the page background.
|
|
6089
|
+
*/
|
|
6090
|
+
menuStyle: {
|
|
6091
|
+
baseline: ["rounded-xs", "bg-surface-container", "py-2"],
|
|
6092
|
+
vertical: ["bg-transparent"]
|
|
6093
|
+
}
|
|
6094
|
+
},
|
|
6095
|
+
defaultVariants: {
|
|
6096
|
+
colorScheme: "standard",
|
|
6097
|
+
menuStyle: "baseline"
|
|
6098
|
+
}
|
|
6099
|
+
}
|
|
6100
|
+
);
|
|
6101
|
+
var menuPopoverVariants = cva([
|
|
6102
|
+
"will-change-[transform,opacity]",
|
|
6103
|
+
"data-[entering]:pointer-events-none data-[exiting]:pointer-events-none",
|
|
6104
|
+
"data-[entering]:animate-md-scale-in",
|
|
6105
|
+
"data-[exiting]:animate-md-scale-out",
|
|
6106
|
+
"origin-top",
|
|
6107
|
+
"data-[placement=top]:origin-bottom",
|
|
6108
|
+
"data-[placement=left]:origin-right",
|
|
6109
|
+
"data-[placement=right]:origin-left",
|
|
6110
|
+
"motion-reduce:data-[entering]:animate-none motion-reduce:data-[exiting]:animate-none"
|
|
6111
|
+
]);
|
|
6112
|
+
var menuItemVariants = cva(
|
|
6113
|
+
[
|
|
6114
|
+
// Layout — height set by density context in MenuItem component
|
|
6115
|
+
// gap is style-specific: baseline = 12dp (gap-3), vertical = 8dp (gap-2)
|
|
6116
|
+
"relative flex w-full items-center",
|
|
6117
|
+
// Typography: Label Large per MD3 menu spec
|
|
6118
|
+
"text-label-large",
|
|
6119
|
+
// Interaction
|
|
6120
|
+
"cursor-pointer select-none outline-none",
|
|
6121
|
+
// Color transition (effects — no overshoot)
|
|
6122
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
6123
|
+
// Disabled — self-targeting data-[x]: selectors (RAC emits data-disabled)
|
|
6124
|
+
"data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed"
|
|
6125
|
+
],
|
|
6126
|
+
{
|
|
6127
|
+
variants: {
|
|
6128
|
+
/**
|
|
6129
|
+
* Color scheme — drives item bg, default text/icon color, and selection colors.
|
|
6130
|
+
*
|
|
6131
|
+
* standard: surface-container-low bg, on-surface text, on-surface-variant icons.
|
|
6132
|
+
* Selected/open: tertiary-container bg highlight, on-tertiary-container content.
|
|
6133
|
+
* vibrant: tertiary-container bg, on-tertiary-container text AND icons.
|
|
6134
|
+
* Selected/open: tertiary bg highlight, on-tertiary content.
|
|
6135
|
+
*/
|
|
6136
|
+
colorScheme: {
|
|
6137
|
+
standard: ["text-on-surface"],
|
|
6138
|
+
vibrant: ["text-on-tertiary-container"]
|
|
6139
|
+
},
|
|
6140
|
+
/**
|
|
6141
|
+
* Visual style — drives padding, gap, segment surface, and corner rounding.
|
|
6142
|
+
*
|
|
6143
|
+
* baseline: 12dp h-padding, 12dp icon-to-label gap, no item background (container provides it).
|
|
6144
|
+
* vertical: 12dp h-padding, 8dp icon-to-label gap, item owns segment surface, segmented rounding
|
|
6145
|
+
* via first/last + adjacent-sibling gap selectors.
|
|
6146
|
+
*/
|
|
6147
|
+
menuStyle: {
|
|
6148
|
+
baseline: ["px-3", "gap-3"],
|
|
6149
|
+
vertical: [
|
|
6150
|
+
"px-3",
|
|
6151
|
+
"gap-2",
|
|
6152
|
+
// Default: inner item (4dp all corners)
|
|
6153
|
+
"rounded-md"
|
|
6154
|
+
// Last item in the whole menu → 16dp bottom corners
|
|
6155
|
+
]
|
|
6156
|
+
}
|
|
6157
|
+
},
|
|
6158
|
+
compoundVariants: [
|
|
6159
|
+
// vertical + standard: selected/open text → on-tertiary-container
|
|
6160
|
+
{
|
|
6161
|
+
menuStyle: "vertical",
|
|
6162
|
+
colorScheme: "standard",
|
|
6163
|
+
class: [
|
|
6164
|
+
"data-[selected]:text-on-tertiary-container",
|
|
6165
|
+
"data-[open]:text-on-tertiary-container"
|
|
6166
|
+
]
|
|
6167
|
+
},
|
|
6168
|
+
// vertical + vibrant: selected/open text → on-tertiary
|
|
6169
|
+
{
|
|
6170
|
+
menuStyle: "vertical",
|
|
6171
|
+
colorScheme: "vibrant",
|
|
6172
|
+
class: ["data-[selected]:text-on-tertiary", "data-[open]:text-on-tertiary"]
|
|
6173
|
+
}
|
|
6174
|
+
],
|
|
6175
|
+
defaultVariants: {
|
|
6176
|
+
colorScheme: "standard",
|
|
6177
|
+
menuStyle: "baseline"
|
|
6178
|
+
}
|
|
6179
|
+
}
|
|
6180
|
+
);
|
|
6181
|
+
var menuItemHighlightVariants = cva(
|
|
6182
|
+
[
|
|
6183
|
+
"absolute inset-0 pointer-events-none",
|
|
6184
|
+
// Inherit the item's own corner radius (inner 4dp or outer 16dp)
|
|
6185
|
+
"rounded-[inherit]",
|
|
6186
|
+
// Effects transition for background-color — no overshoot
|
|
6187
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
6188
|
+
// z-0: below state layer (z-[1]) and content (z-10)
|
|
6189
|
+
"z-0"
|
|
6190
|
+
],
|
|
6191
|
+
{
|
|
6192
|
+
variants: {
|
|
6193
|
+
menuStyle: {
|
|
6194
|
+
baseline: [],
|
|
6195
|
+
vertical: []
|
|
6196
|
+
},
|
|
6197
|
+
colorScheme: {
|
|
6198
|
+
standard: [
|
|
6199
|
+
// baseline selected bg
|
|
6200
|
+
"group-data-[selected]/menuitem:bg-surface-container-highest"
|
|
6201
|
+
],
|
|
6202
|
+
vibrant: [
|
|
6203
|
+
// baseline + vibrant: use surface-container-highest as fallback
|
|
6204
|
+
"group-data-[selected]/menuitem:bg-surface-container-highest"
|
|
6205
|
+
]
|
|
6206
|
+
}
|
|
6207
|
+
},
|
|
6208
|
+
compoundVariants: [
|
|
6209
|
+
// vertical + standard: selected/open highlight → tertiary-container
|
|
6210
|
+
{
|
|
6211
|
+
menuStyle: "vertical",
|
|
6212
|
+
colorScheme: "standard",
|
|
6213
|
+
class: [
|
|
6214
|
+
"group-data-[selected]/menuitem:bg-tertiary-container",
|
|
6215
|
+
"group-data-[open]/menuitem:bg-tertiary-container"
|
|
6216
|
+
]
|
|
6217
|
+
},
|
|
6218
|
+
// vertical + vibrant: selected/open highlight → tertiary
|
|
6219
|
+
{
|
|
6220
|
+
menuStyle: "vertical",
|
|
6221
|
+
colorScheme: "vibrant",
|
|
6222
|
+
class: [
|
|
6223
|
+
"group-data-[selected]/menuitem:bg-tertiary",
|
|
6224
|
+
"group-data-[open]/menuitem:bg-tertiary"
|
|
6225
|
+
]
|
|
6226
|
+
}
|
|
6227
|
+
],
|
|
6228
|
+
defaultVariants: {
|
|
6229
|
+
menuStyle: "baseline",
|
|
6230
|
+
colorScheme: "standard"
|
|
6231
|
+
}
|
|
6232
|
+
}
|
|
6233
|
+
);
|
|
6234
|
+
var menuItemStateLayerVariants = cva(
|
|
6235
|
+
[
|
|
6236
|
+
"absolute inset-0 rounded-[inherit] overflow-hidden pointer-events-none opacity-0",
|
|
6237
|
+
// Effects transition — opacity must NOT overshoot
|
|
6238
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
6239
|
+
// Hover: 8%
|
|
6240
|
+
"group-data-[hovered]/menuitem:opacity-8",
|
|
6241
|
+
// Pressed: 10%, doubled selector wins over hover at same cascade position
|
|
6242
|
+
"group-data-[pressed]/menuitem:group-data-[pressed]/menuitem:opacity-10",
|
|
6243
|
+
// No state layer when disabled
|
|
6244
|
+
"group-data-[disabled]/menuitem:hidden",
|
|
6245
|
+
// z-[1]: above highlight layer (z-0), below content (z-10)
|
|
6246
|
+
"z-[1]"
|
|
6247
|
+
],
|
|
6248
|
+
{
|
|
6249
|
+
variants: {
|
|
6250
|
+
colorScheme: {
|
|
6251
|
+
standard: ["bg-on-surface"],
|
|
6252
|
+
vibrant: ["bg-on-tertiary-container"]
|
|
6253
|
+
},
|
|
6254
|
+
menuStyle: {
|
|
6255
|
+
baseline: [],
|
|
6256
|
+
vertical: []
|
|
6257
|
+
}
|
|
6258
|
+
},
|
|
6259
|
+
compoundVariants: [
|
|
6260
|
+
// vertical + standard: selected/open state layer → on-tertiary-container
|
|
6261
|
+
{
|
|
6262
|
+
menuStyle: "vertical",
|
|
6263
|
+
colorScheme: "standard",
|
|
6264
|
+
class: [
|
|
6265
|
+
"group-data-[selected]/menuitem:bg-on-tertiary-container",
|
|
6266
|
+
"group-data-[open]/menuitem:bg-on-tertiary-container"
|
|
6267
|
+
]
|
|
6268
|
+
},
|
|
6269
|
+
// vertical + vibrant: selected/open state layer → on-tertiary
|
|
6270
|
+
{
|
|
6271
|
+
menuStyle: "vertical",
|
|
6272
|
+
colorScheme: "vibrant",
|
|
6273
|
+
class: [
|
|
6274
|
+
"group-data-[selected]/menuitem:bg-on-tertiary",
|
|
6275
|
+
"group-data-[open]/menuitem:bg-on-tertiary"
|
|
6276
|
+
]
|
|
6277
|
+
}
|
|
6278
|
+
],
|
|
6279
|
+
defaultVariants: {
|
|
6280
|
+
colorScheme: "standard",
|
|
6281
|
+
menuStyle: "baseline"
|
|
6282
|
+
}
|
|
6283
|
+
}
|
|
6284
|
+
);
|
|
6285
|
+
var menuItemFocusRingVariants = cva([
|
|
6286
|
+
"pointer-events-none absolute inset-0 rounded-[inherit]",
|
|
6287
|
+
"outline outline-2 -outline-offset-2 outline-secondary",
|
|
6288
|
+
// Effects transition — opacity must not overshoot
|
|
6289
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
6290
|
+
"opacity-0",
|
|
6291
|
+
"group-data-[focus-visible]/menuitem:opacity-100",
|
|
6292
|
+
// z-[2]: above state layer (z-[1]) and highlight (z-0), below content (z-10)
|
|
6293
|
+
"z-[2]"
|
|
6294
|
+
]);
|
|
6295
|
+
var menuItemIconVariants = cva(
|
|
6296
|
+
[
|
|
6297
|
+
"relative z-10 shrink-0 flex items-center justify-center",
|
|
6298
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
6299
|
+
// Disabled: 38% opacity on icon color
|
|
6300
|
+
"group-data-[disabled]/menuitem:text-on-surface/38"
|
|
6301
|
+
],
|
|
6302
|
+
{
|
|
6303
|
+
variants: {
|
|
6304
|
+
colorScheme: {
|
|
6305
|
+
standard: ["text-on-surface-variant"],
|
|
6306
|
+
vibrant: ["text-on-tertiary-container"]
|
|
6307
|
+
},
|
|
6308
|
+
menuStyle: {
|
|
6309
|
+
baseline: ["h-6 w-6"],
|
|
6310
|
+
vertical: ["h-5 w-5"]
|
|
6311
|
+
}
|
|
6312
|
+
},
|
|
6313
|
+
compoundVariants: [
|
|
6314
|
+
// vertical + standard: selected/open icon → on-tertiary-container
|
|
6315
|
+
{
|
|
6316
|
+
menuStyle: "vertical",
|
|
6317
|
+
colorScheme: "standard",
|
|
6318
|
+
class: [
|
|
6319
|
+
"group-data-[selected]/menuitem:text-on-tertiary-container",
|
|
6320
|
+
"group-data-[open]/menuitem:text-on-tertiary-container"
|
|
6321
|
+
]
|
|
6322
|
+
},
|
|
6323
|
+
// vertical + vibrant: selected/open icon → on-tertiary
|
|
6324
|
+
{
|
|
6325
|
+
menuStyle: "vertical",
|
|
6326
|
+
colorScheme: "vibrant",
|
|
6327
|
+
class: [
|
|
6328
|
+
"group-data-[selected]/menuitem:text-on-tertiary",
|
|
6329
|
+
"group-data-[open]/menuitem:text-on-tertiary"
|
|
6330
|
+
]
|
|
6331
|
+
}
|
|
6332
|
+
],
|
|
6333
|
+
defaultVariants: {
|
|
6334
|
+
colorScheme: "standard",
|
|
6335
|
+
menuStyle: "baseline"
|
|
6336
|
+
}
|
|
6337
|
+
}
|
|
6338
|
+
);
|
|
6339
|
+
var menuSectionVariants = cva(["flex flex-col w-full"]);
|
|
6340
|
+
var menuSectionHeaderVariants = cva(
|
|
6341
|
+
[
|
|
6342
|
+
// 32dp tall region, content vertically centred, 12dp leading padding aligned with items
|
|
6343
|
+
"px-3 h-8 flex items-center",
|
|
6344
|
+
"text-title-small",
|
|
6345
|
+
"select-none"
|
|
6346
|
+
],
|
|
6347
|
+
{
|
|
6348
|
+
variants: {
|
|
6349
|
+
colorScheme: {
|
|
6350
|
+
standard: ["text-on-surface-variant"],
|
|
6351
|
+
vibrant: ["text-on-tertiary-container"]
|
|
6352
|
+
}
|
|
6353
|
+
},
|
|
6354
|
+
defaultVariants: {
|
|
6355
|
+
colorScheme: "standard"
|
|
6356
|
+
}
|
|
6357
|
+
}
|
|
6358
|
+
);
|
|
6359
|
+
var menuDividerVariants = cva(["border-t border-outline-variant", "my-0.5 mx-3"]);
|
|
6360
|
+
cva(["h-0.5 w-full"]);
|
|
6361
|
+
var menuItemTrailingTextVariants = cva(
|
|
6362
|
+
[
|
|
6363
|
+
"ml-auto shrink-0 text-label-large",
|
|
6364
|
+
"select-none",
|
|
6365
|
+
"group-data-[disabled]/menuitem:text-on-surface/38"
|
|
6366
|
+
],
|
|
6367
|
+
{
|
|
6368
|
+
variants: {
|
|
6369
|
+
colorScheme: {
|
|
6370
|
+
standard: ["text-on-surface-variant"],
|
|
6371
|
+
vibrant: ["text-on-tertiary-container"]
|
|
6372
|
+
},
|
|
6373
|
+
menuStyle: {
|
|
6374
|
+
baseline: [],
|
|
6375
|
+
vertical: [
|
|
6376
|
+
"group-data-[selected]/menuitem:text-on-tertiary-container",
|
|
6377
|
+
"group-data-[open]/menuitem:text-on-tertiary-container"
|
|
6378
|
+
]
|
|
6379
|
+
}
|
|
6380
|
+
},
|
|
6381
|
+
compoundVariants: [
|
|
6382
|
+
// vertical + vibrant: selected/open trailing text → on-tertiary
|
|
6383
|
+
{
|
|
6384
|
+
menuStyle: "vertical",
|
|
6385
|
+
colorScheme: "vibrant",
|
|
6386
|
+
class: [
|
|
6387
|
+
"group-data-[selected]/menuitem:text-on-tertiary",
|
|
6388
|
+
"group-data-[open]/menuitem:text-on-tertiary"
|
|
6389
|
+
]
|
|
6390
|
+
}
|
|
6391
|
+
],
|
|
6392
|
+
defaultVariants: {
|
|
6393
|
+
colorScheme: "standard",
|
|
6394
|
+
menuStyle: "baseline"
|
|
6395
|
+
}
|
|
6396
|
+
}
|
|
6397
|
+
);
|
|
6398
|
+
var menuItemDescriptionVariants = cva(
|
|
6399
|
+
["text-body-medium", "select-none", "group-data-[disabled]/menuitem:text-on-surface/38"],
|
|
6400
|
+
{
|
|
6401
|
+
variants: {
|
|
6402
|
+
colorScheme: {
|
|
6403
|
+
standard: ["text-on-surface-variant"],
|
|
6404
|
+
vibrant: ["text-on-tertiary-container"]
|
|
6405
|
+
},
|
|
6406
|
+
menuStyle: {
|
|
6407
|
+
baseline: [],
|
|
6408
|
+
vertical: [
|
|
6409
|
+
"group-data-[selected]/menuitem:text-on-tertiary-container",
|
|
6410
|
+
"group-data-[open]/menuitem:text-on-tertiary-container"
|
|
6411
|
+
]
|
|
6412
|
+
}
|
|
6413
|
+
},
|
|
6414
|
+
compoundVariants: [
|
|
6415
|
+
// vertical + vibrant: selected/open description → on-tertiary
|
|
6416
|
+
{
|
|
6417
|
+
menuStyle: "vertical",
|
|
6418
|
+
colorScheme: "vibrant",
|
|
6419
|
+
class: [
|
|
6420
|
+
"group-data-[selected]/menuitem:text-on-tertiary",
|
|
6421
|
+
"group-data-[open]/menuitem:text-on-tertiary"
|
|
6422
|
+
]
|
|
6423
|
+
}
|
|
6424
|
+
],
|
|
6425
|
+
defaultVariants: {
|
|
6426
|
+
colorScheme: "standard",
|
|
6427
|
+
menuStyle: "baseline"
|
|
5916
6428
|
}
|
|
5917
|
-
},
|
|
5918
|
-
defaultVariants: {
|
|
5919
|
-
aspectRatio: "auto"
|
|
5920
6429
|
}
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
"
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
6430
|
+
);
|
|
6431
|
+
cva(
|
|
6432
|
+
[
|
|
6433
|
+
"flex flex-col w-full",
|
|
6434
|
+
"px-1 py-0.5 gap-0.5",
|
|
6435
|
+
"rounded-lg first:rounded-b-sm last:rounded-t-sm",
|
|
6436
|
+
"shadow-elevation-1"
|
|
6437
|
+
],
|
|
6438
|
+
{
|
|
6439
|
+
variants: {
|
|
6440
|
+
menuStyle: {
|
|
6441
|
+
vertical: ["bg-surface-container-low"],
|
|
6442
|
+
baseline: []
|
|
6443
|
+
},
|
|
6444
|
+
colorScheme: {
|
|
6445
|
+
standard: ["bg-surface-container-low"],
|
|
6446
|
+
vibrant: ["bg-tertiary-container"]
|
|
6447
|
+
}
|
|
6448
|
+
},
|
|
6449
|
+
compoundVariants: [
|
|
6450
|
+
// vertical + standard: item background = surface-container-low
|
|
6451
|
+
{
|
|
6452
|
+
menuStyle: "vertical",
|
|
6453
|
+
colorScheme: "standard",
|
|
6454
|
+
class: ["bg-surface-container-low"]
|
|
6455
|
+
},
|
|
6456
|
+
// vertical + vibrant: item background = tertiary-container
|
|
6457
|
+
{
|
|
6458
|
+
menuStyle: "vertical",
|
|
6459
|
+
colorScheme: "vibrant",
|
|
6460
|
+
class: ["bg-tertiary-container"]
|
|
6461
|
+
}
|
|
6462
|
+
],
|
|
6463
|
+
defaultVariants: {
|
|
6464
|
+
menuStyle: "vertical",
|
|
6465
|
+
colorScheme: "standard"
|
|
5931
6466
|
}
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
CardMedia.displayName = "CardMedia";
|
|
5935
|
-
var CardHeader = forwardRef(function CardHeader2({ headline, subheader, className }, ref) {
|
|
5936
|
-
return /* @__PURE__ */ jsxs("div", { ref, className: cn("p-4", className), children: [
|
|
5937
|
-
/* @__PURE__ */ jsx("h3", { className: "text-on-surface text-title-medium", children: headline }),
|
|
5938
|
-
subheader !== void 0 && /* @__PURE__ */ jsx("p", { className: "text-on-surface-variant text-body-medium mt-1", children: subheader })
|
|
5939
|
-
] });
|
|
5940
|
-
});
|
|
5941
|
-
CardHeader.displayName = "CardHeader";
|
|
5942
|
-
var CardContent = forwardRef(function CardContent2({ children, className }, ref) {
|
|
5943
|
-
return /* @__PURE__ */ jsx("div", { ref, className: cn("p-4", className), children });
|
|
5944
|
-
});
|
|
5945
|
-
CardContent.displayName = "CardContent";
|
|
5946
|
-
var CardActions = forwardRef(function CardActions2({ children, className }, ref) {
|
|
5947
|
-
return /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center justify-end gap-2 p-4 pt-0", className), children });
|
|
5948
|
-
});
|
|
5949
|
-
CardActions.displayName = "CardActions";
|
|
6467
|
+
}
|
|
6468
|
+
);
|
|
5950
6469
|
var MenuContext = createContext(null);
|
|
5951
6470
|
function useMenuContext() {
|
|
5952
6471
|
return useContext(MenuContext);
|
|
@@ -5984,7 +6503,16 @@ function HeadlessMenuTrigger({
|
|
|
5984
6503
|
const [triggerChild, menuChild] = childrenArray;
|
|
5985
6504
|
return /* @__PURE__ */ jsxs(MenuTrigger$1, { ...rest, children: [
|
|
5986
6505
|
/* @__PURE__ */ jsx(TriggerBridge, { children: triggerChild }),
|
|
5987
|
-
/* @__PURE__ */ jsx(
|
|
6506
|
+
/* @__PURE__ */ jsx(
|
|
6507
|
+
Popover,
|
|
6508
|
+
{
|
|
6509
|
+
placement,
|
|
6510
|
+
shouldFlip,
|
|
6511
|
+
offset: 4,
|
|
6512
|
+
className: menuPopoverVariants(),
|
|
6513
|
+
children: menuChild
|
|
6514
|
+
}
|
|
6515
|
+
)
|
|
5988
6516
|
] });
|
|
5989
6517
|
}
|
|
5990
6518
|
function HeadlessMenu({
|
|
@@ -6036,192 +6564,6 @@ function HeadlessMenuDivider({
|
|
|
6036
6564
|
}) {
|
|
6037
6565
|
return /* @__PURE__ */ jsx(Separator, { ...props, className: className ?? "" });
|
|
6038
6566
|
}
|
|
6039
|
-
var menuContainerVariants = cva(
|
|
6040
|
-
[
|
|
6041
|
-
// Elevation
|
|
6042
|
-
"shadow-elevation-2",
|
|
6043
|
-
// Width constraints per MD3 spec (112dp min / 280dp max)
|
|
6044
|
-
"min-w-28 max-w-70",
|
|
6045
|
-
// Layout
|
|
6046
|
-
"py-2",
|
|
6047
|
-
// Scroll: show scrollbar when content overflows; max height avoids clipping
|
|
6048
|
-
"overflow-y-auto",
|
|
6049
|
-
"max-h-[calc(var(--visual-viewport-height,100vh)-2rem)]",
|
|
6050
|
-
// Stacking
|
|
6051
|
-
"z-50",
|
|
6052
|
-
// Focus outline handled by React Aria
|
|
6053
|
-
"outline-none",
|
|
6054
|
-
// GPU compositing — promotes menu to its own compositor layer so
|
|
6055
|
-
// scale + opacity animations run without triggering layout reflow.
|
|
6056
|
-
"will-change-[transform,opacity]",
|
|
6057
|
-
// Pointer events blocked during animation to prevent accidental clicks
|
|
6058
|
-
// on menu items while the panel is still animating in or out.
|
|
6059
|
-
"data-[entering]:pointer-events-none data-[exiting]:pointer-events-none",
|
|
6060
|
-
// ── Enter animation ────────────────────────────────────────────────────
|
|
6061
|
-
// @keyframes menu-enter (defined in styles.css): scale(0.8)+opacity:0 →
|
|
6062
|
-
// scale(1)+opacity:1 in 120ms with cubic-bezier(0,0,0.2,1) (standard
|
|
6063
|
-
// decelerate — matches Angular Material's _mat-menu-enter keyframe).
|
|
6064
|
-
"data-[entering]:animate-[menu-enter_120ms_cubic-bezier(0,0,0.2,1)_both]",
|
|
6065
|
-
// ── Exit animation ─────────────────────────────────────────────────────
|
|
6066
|
-
// @keyframes menu-exit (defined in styles.css): opacity:1 → opacity:0
|
|
6067
|
-
// in 100ms after 25ms delay, linear — matches Angular Material's
|
|
6068
|
-
// _mat-menu-exit keyframe (fade-only, no reverse scale).
|
|
6069
|
-
"data-[exiting]:animate-[menu-exit_100ms_25ms_linear_both]",
|
|
6070
|
-
// ── Transform origin (placement-aware) ────────────────────────────────
|
|
6071
|
-
// RAC sets data-placement="bottom|top|left|right" on the Popover element.
|
|
6072
|
-
// Default (bottom): origin at top edge (menu expands downward).
|
|
6073
|
-
"origin-top",
|
|
6074
|
-
// top: origin at bottom edge (menu expands upward)
|
|
6075
|
-
"data-[placement=top]:origin-bottom",
|
|
6076
|
-
// left: origin at right edge
|
|
6077
|
-
"data-[placement=left]:origin-right",
|
|
6078
|
-
// right: origin at left edge
|
|
6079
|
-
"data-[placement=right]:origin-left",
|
|
6080
|
-
// ── Reduced motion ────────────────────────────────────────────────────
|
|
6081
|
-
// Skip both animations entirely for users who prefer reduced motion.
|
|
6082
|
-
"motion-reduce:data-[entering]:animate-none motion-reduce:data-[exiting]:animate-none"
|
|
6083
|
-
],
|
|
6084
|
-
{
|
|
6085
|
-
variants: {
|
|
6086
|
-
/**
|
|
6087
|
-
* Color scheme — drives the container background.
|
|
6088
|
-
* baseline+standard uses a separate compound variant.
|
|
6089
|
-
*/
|
|
6090
|
-
colorScheme: {
|
|
6091
|
-
standard: [],
|
|
6092
|
-
vibrant: []
|
|
6093
|
-
},
|
|
6094
|
-
/**
|
|
6095
|
-
* Visual style — drives corner radius and baseline vs vertical background.
|
|
6096
|
-
*/
|
|
6097
|
-
menuStyle: {
|
|
6098
|
-
baseline: ["rounded-xs", "bg-surface-container"],
|
|
6099
|
-
vertical: ["rounded-lg", "bg-surface-container-low"]
|
|
6100
|
-
}
|
|
6101
|
-
},
|
|
6102
|
-
compoundVariants: [
|
|
6103
|
-
// Vertical + vibrant: tertiary container background
|
|
6104
|
-
{
|
|
6105
|
-
menuStyle: "vertical",
|
|
6106
|
-
colorScheme: "vibrant",
|
|
6107
|
-
class: ["bg-tertiary-container"]
|
|
6108
|
-
}
|
|
6109
|
-
],
|
|
6110
|
-
defaultVariants: {
|
|
6111
|
-
colorScheme: "standard",
|
|
6112
|
-
menuStyle: "baseline"
|
|
6113
|
-
}
|
|
6114
|
-
}
|
|
6115
|
-
);
|
|
6116
|
-
var menuItemVariants = cva(
|
|
6117
|
-
[
|
|
6118
|
-
// Layout — height set by density context in MenuItem component
|
|
6119
|
-
"relative flex w-full items-center",
|
|
6120
|
-
"px-3 gap-3",
|
|
6121
|
-
// Typography: Body Large per MD3 baseline spec
|
|
6122
|
-
"text-body-large",
|
|
6123
|
-
// Interaction
|
|
6124
|
-
"cursor-pointer select-none outline-none",
|
|
6125
|
-
// State layer pseudo-element
|
|
6126
|
-
"before:absolute before:inset-0 before:rounded-[inherit]",
|
|
6127
|
-
"before:transition-opacity before:duration-short2 before:ease-standard",
|
|
6128
|
-
"before:opacity-0",
|
|
6129
|
-
// Hover state layer
|
|
6130
|
-
"hover:before:opacity-8",
|
|
6131
|
-
// Focus visible state layer
|
|
6132
|
-
"focus-visible:before:opacity-12",
|
|
6133
|
-
// Active pressed state layer
|
|
6134
|
-
"active:before:opacity-12",
|
|
6135
|
-
// Color transition for selection
|
|
6136
|
-
"transition-colors duration-short2 ease-standard"
|
|
6137
|
-
],
|
|
6138
|
-
{
|
|
6139
|
-
variants: {
|
|
6140
|
-
/**
|
|
6141
|
-
* Disabled state: reduces opacity and blocks interaction.
|
|
6142
|
-
*/
|
|
6143
|
-
isDisabled: {
|
|
6144
|
-
true: ["opacity-38 cursor-not-allowed pointer-events-none"],
|
|
6145
|
-
false: []
|
|
6146
|
-
},
|
|
6147
|
-
/**
|
|
6148
|
-
* Selected state: background and text color driven by compound variants.
|
|
6149
|
-
*/
|
|
6150
|
-
isSelected: {
|
|
6151
|
-
true: [],
|
|
6152
|
-
false: []
|
|
6153
|
-
},
|
|
6154
|
-
/**
|
|
6155
|
-
* Color scheme: drives default text and state layer colors.
|
|
6156
|
-
* - standard: on-surface text, on-surface state layer
|
|
6157
|
-
* - vibrant (vertical only): on-tertiary-container text + state layer
|
|
6158
|
-
*/
|
|
6159
|
-
colorScheme: {
|
|
6160
|
-
standard: ["text-on-surface", "before:bg-on-surface"],
|
|
6161
|
-
vibrant: ["text-on-tertiary-container", "before:bg-on-tertiary-container"]
|
|
6162
|
-
},
|
|
6163
|
-
/**
|
|
6164
|
-
* Visual style: drives corner radius on items (vertical uses rounded-lg
|
|
6165
|
-
* inherited from container, items stay flat inside).
|
|
6166
|
-
*/
|
|
6167
|
-
menuStyle: {
|
|
6168
|
-
baseline: [],
|
|
6169
|
-
vertical: []
|
|
6170
|
-
}
|
|
6171
|
-
},
|
|
6172
|
-
compoundVariants: [
|
|
6173
|
-
// ── Baseline selection (both colorSchemes) ──────────────────────────
|
|
6174
|
-
{
|
|
6175
|
-
isSelected: true,
|
|
6176
|
-
menuStyle: "baseline",
|
|
6177
|
-
class: [
|
|
6178
|
-
"bg-surface-container-highest"
|
|
6179
|
-
// text-on-surface already applied by standard colorScheme variant
|
|
6180
|
-
]
|
|
6181
|
-
},
|
|
6182
|
-
// ── Vertical + Standard selection ───────────────────────────────────
|
|
6183
|
-
{
|
|
6184
|
-
isSelected: true,
|
|
6185
|
-
menuStyle: "vertical",
|
|
6186
|
-
colorScheme: "standard",
|
|
6187
|
-
class: [
|
|
6188
|
-
"bg-tertiary-container",
|
|
6189
|
-
"text-on-tertiary-container",
|
|
6190
|
-
"before:bg-on-tertiary-container"
|
|
6191
|
-
]
|
|
6192
|
-
},
|
|
6193
|
-
// ── Vertical + Vibrant selection ─────────────────────────────────────
|
|
6194
|
-
{
|
|
6195
|
-
isSelected: true,
|
|
6196
|
-
menuStyle: "vertical",
|
|
6197
|
-
colorScheme: "vibrant",
|
|
6198
|
-
class: ["bg-tertiary", "text-on-tertiary", "before:bg-on-tertiary"]
|
|
6199
|
-
}
|
|
6200
|
-
],
|
|
6201
|
-
defaultVariants: {
|
|
6202
|
-
isDisabled: false,
|
|
6203
|
-
isSelected: false,
|
|
6204
|
-
colorScheme: "standard",
|
|
6205
|
-
menuStyle: "baseline"
|
|
6206
|
-
}
|
|
6207
|
-
}
|
|
6208
|
-
);
|
|
6209
|
-
var menuSectionVariants = cva(["flex flex-col w-full"]);
|
|
6210
|
-
var menuSectionHeaderVariants = cva([
|
|
6211
|
-
"px-3 pt-2 pb-1",
|
|
6212
|
-
"text-title-small text-on-surface-variant",
|
|
6213
|
-
"select-none"
|
|
6214
|
-
]);
|
|
6215
|
-
var menuDividerVariants = cva(["border-t border-outline-variant", "my-2 mx-0"]);
|
|
6216
|
-
cva(["h-2 w-full"]);
|
|
6217
|
-
var menuItemTrailingTextVariants = cva([
|
|
6218
|
-
"ml-auto shrink-0 text-label-large text-on-surface-variant",
|
|
6219
|
-
"select-none"
|
|
6220
|
-
]);
|
|
6221
|
-
var menuItemDescriptionVariants = cva([
|
|
6222
|
-
"text-body-medium text-on-surface-variant",
|
|
6223
|
-
"select-none"
|
|
6224
|
-
]);
|
|
6225
6567
|
var Menu = forwardRef(function Menu2({
|
|
6226
6568
|
children,
|
|
6227
6569
|
className,
|
|
@@ -6281,7 +6623,13 @@ function CheckIcon() {
|
|
|
6281
6623
|
}
|
|
6282
6624
|
);
|
|
6283
6625
|
}
|
|
6284
|
-
var
|
|
6626
|
+
var BASELINE_DENSITY_HEIGHT = {
|
|
6627
|
+
0: "h-12",
|
|
6628
|
+
[-1]: "h-11",
|
|
6629
|
+
[-2]: "h-10",
|
|
6630
|
+
[-3]: "h-9"
|
|
6631
|
+
};
|
|
6632
|
+
var VERTICAL_DENSITY_HEIGHT = {
|
|
6285
6633
|
0: "h-12",
|
|
6286
6634
|
[-1]: "h-11",
|
|
6287
6635
|
[-2]: "h-10",
|
|
@@ -6304,19 +6652,18 @@ var MenuItem = forwardRef(function MenuItem2({
|
|
|
6304
6652
|
const menuStyle = ctx?.menuStyle ?? "baseline";
|
|
6305
6653
|
const density = ctx?.density ?? 0;
|
|
6306
6654
|
const selectionMode = ctx?.selectionMode;
|
|
6307
|
-
const heightClass =
|
|
6655
|
+
const heightClass = menuStyle === "vertical" ? VERTICAL_DENSITY_HEIGHT[density] : BASELINE_DENSITY_HEIGHT[density];
|
|
6308
6656
|
const isSelectionMenu = selectionMode != null;
|
|
6309
6657
|
const { ripples, onMouseDown } = useRipple({ disabled: disableRipple });
|
|
6310
|
-
const computeClassName = ({
|
|
6311
|
-
menuItemVariants({
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
colorScheme,
|
|
6315
|
-
menuStyle
|
|
6316
|
-
}),
|
|
6658
|
+
const computeClassName = ({ isSelected }) => cn(
|
|
6659
|
+
menuItemVariants({ colorScheme, menuStyle }),
|
|
6660
|
+
// group/menuitem scope: all slot children read state via group-data-[x]/menuitem
|
|
6661
|
+
"group/menuitem",
|
|
6317
6662
|
// Height: auto when description is present (multi-line), otherwise density
|
|
6318
6663
|
description ? "min-h-12 py-2 h-auto items-start" : heightClass,
|
|
6319
|
-
className
|
|
6664
|
+
className,
|
|
6665
|
+
// Silence the isSelected lint — value consumed in render-prop below
|
|
6666
|
+
isSelected ? "" : ""
|
|
6320
6667
|
);
|
|
6321
6668
|
return /* @__PURE__ */ jsx(
|
|
6322
6669
|
HeadlessMenuItem,
|
|
@@ -6326,24 +6673,48 @@ var MenuItem = forwardRef(function MenuItem2({
|
|
|
6326
6673
|
className: computeClassName,
|
|
6327
6674
|
onMouseDown,
|
|
6328
6675
|
children: ({ isSelected }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6329
|
-
|
|
6330
|
-
|
|
6676
|
+
/* @__PURE__ */ jsx(
|
|
6677
|
+
"span",
|
|
6678
|
+
{
|
|
6679
|
+
"aria-hidden": "true",
|
|
6680
|
+
"data-testid": "menuitem-highlight",
|
|
6681
|
+
className: menuItemHighlightVariants({ colorScheme, menuStyle })
|
|
6682
|
+
}
|
|
6683
|
+
),
|
|
6684
|
+
/* @__PURE__ */ jsx(
|
|
6685
|
+
"span",
|
|
6686
|
+
{
|
|
6687
|
+
"aria-hidden": "true",
|
|
6688
|
+
className: menuItemStateLayerVariants({ colorScheme, menuStyle })
|
|
6689
|
+
}
|
|
6690
|
+
),
|
|
6691
|
+
/* @__PURE__ */ jsx(
|
|
6331
6692
|
"span",
|
|
6332
6693
|
{
|
|
6333
|
-
className: "text-on-surface-variant relative z-10 flex h-6 w-6 shrink-0 items-center justify-center",
|
|
6334
6694
|
"aria-hidden": "true",
|
|
6335
|
-
|
|
6695
|
+
"data-testid": "menuitem-focus-ring",
|
|
6696
|
+
className: menuItemFocusRingVariants()
|
|
6697
|
+
}
|
|
6698
|
+
),
|
|
6699
|
+
!disableRipple && /* @__PURE__ */ jsx(
|
|
6700
|
+
"span",
|
|
6701
|
+
{
|
|
6702
|
+
className: cn(
|
|
6703
|
+
"pointer-events-none absolute inset-0 z-[3] overflow-hidden rounded-[inherit]"
|
|
6704
|
+
),
|
|
6705
|
+
children: ripples
|
|
6336
6706
|
}
|
|
6337
6707
|
),
|
|
6708
|
+
(leadingIcon != null || isSelectionMenu) && /* @__PURE__ */ jsx("span", { className: menuItemIconVariants({ colorScheme, menuStyle }), "aria-hidden": "true", children: isSelectionMenu && leadingIcon == null ? isSelected ? /* @__PURE__ */ jsx(CheckIcon, {}) : null : leadingIcon }),
|
|
6338
6709
|
description != null ? /* @__PURE__ */ jsxs("span", { className: "relative z-10 flex min-w-0 flex-1 flex-col", children: [
|
|
6339
|
-
/* @__PURE__ */ jsx("span", { className: "text-
|
|
6340
|
-
/* @__PURE__ */ jsx("span", { className: menuItemDescriptionVariants(), children: description })
|
|
6341
|
-
] }) : /* @__PURE__ */ jsx("span", { className: "text-
|
|
6710
|
+
/* @__PURE__ */ jsx("span", { className: "text-label-large group-data-[disabled]/menuitem:text-on-surface/38", children }),
|
|
6711
|
+
/* @__PURE__ */ jsx("span", { className: menuItemDescriptionVariants({ colorScheme, menuStyle }), children: description })
|
|
6712
|
+
] }) : /* @__PURE__ */ jsx("span", { className: "text-label-large group-data-[disabled]/menuitem:text-on-surface/38 relative z-10 min-w-0 flex-1", children }),
|
|
6342
6713
|
badge != null && /* @__PURE__ */ jsx("span", { className: "relative z-10 shrink-0", children: badge }),
|
|
6343
6714
|
trailingIcon != null && trailingText == null && /* @__PURE__ */ jsx(
|
|
6344
6715
|
"span",
|
|
6345
6716
|
{
|
|
6346
|
-
className:
|
|
6717
|
+
className: cn(menuItemIconVariants({ colorScheme, menuStyle }), "ml-auto"),
|
|
6347
6718
|
"aria-hidden": "true",
|
|
6348
6719
|
children: trailingIcon
|
|
6349
6720
|
}
|
|
@@ -6351,7 +6722,10 @@ var MenuItem = forwardRef(function MenuItem2({
|
|
|
6351
6722
|
trailingText != null && trailingIcon == null && /* @__PURE__ */ jsx(
|
|
6352
6723
|
"span",
|
|
6353
6724
|
{
|
|
6354
|
-
className: cn(
|
|
6725
|
+
className: cn(
|
|
6726
|
+
menuItemTrailingTextVariants({ colorScheme, menuStyle }),
|
|
6727
|
+
"relative z-10"
|
|
6728
|
+
),
|
|
6355
6729
|
"aria-keyshortcuts": trailingText,
|
|
6356
6730
|
children: trailingText
|
|
6357
6731
|
}
|
|
@@ -6367,6 +6741,8 @@ function MenuSection({
|
|
|
6367
6741
|
className,
|
|
6368
6742
|
"aria-label": ariaLabel
|
|
6369
6743
|
}) {
|
|
6744
|
+
const ctx = useMenuContext();
|
|
6745
|
+
const colorScheme = ctx?.colorScheme ?? "standard";
|
|
6370
6746
|
const sectionAriaLabel = ariaLabel ?? header;
|
|
6371
6747
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6372
6748
|
showDivider && /* @__PURE__ */ jsx(HeadlessMenuDivider, { className: menuDividerVariants() }),
|
|
@@ -6376,7 +6752,7 @@ function MenuSection({
|
|
|
6376
6752
|
"aria-label": sectionAriaLabel,
|
|
6377
6753
|
className: cn(menuSectionVariants(), className),
|
|
6378
6754
|
children: [
|
|
6379
|
-
header && /* @__PURE__ */ jsx(Header, { className: menuSectionHeaderVariants(), "aria-hidden": "true", children: header }),
|
|
6755
|
+
header && /* @__PURE__ */ jsx(Header, { className: menuSectionHeaderVariants({ colorScheme }), "aria-hidden": "true", children: header }),
|
|
6380
6756
|
children
|
|
6381
6757
|
]
|
|
6382
6758
|
}
|
|
@@ -9732,6 +10108,39 @@ var BadgeHeadless = forwardRef(
|
|
|
9732
10108
|
}
|
|
9733
10109
|
);
|
|
9734
10110
|
BadgeHeadless.displayName = "BadgeHeadless";
|
|
10111
|
+
var badgeAppearance = [
|
|
10112
|
+
// ── Shape ─────────────────────────────────────────────────────────────────────
|
|
10113
|
+
"flex items-center justify-center",
|
|
10114
|
+
"rounded-full",
|
|
10115
|
+
// ── Large (count) sizing — base defaults ──────────────────────────────────────
|
|
10116
|
+
// Height 16dp, min-width 16dp, horizontal padding 4dp
|
|
10117
|
+
"h-4 min-w-4 px-1",
|
|
10118
|
+
// ── Color — error role (only MD3-spec role for badges) ────────────────────────
|
|
10119
|
+
"bg-error text-on-error",
|
|
10120
|
+
// ── Typography — label-small, tight leading, tabular numbers ──────────────────
|
|
10121
|
+
"text-label-small leading-none tabular-nums",
|
|
10122
|
+
// ── Visibility (runtime flag) ──────────────────────────────────────────────────
|
|
10123
|
+
// Base: fully visible
|
|
10124
|
+
"scale-100",
|
|
10125
|
+
// data-invisible: scale to zero (visually hidden; aria-label still readable by SR)
|
|
10126
|
+
"data-[invisible]:scale-0",
|
|
10127
|
+
// ── Dot content flag overrides (placed last — cascade wins over base sizing) ───
|
|
10128
|
+
// Clear out the count-pill sizing, set 6dp circle
|
|
10129
|
+
"data-[dot]:size-1.5",
|
|
10130
|
+
"data-[dot]:min-w-0",
|
|
10131
|
+
"data-[dot]:p-0",
|
|
10132
|
+
"data-[dot]:text-[0]"
|
|
10133
|
+
// suppress any stray text rendering on dot
|
|
10134
|
+
];
|
|
10135
|
+
var badgeVariants2 = cva([
|
|
10136
|
+
// ── Anchored placement — badge center on host's top-right corner ──────────────
|
|
10137
|
+
// top-0 right-0 places the badge's own top-right at the host's top-right,
|
|
10138
|
+
// then the 1/2-element translate moves the badge center onto that corner.
|
|
10139
|
+
// Host-size-agnostic: works for any wrapped element (icon, avatar, nav chip).
|
|
10140
|
+
"absolute top-0 right-0 -translate-y-1/2 translate-x-1/2",
|
|
10141
|
+
...badgeAppearance
|
|
10142
|
+
]);
|
|
10143
|
+
cva(["inline-flex", ...badgeAppearance]);
|
|
9735
10144
|
var getDisplayValue = (count, max) => {
|
|
9736
10145
|
if (count === void 0) return "";
|
|
9737
10146
|
return count > max ? `${max}+` : count.toString();
|
|
@@ -15279,7 +15688,7 @@ var modeToggleStateLayerVariants = cva([
|
|
|
15279
15688
|
"group-data-[focus-visible]/mode-toggle:opacity-10",
|
|
15280
15689
|
"group-data-[pressed]/mode-toggle:opacity-10"
|
|
15281
15690
|
]);
|
|
15282
|
-
var
|
|
15691
|
+
var scrimVariants = cva([
|
|
15283
15692
|
"fixed inset-0 z-40",
|
|
15284
15693
|
"bg-scrim opacity-32",
|
|
15285
15694
|
"transition-opacity duration-medium2 ease-standard"
|
|
@@ -16022,7 +16431,7 @@ var DatePickerModalStyled = forwardRef(
|
|
|
16022
16431
|
!reducedMotion && MODAL_DIALOG_MOTION,
|
|
16023
16432
|
className
|
|
16024
16433
|
),
|
|
16025
|
-
scrimClassName: cn(
|
|
16434
|
+
scrimClassName: cn(scrimVariants()),
|
|
16026
16435
|
slots: {
|
|
16027
16436
|
CellComponent: StyledCalendarCell,
|
|
16028
16437
|
NavButtonComponent: StyledNavButton,
|
|
@@ -16472,7 +16881,7 @@ var DatePickerModalInputStyled = forwardRef(
|
|
|
16472
16881
|
MODAL_INPUT_CONTENT_STRUCTURAL,
|
|
16473
16882
|
className
|
|
16474
16883
|
),
|
|
16475
|
-
scrimClassName: cn(
|
|
16884
|
+
scrimClassName: cn(scrimVariants()),
|
|
16476
16885
|
ActionButtonComponent: StyledActionButton
|
|
16477
16886
|
}
|
|
16478
16887
|
);
|
|
@@ -16584,6 +16993,6 @@ var DateField = forwardRef((props, forwardedRef) => {
|
|
|
16584
16993
|
});
|
|
16585
16994
|
DateField.displayName = "DateField";
|
|
16586
16995
|
|
|
16587
|
-
export { AppBar, AppBarHeadless, Badge, BadgeContent, BadgeHeadless, BottomSheet, BottomSheetContext, BottomSheetHandle, BottomSheetHeadless, Button, ButtonGroup, ButtonGroupContext, ButtonGroupHeadless, CalendarCore, Card, CardActions, CardContent, CardHeader, CardHeadless, CardMedia, Checkbox, Chip, ChipHeadless, ChipSet, DateField, DatePicker, DatePickerDocked, DatePickerModal, DatePickerModalInput, Dialog, DialogActions, DialogContent, DialogContext, DialogHeadless, DialogHeadline, Divider, DividerHeadless, Drawer,
|
|
16996
|
+
export { AppBar, AppBarHeadless, Badge, BadgeContent, BadgeHeadless, BottomSheet, BottomSheetContext, BottomSheetHandle, BottomSheetHeadless, Button, ButtonGroup, ButtonGroupContext, ButtonGroupHeadless, CalendarCore, Card, CardActions, CardContent, CardHeader, CardHeadless, CardMedia, Checkbox, Chip, ChipHeadless, ChipSet, DateField, DatePicker, DatePickerDocked, DatePickerModal, DatePickerModalInput, Dialog, DialogActions, DialogContent, DialogContext, DialogHeadless, DialogHeadline, Divider, DividerHeadless, Drawer, DrawerContext, DrawerHeadline, DrawerItem, DrawerSection, FAB, FABHeadless, FABMenu, FABMenuContext, FABMenuHeadless, FABMenuItem, HeadlessDrawer, HeadlessDrawerItem, HeadlessMenu, HeadlessMenuDivider, HeadlessMenuItem, HeadlessMenuSection, HeadlessMenuTrigger, HeadlessNavigationBar, HeadlessNavigationBarItem, HeadlessTab, HeadlessTabList, HeadlessTabPanel, IconButton, IconButtonHeadless, List, ListHeadless, ListItem, ListItemHeadless, ListItemLeading, ListItemText, ListItemTrailing, Menu, MenuContext, MenuDivider, MenuItem, MenuSection, MenuTrigger, NavigationBar, NavigationBarItem, Progress, ProgressHeadless, Radio, RadioGroup, RadioGroupHeadless, RadioHeadless, RichTooltip, STATE_LAYER_OPACITY, Search, SearchBar, SearchBarHeadless, SearchView, SearchViewHeadless, Slider, SliderHeadless, Snackbar, SnackbarContext, SnackbarHeadless, SnackbarProvider, SplitButton, SplitButtonHeadless, StyledActionButton, StyledCalendarCell, StyledCalendarTitle, StyledNavButton, StyledWeekday, StyledYearItem, Switch, TYPOGRAPHY_ELEMENT_MAP, TYPOGRAPHY_USAGE, Tab, TabList, TabPanel, Tabs, TextField, TimePicker, TimePickerDial, TimePickerInput, Tooltip, TooltipOverlayHeadless, TooltipTrigger, TooltipTriggerHeadless, actionButtonFocusRingVariants, actionButtonStateLayerVariants, actionButtonVariants, actionRowVariants, applyStateLayer, badgeVariants2 as badgeVariants, bottomSheetAnimationVariants, bottomSheetHandlePillVariants, bottomSheetHandleWrapperVariants, bottomSheetScrimVariants, bottomSheetVariants, buttonGroupFocusRingVariants, buttonGroupRootVariants, buttonGroupVariants, calendarCellFocusRingVariants, calendarCellStateLayerVariants, calendarCellVariants, calendarDividerVariants, calendarHeaderVariants, calendarTitleIconVariants, calendarTitleStateLayerVariants, calendarTitleTextVariants, calendarTitleVariants, cardVariants, chipVariants, clockDialContainerVariants, clockDialNumberVariants, clockHandCenterVariants, clockHandHandleVariants, clockHandTrackVariants, cn, dateFieldVariants, dateInputErrorVariants, dateInputFieldGroupVariants, dateInputFieldVariants, dateInputLabelVariants, datePickerContainerVariants, dateSegmentPlaceholderVariants, dividerVariants, dockedFieldGroupVariants, dockedLabelVariants, dockedTriggerStateLayerVariants, dockedTriggerVariants, drawerAnimationVariants, drawerHeadlineVariants, drawerItemActiveIndicatorVariants, drawerItemBadgeVariants, drawerItemFocusRingVariants, drawerItemIconVariants, drawerItemLabelVariants, drawerItemStateLayerVariants, drawerItemVariants, drawerScrimAnimationVariants, drawerScrimVariants, drawerSectionHeaderVariants, drawerSectionVariants, drawerVariants, fabMenuItemFocusRingVariants, fabMenuItemIconVariants, fabMenuItemLabelVariants, fabMenuItemStateLayerVariants, fabMenuItemVariants, fabMenuListVariants, fabMenuVariants, generateMD3Theme, getColorValue, getConnectedRadiusClasses, getFontFamily, getMD3Color, getResponsiveTypography, getTypographyClassName, getTypographyForElement, getTypographyStyle, getTypographyToken, headlineVariants, hexToRgb, listItemVariants, listVariants, modalDialogVariants, modalHeaderVariants, modeToggleStateLayerVariants, modeToggleVariants, navButtonFocusRingVariants, navButtonStateLayerVariants, navButtonVariants, periodSelectorContainerVariants, periodSelectorItemVariants, popoverVariants, pxToRem, remToPx, rgbToHex, richTooltipVariants, scrimVariants, searchBarAvatarVariants, searchBarFocusRingVariants, searchBarInputVariants, searchBarLeadingIconVariants, searchBarRootVariants, searchBarStateLayerVariants, searchBarTrailingActionVariants, searchBarTrailingActionsVariants, searchViewBackButtonVariants, searchViewClearButtonVariants, searchViewContentVariants, searchViewDividerVariants, searchViewHeaderVariants, searchViewInputVariants, searchViewTrailingActionVariants, searchViewTrailingActionsVariants, searchViewVariants, sliderActiveTrackVariants, sliderContainerVariants, sliderHandleStateLayerVariants, sliderHandleVariants, sliderInactiveTrackVariants, sliderTrackLayoutVariants, splitButtonContainerVariants, splitButtonFocusRingVariants, splitButtonIconVariants, splitButtonLabelVariants, splitButtonLeadingVariants, splitButtonMenuItemVariants, splitButtonMenuVariants, splitButtonStateLayerVariants, splitButtonTrailingVariants, splitButtonVariants, supportingTextVariants, timeInputFieldVariants, timePickerActionButtonVariants, timePickerActionRowVariants, timePickerContainerVariants, timePickerHeadlineVariants, timePickerModeToggleVariants, timeSelectorContainerVariants, timeSeparatorVariants, tooltipVariants, truncateText, useBottomSheetContext, useBottomSheetDrag, useButtonGroup, useDialogContext, useFABMenuContext, useMenuContext, useOptionalButtonGroup, useSnackbar, weekdayVariants, withOpacity, yearGridVariants, yearItemFocusRingVariants, yearItemStateLayerVariants, yearItemVariants };
|
|
16588
16997
|
//# sourceMappingURL=index.js.map
|
|
16589
16998
|
//# sourceMappingURL=index.js.map
|