@bug-on/m3-expressive 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/buttons.d.mts +26 -5
- package/dist/buttons.d.ts +26 -5
- package/dist/buttons.js +581 -345
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +573 -345
- package/dist/buttons.mjs.map +1 -1
- package/dist/core.js +52 -13
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +52 -13
- package/dist/core.mjs.map +1 -1
- package/dist/feedback.js +52 -13
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs +52 -13
- package/dist/feedback.mjs.map +1 -1
- package/dist/forms.js +4 -1
- package/dist/forms.js.map +1 -1
- package/dist/forms.mjs +4 -1
- package/dist/forms.mjs.map +1 -1
- package/dist/{icon-button-sSt6PPLg.d.mts → icon-button-CSsDmuQC.d.mts} +13 -0
- package/dist/{icon-button-sSt6PPLg.d.ts → icon-button-CSsDmuQC.d.ts} +13 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1483 -1027
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1342 -887
- package/dist/index.mjs.map +1 -1
- package/dist/layout.js +15 -7
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +15 -7
- package/dist/layout.mjs.map +1 -1
- package/dist/navigation.d.mts +7 -1
- package/dist/navigation.d.ts +7 -1
- package/dist/navigation.js +281 -38
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +281 -38
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.js +52 -13
- package/dist/overlays.js.map +1 -1
- package/dist/overlays.mjs +52 -13
- package/dist/overlays.mjs.map +1 -1
- package/dist/pickers.js +177 -111
- package/dist/pickers.js.map +1 -1
- package/dist/pickers.mjs +177 -111
- package/dist/pickers.mjs.map +1 -1
- package/dist/{split-button-trailing-uncheckable-BcPD_7uK.d.ts → split-button-trailing-uncheckable-C-qQlyZx.d.ts} +74 -19
- package/dist/{split-button-trailing-uncheckable-DtFJkTFr.d.mts → split-button-trailing-uncheckable-DHJqNeq_.d.mts} +74 -19
- package/package.json +3 -3
package/dist/navigation.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
5
5
|
import * as RxContextMenu from '@radix-ui/react-context-menu';
|
|
6
6
|
import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
|
|
7
7
|
import { Transition, Variants, HTMLMotionProps } from 'motion/react';
|
|
8
|
-
import { B as BaseIconButtonProps } from './icon-button-
|
|
8
|
+
import { B as BaseIconButtonProps } from './icon-button-CSsDmuQC.mjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @file app-bar.tokens.ts
|
|
@@ -1631,6 +1631,8 @@ interface NavigationBarItemProps {
|
|
|
1631
1631
|
badge?: React$1.ReactNode;
|
|
1632
1632
|
"aria-label"?: string;
|
|
1633
1633
|
className?: string;
|
|
1634
|
+
asChild?: boolean;
|
|
1635
|
+
children?: React$1.ReactNode;
|
|
1634
1636
|
}
|
|
1635
1637
|
interface NavigationBarProps {
|
|
1636
1638
|
/** Visual variant of the Navigation Bar */
|
|
@@ -1671,6 +1673,8 @@ interface NavigationRailItemProps {
|
|
|
1671
1673
|
badge?: React$1.ReactNode;
|
|
1672
1674
|
"aria-label"?: string;
|
|
1673
1675
|
className?: string;
|
|
1676
|
+
asChild?: boolean;
|
|
1677
|
+
children?: React$1.ReactNode;
|
|
1674
1678
|
}
|
|
1675
1679
|
interface NavigationRailProps {
|
|
1676
1680
|
variant?: NavigationRailVariant;
|
|
@@ -2758,6 +2762,8 @@ type ToolbarIconButtonVariant = "standard" | "tonal" | "filled";
|
|
|
2758
2762
|
* - Support for `asChild` slot delegation.
|
|
2759
2763
|
* - Always `rounded-full` shape (required for floating toolbars per MD3 spec).
|
|
2760
2764
|
* - Always 48dp height to meet MD3 accessibility touch-target requirements.
|
|
2765
|
+
* - Material Design 3 Expressive spring motion physics (`TOOLBAR_SPRING_TRANSITION`)
|
|
2766
|
+
* synchronized with `ButtonDistribute` for responsive press scale and width expansion.
|
|
2761
2767
|
*
|
|
2762
2768
|
* @example
|
|
2763
2769
|
* ```tsx
|
package/dist/navigation.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
5
5
|
import * as RxContextMenu from '@radix-ui/react-context-menu';
|
|
6
6
|
import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
|
|
7
7
|
import { Transition, Variants, HTMLMotionProps } from 'motion/react';
|
|
8
|
-
import { B as BaseIconButtonProps } from './icon-button-
|
|
8
|
+
import { B as BaseIconButtonProps } from './icon-button-CSsDmuQC.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @file app-bar.tokens.ts
|
|
@@ -1631,6 +1631,8 @@ interface NavigationBarItemProps {
|
|
|
1631
1631
|
badge?: React$1.ReactNode;
|
|
1632
1632
|
"aria-label"?: string;
|
|
1633
1633
|
className?: string;
|
|
1634
|
+
asChild?: boolean;
|
|
1635
|
+
children?: React$1.ReactNode;
|
|
1634
1636
|
}
|
|
1635
1637
|
interface NavigationBarProps {
|
|
1636
1638
|
/** Visual variant of the Navigation Bar */
|
|
@@ -1671,6 +1673,8 @@ interface NavigationRailItemProps {
|
|
|
1671
1673
|
badge?: React$1.ReactNode;
|
|
1672
1674
|
"aria-label"?: string;
|
|
1673
1675
|
className?: string;
|
|
1676
|
+
asChild?: boolean;
|
|
1677
|
+
children?: React$1.ReactNode;
|
|
1674
1678
|
}
|
|
1675
1679
|
interface NavigationRailProps {
|
|
1676
1680
|
variant?: NavigationRailVariant;
|
|
@@ -2758,6 +2762,8 @@ type ToolbarIconButtonVariant = "standard" | "tonal" | "filled";
|
|
|
2758
2762
|
* - Support for `asChild` slot delegation.
|
|
2759
2763
|
* - Always `rounded-full` shape (required for floating toolbars per MD3 spec).
|
|
2760
2764
|
* - Always 48dp height to meet MD3 accessibility touch-target requirements.
|
|
2765
|
+
* - Material Design 3 Expressive spring motion physics (`TOOLBAR_SPRING_TRANSITION`)
|
|
2766
|
+
* synchronized with `ButtonDistribute` for responsive press scale and width expansion.
|
|
2761
2767
|
*
|
|
2762
2768
|
* @example
|
|
2763
2769
|
* ```tsx
|
package/dist/navigation.js
CHANGED
|
@@ -2601,7 +2601,10 @@ function useRippleState(options = {}) {
|
|
|
2601
2601
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
2602
2602
|
const x = e.clientX - rect.left;
|
|
2603
2603
|
const y = e.clientY - rect.top;
|
|
2604
|
-
const rippleSize = Math.
|
|
2604
|
+
const rippleSize = Math.max(
|
|
2605
|
+
Math.hypot(rect.width, rect.height) * 2.5,
|
|
2606
|
+
320
|
|
2607
|
+
);
|
|
2605
2608
|
setRipples((prev) => [
|
|
2606
2609
|
...prev,
|
|
2607
2610
|
{ id: Date.now(), x, y, size: rippleSize }
|
|
@@ -2682,9 +2685,16 @@ var NavigationBarItemComponent = React36__namespace.forwardRef(
|
|
|
2682
2685
|
disabled = false,
|
|
2683
2686
|
badge,
|
|
2684
2687
|
className,
|
|
2685
|
-
"aria-label": ariaLabelProp
|
|
2688
|
+
"aria-label": ariaLabelProp,
|
|
2689
|
+
asChild = false,
|
|
2690
|
+
children
|
|
2686
2691
|
}, ref) => {
|
|
2687
|
-
|
|
2692
|
+
var _a;
|
|
2693
|
+
const {
|
|
2694
|
+
variant,
|
|
2695
|
+
itemLayout,
|
|
2696
|
+
itemClassName: contextItemClassName
|
|
2697
|
+
} = React36__namespace.useContext(NavigationBarContext);
|
|
2688
2698
|
const isForcedHorizontal = itemLayout === "horizontal";
|
|
2689
2699
|
const isResponsiveHorizontal = (variant === "flexible" || variant === "xr") && itemLayout === void 0;
|
|
2690
2700
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
@@ -2707,6 +2717,101 @@ var NavigationBarItemComponent = React36__namespace.forwardRef(
|
|
|
2707
2717
|
[disabled, selected, onClick]
|
|
2708
2718
|
);
|
|
2709
2719
|
const filledIcon = cloneIconWithFill(icon, selected);
|
|
2720
|
+
const itemClassName = cn(
|
|
2721
|
+
"group relative flex cursor-pointer transition-colors duration-200 outline-none select-none h-full items-center justify-center min-w-0",
|
|
2722
|
+
variant === "xr" ? isResponsiveHorizontal ? "flex-1 min-[600px]:flex-initial min-[600px]:w-auto" : isForcedHorizontal ? "flex-initial w-auto" : "flex-1" : isForcedHorizontal ? "flex-initial w-auto" : "flex-1",
|
|
2723
|
+
disabled && "pointer-events-none opacity-[0.38]",
|
|
2724
|
+
contextItemClassName,
|
|
2725
|
+
className
|
|
2726
|
+
);
|
|
2727
|
+
if (asChild && children) {
|
|
2728
|
+
const child = React36__namespace.Children.only(children);
|
|
2729
|
+
const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2730
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2731
|
+
"div",
|
|
2732
|
+
{
|
|
2733
|
+
className: cn(
|
|
2734
|
+
"relative flex items-center justify-center flex-col gap-y-1 w-full px-1 py-1.5",
|
|
2735
|
+
isResponsiveHorizontal && "min-[600px]:flex-row min-[600px]:gap-y-0 min-[600px]:gap-x-1.5 min-[600px]:h-10 min-[600px]:px-4 min-[600px]:py-0 min-[600px]:rounded-full min-[600px]:w-auto",
|
|
2736
|
+
isForcedHorizontal && "flex-row gap-y-0 gap-x-1.5 h-10 px-4 py-0 rounded-full w-auto"
|
|
2737
|
+
),
|
|
2738
|
+
children: [
|
|
2739
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2740
|
+
"div",
|
|
2741
|
+
{
|
|
2742
|
+
className: cn(
|
|
2743
|
+
"absolute inset-0 z-0 hidden",
|
|
2744
|
+
isResponsiveHorizontal && "min-[600px]:block",
|
|
2745
|
+
isForcedHorizontal && "block!"
|
|
2746
|
+
),
|
|
2747
|
+
children: [
|
|
2748
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(ActivePill, {}) }),
|
|
2749
|
+
/* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer, {}),
|
|
2750
|
+
/* @__PURE__ */ jsxRuntime.jsx(RippleLayer, { ripples, onRippleDone: removeRipple })
|
|
2751
|
+
]
|
|
2752
|
+
}
|
|
2753
|
+
),
|
|
2754
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2755
|
+
"div",
|
|
2756
|
+
{
|
|
2757
|
+
className: cn(
|
|
2758
|
+
"relative flex items-center justify-center shrink-0 z-10",
|
|
2759
|
+
"h-8 w-16 mx-auto rounded-full",
|
|
2760
|
+
isResponsiveHorizontal && "min-[600px]:size-6 min-[600px]:w-auto min-[600px]:h-auto",
|
|
2761
|
+
isForcedHorizontal && "size-6 w-auto h-auto"
|
|
2762
|
+
),
|
|
2763
|
+
children: [
|
|
2764
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2765
|
+
"div",
|
|
2766
|
+
{
|
|
2767
|
+
className: cn(
|
|
2768
|
+
"absolute inset-0 z-0",
|
|
2769
|
+
isResponsiveHorizontal && "min-[600px]:hidden",
|
|
2770
|
+
isForcedHorizontal && "hidden"
|
|
2771
|
+
),
|
|
2772
|
+
children: [
|
|
2773
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(ActivePill, {}) }),
|
|
2774
|
+
/* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer, {}),
|
|
2775
|
+
/* @__PURE__ */ jsxRuntime.jsx(RippleLayer, { ripples, onRippleDone: removeRipple })
|
|
2776
|
+
]
|
|
2777
|
+
}
|
|
2778
|
+
),
|
|
2779
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative z-10 flex size-6 items-center justify-center text-current", children: /* @__PURE__ */ jsxRuntime.jsx(IconContainer, { selected, badge, children: filledIcon }) })
|
|
2780
|
+
]
|
|
2781
|
+
}
|
|
2782
|
+
),
|
|
2783
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "popLayout", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2784
|
+
"span",
|
|
2785
|
+
{
|
|
2786
|
+
className: cn(
|
|
2787
|
+
"z-10 transition-all duration-200 truncate px-1",
|
|
2788
|
+
selected ? "text-m3-on-surface" : "text-m3-on-surface-variant",
|
|
2789
|
+
"font-medium text-[12px] leading-4 tracking-[0.5px]"
|
|
2790
|
+
),
|
|
2791
|
+
children: (_a = child.props.children) != null ? _a : label
|
|
2792
|
+
},
|
|
2793
|
+
"nav-label"
|
|
2794
|
+
) })
|
|
2795
|
+
]
|
|
2796
|
+
}
|
|
2797
|
+
),
|
|
2798
|
+
/* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {})
|
|
2799
|
+
] });
|
|
2800
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2801
|
+
reactSlot.Slot,
|
|
2802
|
+
{
|
|
2803
|
+
ref,
|
|
2804
|
+
role: "menuitem",
|
|
2805
|
+
"aria-current": selected ? "page" : void 0,
|
|
2806
|
+
"aria-disabled": disabled ? true : void 0,
|
|
2807
|
+
"aria-label": ariaLabelProp || (typeof label === "string" ? label : void 0),
|
|
2808
|
+
onClick: handleClick,
|
|
2809
|
+
onPointerDown,
|
|
2810
|
+
className: itemClassName,
|
|
2811
|
+
children: React36__namespace.cloneElement(child, { children: innerContent })
|
|
2812
|
+
}
|
|
2813
|
+
);
|
|
2814
|
+
}
|
|
2710
2815
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2711
2816
|
react.m.button,
|
|
2712
2817
|
{
|
|
@@ -2718,13 +2823,7 @@ var NavigationBarItemComponent = React36__namespace.forwardRef(
|
|
|
2718
2823
|
"aria-label": ariaLabelProp || (typeof label === "string" ? label : void 0),
|
|
2719
2824
|
onClick: handleClick,
|
|
2720
2825
|
onPointerDown,
|
|
2721
|
-
className:
|
|
2722
|
-
"group relative flex cursor-pointer transition-colors duration-200 outline-none select-none h-full items-center justify-center min-w-0",
|
|
2723
|
-
variant === "xr" ? isResponsiveHorizontal ? "flex-1 min-[600px]:flex-initial min-[600px]:w-auto" : isForcedHorizontal ? "flex-initial w-auto" : "flex-1" : isForcedHorizontal ? "flex-initial w-auto" : "flex-1",
|
|
2724
|
-
disabled && "pointer-events-none opacity-[0.38]",
|
|
2725
|
-
contextItemClassName,
|
|
2726
|
-
className
|
|
2727
|
-
),
|
|
2826
|
+
className: itemClassName,
|
|
2728
2827
|
children: [
|
|
2729
2828
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2730
2829
|
"div",
|
|
@@ -2888,7 +2987,12 @@ var NavigationBarComponent = React36__namespace.forwardRef(
|
|
|
2888
2987
|
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2889
2988
|
NavigationBarContext.Provider,
|
|
2890
2989
|
{
|
|
2891
|
-
value: {
|
|
2990
|
+
value: {
|
|
2991
|
+
variant,
|
|
2992
|
+
itemLayout,
|
|
2993
|
+
activeIndicatorTransition,
|
|
2994
|
+
itemClassName
|
|
2995
|
+
},
|
|
2892
2996
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2893
2997
|
react.m.nav,
|
|
2894
2998
|
{
|
|
@@ -3024,8 +3128,11 @@ var NavigationRailItemComponent = React36__namespace.forwardRef(
|
|
|
3024
3128
|
disabled = false,
|
|
3025
3129
|
badge,
|
|
3026
3130
|
className,
|
|
3027
|
-
"aria-label": ariaLabelProp
|
|
3131
|
+
"aria-label": ariaLabelProp,
|
|
3132
|
+
asChild = false,
|
|
3133
|
+
children
|
|
3028
3134
|
}, ref) => {
|
|
3135
|
+
var _a;
|
|
3029
3136
|
const { variant, labelVisibility } = React36__namespace.useContext(
|
|
3030
3137
|
NavigationRailContext
|
|
3031
3138
|
);
|
|
@@ -3049,6 +3156,96 @@ var NavigationRailItemComponent = React36__namespace.forwardRef(
|
|
|
3049
3156
|
);
|
|
3050
3157
|
const filledIcon = cloneIconWithFill2(icon, selected);
|
|
3051
3158
|
const labelInitial = isModal ? false : { opacity: 0, x: isExpanded ? -12 : 0, y: isExpanded ? 0 : -8 };
|
|
3159
|
+
const itemClassName = cn(
|
|
3160
|
+
"group relative flex cursor-pointer transition-colors duration-200 outline-none select-none",
|
|
3161
|
+
"focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2 rounded-full",
|
|
3162
|
+
disabled && "pointer-events-none opacity-[0.38]",
|
|
3163
|
+
isExpanded ? "w-full flex-row items-center px-3 h-14" : "w-full flex-col justify-center h-14",
|
|
3164
|
+
className
|
|
3165
|
+
);
|
|
3166
|
+
if (asChild && children) {
|
|
3167
|
+
const child = React36__namespace.Children.only(children);
|
|
3168
|
+
const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3169
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3170
|
+
react.m.div,
|
|
3171
|
+
{
|
|
3172
|
+
layout: enableLayout,
|
|
3173
|
+
className: cn(
|
|
3174
|
+
"relative flex z-10",
|
|
3175
|
+
isExpanded ? "flex-row items-center w-fit h-14 px-4 gap-x-3 rounded-full" : "flex-col items-center justify-center w-full gap-y-1 rounded-full"
|
|
3176
|
+
),
|
|
3177
|
+
children: [
|
|
3178
|
+
isExpanded && /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3179
|
+
ActivePill2,
|
|
3180
|
+
{
|
|
3181
|
+
layoutId: activePillId,
|
|
3182
|
+
disableInitial: isModal
|
|
3183
|
+
}
|
|
3184
|
+
) }),
|
|
3185
|
+
isExpanded && /* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer2, {}),
|
|
3186
|
+
isExpanded && /* @__PURE__ */ jsxRuntime.jsx(RippleLayer2, { ripples, onRippleDone: removeRipple }),
|
|
3187
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3188
|
+
react.m.div,
|
|
3189
|
+
{
|
|
3190
|
+
layout: enableLayout,
|
|
3191
|
+
className: cn(
|
|
3192
|
+
"relative flex items-center justify-center shrink-0 z-10",
|
|
3193
|
+
isExpanded ? "size-6" : "h-8 w-14 mx-auto"
|
|
3194
|
+
),
|
|
3195
|
+
style: { borderRadius: 9999 },
|
|
3196
|
+
children: [
|
|
3197
|
+
!isExpanded && /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(ActivePill2, { layoutId: activePillId }) }),
|
|
3198
|
+
!isExpanded && /* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer2, {}),
|
|
3199
|
+
!isExpanded && /* @__PURE__ */ jsxRuntime.jsx(RippleLayer2, { ripples, onRippleDone: removeRipple }),
|
|
3200
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3201
|
+
react.m.div,
|
|
3202
|
+
{
|
|
3203
|
+
layout: enableLayout ? "position" : false,
|
|
3204
|
+
className: "relative z-10 flex size-6 items-center justify-center text-current",
|
|
3205
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(IconContainer2, { selected, badge, children: filledIcon })
|
|
3206
|
+
}
|
|
3207
|
+
)
|
|
3208
|
+
]
|
|
3209
|
+
}
|
|
3210
|
+
),
|
|
3211
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "popLayout", children: showLabel && (label || child.props.children) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3212
|
+
react.m.span,
|
|
3213
|
+
{
|
|
3214
|
+
layout: enableLayout ? "position" : false,
|
|
3215
|
+
initial: labelInitial,
|
|
3216
|
+
animate: { opacity: 1, x: 0, y: 0 },
|
|
3217
|
+
exit: { opacity: 0, transition: { duration: 0.1 } },
|
|
3218
|
+
transition: SPRING_TRANSITION,
|
|
3219
|
+
className: cn(
|
|
3220
|
+
"z-10 transition-colors duration-200 whitespace-nowrap",
|
|
3221
|
+
selected ? "text-m3-on-surface" : "text-m3-on-surface-variant",
|
|
3222
|
+
isExpanded ? "text-sm font-medium tracking-wide text-left" : "text-xs font-medium tracking-wide"
|
|
3223
|
+
),
|
|
3224
|
+
children: (_a = child.props.children) != null ? _a : label
|
|
3225
|
+
},
|
|
3226
|
+
"rail-label"
|
|
3227
|
+
) })
|
|
3228
|
+
]
|
|
3229
|
+
}
|
|
3230
|
+
),
|
|
3231
|
+
/* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {})
|
|
3232
|
+
] });
|
|
3233
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3234
|
+
reactSlot.Slot,
|
|
3235
|
+
{
|
|
3236
|
+
ref,
|
|
3237
|
+
role: "menuitem",
|
|
3238
|
+
"aria-current": selected ? "page" : void 0,
|
|
3239
|
+
"aria-disabled": disabled ? true : void 0,
|
|
3240
|
+
"aria-label": ariaLabelProp || (typeof label === "string" ? label : void 0),
|
|
3241
|
+
onClick: handleClick,
|
|
3242
|
+
onPointerDown,
|
|
3243
|
+
className: itemClassName,
|
|
3244
|
+
tabIndex: -1,
|
|
3245
|
+
children: React36__namespace.cloneElement(child, { children: innerContent })
|
|
3246
|
+
}
|
|
3247
|
+
) });
|
|
3248
|
+
}
|
|
3052
3249
|
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3053
3250
|
react.m.button,
|
|
3054
3251
|
{
|
|
@@ -3061,13 +3258,7 @@ var NavigationRailItemComponent = React36__namespace.forwardRef(
|
|
|
3061
3258
|
"aria-label": ariaLabelProp || (typeof label === "string" ? label : void 0),
|
|
3062
3259
|
onClick: handleClick,
|
|
3063
3260
|
onPointerDown,
|
|
3064
|
-
className:
|
|
3065
|
-
"group relative flex cursor-pointer transition-colors duration-200 outline-none select-none",
|
|
3066
|
-
"focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2 rounded-full",
|
|
3067
|
-
disabled && "pointer-events-none opacity-[0.38]",
|
|
3068
|
-
isExpanded ? "w-full flex-row items-center px-3 h-14" : "w-full flex-col justify-center h-14",
|
|
3069
|
-
className
|
|
3070
|
-
),
|
|
3261
|
+
className: itemClassName,
|
|
3071
3262
|
tabIndex: -1,
|
|
3072
3263
|
children: [
|
|
3073
3264
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -4652,12 +4843,39 @@ var ProgressIndicator = React36__namespace.forwardRef((props, ref) => {
|
|
|
4652
4843
|
return /* @__PURE__ */ jsxRuntime.jsx(LinearProgress, __spreadValues({ ref }, props));
|
|
4653
4844
|
});
|
|
4654
4845
|
ProgressIndicator.displayName = "ProgressIndicator";
|
|
4655
|
-
var
|
|
4656
|
-
xs: "h-8
|
|
4657
|
-
sm: "h-10
|
|
4658
|
-
md: "h-14
|
|
4659
|
-
lg: "h-24
|
|
4660
|
-
xl: "h-[8.5rem]
|
|
4846
|
+
var SIZE_HEIGHT_STYLES = {
|
|
4847
|
+
xs: "h-8",
|
|
4848
|
+
sm: "h-10",
|
|
4849
|
+
md: "h-14",
|
|
4850
|
+
lg: "h-24",
|
|
4851
|
+
xl: "h-[8.5rem]"
|
|
4852
|
+
};
|
|
4853
|
+
var WIDTH_SIZE_STYLES = {
|
|
4854
|
+
xs: {
|
|
4855
|
+
default: "w-8",
|
|
4856
|
+
narrow: "w-8",
|
|
4857
|
+
wide: "w-12"
|
|
4858
|
+
},
|
|
4859
|
+
sm: {
|
|
4860
|
+
default: "w-10",
|
|
4861
|
+
narrow: "w-12",
|
|
4862
|
+
wide: "w-[3.25rem]"
|
|
4863
|
+
},
|
|
4864
|
+
md: {
|
|
4865
|
+
default: "w-14",
|
|
4866
|
+
narrow: "w-12",
|
|
4867
|
+
wide: "w-[4.5rem]"
|
|
4868
|
+
},
|
|
4869
|
+
lg: {
|
|
4870
|
+
default: "w-24",
|
|
4871
|
+
narrow: "w-16",
|
|
4872
|
+
wide: "w-32"
|
|
4873
|
+
},
|
|
4874
|
+
xl: {
|
|
4875
|
+
default: "w-[8.5rem]",
|
|
4876
|
+
narrow: "w-[6.5rem]",
|
|
4877
|
+
wide: "w-[11.5rem]"
|
|
4878
|
+
}
|
|
4661
4879
|
};
|
|
4662
4880
|
var SIZE_ICON = {
|
|
4663
4881
|
xs: { cls: "size-5", px: 20 },
|
|
@@ -4758,8 +4976,10 @@ var IconButtonComponent = React36__namespace.forwardRef(
|
|
|
4758
4976
|
variant = "default",
|
|
4759
4977
|
colorStyle = "standard",
|
|
4760
4978
|
size = "sm",
|
|
4979
|
+
widthVariant = "default",
|
|
4761
4980
|
shape = "round",
|
|
4762
4981
|
selected,
|
|
4982
|
+
selectedIcon,
|
|
4763
4983
|
loading = false,
|
|
4764
4984
|
loadingVariant = "loading-indicator",
|
|
4765
4985
|
iconSize,
|
|
@@ -4774,8 +4994,10 @@ var IconButtonComponent = React36__namespace.forwardRef(
|
|
|
4774
4994
|
"variant",
|
|
4775
4995
|
"colorStyle",
|
|
4776
4996
|
"size",
|
|
4997
|
+
"widthVariant",
|
|
4777
4998
|
"shape",
|
|
4778
4999
|
"selected",
|
|
5000
|
+
"selectedIcon",
|
|
4779
5001
|
"loading",
|
|
4780
5002
|
"loadingVariant",
|
|
4781
5003
|
"iconSize",
|
|
@@ -4785,7 +5007,7 @@ var IconButtonComponent = React36__namespace.forwardRef(
|
|
|
4785
5007
|
"onKeyDown",
|
|
4786
5008
|
"aria-label"
|
|
4787
5009
|
]);
|
|
4788
|
-
var _a2, _b2;
|
|
5010
|
+
var _a2, _b2, _c, _d, _e;
|
|
4789
5011
|
const isToggle = variant === "toggle";
|
|
4790
5012
|
const isSelected = isToggle && !!selected;
|
|
4791
5013
|
const resolvedColorClass = React36__namespace.useMemo(
|
|
@@ -4816,6 +5038,8 @@ var IconButtonComponent = React36__namespace.forwardRef(
|
|
|
4816
5038
|
const defaultIconPx = sizeIcon.px;
|
|
4817
5039
|
const iconPx = iconSize != null ? iconSize : defaultIconPx;
|
|
4818
5040
|
const isCustomSize = iconSize != null && iconSize !== "inherit";
|
|
5041
|
+
const heightClass = (_c = SIZE_HEIGHT_STYLES[size]) != null ? _c : SIZE_HEIGHT_STYLES.sm;
|
|
5042
|
+
const widthClass = (_e = ((_d = WIDTH_SIZE_STYLES[size]) != null ? _d : WIDTH_SIZE_STYLES.sm)[widthVariant]) != null ? _e : WIDTH_SIZE_STYLES.sm.default;
|
|
4819
5043
|
const needsTouchTarget = size === "xs" || size === "sm";
|
|
4820
5044
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
4821
5045
|
disabled: loading
|
|
@@ -4878,7 +5102,7 @@ var IconButtonComponent = React36__namespace.forwardRef(
|
|
|
4878
5102
|
transition: SPRING_TRANSITION,
|
|
4879
5103
|
"aria-hidden": "true",
|
|
4880
5104
|
className: cn(
|
|
4881
|
-
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]
|
|
5105
|
+
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]",
|
|
4882
5106
|
iconSize != null ? void 0 : iconClass
|
|
4883
5107
|
),
|
|
4884
5108
|
style: {
|
|
@@ -4886,9 +5110,9 @@ var IconButtonComponent = React36__namespace.forwardRef(
|
|
|
4886
5110
|
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
4887
5111
|
height: isCustomSize ? `${iconSize}px` : void 0
|
|
4888
5112
|
},
|
|
4889
|
-
children: asChild ? React36__namespace.Children.only(children).props.children : children
|
|
5113
|
+
children: isSelected && selectedIcon ? selectedIcon : asChild ? React36__namespace.Children.only(children).props.children : children
|
|
4890
5114
|
}),
|
|
4891
|
-
"content"
|
|
5115
|
+
isSelected && selectedIcon ? "selected-content" : "content"
|
|
4892
5116
|
) })
|
|
4893
5117
|
] });
|
|
4894
5118
|
const containerClassName = cn(
|
|
@@ -4897,7 +5121,8 @@ var IconButtonComponent = React36__namespace.forwardRef(
|
|
|
4897
5121
|
outlineWidthClass,
|
|
4898
5122
|
disabledBgClass,
|
|
4899
5123
|
"overflow-hidden",
|
|
4900
|
-
|
|
5124
|
+
heightClass,
|
|
5125
|
+
widthClass,
|
|
4901
5126
|
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
4902
5127
|
className
|
|
4903
5128
|
);
|
|
@@ -4914,7 +5139,9 @@ var IconButtonComponent = React36__namespace.forwardRef(
|
|
|
4914
5139
|
onClick: handleClick,
|
|
4915
5140
|
onPointerDown,
|
|
4916
5141
|
onKeyDown: handleKeyDown,
|
|
4917
|
-
style: __spreadProps(__spreadValues({}, style), {
|
|
5142
|
+
style: __spreadProps(__spreadValues({}, style), {
|
|
5143
|
+
borderRadius: `${animateRadius}px`
|
|
5144
|
+
}),
|
|
4918
5145
|
className: containerClassName
|
|
4919
5146
|
}, restProps), {
|
|
4920
5147
|
children: React36__namespace.cloneElement(child, { children: innerContent })
|
|
@@ -6169,6 +6396,12 @@ var BottomDockedToolbar = React36__namespace.forwardRef(
|
|
|
6169
6396
|
BottomDockedToolbar.displayName = "BottomDockedToolbar";
|
|
6170
6397
|
|
|
6171
6398
|
// src/ui/toolbar/toolbar-tokens.ts
|
|
6399
|
+
var TOOLBAR_SPRING_TRANSITION = {
|
|
6400
|
+
type: "spring",
|
|
6401
|
+
stiffness: 300,
|
|
6402
|
+
damping: 30,
|
|
6403
|
+
mass: 0.8
|
|
6404
|
+
};
|
|
6172
6405
|
var FloatingToolbarTokens = {
|
|
6173
6406
|
ContainerBetweenSpace: 4,
|
|
6174
6407
|
ContainerHeight: 64};
|
|
@@ -6363,7 +6596,9 @@ var FloatingToolbarBase = React36__namespace.forwardRef(
|
|
|
6363
6596
|
isHorizontal ? "flex-row h-full" : "flex-col w-full",
|
|
6364
6597
|
isStringPadding ? contentPadding : isHorizontal ? "px-2" : "py-2"
|
|
6365
6598
|
),
|
|
6366
|
-
style: __spreadValues({
|
|
6599
|
+
style: __spreadValues({
|
|
6600
|
+
gap: itemGap
|
|
6601
|
+
}, isStringPadding ? {} : contentPadding),
|
|
6367
6602
|
children: [
|
|
6368
6603
|
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: expanded && startContent && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6369
6604
|
react.m.div,
|
|
@@ -6598,13 +6833,17 @@ var ToolbarIconButton = React36__namespace.forwardRef(
|
|
|
6598
6833
|
toolbarSize = "default",
|
|
6599
6834
|
selected,
|
|
6600
6835
|
asChild,
|
|
6601
|
-
className
|
|
6836
|
+
className,
|
|
6837
|
+
transition,
|
|
6838
|
+
whileTap
|
|
6602
6839
|
} = _b, props = __objRest(_b, [
|
|
6603
6840
|
"emphasis",
|
|
6604
6841
|
"toolbarSize",
|
|
6605
6842
|
"selected",
|
|
6606
6843
|
"asChild",
|
|
6607
|
-
"className"
|
|
6844
|
+
"className",
|
|
6845
|
+
"transition",
|
|
6846
|
+
"whileTap"
|
|
6608
6847
|
]);
|
|
6609
6848
|
const context = useToolbarContext();
|
|
6610
6849
|
const widthClass = TOOLBAR_ICON_BUTTON_WIDTH[toolbarSize];
|
|
@@ -6615,16 +6854,20 @@ var ToolbarIconButton = React36__namespace.forwardRef(
|
|
|
6615
6854
|
} : {
|
|
6616
6855
|
variant: "default"
|
|
6617
6856
|
};
|
|
6857
|
+
const motionProps = asChild ? __spreadValues(__spreadValues({}, transition !== void 0 && { transition }), whileTap !== void 0 && { whileTap }) : {
|
|
6858
|
+
transition: transition != null ? transition : TOOLBAR_SPRING_TRANSITION,
|
|
6859
|
+
whileTap: whileTap != null ? whileTap : { scale: 0.95 }
|
|
6860
|
+
};
|
|
6618
6861
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6619
6862
|
IconButton,
|
|
6620
|
-
__spreadValues(__spreadProps(__spreadValues({
|
|
6863
|
+
__spreadValues(__spreadProps(__spreadValues(__spreadValues({
|
|
6621
6864
|
ref,
|
|
6622
6865
|
asChild,
|
|
6623
6866
|
colorStyle,
|
|
6624
6867
|
size: "md",
|
|
6625
6868
|
shape: "round",
|
|
6626
6869
|
iconSize: ToolbarIconButtonTokens.IconSize
|
|
6627
|
-
}, iconButtonProps), {
|
|
6870
|
+
}, motionProps), iconButtonProps), {
|
|
6628
6871
|
className: cn(
|
|
6629
6872
|
"h-[48px]",
|
|
6630
6873
|
widthClass,
|
|
@@ -6800,8 +7043,8 @@ var ToolbarToggleButton = React36__namespace.forwardRef(
|
|
|
6800
7043
|
[pressScale, pressBounceOffset]
|
|
6801
7044
|
);
|
|
6802
7045
|
const transitionConfig = React36__namespace.useMemo(
|
|
6803
|
-
() => ({
|
|
6804
|
-
scale:
|
|
7046
|
+
() => __spreadProps(__spreadValues({}, TOOLBAR_SPRING_TRANSITION), {
|
|
7047
|
+
scale: TOOLBAR_SPRING_TRANSITION,
|
|
6805
7048
|
x: {
|
|
6806
7049
|
duration: 0.35,
|
|
6807
7050
|
ease: "easeInOut"
|