@bug-on/m3-expressive 1.2.0 → 1.2.2
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 +1074 -765
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +1066 -765
- package/dist/buttons.mjs.map +1 -1
- package/dist/core.js +133 -69
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +133 -69
- package/dist/core.mjs.map +1 -1
- package/dist/feedback.js +132 -69
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs +132 -69
- package/dist/feedback.mjs.map +1 -1
- package/dist/forms.d.mts +2 -2
- package/dist/forms.d.ts +2 -2
- package/dist/forms.js +74 -9
- package/dist/forms.js.map +1 -1
- package/dist/forms.mjs +74 -9
- package/dist/forms.mjs.map +1 -1
- package/dist/{icon-button-D-gs0gfj.d.mts → icon-button-CSsDmuQC.d.mts} +19 -0
- package/dist/{icon-button-D-gs0gfj.d.ts → icon-button-CSsDmuQC.d.ts} +19 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2204 -1464
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2056 -1324
- package/dist/index.mjs.map +1 -1
- package/dist/layout.d.mts +18 -1
- package/dist/layout.d.ts +18 -1
- package/dist/layout.js +80 -15
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +80 -15
- package/dist/layout.mjs.map +1 -1
- package/dist/navigation.d.mts +134 -9
- package/dist/navigation.d.ts +134 -9
- package/dist/navigation.js +461 -101
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +455 -102
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.js +261 -197
- package/dist/overlays.js.map +1 -1
- package/dist/overlays.mjs +223 -159
- package/dist/overlays.mjs.map +1 -1
- package/dist/pickers.js +392 -301
- package/dist/pickers.js.map +1 -1
- package/dist/pickers.mjs +361 -270
- package/dist/pickers.mjs.map +1 -1
- package/dist/{split-button-trailing-uncheckable-BkPbiBo3.d.ts → split-button-trailing-uncheckable-C-qQlyZx.d.ts} +118 -25
- package/dist/{split-button-trailing-uncheckable-D_PLPb-u.d.mts → split-button-trailing-uncheckable-DHJqNeq_.d.mts} +118 -25
- package/dist/{text-field-eAIpz9z1.d.mts → text-field-T4Rg-9Bw.d.mts} +7 -0
- package/dist/{text-field-eAIpz9z1.d.ts → text-field-T4Rg-9Bw.d.ts} +7 -0
- package/package.json +3 -3
package/dist/navigation.mjs
CHANGED
|
@@ -2578,7 +2578,10 @@ function useRippleState(options = {}) {
|
|
|
2578
2578
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
2579
2579
|
const x = e.clientX - rect.left;
|
|
2580
2580
|
const y = e.clientY - rect.top;
|
|
2581
|
-
const rippleSize = Math.
|
|
2581
|
+
const rippleSize = Math.max(
|
|
2582
|
+
Math.hypot(rect.width, rect.height) * 2.5,
|
|
2583
|
+
320
|
|
2584
|
+
);
|
|
2582
2585
|
setRipples((prev) => [
|
|
2583
2586
|
...prev,
|
|
2584
2587
|
{ id: Date.now(), x, y, size: rippleSize }
|
|
@@ -2661,7 +2664,11 @@ var NavigationBarItemComponent = React36.forwardRef(
|
|
|
2661
2664
|
className,
|
|
2662
2665
|
"aria-label": ariaLabelProp
|
|
2663
2666
|
}, ref) => {
|
|
2664
|
-
const {
|
|
2667
|
+
const {
|
|
2668
|
+
variant,
|
|
2669
|
+
itemLayout,
|
|
2670
|
+
itemClassName: contextItemClassName
|
|
2671
|
+
} = React36.useContext(NavigationBarContext);
|
|
2665
2672
|
const isForcedHorizontal = itemLayout === "horizontal";
|
|
2666
2673
|
const isResponsiveHorizontal = (variant === "flexible" || variant === "xr") && itemLayout === void 0;
|
|
2667
2674
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
@@ -2696,9 +2703,10 @@ var NavigationBarItemComponent = React36.forwardRef(
|
|
|
2696
2703
|
onClick: handleClick,
|
|
2697
2704
|
onPointerDown,
|
|
2698
2705
|
className: cn(
|
|
2699
|
-
"group relative flex
|
|
2700
|
-
variant === "xr" ? "
|
|
2706
|
+
"group relative flex cursor-pointer transition-colors duration-200 outline-none select-none h-full items-center justify-center min-w-0",
|
|
2707
|
+
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",
|
|
2701
2708
|
disabled && "pointer-events-none opacity-[0.38]",
|
|
2709
|
+
contextItemClassName,
|
|
2702
2710
|
className
|
|
2703
2711
|
),
|
|
2704
2712
|
children: [
|
|
@@ -2706,9 +2714,9 @@ var NavigationBarItemComponent = React36.forwardRef(
|
|
|
2706
2714
|
"div",
|
|
2707
2715
|
{
|
|
2708
2716
|
className: cn(
|
|
2709
|
-
"relative flex items-center justify-center flex-col gap-y-1 w-full",
|
|
2710
|
-
isResponsiveHorizontal && "min-[600px]:flex-row min-[600px]:gap-y-0 min-[600px]:gap-x-1 min-[600px]:h-10 min-[600px]:px-4 min-[600px]:
|
|
2711
|
-
isForcedHorizontal && "flex-row gap-y-0 gap-x-1 h-10 px-4 rounded-full w-auto
|
|
2717
|
+
"relative flex items-center justify-center flex-col gap-y-1 w-full px-1 py-1.5",
|
|
2718
|
+
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",
|
|
2719
|
+
isForcedHorizontal && "flex-row gap-y-0 gap-x-1.5 h-10 px-4 py-0 rounded-full w-auto"
|
|
2712
2720
|
),
|
|
2713
2721
|
children: [
|
|
2714
2722
|
/* @__PURE__ */ jsxs(
|
|
@@ -2785,7 +2793,7 @@ var navContainerVariants = cva(
|
|
|
2785
2793
|
variant: {
|
|
2786
2794
|
flexible: "bottom-0 left-0 right-0 w-full h-16 pb-safe",
|
|
2787
2795
|
baseline: "bottom-0 left-0 right-0 w-full h-20 pb-safe",
|
|
2788
|
-
xr: "bottom-6 left-1/2 -translate-x-1/2 w-auto max-w-fit h-20 min-[600px]:h-16 rounded-[48px] px-2"
|
|
2796
|
+
xr: "bottom-6 left-1/2 -translate-x-1/2 w-auto max-w-[calc(100%-2rem)] min-[600px]:max-w-fit h-20 min-[600px]:h-16 rounded-[48px] px-2"
|
|
2789
2797
|
},
|
|
2790
2798
|
position: {
|
|
2791
2799
|
fixed: "fixed",
|
|
@@ -2813,6 +2821,7 @@ var NavigationBarComponent = React36.forwardRef(
|
|
|
2813
2821
|
scrollContainerRef,
|
|
2814
2822
|
activeIndicatorTransition,
|
|
2815
2823
|
children,
|
|
2824
|
+
itemClassName,
|
|
2816
2825
|
className,
|
|
2817
2826
|
style
|
|
2818
2827
|
}, ref) => {
|
|
@@ -2863,7 +2872,12 @@ var NavigationBarComponent = React36.forwardRef(
|
|
|
2863
2872
|
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
|
|
2864
2873
|
NavigationBarContext.Provider,
|
|
2865
2874
|
{
|
|
2866
|
-
value: {
|
|
2875
|
+
value: {
|
|
2876
|
+
variant,
|
|
2877
|
+
itemLayout,
|
|
2878
|
+
activeIndicatorTransition,
|
|
2879
|
+
itemClassName
|
|
2880
|
+
},
|
|
2867
2881
|
children: /* @__PURE__ */ jsx(
|
|
2868
2882
|
m.nav,
|
|
2869
2883
|
{
|
|
@@ -2884,7 +2898,7 @@ var NavigationBarComponent = React36.forwardRef(
|
|
|
2884
2898
|
"aria-orientation": "horizontal",
|
|
2885
2899
|
className: cn(
|
|
2886
2900
|
"flex w-full h-full mx-auto",
|
|
2887
|
-
variant === "xr" ? "gap-0 min-[600px]:gap-1.5" : "max-w-7xl gap-1.5"
|
|
2901
|
+
variant === "xr" ? "gap-0 min-[600px]:gap-1.5 items-center justify-center px-1" : "max-w-7xl gap-1.5"
|
|
2888
2902
|
),
|
|
2889
2903
|
children
|
|
2890
2904
|
}
|
|
@@ -4627,12 +4641,39 @@ var ProgressIndicator = React36.forwardRef((props, ref) => {
|
|
|
4627
4641
|
return /* @__PURE__ */ jsx(LinearProgress, __spreadValues({ ref }, props));
|
|
4628
4642
|
});
|
|
4629
4643
|
ProgressIndicator.displayName = "ProgressIndicator";
|
|
4630
|
-
var
|
|
4631
|
-
xs: "h-8
|
|
4632
|
-
sm: "h-10
|
|
4633
|
-
md: "h-14
|
|
4634
|
-
lg: "h-24
|
|
4635
|
-
xl: "h-[8.5rem]
|
|
4644
|
+
var SIZE_HEIGHT_STYLES = {
|
|
4645
|
+
xs: "h-8",
|
|
4646
|
+
sm: "h-10",
|
|
4647
|
+
md: "h-14",
|
|
4648
|
+
lg: "h-24",
|
|
4649
|
+
xl: "h-[8.5rem]"
|
|
4650
|
+
};
|
|
4651
|
+
var WIDTH_SIZE_STYLES = {
|
|
4652
|
+
xs: {
|
|
4653
|
+
default: "w-8",
|
|
4654
|
+
narrow: "w-8",
|
|
4655
|
+
wide: "w-12"
|
|
4656
|
+
},
|
|
4657
|
+
sm: {
|
|
4658
|
+
default: "w-10",
|
|
4659
|
+
narrow: "w-12",
|
|
4660
|
+
wide: "w-[3.25rem]"
|
|
4661
|
+
},
|
|
4662
|
+
md: {
|
|
4663
|
+
default: "w-14",
|
|
4664
|
+
narrow: "w-12",
|
|
4665
|
+
wide: "w-[4.5rem]"
|
|
4666
|
+
},
|
|
4667
|
+
lg: {
|
|
4668
|
+
default: "w-24",
|
|
4669
|
+
narrow: "w-16",
|
|
4670
|
+
wide: "w-32"
|
|
4671
|
+
},
|
|
4672
|
+
xl: {
|
|
4673
|
+
default: "w-[8.5rem]",
|
|
4674
|
+
narrow: "w-[6.5rem]",
|
|
4675
|
+
wide: "w-[11.5rem]"
|
|
4676
|
+
}
|
|
4636
4677
|
};
|
|
4637
4678
|
var SIZE_ICON = {
|
|
4638
4679
|
xs: { cls: "size-5", px: 20 },
|
|
@@ -4733,11 +4774,14 @@ var IconButtonComponent = React36.forwardRef(
|
|
|
4733
4774
|
variant = "default",
|
|
4734
4775
|
colorStyle = "standard",
|
|
4735
4776
|
size = "sm",
|
|
4777
|
+
widthVariant = "default",
|
|
4736
4778
|
shape = "round",
|
|
4737
4779
|
selected,
|
|
4780
|
+
selectedIcon,
|
|
4738
4781
|
loading = false,
|
|
4739
4782
|
loadingVariant = "loading-indicator",
|
|
4740
4783
|
iconSize,
|
|
4784
|
+
asChild = false,
|
|
4741
4785
|
children,
|
|
4742
4786
|
onClick,
|
|
4743
4787
|
onKeyDown,
|
|
@@ -4748,17 +4792,20 @@ var IconButtonComponent = React36.forwardRef(
|
|
|
4748
4792
|
"variant",
|
|
4749
4793
|
"colorStyle",
|
|
4750
4794
|
"size",
|
|
4795
|
+
"widthVariant",
|
|
4751
4796
|
"shape",
|
|
4752
4797
|
"selected",
|
|
4798
|
+
"selectedIcon",
|
|
4753
4799
|
"loading",
|
|
4754
4800
|
"loadingVariant",
|
|
4755
4801
|
"iconSize",
|
|
4802
|
+
"asChild",
|
|
4756
4803
|
"children",
|
|
4757
4804
|
"onClick",
|
|
4758
4805
|
"onKeyDown",
|
|
4759
4806
|
"aria-label"
|
|
4760
4807
|
]);
|
|
4761
|
-
var _a2, _b2;
|
|
4808
|
+
var _a2, _b2, _c, _d, _e;
|
|
4762
4809
|
const isToggle = variant === "toggle";
|
|
4763
4810
|
const isSelected = isToggle && !!selected;
|
|
4764
4811
|
const resolvedColorClass = React36.useMemo(
|
|
@@ -4789,6 +4836,8 @@ var IconButtonComponent = React36.forwardRef(
|
|
|
4789
4836
|
const defaultIconPx = sizeIcon.px;
|
|
4790
4837
|
const iconPx = iconSize != null ? iconSize : defaultIconPx;
|
|
4791
4838
|
const isCustomSize = iconSize != null && iconSize !== "inherit";
|
|
4839
|
+
const heightClass = (_c = SIZE_HEIGHT_STYLES[size]) != null ? _c : SIZE_HEIGHT_STYLES.sm;
|
|
4840
|
+
const widthClass = (_e = ((_d = WIDTH_SIZE_STYLES[size]) != null ? _d : WIDTH_SIZE_STYLES.sm)[widthVariant]) != null ? _e : WIDTH_SIZE_STYLES.sm.default;
|
|
4792
4841
|
const needsTouchTarget = size === "xs" || size === "sm";
|
|
4793
4842
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
4794
4843
|
disabled: loading
|
|
@@ -4814,7 +4863,90 @@ var IconButtonComponent = React36.forwardRef(
|
|
|
4814
4863
|
},
|
|
4815
4864
|
[loading, onClick, onKeyDown]
|
|
4816
4865
|
);
|
|
4817
|
-
|
|
4866
|
+
const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4867
|
+
needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
|
|
4868
|
+
/* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
4869
|
+
/* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsx(
|
|
4870
|
+
m.span,
|
|
4871
|
+
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
4872
|
+
transition: SPRING_TRANSITION,
|
|
4873
|
+
className: cn(
|
|
4874
|
+
"flex items-center justify-center shrink-0",
|
|
4875
|
+
iconSize != null ? void 0 : iconClass
|
|
4876
|
+
),
|
|
4877
|
+
style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
|
|
4878
|
+
children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsx(
|
|
4879
|
+
LoadingIndicator,
|
|
4880
|
+
{
|
|
4881
|
+
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
4882
|
+
color: "currentColor",
|
|
4883
|
+
"aria-label": "Loading"
|
|
4884
|
+
}
|
|
4885
|
+
) : /* @__PURE__ */ jsx(
|
|
4886
|
+
ProgressIndicator,
|
|
4887
|
+
{
|
|
4888
|
+
variant: "circular",
|
|
4889
|
+
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
4890
|
+
color: "currentColor",
|
|
4891
|
+
trackColor: "transparent",
|
|
4892
|
+
"aria-label": "Loading"
|
|
4893
|
+
}
|
|
4894
|
+
)
|
|
4895
|
+
}),
|
|
4896
|
+
"loading"
|
|
4897
|
+
) : /* @__PURE__ */ jsx(
|
|
4898
|
+
m.span,
|
|
4899
|
+
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
4900
|
+
transition: SPRING_TRANSITION,
|
|
4901
|
+
"aria-hidden": "true",
|
|
4902
|
+
className: cn(
|
|
4903
|
+
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]",
|
|
4904
|
+
iconSize != null ? void 0 : iconClass
|
|
4905
|
+
),
|
|
4906
|
+
style: {
|
|
4907
|
+
fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
|
|
4908
|
+
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
4909
|
+
height: isCustomSize ? `${iconSize}px` : void 0
|
|
4910
|
+
},
|
|
4911
|
+
children: isSelected && selectedIcon ? selectedIcon : asChild ? React36.Children.only(children).props.children : children
|
|
4912
|
+
}),
|
|
4913
|
+
isSelected && selectedIcon ? "selected-content" : "content"
|
|
4914
|
+
) })
|
|
4915
|
+
] });
|
|
4916
|
+
const containerClassName = cn(
|
|
4917
|
+
baseIconButtonClasses,
|
|
4918
|
+
resolvedColorClass,
|
|
4919
|
+
outlineWidthClass,
|
|
4920
|
+
disabledBgClass,
|
|
4921
|
+
"overflow-hidden",
|
|
4922
|
+
heightClass,
|
|
4923
|
+
widthClass,
|
|
4924
|
+
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
4925
|
+
className
|
|
4926
|
+
);
|
|
4927
|
+
if (asChild) {
|
|
4928
|
+
const child = React36.Children.only(children);
|
|
4929
|
+
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
|
|
4930
|
+
Slot,
|
|
4931
|
+
__spreadProps(__spreadValues({
|
|
4932
|
+
ref,
|
|
4933
|
+
"aria-pressed": isToggle ? isSelected : void 0,
|
|
4934
|
+
"aria-label": ariaLabel,
|
|
4935
|
+
"aria-busy": loading || void 0,
|
|
4936
|
+
"aria-disabled": loading || restProps.disabled,
|
|
4937
|
+
onClick: handleClick,
|
|
4938
|
+
onPointerDown,
|
|
4939
|
+
onKeyDown: handleKeyDown,
|
|
4940
|
+
style: __spreadProps(__spreadValues({}, style), {
|
|
4941
|
+
borderRadius: `${animateRadius}px`
|
|
4942
|
+
}),
|
|
4943
|
+
className: containerClassName
|
|
4944
|
+
}, restProps), {
|
|
4945
|
+
children: React36.cloneElement(child, { children: innerContent })
|
|
4946
|
+
})
|
|
4947
|
+
) });
|
|
4948
|
+
}
|
|
4949
|
+
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
|
|
4818
4950
|
m.button,
|
|
4819
4951
|
__spreadProps(__spreadValues({
|
|
4820
4952
|
ref,
|
|
@@ -4830,67 +4962,9 @@ var IconButtonComponent = React36.forwardRef(
|
|
|
4830
4962
|
animate: { borderRadius: animateRadius },
|
|
4831
4963
|
whileTap: { borderRadius: pressedRadius },
|
|
4832
4964
|
transition: { borderRadius: SPRING_TRANSITION_FAST },
|
|
4833
|
-
className:
|
|
4834
|
-
baseIconButtonClasses,
|
|
4835
|
-
resolvedColorClass,
|
|
4836
|
-
outlineWidthClass,
|
|
4837
|
-
disabledBgClass,
|
|
4838
|
-
"overflow-hidden",
|
|
4839
|
-
SIZE_STYLES[size],
|
|
4840
|
-
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
4841
|
-
className
|
|
4842
|
-
)
|
|
4965
|
+
className: containerClassName
|
|
4843
4966
|
}, restProps), {
|
|
4844
|
-
children:
|
|
4845
|
-
needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
|
|
4846
|
-
/* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
4847
|
-
/* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsx(
|
|
4848
|
-
m.span,
|
|
4849
|
-
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
4850
|
-
transition: SPRING_TRANSITION,
|
|
4851
|
-
className: cn(
|
|
4852
|
-
"flex items-center justify-center shrink-0",
|
|
4853
|
-
iconSize != null ? void 0 : iconClass
|
|
4854
|
-
),
|
|
4855
|
-
style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
|
|
4856
|
-
children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsx(
|
|
4857
|
-
LoadingIndicator,
|
|
4858
|
-
{
|
|
4859
|
-
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
4860
|
-
color: "currentColor",
|
|
4861
|
-
"aria-label": "Loading"
|
|
4862
|
-
}
|
|
4863
|
-
) : /* @__PURE__ */ jsx(
|
|
4864
|
-
ProgressIndicator,
|
|
4865
|
-
{
|
|
4866
|
-
variant: "circular",
|
|
4867
|
-
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
4868
|
-
color: "currentColor",
|
|
4869
|
-
trackColor: "transparent",
|
|
4870
|
-
"aria-label": "Loading"
|
|
4871
|
-
}
|
|
4872
|
-
)
|
|
4873
|
-
}),
|
|
4874
|
-
"loading"
|
|
4875
|
-
) : /* @__PURE__ */ jsx(
|
|
4876
|
-
m.span,
|
|
4877
|
-
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
4878
|
-
transition: SPRING_TRANSITION,
|
|
4879
|
-
"aria-hidden": "true",
|
|
4880
|
-
className: cn(
|
|
4881
|
-
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
|
|
4882
|
-
iconSize != null ? void 0 : iconClass
|
|
4883
|
-
),
|
|
4884
|
-
style: {
|
|
4885
|
-
fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
|
|
4886
|
-
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
4887
|
-
height: isCustomSize ? `${iconSize}px` : void 0
|
|
4888
|
-
},
|
|
4889
|
-
children
|
|
4890
|
-
}),
|
|
4891
|
-
"content"
|
|
4892
|
-
) })
|
|
4893
|
-
]
|
|
4967
|
+
children: innerContent
|
|
4894
4968
|
})
|
|
4895
4969
|
) });
|
|
4896
4970
|
}
|
|
@@ -5964,6 +6038,47 @@ var vibrantFloatingToolbarColors = {
|
|
|
5964
6038
|
fabContainerColor: "var(--md-sys-color-tertiary-container)",
|
|
5965
6039
|
fabContentColor: "var(--md-sys-color-on-tertiary-container)"
|
|
5966
6040
|
};
|
|
6041
|
+
var surfaceContainerHighFloatingToolbarColors = {
|
|
6042
|
+
toolbarContainerColor: "var(--md-sys-color-surface-container-high)",
|
|
6043
|
+
toolbarContentColor: "var(--md-sys-color-on-surface)",
|
|
6044
|
+
fabContainerColor: "var(--md-sys-color-secondary-container)",
|
|
6045
|
+
fabContentColor: "var(--md-sys-color-on-secondary-container)"
|
|
6046
|
+
};
|
|
6047
|
+
var surfaceContainerHighestFloatingToolbarColors = {
|
|
6048
|
+
toolbarContainerColor: "var(--md-sys-color-surface-container-highest)",
|
|
6049
|
+
toolbarContentColor: "var(--md-sys-color-on-surface)",
|
|
6050
|
+
fabContainerColor: "var(--md-sys-color-secondary-container)",
|
|
6051
|
+
fabContentColor: "var(--md-sys-color-on-secondary-container)"
|
|
6052
|
+
};
|
|
6053
|
+
var tertiaryContainerFloatingToolbarColors = {
|
|
6054
|
+
toolbarContainerColor: "var(--md-sys-color-tertiary-container)",
|
|
6055
|
+
toolbarContentColor: "var(--md-sys-color-on-tertiary-container)",
|
|
6056
|
+
fabContainerColor: "var(--md-sys-color-primary-container)",
|
|
6057
|
+
fabContentColor: "var(--md-sys-color-on-primary-container)"
|
|
6058
|
+
};
|
|
6059
|
+
var xrFloatingToolbarColors = {
|
|
6060
|
+
toolbarContainerColor: "color-mix(in srgb, var(--md-sys-color-surface-container-high) 80%, transparent)",
|
|
6061
|
+
toolbarContentColor: "var(--md-sys-color-on-surface)",
|
|
6062
|
+
fabContainerColor: "color-mix(in srgb, var(--md-sys-color-secondary-container) 85%, transparent)",
|
|
6063
|
+
fabContentColor: "var(--md-sys-color-on-secondary-container)"
|
|
6064
|
+
};
|
|
6065
|
+
function getToolbarColors(variant = "standard", customColors) {
|
|
6066
|
+
if (customColors) return customColors;
|
|
6067
|
+
switch (variant) {
|
|
6068
|
+
case "vibrant":
|
|
6069
|
+
return vibrantFloatingToolbarColors;
|
|
6070
|
+
case "surface-high":
|
|
6071
|
+
return surfaceContainerHighFloatingToolbarColors;
|
|
6072
|
+
case "surface-highest":
|
|
6073
|
+
return surfaceContainerHighestFloatingToolbarColors;
|
|
6074
|
+
case "tertiary":
|
|
6075
|
+
return tertiaryContainerFloatingToolbarColors;
|
|
6076
|
+
case "xr":
|
|
6077
|
+
return xrFloatingToolbarColors;
|
|
6078
|
+
default:
|
|
6079
|
+
return standardFloatingToolbarColors;
|
|
6080
|
+
}
|
|
6081
|
+
}
|
|
5967
6082
|
var ToolbarContext = React36.createContext(
|
|
5968
6083
|
null
|
|
5969
6084
|
);
|
|
@@ -5999,7 +6114,7 @@ var BottomDockedToolbar = React36.forwardRef(
|
|
|
5999
6114
|
"className",
|
|
6000
6115
|
"aria-label"
|
|
6001
6116
|
]);
|
|
6002
|
-
const colors =
|
|
6117
|
+
const colors = getToolbarColors(variant, customColors);
|
|
6003
6118
|
const { scrollY } = useScroll(
|
|
6004
6119
|
scrollContainerRef ? { container: scrollContainerRef } : void 0
|
|
6005
6120
|
);
|
|
@@ -6028,6 +6143,7 @@ var BottomDockedToolbar = React36.forwardRef(
|
|
|
6028
6143
|
full: "rounded-full"
|
|
6029
6144
|
};
|
|
6030
6145
|
const justifyClass = justify === "center" ? "justify-center gap-4" : "justify-between";
|
|
6146
|
+
const isXr = variant === "xr";
|
|
6031
6147
|
return /* @__PURE__ */ jsx(ToolbarContext.Provider, { value: { orientation: "horizontal" }, children: /* @__PURE__ */ jsxs(
|
|
6032
6148
|
m.div,
|
|
6033
6149
|
__spreadProps(__spreadValues({
|
|
@@ -6048,11 +6164,12 @@ var BottomDockedToolbar = React36.forwardRef(
|
|
|
6048
6164
|
paddingRight: paddingX
|
|
6049
6165
|
}),
|
|
6050
6166
|
className: cn(
|
|
6051
|
-
"fixed bottom-0 left-0 right-0 w-full z-40",
|
|
6167
|
+
"fixed bottom-0 left-0 right-0 w-full z-40 text-(--toolbar-color) [&_.text-m3-on-surface-variant]:text-current",
|
|
6052
6168
|
"flex items-center h-16",
|
|
6053
6169
|
justifyClass,
|
|
6054
6170
|
SHAPE_CLASSES[shape],
|
|
6055
|
-
"shadow-[0_-1px_3px_rgba(0,0,0,0.1)]
|
|
6171
|
+
isXr ? "backdrop-blur-md border-t border-white/10 shadow-lg" : "shadow-[0_-1px_3px_rgba(0,0,0,0.1)]",
|
|
6172
|
+
"pointer-events-auto",
|
|
6056
6173
|
className
|
|
6057
6174
|
)
|
|
6058
6175
|
}, props), {
|
|
@@ -6099,6 +6216,13 @@ var ToolbarIconButtonTokens = {
|
|
|
6099
6216
|
/** Icon size in dp — larger than standard 24dp to fill the 48dp button properly */
|
|
6100
6217
|
IconSize: 28
|
|
6101
6218
|
};
|
|
6219
|
+
var ToolbarToggleButtonTokens = {
|
|
6220
|
+
Height: 48,
|
|
6221
|
+
MinWidth: 95,
|
|
6222
|
+
IconSize: 24,
|
|
6223
|
+
PaddingX: 16,
|
|
6224
|
+
Gap: 8
|
|
6225
|
+
};
|
|
6102
6226
|
var ALIGNMENT_CLASS = {
|
|
6103
6227
|
start: "justify-start",
|
|
6104
6228
|
center: "justify-center",
|
|
@@ -6157,7 +6281,8 @@ var FloatingToolbarBase = React36.forwardRef(
|
|
|
6157
6281
|
var _b = _a, {
|
|
6158
6282
|
expanded,
|
|
6159
6283
|
orientation = "horizontal",
|
|
6160
|
-
|
|
6284
|
+
variant = "standard",
|
|
6285
|
+
colors: customColors,
|
|
6161
6286
|
shape = "full",
|
|
6162
6287
|
contentPadding,
|
|
6163
6288
|
scrollBehavior,
|
|
@@ -6175,6 +6300,7 @@ var FloatingToolbarBase = React36.forwardRef(
|
|
|
6175
6300
|
} = _b, props = __objRest(_b, [
|
|
6176
6301
|
"expanded",
|
|
6177
6302
|
"orientation",
|
|
6303
|
+
"variant",
|
|
6178
6304
|
"colors",
|
|
6179
6305
|
"shape",
|
|
6180
6306
|
"contentPadding",
|
|
@@ -6191,6 +6317,7 @@ var FloatingToolbarBase = React36.forwardRef(
|
|
|
6191
6317
|
"style",
|
|
6192
6318
|
"aria-label"
|
|
6193
6319
|
]);
|
|
6320
|
+
const colors = getToolbarColors(variant, customColors);
|
|
6194
6321
|
const isHorizontal = orientation === "horizontal";
|
|
6195
6322
|
const isStringPadding = typeof contentPadding === "string";
|
|
6196
6323
|
const cssVars = __spreadValues(__spreadValues({
|
|
@@ -6199,7 +6326,8 @@ var FloatingToolbarBase = React36.forwardRef(
|
|
|
6199
6326
|
"--toolbar-size": `${FloatingToolbarTokens.ContainerHeight}px`
|
|
6200
6327
|
}, isStringPadding ? {} : contentPadding), style);
|
|
6201
6328
|
const isScrolledOff = scrollBehavior && scrollBehavior.offset < 0;
|
|
6202
|
-
const
|
|
6329
|
+
const isXr = variant === "xr";
|
|
6330
|
+
const shadowClass = isXr ? "shadow-lg border border-white/10 backdrop-blur-md" : expanded ? "shadow-md" : "shadow-sm";
|
|
6203
6331
|
const containerShapeClass = shape === "full" ? "rounded-full" : "rounded-2xl";
|
|
6204
6332
|
const leadingVariants = buildSlotVariants(
|
|
6205
6333
|
isHorizontal ? "-100%" : 0,
|
|
@@ -6216,7 +6344,7 @@ var FloatingToolbarBase = React36.forwardRef(
|
|
|
6216
6344
|
scrollBehavior,
|
|
6217
6345
|
disableScrollTranslation
|
|
6218
6346
|
);
|
|
6219
|
-
return /* @__PURE__ */ jsx(ToolbarContext.Provider, { value: { orientation }, children: /* @__PURE__ */ jsx(
|
|
6347
|
+
return /* @__PURE__ */ jsx(ToolbarContext.Provider, { value: { orientation, itemClassName }, children: /* @__PURE__ */ jsx(
|
|
6220
6348
|
m.div,
|
|
6221
6349
|
{
|
|
6222
6350
|
ref,
|
|
@@ -6238,8 +6366,8 @@ var FloatingToolbarBase = React36.forwardRef(
|
|
|
6238
6366
|
color: "var(--toolbar-color)"
|
|
6239
6367
|
}),
|
|
6240
6368
|
className: cn(
|
|
6241
|
-
"flex pointer-events-auto relative",
|
|
6242
|
-
isHorizontal ? "max-w-[90vw] h-(--toolbar-size)" : "max-h-[90vh] w-(--toolbar-size) h-fit",
|
|
6369
|
+
"flex pointer-events-auto relative text-(--toolbar-color) [&_.text-m3-on-surface-variant]:text-current",
|
|
6370
|
+
isHorizontal ? "max-w-[min(90vw,100%)] h-(--toolbar-size)" : "max-h-[min(90vh,100%)] w-(--toolbar-size) h-fit",
|
|
6243
6371
|
containerShapeClass,
|
|
6244
6372
|
shadowClass,
|
|
6245
6373
|
className
|
|
@@ -6256,11 +6384,13 @@ var FloatingToolbarBase = React36.forwardRef(
|
|
|
6256
6384
|
"div",
|
|
6257
6385
|
{
|
|
6258
6386
|
className: cn(
|
|
6259
|
-
"flex items-center
|
|
6387
|
+
"flex items-center min-w-0 min-h-0",
|
|
6260
6388
|
isHorizontal ? "flex-row h-full" : "flex-col w-full",
|
|
6261
|
-
isStringPadding ? contentPadding : isHorizontal ? "px-
|
|
6389
|
+
isStringPadding ? contentPadding : isHorizontal ? "px-2" : "py-2"
|
|
6262
6390
|
),
|
|
6263
|
-
style:
|
|
6391
|
+
style: __spreadValues({
|
|
6392
|
+
gap: itemGap
|
|
6393
|
+
}, isStringPadding ? {} : contentPadding),
|
|
6264
6394
|
children: [
|
|
6265
6395
|
/* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: expanded && startContent && /* @__PURE__ */ jsx(
|
|
6266
6396
|
m.div,
|
|
@@ -6270,9 +6400,10 @@ var FloatingToolbarBase = React36.forwardRef(
|
|
|
6270
6400
|
animate: "visible",
|
|
6271
6401
|
exit: "hidden",
|
|
6272
6402
|
className: cn(
|
|
6273
|
-
"flex shrink-0 overflow-hidden",
|
|
6403
|
+
"flex shrink-0 items-center overflow-hidden",
|
|
6274
6404
|
isHorizontal ? "flex-row" : "flex-col"
|
|
6275
6405
|
),
|
|
6406
|
+
style: { gap: itemGap },
|
|
6276
6407
|
children: processNodes(startContent)
|
|
6277
6408
|
},
|
|
6278
6409
|
"start"
|
|
@@ -6297,9 +6428,10 @@ var FloatingToolbarBase = React36.forwardRef(
|
|
|
6297
6428
|
animate: "visible",
|
|
6298
6429
|
exit: "hidden",
|
|
6299
6430
|
className: cn(
|
|
6300
|
-
"flex shrink-0 overflow-hidden",
|
|
6431
|
+
"flex shrink-0 items-center overflow-hidden",
|
|
6301
6432
|
isHorizontal ? "flex-row" : "flex-col"
|
|
6302
6433
|
),
|
|
6434
|
+
style: { gap: itemGap },
|
|
6303
6435
|
children: processNodes(endContent)
|
|
6304
6436
|
},
|
|
6305
6437
|
"end"
|
|
@@ -6325,7 +6457,8 @@ var FloatingToolbarWithFabBase = React36.forwardRef(
|
|
|
6325
6457
|
var _b = _a, {
|
|
6326
6458
|
expanded,
|
|
6327
6459
|
orientation = "horizontal",
|
|
6328
|
-
|
|
6460
|
+
variant = "standard",
|
|
6461
|
+
colors: customColors,
|
|
6329
6462
|
floatingActionButton,
|
|
6330
6463
|
fabPosition = orientation === "horizontal" ? "end" : "bottom",
|
|
6331
6464
|
animationDuration = 0.3,
|
|
@@ -6336,6 +6469,7 @@ var FloatingToolbarWithFabBase = React36.forwardRef(
|
|
|
6336
6469
|
} = _b, props = __objRest(_b, [
|
|
6337
6470
|
"expanded",
|
|
6338
6471
|
"orientation",
|
|
6472
|
+
"variant",
|
|
6339
6473
|
"colors",
|
|
6340
6474
|
"floatingActionButton",
|
|
6341
6475
|
"fabPosition",
|
|
@@ -6345,6 +6479,7 @@ var FloatingToolbarWithFabBase = React36.forwardRef(
|
|
|
6345
6479
|
"className",
|
|
6346
6480
|
"style"
|
|
6347
6481
|
]);
|
|
6482
|
+
const colors = getToolbarColors(variant, customColors);
|
|
6348
6483
|
const isHorizontal = orientation === "horizontal";
|
|
6349
6484
|
const effectiveExpanded = expanded && (!scrollBehavior || scrollBehavior.isExpanded);
|
|
6350
6485
|
const isFabBefore = fabPosition === "start" || fabPosition === "top";
|
|
@@ -6422,7 +6557,8 @@ var FloatingToolbarWithFabBase = React36.forwardRef(
|
|
|
6422
6557
|
expanded,
|
|
6423
6558
|
colors,
|
|
6424
6559
|
disableScrollTranslation: true,
|
|
6425
|
-
disableLayoutAnimation: true
|
|
6560
|
+
disableLayoutAnimation: true,
|
|
6561
|
+
className: className ? cn("h-full", className) : void 0
|
|
6426
6562
|
}, props)
|
|
6427
6563
|
) : /* @__PURE__ */ jsx(
|
|
6428
6564
|
VerticalFloatingToolbar,
|
|
@@ -6430,7 +6566,8 @@ var FloatingToolbarWithFabBase = React36.forwardRef(
|
|
|
6430
6566
|
expanded,
|
|
6431
6567
|
colors,
|
|
6432
6568
|
disableScrollTranslation: true,
|
|
6433
|
-
disableLayoutAnimation: true
|
|
6569
|
+
disableLayoutAnimation: true,
|
|
6570
|
+
className: className ? cn("w-full", className) : void 0
|
|
6434
6571
|
}, props)
|
|
6435
6572
|
)
|
|
6436
6573
|
},
|
|
@@ -6460,7 +6597,7 @@ var ToolbarDivider = ({
|
|
|
6460
6597
|
"aria-orientation": isHorizontalToolbar ? "vertical" : "horizontal",
|
|
6461
6598
|
className: cn(
|
|
6462
6599
|
"shrink-0 bg-current opacity-30 border-none",
|
|
6463
|
-
isHorizontalToolbar ? "w-px h-8 self-center mx-
|
|
6600
|
+
isHorizontalToolbar ? "w-px h-8 self-center mx-1" : "h-px w-8 self-center my-1",
|
|
6464
6601
|
className
|
|
6465
6602
|
),
|
|
6466
6603
|
style: {
|
|
@@ -6483,20 +6620,47 @@ var VARIANT_TO_COLOR_STYLE = {
|
|
|
6483
6620
|
};
|
|
6484
6621
|
var ToolbarIconButton = React36.forwardRef(
|
|
6485
6622
|
(_a, ref) => {
|
|
6486
|
-
var _b = _a, {
|
|
6623
|
+
var _b = _a, {
|
|
6624
|
+
emphasis = "standard",
|
|
6625
|
+
toolbarSize = "default",
|
|
6626
|
+
selected,
|
|
6627
|
+
asChild,
|
|
6628
|
+
className
|
|
6629
|
+
} = _b, props = __objRest(_b, [
|
|
6630
|
+
"emphasis",
|
|
6631
|
+
"toolbarSize",
|
|
6632
|
+
"selected",
|
|
6633
|
+
"asChild",
|
|
6634
|
+
"className"
|
|
6635
|
+
]);
|
|
6636
|
+
const context = useToolbarContext();
|
|
6487
6637
|
const widthClass = TOOLBAR_ICON_BUTTON_WIDTH[toolbarSize];
|
|
6488
6638
|
const colorStyle = VARIANT_TO_COLOR_STYLE[emphasis];
|
|
6639
|
+
const iconButtonProps = selected !== void 0 ? {
|
|
6640
|
+
variant: "toggle",
|
|
6641
|
+
selected: Boolean(selected)
|
|
6642
|
+
} : {
|
|
6643
|
+
variant: "default"
|
|
6644
|
+
};
|
|
6489
6645
|
return /* @__PURE__ */ jsx(
|
|
6490
6646
|
IconButton,
|
|
6491
|
-
__spreadValues({
|
|
6647
|
+
__spreadValues(__spreadProps(__spreadValues({
|
|
6492
6648
|
ref,
|
|
6493
|
-
|
|
6649
|
+
asChild,
|
|
6494
6650
|
colorStyle,
|
|
6495
6651
|
size: "md",
|
|
6496
6652
|
shape: "round",
|
|
6497
|
-
iconSize: ToolbarIconButtonTokens.IconSize
|
|
6498
|
-
|
|
6499
|
-
|
|
6653
|
+
iconSize: ToolbarIconButtonTokens.IconSize
|
|
6654
|
+
}, iconButtonProps), {
|
|
6655
|
+
className: cn(
|
|
6656
|
+
"h-[48px]",
|
|
6657
|
+
widthClass,
|
|
6658
|
+
emphasis === "standard" && !selected && "text-current hover:bg-current/8 active:bg-current/12",
|
|
6659
|
+
emphasis === "standard" && selected && "bg-current/16 text-current hover:bg-current/20 active:bg-current/24",
|
|
6660
|
+
context == null ? void 0 : context.itemClassName,
|
|
6661
|
+
className
|
|
6662
|
+
)
|
|
6663
|
+
}), props)
|
|
6500
6664
|
);
|
|
6501
6665
|
}
|
|
6502
6666
|
);
|
|
@@ -6567,7 +6731,196 @@ function useFloatingToolbarScrollBehavior(options = {}) {
|
|
|
6567
6731
|
exitDirection
|
|
6568
6732
|
};
|
|
6569
6733
|
}
|
|
6734
|
+
var MOTION_PROP_KEYS = [
|
|
6735
|
+
"animate",
|
|
6736
|
+
"exit",
|
|
6737
|
+
"initial",
|
|
6738
|
+
"transition",
|
|
6739
|
+
"variants",
|
|
6740
|
+
"whileHover",
|
|
6741
|
+
"whileTap",
|
|
6742
|
+
"whileFocus",
|
|
6743
|
+
"whileDrag",
|
|
6744
|
+
"whileInView",
|
|
6745
|
+
"onAnimationStart",
|
|
6746
|
+
"onAnimationComplete",
|
|
6747
|
+
"onUpdate",
|
|
6748
|
+
"onDragStart",
|
|
6749
|
+
"onDragEnd",
|
|
6750
|
+
"onDrag",
|
|
6751
|
+
"onDirectionLock",
|
|
6752
|
+
"onDragTransitionEnd",
|
|
6753
|
+
"layout",
|
|
6754
|
+
"layoutId",
|
|
6755
|
+
"onLayoutAnimationComplete"
|
|
6756
|
+
];
|
|
6757
|
+
var ToolbarToggleButton = React36.forwardRef(
|
|
6758
|
+
(_a, ref) => {
|
|
6759
|
+
var _b = _a, {
|
|
6760
|
+
emphasis = "standard",
|
|
6761
|
+
selected = false,
|
|
6762
|
+
icon,
|
|
6763
|
+
children,
|
|
6764
|
+
pressScale = 0.95,
|
|
6765
|
+
pressBounceOffset = 6,
|
|
6766
|
+
ripple = true,
|
|
6767
|
+
asChild = false,
|
|
6768
|
+
className,
|
|
6769
|
+
type = "button",
|
|
6770
|
+
disabled,
|
|
6771
|
+
onPointerDown: onPointerDownProp
|
|
6772
|
+
} = _b, props = __objRest(_b, [
|
|
6773
|
+
"emphasis",
|
|
6774
|
+
"selected",
|
|
6775
|
+
"icon",
|
|
6776
|
+
"children",
|
|
6777
|
+
"pressScale",
|
|
6778
|
+
"pressBounceOffset",
|
|
6779
|
+
"ripple",
|
|
6780
|
+
"asChild",
|
|
6781
|
+
"className",
|
|
6782
|
+
"type",
|
|
6783
|
+
"disabled",
|
|
6784
|
+
"onPointerDown"
|
|
6785
|
+
]);
|
|
6786
|
+
const context = useToolbarContext();
|
|
6787
|
+
const {
|
|
6788
|
+
ripples,
|
|
6789
|
+
onPointerDown: handleRipplePointerDown,
|
|
6790
|
+
removeRipple
|
|
6791
|
+
} = useRippleState({
|
|
6792
|
+
disabled: Boolean(disabled) || !ripple
|
|
6793
|
+
});
|
|
6794
|
+
const handlePointerDown = React36.useCallback(
|
|
6795
|
+
(e) => {
|
|
6796
|
+
if (!disabled && ripple) {
|
|
6797
|
+
handleRipplePointerDown(e);
|
|
6798
|
+
}
|
|
6799
|
+
onPointerDownProp == null ? void 0 : onPointerDownProp(e);
|
|
6800
|
+
},
|
|
6801
|
+
[disabled, ripple, handleRipplePointerDown, onPointerDownProp]
|
|
6802
|
+
);
|
|
6803
|
+
const baseClasses = "relative overflow-hidden inline-flex items-center justify-center min-w-[95px] h-[48px] px-4 rounded-full text-sm font-medium transition-colors select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current/40 disabled:pointer-events-none disabled:opacity-38";
|
|
6804
|
+
const variantClasses = {
|
|
6805
|
+
standard: selected ? "bg-current/16 text-current hover:bg-current/20 active:bg-current/24" : "bg-transparent text-current hover:bg-current/8 active:bg-current/12",
|
|
6806
|
+
tonal: selected ? "bg-m3-secondary-container text-m3-on-secondary-container hover:shadow-sm" : "bg-m3-surface-container-high text-m3-on-surface hover:bg-m3-surface-container-highest",
|
|
6807
|
+
filled: selected ? "bg-m3-primary text-m3-on-primary hover:shadow-sm" : "bg-m3-surface-container-highest text-m3-on-surface hover:bg-m3-surface-container-high"
|
|
6808
|
+
};
|
|
6809
|
+
const combinedClassName = cn(
|
|
6810
|
+
baseClasses,
|
|
6811
|
+
variantClasses[emphasis],
|
|
6812
|
+
context == null ? void 0 : context.itemClassName,
|
|
6813
|
+
className
|
|
6814
|
+
);
|
|
6815
|
+
const whileTapConfig = React36.useMemo(
|
|
6816
|
+
() => ({
|
|
6817
|
+
scale: pressScale,
|
|
6818
|
+
x: pressBounceOffset ? [
|
|
6819
|
+
0,
|
|
6820
|
+
-pressBounceOffset,
|
|
6821
|
+
pressBounceOffset,
|
|
6822
|
+
-pressBounceOffset / 2,
|
|
6823
|
+
pressBounceOffset / 2,
|
|
6824
|
+
0
|
|
6825
|
+
] : 0
|
|
6826
|
+
}),
|
|
6827
|
+
[pressScale, pressBounceOffset]
|
|
6828
|
+
);
|
|
6829
|
+
const transitionConfig = React36.useMemo(
|
|
6830
|
+
() => ({
|
|
6831
|
+
scale: FAST_SPATIAL_SPRING,
|
|
6832
|
+
x: {
|
|
6833
|
+
duration: 0.35,
|
|
6834
|
+
ease: "easeInOut"
|
|
6835
|
+
}
|
|
6836
|
+
}),
|
|
6837
|
+
[]
|
|
6838
|
+
);
|
|
6839
|
+
const mainContent = /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center justify-center h-full gap-2", children: [
|
|
6840
|
+
icon && /* @__PURE__ */ jsx(
|
|
6841
|
+
"span",
|
|
6842
|
+
{
|
|
6843
|
+
className: "shrink-0 inline-flex items-center justify-center",
|
|
6844
|
+
style: {
|
|
6845
|
+
width: ToolbarToggleButtonTokens.IconSize,
|
|
6846
|
+
height: ToolbarToggleButtonTokens.IconSize
|
|
6847
|
+
},
|
|
6848
|
+
children: icon
|
|
6849
|
+
}
|
|
6850
|
+
),
|
|
6851
|
+
children && (typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx("span", { children }) : children)
|
|
6852
|
+
] });
|
|
6853
|
+
if (asChild) {
|
|
6854
|
+
const child = React36.Children.only(children);
|
|
6855
|
+
const childContent = child.props.children;
|
|
6856
|
+
const innerChildContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6857
|
+
ripple && /* @__PURE__ */ jsx(
|
|
6858
|
+
Ripple,
|
|
6859
|
+
{
|
|
6860
|
+
ripples,
|
|
6861
|
+
onRippleDone: removeRipple,
|
|
6862
|
+
disabled
|
|
6863
|
+
}
|
|
6864
|
+
),
|
|
6865
|
+
/* @__PURE__ */ jsx("span", { className: "inline-flex items-center justify-center h-full gap-2", children: icon ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6866
|
+
/* @__PURE__ */ jsx(
|
|
6867
|
+
"span",
|
|
6868
|
+
{
|
|
6869
|
+
className: "shrink-0 inline-flex items-center justify-center",
|
|
6870
|
+
style: {
|
|
6871
|
+
width: ToolbarToggleButtonTokens.IconSize,
|
|
6872
|
+
height: ToolbarToggleButtonTokens.IconSize
|
|
6873
|
+
},
|
|
6874
|
+
children: icon
|
|
6875
|
+
}
|
|
6876
|
+
),
|
|
6877
|
+
typeof childContent === "string" || typeof childContent === "number" ? /* @__PURE__ */ jsx("span", { children: childContent }) : childContent
|
|
6878
|
+
] }) : childContent })
|
|
6879
|
+
] });
|
|
6880
|
+
const strippedProps = __spreadValues({}, props);
|
|
6881
|
+
for (const key of MOTION_PROP_KEYS) delete strippedProps[key];
|
|
6882
|
+
delete strippedProps.children;
|
|
6883
|
+
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
|
|
6884
|
+
Slot,
|
|
6885
|
+
__spreadProps(__spreadValues({
|
|
6886
|
+
ref,
|
|
6887
|
+
"aria-pressed": selected,
|
|
6888
|
+
className: combinedClassName,
|
|
6889
|
+
onPointerDown: handlePointerDown
|
|
6890
|
+
}, strippedProps), {
|
|
6891
|
+
children: React36.cloneElement(child, { children: innerChildContent })
|
|
6892
|
+
})
|
|
6893
|
+
) });
|
|
6894
|
+
}
|
|
6895
|
+
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
|
|
6896
|
+
m.button,
|
|
6897
|
+
__spreadProps(__spreadValues({
|
|
6898
|
+
ref,
|
|
6899
|
+
type,
|
|
6900
|
+
"aria-pressed": selected,
|
|
6901
|
+
disabled,
|
|
6902
|
+
whileTap: whileTapConfig,
|
|
6903
|
+
transition: transitionConfig,
|
|
6904
|
+
onPointerDown: handlePointerDown,
|
|
6905
|
+
className: combinedClassName
|
|
6906
|
+
}, props), {
|
|
6907
|
+
children: [
|
|
6908
|
+
ripple && /* @__PURE__ */ jsx(
|
|
6909
|
+
Ripple,
|
|
6910
|
+
{
|
|
6911
|
+
ripples,
|
|
6912
|
+
onRippleDone: removeRipple,
|
|
6913
|
+
disabled
|
|
6914
|
+
}
|
|
6915
|
+
),
|
|
6916
|
+
mainContent
|
|
6917
|
+
]
|
|
6918
|
+
})
|
|
6919
|
+
) });
|
|
6920
|
+
}
|
|
6921
|
+
);
|
|
6922
|
+
ToolbarToggleButton.displayName = "ToolbarToggleButton";
|
|
6570
6923
|
|
|
6571
|
-
export { APP_BAR_BOTTOM_SPRING, APP_BAR_COLORS, APP_BAR_COLOR_TRANSITION, APP_BAR_ENTER_ALWAYS_SPRING, APP_BAR_TITLE_FADE, AppBarColumn, AppBarOverflowIndicator, AppBarRow, AppBarTokens, BottomAppBar, BottomDockedToolbar, CHECK_ICON_VARIANTS, ContextMenu, ContextMenuContent, ContextMenuTrigger, DIVIDER_COLOR, DIVIDER_PADDING, DockedToolbar, FAST_EFFECTS_TRANSITION, FAST_SPATIAL_SPRING, GROUP_SHAPES, HorizontalFloatingToolbar, HorizontalFloatingToolbarWithFab, ITEM_SHAPE_CLASSES, LargeFlexibleAppBar, MENU_CHECK_ICON_SIZE, MENU_CONTAINER_VARIANTS, MENU_GROUP_GAP, MENU_ICON_SIZE, MENU_ITEM_MIN_HEIGHT, MENU_MAX_WIDTH, MENU_MIN_WIDTH, MediumFlexibleAppBar, Menu, MenuContent, MenuDivider, MenuGroup, MenuItem, MenuProvider, MenuTrigger, NavigationBar, NavigationBarComponent, NavigationBarItem, NavigationRail, NavigationRailItem, SEARCH_BAR_EXIT_SPRING, SEARCH_BAR_EXPAND_SPRING, SEARCH_COLORS, SEARCH_DOCKED_REVEAL_SPRING, SEARCH_FULLSCREEN_SPRING, SEARCH_TYPOGRAPHY, SEARCH_VIEW_SPRING, STANDARD_COLORS, SUBMENU_CONTAINER_VARIANTS, Search, SearchAppBar, SearchBar, SearchTokens, SearchView, SearchViewContainer, SearchViewDocked, SearchViewFullScreen, SmallAppBar, SubMenu, Tab, Tabs, TabsColors, TabsContent, TabsList, TabsTokens, ToolbarDivider, ToolbarDividerTokens, ToolbarIconButton, ToolbarIconButtonTokens, VIBRANT_COLORS, VerticalFloatingToolbar, VerticalFloatingToolbarWithFab, VerticalMenu, VerticalMenuContent, VerticalMenuDivider, VerticalMenuGroup, appBarTypography, standardFloatingToolbarColors, useAppBarScroll, useFloatingToolbarScrollBehavior, useMenuContext, useSearch, useSearchKeyboard, vibrantFloatingToolbarColors };
|
|
6924
|
+
export { APP_BAR_BOTTOM_SPRING, APP_BAR_COLORS, APP_BAR_COLOR_TRANSITION, APP_BAR_ENTER_ALWAYS_SPRING, APP_BAR_TITLE_FADE, AppBarColumn, AppBarOverflowIndicator, AppBarRow, AppBarTokens, BottomAppBar, BottomDockedToolbar, CHECK_ICON_VARIANTS, ContextMenu, ContextMenuContent, ContextMenuTrigger, DIVIDER_COLOR, DIVIDER_PADDING, DockedToolbar, FAST_EFFECTS_TRANSITION, FAST_SPATIAL_SPRING, GROUP_SHAPES, HorizontalFloatingToolbar, HorizontalFloatingToolbarWithFab, ITEM_SHAPE_CLASSES, LargeFlexibleAppBar, MENU_CHECK_ICON_SIZE, MENU_CONTAINER_VARIANTS, MENU_GROUP_GAP, MENU_ICON_SIZE, MENU_ITEM_MIN_HEIGHT, MENU_MAX_WIDTH, MENU_MIN_WIDTH, MediumFlexibleAppBar, Menu, MenuContent, MenuDivider, MenuGroup, MenuItem, MenuProvider, MenuTrigger, NavigationBar, NavigationBarComponent, NavigationBarItem, NavigationRail, NavigationRailItem, SEARCH_BAR_EXIT_SPRING, SEARCH_BAR_EXPAND_SPRING, SEARCH_COLORS, SEARCH_DOCKED_REVEAL_SPRING, SEARCH_FULLSCREEN_SPRING, SEARCH_TYPOGRAPHY, SEARCH_VIEW_SPRING, STANDARD_COLORS, SUBMENU_CONTAINER_VARIANTS, Search, SearchAppBar, SearchBar, SearchTokens, SearchView, SearchViewContainer, SearchViewDocked, SearchViewFullScreen, SmallAppBar, SubMenu, Tab, Tabs, TabsColors, TabsContent, TabsList, TabsTokens, ToolbarDivider, ToolbarDividerTokens, ToolbarIconButton, ToolbarIconButtonTokens, ToolbarToggleButton, ToolbarToggleButtonTokens, VIBRANT_COLORS, VerticalFloatingToolbar, VerticalFloatingToolbarWithFab, VerticalMenu, VerticalMenuContent, VerticalMenuDivider, VerticalMenuGroup, appBarTypography, getToolbarColors, standardFloatingToolbarColors, surfaceContainerHighFloatingToolbarColors, surfaceContainerHighestFloatingToolbarColors, tertiaryContainerFloatingToolbarColors, useAppBarScroll, useFloatingToolbarScrollBehavior, useMenuContext, useSearch, useSearchKeyboard, vibrantFloatingToolbarColors, xrFloatingToolbarColors };
|
|
6572
6925
|
//# sourceMappingURL=navigation.mjs.map
|
|
6573
6926
|
//# sourceMappingURL=navigation.mjs.map
|