@bug-on/m3-expressive 1.3.6 → 1.3.7
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 +6 -0
- package/dist/buttons.d.mts +3 -3
- package/dist/buttons.d.ts +3 -3
- package/dist/buttons.js +110 -91
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +110 -91
- package/dist/buttons.mjs.map +1 -1
- package/dist/{core-Cckt8qEm.d.ts → core-DamhB5Yd.d.ts} +1 -1
- package/dist/{core-DDfG4pym.d.mts → core-Wsfqn9_N.d.mts} +1 -1
- package/dist/core.d.mts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +1 -1
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +1 -1
- package/dist/core.mjs.map +1 -1
- package/dist/{fading-blur-mask--uZbBKLj.d.ts → fading-blur-mask-CX-bwjNU.d.mts} +6 -1
- package/dist/{fading-blur-mask--uZbBKLj.d.mts → fading-blur-mask-D57UMguz.d.ts} +6 -1
- package/dist/feedback.d.mts +17 -5
- package/dist/feedback.d.ts +17 -5
- package/dist/feedback.js +1 -1
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs +1 -1
- package/dist/feedback.mjs.map +1 -1
- package/dist/forms.d.mts +3 -3
- package/dist/forms.d.ts +3 -3
- package/dist/{icon-button-CxyJv7UV.d.mts → icon-button-BpX9_fwZ.d.mts} +1 -1
- package/dist/{icon-button-Di8VX6ou.d.ts → icon-button-DFXp9hze.d.ts} +1 -1
- package/dist/index.d.mts +9 -8
- package/dist/index.d.ts +9 -8
- package/dist/index.js +1098 -976
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +924 -802
- package/dist/index.mjs.map +1 -1
- package/dist/layout.d.mts +92 -23
- package/dist/layout.d.ts +92 -23
- package/dist/layout.js +118 -13
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +118 -15
- package/dist/layout.mjs.map +1 -1
- package/dist/md3-xBl4wgND.d.mts +44 -0
- package/dist/md3-xBl4wgND.d.ts +44 -0
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.js +1 -1
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +1 -1
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.d.mts +4 -4
- package/dist/overlays.d.ts +4 -4
- package/dist/overlays.js +1 -1
- package/dist/overlays.js.map +1 -1
- package/dist/overlays.mjs +1 -1
- package/dist/overlays.mjs.map +1 -1
- package/dist/pickers.js +1 -1
- package/dist/pickers.js.map +1 -1
- package/dist/pickers.mjs +1 -1
- package/dist/pickers.mjs.map +1 -1
- package/dist/shapes.d.mts +9 -2
- package/dist/shapes.d.ts +9 -2
- package/dist/{side-sheet-modal-Cw4vemKx.d.ts → side-sheet-modal-BfdgYjd3.d.ts} +1 -1
- package/dist/{side-sheet-modal-BycxrabB.d.mts → side-sheet-modal-kLfHINFZ.d.mts} +1 -1
- package/dist/{split-button-trailing-uncheckable-CGzk7KcG.d.ts → split-button-trailing-uncheckable-BpyIlOdn.d.ts} +7 -3
- package/dist/{split-button-trailing-uncheckable-gAz6OAIi.d.mts → split-button-trailing-uncheckable-CpT8iPpr.d.mts} +7 -3
- package/dist/{text-field-C0VQLp8Y.d.ts → text-field-Ct-LT_2T.d.ts} +1 -1
- package/dist/{text-field-B1fLh5Sh.d.mts → text-field-D5xiGn-q.d.mts} +1 -1
- package/llms-full.txt +18 -3
- package/llms.txt +4 -1
- package/package.json +1 -1
- package/dist/md3-BQhRygSi.d.mts +0 -31
- package/dist/md3-BQhRygSi.d.ts +0 -31
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
2
|
+
import * as React33 from 'react';
|
|
3
3
|
import { createContext, forwardRef, useState, useRef, useCallback, useMemo, useEffect, useLayoutEffect, useReducer, useContext, useId, cloneElement, createElement } from 'react';
|
|
4
4
|
import { hexFromArgb, Hct, SchemeExpressive, SchemeNeutral, SchemeMonochrome, SchemeContent, SchemeFidelity, SchemeVibrant, SchemeTonalSpot } from '@material/material-color-utilities';
|
|
5
5
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -8,7 +8,7 @@ import { clsx } from 'clsx';
|
|
|
8
8
|
import { twMerge } from 'tailwind-merge';
|
|
9
9
|
import * as RxContextMenu from '@radix-ui/react-context-menu';
|
|
10
10
|
import * as RadixScrollArea from '@radix-ui/react-scroll-area';
|
|
11
|
-
import { cornerRadius } from '@bug-on/m3-tokens';
|
|
11
|
+
import { cornerRadius, framerSprings } from '@bug-on/m3-tokens';
|
|
12
12
|
import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
|
|
13
13
|
import { Slot } from '@radix-ui/react-slot';
|
|
14
14
|
import { cva } from 'class-variance-authority';
|
|
@@ -3416,7 +3416,7 @@ function AppBarItemButton({ item }) {
|
|
|
3416
3416
|
}
|
|
3417
3417
|
);
|
|
3418
3418
|
}
|
|
3419
|
-
var ScrollArea =
|
|
3419
|
+
var ScrollArea = React33.forwardRef(
|
|
3420
3420
|
(_a, ref) => {
|
|
3421
3421
|
var _b = _a, {
|
|
3422
3422
|
className,
|
|
@@ -3437,15 +3437,15 @@ var ScrollArea = React67.forwardRef(
|
|
|
3437
3437
|
"viewportRef",
|
|
3438
3438
|
"viewportProps"
|
|
3439
3439
|
]);
|
|
3440
|
-
const [isTouchDevice, setIsTouchDevice] =
|
|
3441
|
-
|
|
3440
|
+
const [isTouchDevice, setIsTouchDevice] = React33.useState(false);
|
|
3441
|
+
React33.useEffect(() => {
|
|
3442
3442
|
if (typeof window !== "undefined") {
|
|
3443
3443
|
setIsTouchDevice(
|
|
3444
3444
|
"ontouchstart" in window || navigator.maxTouchPoints > 0
|
|
3445
3445
|
);
|
|
3446
3446
|
}
|
|
3447
3447
|
}, []);
|
|
3448
|
-
const resolvedType =
|
|
3448
|
+
const resolvedType = React33.useMemo(() => {
|
|
3449
3449
|
if (type === "hover" && isTouchDevice) {
|
|
3450
3450
|
return "scroll";
|
|
3451
3451
|
}
|
|
@@ -3496,7 +3496,7 @@ var ScrollArea = React67.forwardRef(
|
|
|
3496
3496
|
}
|
|
3497
3497
|
);
|
|
3498
3498
|
ScrollArea.displayName = "ScrollArea";
|
|
3499
|
-
var ScrollAreaScrollbar =
|
|
3499
|
+
var ScrollAreaScrollbar = React33.forwardRef((_a, ref) => {
|
|
3500
3500
|
var _b = _a, { className, orientation = "vertical" } = _b, props = __objRest(_b, ["className", "orientation"]);
|
|
3501
3501
|
return /* @__PURE__ */ jsx(
|
|
3502
3502
|
RadixScrollArea.Scrollbar,
|
|
@@ -3526,7 +3526,7 @@ var ScrollAreaScrollbar = React67.forwardRef((_a, ref) => {
|
|
|
3526
3526
|
);
|
|
3527
3527
|
});
|
|
3528
3528
|
ScrollAreaScrollbar.displayName = RadixScrollArea.Scrollbar.displayName;
|
|
3529
|
-
var ScrollAreaCorner =
|
|
3529
|
+
var ScrollAreaCorner = React33.forwardRef((_a, ref) => {
|
|
3530
3530
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3531
3531
|
return /* @__PURE__ */ jsx(
|
|
3532
3532
|
RadixScrollArea.Corner,
|
|
@@ -3595,7 +3595,7 @@ var SUBMENU_CONTAINER_VARIANTS = {
|
|
|
3595
3595
|
transition: FAST_EFFECTS_TRANSITION
|
|
3596
3596
|
}
|
|
3597
3597
|
};
|
|
3598
|
-
var MenuContext =
|
|
3598
|
+
var MenuContext = React33.createContext({
|
|
3599
3599
|
variant: "baseline",
|
|
3600
3600
|
colorVariant: "standard",
|
|
3601
3601
|
density: 0,
|
|
@@ -3613,7 +3613,7 @@ function MenuProvider({
|
|
|
3613
3613
|
onOpenChange,
|
|
3614
3614
|
children
|
|
3615
3615
|
}) {
|
|
3616
|
-
const value =
|
|
3616
|
+
const value = React33.useMemo(
|
|
3617
3617
|
() => ({
|
|
3618
3618
|
variant,
|
|
3619
3619
|
colorVariant,
|
|
@@ -3627,8 +3627,8 @@ function MenuProvider({
|
|
|
3627
3627
|
return /* @__PURE__ */ jsx(MenuContext.Provider, { value, children });
|
|
3628
3628
|
}
|
|
3629
3629
|
function useMenuContext() {
|
|
3630
|
-
const ctx =
|
|
3631
|
-
return
|
|
3630
|
+
const ctx = React33.useContext(MenuContext);
|
|
3631
|
+
return React33.useMemo(
|
|
3632
3632
|
() => Object.assign(ctx, {
|
|
3633
3633
|
get isStatic() {
|
|
3634
3634
|
return ctx.menuPrimitive === "static";
|
|
@@ -3748,10 +3748,10 @@ var VIBRANT_COLORS = {
|
|
|
3748
3748
|
var DIVIDER_PADDING = "mx-3 my-0.5";
|
|
3749
3749
|
var DIVIDER_COLOR = "bg-m3-outline-variant";
|
|
3750
3750
|
function flattenChildren(nodes) {
|
|
3751
|
-
return
|
|
3751
|
+
return React33.Children.toArray(nodes).reduce(
|
|
3752
3752
|
(acc, child) => {
|
|
3753
|
-
if (!
|
|
3754
|
-
if (child.type ===
|
|
3753
|
+
if (!React33.isValidElement(child)) return acc;
|
|
3754
|
+
if (child.type === React33.Fragment) {
|
|
3755
3755
|
return acc.concat(
|
|
3756
3756
|
flattenChildren(
|
|
3757
3757
|
child.props.children
|
|
@@ -3769,7 +3769,7 @@ function ContextMenu({
|
|
|
3769
3769
|
variant = "baseline",
|
|
3770
3770
|
colorVariant = "standard"
|
|
3771
3771
|
}) {
|
|
3772
|
-
const [open, setOpen] =
|
|
3772
|
+
const [open, setOpen] = React33.useState(false);
|
|
3773
3773
|
return /* @__PURE__ */ jsx(
|
|
3774
3774
|
MenuProvider,
|
|
3775
3775
|
{
|
|
@@ -3783,12 +3783,12 @@ function ContextMenu({
|
|
|
3783
3783
|
);
|
|
3784
3784
|
}
|
|
3785
3785
|
ContextMenu.displayName = "ContextMenu";
|
|
3786
|
-
var ContextMenuTrigger =
|
|
3786
|
+
var ContextMenuTrigger = React33.forwardRef((_a, ref) => {
|
|
3787
3787
|
var _b = _a, { children, asChild = true } = _b, props = __objRest(_b, ["children", "asChild"]);
|
|
3788
3788
|
return /* @__PURE__ */ jsx(RxContextMenu.Trigger, __spreadProps(__spreadValues({ ref, asChild }, props), { children }));
|
|
3789
3789
|
});
|
|
3790
3790
|
ContextMenuTrigger.displayName = "ContextMenuTrigger";
|
|
3791
|
-
var ContextMenuContent =
|
|
3791
|
+
var ContextMenuContent = React33.forwardRef(
|
|
3792
3792
|
(_a, ref) => {
|
|
3793
3793
|
var _b = _a, {
|
|
3794
3794
|
children,
|
|
@@ -3817,7 +3817,7 @@ var ContextMenuContent = React67.forwardRef(
|
|
|
3817
3817
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
3818
3818
|
const colors = variant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
3819
3819
|
const isExpressiveGap = variant === "expressive" && separatorStyle === "gap";
|
|
3820
|
-
const setViewportNode =
|
|
3820
|
+
const setViewportNode = React33.useCallback(
|
|
3821
3821
|
(node) => {
|
|
3822
3822
|
if (typeof viewportRef === "function") {
|
|
3823
3823
|
viewportRef(node);
|
|
@@ -3828,7 +3828,7 @@ var ContextMenuContent = React67.forwardRef(
|
|
|
3828
3828
|
},
|
|
3829
3829
|
[viewportRef, onViewportRef]
|
|
3830
3830
|
);
|
|
3831
|
-
const containerClassName =
|
|
3831
|
+
const containerClassName = React33.useMemo(
|
|
3832
3832
|
() => variant === "expressive" ? cn(
|
|
3833
3833
|
"z-50 flex flex-col w-full",
|
|
3834
3834
|
MENU_MIN_WIDTH,
|
|
@@ -3855,12 +3855,12 @@ var ContextMenuContent = React67.forwardRef(
|
|
|
3855
3855
|
),
|
|
3856
3856
|
[variant, isExpressiveGap, hasOverflow, className, colors.containerBg]
|
|
3857
3857
|
);
|
|
3858
|
-
const renderedChildren =
|
|
3858
|
+
const renderedChildren = React33.useMemo(() => {
|
|
3859
3859
|
if (variant !== "expressive") return children;
|
|
3860
3860
|
const validChildren = flattenChildren(children);
|
|
3861
3861
|
const groupCount = validChildren.length;
|
|
3862
3862
|
const enhanced = validChildren.map(
|
|
3863
|
-
(child, i) =>
|
|
3863
|
+
(child, i) => React33.cloneElement(
|
|
3864
3864
|
child,
|
|
3865
3865
|
{ index: i, count: groupCount, isGapVariant: isExpressiveGap }
|
|
3866
3866
|
)
|
|
@@ -3929,12 +3929,12 @@ function Menu(_a) {
|
|
|
3929
3929
|
]);
|
|
3930
3930
|
var _a2;
|
|
3931
3931
|
const resolvedVariant = (_a2 = variant != null ? variant : menuVariant) != null ? _a2 : "baseline";
|
|
3932
|
-
const [internalOpen, setInternalOpen] =
|
|
3932
|
+
const [internalOpen, setInternalOpen] = React33.useState(
|
|
3933
3933
|
() => defaultOpen != null ? defaultOpen : false
|
|
3934
3934
|
);
|
|
3935
3935
|
const isControlled = controlledOpen !== void 0;
|
|
3936
3936
|
const open = isControlled ? controlledOpen : internalOpen;
|
|
3937
|
-
const handleOpenChange =
|
|
3937
|
+
const handleOpenChange = React33.useCallback(
|
|
3938
3938
|
(next) => {
|
|
3939
3939
|
if (!isControlled) setInternalOpen(next);
|
|
3940
3940
|
controlledOnOpenChange == null ? void 0 : controlledOnOpenChange(next);
|
|
@@ -3962,12 +3962,12 @@ function Menu(_a) {
|
|
|
3962
3962
|
);
|
|
3963
3963
|
}
|
|
3964
3964
|
Menu.displayName = "Menu";
|
|
3965
|
-
var MenuTrigger =
|
|
3965
|
+
var MenuTrigger = React33.forwardRef((_a, ref) => {
|
|
3966
3966
|
var _b = _a, { children, asChild = true } = _b, props = __objRest(_b, ["children", "asChild"]);
|
|
3967
3967
|
return /* @__PURE__ */ jsx(DropdownMenu.Trigger, __spreadProps(__spreadValues({ ref, asChild }, props), { children }));
|
|
3968
3968
|
});
|
|
3969
3969
|
MenuTrigger.displayName = "MenuTrigger";
|
|
3970
|
-
var MenuContent =
|
|
3970
|
+
var MenuContent = React33.forwardRef(
|
|
3971
3971
|
(_a, ref) => {
|
|
3972
3972
|
var _b = _a, {
|
|
3973
3973
|
children,
|
|
@@ -4004,7 +4004,7 @@ var MenuContent = React67.forwardRef(
|
|
|
4004
4004
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
4005
4005
|
const colors = variant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
4006
4006
|
const isExpressiveGap = variant === "expressive" && separatorStyle === "gap";
|
|
4007
|
-
const setViewportNode =
|
|
4007
|
+
const setViewportNode = React33.useCallback(
|
|
4008
4008
|
(node) => {
|
|
4009
4009
|
if (typeof viewportRef === "function") {
|
|
4010
4010
|
viewportRef(node);
|
|
@@ -4015,7 +4015,7 @@ var MenuContent = React67.forwardRef(
|
|
|
4015
4015
|
},
|
|
4016
4016
|
[viewportRef, onViewportRef]
|
|
4017
4017
|
);
|
|
4018
|
-
const containerClassName =
|
|
4018
|
+
const containerClassName = React33.useMemo(() => {
|
|
4019
4019
|
const widthClass = matchTriggerWidth ? "w-[var(--radix-dropdown-menu-trigger-width)]" : cn(MENU_MIN_WIDTH, MENU_MAX_WIDTH);
|
|
4020
4020
|
return variant === "expressive" ? cn(
|
|
4021
4021
|
"z-50 flex flex-col",
|
|
@@ -4048,7 +4048,7 @@ var MenuContent = React67.forwardRef(
|
|
|
4048
4048
|
className,
|
|
4049
4049
|
colors.containerBg
|
|
4050
4050
|
]);
|
|
4051
|
-
const renderedChildren =
|
|
4051
|
+
const renderedChildren = React33.useMemo(() => {
|
|
4052
4052
|
if (variant !== "expressive") return children;
|
|
4053
4053
|
const validChildren = flattenChildren(children);
|
|
4054
4054
|
const groupCount = validChildren.length;
|
|
@@ -4057,7 +4057,7 @@ var MenuContent = React67.forwardRef(
|
|
|
4057
4057
|
if (typeof child.type === "string") return child;
|
|
4058
4058
|
const defaultItemPosition = groupCount === 1 ? "standalone" : i === 0 ? "leading" : i === groupCount - 1 ? "trailing" : "middle";
|
|
4059
4059
|
const itemPosition = (_a2 = child.props.itemPosition) != null ? _a2 : defaultItemPosition;
|
|
4060
|
-
return
|
|
4060
|
+
return React33.cloneElement(
|
|
4061
4061
|
child,
|
|
4062
4062
|
{
|
|
4063
4063
|
index: i,
|
|
@@ -4123,7 +4123,7 @@ var MenuContent = React67.forwardRef(
|
|
|
4123
4123
|
}
|
|
4124
4124
|
);
|
|
4125
4125
|
MenuContent.displayName = "MenuContent";
|
|
4126
|
-
var MenuDivider =
|
|
4126
|
+
var MenuDivider = React33.forwardRef(
|
|
4127
4127
|
(_a, ref) => {
|
|
4128
4128
|
var _b = _a, { className, isGapVariant: _isGapVariant } = _b, props = __objRest(_b, ["className", "isGapVariant"]);
|
|
4129
4129
|
const { menuVariant } = useMenuContext();
|
|
@@ -4154,7 +4154,7 @@ function getGroupPosition(index, count) {
|
|
|
4154
4154
|
function getGroupActiveShape(position) {
|
|
4155
4155
|
return GROUP_SHAPES[`${position}Active`];
|
|
4156
4156
|
}
|
|
4157
|
-
var MenuGroup =
|
|
4157
|
+
var MenuGroup = React33.forwardRef(
|
|
4158
4158
|
(_a, ref) => {
|
|
4159
4159
|
var _b = _a, {
|
|
4160
4160
|
children,
|
|
@@ -4180,7 +4180,7 @@ var MenuGroup = React67.forwardRef(
|
|
|
4180
4180
|
const colors = menuVariant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
4181
4181
|
const position = getGroupPosition(index, count);
|
|
4182
4182
|
const currentShape = getGroupActiveShape(position);
|
|
4183
|
-
const enhancedChildren =
|
|
4183
|
+
const enhancedChildren = React33.useMemo(() => {
|
|
4184
4184
|
const valid = flattenChildren(children);
|
|
4185
4185
|
const itemCount = valid.length;
|
|
4186
4186
|
return valid.map((child, i) => {
|
|
@@ -4188,7 +4188,7 @@ var MenuGroup = React67.forwardRef(
|
|
|
4188
4188
|
if (typeof child.type === "string") return child;
|
|
4189
4189
|
const defaultItemPosition = itemCount === 1 ? "standalone" : i === 0 ? "leading" : i === itemCount - 1 ? "trailing" : "middle";
|
|
4190
4190
|
const itemPosition2 = (_a2 = child.props.itemPosition) != null ? _a2 : defaultItemPosition;
|
|
4191
|
-
return
|
|
4191
|
+
return React33.cloneElement(child, {
|
|
4192
4192
|
itemPosition: itemPosition2,
|
|
4193
4193
|
colorVariant
|
|
4194
4194
|
});
|
|
@@ -4261,7 +4261,7 @@ var VARIANT_FONT = {
|
|
|
4261
4261
|
rounded: "'Material Symbols Rounded'",
|
|
4262
4262
|
sharp: "'Material Symbols Sharp'"
|
|
4263
4263
|
};
|
|
4264
|
-
var IconComponent =
|
|
4264
|
+
var IconComponent = React33.forwardRef(
|
|
4265
4265
|
(_a, ref) => {
|
|
4266
4266
|
var _b = _a, {
|
|
4267
4267
|
name,
|
|
@@ -4327,14 +4327,14 @@ var IconComponent = React67.forwardRef(
|
|
|
4327
4327
|
}
|
|
4328
4328
|
);
|
|
4329
4329
|
IconComponent.displayName = "Icon";
|
|
4330
|
-
var Icon =
|
|
4330
|
+
var Icon = React33.memo(IconComponent);
|
|
4331
4331
|
function getItemShapeClass(position, selected, isStatic = false, menuVariant = "expressive") {
|
|
4332
4332
|
if (menuVariant === "baseline") return BASELINE_ITEM_SHAPE;
|
|
4333
4333
|
if (selected) return ITEM_SHAPE_CLASSES.selected;
|
|
4334
4334
|
if (isStatic && position === "standalone") return "rounded-[12px]";
|
|
4335
4335
|
return ITEM_SHAPE_CLASSES[position];
|
|
4336
4336
|
}
|
|
4337
|
-
var MenuItem =
|
|
4337
|
+
var MenuItem = React33.forwardRef(
|
|
4338
4338
|
(_a, ref) => {
|
|
4339
4339
|
var _b = _a, {
|
|
4340
4340
|
children,
|
|
@@ -4543,31 +4543,31 @@ function SubMenu({
|
|
|
4543
4543
|
}) {
|
|
4544
4544
|
const { colorVariant: contextColorVariant, menuPrimitive } = useMenuContext();
|
|
4545
4545
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
4546
|
-
const [open, setOpen] =
|
|
4547
|
-
const openTimerRef =
|
|
4548
|
-
const closeTimerRef =
|
|
4546
|
+
const [open, setOpen] = React33.useState(false);
|
|
4547
|
+
const openTimerRef = React33.useRef(null);
|
|
4548
|
+
const closeTimerRef = React33.useRef(
|
|
4549
4549
|
null
|
|
4550
4550
|
);
|
|
4551
|
-
const clearTimers =
|
|
4551
|
+
const clearTimers = React33.useCallback(() => {
|
|
4552
4552
|
if (openTimerRef.current) clearTimeout(openTimerRef.current);
|
|
4553
4553
|
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
4554
4554
|
}, []);
|
|
4555
|
-
const handleTriggerPointerEnter =
|
|
4555
|
+
const handleTriggerPointerEnter = React33.useCallback(() => {
|
|
4556
4556
|
clearTimers();
|
|
4557
4557
|
openTimerRef.current = setTimeout(() => setOpen(true), hoverOpenDelay);
|
|
4558
4558
|
}, [hoverOpenDelay, clearTimers]);
|
|
4559
|
-
const handleTriggerPointerLeave =
|
|
4559
|
+
const handleTriggerPointerLeave = React33.useCallback(() => {
|
|
4560
4560
|
clearTimers();
|
|
4561
4561
|
closeTimerRef.current = setTimeout(() => setOpen(false), hoverCloseDelay);
|
|
4562
4562
|
}, [hoverCloseDelay, clearTimers]);
|
|
4563
|
-
const handleContentPointerEnter =
|
|
4563
|
+
const handleContentPointerEnter = React33.useCallback(() => {
|
|
4564
4564
|
clearTimers();
|
|
4565
4565
|
}, [clearTimers]);
|
|
4566
|
-
const handleContentPointerLeave =
|
|
4566
|
+
const handleContentPointerLeave = React33.useCallback(() => {
|
|
4567
4567
|
clearTimers();
|
|
4568
4568
|
closeTimerRef.current = setTimeout(() => setOpen(false), hoverCloseDelay);
|
|
4569
4569
|
}, [hoverCloseDelay, clearTimers]);
|
|
4570
|
-
|
|
4570
|
+
React33.useEffect(() => () => clearTimers(), [clearTimers]);
|
|
4571
4571
|
const Sub3 = menuPrimitive === "context" ? RxContextMenu.Sub : DropdownMenu.Sub;
|
|
4572
4572
|
const SubTrigger3 = menuPrimitive === "context" ? RxContextMenu.SubTrigger : DropdownMenu.SubTrigger;
|
|
4573
4573
|
const SubContent3 = menuPrimitive === "context" ? RxContextMenu.SubContent : DropdownMenu.SubContent;
|
|
@@ -4579,7 +4579,7 @@ function SubMenu({
|
|
|
4579
4579
|
className: "w-full outline-none",
|
|
4580
4580
|
onPointerEnter: handleTriggerPointerEnter,
|
|
4581
4581
|
onPointerLeave: handleTriggerPointerLeave,
|
|
4582
|
-
children:
|
|
4582
|
+
children: React33.isValidElement(trigger) ? React33.cloneElement(trigger, {
|
|
4583
4583
|
isSubTrigger: true,
|
|
4584
4584
|
// Auto-add chevron if missing
|
|
4585
4585
|
trailingIcon: trigger.props.trailingIcon || /* @__PURE__ */ jsx(Icon, { name: "chevron_right", size: 20 })
|
|
@@ -4656,7 +4656,7 @@ function SubMenuContent({
|
|
|
4656
4656
|
);
|
|
4657
4657
|
}
|
|
4658
4658
|
SubMenuContent.displayName = "SubMenuContent";
|
|
4659
|
-
var VerticalMenuDivider =
|
|
4659
|
+
var VerticalMenuDivider = React33.forwardRef((_a, ref) => {
|
|
4660
4660
|
var _b = _a, { className, index, count, isGapVariant } = _b, props = __objRest(_b, ["className", "index", "count", "isGapVariant"]);
|
|
4661
4661
|
return /* @__PURE__ */ jsx(
|
|
4662
4662
|
"hr",
|
|
@@ -4676,7 +4676,7 @@ var VerticalMenuDivider = React67.forwardRef((_a, ref) => {
|
|
|
4676
4676
|
});
|
|
4677
4677
|
VerticalMenuDivider.displayName = "VerticalMenuDivider";
|
|
4678
4678
|
var VerticalMenuGroup = MenuGroup;
|
|
4679
|
-
var VerticalMenuContent =
|
|
4679
|
+
var VerticalMenuContent = React33.forwardRef(
|
|
4680
4680
|
(_a, ref) => {
|
|
4681
4681
|
var _b = _a, {
|
|
4682
4682
|
children,
|
|
@@ -4692,7 +4692,7 @@ var VerticalMenuContent = React67.forwardRef(
|
|
|
4692
4692
|
const { colorVariant: contextColorVariant } = useMenuContext();
|
|
4693
4693
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
4694
4694
|
const colors = colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
4695
|
-
const renderedChildren =
|
|
4695
|
+
const renderedChildren = React33.useMemo(() => {
|
|
4696
4696
|
const valid = flattenChildren(children);
|
|
4697
4697
|
const groupCount = valid.length;
|
|
4698
4698
|
const enhanced = valid.map((child, i) => {
|
|
@@ -4700,7 +4700,7 @@ var VerticalMenuContent = React67.forwardRef(
|
|
|
4700
4700
|
if (typeof child.type === "string") return child;
|
|
4701
4701
|
const defaultItemPosition = groupCount === 1 ? "standalone" : i === 0 ? "leading" : i === groupCount - 1 ? "trailing" : "middle";
|
|
4702
4702
|
const itemPosition = (_a2 = child.props.itemPosition) != null ? _a2 : defaultItemPosition;
|
|
4703
|
-
return
|
|
4703
|
+
return React33.cloneElement(
|
|
4704
4704
|
child,
|
|
4705
4705
|
{
|
|
4706
4706
|
index: i,
|
|
@@ -4743,13 +4743,13 @@ var VerticalMenuContent = React67.forwardRef(
|
|
|
4743
4743
|
}
|
|
4744
4744
|
);
|
|
4745
4745
|
VerticalMenuContent.displayName = "VerticalMenuContent";
|
|
4746
|
-
var VerticalMenu =
|
|
4746
|
+
var VerticalMenu = React33.forwardRef((_a, ref) => {
|
|
4747
4747
|
var _b = _a, { children, colorVariant = "standard", className } = _b, props = __objRest(_b, ["children", "colorVariant", "className"]);
|
|
4748
|
-
const noop =
|
|
4748
|
+
const noop = React33.useCallback(() => {
|
|
4749
4749
|
}, []);
|
|
4750
4750
|
const colors = colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
4751
|
-
const containerRef =
|
|
4752
|
-
const mergedRef =
|
|
4751
|
+
const containerRef = React33.useRef(null);
|
|
4752
|
+
const mergedRef = React33.useCallback(
|
|
4753
4753
|
(node) => {
|
|
4754
4754
|
containerRef.current = node;
|
|
4755
4755
|
if (typeof ref === "function") ref(node);
|
|
@@ -4758,7 +4758,7 @@ var VerticalMenu = React67.forwardRef((_a, ref) => {
|
|
|
4758
4758
|
},
|
|
4759
4759
|
[ref]
|
|
4760
4760
|
);
|
|
4761
|
-
const handleKeyDown =
|
|
4761
|
+
const handleKeyDown = React33.useCallback(
|
|
4762
4762
|
(e) => {
|
|
4763
4763
|
var _a2;
|
|
4764
4764
|
if (!containerRef.current) return;
|
|
@@ -4841,7 +4841,7 @@ var VerticalMenu = React67.forwardRef((_a, ref) => {
|
|
|
4841
4841
|
});
|
|
4842
4842
|
VerticalMenu.displayName = "VerticalMenu";
|
|
4843
4843
|
function detectSeparatorStyle(children) {
|
|
4844
|
-
const child =
|
|
4844
|
+
const child = React33.Children.toArray(children).find(React33.isValidElement);
|
|
4845
4845
|
if (child) {
|
|
4846
4846
|
const style = child.props.separatorStyle;
|
|
4847
4847
|
if (style) return style;
|
|
@@ -4922,11 +4922,11 @@ function AppBarColumn({
|
|
|
4922
4922
|
maxItemCount,
|
|
4923
4923
|
className
|
|
4924
4924
|
}) {
|
|
4925
|
-
const containerRef =
|
|
4926
|
-
const [visibleCount, setVisibleCount] =
|
|
4925
|
+
const containerRef = React33.useRef(null);
|
|
4926
|
+
const [visibleCount, setVisibleCount] = React33.useState(
|
|
4927
4927
|
maxItemCount != null ? maxItemCount : items.length
|
|
4928
4928
|
);
|
|
4929
|
-
|
|
4929
|
+
React33.useEffect(() => {
|
|
4930
4930
|
if (maxItemCount !== void 0) {
|
|
4931
4931
|
setVisibleCount(Math.min(maxItemCount, items.length));
|
|
4932
4932
|
return;
|
|
@@ -4974,11 +4974,11 @@ function AppBarColumn({
|
|
|
4974
4974
|
);
|
|
4975
4975
|
}
|
|
4976
4976
|
function AppBarRow({ items, maxItemCount, className }) {
|
|
4977
|
-
const containerRef =
|
|
4978
|
-
const [visibleCount, setVisibleCount] =
|
|
4977
|
+
const containerRef = React33.useRef(null);
|
|
4978
|
+
const [visibleCount, setVisibleCount] = React33.useState(
|
|
4979
4979
|
maxItemCount != null ? maxItemCount : items.length
|
|
4980
4980
|
);
|
|
4981
|
-
|
|
4981
|
+
React33.useEffect(() => {
|
|
4982
4982
|
if (maxItemCount !== void 0) {
|
|
4983
4983
|
setVisibleCount(Math.min(maxItemCount, items.length));
|
|
4984
4984
|
return;
|
|
@@ -5032,12 +5032,12 @@ function useAppBarScroll({
|
|
|
5032
5032
|
collapsedHeight = 64,
|
|
5033
5033
|
expandedHeight = 112
|
|
5034
5034
|
} = {}) {
|
|
5035
|
-
const [isScrolled, setIsScrolled] =
|
|
5036
|
-
const [collapsedFraction, setCollapsedFraction] =
|
|
5037
|
-
const [isHidden, setIsHidden] =
|
|
5038
|
-
const prevScrollYRef =
|
|
5035
|
+
const [isScrolled, setIsScrolled] = React33.useState(false);
|
|
5036
|
+
const [collapsedFraction, setCollapsedFraction] = React33.useState(0);
|
|
5037
|
+
const [isHidden, setIsHidden] = React33.useState(false);
|
|
5038
|
+
const prevScrollYRef = React33.useRef(0);
|
|
5039
5039
|
const hideThreshold = 64;
|
|
5040
|
-
|
|
5040
|
+
React33.useEffect(() => {
|
|
5041
5041
|
var _a;
|
|
5042
5042
|
const scrollDistance = expandedHeight - collapsedHeight;
|
|
5043
5043
|
const getScrollY = () => {
|
|
@@ -5172,7 +5172,7 @@ function useFlexibleAppBar({
|
|
|
5172
5172
|
expandedHeight
|
|
5173
5173
|
});
|
|
5174
5174
|
const scrollProgress = useMotionValue(0);
|
|
5175
|
-
|
|
5175
|
+
React33.useEffect(() => {
|
|
5176
5176
|
scrollProgress.set(
|
|
5177
5177
|
shouldReduceMotion ? collapsedFraction > 0.5 ? 1 : 0 : collapsedFraction
|
|
5178
5178
|
);
|
|
@@ -5550,7 +5550,7 @@ function SearchAppBar({
|
|
|
5550
5550
|
}) {
|
|
5551
5551
|
var _a, _b;
|
|
5552
5552
|
const shouldReduceMotion = useReducedMotion();
|
|
5553
|
-
const [isSearchOpen, setIsSearchOpen] =
|
|
5553
|
+
const [isSearchOpen, setIsSearchOpen] = React33.useState(false);
|
|
5554
5554
|
const { isScrolled } = useAppBarScroll({
|
|
5555
5555
|
scrollElement,
|
|
5556
5556
|
behavior: scrollBehavior === "exitUntilCollapsed" ? "pinned" : scrollBehavior
|
|
@@ -5691,8 +5691,8 @@ function SearchView({
|
|
|
5691
5691
|
className
|
|
5692
5692
|
}) {
|
|
5693
5693
|
const shouldReduceMotion = useReducedMotion();
|
|
5694
|
-
const inputRef =
|
|
5695
|
-
|
|
5694
|
+
const inputRef = React33.useRef(null);
|
|
5695
|
+
React33.useEffect(() => {
|
|
5696
5696
|
const timer = window.setTimeout(() => {
|
|
5697
5697
|
var _a;
|
|
5698
5698
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
@@ -5997,9 +5997,9 @@ function formatBadgeLabel(children, max) {
|
|
|
5997
5997
|
return "";
|
|
5998
5998
|
}
|
|
5999
5999
|
function detectBadgeHasContent(badge) {
|
|
6000
|
-
return
|
|
6000
|
+
return React33.isValidElement(badge) && badge.props.children != null;
|
|
6001
6001
|
}
|
|
6002
|
-
var BadgeImpl =
|
|
6002
|
+
var BadgeImpl = React33.forwardRef(
|
|
6003
6003
|
(_a, ref) => {
|
|
6004
6004
|
var _b = _a, {
|
|
6005
6005
|
children,
|
|
@@ -6053,7 +6053,7 @@ var BadgeImpl = React67.forwardRef(
|
|
|
6053
6053
|
}
|
|
6054
6054
|
);
|
|
6055
6055
|
BadgeImpl.displayName = "Badge";
|
|
6056
|
-
var Badge =
|
|
6056
|
+
var Badge = React33.memo(BadgeImpl);
|
|
6057
6057
|
function BadgedBox({
|
|
6058
6058
|
badge,
|
|
6059
6059
|
children,
|
|
@@ -6119,11 +6119,11 @@ var ROTATE_KEY_SPLINES = [
|
|
|
6119
6119
|
var ROTATE_VALUES = "0 24 24; 154 24 24; 309 24 24; 463 24 24; 617 24 24; 771 24 24; 926 24 24; 1080 24 24";
|
|
6120
6120
|
var DETERMINATE_CIRCLE = "M24 7 C34.49 7 41 13.51 41 24 C41 34.49 34.49 41 24 41 C13.51 41 7 34.49 7 24 C7 13.51 13.51 7 24 7 Z";
|
|
6121
6121
|
var DETERMINATE_SOFT_BURST = "M20.9 10.4 21.4 9.5 21.9 8.7 22.5 7.8 23.2 7.2 24.2 7 25.1 7.4 25.7 8.1 26.2 9 26.8 9.8 27.3 10.6 28.1 11.2 29 11.3 30 11 30.9 10.6 31.8 10.3 32.8 9.9 33.7 10 34.5 10.6 34.9 11.5 34.8 12.5 34.8 13.5 34.7 14.5 34.7 15.5 35.2 16.3 36 16.8 37 17.1 37.9 17.3 38.9 17.5 39.8 17.9 40.4 18.7 40.5 19.7 40 20.5 39.4 21.3 38.7 22 38.1 22.8 37.6 23.7 37.7 24.6 38.3 25.5 38.9 26.2 39.6 27 40.2 27.7 40.5 28.7 40.3 29.6 39.5 30.3 38.6 30.6 37.6 30.8 36.7 31 35.7 31.3 35 31.9 34.6 32.8 34.7 33.8 34.8 34.8 34.9 35.8 34.8 36.8 34.3 37.6 33.4 38.1 32.4 38 31.5 37.6 30.6 37.2 29.7 36.9 28.7 36.6 27.8 36.9 27.1 37.6 26.6 38.5 26.1 39.3 25.5 40.2 24.8 40.8 23.8 41 22.9 40.6 22.3 39.9 21.8 39 21.2 38.2 20.7 37.4 19.9 36.8 19 36.7 18 37 17.1 37.4 16.2 37.7 15.2 38.1 14.3 38 13.5 37.4 13.1 36.5 13.2 35.5 13.2 34.5 13.3 33.5 13.3 32.5 12.8 31.7 12 31.2 11 31 10.1 30.7 9.1 30.5 8.2 30.1 7.6 29.3 7.5 28.3 8 27.5 8.7 26.7 9.3 26 9.9 25.2 10.4 24.3 10.3 23.4 9.7 22.5 9.1 21.8 8.4 21 7.8 20.3 7.5 19.3 7.7 18.4 8.5 17.7 9.4 17.4 10.4 17.2 11.3 17 12.3 16.7 13 16.1 13.4 15.2 13.3 14.2 13.2 13.2 13.1 12.2 13.2 11.2 13.7 10.4 14.6 9.9 15.6 10 16.5 10.4 17.4 10.8 18.3 11.1 19.3 11.4 20.2 11.1Z";
|
|
6122
|
-
var IndeterminateSvg =
|
|
6122
|
+
var IndeterminateSvg = React33.memo(function IndeterminateSvg2({
|
|
6123
6123
|
size
|
|
6124
6124
|
}) {
|
|
6125
|
-
const [ready, setReady] =
|
|
6126
|
-
|
|
6125
|
+
const [ready, setReady] = React33.useState(false);
|
|
6126
|
+
React33.useEffect(() => {
|
|
6127
6127
|
const raf = requestAnimationFrame(() => setReady(true));
|
|
6128
6128
|
return () => cancelAnimationFrame(raf);
|
|
6129
6129
|
}, []);
|
|
@@ -6168,7 +6168,7 @@ var IndeterminateSvg = React67.memo(function IndeterminateSvg2({
|
|
|
6168
6168
|
}
|
|
6169
6169
|
);
|
|
6170
6170
|
});
|
|
6171
|
-
var DeterminateSvg =
|
|
6171
|
+
var DeterminateSvg = React33.memo(function DeterminateSvg2({
|
|
6172
6172
|
size,
|
|
6173
6173
|
progress
|
|
6174
6174
|
}) {
|
|
@@ -6193,7 +6193,7 @@ var DeterminateSvg = React67.memo(function DeterminateSvg2({
|
|
|
6193
6193
|
}
|
|
6194
6194
|
);
|
|
6195
6195
|
});
|
|
6196
|
-
var LoadingIndicator =
|
|
6196
|
+
var LoadingIndicator = React33.forwardRef(
|
|
6197
6197
|
(_a, ref) => {
|
|
6198
6198
|
var _b = _a, {
|
|
6199
6199
|
variant = "uncontained",
|
|
@@ -6328,7 +6328,7 @@ var ADDITIONAL_ROTATION_EASE_DURATION = 500;
|
|
|
6328
6328
|
var DEFAULT_MIN_PROGRESS = 0.1;
|
|
6329
6329
|
var DEFAULT_MAX_PROGRESS = 0.8;
|
|
6330
6330
|
var PROGRESS_CYCLE_DURATION = 1500;
|
|
6331
|
-
var CircularProgress =
|
|
6331
|
+
var CircularProgress = React33.forwardRef(
|
|
6332
6332
|
(_a, ref) => {
|
|
6333
6333
|
var _b = _a, {
|
|
6334
6334
|
value,
|
|
@@ -6382,19 +6382,19 @@ var CircularProgress = React67.forwardRef(
|
|
|
6382
6382
|
const shouldShowDeterminateTrack = showTrack === "auto" ? true : showTrack;
|
|
6383
6383
|
const BASELINE_SIZE = 48;
|
|
6384
6384
|
const scaleFactor = size / BASELINE_SIZE;
|
|
6385
|
-
const effectiveAmplitude =
|
|
6385
|
+
const effectiveAmplitude = React33.useMemo(
|
|
6386
6386
|
() => amplitude != null ? amplitude : 1.6 * scaleFactor,
|
|
6387
6387
|
[amplitude, scaleFactor]
|
|
6388
6388
|
);
|
|
6389
|
-
const effectiveWavelength =
|
|
6389
|
+
const effectiveWavelength = React33.useMemo(
|
|
6390
6390
|
() => wavelength != null ? wavelength : 15 * scaleFactor,
|
|
6391
6391
|
[wavelength, scaleFactor]
|
|
6392
6392
|
);
|
|
6393
|
-
const resolvedAmplitudeRange =
|
|
6393
|
+
const resolvedAmplitudeRange = React33.useMemo(
|
|
6394
6394
|
() => amplitudeRange != null ? amplitudeRange : [0, effectiveAmplitude],
|
|
6395
6395
|
[amplitudeRange, effectiveAmplitude]
|
|
6396
6396
|
);
|
|
6397
|
-
const wavyActivePath =
|
|
6397
|
+
const wavyActivePath = React33.useMemo(
|
|
6398
6398
|
() => isWavy ? generateWavyCircularPath(
|
|
6399
6399
|
center,
|
|
6400
6400
|
radius,
|
|
@@ -6403,8 +6403,8 @@ var CircularProgress = React67.forwardRef(
|
|
|
6403
6403
|
) : null,
|
|
6404
6404
|
[isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
|
|
6405
6405
|
);
|
|
6406
|
-
const circumference =
|
|
6407
|
-
const gapForTrack =
|
|
6406
|
+
const circumference = React33.useMemo(() => 2 * Math.PI * radius, [radius]);
|
|
6407
|
+
const gapForTrack = React33.useMemo(
|
|
6408
6408
|
() => (gapSize + trackHeight) / circumference,
|
|
6409
6409
|
[gapSize, trackHeight, circumference]
|
|
6410
6410
|
);
|
|
@@ -6412,17 +6412,17 @@ var CircularProgress = React67.forwardRef(
|
|
|
6412
6412
|
const trackOffset = isDeterminate ? activeAngularFraction + gapForTrack : 0;
|
|
6413
6413
|
const trackLength = isDeterminate ? Math.max(1e-3, 1 - activeAngularFraction - 2 * gapForTrack) : 1;
|
|
6414
6414
|
const ActiveCircleElem = m.circle;
|
|
6415
|
-
const indeterminateSvgRef =
|
|
6416
|
-
const indeterminateTrackRef =
|
|
6417
|
-
const indeterminateActiveRef =
|
|
6418
|
-
const indeterminateWavyTrackPathRef =
|
|
6419
|
-
const indeterminateWavyActivePathRef =
|
|
6420
|
-
const determinateWavyActivePathRef =
|
|
6421
|
-
const determinateWavyTrackPathRef =
|
|
6422
|
-
const cachedPathLengthRef =
|
|
6415
|
+
const indeterminateSvgRef = React33.useRef(null);
|
|
6416
|
+
const indeterminateTrackRef = React33.useRef(null);
|
|
6417
|
+
const indeterminateActiveRef = React33.useRef(null);
|
|
6418
|
+
const indeterminateWavyTrackPathRef = React33.useRef(null);
|
|
6419
|
+
const indeterminateWavyActivePathRef = React33.useRef(null);
|
|
6420
|
+
const determinateWavyActivePathRef = React33.useRef(null);
|
|
6421
|
+
const determinateWavyTrackPathRef = React33.useRef(null);
|
|
6422
|
+
const cachedPathLengthRef = React33.useRef(0);
|
|
6423
6423
|
const fractionMV = useMotionValue(isDeterminate ? clampedValue / 100 : 0);
|
|
6424
6424
|
const amplitudeMV = useMotionValue(isWavy ? effectiveAmplitude : 0);
|
|
6425
|
-
|
|
6425
|
+
React33.useEffect(() => {
|
|
6426
6426
|
if (isDeterminate) {
|
|
6427
6427
|
animate(fractionMV, clampedValue / 100, {
|
|
6428
6428
|
duration: 0.4,
|
|
@@ -6430,7 +6430,7 @@ var CircularProgress = React67.forwardRef(
|
|
|
6430
6430
|
});
|
|
6431
6431
|
}
|
|
6432
6432
|
}, [clampedValue, isDeterminate, fractionMV]);
|
|
6433
|
-
|
|
6433
|
+
React33.useEffect(() => {
|
|
6434
6434
|
if (!isDeterminate || !isWavy) return;
|
|
6435
6435
|
const fraction = clampedValue / 100;
|
|
6436
6436
|
let targetAmp = effectiveAmplitude;
|
|
@@ -6450,7 +6450,7 @@ var CircularProgress = React67.forwardRef(
|
|
|
6450
6450
|
amplitudeMV,
|
|
6451
6451
|
determinateAnimation
|
|
6452
6452
|
]);
|
|
6453
|
-
|
|
6453
|
+
React33.useLayoutEffect(() => {
|
|
6454
6454
|
if (!isWavy || !wavyActivePath) {
|
|
6455
6455
|
cachedPathLengthRef.current = circumference;
|
|
6456
6456
|
return;
|
|
@@ -6827,9 +6827,9 @@ var CircularProgress = React67.forwardRef(
|
|
|
6827
6827
|
);
|
|
6828
6828
|
CircularProgress.displayName = "CircularProgress";
|
|
6829
6829
|
function useContainerWidth() {
|
|
6830
|
-
const [width, setWidth] =
|
|
6831
|
-
const observerRef =
|
|
6832
|
-
const ref =
|
|
6830
|
+
const [width, setWidth] = React33.useState(0);
|
|
6831
|
+
const observerRef = React33.useRef(null);
|
|
6832
|
+
const ref = React33.useCallback((node) => {
|
|
6833
6833
|
if (observerRef.current) {
|
|
6834
6834
|
observerRef.current.disconnect();
|
|
6835
6835
|
observerRef.current = null;
|
|
@@ -6843,7 +6843,7 @@ function useContainerWidth() {
|
|
|
6843
6843
|
observerRef.current = obs;
|
|
6844
6844
|
}
|
|
6845
6845
|
}, []);
|
|
6846
|
-
|
|
6846
|
+
React33.useEffect(() => {
|
|
6847
6847
|
return () => {
|
|
6848
6848
|
if (observerRef.current) {
|
|
6849
6849
|
observerRef.current.disconnect();
|
|
@@ -6853,7 +6853,7 @@ function useContainerWidth() {
|
|
|
6853
6853
|
return [ref, width];
|
|
6854
6854
|
}
|
|
6855
6855
|
function useMergedRef(...refs) {
|
|
6856
|
-
return
|
|
6856
|
+
return React33.useCallback(
|
|
6857
6857
|
(node) => {
|
|
6858
6858
|
for (const ref of refs) {
|
|
6859
6859
|
if (typeof ref === "function") {
|
|
@@ -6867,7 +6867,7 @@ function useMergedRef(...refs) {
|
|
|
6867
6867
|
[refs]
|
|
6868
6868
|
);
|
|
6869
6869
|
}
|
|
6870
|
-
var FlatLinearTrack =
|
|
6870
|
+
var FlatLinearTrack = React33.memo(function FlatLinearTrack2({
|
|
6871
6871
|
trackHeight,
|
|
6872
6872
|
activeColor,
|
|
6873
6873
|
trackColor,
|
|
@@ -6943,7 +6943,7 @@ var FlatLinearTrack = React67.memo(function FlatLinearTrack2({
|
|
|
6943
6943
|
}
|
|
6944
6944
|
);
|
|
6945
6945
|
});
|
|
6946
|
-
var WavyLinearTrack =
|
|
6946
|
+
var WavyLinearTrack = React33.memo(function WavyLinearTrack2({
|
|
6947
6947
|
trackHeight,
|
|
6948
6948
|
svgHeight,
|
|
6949
6949
|
amplitude,
|
|
@@ -6962,13 +6962,13 @@ var WavyLinearTrack = React67.memo(function WavyLinearTrack2({
|
|
|
6962
6962
|
}) {
|
|
6963
6963
|
const isDeterminate = typeof value === "number";
|
|
6964
6964
|
const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
|
|
6965
|
-
const titleId =
|
|
6965
|
+
const titleId = React33.useId();
|
|
6966
6966
|
const [containerRef, width] = useContainerWidth();
|
|
6967
|
-
const activePathRef =
|
|
6968
|
-
const trackPathRef =
|
|
6967
|
+
const activePathRef = React33.useRef(null);
|
|
6968
|
+
const trackPathRef = React33.useRef(null);
|
|
6969
6969
|
const amplitudeMV = useMotionValue(amplitude);
|
|
6970
6970
|
const fractionMV = useMotionValue(isDeterminate ? clampedValue / 100 : 1);
|
|
6971
|
-
|
|
6971
|
+
React33.useEffect(() => {
|
|
6972
6972
|
if (isDeterminate) {
|
|
6973
6973
|
const fraction = clampedValue / 100;
|
|
6974
6974
|
let targetAmp = amplitude;
|
|
@@ -7156,7 +7156,7 @@ var WavyLinearTrack = React67.memo(function WavyLinearTrack2({
|
|
|
7156
7156
|
}
|
|
7157
7157
|
);
|
|
7158
7158
|
});
|
|
7159
|
-
var LinearProgress =
|
|
7159
|
+
var LinearProgress = React33.forwardRef(
|
|
7160
7160
|
(_a, ref) => {
|
|
7161
7161
|
var _b = _a, {
|
|
7162
7162
|
value,
|
|
@@ -7197,10 +7197,10 @@ var LinearProgress = React67.forwardRef(
|
|
|
7197
7197
|
]);
|
|
7198
7198
|
const isDeterminate = value !== void 0;
|
|
7199
7199
|
const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
|
|
7200
|
-
const containerRef =
|
|
7200
|
+
const containerRef = React33.useRef(null);
|
|
7201
7201
|
const mergedRef = useMergedRef(ref, containerRef);
|
|
7202
|
-
const [isRtl, setIsRtl] =
|
|
7203
|
-
|
|
7202
|
+
const [isRtl, setIsRtl] = React33.useState(false);
|
|
7203
|
+
React33.useEffect(() => {
|
|
7204
7204
|
if (containerRef.current) {
|
|
7205
7205
|
const dir = getComputedStyle(containerRef.current).direction;
|
|
7206
7206
|
setIsRtl(dir === "rtl");
|
|
@@ -7208,16 +7208,16 @@ var LinearProgress = React67.forwardRef(
|
|
|
7208
7208
|
}, []);
|
|
7209
7209
|
const resolvedTrackShape = trackShape != null ? trackShape : shape;
|
|
7210
7210
|
const isWavy = shape === "wavy" || resolvedTrackShape === "wavy";
|
|
7211
|
-
const effectiveAmplitude =
|
|
7212
|
-
const svgHeight =
|
|
7211
|
+
const effectiveAmplitude = React33.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
|
|
7212
|
+
const svgHeight = React33.useMemo(
|
|
7213
7213
|
() => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
|
|
7214
7214
|
[isWavy, trackHeight, effectiveAmplitude]
|
|
7215
7215
|
);
|
|
7216
|
-
const shouldShowStop =
|
|
7216
|
+
const shouldShowStop = React33.useMemo(
|
|
7217
7217
|
() => isDeterminate && resolvedTrackShape === "flat" && showStopIndicator !== false,
|
|
7218
7218
|
[isDeterminate, resolvedTrackShape, showStopIndicator]
|
|
7219
7219
|
);
|
|
7220
|
-
const stopSize =
|
|
7220
|
+
const stopSize = React33.useMemo(
|
|
7221
7221
|
() => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
|
|
7222
7222
|
[trackHeight]
|
|
7223
7223
|
);
|
|
@@ -7292,14 +7292,14 @@ var LinearProgress = React67.forwardRef(
|
|
|
7292
7292
|
}
|
|
7293
7293
|
);
|
|
7294
7294
|
LinearProgress.displayName = "LinearProgress";
|
|
7295
|
-
var ProgressIndicator =
|
|
7295
|
+
var ProgressIndicator = React33.forwardRef((props, ref) => {
|
|
7296
7296
|
if (props.variant === "circular") {
|
|
7297
7297
|
return /* @__PURE__ */ jsx(CircularProgress, __spreadValues({ ref }, props));
|
|
7298
7298
|
}
|
|
7299
7299
|
return /* @__PURE__ */ jsx(LinearProgress, __spreadValues({ ref }, props));
|
|
7300
7300
|
});
|
|
7301
7301
|
ProgressIndicator.displayName = "ProgressIndicator";
|
|
7302
|
-
var RippleItem =
|
|
7302
|
+
var RippleItem = React33.memo(function RippleItem2({
|
|
7303
7303
|
ripple,
|
|
7304
7304
|
onDone
|
|
7305
7305
|
}) {
|
|
@@ -7343,8 +7343,8 @@ function Ripple({
|
|
|
7343
7343
|
}
|
|
7344
7344
|
function useRippleState(options = {}) {
|
|
7345
7345
|
const { disabled = false } = options;
|
|
7346
|
-
const [ripples, setRipples] =
|
|
7347
|
-
const onPointerDown =
|
|
7346
|
+
const [ripples, setRipples] = React33.useState([]);
|
|
7347
|
+
const onPointerDown = React33.useCallback(
|
|
7348
7348
|
(e) => {
|
|
7349
7349
|
if (disabled) return;
|
|
7350
7350
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -7361,7 +7361,7 @@ function useRippleState(options = {}) {
|
|
|
7361
7361
|
},
|
|
7362
7362
|
[disabled]
|
|
7363
7363
|
);
|
|
7364
|
-
const removeRipple =
|
|
7364
|
+
const removeRipple = React33.useCallback((id) => {
|
|
7365
7365
|
setRipples((prev) => prev.filter((r) => r.id !== id));
|
|
7366
7366
|
}, []);
|
|
7367
7367
|
return { ripples, onPointerDown, removeRipple };
|
|
@@ -7593,7 +7593,7 @@ function AnimatedIconSlot({
|
|
|
7593
7593
|
}
|
|
7594
7594
|
);
|
|
7595
7595
|
}
|
|
7596
|
-
var ButtonComponent =
|
|
7596
|
+
var ButtonComponent = React33.forwardRef(
|
|
7597
7597
|
(_a, ref) => {
|
|
7598
7598
|
var _b = _a, {
|
|
7599
7599
|
className,
|
|
@@ -7659,9 +7659,9 @@ var ButtonComponent = React67.forwardRef(
|
|
|
7659
7659
|
borderWidth: outlineWidth != null ? outlineWidth : colorStyle === "outlined" ? sizeTokens.outlineWidth : 0,
|
|
7660
7660
|
borderStyle: colorStyle === "outlined" ? "solid" : void 0
|
|
7661
7661
|
}, style);
|
|
7662
|
-
const labelText =
|
|
7662
|
+
const labelText = React33.useMemo(() => {
|
|
7663
7663
|
if (asChild) {
|
|
7664
|
-
const child =
|
|
7664
|
+
const child = React33.Children.only(children);
|
|
7665
7665
|
return child.props.children;
|
|
7666
7666
|
}
|
|
7667
7667
|
return children;
|
|
@@ -7669,8 +7669,8 @@ var ButtonComponent = React67.forwardRef(
|
|
|
7669
7669
|
const computedAriaLabel = ariaLabelProp || (typeof children === "string" ? children : void 0);
|
|
7670
7670
|
const needsTouchTarget = size === "xs" || size === "sm";
|
|
7671
7671
|
const motionRadius = useMotionValue(animateRadius);
|
|
7672
|
-
const asChildRef =
|
|
7673
|
-
const mergedRef =
|
|
7672
|
+
const asChildRef = React33.useRef(null);
|
|
7673
|
+
const mergedRef = React33.useCallback(
|
|
7674
7674
|
(node) => {
|
|
7675
7675
|
asChildRef.current = node;
|
|
7676
7676
|
if (typeof ref === "function") ref(node);
|
|
@@ -7679,14 +7679,14 @@ var ButtonComponent = React67.forwardRef(
|
|
|
7679
7679
|
},
|
|
7680
7680
|
[ref]
|
|
7681
7681
|
);
|
|
7682
|
-
|
|
7682
|
+
React33.useEffect(() => {
|
|
7683
7683
|
if (!asChild) return;
|
|
7684
7684
|
return motionRadius.on("change", (v) => {
|
|
7685
7685
|
if (asChildRef.current)
|
|
7686
7686
|
asChildRef.current.style.borderRadius = `${v}px`;
|
|
7687
7687
|
});
|
|
7688
7688
|
}, [motionRadius, asChild]);
|
|
7689
|
-
|
|
7689
|
+
React33.useEffect(() => {
|
|
7690
7690
|
if (!asChild) return;
|
|
7691
7691
|
const controls = springAnimate(motionRadius, animateRadius);
|
|
7692
7692
|
return () => controls.stop();
|
|
@@ -7694,14 +7694,14 @@ var ButtonComponent = React67.forwardRef(
|
|
|
7694
7694
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
7695
7695
|
disabled: loading
|
|
7696
7696
|
});
|
|
7697
|
-
const handleClick =
|
|
7697
|
+
const handleClick = React33.useCallback(
|
|
7698
7698
|
(e) => {
|
|
7699
7699
|
if (loading) return e.preventDefault();
|
|
7700
7700
|
onClick == null ? void 0 : onClick(e);
|
|
7701
7701
|
},
|
|
7702
7702
|
[loading, onClick]
|
|
7703
7703
|
);
|
|
7704
|
-
const handleKeyDown =
|
|
7704
|
+
const handleKeyDown = React33.useCallback(
|
|
7705
7705
|
(e) => {
|
|
7706
7706
|
if (loading) return;
|
|
7707
7707
|
if (onClick && (e.key === "Enter" || e.key === " ")) {
|
|
@@ -7780,17 +7780,17 @@ var ButtonComponent = React67.forwardRef(
|
|
|
7780
7780
|
isSelected && selectedIcon ? "selected-icon" : "icon"
|
|
7781
7781
|
) })
|
|
7782
7782
|
] });
|
|
7783
|
-
const handleAsChildPointerDown =
|
|
7783
|
+
const handleAsChildPointerDown = React33.useCallback(
|
|
7784
7784
|
(e) => {
|
|
7785
7785
|
springAnimate(motionRadius, pressedRadius);
|
|
7786
7786
|
onPointerDown == null ? void 0 : onPointerDown(e);
|
|
7787
7787
|
},
|
|
7788
7788
|
[motionRadius, pressedRadius, onPointerDown]
|
|
7789
7789
|
);
|
|
7790
|
-
const handleAsChildPointerUp =
|
|
7790
|
+
const handleAsChildPointerUp = React33.useCallback(() => {
|
|
7791
7791
|
springAnimate(motionRadius, animateRadius);
|
|
7792
7792
|
}, [motionRadius, animateRadius]);
|
|
7793
|
-
const handlePointerDown =
|
|
7793
|
+
const handlePointerDown = React33.useCallback(
|
|
7794
7794
|
(e) => {
|
|
7795
7795
|
onPointerDown(e);
|
|
7796
7796
|
},
|
|
@@ -7800,7 +7800,7 @@ var ButtonComponent = React67.forwardRef(
|
|
|
7800
7800
|
const strippedProps = __spreadValues({}, restProps);
|
|
7801
7801
|
for (const key of MOTION_PROP_KEYS) delete strippedProps[key];
|
|
7802
7802
|
const htmlProps = strippedProps;
|
|
7803
|
-
const child =
|
|
7803
|
+
const child = React33.Children.only(children);
|
|
7804
7804
|
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
|
|
7805
7805
|
Slot,
|
|
7806
7806
|
__spreadProps(__spreadValues({
|
|
@@ -7817,7 +7817,7 @@ var ButtonComponent = React67.forwardRef(
|
|
|
7817
7817
|
}),
|
|
7818
7818
|
className: buttonClassName
|
|
7819
7819
|
}, htmlProps), {
|
|
7820
|
-
children:
|
|
7820
|
+
children: React33.cloneElement(child, { children: innerContent })
|
|
7821
7821
|
})
|
|
7822
7822
|
) });
|
|
7823
7823
|
}
|
|
@@ -7845,7 +7845,7 @@ var ButtonComponent = React67.forwardRef(
|
|
|
7845
7845
|
}
|
|
7846
7846
|
);
|
|
7847
7847
|
ButtonComponent.displayName = "Button";
|
|
7848
|
-
var Button =
|
|
7848
|
+
var Button = React33.memo(ButtonComponent);
|
|
7849
7849
|
|
|
7850
7850
|
// src/ui/buttons/button-distribute/button-distribute-tokens.ts
|
|
7851
7851
|
var DISTRIBUTE_SPRING_TRANSITION = {
|
|
@@ -7877,7 +7877,7 @@ function useDistributeWeights({
|
|
|
7877
7877
|
mode = "dynamic",
|
|
7878
7878
|
isTextItem
|
|
7879
7879
|
}) {
|
|
7880
|
-
return
|
|
7880
|
+
return React33.useMemo(() => {
|
|
7881
7881
|
if (count <= 0) return [];
|
|
7882
7882
|
if (mode === "mixed") {
|
|
7883
7883
|
const baseWeights2 = new Array(count).fill(0).map((_, idx) => {
|
|
@@ -7947,7 +7947,7 @@ function useDistributeWeights({
|
|
|
7947
7947
|
return result;
|
|
7948
7948
|
}, [count, weights, activeIndex, expandRatio, mode, isTextItem]);
|
|
7949
7949
|
}
|
|
7950
|
-
var ButtonDistribute =
|
|
7950
|
+
var ButtonDistribute = React33.forwardRef(
|
|
7951
7951
|
(_a, ref) => {
|
|
7952
7952
|
var _b = _a, {
|
|
7953
7953
|
className,
|
|
@@ -7981,14 +7981,14 @@ var ButtonDistribute = React67.forwardRef(
|
|
|
7981
7981
|
"onMouseLeave"
|
|
7982
7982
|
]);
|
|
7983
7983
|
var _a2, _b2;
|
|
7984
|
-
const [activeIndex, setActiveIndex] =
|
|
7985
|
-
const [pressedIndex, setPressedIndex] =
|
|
7986
|
-
const childrenArray =
|
|
7987
|
-
() =>
|
|
7984
|
+
const [activeIndex, setActiveIndex] = React33.useState(null);
|
|
7985
|
+
const [pressedIndex, setPressedIndex] = React33.useState(null);
|
|
7986
|
+
const childrenArray = React33.useMemo(
|
|
7987
|
+
() => React33.Children.toArray(children).filter(React33.isValidElement),
|
|
7988
7988
|
[children]
|
|
7989
7989
|
);
|
|
7990
7990
|
const count = childrenArray.length;
|
|
7991
|
-
const isTextItem =
|
|
7991
|
+
const isTextItem = React33.useMemo(() => {
|
|
7992
7992
|
return childrenArray.map((child) => {
|
|
7993
7993
|
const childEl = child;
|
|
7994
7994
|
if (typeof childEl.props.children === "string") return true;
|
|
@@ -8008,7 +8008,7 @@ var ButtonDistribute = React67.forwardRef(
|
|
|
8008
8008
|
mode,
|
|
8009
8009
|
isTextItem
|
|
8010
8010
|
});
|
|
8011
|
-
const handleGroupMouseLeave =
|
|
8011
|
+
const handleGroupMouseLeave = React33.useCallback(
|
|
8012
8012
|
(e) => {
|
|
8013
8013
|
setActiveIndex(null);
|
|
8014
8014
|
setPressedIndex(null);
|
|
@@ -8132,7 +8132,7 @@ var ButtonDistribute = React67.forwardRef(
|
|
|
8132
8132
|
}
|
|
8133
8133
|
(_b4 = (_a4 = childElement.props).onClick) == null ? void 0 : _b4.call(_a4, e);
|
|
8134
8134
|
};
|
|
8135
|
-
const clonedChild =
|
|
8135
|
+
const clonedChild = React33.cloneElement(childElement, {
|
|
8136
8136
|
size: (_d = childElement.props.size) != null ? _d : size,
|
|
8137
8137
|
className: cn(
|
|
8138
8138
|
"w-full! h-full! justify-center items-center flex-1 rounded-[inherit]! px-3! sm:px-4!",
|
|
@@ -8257,7 +8257,7 @@ var CHECK_ICON_MOTION = {
|
|
|
8257
8257
|
damping: 34,
|
|
8258
8258
|
mass: 0.75
|
|
8259
8259
|
};
|
|
8260
|
-
var AnimatedCheckLabel =
|
|
8260
|
+
var AnimatedCheckLabel = React33.memo(function AnimatedCheckLabel2({
|
|
8261
8261
|
selected,
|
|
8262
8262
|
size,
|
|
8263
8263
|
children
|
|
@@ -8381,7 +8381,7 @@ function buildMotionProps(variant, isSelected, isPressed, itemSize, shapes, exis
|
|
|
8381
8381
|
}
|
|
8382
8382
|
return props;
|
|
8383
8383
|
}
|
|
8384
|
-
var ButtonGroupComponent =
|
|
8384
|
+
var ButtonGroupComponent = React33.forwardRef(
|
|
8385
8385
|
(_a, ref) => {
|
|
8386
8386
|
var _b = _a, {
|
|
8387
8387
|
className,
|
|
@@ -8408,13 +8408,13 @@ var ButtonGroupComponent = React67.forwardRef(
|
|
|
8408
8408
|
"labelBehavior",
|
|
8409
8409
|
"style"
|
|
8410
8410
|
]);
|
|
8411
|
-
const [pressedIndex, setPressedIndex] =
|
|
8412
|
-
const childrenArray =
|
|
8413
|
-
() =>
|
|
8411
|
+
const [pressedIndex, setPressedIndex] = React33.useState(null);
|
|
8412
|
+
const childrenArray = React33.useMemo(
|
|
8413
|
+
() => React33.Children.toArray(children).filter(React33.isValidElement),
|
|
8414
8414
|
[children]
|
|
8415
8415
|
);
|
|
8416
8416
|
const count = childrenArray.length;
|
|
8417
|
-
const handlePointerLeaveAndUp =
|
|
8417
|
+
const handlePointerLeaveAndUp = React33.useCallback(() => {
|
|
8418
8418
|
setPressedIndex(null);
|
|
8419
8419
|
}, []);
|
|
8420
8420
|
return /* @__PURE__ */ jsx(
|
|
@@ -8468,7 +8468,7 @@ var ButtonGroupComponent = React67.forwardRef(
|
|
|
8468
8468
|
existingWhileTap
|
|
8469
8469
|
);
|
|
8470
8470
|
const connectedClasses = variant === "connected" && isSelected ? "z-20" : "";
|
|
8471
|
-
const clonedElement =
|
|
8471
|
+
const clonedElement = React33.cloneElement(element, __spreadValues(__spreadProps(__spreadValues({
|
|
8472
8472
|
key: (_a2 = element.key) != null ? _a2 : index,
|
|
8473
8473
|
tabIndex: isFirst ? 0 : -1,
|
|
8474
8474
|
size: size || element.props.size,
|
|
@@ -8498,7 +8498,7 @@ var ButtonGroupComponent = React67.forwardRef(
|
|
|
8498
8498
|
}
|
|
8499
8499
|
);
|
|
8500
8500
|
ButtonGroupComponent.displayName = "ButtonGroup";
|
|
8501
|
-
var ButtonGroup =
|
|
8501
|
+
var ButtonGroup = React33.memo(ButtonGroupComponent);
|
|
8502
8502
|
var SIZE_HEIGHT = {
|
|
8503
8503
|
sm: "h-14",
|
|
8504
8504
|
md: "h-20",
|
|
@@ -8553,9 +8553,9 @@ var COLOR_CLASSES = {
|
|
|
8553
8553
|
}
|
|
8554
8554
|
};
|
|
8555
8555
|
function useScrollCollapse(enabled, scrollThreshold, onCollapsedChange) {
|
|
8556
|
-
const [collapsed, setCollapsed] =
|
|
8557
|
-
const lastScrollY =
|
|
8558
|
-
|
|
8556
|
+
const [collapsed, setCollapsed] = React33.useState(false);
|
|
8557
|
+
const lastScrollY = React33.useRef(0);
|
|
8558
|
+
React33.useEffect(() => {
|
|
8559
8559
|
if (!enabled || typeof window === "undefined") return;
|
|
8560
8560
|
lastScrollY.current = window.scrollY;
|
|
8561
8561
|
const handleScroll = () => {
|
|
@@ -8578,7 +8578,7 @@ function useScrollCollapse(enabled, scrollThreshold, onCollapsedChange) {
|
|
|
8578
8578
|
}, [enabled, scrollThreshold, collapsed, onCollapsedChange]);
|
|
8579
8579
|
return collapsed;
|
|
8580
8580
|
}
|
|
8581
|
-
var ExtendedFABComponent =
|
|
8581
|
+
var ExtendedFABComponent = React33.forwardRef(
|
|
8582
8582
|
(_a, ref) => {
|
|
8583
8583
|
var _b = _a, {
|
|
8584
8584
|
className,
|
|
@@ -8626,10 +8626,10 @@ var ExtendedFABComponent = React67.forwardRef(
|
|
|
8626
8626
|
"aria-label"
|
|
8627
8627
|
]);
|
|
8628
8628
|
var _a2, _b2, _c, _d;
|
|
8629
|
-
const localRef =
|
|
8630
|
-
|
|
8631
|
-
const [dir, setDir] =
|
|
8632
|
-
|
|
8629
|
+
const localRef = React33.useRef(null);
|
|
8630
|
+
React33.useImperativeHandle(ref, () => localRef.current);
|
|
8631
|
+
const [dir, setDir] = React33.useState("ltr");
|
|
8632
|
+
React33.useEffect(() => {
|
|
8633
8633
|
var _a3;
|
|
8634
8634
|
if (!localRef.current) return;
|
|
8635
8635
|
const closestDir = (_a3 = localRef.current.closest("[dir]")) == null ? void 0 : _a3.getAttribute("dir");
|
|
@@ -8648,7 +8648,7 @@ var ExtendedFABComponent = React67.forwardRef(
|
|
|
8648
8648
|
const radiusConfig = (_b2 = MORPH_RADIUS[size]) != null ? _b2 : MORPH_RADIUS.sm;
|
|
8649
8649
|
const sizeIcon = (_c = SIZE_ICON[size]) != null ? _c : SIZE_ICON.sm;
|
|
8650
8650
|
const motionRadius = useMotionValue(radiusConfig.default);
|
|
8651
|
-
|
|
8651
|
+
React33.useEffect(() => {
|
|
8652
8652
|
const controls = animate(motionRadius, radiusConfig.default, __spreadProps(__spreadValues({}, SPRING_TRANSITION), {
|
|
8653
8653
|
type: "spring"
|
|
8654
8654
|
}));
|
|
@@ -8657,7 +8657,7 @@ var ExtendedFABComponent = React67.forwardRef(
|
|
|
8657
8657
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
8658
8658
|
disabled: loading
|
|
8659
8659
|
});
|
|
8660
|
-
const handleClick =
|
|
8660
|
+
const handleClick = React33.useCallback(
|
|
8661
8661
|
(e) => {
|
|
8662
8662
|
if (loading) {
|
|
8663
8663
|
e.preventDefault();
|
|
@@ -8667,7 +8667,7 @@ var ExtendedFABComponent = React67.forwardRef(
|
|
|
8667
8667
|
},
|
|
8668
8668
|
[loading, onClick]
|
|
8669
8669
|
);
|
|
8670
|
-
const handleKeyDown =
|
|
8670
|
+
const handleKeyDown = React33.useCallback(
|
|
8671
8671
|
(e) => {
|
|
8672
8672
|
if (loading) return;
|
|
8673
8673
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -8787,8 +8787,8 @@ var ExtendedFABComponent = React67.forwardRef(
|
|
|
8787
8787
|
}),
|
|
8788
8788
|
className: containerClassName
|
|
8789
8789
|
}, restProps), {
|
|
8790
|
-
children:
|
|
8791
|
-
|
|
8790
|
+
children: React33.cloneElement(
|
|
8791
|
+
React33.Children.only(children),
|
|
8792
8792
|
{ children: innerContent }
|
|
8793
8793
|
)
|
|
8794
8794
|
})
|
|
@@ -8834,7 +8834,7 @@ var ExtendedFABComponent = React67.forwardRef(
|
|
|
8834
8834
|
}
|
|
8835
8835
|
);
|
|
8836
8836
|
ExtendedFABComponent.displayName = "ExtendedFAB";
|
|
8837
|
-
var ExtendedFAB =
|
|
8837
|
+
var ExtendedFAB = React33.memo(ExtendedFABComponent);
|
|
8838
8838
|
var SIZE_STYLES = {
|
|
8839
8839
|
sm: "h-10 w-10",
|
|
8840
8840
|
md: "h-14 w-14",
|
|
@@ -8917,7 +8917,7 @@ function FABPosition({
|
|
|
8917
8917
|
}
|
|
8918
8918
|
);
|
|
8919
8919
|
}
|
|
8920
|
-
var FABComponent =
|
|
8920
|
+
var FABComponent = React33.forwardRef(
|
|
8921
8921
|
(_a, ref) => {
|
|
8922
8922
|
var _b = _a, {
|
|
8923
8923
|
className,
|
|
@@ -8968,7 +8968,7 @@ var FABComponent = React67.forwardRef(
|
|
|
8968
8968
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
8969
8969
|
disabled: loading
|
|
8970
8970
|
});
|
|
8971
|
-
const handleClick =
|
|
8971
|
+
const handleClick = React33.useCallback(
|
|
8972
8972
|
(e) => {
|
|
8973
8973
|
if (loading) {
|
|
8974
8974
|
e.preventDefault();
|
|
@@ -8978,7 +8978,7 @@ var FABComponent = React67.forwardRef(
|
|
|
8978
8978
|
},
|
|
8979
8979
|
[loading, onClick]
|
|
8980
8980
|
);
|
|
8981
|
-
const handleKeyDown =
|
|
8981
|
+
const handleKeyDown = React33.useCallback(
|
|
8982
8982
|
(e) => {
|
|
8983
8983
|
if (loading) return;
|
|
8984
8984
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -8989,7 +8989,7 @@ var FABComponent = React67.forwardRef(
|
|
|
8989
8989
|
},
|
|
8990
8990
|
[loading, onClick, onKeyDown]
|
|
8991
8991
|
);
|
|
8992
|
-
const labelContent = asChild ?
|
|
8992
|
+
const labelContent = asChild ? React33.Children.only(children).props.children : children;
|
|
8993
8993
|
const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8994
8994
|
needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
|
|
8995
8995
|
/* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
@@ -9086,8 +9086,8 @@ var FABComponent = React67.forwardRef(
|
|
|
9086
9086
|
className
|
|
9087
9087
|
);
|
|
9088
9088
|
const motionRadius = useMotionValue(animateRadius);
|
|
9089
|
-
const asChildRef =
|
|
9090
|
-
const mergedRef =
|
|
9089
|
+
const asChildRef = React33.useRef(null);
|
|
9090
|
+
const mergedRef = React33.useCallback(
|
|
9091
9091
|
(node) => {
|
|
9092
9092
|
asChildRef.current = node;
|
|
9093
9093
|
if (typeof ref === "function") ref(node);
|
|
@@ -9096,20 +9096,20 @@ var FABComponent = React67.forwardRef(
|
|
|
9096
9096
|
},
|
|
9097
9097
|
[ref]
|
|
9098
9098
|
);
|
|
9099
|
-
|
|
9099
|
+
React33.useEffect(() => {
|
|
9100
9100
|
if (!asChild) return;
|
|
9101
9101
|
return motionRadius.on("change", (v) => {
|
|
9102
9102
|
if (asChildRef.current)
|
|
9103
9103
|
asChildRef.current.style.borderRadius = `${v}px`;
|
|
9104
9104
|
});
|
|
9105
9105
|
}, [motionRadius, asChild]);
|
|
9106
|
-
|
|
9106
|
+
React33.useEffect(() => {
|
|
9107
9107
|
const controls = animate(motionRadius, animateRadius, __spreadProps(__spreadValues({}, SPRING_TRANSITION), {
|
|
9108
9108
|
type: "spring"
|
|
9109
9109
|
}));
|
|
9110
9110
|
return () => controls.stop();
|
|
9111
9111
|
}, [animateRadius, motionRadius]);
|
|
9112
|
-
const handleAsChildPointerDown =
|
|
9112
|
+
const handleAsChildPointerDown = React33.useCallback(
|
|
9113
9113
|
(e) => {
|
|
9114
9114
|
onPointerDown(e);
|
|
9115
9115
|
animate(motionRadius, pressedRadius, __spreadProps(__spreadValues({}, SPRING_TRANSITION_FAST), {
|
|
@@ -9118,7 +9118,7 @@ var FABComponent = React67.forwardRef(
|
|
|
9118
9118
|
},
|
|
9119
9119
|
[onPointerDown, motionRadius, pressedRadius]
|
|
9120
9120
|
);
|
|
9121
|
-
const handleAsChildPointerUp =
|
|
9121
|
+
const handleAsChildPointerUp = React33.useCallback(() => {
|
|
9122
9122
|
animate(motionRadius, animateRadius, __spreadProps(__spreadValues({}, SPRING_TRANSITION_FAST), {
|
|
9123
9123
|
type: "spring"
|
|
9124
9124
|
}));
|
|
@@ -9142,8 +9142,8 @@ var FABComponent = React67.forwardRef(
|
|
|
9142
9142
|
}),
|
|
9143
9143
|
className: containerClassName
|
|
9144
9144
|
}, restProps), {
|
|
9145
|
-
children:
|
|
9146
|
-
|
|
9145
|
+
children: React33.cloneElement(
|
|
9146
|
+
React33.Children.only(children),
|
|
9147
9147
|
{ children: innerContent }
|
|
9148
9148
|
)
|
|
9149
9149
|
})
|
|
@@ -9186,7 +9186,7 @@ var FABComponent = React67.forwardRef(
|
|
|
9186
9186
|
}
|
|
9187
9187
|
);
|
|
9188
9188
|
FABComponent.displayName = "FAB";
|
|
9189
|
-
var FAB =
|
|
9189
|
+
var FAB = React33.memo(FABComponent);
|
|
9190
9190
|
var SPRING_NORMAL = { stiffness: 700, damping: 40 };
|
|
9191
9191
|
var SPRING_REDUCED = { stiffness: 1e4, damping: 100 };
|
|
9192
9192
|
var FOCUS_DELAY_MS = 50;
|
|
@@ -9294,7 +9294,7 @@ function CloseIcon2() {
|
|
|
9294
9294
|
function defaultFabIcon(progress) {
|
|
9295
9295
|
return progress > 0.5 ? /* @__PURE__ */ jsx(CloseIcon2, {}) : /* @__PURE__ */ jsx(AddIcon, {});
|
|
9296
9296
|
}
|
|
9297
|
-
var ToggleFABComponent =
|
|
9297
|
+
var ToggleFABComponent = React33.forwardRef(
|
|
9298
9298
|
({
|
|
9299
9299
|
expanded,
|
|
9300
9300
|
onToggle,
|
|
@@ -9312,7 +9312,7 @@ var ToggleFABComponent = React67.forwardRef(
|
|
|
9312
9312
|
const sizeTokens = (_b = TOGGLE_FAB_SIZES[size]) != null ? _b : TOGGLE_FAB_SIZES.sm;
|
|
9313
9313
|
const springConfig = prefersReduced ? SPRING_REDUCED : SPRING_NORMAL;
|
|
9314
9314
|
const checkedProgress = useSpring(expanded ? 1 : 0, springConfig);
|
|
9315
|
-
|
|
9315
|
+
React33.useEffect(() => {
|
|
9316
9316
|
checkedProgress.set(expanded ? 1 : 0);
|
|
9317
9317
|
}, [expanded, checkedProgress]);
|
|
9318
9318
|
const borderRadius = useTransform(
|
|
@@ -9320,12 +9320,12 @@ var ToggleFABComponent = React67.forwardRef(
|
|
|
9320
9320
|
[0, 1],
|
|
9321
9321
|
[`${sizeTokens.initialRadius}px`, `${sizeTokens.finalRadius}px`]
|
|
9322
9322
|
);
|
|
9323
|
-
const [iconProgress, setIconProgress] =
|
|
9324
|
-
|
|
9323
|
+
const [iconProgress, setIconProgress] = React33.useState(expanded ? 1 : 0);
|
|
9324
|
+
React33.useEffect(() => {
|
|
9325
9325
|
return checkedProgress.on("change", setIconProgress);
|
|
9326
9326
|
}, [checkedProgress]);
|
|
9327
9327
|
const { ripples, onPointerDown, removeRipple } = useRippleState();
|
|
9328
|
-
const handleClick =
|
|
9328
|
+
const handleClick = React33.useCallback(() => {
|
|
9329
9329
|
onToggle(!expanded);
|
|
9330
9330
|
}, [expanded, onToggle]);
|
|
9331
9331
|
return /* @__PURE__ */ jsxs(
|
|
@@ -9374,7 +9374,7 @@ var ToggleFABComponent = React67.forwardRef(
|
|
|
9374
9374
|
}
|
|
9375
9375
|
);
|
|
9376
9376
|
ToggleFABComponent.displayName = "ToggleFAB";
|
|
9377
|
-
var ToggleFAB =
|
|
9377
|
+
var ToggleFAB = React33.memo(ToggleFABComponent);
|
|
9378
9378
|
function FABMenuItem({
|
|
9379
9379
|
icon,
|
|
9380
9380
|
label,
|
|
@@ -9389,7 +9389,7 @@ function FABMenuItem({
|
|
|
9389
9389
|
var _a;
|
|
9390
9390
|
const colors = (_a = MENU_ITEM_COLORS[colorVariant]) != null ? _a : MENU_ITEM_COLORS.primary;
|
|
9391
9391
|
const { ripples, onPointerDown, removeRipple } = useRippleState({ disabled });
|
|
9392
|
-
const handleClick =
|
|
9392
|
+
const handleClick = React33.useCallback(
|
|
9393
9393
|
(e) => {
|
|
9394
9394
|
if (disabled) {
|
|
9395
9395
|
e.preventDefault();
|
|
@@ -9399,7 +9399,7 @@ function FABMenuItem({
|
|
|
9399
9399
|
},
|
|
9400
9400
|
[disabled, onClick]
|
|
9401
9401
|
);
|
|
9402
|
-
const handleKeyDown =
|
|
9402
|
+
const handleKeyDown = React33.useCallback(
|
|
9403
9403
|
(e) => {
|
|
9404
9404
|
if (disabled) return;
|
|
9405
9405
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -9441,7 +9441,7 @@ function FABMenuItem({
|
|
|
9441
9441
|
borderRadius: `${MENU_ITEM_STYLES.cornerRadius}px`
|
|
9442
9442
|
};
|
|
9443
9443
|
if (asChild) {
|
|
9444
|
-
const child =
|
|
9444
|
+
const child = React33.Children.only(children);
|
|
9445
9445
|
return /* @__PURE__ */ jsx(m.div, { variants: MENU_ITEM_VARIANTS, style: containerStyle, children: /* @__PURE__ */ jsx(
|
|
9446
9446
|
Slot,
|
|
9447
9447
|
{
|
|
@@ -9453,7 +9453,7 @@ function FABMenuItem({
|
|
|
9453
9453
|
onPointerDown,
|
|
9454
9454
|
onKeyDown: handleKeyDown,
|
|
9455
9455
|
className: containerClassName,
|
|
9456
|
-
children:
|
|
9456
|
+
children: React33.cloneElement(child, { children: innerContent })
|
|
9457
9457
|
}
|
|
9458
9458
|
) });
|
|
9459
9459
|
}
|
|
@@ -9474,6 +9474,25 @@ function FABMenuItem({
|
|
|
9474
9474
|
}
|
|
9475
9475
|
);
|
|
9476
9476
|
}
|
|
9477
|
+
function useClickOutside(ref, handler, enabled) {
|
|
9478
|
+
const stableHandler = React33.useRef(handler);
|
|
9479
|
+
React33.useEffect(() => {
|
|
9480
|
+
stableHandler.current = handler;
|
|
9481
|
+
});
|
|
9482
|
+
React33.useEffect(() => {
|
|
9483
|
+
if (!enabled) return;
|
|
9484
|
+
const listener = (event) => {
|
|
9485
|
+
if (!ref.current || ref.current.contains(event.target)) return;
|
|
9486
|
+
stableHandler.current();
|
|
9487
|
+
};
|
|
9488
|
+
document.addEventListener("mousedown", listener);
|
|
9489
|
+
document.addEventListener("touchstart", listener, { passive: true });
|
|
9490
|
+
return () => {
|
|
9491
|
+
document.removeEventListener("mousedown", listener);
|
|
9492
|
+
document.removeEventListener("touchstart", listener);
|
|
9493
|
+
};
|
|
9494
|
+
}, [ref, enabled]);
|
|
9495
|
+
}
|
|
9477
9496
|
function FABMenu({
|
|
9478
9497
|
expanded,
|
|
9479
9498
|
onToggle,
|
|
@@ -9486,13 +9505,22 @@ function FABMenu({
|
|
|
9486
9505
|
focusLast = true,
|
|
9487
9506
|
"aria-label": ariaLabel
|
|
9488
9507
|
}) {
|
|
9489
|
-
const fabId =
|
|
9490
|
-
const menuId =
|
|
9491
|
-
const toggleRef =
|
|
9492
|
-
const
|
|
9493
|
-
const
|
|
9494
|
-
const
|
|
9495
|
-
const
|
|
9508
|
+
const fabId = React33.useId();
|
|
9509
|
+
const menuId = React33.useId();
|
|
9510
|
+
const toggleRef = React33.useRef(null);
|
|
9511
|
+
const containerRef = React33.useRef(null);
|
|
9512
|
+
const itemRefs = React33.useRef([]);
|
|
9513
|
+
const [focusedIndex, setFocusedIndex] = React33.useState(-1);
|
|
9514
|
+
const reversedItems = React33.useMemo(() => [...items].reverse(), [items]);
|
|
9515
|
+
const handleOutsideClick = React33.useCallback(() => {
|
|
9516
|
+
onToggle(false);
|
|
9517
|
+
}, [onToggle]);
|
|
9518
|
+
useClickOutside(
|
|
9519
|
+
containerRef,
|
|
9520
|
+
handleOutsideClick,
|
|
9521
|
+
expanded && closeOnBackdropClick
|
|
9522
|
+
);
|
|
9523
|
+
const focusItem = React33.useCallback((index) => {
|
|
9496
9524
|
var _a;
|
|
9497
9525
|
const clampedIndex = Math.max(
|
|
9498
9526
|
0,
|
|
@@ -9501,8 +9529,8 @@ function FABMenu({
|
|
|
9501
9529
|
setFocusedIndex(clampedIndex);
|
|
9502
9530
|
(_a = itemRefs.current[clampedIndex]) == null ? void 0 : _a.focus();
|
|
9503
9531
|
}, []);
|
|
9504
|
-
const wasExpandedRef =
|
|
9505
|
-
|
|
9532
|
+
const wasExpandedRef = React33.useRef(false);
|
|
9533
|
+
React33.useEffect(() => {
|
|
9506
9534
|
var _a;
|
|
9507
9535
|
if (expanded) {
|
|
9508
9536
|
wasExpandedRef.current = true;
|
|
@@ -9517,7 +9545,7 @@ function FABMenu({
|
|
|
9517
9545
|
wasExpandedRef.current = false;
|
|
9518
9546
|
setFocusedIndex(-1);
|
|
9519
9547
|
}, [expanded, focusLast, items.length, focusItem]);
|
|
9520
|
-
const handleMenuKeyDown =
|
|
9548
|
+
const handleMenuKeyDown = React33.useCallback(
|
|
9521
9549
|
(e) => {
|
|
9522
9550
|
if (!expanded) return;
|
|
9523
9551
|
const lastIndex = items.length - 1;
|
|
@@ -9549,97 +9577,88 @@ function FABMenu({
|
|
|
9549
9577
|
},
|
|
9550
9578
|
[expanded, focusedIndex, items.length, focusItem, onToggle]
|
|
9551
9579
|
);
|
|
9552
|
-
return /* @__PURE__ */
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
|
|
9567
|
-
|
|
9568
|
-
|
|
9569
|
-
|
|
9570
|
-
|
|
9571
|
-
|
|
9572
|
-
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
|
|
9581
|
-
|
|
9582
|
-
|
|
9583
|
-
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
|
|
9588
|
-
|
|
9589
|
-
|
|
9590
|
-
var _a;
|
|
9591
|
-
const originalIndex = items.length - 1 - reversedIndex;
|
|
9592
|
-
return /* @__PURE__ */ jsx(
|
|
9593
|
-
m.div,
|
|
9594
|
-
{
|
|
9595
|
-
variants: MENU_ITEM_VARIANTS,
|
|
9596
|
-
style: {
|
|
9597
|
-
transformOrigin: (_a = ALIGNMENT_TRANSFORM_ORIGIN[alignment]) != null ? _a : "right"
|
|
9598
|
-
},
|
|
9599
|
-
ref: (el) => {
|
|
9600
|
-
itemRefs.current[originalIndex] = el;
|
|
9601
|
-
},
|
|
9602
|
-
children: /* @__PURE__ */ jsx(
|
|
9603
|
-
FABMenuItem,
|
|
9604
|
-
{
|
|
9605
|
-
icon: item.icon,
|
|
9606
|
-
label: item.label,
|
|
9607
|
-
onClick: () => {
|
|
9608
|
-
if (!item.disabled) {
|
|
9609
|
-
item.onClick();
|
|
9610
|
-
onToggle(false);
|
|
9611
|
-
}
|
|
9612
|
-
},
|
|
9613
|
-
disabled: item.disabled,
|
|
9614
|
-
colorVariant,
|
|
9615
|
-
className: item.className,
|
|
9616
|
-
tabIndex: expanded ? 0 : -1
|
|
9617
|
-
}
|
|
9618
|
-
)
|
|
9580
|
+
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
|
|
9581
|
+
"div",
|
|
9582
|
+
{
|
|
9583
|
+
ref: containerRef,
|
|
9584
|
+
role: "group",
|
|
9585
|
+
"aria-label": ariaLabel != null ? ariaLabel : "Actions menu",
|
|
9586
|
+
className: cn(
|
|
9587
|
+
"fixed z-50 flex flex-col gap-2",
|
|
9588
|
+
ALIGNMENT_CONTAINER_CLASSES[alignment],
|
|
9589
|
+
"*:shrink-0",
|
|
9590
|
+
className
|
|
9591
|
+
),
|
|
9592
|
+
onKeyDown: handleMenuKeyDown,
|
|
9593
|
+
children: [
|
|
9594
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: expanded && /* @__PURE__ */ jsx(
|
|
9595
|
+
m.div,
|
|
9596
|
+
{
|
|
9597
|
+
id: menuId,
|
|
9598
|
+
role: "menu",
|
|
9599
|
+
"aria-labelledby": fabId,
|
|
9600
|
+
"aria-orientation": "vertical",
|
|
9601
|
+
variants: MENU_CONTAINER_VARIANTS2,
|
|
9602
|
+
initial: "closed",
|
|
9603
|
+
animate: "open",
|
|
9604
|
+
exit: "closed",
|
|
9605
|
+
className: cn(
|
|
9606
|
+
"flex flex-col-reverse gap-2",
|
|
9607
|
+
ALIGNMENT_ITEMS_CLASSES[alignment]
|
|
9608
|
+
),
|
|
9609
|
+
children: reversedItems.map((item, reversedIndex) => {
|
|
9610
|
+
var _a;
|
|
9611
|
+
const originalIndex = items.length - 1 - reversedIndex;
|
|
9612
|
+
return /* @__PURE__ */ jsx(
|
|
9613
|
+
m.div,
|
|
9614
|
+
{
|
|
9615
|
+
variants: MENU_ITEM_VARIANTS,
|
|
9616
|
+
style: {
|
|
9617
|
+
transformOrigin: (_a = ALIGNMENT_TRANSFORM_ORIGIN[alignment]) != null ? _a : "right"
|
|
9619
9618
|
},
|
|
9620
|
-
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
|
|
9626
|
-
|
|
9627
|
-
|
|
9628
|
-
|
|
9629
|
-
|
|
9630
|
-
|
|
9631
|
-
|
|
9632
|
-
|
|
9633
|
-
|
|
9634
|
-
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9619
|
+
ref: (el) => {
|
|
9620
|
+
itemRefs.current[originalIndex] = el;
|
|
9621
|
+
},
|
|
9622
|
+
children: /* @__PURE__ */ jsx(
|
|
9623
|
+
FABMenuItem,
|
|
9624
|
+
{
|
|
9625
|
+
icon: item.icon,
|
|
9626
|
+
label: item.label,
|
|
9627
|
+
onClick: () => {
|
|
9628
|
+
if (!item.disabled) {
|
|
9629
|
+
item.onClick();
|
|
9630
|
+
onToggle(false);
|
|
9631
|
+
}
|
|
9632
|
+
},
|
|
9633
|
+
disabled: item.disabled,
|
|
9634
|
+
colorVariant,
|
|
9635
|
+
className: item.className,
|
|
9636
|
+
tabIndex: expanded ? 0 : -1
|
|
9637
|
+
}
|
|
9638
|
+
)
|
|
9639
|
+
},
|
|
9640
|
+
item.id
|
|
9641
|
+
);
|
|
9642
|
+
})
|
|
9643
|
+
}
|
|
9644
|
+
) }),
|
|
9645
|
+
/* @__PURE__ */ jsx(
|
|
9646
|
+
ToggleFAB,
|
|
9647
|
+
{
|
|
9648
|
+
ref: toggleRef,
|
|
9649
|
+
id: fabId,
|
|
9650
|
+
expanded,
|
|
9651
|
+
onToggle,
|
|
9652
|
+
colorVariant,
|
|
9653
|
+
size,
|
|
9654
|
+
"aria-label": ariaLabel != null ? ariaLabel : expanded ? "Close actions menu" : "Open actions menu",
|
|
9655
|
+
"aria-controls": menuId,
|
|
9656
|
+
icon: defaultFabIcon
|
|
9657
|
+
}
|
|
9658
|
+
)
|
|
9659
|
+
]
|
|
9660
|
+
}
|
|
9661
|
+
) });
|
|
9643
9662
|
}
|
|
9644
9663
|
var SIZE_HEIGHT_STYLES = {
|
|
9645
9664
|
xs: "h-8",
|
|
@@ -9656,7 +9675,7 @@ var WIDTH_SIZE_STYLES = {
|
|
|
9656
9675
|
},
|
|
9657
9676
|
sm: {
|
|
9658
9677
|
default: "w-10",
|
|
9659
|
-
narrow: "w-
|
|
9678
|
+
narrow: "w-10",
|
|
9660
9679
|
wide: "w-[3.25rem]"
|
|
9661
9680
|
},
|
|
9662
9681
|
md: {
|
|
@@ -9766,7 +9785,7 @@ function resolveDisabledBgClass(colorStyle) {
|
|
|
9766
9785
|
}
|
|
9767
9786
|
return "disabled:text-m3-on-surface/[0.38]";
|
|
9768
9787
|
}
|
|
9769
|
-
var IconButtonComponent =
|
|
9788
|
+
var IconButtonComponent = React33.forwardRef(
|
|
9770
9789
|
(_a, ref) => {
|
|
9771
9790
|
var _b = _a, {
|
|
9772
9791
|
className,
|
|
@@ -9808,18 +9827,18 @@ var IconButtonComponent = React67.forwardRef(
|
|
|
9808
9827
|
var _a2, _b2, _c, _d, _e;
|
|
9809
9828
|
const isToggle = variant === "toggle";
|
|
9810
9829
|
const isSelected = isToggle && !!selected;
|
|
9811
|
-
const resolvedColorClass =
|
|
9830
|
+
const resolvedColorClass = React33.useMemo(
|
|
9812
9831
|
() => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
|
|
9813
9832
|
[isSelected, colorStyle]
|
|
9814
9833
|
);
|
|
9815
|
-
const outlineWidthClass =
|
|
9834
|
+
const outlineWidthClass = React33.useMemo(
|
|
9816
9835
|
() => {
|
|
9817
9836
|
var _a3;
|
|
9818
9837
|
return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
|
|
9819
9838
|
},
|
|
9820
9839
|
[colorStyle, isSelected, size]
|
|
9821
9840
|
);
|
|
9822
|
-
const disabledBgClass =
|
|
9841
|
+
const disabledBgClass = React33.useMemo(
|
|
9823
9842
|
() => resolveDisabledBgClass(colorStyle),
|
|
9824
9843
|
[colorStyle]
|
|
9825
9844
|
);
|
|
@@ -9842,7 +9861,7 @@ var IconButtonComponent = React67.forwardRef(
|
|
|
9842
9861
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
9843
9862
|
disabled: loading
|
|
9844
9863
|
});
|
|
9845
|
-
const handleClick =
|
|
9864
|
+
const handleClick = React33.useCallback(
|
|
9846
9865
|
(e) => {
|
|
9847
9866
|
if (loading) {
|
|
9848
9867
|
e.preventDefault();
|
|
@@ -9852,7 +9871,7 @@ var IconButtonComponent = React67.forwardRef(
|
|
|
9852
9871
|
},
|
|
9853
9872
|
[loading, onClick]
|
|
9854
9873
|
);
|
|
9855
|
-
const handleKeyDown =
|
|
9874
|
+
const handleKeyDown = React33.useCallback(
|
|
9856
9875
|
(e) => {
|
|
9857
9876
|
if (loading) return;
|
|
9858
9877
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -9908,7 +9927,7 @@ var IconButtonComponent = React67.forwardRef(
|
|
|
9908
9927
|
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
9909
9928
|
height: isCustomSize ? `${iconSize}px` : void 0
|
|
9910
9929
|
},
|
|
9911
|
-
children: isSelected && selectedIcon ? selectedIcon : asChild ?
|
|
9930
|
+
children: isSelected && selectedIcon ? selectedIcon : asChild ? React33.Children.only(children).props.children : children
|
|
9912
9931
|
}),
|
|
9913
9932
|
isSelected && selectedIcon ? "selected-content" : "content"
|
|
9914
9933
|
) })
|
|
@@ -9925,7 +9944,7 @@ var IconButtonComponent = React67.forwardRef(
|
|
|
9925
9944
|
className
|
|
9926
9945
|
);
|
|
9927
9946
|
if (asChild) {
|
|
9928
|
-
const child =
|
|
9947
|
+
const child = React33.Children.only(children);
|
|
9929
9948
|
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
|
|
9930
9949
|
Slot,
|
|
9931
9950
|
__spreadProps(__spreadValues({
|
|
@@ -9942,7 +9961,7 @@ var IconButtonComponent = React67.forwardRef(
|
|
|
9942
9961
|
}),
|
|
9943
9962
|
className: containerClassName
|
|
9944
9963
|
}, restProps), {
|
|
9945
|
-
children:
|
|
9964
|
+
children: React33.cloneElement(child, { children: innerContent })
|
|
9946
9965
|
})
|
|
9947
9966
|
) });
|
|
9948
9967
|
}
|
|
@@ -9970,12 +9989,12 @@ var IconButtonComponent = React67.forwardRef(
|
|
|
9970
9989
|
}
|
|
9971
9990
|
);
|
|
9972
9991
|
IconButtonComponent.displayName = "IconButton";
|
|
9973
|
-
var IconButton =
|
|
9974
|
-
var SplitButtonContext =
|
|
9992
|
+
var IconButton = React33.memo(IconButtonComponent);
|
|
9993
|
+
var SplitButtonContext = React33.createContext(null);
|
|
9975
9994
|
function useSplitButtonContext() {
|
|
9976
|
-
return
|
|
9995
|
+
return React33.useContext(SplitButtonContext);
|
|
9977
9996
|
}
|
|
9978
|
-
var SplitButtonLayoutComponent =
|
|
9997
|
+
var SplitButtonLayoutComponent = React33.forwardRef(
|
|
9979
9998
|
(_a, ref) => {
|
|
9980
9999
|
var _b = _a, {
|
|
9981
10000
|
leadingButton,
|
|
@@ -9992,10 +10011,10 @@ var SplitButtonLayoutComponent = React67.forwardRef(
|
|
|
9992
10011
|
"variant",
|
|
9993
10012
|
"size"
|
|
9994
10013
|
]);
|
|
9995
|
-
const leadingProps =
|
|
10014
|
+
const leadingProps = React33.isValidElement(leadingButton) ? leadingButton.props : {};
|
|
9996
10015
|
const size = layoutSize || leadingProps.size;
|
|
9997
10016
|
const variant = layoutVariant || leadingProps.variant;
|
|
9998
|
-
const contextValue =
|
|
10017
|
+
const contextValue = React33.useMemo(
|
|
9999
10018
|
() => ({
|
|
10000
10019
|
size,
|
|
10001
10020
|
variant
|
|
@@ -10022,8 +10041,8 @@ var SplitButtonLayoutComponent = React67.forwardRef(
|
|
|
10022
10041
|
}
|
|
10023
10042
|
);
|
|
10024
10043
|
SplitButtonLayoutComponent.displayName = "SplitButtonLayout";
|
|
10025
|
-
var SplitButtonLayout =
|
|
10026
|
-
var StateLayer =
|
|
10044
|
+
var SplitButtonLayout = React33.memo(SplitButtonLayoutComponent);
|
|
10045
|
+
var StateLayer = React33.forwardRef(
|
|
10027
10046
|
(_a, ref) => {
|
|
10028
10047
|
var _b = _a, { className, hovered, focused, pressed } = _b, props = __objRest(_b, ["className", "hovered", "focused", "pressed"]);
|
|
10029
10048
|
let opacity = 0;
|
|
@@ -10275,7 +10294,7 @@ var splitButtonVariants = cva(
|
|
|
10275
10294
|
}
|
|
10276
10295
|
}
|
|
10277
10296
|
);
|
|
10278
|
-
var SplitButtonLeadingComponent =
|
|
10297
|
+
var SplitButtonLeadingComponent = React33.forwardRef(
|
|
10279
10298
|
(_a, ref) => {
|
|
10280
10299
|
var _b = _a, {
|
|
10281
10300
|
className,
|
|
@@ -10314,9 +10333,9 @@ var SplitButtonLeadingComponent = React67.forwardRef(
|
|
|
10314
10333
|
const context = useSplitButtonContext();
|
|
10315
10334
|
const actualSize = (_a2 = context == null ? void 0 : context.size) != null ? _a2 : size;
|
|
10316
10335
|
const actualVariant = (_b2 = context == null ? void 0 : context.variant) != null ? _b2 : variant;
|
|
10317
|
-
const [isHovered, setIsHovered] =
|
|
10318
|
-
const [isFocused, setIsFocused] =
|
|
10319
|
-
const [isPressed, setIsPressed] =
|
|
10336
|
+
const [isHovered, setIsHovered] = React33.useState(false);
|
|
10337
|
+
const [isFocused, setIsFocused] = React33.useState(false);
|
|
10338
|
+
const [isPressed, setIsPressed] = React33.useState(false);
|
|
10320
10339
|
const tokens = SPLIT_BUTTON_TOKENS[actualSize];
|
|
10321
10340
|
const typographyClass = (_c = BUTTON_TYPOGRAPHY_TOKENS[actualSize]) != null ? _c : BUTTON_TYPOGRAPHY_TOKENS.sm;
|
|
10322
10341
|
const needsTouchTarget = actualSize === "xs" || actualSize === "sm";
|
|
@@ -10328,7 +10347,7 @@ var SplitButtonLeadingComponent = React67.forwardRef(
|
|
|
10328
10347
|
const innerCornerRadius = isPressed || isFocused ? tokens.innerCorner.pressed : isHovered ? tokens.innerCorner.hovered : tokens.innerCorner.default;
|
|
10329
10348
|
const outerRadius = tokens.containerHeight * tokens.outerCornerPercent / 100;
|
|
10330
10349
|
const borderRadius = `${outerRadius}px ${innerCornerRadius}px ${innerCornerRadius}px ${outerRadius}px`;
|
|
10331
|
-
const handleClick =
|
|
10350
|
+
const handleClick = React33.useCallback(
|
|
10332
10351
|
(e) => {
|
|
10333
10352
|
if (disabled) {
|
|
10334
10353
|
e.preventDefault();
|
|
@@ -10338,7 +10357,7 @@ var SplitButtonLeadingComponent = React67.forwardRef(
|
|
|
10338
10357
|
},
|
|
10339
10358
|
[disabled, onClick]
|
|
10340
10359
|
);
|
|
10341
|
-
const handlePointerDown =
|
|
10360
|
+
const handlePointerDown = React33.useCallback(
|
|
10342
10361
|
(e) => {
|
|
10343
10362
|
onRipplePointerDown(e);
|
|
10344
10363
|
setIsPressed(true);
|
|
@@ -10346,19 +10365,19 @@ var SplitButtonLeadingComponent = React67.forwardRef(
|
|
|
10346
10365
|
},
|
|
10347
10366
|
[onRipplePointerDown, onPointerDown]
|
|
10348
10367
|
);
|
|
10349
|
-
const handlePointerUp =
|
|
10368
|
+
const handlePointerUp = React33.useCallback(
|
|
10350
10369
|
(e) => {
|
|
10351
10370
|
setIsPressed(false);
|
|
10352
10371
|
onPointerUp == null ? void 0 : onPointerUp(e);
|
|
10353
10372
|
},
|
|
10354
10373
|
[onPointerUp]
|
|
10355
10374
|
);
|
|
10356
|
-
const handlePointerEnter =
|
|
10375
|
+
const handlePointerEnter = React33.useCallback(() => {
|
|
10357
10376
|
if (!disabled) {
|
|
10358
10377
|
setIsHovered(true);
|
|
10359
10378
|
}
|
|
10360
10379
|
}, [disabled]);
|
|
10361
|
-
const handlePointerLeave =
|
|
10380
|
+
const handlePointerLeave = React33.useCallback(
|
|
10362
10381
|
(e) => {
|
|
10363
10382
|
setIsHovered(false);
|
|
10364
10383
|
setIsPressed(false);
|
|
@@ -10366,21 +10385,21 @@ var SplitButtonLeadingComponent = React67.forwardRef(
|
|
|
10366
10385
|
},
|
|
10367
10386
|
[onPointerLeave]
|
|
10368
10387
|
);
|
|
10369
|
-
const handlePointerCancel =
|
|
10388
|
+
const handlePointerCancel = React33.useCallback(
|
|
10370
10389
|
(e) => {
|
|
10371
10390
|
setIsPressed(false);
|
|
10372
10391
|
onPointerCancel == null ? void 0 : onPointerCancel(e);
|
|
10373
10392
|
},
|
|
10374
10393
|
[onPointerCancel]
|
|
10375
10394
|
);
|
|
10376
|
-
const handleFocus =
|
|
10395
|
+
const handleFocus = React33.useCallback(
|
|
10377
10396
|
(e) => {
|
|
10378
10397
|
if (!disabled) setIsFocused(true);
|
|
10379
10398
|
onFocus == null ? void 0 : onFocus(e);
|
|
10380
10399
|
},
|
|
10381
10400
|
[disabled, onFocus]
|
|
10382
10401
|
);
|
|
10383
|
-
const handleBlur =
|
|
10402
|
+
const handleBlur = React33.useCallback(
|
|
10384
10403
|
(e) => {
|
|
10385
10404
|
setIsFocused(false);
|
|
10386
10405
|
onBlur == null ? void 0 : onBlur(e);
|
|
@@ -10388,7 +10407,7 @@ var SplitButtonLeadingComponent = React67.forwardRef(
|
|
|
10388
10407
|
[onBlur]
|
|
10389
10408
|
);
|
|
10390
10409
|
const leadingIconSize = LEADING_ICON_SIZE_FOR_SIZE[actualSize];
|
|
10391
|
-
const labelContent = asChild ?
|
|
10410
|
+
const labelContent = asChild ? React33.Children.only(children).props.children : children;
|
|
10392
10411
|
const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10393
10412
|
needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
|
|
10394
10413
|
/* @__PURE__ */ jsx(
|
|
@@ -10446,8 +10465,8 @@ var SplitButtonLeadingComponent = React67.forwardRef(
|
|
|
10446
10465
|
style: mergedStyle,
|
|
10447
10466
|
className: containerClassName
|
|
10448
10467
|
}, restProps), {
|
|
10449
|
-
children:
|
|
10450
|
-
|
|
10468
|
+
children: React33.cloneElement(
|
|
10469
|
+
React33.Children.only(children),
|
|
10451
10470
|
{ children: innerContent }
|
|
10452
10471
|
)
|
|
10453
10472
|
})
|
|
@@ -10480,16 +10499,16 @@ var SplitButtonLeadingComponent = React67.forwardRef(
|
|
|
10480
10499
|
}
|
|
10481
10500
|
);
|
|
10482
10501
|
SplitButtonLeadingComponent.displayName = "SplitButtonLeading";
|
|
10483
|
-
var SplitButtonLeading =
|
|
10484
|
-
var FilledSplitButtonLeading =
|
|
10502
|
+
var SplitButtonLeading = React33.memo(SplitButtonLeadingComponent);
|
|
10503
|
+
var FilledSplitButtonLeading = React33.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonLeading, __spreadValues({ ref, variant: "filled" }, props)));
|
|
10485
10504
|
FilledSplitButtonLeading.displayName = "FilledSplitButtonLeading";
|
|
10486
|
-
var TonalSplitButtonLeading =
|
|
10505
|
+
var TonalSplitButtonLeading = React33.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonLeading, __spreadValues({ ref, variant: "tonal" }, props)));
|
|
10487
10506
|
TonalSplitButtonLeading.displayName = "TonalSplitButtonLeading";
|
|
10488
|
-
var ElevatedSplitButtonLeading =
|
|
10507
|
+
var ElevatedSplitButtonLeading = React33.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonLeading, __spreadValues({ ref, variant: "elevated" }, props)));
|
|
10489
10508
|
ElevatedSplitButtonLeading.displayName = "ElevatedSplitButtonLeading";
|
|
10490
|
-
var OutlinedSplitButtonLeading =
|
|
10509
|
+
var OutlinedSplitButtonLeading = React33.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonLeading, __spreadValues({ ref, variant: "outlined" }, props)));
|
|
10491
10510
|
OutlinedSplitButtonLeading.displayName = "OutlinedSplitButtonLeading";
|
|
10492
|
-
var SplitButtonTrailingComponent =
|
|
10511
|
+
var SplitButtonTrailingComponent = React33.forwardRef(
|
|
10493
10512
|
(_a, ref) => {
|
|
10494
10513
|
var _b = _a, {
|
|
10495
10514
|
className,
|
|
@@ -10534,9 +10553,9 @@ var SplitButtonTrailingComponent = React67.forwardRef(
|
|
|
10534
10553
|
const context = useSplitButtonContext();
|
|
10535
10554
|
const actualSize = (_a2 = context == null ? void 0 : context.size) != null ? _a2 : size;
|
|
10536
10555
|
const actualVariant = (_b2 = context == null ? void 0 : context.variant) != null ? _b2 : variant;
|
|
10537
|
-
const [isHovered, setIsHovered] =
|
|
10538
|
-
const [isFocused, setIsFocused] =
|
|
10539
|
-
const [isPressed, setIsPressed] =
|
|
10556
|
+
const [isHovered, setIsHovered] = React33.useState(false);
|
|
10557
|
+
const [isFocused, setIsFocused] = React33.useState(false);
|
|
10558
|
+
const [isPressed, setIsPressed] = React33.useState(false);
|
|
10540
10559
|
const tokens = SPLIT_BUTTON_TOKENS[actualSize];
|
|
10541
10560
|
const prefersReducedMotion2 = useReducedMotion();
|
|
10542
10561
|
const needsTouchTarget = actualSize === "xs" || actualSize === "sm";
|
|
@@ -10548,12 +10567,12 @@ var SplitButtonTrailingComponent = React67.forwardRef(
|
|
|
10548
10567
|
const innerCornerRadius = isPressed || isFocused ? tokens.innerCorner.pressed : isHovered ? tokens.innerCorner.hovered : tokens.innerCorner.default;
|
|
10549
10568
|
const outerRadius = tokens.containerHeight * tokens.outerCornerPercent / 100;
|
|
10550
10569
|
const borderRadius = checked ? `${outerRadius}px ${outerRadius}px ${outerRadius}px ${outerRadius}px` : `${innerCornerRadius}px ${outerRadius}px ${outerRadius}px ${innerCornerRadius}px`;
|
|
10551
|
-
const handleToggle =
|
|
10570
|
+
const handleToggle = React33.useCallback(() => {
|
|
10552
10571
|
if (!disabled) {
|
|
10553
10572
|
onCheckedChange(!checked);
|
|
10554
10573
|
}
|
|
10555
10574
|
}, [disabled, checked, onCheckedChange]);
|
|
10556
|
-
const handlePointerDown =
|
|
10575
|
+
const handlePointerDown = React33.useCallback(
|
|
10557
10576
|
(e) => {
|
|
10558
10577
|
onRipplePointerDown(e);
|
|
10559
10578
|
setIsPressed(true);
|
|
@@ -10561,19 +10580,19 @@ var SplitButtonTrailingComponent = React67.forwardRef(
|
|
|
10561
10580
|
},
|
|
10562
10581
|
[onRipplePointerDown, onPointerDown]
|
|
10563
10582
|
);
|
|
10564
|
-
const handlePointerUp =
|
|
10583
|
+
const handlePointerUp = React33.useCallback(
|
|
10565
10584
|
(e) => {
|
|
10566
10585
|
setIsPressed(false);
|
|
10567
10586
|
onPointerUp == null ? void 0 : onPointerUp(e);
|
|
10568
10587
|
},
|
|
10569
10588
|
[onPointerUp]
|
|
10570
10589
|
);
|
|
10571
|
-
const handlePointerEnter =
|
|
10590
|
+
const handlePointerEnter = React33.useCallback(() => {
|
|
10572
10591
|
if (!disabled) {
|
|
10573
10592
|
setIsHovered(true);
|
|
10574
10593
|
}
|
|
10575
10594
|
}, [disabled]);
|
|
10576
|
-
const handlePointerLeave =
|
|
10595
|
+
const handlePointerLeave = React33.useCallback(
|
|
10577
10596
|
(e) => {
|
|
10578
10597
|
setIsHovered(false);
|
|
10579
10598
|
setIsPressed(false);
|
|
@@ -10581,21 +10600,21 @@ var SplitButtonTrailingComponent = React67.forwardRef(
|
|
|
10581
10600
|
},
|
|
10582
10601
|
[onPointerLeave]
|
|
10583
10602
|
);
|
|
10584
|
-
const handlePointerCancel =
|
|
10603
|
+
const handlePointerCancel = React33.useCallback(
|
|
10585
10604
|
(e) => {
|
|
10586
10605
|
setIsPressed(false);
|
|
10587
10606
|
onPointerCancel == null ? void 0 : onPointerCancel(e);
|
|
10588
10607
|
},
|
|
10589
10608
|
[onPointerCancel]
|
|
10590
10609
|
);
|
|
10591
|
-
const handleFocus =
|
|
10610
|
+
const handleFocus = React33.useCallback(
|
|
10592
10611
|
(e) => {
|
|
10593
10612
|
if (!disabled) setIsFocused(true);
|
|
10594
10613
|
onFocus == null ? void 0 : onFocus(e);
|
|
10595
10614
|
},
|
|
10596
10615
|
[disabled, onFocus]
|
|
10597
10616
|
);
|
|
10598
|
-
const handleBlur =
|
|
10617
|
+
const handleBlur = React33.useCallback(
|
|
10599
10618
|
(e) => {
|
|
10600
10619
|
setIsFocused(false);
|
|
10601
10620
|
onBlur == null ? void 0 : onBlur(e);
|
|
@@ -10670,8 +10689,8 @@ var SplitButtonTrailingComponent = React67.forwardRef(
|
|
|
10670
10689
|
style: mergedStyle,
|
|
10671
10690
|
className: containerClassName
|
|
10672
10691
|
}, restProps), {
|
|
10673
|
-
children:
|
|
10674
|
-
|
|
10692
|
+
children: React33.cloneElement(
|
|
10693
|
+
React33.Children.only(children),
|
|
10675
10694
|
{ children: innerContent }
|
|
10676
10695
|
)
|
|
10677
10696
|
})
|
|
@@ -10708,16 +10727,16 @@ var SplitButtonTrailingComponent = React67.forwardRef(
|
|
|
10708
10727
|
}
|
|
10709
10728
|
);
|
|
10710
10729
|
SplitButtonTrailingComponent.displayName = "SplitButtonTrailing";
|
|
10711
|
-
var SplitButtonTrailing =
|
|
10712
|
-
var FilledSplitButtonTrailing =
|
|
10730
|
+
var SplitButtonTrailing = React33.memo(SplitButtonTrailingComponent);
|
|
10731
|
+
var FilledSplitButtonTrailing = React33.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "filled" }, props)));
|
|
10713
10732
|
FilledSplitButtonTrailing.displayName = "FilledSplitButtonTrailing";
|
|
10714
|
-
var TonalSplitButtonTrailing =
|
|
10733
|
+
var TonalSplitButtonTrailing = React33.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "tonal" }, props)));
|
|
10715
10734
|
TonalSplitButtonTrailing.displayName = "TonalSplitButtonTrailing";
|
|
10716
|
-
var ElevatedSplitButtonTrailing =
|
|
10735
|
+
var ElevatedSplitButtonTrailing = React33.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "elevated" }, props)));
|
|
10717
10736
|
ElevatedSplitButtonTrailing.displayName = "ElevatedSplitButtonTrailing";
|
|
10718
|
-
var OutlinedSplitButtonTrailing =
|
|
10737
|
+
var OutlinedSplitButtonTrailing = React33.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "outlined" }, props)));
|
|
10719
10738
|
OutlinedSplitButtonTrailing.displayName = "OutlinedSplitButtonTrailing";
|
|
10720
|
-
var SplitButtonTrailingUncheckableComponent =
|
|
10739
|
+
var SplitButtonTrailingUncheckableComponent = React33.forwardRef(
|
|
10721
10740
|
(_a, ref) => {
|
|
10722
10741
|
var _b = _a, {
|
|
10723
10742
|
className,
|
|
@@ -10754,9 +10773,9 @@ var SplitButtonTrailingUncheckableComponent = React67.forwardRef(
|
|
|
10754
10773
|
const context = useSplitButtonContext();
|
|
10755
10774
|
const actualSize = (_a2 = context == null ? void 0 : context.size) != null ? _a2 : size;
|
|
10756
10775
|
const actualVariant = (_b2 = context == null ? void 0 : context.variant) != null ? _b2 : variant;
|
|
10757
|
-
const [isHovered, setIsHovered] =
|
|
10758
|
-
const [isFocused, setIsFocused] =
|
|
10759
|
-
const [isPressed, setIsPressed] =
|
|
10776
|
+
const [isHovered, setIsHovered] = React33.useState(false);
|
|
10777
|
+
const [isFocused, setIsFocused] = React33.useState(false);
|
|
10778
|
+
const [isPressed, setIsPressed] = React33.useState(false);
|
|
10760
10779
|
const tokens = SPLIT_BUTTON_TOKENS[actualSize];
|
|
10761
10780
|
const prefersReducedMotion2 = useReducedMotion();
|
|
10762
10781
|
const needsTouchTarget = actualSize === "xs" || actualSize === "sm";
|
|
@@ -10768,7 +10787,7 @@ var SplitButtonTrailingUncheckableComponent = React67.forwardRef(
|
|
|
10768
10787
|
const innerCornerRadius = isPressed || isFocused ? tokens.innerCorner.pressed : isHovered ? tokens.innerCorner.hovered : tokens.innerCorner.default;
|
|
10769
10788
|
const outerRadius = tokens.containerHeight * tokens.outerCornerPercent / 100;
|
|
10770
10789
|
const borderRadius = `${innerCornerRadius}px ${outerRadius}px ${outerRadius}px ${innerCornerRadius}px`;
|
|
10771
|
-
const handlePointerDown =
|
|
10790
|
+
const handlePointerDown = React33.useCallback(
|
|
10772
10791
|
(e) => {
|
|
10773
10792
|
onRipplePointerDown(e);
|
|
10774
10793
|
setIsPressed(true);
|
|
@@ -10776,19 +10795,19 @@ var SplitButtonTrailingUncheckableComponent = React67.forwardRef(
|
|
|
10776
10795
|
},
|
|
10777
10796
|
[onRipplePointerDown, onPointerDown]
|
|
10778
10797
|
);
|
|
10779
|
-
const handlePointerUp =
|
|
10798
|
+
const handlePointerUp = React33.useCallback(
|
|
10780
10799
|
(e) => {
|
|
10781
10800
|
setIsPressed(false);
|
|
10782
10801
|
onPointerUp == null ? void 0 : onPointerUp(e);
|
|
10783
10802
|
},
|
|
10784
10803
|
[onPointerUp]
|
|
10785
10804
|
);
|
|
10786
|
-
const handlePointerEnter =
|
|
10805
|
+
const handlePointerEnter = React33.useCallback(() => {
|
|
10787
10806
|
if (!disabled) {
|
|
10788
10807
|
setIsHovered(true);
|
|
10789
10808
|
}
|
|
10790
10809
|
}, [disabled]);
|
|
10791
|
-
const handlePointerLeave =
|
|
10810
|
+
const handlePointerLeave = React33.useCallback(
|
|
10792
10811
|
(e) => {
|
|
10793
10812
|
setIsHovered(false);
|
|
10794
10813
|
setIsPressed(false);
|
|
@@ -10796,21 +10815,21 @@ var SplitButtonTrailingUncheckableComponent = React67.forwardRef(
|
|
|
10796
10815
|
},
|
|
10797
10816
|
[onPointerLeave]
|
|
10798
10817
|
);
|
|
10799
|
-
const handlePointerCancel =
|
|
10818
|
+
const handlePointerCancel = React33.useCallback(
|
|
10800
10819
|
(e) => {
|
|
10801
10820
|
setIsPressed(false);
|
|
10802
10821
|
onPointerCancel == null ? void 0 : onPointerCancel(e);
|
|
10803
10822
|
},
|
|
10804
10823
|
[onPointerCancel]
|
|
10805
10824
|
);
|
|
10806
|
-
const handleFocus =
|
|
10825
|
+
const handleFocus = React33.useCallback(
|
|
10807
10826
|
(e) => {
|
|
10808
10827
|
if (!disabled) setIsFocused(true);
|
|
10809
10828
|
onFocus == null ? void 0 : onFocus(e);
|
|
10810
10829
|
},
|
|
10811
10830
|
[disabled, onFocus]
|
|
10812
10831
|
);
|
|
10813
|
-
const handleBlur =
|
|
10832
|
+
const handleBlur = React33.useCallback(
|
|
10814
10833
|
(e) => {
|
|
10815
10834
|
setIsFocused(false);
|
|
10816
10835
|
onBlur == null ? void 0 : onBlur(e);
|
|
@@ -10878,19 +10897,17 @@ var SplitButtonTrailingUncheckableComponent = React67.forwardRef(
|
|
|
10878
10897
|
}
|
|
10879
10898
|
);
|
|
10880
10899
|
SplitButtonTrailingUncheckableComponent.displayName = "SplitButtonTrailingUncheckable";
|
|
10881
|
-
var SplitButtonTrailingUncheckable =
|
|
10900
|
+
var SplitButtonTrailingUncheckable = React33.memo(
|
|
10882
10901
|
SplitButtonTrailingUncheckableComponent
|
|
10883
10902
|
);
|
|
10884
|
-
var FilledSplitButtonTrailingUncheckable =
|
|
10903
|
+
var FilledSplitButtonTrailingUncheckable = React33.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "filled" }, props)));
|
|
10885
10904
|
FilledSplitButtonTrailingUncheckable.displayName = "FilledSplitButtonTrailingUncheckable";
|
|
10886
|
-
var TonalSplitButtonTrailingUncheckable =
|
|
10905
|
+
var TonalSplitButtonTrailingUncheckable = React33.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "tonal" }, props)));
|
|
10887
10906
|
TonalSplitButtonTrailingUncheckable.displayName = "TonalSplitButtonTrailingUncheckable";
|
|
10888
|
-
var ElevatedSplitButtonTrailingUncheckable =
|
|
10907
|
+
var ElevatedSplitButtonTrailingUncheckable = React33.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "elevated" }, props)));
|
|
10889
10908
|
ElevatedSplitButtonTrailingUncheckable.displayName = "ElevatedSplitButtonTrailingUncheckable";
|
|
10890
|
-
var OutlinedSplitButtonTrailingUncheckable =
|
|
10909
|
+
var OutlinedSplitButtonTrailingUncheckable = React33.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "outlined" }, props)));
|
|
10891
10910
|
OutlinedSplitButtonTrailingUncheckable.displayName = "OutlinedSplitButtonTrailingUncheckable";
|
|
10892
|
-
|
|
10893
|
-
// src/ui/cards/card/card-tokens.ts
|
|
10894
10911
|
var SHADOW = {
|
|
10895
10912
|
level0: "none",
|
|
10896
10913
|
level1: "0px 1px 2px 0px rgba(0,0,0,.3), 0px 1px 3px 1px rgba(0,0,0,.15)",
|
|
@@ -10993,6 +11010,45 @@ function useCardElevation({
|
|
|
10993
11010
|
}
|
|
10994
11011
|
};
|
|
10995
11012
|
}
|
|
11013
|
+
function resolveCornerRadius(level, fallback, maxPillRadius) {
|
|
11014
|
+
if (level === void 0) return `${fallback}px`;
|
|
11015
|
+
if (typeof level === "number") return `${level}px`;
|
|
11016
|
+
if (level === "full" && maxPillRadius !== void 0 && maxPillRadius > 0) {
|
|
11017
|
+
return `${maxPillRadius}px`;
|
|
11018
|
+
}
|
|
11019
|
+
if (level in cornerRadius) {
|
|
11020
|
+
return `${cornerRadius[level]}px`;
|
|
11021
|
+
}
|
|
11022
|
+
return `${fallback}px`;
|
|
11023
|
+
}
|
|
11024
|
+
function useCardMorphRadius({
|
|
11025
|
+
morphRadius,
|
|
11026
|
+
disabled = false,
|
|
11027
|
+
isInteractive = false,
|
|
11028
|
+
isForceMotion = false,
|
|
11029
|
+
hoverEffect = true,
|
|
11030
|
+
maxPillRadius
|
|
11031
|
+
}) {
|
|
11032
|
+
if (!morphRadius) return null;
|
|
11033
|
+
if (!isInteractive && !isForceMotion) return null;
|
|
11034
|
+
const config = typeof morphRadius === "object" ? morphRadius : {};
|
|
11035
|
+
const restRadius = resolveCornerRadius(
|
|
11036
|
+
config.rest,
|
|
11037
|
+
cornerRadius.large,
|
|
11038
|
+
maxPillRadius
|
|
11039
|
+
);
|
|
11040
|
+
const hoverRadius = hoverEffect ? resolveCornerRadius(config.hover, cornerRadius.extraLarge, maxPillRadius) : restRadius;
|
|
11041
|
+
const pressedRadius = config.pressed !== void 0 ? resolveCornerRadius(config.pressed, cornerRadius.large, maxPillRadius) : restRadius;
|
|
11042
|
+
return {
|
|
11043
|
+
animate: { borderRadius: restRadius },
|
|
11044
|
+
whileHover: disabled || !hoverEffect ? void 0 : { borderRadius: hoverRadius },
|
|
11045
|
+
whileTap: disabled ? void 0 : { borderRadius: pressedRadius },
|
|
11046
|
+
whileFocus: disabled || !hoverEffect ? void 0 : { borderRadius: hoverRadius },
|
|
11047
|
+
transition: {
|
|
11048
|
+
borderRadius: framerSprings.fast.spatial
|
|
11049
|
+
}
|
|
11050
|
+
};
|
|
11051
|
+
}
|
|
10996
11052
|
var cardVariants = cva(
|
|
10997
11053
|
"rounded-m3-lg flex flex-col relative overflow-hidden transition-all duration-200",
|
|
10998
11054
|
{
|
|
@@ -11009,7 +11065,7 @@ var cardVariants = cva(
|
|
|
11009
11065
|
defaultVariants: { variant: "elevated" }
|
|
11010
11066
|
}
|
|
11011
11067
|
);
|
|
11012
|
-
var CardImpl =
|
|
11068
|
+
var CardImpl = React33.forwardRef(
|
|
11013
11069
|
(_a, ref) => {
|
|
11014
11070
|
var _b = _a, {
|
|
11015
11071
|
className,
|
|
@@ -11036,6 +11092,8 @@ var CardImpl = React67.forwardRef(
|
|
|
11036
11092
|
whileDrag,
|
|
11037
11093
|
transition,
|
|
11038
11094
|
asChild = false,
|
|
11095
|
+
morphRadius = false,
|
|
11096
|
+
forceMotion = false,
|
|
11039
11097
|
children
|
|
11040
11098
|
} = _b, props = __objRest(_b, [
|
|
11041
11099
|
"className",
|
|
@@ -11062,6 +11120,8 @@ var CardImpl = React67.forwardRef(
|
|
|
11062
11120
|
"whileDrag",
|
|
11063
11121
|
"transition",
|
|
11064
11122
|
"asChild",
|
|
11123
|
+
"morphRadius",
|
|
11124
|
+
"forceMotion",
|
|
11065
11125
|
"children"
|
|
11066
11126
|
]);
|
|
11067
11127
|
const safeVariant = variant || "elevated";
|
|
@@ -11069,6 +11129,39 @@ var CardImpl = React67.forwardRef(
|
|
|
11069
11129
|
const isHoverEnabled = hoverEffect !== false && !disableHoverEffect;
|
|
11070
11130
|
const isRippleEnabled = ripple !== false && !disableRipple && isInteractive && !disabled;
|
|
11071
11131
|
const isStateLayerEnabled = stateLayer !== false && !disableStateLayer && isInteractive && !disabled;
|
|
11132
|
+
const containerRef = React33.useRef(null);
|
|
11133
|
+
const setRefs = React33.useCallback(
|
|
11134
|
+
(node) => {
|
|
11135
|
+
containerRef.current = node;
|
|
11136
|
+
if (typeof ref === "function") {
|
|
11137
|
+
ref(node);
|
|
11138
|
+
} else if (ref) {
|
|
11139
|
+
ref.current = node;
|
|
11140
|
+
}
|
|
11141
|
+
},
|
|
11142
|
+
[ref]
|
|
11143
|
+
);
|
|
11144
|
+
const hasFullRadius = typeof morphRadius === "object" && (morphRadius.rest === "full" || morphRadius.hover === "full" || morphRadius.pressed === "full");
|
|
11145
|
+
const [pillRadius, setPillRadius] = React33.useState(
|
|
11146
|
+
void 0
|
|
11147
|
+
);
|
|
11148
|
+
React33.useEffect(() => {
|
|
11149
|
+
if (!hasFullRadius || !containerRef.current) return;
|
|
11150
|
+
const el = containerRef.current;
|
|
11151
|
+
const updateRadius = () => {
|
|
11152
|
+
const h = el.offsetHeight;
|
|
11153
|
+
const w = el.offsetWidth;
|
|
11154
|
+
if (h > 0 && w > 0) {
|
|
11155
|
+
setPillRadius(Math.ceil(Math.min(h, w) / 2));
|
|
11156
|
+
}
|
|
11157
|
+
};
|
|
11158
|
+
updateRadius();
|
|
11159
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
11160
|
+
const ro = new ResizeObserver(updateRadius);
|
|
11161
|
+
ro.observe(el);
|
|
11162
|
+
return () => ro.disconnect();
|
|
11163
|
+
}
|
|
11164
|
+
}, [hasFullRadius]);
|
|
11072
11165
|
const elevationProps = useCardElevation({
|
|
11073
11166
|
variant: safeVariant,
|
|
11074
11167
|
disabled,
|
|
@@ -11077,6 +11170,14 @@ var CardImpl = React67.forwardRef(
|
|
|
11077
11170
|
disableElevation,
|
|
11078
11171
|
hoverEffect: isHoverEnabled
|
|
11079
11172
|
});
|
|
11173
|
+
const morphRadiusProps = useCardMorphRadius({
|
|
11174
|
+
morphRadius,
|
|
11175
|
+
disabled,
|
|
11176
|
+
isInteractive,
|
|
11177
|
+
isForceMotion: forceMotion,
|
|
11178
|
+
hoverEffect: isHoverEnabled,
|
|
11179
|
+
maxPillRadius: pillRadius
|
|
11180
|
+
});
|
|
11080
11181
|
const {
|
|
11081
11182
|
ripples,
|
|
11082
11183
|
onPointerDown: rippleOnPointerDown,
|
|
@@ -11090,8 +11191,10 @@ var CardImpl = React67.forwardRef(
|
|
|
11090
11191
|
event
|
|
11091
11192
|
);
|
|
11092
11193
|
};
|
|
11194
|
+
const rawVariants = cardVariants({ variant: safeVariant });
|
|
11195
|
+
const variantClass = morphRadiusProps ? rawVariants.replace("rounded-m3-lg", "").replace("transition-all", "") : rawVariants;
|
|
11093
11196
|
const baseClass = cn(
|
|
11094
|
-
|
|
11197
|
+
variantClass,
|
|
11095
11198
|
// Disabled state:
|
|
11096
11199
|
// - pointer-events-none → disable interactions completely
|
|
11097
11200
|
// - opacity-[0.38] → MD3 DisabledContainerOpacity
|
|
@@ -11111,13 +11214,14 @@ var CardImpl = React67.forwardRef(
|
|
|
11111
11214
|
// Outlined interactive card: smooth transition of border color to m3-outline on hover/focus/press
|
|
11112
11215
|
safeVariant === "outlined" && "transition-colors duration-200 hover:border-m3-outline focus-visible:border-m3-outline active:border-m3-outline"
|
|
11113
11216
|
);
|
|
11114
|
-
const
|
|
11115
|
-
const
|
|
11116
|
-
const
|
|
11217
|
+
const mergedAnimate = __spreadValues(__spreadValues({}, elevationProps.animate), (morphRadiusProps == null ? void 0 : morphRadiusProps.animate) || {});
|
|
11218
|
+
const mergedWhileHover = elevationProps.whileHover || (morphRadiusProps == null ? void 0 : morphRadiusProps.whileHover) || whileHover ? __spreadValues(__spreadValues(__spreadValues({}, elevationProps.whileHover), morphRadiusProps == null ? void 0 : morphRadiusProps.whileHover), typeof whileHover === "object" ? whileHover : {}) : void 0;
|
|
11219
|
+
const mergedWhileTap = elevationProps.whileTap || (morphRadiusProps == null ? void 0 : morphRadiusProps.whileTap) || whileTap ? __spreadValues(__spreadValues(__spreadValues({}, elevationProps.whileTap), morphRadiusProps == null ? void 0 : morphRadiusProps.whileTap), typeof whileTap === "object" ? whileTap : {}) : void 0;
|
|
11220
|
+
const mergedWhileFocus = elevationProps.whileFocus || (morphRadiusProps == null ? void 0 : morphRadiusProps.whileFocus) || whileFocus ? __spreadValues(__spreadValues(__spreadValues({}, elevationProps.whileFocus), morphRadiusProps == null ? void 0 : morphRadiusProps.whileFocus), typeof whileFocus === "object" ? whileFocus : {}) : void 0;
|
|
11117
11221
|
const mergedWhileDrag = elevationProps.whileDrag || whileDrag ? __spreadValues(__spreadValues({}, elevationProps.whileDrag), typeof whileDrag === "object" ? whileDrag : {}) : void 0;
|
|
11118
|
-
const mergedTransition = elevationProps.transition || transition ? __spreadValues(__spreadValues({}, elevationProps.transition), typeof transition === "object" ? transition : {}) : void 0;
|
|
11222
|
+
const mergedTransition = elevationProps.transition || (morphRadiusProps == null ? void 0 : morphRadiusProps.transition) || transition ? __spreadValues(__spreadValues(__spreadValues({}, elevationProps.transition), morphRadiusProps == null ? void 0 : morphRadiusProps.transition), typeof transition === "object" ? transition : {}) : void 0;
|
|
11119
11223
|
if (asChild) {
|
|
11120
|
-
const child =
|
|
11224
|
+
const child = React33.Children.only(children);
|
|
11121
11225
|
const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11122
11226
|
isRippleEnabled && /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
11123
11227
|
child.props.children
|
|
@@ -11125,22 +11229,40 @@ var CardImpl = React67.forwardRef(
|
|
|
11125
11229
|
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
|
|
11126
11230
|
Slot,
|
|
11127
11231
|
__spreadProps(__spreadValues({
|
|
11128
|
-
ref,
|
|
11232
|
+
ref: setRefs,
|
|
11129
11233
|
className: cn(baseClass, interactiveClass),
|
|
11130
11234
|
"aria-disabled": disabled ? true : void 0,
|
|
11131
11235
|
tabIndex: disabled ? -1 : 0,
|
|
11132
11236
|
onPointerDown: handlePointerDown,
|
|
11133
11237
|
onClick
|
|
11134
11238
|
}, props), {
|
|
11135
|
-
children:
|
|
11239
|
+
children: React33.cloneElement(child, { children: innerContent })
|
|
11136
11240
|
})
|
|
11137
11241
|
) });
|
|
11138
11242
|
}
|
|
11139
11243
|
if (!isInteractive) {
|
|
11244
|
+
if (forceMotion && morphRadiusProps) {
|
|
11245
|
+
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
|
|
11246
|
+
m.div,
|
|
11247
|
+
__spreadProps(__spreadValues({
|
|
11248
|
+
ref: setRefs,
|
|
11249
|
+
className: baseClass,
|
|
11250
|
+
"aria-disabled": disabled ? true : void 0,
|
|
11251
|
+
animate: mergedAnimate,
|
|
11252
|
+
whileHover: mergedWhileHover,
|
|
11253
|
+
whileTap: mergedWhileTap,
|
|
11254
|
+
whileFocus: mergedWhileFocus,
|
|
11255
|
+
whileDrag: mergedWhileDrag,
|
|
11256
|
+
transition: mergedTransition
|
|
11257
|
+
}, props), {
|
|
11258
|
+
children
|
|
11259
|
+
})
|
|
11260
|
+
) });
|
|
11261
|
+
}
|
|
11140
11262
|
return /* @__PURE__ */ jsx(
|
|
11141
11263
|
"div",
|
|
11142
11264
|
__spreadProps(__spreadValues({
|
|
11143
|
-
ref,
|
|
11265
|
+
ref: setRefs,
|
|
11144
11266
|
className: baseClass,
|
|
11145
11267
|
style: __spreadValues({
|
|
11146
11268
|
boxShadow: elevationProps.animate.boxShadow
|
|
@@ -11156,7 +11278,7 @@ var CardImpl = React67.forwardRef(
|
|
|
11156
11278
|
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
|
|
11157
11279
|
m.a,
|
|
11158
11280
|
__spreadProps(__spreadValues({
|
|
11159
|
-
ref,
|
|
11281
|
+
ref: setRefs,
|
|
11160
11282
|
href: disabled ? void 0 : href,
|
|
11161
11283
|
target,
|
|
11162
11284
|
rel: safeRel,
|
|
@@ -11164,7 +11286,7 @@ var CardImpl = React67.forwardRef(
|
|
|
11164
11286
|
"aria-disabled": disabled ? true : void 0,
|
|
11165
11287
|
tabIndex: disabled ? -1 : 0,
|
|
11166
11288
|
onPointerDown: handlePointerDown,
|
|
11167
|
-
animate:
|
|
11289
|
+
animate: mergedAnimate,
|
|
11168
11290
|
whileHover: mergedWhileHover,
|
|
11169
11291
|
whileTap: mergedWhileTap,
|
|
11170
11292
|
whileFocus: mergedWhileFocus,
|
|
@@ -11181,7 +11303,7 @@ var CardImpl = React67.forwardRef(
|
|
|
11181
11303
|
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
|
|
11182
11304
|
m.button,
|
|
11183
11305
|
__spreadProps(__spreadValues({
|
|
11184
|
-
ref,
|
|
11306
|
+
ref: setRefs,
|
|
11185
11307
|
type: "button",
|
|
11186
11308
|
disabled,
|
|
11187
11309
|
onClick,
|
|
@@ -11189,7 +11311,7 @@ var CardImpl = React67.forwardRef(
|
|
|
11189
11311
|
"aria-disabled": disabled ? true : void 0,
|
|
11190
11312
|
tabIndex: disabled ? -1 : 0,
|
|
11191
11313
|
onPointerDown: handlePointerDown,
|
|
11192
|
-
animate:
|
|
11314
|
+
animate: mergedAnimate,
|
|
11193
11315
|
whileHover: mergedWhileHover,
|
|
11194
11316
|
whileTap: mergedWhileTap,
|
|
11195
11317
|
whileFocus: mergedWhileFocus,
|
|
@@ -11205,8 +11327,8 @@ var CardImpl = React67.forwardRef(
|
|
|
11205
11327
|
}
|
|
11206
11328
|
);
|
|
11207
11329
|
CardImpl.displayName = "Card";
|
|
11208
|
-
var Card =
|
|
11209
|
-
var CardHeader =
|
|
11330
|
+
var Card = React33.memo(CardImpl);
|
|
11331
|
+
var CardHeader = React33.forwardRef(
|
|
11210
11332
|
(_a, ref) => {
|
|
11211
11333
|
var _b = _a, { className, avatar, title, subheader, action, children } = _b, props = __objRest(_b, ["className", "avatar", "title", "subheader", "action", "children"]);
|
|
11212
11334
|
return /* @__PURE__ */ jsxs(
|
|
@@ -11238,7 +11360,7 @@ var ASPECT_RATIO_CLASSES = {
|
|
|
11238
11360
|
wide: "aspect-[21/9]",
|
|
11239
11361
|
auto: ""
|
|
11240
11362
|
};
|
|
11241
|
-
var CardMedia =
|
|
11363
|
+
var CardMedia = React33.forwardRef(
|
|
11242
11364
|
(_a, ref) => {
|
|
11243
11365
|
var _b = _a, {
|
|
11244
11366
|
className,
|
|
@@ -11280,7 +11402,7 @@ var CardMedia = React67.forwardRef(
|
|
|
11280
11402
|
}
|
|
11281
11403
|
);
|
|
11282
11404
|
CardMedia.displayName = "CardMedia";
|
|
11283
|
-
var CardContent =
|
|
11405
|
+
var CardContent = React33.forwardRef(
|
|
11284
11406
|
(_a, ref) => {
|
|
11285
11407
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
11286
11408
|
return /* @__PURE__ */ jsx(
|
|
@@ -11304,7 +11426,7 @@ var ALIGN_CLASSES = {
|
|
|
11304
11426
|
end: "justify-end",
|
|
11305
11427
|
between: "justify-between"
|
|
11306
11428
|
};
|
|
11307
|
-
var CardFooter =
|
|
11429
|
+
var CardFooter = React33.forwardRef(
|
|
11308
11430
|
(_a, ref) => {
|
|
11309
11431
|
var _b = _a, { className, align = "end", children } = _b, props = __objRest(_b, ["className", "align", "children"]);
|
|
11310
11432
|
return /* @__PURE__ */ jsx(
|
|
@@ -11376,14 +11498,14 @@ function CarouselGrid(_a) {
|
|
|
11376
11498
|
style: gridStyle,
|
|
11377
11499
|
"aria-label": "Expanded carousel grid"
|
|
11378
11500
|
}, props), {
|
|
11379
|
-
children:
|
|
11380
|
-
const childKey =
|
|
11501
|
+
children: React33.Children.map(children, (child, index) => {
|
|
11502
|
+
const childKey = React33.isValidElement(child) && child.key != null ? child.key : index;
|
|
11381
11503
|
return /* @__PURE__ */ jsx("div", { style: itemStyle, children: child }, childKey);
|
|
11382
11504
|
})
|
|
11383
11505
|
})
|
|
11384
11506
|
);
|
|
11385
11507
|
}
|
|
11386
|
-
var CarouselItem =
|
|
11508
|
+
var CarouselItem = React33.forwardRef(
|
|
11387
11509
|
function CarouselItem2(_a, ref) {
|
|
11388
11510
|
var _b = _a, {
|
|
11389
11511
|
index,
|
|
@@ -11939,13 +12061,13 @@ function CarouselScrollClient(_a) {
|
|
|
11939
12061
|
"className",
|
|
11940
12062
|
"style"
|
|
11941
12063
|
]);
|
|
11942
|
-
const trackRef =
|
|
11943
|
-
const [containerWidth, setContainerWidth] =
|
|
11944
|
-
const rafIdRef =
|
|
11945
|
-
const isDraggingRef =
|
|
11946
|
-
const hasMovedRef =
|
|
11947
|
-
const startPosRef =
|
|
11948
|
-
const startScrollRef =
|
|
12064
|
+
const trackRef = React33.useRef(null);
|
|
12065
|
+
const [containerWidth, setContainerWidth] = React33.useState(600);
|
|
12066
|
+
const rafIdRef = React33.useRef(null);
|
|
12067
|
+
const isDraggingRef = React33.useRef(false);
|
|
12068
|
+
const hasMovedRef = React33.useRef(false);
|
|
12069
|
+
const startPosRef = React33.useRef(0);
|
|
12070
|
+
const startScrollRef = React33.useRef(0);
|
|
11949
12071
|
const keylines = useCarouselKeylines({
|
|
11950
12072
|
containerWidth,
|
|
11951
12073
|
preferredItemWidth,
|
|
@@ -11954,7 +12076,7 @@ function CarouselScrollClient(_a) {
|
|
|
11954
12076
|
contentPadding,
|
|
11955
12077
|
totalItems: totalItemsCount
|
|
11956
12078
|
});
|
|
11957
|
-
const handleScroll =
|
|
12079
|
+
const handleScroll = React33.useCallback(() => {
|
|
11958
12080
|
if (rafIdRef.current !== null) return;
|
|
11959
12081
|
rafIdRef.current = requestAnimationFrame(() => {
|
|
11960
12082
|
var _a2, _b2;
|
|
@@ -12013,7 +12135,7 @@ function CarouselScrollClient(_a) {
|
|
|
12013
12135
|
keylines.smallWidth,
|
|
12014
12136
|
contentPadding
|
|
12015
12137
|
]);
|
|
12016
|
-
|
|
12138
|
+
React33.useEffect(() => {
|
|
12017
12139
|
const track = trackRef.current;
|
|
12018
12140
|
if (!track) return;
|
|
12019
12141
|
const updateWidth = () => {
|
|
@@ -12026,17 +12148,17 @@ function CarouselScrollClient(_a) {
|
|
|
12026
12148
|
observer.observe(track);
|
|
12027
12149
|
return () => observer.disconnect();
|
|
12028
12150
|
}, []);
|
|
12029
|
-
|
|
12151
|
+
React33.useEffect(() => {
|
|
12030
12152
|
handleScroll();
|
|
12031
12153
|
}, [handleScroll]);
|
|
12032
|
-
|
|
12154
|
+
React33.useEffect(() => {
|
|
12033
12155
|
return () => {
|
|
12034
12156
|
if (rafIdRef.current !== null) {
|
|
12035
12157
|
cancelAnimationFrame(rafIdRef.current);
|
|
12036
12158
|
}
|
|
12037
12159
|
};
|
|
12038
12160
|
}, []);
|
|
12039
|
-
const handlePointerDown =
|
|
12161
|
+
const handlePointerDown = React33.useCallback(
|
|
12040
12162
|
(e) => {
|
|
12041
12163
|
var _a2, _b2;
|
|
12042
12164
|
if (!userScrollEnabled || e.button !== 0) return;
|
|
@@ -12053,7 +12175,7 @@ function CarouselScrollClient(_a) {
|
|
|
12053
12175
|
},
|
|
12054
12176
|
[userScrollEnabled, layout]
|
|
12055
12177
|
);
|
|
12056
|
-
const handlePointerMove =
|
|
12178
|
+
const handlePointerMove = React33.useCallback(
|
|
12057
12179
|
(e) => {
|
|
12058
12180
|
if (!isDraggingRef.current || !trackRef.current) return;
|
|
12059
12181
|
const currentPos = layout === "full-screen" ? e.clientY : e.clientX;
|
|
@@ -12071,7 +12193,7 @@ function CarouselScrollClient(_a) {
|
|
|
12071
12193
|
},
|
|
12072
12194
|
[layout]
|
|
12073
12195
|
);
|
|
12074
|
-
const handlePointerUp =
|
|
12196
|
+
const handlePointerUp = React33.useCallback(
|
|
12075
12197
|
(e) => {
|
|
12076
12198
|
var _a2, _b2;
|
|
12077
12199
|
if (!isDraggingRef.current) return;
|
|
@@ -12083,14 +12205,14 @@ function CarouselScrollClient(_a) {
|
|
|
12083
12205
|
},
|
|
12084
12206
|
[]
|
|
12085
12207
|
);
|
|
12086
|
-
const handleClickCapture =
|
|
12208
|
+
const handleClickCapture = React33.useCallback((e) => {
|
|
12087
12209
|
if (hasMovedRef.current) {
|
|
12088
12210
|
e.stopPropagation();
|
|
12089
12211
|
e.preventDefault();
|
|
12090
12212
|
hasMovedRef.current = false;
|
|
12091
12213
|
}
|
|
12092
12214
|
}, []);
|
|
12093
|
-
const scrollToIndex =
|
|
12215
|
+
const scrollToIndex = React33.useCallback(
|
|
12094
12216
|
(index) => {
|
|
12095
12217
|
const track = trackRef.current;
|
|
12096
12218
|
if (!track) return;
|
|
@@ -12159,8 +12281,8 @@ function CarouselScrollClient(_a) {
|
|
|
12159
12281
|
);
|
|
12160
12282
|
});
|
|
12161
12283
|
}
|
|
12162
|
-
return
|
|
12163
|
-
if (!
|
|
12284
|
+
return React33.Children.map(children, (child, index) => {
|
|
12285
|
+
if (!React33.isValidElement(child)) return child;
|
|
12164
12286
|
const itemWidth = keylines.largeWidth;
|
|
12165
12287
|
const maskClip = keylines.getItemMaskClip(index);
|
|
12166
12288
|
const parallax = keylines.getItemParallaxOffset(index);
|
|
@@ -12250,13 +12372,13 @@ function Carousel(_a) {
|
|
|
12250
12372
|
"className",
|
|
12251
12373
|
"style"
|
|
12252
12374
|
]);
|
|
12253
|
-
const [internalExpanded, setInternalExpanded] =
|
|
12375
|
+
const [internalExpanded, setInternalExpanded] = React33.useState(false);
|
|
12254
12376
|
const isExpanded = controlledExpanded != null ? controlledExpanded : internalExpanded;
|
|
12255
|
-
const totalItemsCount =
|
|
12377
|
+
const totalItemsCount = React33.useMemo(() => {
|
|
12256
12378
|
if (items) return items.length;
|
|
12257
|
-
return
|
|
12379
|
+
return React33.Children.count(children);
|
|
12258
12380
|
}, [items, children]);
|
|
12259
|
-
const handleShowAllToggle =
|
|
12381
|
+
const handleShowAllToggle = React33.useCallback(() => {
|
|
12260
12382
|
if (onShowAllClick) {
|
|
12261
12383
|
onShowAllClick();
|
|
12262
12384
|
} else {
|
|
@@ -12344,7 +12466,7 @@ var NEXT_STATE = {
|
|
|
12344
12466
|
checked: "indeterminate",
|
|
12345
12467
|
indeterminate: "unchecked"
|
|
12346
12468
|
};
|
|
12347
|
-
var CheckboxVisual =
|
|
12469
|
+
var CheckboxVisual = React33.memo(function CheckboxVisual2({
|
|
12348
12470
|
isSelected,
|
|
12349
12471
|
isIndeterminate,
|
|
12350
12472
|
containerBg,
|
|
@@ -12415,7 +12537,7 @@ var CheckboxVisual = React67.memo(function CheckboxVisual2({
|
|
|
12415
12537
|
);
|
|
12416
12538
|
});
|
|
12417
12539
|
function useMergedRef2(externalRef, internalRef) {
|
|
12418
|
-
return
|
|
12540
|
+
return React33.useCallback(
|
|
12419
12541
|
(node) => {
|
|
12420
12542
|
internalRef.current = node;
|
|
12421
12543
|
if (!externalRef) return;
|
|
@@ -12428,7 +12550,7 @@ function useMergedRef2(externalRef, internalRef) {
|
|
|
12428
12550
|
[externalRef, internalRef]
|
|
12429
12551
|
);
|
|
12430
12552
|
}
|
|
12431
|
-
var CheckboxComponent =
|
|
12553
|
+
var CheckboxComponent = React33.forwardRef(
|
|
12432
12554
|
({
|
|
12433
12555
|
checked,
|
|
12434
12556
|
defaultChecked = false,
|
|
@@ -12450,20 +12572,20 @@ var CheckboxComponent = React67.forwardRef(
|
|
|
12450
12572
|
}, ref) => {
|
|
12451
12573
|
var _a;
|
|
12452
12574
|
const prefersReduced = (_a = useReducedMotion()) != null ? _a : false;
|
|
12453
|
-
const generatedId =
|
|
12575
|
+
const generatedId = React33.useId();
|
|
12454
12576
|
const inputId = idProp != null ? idProp : label ? `checkbox-${generatedId}` : void 0;
|
|
12455
|
-
const [internalState, setInternalState] =
|
|
12577
|
+
const [internalState, setInternalState] = React33.useState(
|
|
12456
12578
|
() => defaultChecked ? "checked" : "unchecked"
|
|
12457
12579
|
);
|
|
12458
12580
|
const isControlled = stateProp !== void 0 || checked !== void 0;
|
|
12459
12581
|
const baseState = isControlled ? resolveState(checked, false, stateProp) : internalState;
|
|
12460
12582
|
const effectiveState = indeterminate ? "indeterminate" : baseState;
|
|
12461
|
-
const [ripples, setRipples] =
|
|
12462
|
-
const removeRipple =
|
|
12583
|
+
const [ripples, setRipples] = React33.useState([]);
|
|
12584
|
+
const removeRipple = React33.useCallback(
|
|
12463
12585
|
(id) => setRipples((prev) => prev.filter((r) => r.id !== id)),
|
|
12464
12586
|
[]
|
|
12465
12587
|
);
|
|
12466
|
-
const onPointerDown =
|
|
12588
|
+
const onPointerDown = React33.useCallback(
|
|
12467
12589
|
(e) => {
|
|
12468
12590
|
if (disabled) return;
|
|
12469
12591
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -12477,7 +12599,7 @@ var CheckboxComponent = React67.forwardRef(
|
|
|
12477
12599
|
},
|
|
12478
12600
|
[disabled]
|
|
12479
12601
|
);
|
|
12480
|
-
const handleChange =
|
|
12602
|
+
const handleChange = React33.useCallback(
|
|
12481
12603
|
(e) => {
|
|
12482
12604
|
if (disabled) return;
|
|
12483
12605
|
if (stateProp !== void 0) {
|
|
@@ -12503,9 +12625,9 @@ var CheckboxComponent = React67.forwardRef(
|
|
|
12503
12625
|
onCheckedChange
|
|
12504
12626
|
]
|
|
12505
12627
|
);
|
|
12506
|
-
const inputRef =
|
|
12628
|
+
const inputRef = React33.useRef(null);
|
|
12507
12629
|
const mergedRef = useMergedRef2(ref, inputRef);
|
|
12508
|
-
|
|
12630
|
+
React33.useEffect(() => {
|
|
12509
12631
|
if (inputRef.current) {
|
|
12510
12632
|
inputRef.current.indeterminate = effectiveState === "indeterminate";
|
|
12511
12633
|
}
|
|
@@ -12630,13 +12752,13 @@ var CheckboxComponent = React67.forwardRef(
|
|
|
12630
12752
|
}
|
|
12631
12753
|
);
|
|
12632
12754
|
CheckboxComponent.displayName = "Checkbox";
|
|
12633
|
-
var Checkbox =
|
|
12634
|
-
var TriStateCheckboxComponent =
|
|
12755
|
+
var Checkbox = React33.memo(CheckboxComponent);
|
|
12756
|
+
var TriStateCheckboxComponent = React33.forwardRef((_a, ref) => {
|
|
12635
12757
|
var _b = _a, { state, onStateChange } = _b, rest = __objRest(_b, ["state", "onStateChange"]);
|
|
12636
12758
|
return /* @__PURE__ */ jsx(Checkbox, __spreadValues({ ref, state, onStateChange }, rest));
|
|
12637
12759
|
});
|
|
12638
12760
|
TriStateCheckboxComponent.displayName = "TriStateCheckbox";
|
|
12639
|
-
var TriStateCheckbox =
|
|
12761
|
+
var TriStateCheckbox = React33.memo(TriStateCheckboxComponent);
|
|
12640
12762
|
function CheckIcon({ className }) {
|
|
12641
12763
|
return /* @__PURE__ */ jsx(
|
|
12642
12764
|
"svg",
|
|
@@ -12728,7 +12850,7 @@ var chipVariants = cva(
|
|
|
12728
12850
|
defaultVariants: { variant: "assist" }
|
|
12729
12851
|
}
|
|
12730
12852
|
);
|
|
12731
|
-
var ChipImpl =
|
|
12853
|
+
var ChipImpl = React33.forwardRef(
|
|
12732
12854
|
(_a, ref) => {
|
|
12733
12855
|
var _b = _a, {
|
|
12734
12856
|
variant = "assist",
|
|
@@ -12777,7 +12899,7 @@ var ChipImpl = React67.forwardRef(
|
|
|
12777
12899
|
const showCheckmark = isFilter && selected;
|
|
12778
12900
|
const hasTrailingContent = !!trailingIcon || !!onRemove;
|
|
12779
12901
|
const hasLeadingContent = isFilter && (selected || !!resolvedLeadingIcon) || !isFilter && !!resolvedLeadingIcon;
|
|
12780
|
-
const paddingClass =
|
|
12902
|
+
const paddingClass = React33.useMemo(
|
|
12781
12903
|
() => cn(
|
|
12782
12904
|
!isInput && !hasLeadingContent && !hasTrailingContent && "px-4",
|
|
12783
12905
|
!isInput && hasLeadingContent && !hasTrailingContent && "pl-2 pr-4",
|
|
@@ -12790,7 +12912,7 @@ var ChipImpl = React67.forwardRef(
|
|
|
12790
12912
|
),
|
|
12791
12913
|
[isInput, hasLeadingContent, hasTrailingContent]
|
|
12792
12914
|
);
|
|
12793
|
-
const stateClass =
|
|
12915
|
+
const stateClass = React33.useMemo(
|
|
12794
12916
|
() => cn(
|
|
12795
12917
|
isSelectable && selected && "bg-m3-secondary-container text-m3-on-secondary-container border-none before:bg-m3-on-secondary-container",
|
|
12796
12918
|
elevated && !selected && "bg-m3-surface-container-low border-none elevation-1",
|
|
@@ -12801,7 +12923,7 @@ var ChipImpl = React67.forwardRef(
|
|
|
12801
12923
|
),
|
|
12802
12924
|
[isSelectable, isFilter, selected, elevated, disabled]
|
|
12803
12925
|
);
|
|
12804
|
-
const leadingIconColorClass =
|
|
12926
|
+
const leadingIconColorClass = React33.useMemo(
|
|
12805
12927
|
() => cn(
|
|
12806
12928
|
(variant === "assist" || variant === "suggestion") && "text-m3-primary",
|
|
12807
12929
|
isFilter && !selected && "text-m3-primary",
|
|
@@ -12889,7 +13011,7 @@ var ChipImpl = React67.forwardRef(
|
|
|
12889
13011
|
/* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: label })
|
|
12890
13012
|
] });
|
|
12891
13013
|
if (asChild) {
|
|
12892
|
-
const child =
|
|
13014
|
+
const child = React33.Children.only(children);
|
|
12893
13015
|
const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12894
13016
|
/* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
12895
13017
|
mainContent,
|
|
@@ -12951,7 +13073,7 @@ var ChipImpl = React67.forwardRef(
|
|
|
12951
13073
|
onPointerDown,
|
|
12952
13074
|
className: containerClass
|
|
12953
13075
|
}, strippedProps), {
|
|
12954
|
-
children:
|
|
13076
|
+
children: React33.cloneElement(child, { children: innerContent })
|
|
12955
13077
|
})
|
|
12956
13078
|
) });
|
|
12957
13079
|
}
|
|
@@ -13048,7 +13170,7 @@ var ChipImpl = React67.forwardRef(
|
|
|
13048
13170
|
}
|
|
13049
13171
|
);
|
|
13050
13172
|
ChipImpl.displayName = "Chip";
|
|
13051
|
-
var Chip =
|
|
13173
|
+
var Chip = React33.memo(ChipImpl);
|
|
13052
13174
|
var COPY_RESET_DELAY = 2e3;
|
|
13053
13175
|
function CopyButton({
|
|
13054
13176
|
copied,
|
|
@@ -13413,13 +13535,13 @@ var DatePickerInput = ({
|
|
|
13413
13535
|
locale,
|
|
13414
13536
|
className
|
|
13415
13537
|
}) => {
|
|
13416
|
-
const inputId =
|
|
13538
|
+
const inputId = React33.useId();
|
|
13417
13539
|
const errorId = `${inputId}-error`;
|
|
13418
|
-
const placeholder =
|
|
13540
|
+
const placeholder = React33.useMemo(() => {
|
|
13419
13541
|
if (locale == null ? void 0 : locale.startsWith("vi")) return "DD/MM/YYYY";
|
|
13420
13542
|
return "MM/DD/YYYY";
|
|
13421
13543
|
}, [locale]);
|
|
13422
|
-
const handleKeyDown =
|
|
13544
|
+
const handleKeyDown = React33.useCallback(
|
|
13423
13545
|
(e) => {
|
|
13424
13546
|
if (e.key === "Enter") {
|
|
13425
13547
|
const parsed = parseDateInput(value);
|
|
@@ -13428,11 +13550,11 @@ var DatePickerInput = ({
|
|
|
13428
13550
|
},
|
|
13429
13551
|
[value, onCommit]
|
|
13430
13552
|
);
|
|
13431
|
-
const handleBlur =
|
|
13553
|
+
const handleBlur = React33.useCallback(() => {
|
|
13432
13554
|
const parsed = parseDateInput(value);
|
|
13433
13555
|
onCommit(parsed);
|
|
13434
13556
|
}, [value, onCommit]);
|
|
13435
|
-
const handleChange =
|
|
13557
|
+
const handleChange = React33.useCallback(
|
|
13436
13558
|
(e) => {
|
|
13437
13559
|
let raw = e.target.value.replace(/\D/g, "");
|
|
13438
13560
|
if (raw.length > 8) raw = raw.slice(0, 8);
|
|
@@ -13526,11 +13648,11 @@ var DayCell = ({
|
|
|
13526
13648
|
// Disabled
|
|
13527
13649
|
isDisabled && "opacity-[0.38]"
|
|
13528
13650
|
);
|
|
13529
|
-
const handleClick =
|
|
13651
|
+
const handleClick = React33.useCallback(() => {
|
|
13530
13652
|
if (isDisabled) return;
|
|
13531
13653
|
onSelect(utcMs);
|
|
13532
13654
|
}, [isDisabled, utcMs, onSelect]);
|
|
13533
|
-
const handleKeyDown =
|
|
13655
|
+
const handleKeyDown = React33.useCallback(
|
|
13534
13656
|
(e) => {
|
|
13535
13657
|
if (e.key === "Enter" || e.key === " ") {
|
|
13536
13658
|
e.preventDefault();
|
|
@@ -13566,7 +13688,7 @@ var DayCell = ({
|
|
|
13566
13688
|
};
|
|
13567
13689
|
DayCell.displayName = "DayCell";
|
|
13568
13690
|
var WeekdayRow = ({ locale }) => {
|
|
13569
|
-
const names =
|
|
13691
|
+
const names = React33.useMemo(() => getWeekdayNames(locale), [locale]);
|
|
13570
13692
|
return /* @__PURE__ */ jsx("tr", { className: "grid grid-cols-7 mb-1", children: names.map((name, i) => /* @__PURE__ */ jsx(
|
|
13571
13693
|
"th",
|
|
13572
13694
|
{
|
|
@@ -13593,7 +13715,7 @@ var CalendarGrid = ({
|
|
|
13593
13715
|
const d = new Date(displayedMonthMs);
|
|
13594
13716
|
const year = d.getUTCFullYear();
|
|
13595
13717
|
const month = d.getUTCMonth();
|
|
13596
|
-
const weeks =
|
|
13718
|
+
const weeks = React33.useMemo(
|
|
13597
13719
|
() => getWeeksInMonth(year, month, locale.weekStartsOn),
|
|
13598
13720
|
[year, month, locale.weekStartsOn]
|
|
13599
13721
|
);
|
|
@@ -13825,15 +13947,15 @@ var MonthPickerList = ({
|
|
|
13825
13947
|
locale,
|
|
13826
13948
|
onMonthSelect
|
|
13827
13949
|
}) => {
|
|
13828
|
-
const selectedRef =
|
|
13829
|
-
|
|
13950
|
+
const selectedRef = React33.useRef(null);
|
|
13951
|
+
React33.useEffect(() => {
|
|
13830
13952
|
var _a, _b;
|
|
13831
13953
|
(_b = (_a = selectedRef.current) == null ? void 0 : _a.scrollIntoView) == null ? void 0 : _b.call(_a, {
|
|
13832
13954
|
block: "center",
|
|
13833
13955
|
behavior: "instant"
|
|
13834
13956
|
});
|
|
13835
13957
|
}, []);
|
|
13836
|
-
const months =
|
|
13958
|
+
const months = React33.useMemo(
|
|
13837
13959
|
() => Array.from({ length: 12 }, (_, month) => month),
|
|
13838
13960
|
[]
|
|
13839
13961
|
);
|
|
@@ -13878,12 +14000,12 @@ var YearPickerList = ({
|
|
|
13878
14000
|
selectableDates,
|
|
13879
14001
|
onYearSelect
|
|
13880
14002
|
}) => {
|
|
13881
|
-
const selectedRef =
|
|
13882
|
-
const years =
|
|
14003
|
+
const selectedRef = React33.useRef(null);
|
|
14004
|
+
const years = React33.useMemo(() => {
|
|
13883
14005
|
const [min, max] = yearRange;
|
|
13884
14006
|
return Array.from({ length: max - min + 1 }, (_, index) => min + index);
|
|
13885
14007
|
}, [yearRange]);
|
|
13886
|
-
|
|
14008
|
+
React33.useEffect(() => {
|
|
13887
14009
|
var _a, _b;
|
|
13888
14010
|
(_b = (_a = selectedRef.current) == null ? void 0 : _a.scrollIntoView) == null ? void 0 : _b.call(_a, {
|
|
13889
14011
|
block: "center",
|
|
@@ -13956,17 +14078,17 @@ var DatePicker = ({
|
|
|
13956
14078
|
navigateToMonth,
|
|
13957
14079
|
setDisplayMode
|
|
13958
14080
|
} = state;
|
|
13959
|
-
const [activeSelector, setActiveSelector] =
|
|
13960
|
-
const [slideDirection, setSlideDirection] =
|
|
13961
|
-
const handlePrev =
|
|
14081
|
+
const [activeSelector, setActiveSelector] = React33.useState(null);
|
|
14082
|
+
const [slideDirection, setSlideDirection] = React33.useState(null);
|
|
14083
|
+
const handlePrev = React33.useCallback(() => {
|
|
13962
14084
|
setSlideDirection("prev");
|
|
13963
14085
|
navigateMonth2("prev");
|
|
13964
14086
|
}, [navigateMonth2]);
|
|
13965
|
-
const handleNext =
|
|
14087
|
+
const handleNext = React33.useCallback(() => {
|
|
13966
14088
|
setSlideDirection("next");
|
|
13967
14089
|
navigateMonth2("next");
|
|
13968
14090
|
}, [navigateMonth2]);
|
|
13969
|
-
const handleYearSelect =
|
|
14091
|
+
const handleYearSelect = React33.useCallback(
|
|
13970
14092
|
(year) => {
|
|
13971
14093
|
const d = new Date(displayedMonthMs);
|
|
13972
14094
|
navigateToMonth(year, d.getUTCMonth());
|
|
@@ -13974,7 +14096,7 @@ var DatePicker = ({
|
|
|
13974
14096
|
},
|
|
13975
14097
|
[displayedMonthMs, navigateToMonth]
|
|
13976
14098
|
);
|
|
13977
|
-
const handleMonthSelect =
|
|
14099
|
+
const handleMonthSelect = React33.useCallback(
|
|
13978
14100
|
(month) => {
|
|
13979
14101
|
const d = new Date(displayedMonthMs);
|
|
13980
14102
|
navigateToMonth(d.getUTCFullYear(), month);
|
|
@@ -13982,11 +14104,11 @@ var DatePicker = ({
|
|
|
13982
14104
|
},
|
|
13983
14105
|
[displayedMonthMs, navigateToMonth]
|
|
13984
14106
|
);
|
|
13985
|
-
const [inputValue, setInputValue] =
|
|
14107
|
+
const [inputValue, setInputValue] = React33.useState(
|
|
13986
14108
|
() => selectedDateMs !== null ? formatInputDate(selectedDateMs) : ""
|
|
13987
14109
|
);
|
|
13988
|
-
const [inputError, setInputError] =
|
|
13989
|
-
const handleInputCommit =
|
|
14110
|
+
const [inputError, setInputError] = React33.useState();
|
|
14111
|
+
const handleInputCommit = React33.useCallback(
|
|
13990
14112
|
(ms) => {
|
|
13991
14113
|
if (ms === null && inputValue.length > 0) {
|
|
13992
14114
|
setInputError("Invalid date");
|
|
@@ -14260,9 +14382,9 @@ DialogTrigger.displayName = "DialogTrigger";
|
|
|
14260
14382
|
var DialogPortal = ({
|
|
14261
14383
|
open,
|
|
14262
14384
|
children
|
|
14263
|
-
}) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { children: open ?
|
|
14385
|
+
}) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { children: open ? React33.Children.toArray(children) : null }) });
|
|
14264
14386
|
DialogPortal.displayName = "DialogPortal";
|
|
14265
|
-
var DialogOverlay =
|
|
14387
|
+
var DialogOverlay = React33.forwardRef((_a, ref) => {
|
|
14266
14388
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
14267
14389
|
return /* @__PURE__ */ jsx(RadixDialog.Overlay, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children: /* @__PURE__ */ jsx(
|
|
14268
14390
|
m.div,
|
|
@@ -14279,7 +14401,7 @@ var DEFAULT_CLOSE_BTN_PROPS = {
|
|
|
14279
14401
|
className: "absolute right-4 top-4",
|
|
14280
14402
|
"aria-label": "Close"
|
|
14281
14403
|
};
|
|
14282
|
-
var DialogContent =
|
|
14404
|
+
var DialogContent = React33.forwardRef(
|
|
14283
14405
|
(_a, ref) => {
|
|
14284
14406
|
var _b = _a, {
|
|
14285
14407
|
className,
|
|
@@ -14332,7 +14454,7 @@ var DialogContent = React67.forwardRef(
|
|
|
14332
14454
|
}
|
|
14333
14455
|
);
|
|
14334
14456
|
DialogContent.displayName = "DialogContent";
|
|
14335
|
-
var DialogIcon =
|
|
14457
|
+
var DialogIcon = React33.forwardRef((_a, ref) => {
|
|
14336
14458
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
14337
14459
|
return /* @__PURE__ */ jsx(
|
|
14338
14460
|
"div",
|
|
@@ -14355,7 +14477,7 @@ var DialogHeader = (_a) => {
|
|
|
14355
14477
|
return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("flex flex-col gap-2 mb-4", className) }, props));
|
|
14356
14478
|
};
|
|
14357
14479
|
DialogHeader.displayName = "DialogHeader";
|
|
14358
|
-
var DialogTitle =
|
|
14480
|
+
var DialogTitle = React33.forwardRef((_a, ref) => {
|
|
14359
14481
|
var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
14360
14482
|
return /* @__PURE__ */ jsx(
|
|
14361
14483
|
RadixDialog.Title,
|
|
@@ -14370,7 +14492,7 @@ var DialogTitle = React67.forwardRef((_a, ref) => {
|
|
|
14370
14492
|
);
|
|
14371
14493
|
});
|
|
14372
14494
|
DialogTitle.displayName = "DialogTitle";
|
|
14373
|
-
var DialogDescription =
|
|
14495
|
+
var DialogDescription = React33.forwardRef((_a, ref) => {
|
|
14374
14496
|
var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
14375
14497
|
return /* @__PURE__ */ jsx(
|
|
14376
14498
|
RadixDialog.Description,
|
|
@@ -14382,7 +14504,7 @@ var DialogDescription = React67.forwardRef((_a, ref) => {
|
|
|
14382
14504
|
);
|
|
14383
14505
|
});
|
|
14384
14506
|
DialogDescription.displayName = "DialogDescription";
|
|
14385
|
-
var DialogBody =
|
|
14507
|
+
var DialogBody = React33.forwardRef((_a, ref) => {
|
|
14386
14508
|
var _b = _a, { className, children, dir } = _b, props = __objRest(_b, ["className", "children", "dir"]);
|
|
14387
14509
|
return /* @__PURE__ */ jsx(
|
|
14388
14510
|
ScrollArea,
|
|
@@ -14413,7 +14535,7 @@ var DialogFooter = (_a) => {
|
|
|
14413
14535
|
};
|
|
14414
14536
|
DialogFooter.displayName = "DialogFooter";
|
|
14415
14537
|
var DialogClose = RadixDialog.Close;
|
|
14416
|
-
var DialogFullScreenContent =
|
|
14538
|
+
var DialogFullScreenContent = React33.forwardRef(
|
|
14417
14539
|
(_a, ref) => {
|
|
14418
14540
|
var _b = _a, {
|
|
14419
14541
|
className,
|
|
@@ -14590,17 +14712,17 @@ var DateRangePicker = ({
|
|
|
14590
14712
|
navigateToMonth,
|
|
14591
14713
|
setDisplayMode
|
|
14592
14714
|
} = state;
|
|
14593
|
-
const [activeSelector, setActiveSelector] =
|
|
14594
|
-
const [slideDirection, setSlideDirection] =
|
|
14595
|
-
const handlePrev =
|
|
14715
|
+
const [activeSelector, setActiveSelector] = React33.useState(null);
|
|
14716
|
+
const [slideDirection, setSlideDirection] = React33.useState(null);
|
|
14717
|
+
const handlePrev = React33.useCallback(() => {
|
|
14596
14718
|
setSlideDirection("prev");
|
|
14597
14719
|
navigateMonth2("prev");
|
|
14598
14720
|
}, [navigateMonth2]);
|
|
14599
|
-
const handleNext =
|
|
14721
|
+
const handleNext = React33.useCallback(() => {
|
|
14600
14722
|
setSlideDirection("next");
|
|
14601
14723
|
navigateMonth2("next");
|
|
14602
14724
|
}, [navigateMonth2]);
|
|
14603
|
-
const handleYearSelect =
|
|
14725
|
+
const handleYearSelect = React33.useCallback(
|
|
14604
14726
|
(year) => {
|
|
14605
14727
|
const d = new Date(displayedMonthMs);
|
|
14606
14728
|
navigateToMonth(year, d.getUTCMonth());
|
|
@@ -14608,7 +14730,7 @@ var DateRangePicker = ({
|
|
|
14608
14730
|
},
|
|
14609
14731
|
[displayedMonthMs, navigateToMonth]
|
|
14610
14732
|
);
|
|
14611
|
-
const handleMonthSelect =
|
|
14733
|
+
const handleMonthSelect = React33.useCallback(
|
|
14612
14734
|
(month) => {
|
|
14613
14735
|
const d = new Date(displayedMonthMs);
|
|
14614
14736
|
navigateToMonth(d.getUTCFullYear(), month);
|
|
@@ -14616,7 +14738,7 @@ var DateRangePicker = ({
|
|
|
14616
14738
|
},
|
|
14617
14739
|
[displayedMonthMs, navigateToMonth]
|
|
14618
14740
|
);
|
|
14619
|
-
const formatShort =
|
|
14741
|
+
const formatShort = React33.useCallback(
|
|
14620
14742
|
(ms) => {
|
|
14621
14743
|
if (ms === null) return "\u2014";
|
|
14622
14744
|
return formatDate(ms, locale, {
|
|
@@ -15230,16 +15352,16 @@ var InputField = ({
|
|
|
15230
15352
|
onBlur,
|
|
15231
15353
|
className
|
|
15232
15354
|
}) => {
|
|
15233
|
-
const [inputText, setInputText] =
|
|
15355
|
+
const [inputText, setInputText] = React33.useState(
|
|
15234
15356
|
String(value).padStart(2, "0")
|
|
15235
15357
|
);
|
|
15236
|
-
const inputRef =
|
|
15237
|
-
|
|
15358
|
+
const inputRef = React33.useRef(null);
|
|
15359
|
+
React33.useEffect(() => {
|
|
15238
15360
|
if (!isFocused) {
|
|
15239
15361
|
setInputText(String(value).padStart(2, "0"));
|
|
15240
15362
|
}
|
|
15241
15363
|
}, [value, isFocused]);
|
|
15242
|
-
|
|
15364
|
+
React33.useEffect(() => {
|
|
15243
15365
|
var _a, _b;
|
|
15244
15366
|
if (isFocused) {
|
|
15245
15367
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
@@ -15329,7 +15451,7 @@ var InputField = ({
|
|
|
15329
15451
|
};
|
|
15330
15452
|
var TimeInput = ({ state, className }) => {
|
|
15331
15453
|
const { is24hour, setHourInput, setMinuteInput, setSelection } = state;
|
|
15332
|
-
const [focusedField, setFocusedField] =
|
|
15454
|
+
const [focusedField, setFocusedField] = React33.useState(null);
|
|
15333
15455
|
const handleHourAutoAdvance = () => {
|
|
15334
15456
|
setFocusedField("minute");
|
|
15335
15457
|
setSelection("minute");
|
|
@@ -15515,17 +15637,17 @@ var ClockDial = ({
|
|
|
15515
15637
|
setMinute,
|
|
15516
15638
|
setSelection
|
|
15517
15639
|
} = state;
|
|
15518
|
-
const displayAngle =
|
|
15640
|
+
const displayAngle = React33.useMemo(() => {
|
|
15519
15641
|
if (selection === "hour") {
|
|
15520
15642
|
return valueToAngle(hour, "hour");
|
|
15521
15643
|
}
|
|
15522
15644
|
return valueToAngle(minute, "minute");
|
|
15523
15645
|
}, [selection, hour, minute]);
|
|
15524
|
-
const selectorPos =
|
|
15646
|
+
const selectorPos = React33.useMemo(
|
|
15525
15647
|
() => getSelectorPosition(displayAngle, selection, is24hour, isPm),
|
|
15526
15648
|
[displayAngle, selection, is24hour, isPm]
|
|
15527
15649
|
);
|
|
15528
|
-
const trackEnd =
|
|
15650
|
+
const trackEnd = React33.useMemo(() => {
|
|
15529
15651
|
const dx = selectorPos.x - CENTER;
|
|
15530
15652
|
const dy = selectorPos.y - CENTER;
|
|
15531
15653
|
const length = Math.hypot(dx, dy);
|
|
@@ -15535,13 +15657,13 @@ var ClockDial = ({
|
|
|
15535
15657
|
y: selectorPos.y - dy / length * HANDLE_RADIUS
|
|
15536
15658
|
};
|
|
15537
15659
|
}, [selectorPos]);
|
|
15538
|
-
const numbers =
|
|
15660
|
+
const numbers = React33.useMemo(() => {
|
|
15539
15661
|
if (selection === "minute") return buildMinuteNumbers();
|
|
15540
15662
|
if (is24hour) return buildHour24Numbers();
|
|
15541
15663
|
return buildHour12Numbers();
|
|
15542
15664
|
}, [selection, is24hour]);
|
|
15543
|
-
const isDragging =
|
|
15544
|
-
const svgRef =
|
|
15665
|
+
const isDragging = React33.useRef(false);
|
|
15666
|
+
const svgRef = React33.useRef(null);
|
|
15545
15667
|
const getSVGPoint = (e) => {
|
|
15546
15668
|
const svg = svgRef.current;
|
|
15547
15669
|
if (!svg) return { x: e.clientX, y: e.clientY };
|
|
@@ -15691,8 +15813,8 @@ var getAutoLayout = () => {
|
|
|
15691
15813
|
return innerWidth >= 600 && innerHeight >= 300 && innerWidth >= innerHeight ? "horizontal" : "vertical";
|
|
15692
15814
|
};
|
|
15693
15815
|
var useResolvedLayout = (layout) => {
|
|
15694
|
-
const [autoLayout, setAutoLayout] =
|
|
15695
|
-
|
|
15816
|
+
const [autoLayout, setAutoLayout] = React33.useState("vertical");
|
|
15817
|
+
React33.useEffect(() => {
|
|
15696
15818
|
if (layout !== "auto") return;
|
|
15697
15819
|
const updateLayout = () => setAutoLayout(getAutoLayout());
|
|
15698
15820
|
updateLayout();
|
|
@@ -16007,7 +16129,7 @@ function buildWavePath(startX, endX, amplitude = 2, wavelength = 32, yCenter = 4
|
|
|
16007
16129
|
}
|
|
16008
16130
|
return d;
|
|
16009
16131
|
}
|
|
16010
|
-
var DividerImpl =
|
|
16132
|
+
var DividerImpl = React33.forwardRef(
|
|
16011
16133
|
(_a, ref) => {
|
|
16012
16134
|
var _b = _a, {
|
|
16013
16135
|
variant = "full-bleed",
|
|
@@ -16127,7 +16249,7 @@ var DividerImpl = React67.forwardRef(
|
|
|
16127
16249
|
}
|
|
16128
16250
|
);
|
|
16129
16251
|
DividerImpl.displayName = "Divider";
|
|
16130
|
-
var Divider =
|
|
16252
|
+
var Divider = React33.memo(DividerImpl);
|
|
16131
16253
|
var MD3_DRAWER_SPRING = DEFAULT_SPATIAL_SPRING;
|
|
16132
16254
|
var MD3_DRAWER_ANIM = {
|
|
16133
16255
|
initial: { y: "100%", opacity: 0.6 },
|
|
@@ -16159,7 +16281,7 @@ var DrawerPortal = ({
|
|
|
16159
16281
|
open,
|
|
16160
16282
|
children
|
|
16161
16283
|
}) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: open && children }) });
|
|
16162
|
-
var DrawerOverlay =
|
|
16284
|
+
var DrawerOverlay = React33.forwardRef((_a, ref) => {
|
|
16163
16285
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
16164
16286
|
return /* @__PURE__ */ jsx(RadixDialog.Overlay, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children: /* @__PURE__ */ jsx(
|
|
16165
16287
|
m.div,
|
|
@@ -16170,7 +16292,7 @@ var DrawerOverlay = React67.forwardRef((_a, ref) => {
|
|
|
16170
16292
|
) }));
|
|
16171
16293
|
});
|
|
16172
16294
|
DrawerOverlay.displayName = "DrawerOverlay";
|
|
16173
|
-
var DrawerContent =
|
|
16295
|
+
var DrawerContent = React33.forwardRef(
|
|
16174
16296
|
(_a, ref) => {
|
|
16175
16297
|
var _b = _a, {
|
|
16176
16298
|
className,
|
|
@@ -16249,7 +16371,7 @@ var DrawerFooter = (_a) => {
|
|
|
16249
16371
|
return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("flex flex-col gap-2 mt-4", className) }, props));
|
|
16250
16372
|
};
|
|
16251
16373
|
DrawerFooter.displayName = "DrawerFooter";
|
|
16252
|
-
var DrawerTitle =
|
|
16374
|
+
var DrawerTitle = React33.forwardRef((_a, ref) => {
|
|
16253
16375
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
16254
16376
|
return /* @__PURE__ */ jsx(
|
|
16255
16377
|
RadixDialog.Title,
|
|
@@ -16263,7 +16385,7 @@ var DrawerTitle = React67.forwardRef((_a, ref) => {
|
|
|
16263
16385
|
);
|
|
16264
16386
|
});
|
|
16265
16387
|
DrawerTitle.displayName = "DrawerTitle";
|
|
16266
|
-
var DrawerDescription =
|
|
16388
|
+
var DrawerDescription = React33.forwardRef((_a, ref) => {
|
|
16267
16389
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
16268
16390
|
return /* @__PURE__ */ jsx(
|
|
16269
16391
|
RadixDialog.Description,
|
|
@@ -16274,8 +16396,8 @@ var DrawerDescription = React67.forwardRef((_a, ref) => {
|
|
|
16274
16396
|
);
|
|
16275
16397
|
});
|
|
16276
16398
|
DrawerDescription.displayName = "DrawerDescription";
|
|
16277
|
-
var ListContext =
|
|
16278
|
-
var useListContext = () =>
|
|
16399
|
+
var ListContext = React33.createContext(null);
|
|
16400
|
+
var useListContext = () => React33.useContext(ListContext);
|
|
16279
16401
|
var LIST_TOKENS = {
|
|
16280
16402
|
oneLineHeight: 56,
|
|
16281
16403
|
twoLineHeight: 72,
|
|
@@ -16340,9 +16462,9 @@ function resolveItemId(item) {
|
|
|
16340
16462
|
return String(item);
|
|
16341
16463
|
}
|
|
16342
16464
|
function isListItem(child) {
|
|
16343
|
-
return
|
|
16465
|
+
return React33.isValidElement(child) && child.props != null && typeof child.props === "object" && "value" in child.props;
|
|
16344
16466
|
}
|
|
16345
|
-
var ListImpl =
|
|
16467
|
+
var ListImpl = React33.forwardRef(
|
|
16346
16468
|
(_a, ref) => {
|
|
16347
16469
|
var _b = _a, {
|
|
16348
16470
|
className,
|
|
@@ -16373,12 +16495,12 @@ var ListImpl = React67.forwardRef(
|
|
|
16373
16495
|
"innerRadius",
|
|
16374
16496
|
"children"
|
|
16375
16497
|
]);
|
|
16376
|
-
const listRef =
|
|
16377
|
-
const [draggedOrder, setDraggedOrder] =
|
|
16498
|
+
const listRef = React33.useRef(null);
|
|
16499
|
+
const [draggedOrder, setDraggedOrder] = React33.useState(
|
|
16378
16500
|
null
|
|
16379
16501
|
);
|
|
16380
|
-
|
|
16381
|
-
const [selectedState, setSelectedState] =
|
|
16502
|
+
React33.useImperativeHandle(ref, () => listRef.current);
|
|
16503
|
+
const [selectedState, setSelectedState] = React33.useState(
|
|
16382
16504
|
() => {
|
|
16383
16505
|
var _a2;
|
|
16384
16506
|
const initialValue = (_a2 = value != null ? value : defaultValue) != null ? _a2 : [];
|
|
@@ -16388,13 +16510,13 @@ var ListImpl = React67.forwardRef(
|
|
|
16388
16510
|
}
|
|
16389
16511
|
);
|
|
16390
16512
|
const isControlled = value !== void 0;
|
|
16391
|
-
const selectedValues =
|
|
16513
|
+
const selectedValues = React33.useMemo(() => {
|
|
16392
16514
|
if (isControlled) {
|
|
16393
16515
|
return new Set(Array.isArray(value) ? value : value ? [value] : []);
|
|
16394
16516
|
}
|
|
16395
16517
|
return selectedState;
|
|
16396
16518
|
}, [isControlled, value, selectedState]);
|
|
16397
|
-
const onItemChange =
|
|
16519
|
+
const onItemChange = React33.useCallback(
|
|
16398
16520
|
(itemValue, selected) => {
|
|
16399
16521
|
const nextSet = new Set(selectedValues);
|
|
16400
16522
|
if (selectionMode === "single-select") {
|
|
@@ -16426,11 +16548,11 @@ var ListImpl = React67.forwardRef(
|
|
|
16426
16548
|
coordinateGetter: sortableKeyboardCoordinates
|
|
16427
16549
|
})
|
|
16428
16550
|
);
|
|
16429
|
-
const itemIds =
|
|
16551
|
+
const itemIds = React33.useMemo(
|
|
16430
16552
|
() => items ? items.map(resolveItemId) : [],
|
|
16431
16553
|
[items]
|
|
16432
16554
|
);
|
|
16433
|
-
const currentOrder =
|
|
16555
|
+
const currentOrder = React33.useMemo(
|
|
16434
16556
|
() => draggedOrder || itemIds,
|
|
16435
16557
|
[draggedOrder, itemIds]
|
|
16436
16558
|
);
|
|
@@ -16490,20 +16612,20 @@ var ListImpl = React67.forwardRef(
|
|
|
16490
16612
|
}
|
|
16491
16613
|
(_a2 = focusableItems[nextIndex]) == null ? void 0 : _a2.focus();
|
|
16492
16614
|
};
|
|
16493
|
-
const childrenArray =
|
|
16615
|
+
const childrenArray = React33.Children.toArray(children);
|
|
16494
16616
|
const listItemCount = childrenArray.filter(isListItem).length;
|
|
16495
16617
|
let currentListItemIndex = 0;
|
|
16496
|
-
const processedChildren =
|
|
16618
|
+
const processedChildren = React33.Children.map(children, (child) => {
|
|
16497
16619
|
if (!isListItem(child)) return child;
|
|
16498
16620
|
const childValue = child.props.value;
|
|
16499
16621
|
const index = reorderable && currentOrder.length > 0 ? currentOrder.indexOf(String(childValue)) : currentListItemIndex;
|
|
16500
16622
|
currentListItemIndex++;
|
|
16501
|
-
return
|
|
16623
|
+
return React33.cloneElement(
|
|
16502
16624
|
child,
|
|
16503
16625
|
{ _listIndex: index }
|
|
16504
16626
|
);
|
|
16505
16627
|
});
|
|
16506
|
-
const contextValue =
|
|
16628
|
+
const contextValue = React33.useMemo(
|
|
16507
16629
|
() => ({
|
|
16508
16630
|
selectionMode,
|
|
16509
16631
|
variant,
|
|
@@ -16527,7 +16649,7 @@ var ListImpl = React67.forwardRef(
|
|
|
16527
16649
|
innerRadius
|
|
16528
16650
|
]
|
|
16529
16651
|
);
|
|
16530
|
-
const dndId =
|
|
16652
|
+
const dndId = React33.useId();
|
|
16531
16653
|
const isListbox = selectionMode === "single-select" || selectionMode === "multi-select";
|
|
16532
16654
|
const role = isListbox ? "listbox" : "list";
|
|
16533
16655
|
const ariaMultiselectable = selectionMode === "multi-select" ? true : void 0;
|
|
@@ -16574,13 +16696,13 @@ var ListImpl = React67.forwardRef(
|
|
|
16574
16696
|
}
|
|
16575
16697
|
);
|
|
16576
16698
|
ListImpl.displayName = "List";
|
|
16577
|
-
var List =
|
|
16699
|
+
var List = React33.memo(ListImpl);
|
|
16578
16700
|
var INSET_CLASSES = {
|
|
16579
16701
|
icon: "pl-[56px]",
|
|
16580
16702
|
avatar: "pl-[72px]",
|
|
16581
16703
|
custom: "pl-4"
|
|
16582
16704
|
};
|
|
16583
|
-
var ListDividerImpl =
|
|
16705
|
+
var ListDividerImpl = React33.forwardRef(
|
|
16584
16706
|
(_a, ref) => {
|
|
16585
16707
|
var _b = _a, { className, inset = false, insetType = "avatar" } = _b, props = __objRest(_b, ["className", "inset", "insetType"]);
|
|
16586
16708
|
const insetClass = inset ? INSET_CLASSES[insetType] : "";
|
|
@@ -16605,13 +16727,13 @@ var ListDividerImpl = React67.forwardRef(
|
|
|
16605
16727
|
}
|
|
16606
16728
|
);
|
|
16607
16729
|
ListDividerImpl.displayName = "ListDivider";
|
|
16608
|
-
var ListDivider =
|
|
16730
|
+
var ListDivider = React33.memo(ListDividerImpl);
|
|
16609
16731
|
var MD3_FAST_EFFECTS2 = [0.3, 0, 1, 1];
|
|
16610
|
-
var RadioGroupContext =
|
|
16732
|
+
var RadioGroupContext = React33.createContext(
|
|
16611
16733
|
null
|
|
16612
16734
|
);
|
|
16613
16735
|
function useMergedRef3(externalRef, internalRef) {
|
|
16614
|
-
return
|
|
16736
|
+
return React33.useCallback(
|
|
16615
16737
|
(node) => {
|
|
16616
16738
|
internalRef.current = node;
|
|
16617
16739
|
if (!externalRef) return;
|
|
@@ -16624,7 +16746,7 @@ function useMergedRef3(externalRef, internalRef) {
|
|
|
16624
16746
|
[externalRef, internalRef]
|
|
16625
16747
|
);
|
|
16626
16748
|
}
|
|
16627
|
-
var RadioVisual =
|
|
16749
|
+
var RadioVisual = React33.memo(function RadioVisual2({
|
|
16628
16750
|
isSelected,
|
|
16629
16751
|
disabled,
|
|
16630
16752
|
error,
|
|
@@ -16677,7 +16799,7 @@ var RadioVisual = React67.memo(function RadioVisual2({
|
|
|
16677
16799
|
}
|
|
16678
16800
|
);
|
|
16679
16801
|
});
|
|
16680
|
-
var RadioButtonComponent =
|
|
16802
|
+
var RadioButtonComponent = React33.forwardRef(
|
|
16681
16803
|
({
|
|
16682
16804
|
selected,
|
|
16683
16805
|
defaultSelected = false,
|
|
@@ -16696,23 +16818,23 @@ var RadioButtonComponent = React67.forwardRef(
|
|
|
16696
16818
|
required: requiredProp
|
|
16697
16819
|
}, ref) => {
|
|
16698
16820
|
var _a, _b;
|
|
16699
|
-
const group =
|
|
16821
|
+
const group = React33.useContext(RadioGroupContext);
|
|
16700
16822
|
const prefersReduced = (_a = useReducedMotion()) != null ? _a : false;
|
|
16701
|
-
const generatedId =
|
|
16823
|
+
const generatedId = React33.useId();
|
|
16702
16824
|
const inputId = idProp != null ? idProp : label ? `radio-${generatedId}` : void 0;
|
|
16703
16825
|
const name = (_b = group == null ? void 0 : group.name) != null ? _b : nameProp;
|
|
16704
16826
|
const disabled = (group == null ? void 0 : group.disabled) || disabledProp;
|
|
16705
16827
|
const error = (group == null ? void 0 : group.error) || errorProp || color === "error";
|
|
16706
16828
|
const required = (group == null ? void 0 : group.required) || requiredProp;
|
|
16707
|
-
const [internalSelected, setInternalSelected] =
|
|
16829
|
+
const [internalSelected, setInternalSelected] = React33.useState(defaultSelected);
|
|
16708
16830
|
const isControlled = selected !== void 0;
|
|
16709
16831
|
const isSelected = group ? group.selectedValue === value : isControlled ? selected != null ? selected : false : internalSelected;
|
|
16710
|
-
const [ripples, setRipples] =
|
|
16711
|
-
const removeRipple =
|
|
16832
|
+
const [ripples, setRipples] = React33.useState([]);
|
|
16833
|
+
const removeRipple = React33.useCallback(
|
|
16712
16834
|
(id) => setRipples((prev) => prev.filter((r) => r.id !== id)),
|
|
16713
16835
|
[]
|
|
16714
16836
|
);
|
|
16715
|
-
const onPointerDown =
|
|
16837
|
+
const onPointerDown = React33.useCallback(
|
|
16716
16838
|
(e) => {
|
|
16717
16839
|
if (disabled) return;
|
|
16718
16840
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -16726,12 +16848,12 @@ var RadioButtonComponent = React67.forwardRef(
|
|
|
16726
16848
|
},
|
|
16727
16849
|
[disabled]
|
|
16728
16850
|
);
|
|
16729
|
-
const [isHovered, setIsHovered] =
|
|
16730
|
-
const onPointerEnter =
|
|
16851
|
+
const [isHovered, setIsHovered] = React33.useState(false);
|
|
16852
|
+
const onPointerEnter = React33.useCallback(() => {
|
|
16731
16853
|
if (!disabled) setIsHovered(true);
|
|
16732
16854
|
}, [disabled]);
|
|
16733
|
-
const onPointerLeave =
|
|
16734
|
-
const handleChange =
|
|
16855
|
+
const onPointerLeave = React33.useCallback(() => setIsHovered(false), []);
|
|
16856
|
+
const handleChange = React33.useCallback(
|
|
16735
16857
|
(_e) => {
|
|
16736
16858
|
if (disabled || onClick === null) return;
|
|
16737
16859
|
if (group) {
|
|
@@ -16745,7 +16867,7 @@ var RadioButtonComponent = React67.forwardRef(
|
|
|
16745
16867
|
},
|
|
16746
16868
|
[disabled, onClick, group, value, isControlled]
|
|
16747
16869
|
);
|
|
16748
|
-
const inputRef =
|
|
16870
|
+
const inputRef = React33.useRef(null);
|
|
16749
16871
|
const mergedRef = useMergedRef3(ref, inputRef);
|
|
16750
16872
|
const stateLayerBg = error ? "before:bg-m3-error" : "before:bg-m3-primary";
|
|
16751
16873
|
const stateLayerClass = cn(
|
|
@@ -16856,8 +16978,8 @@ var RadioButtonComponent = React67.forwardRef(
|
|
|
16856
16978
|
}
|
|
16857
16979
|
);
|
|
16858
16980
|
RadioButtonComponent.displayName = "RadioButton";
|
|
16859
|
-
var RadioButton =
|
|
16860
|
-
var RadioGroupComponent =
|
|
16981
|
+
var RadioButton = React33.memo(RadioButtonComponent);
|
|
16982
|
+
var RadioGroupComponent = React33.forwardRef(
|
|
16861
16983
|
({
|
|
16862
16984
|
name,
|
|
16863
16985
|
value: valueProp,
|
|
@@ -16872,19 +16994,19 @@ var RadioGroupComponent = React67.forwardRef(
|
|
|
16872
16994
|
children,
|
|
16873
16995
|
className
|
|
16874
16996
|
}, ref) => {
|
|
16875
|
-
const [internalValue, setInternalValue] =
|
|
16997
|
+
const [internalValue, setInternalValue] = React33.useState(defaultValue);
|
|
16876
16998
|
const isControlled = valueProp !== void 0;
|
|
16877
16999
|
const selectedValue = isControlled ? valueProp : internalValue;
|
|
16878
|
-
const handleValueChange =
|
|
17000
|
+
const handleValueChange = React33.useCallback(
|
|
16879
17001
|
(val) => {
|
|
16880
17002
|
if (!isControlled) setInternalValue(val);
|
|
16881
17003
|
onValueChange == null ? void 0 : onValueChange(val);
|
|
16882
17004
|
},
|
|
16883
17005
|
[isControlled, onValueChange]
|
|
16884
17006
|
);
|
|
16885
|
-
const groupRef =
|
|
17007
|
+
const groupRef = React33.useRef(null);
|
|
16886
17008
|
const mergedRef = useMergedRef3(ref, groupRef);
|
|
16887
|
-
const onKeyDown =
|
|
17009
|
+
const onKeyDown = React33.useCallback(
|
|
16888
17010
|
(e) => {
|
|
16889
17011
|
var _a, _b;
|
|
16890
17012
|
if (disabled) return;
|
|
@@ -16908,7 +17030,7 @@ var RadioGroupComponent = React67.forwardRef(
|
|
|
16908
17030
|
},
|
|
16909
17031
|
[disabled, handleValueChange]
|
|
16910
17032
|
);
|
|
16911
|
-
const contextValue =
|
|
17033
|
+
const contextValue = React33.useMemo(
|
|
16912
17034
|
() => ({
|
|
16913
17035
|
name,
|
|
16914
17036
|
selectedValue,
|
|
@@ -16943,7 +17065,7 @@ var RadioGroupComponent = React67.forwardRef(
|
|
|
16943
17065
|
}
|
|
16944
17066
|
);
|
|
16945
17067
|
RadioGroupComponent.displayName = "RadioGroup";
|
|
16946
|
-
var RadioGroup =
|
|
17068
|
+
var RadioGroup = React33.memo(RadioGroupComponent);
|
|
16947
17069
|
|
|
16948
17070
|
// src/ui/switch/switch.tokens.ts
|
|
16949
17071
|
var SwitchTokens = {
|
|
@@ -17035,7 +17157,7 @@ function isIconVisible(thumbContent, icons, showOnlySelectedIcon, checked) {
|
|
|
17035
17157
|
if (icons) return true;
|
|
17036
17158
|
return showOnlySelectedIcon && checked;
|
|
17037
17159
|
}
|
|
17038
|
-
var SwitchVisual =
|
|
17160
|
+
var SwitchVisual = React33.memo(function SwitchVisual2({
|
|
17039
17161
|
checked,
|
|
17040
17162
|
disabled,
|
|
17041
17163
|
isPressed,
|
|
@@ -17155,7 +17277,7 @@ var SwitchVisual = React67.memo(function SwitchVisual2({
|
|
|
17155
17277
|
}
|
|
17156
17278
|
);
|
|
17157
17279
|
});
|
|
17158
|
-
var SwitchComponent =
|
|
17280
|
+
var SwitchComponent = React33.forwardRef(
|
|
17159
17281
|
({
|
|
17160
17282
|
checked,
|
|
17161
17283
|
onCheckedChange,
|
|
@@ -17173,16 +17295,16 @@ var SwitchComponent = React67.forwardRef(
|
|
|
17173
17295
|
}, ref) => {
|
|
17174
17296
|
var _a;
|
|
17175
17297
|
const prefersReduced = (_a = useReducedMotion()) != null ? _a : false;
|
|
17176
|
-
const [isPressed, setIsPressed] =
|
|
17177
|
-
const [isHovered, setIsHovered] =
|
|
17178
|
-
const [isFocused, setIsFocused] =
|
|
17179
|
-
const [ripples, setRipples] =
|
|
17180
|
-
const generatedId =
|
|
17298
|
+
const [isPressed, setIsPressed] = React33.useState(false);
|
|
17299
|
+
const [isHovered, setIsHovered] = React33.useState(false);
|
|
17300
|
+
const [isFocused, setIsFocused] = React33.useState(false);
|
|
17301
|
+
const [ripples, setRipples] = React33.useState([]);
|
|
17302
|
+
const generatedId = React33.useId();
|
|
17181
17303
|
const switchId = label ? `switch-${generatedId}` : void 0;
|
|
17182
|
-
const handleClick =
|
|
17304
|
+
const handleClick = React33.useCallback(() => {
|
|
17183
17305
|
if (!disabled) onCheckedChange(!checked);
|
|
17184
17306
|
}, [disabled, checked, onCheckedChange]);
|
|
17185
|
-
const handleKeyDown =
|
|
17307
|
+
const handleKeyDown = React33.useCallback(
|
|
17186
17308
|
(e) => {
|
|
17187
17309
|
if (disabled) return;
|
|
17188
17310
|
if (e.key === " " || e.key === "Enter") {
|
|
@@ -17192,7 +17314,7 @@ var SwitchComponent = React67.forwardRef(
|
|
|
17192
17314
|
},
|
|
17193
17315
|
[disabled, checked, onCheckedChange]
|
|
17194
17316
|
);
|
|
17195
|
-
const handlePointerDown =
|
|
17317
|
+
const handlePointerDown = React33.useCallback(
|
|
17196
17318
|
(e) => {
|
|
17197
17319
|
if (disabled) return;
|
|
17198
17320
|
setIsPressed(true);
|
|
@@ -17207,19 +17329,19 @@ var SwitchComponent = React67.forwardRef(
|
|
|
17207
17329
|
},
|
|
17208
17330
|
[disabled]
|
|
17209
17331
|
);
|
|
17210
|
-
const handlePointerUp =
|
|
17332
|
+
const handlePointerUp = React33.useCallback(() => {
|
|
17211
17333
|
setIsPressed(false);
|
|
17212
17334
|
}, []);
|
|
17213
|
-
const handlePointerEnter =
|
|
17335
|
+
const handlePointerEnter = React33.useCallback(() => {
|
|
17214
17336
|
if (!disabled) setIsHovered(true);
|
|
17215
17337
|
}, [disabled]);
|
|
17216
|
-
const handlePointerLeave =
|
|
17338
|
+
const handlePointerLeave = React33.useCallback(() => {
|
|
17217
17339
|
setIsHovered(false);
|
|
17218
17340
|
setIsPressed(false);
|
|
17219
17341
|
}, []);
|
|
17220
|
-
const handleFocus =
|
|
17221
|
-
const handleBlur =
|
|
17222
|
-
const removeRipple =
|
|
17342
|
+
const handleFocus = React33.useCallback(() => setIsFocused(true), []);
|
|
17343
|
+
const handleBlur = React33.useCallback(() => setIsFocused(false), []);
|
|
17344
|
+
const removeRipple = React33.useCallback(
|
|
17223
17345
|
(id) => setRipples((prev) => prev.filter((r) => r.id !== id)),
|
|
17224
17346
|
[]
|
|
17225
17347
|
);
|
|
@@ -17304,7 +17426,7 @@ var SwitchComponent = React67.forwardRef(
|
|
|
17304
17426
|
}
|
|
17305
17427
|
);
|
|
17306
17428
|
SwitchComponent.displayName = "Switch";
|
|
17307
|
-
var Switch =
|
|
17429
|
+
var Switch = React33.memo(SwitchComponent);
|
|
17308
17430
|
|
|
17309
17431
|
// src/ui/lists/list-utils.ts
|
|
17310
17432
|
function getListItemHeight(hasOverline, supportingTextLines) {
|
|
@@ -17444,7 +17566,7 @@ function renderSwitchTrailing({
|
|
|
17444
17566
|
trailingClass
|
|
17445
17567
|
}) {
|
|
17446
17568
|
const isSelectingMode = selectionMode === "single-select" || selectionMode === "multi-select";
|
|
17447
|
-
const switchElement =
|
|
17569
|
+
const switchElement = React33.isValidElement(trailingContent) ? (() => {
|
|
17448
17570
|
const trailingProps = trailingContent.props;
|
|
17449
17571
|
const checkedValue = !isSelectingMode && trailingProps.checked !== void 0 ? trailingProps.checked : isSelected;
|
|
17450
17572
|
const disabledValue = trailingProps.disabled !== void 0 ? disabled || trailingProps.disabled : disabled;
|
|
@@ -17455,7 +17577,7 @@ function renderSwitchTrailing({
|
|
|
17455
17577
|
onItemChange(value, checked);
|
|
17456
17578
|
}
|
|
17457
17579
|
};
|
|
17458
|
-
return
|
|
17580
|
+
return React33.cloneElement(
|
|
17459
17581
|
trailingContent,
|
|
17460
17582
|
{ checked: checkedValue, disabled: disabledValue, onCheckedChange }
|
|
17461
17583
|
);
|
|
@@ -17480,7 +17602,7 @@ function renderSwitchTrailing({
|
|
|
17480
17602
|
)
|
|
17481
17603
|
);
|
|
17482
17604
|
}
|
|
17483
|
-
var ListItemImpl =
|
|
17605
|
+
var ListItemImpl = React33.forwardRef(
|
|
17484
17606
|
(_a, ref) => {
|
|
17485
17607
|
var _b = _a, {
|
|
17486
17608
|
className,
|
|
@@ -17536,9 +17658,9 @@ var ListItemImpl = React67.forwardRef(
|
|
|
17536
17658
|
});
|
|
17537
17659
|
const reorderable = (_e = context == null ? void 0 : context.reorderable) != null ? _e : false;
|
|
17538
17660
|
const isSelected = selected !== void 0 ? selected : (_f = context == null ? void 0 : context.selectedValues.has(value)) != null ? _f : false;
|
|
17539
|
-
const [isHovered, setIsHovered] =
|
|
17540
|
-
const [isFocused, setIsFocused] =
|
|
17541
|
-
const [isPressed, setIsPressed] =
|
|
17661
|
+
const [isHovered, setIsHovered] = React33.useState(false);
|
|
17662
|
+
const [isFocused, setIsFocused] = React33.useState(false);
|
|
17663
|
+
const [isPressed, setIsPressed] = React33.useState(false);
|
|
17542
17664
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
17543
17665
|
disabled
|
|
17544
17666
|
});
|
|
@@ -17550,8 +17672,8 @@ var ListItemImpl = React67.forwardRef(
|
|
|
17550
17672
|
transition,
|
|
17551
17673
|
isDragging
|
|
17552
17674
|
} = useSortable({ id: value, disabled: !reorderable });
|
|
17553
|
-
const itemRef =
|
|
17554
|
-
const setRefs =
|
|
17675
|
+
const itemRef = React33.useRef(null);
|
|
17676
|
+
const setRefs = React33.useCallback(
|
|
17555
17677
|
(node) => {
|
|
17556
17678
|
itemRef.current = node;
|
|
17557
17679
|
setNodeRef(node);
|
|
@@ -18004,7 +18126,7 @@ var ListItemImpl = React67.forwardRef(
|
|
|
18004
18126
|
}
|
|
18005
18127
|
);
|
|
18006
18128
|
ListItemImpl.displayName = "ListItem";
|
|
18007
|
-
var ListItem =
|
|
18129
|
+
var ListItem = React33.memo(ListItemImpl);
|
|
18008
18130
|
|
|
18009
18131
|
// src/ui/navigation/navigation-shape-utils.ts
|
|
18010
18132
|
function getNavigationShapeStyle(shape, width = 56, height = 56) {
|
|
@@ -18022,11 +18144,11 @@ function getNavigationShapeStyle(shape, width = 56, height = 56) {
|
|
|
18022
18144
|
function isSquareShape(shape) {
|
|
18023
18145
|
return Boolean(shape && shape !== "pill");
|
|
18024
18146
|
}
|
|
18025
|
-
var NavigationBarContext =
|
|
18147
|
+
var NavigationBarContext = React33.createContext({ variant: "flexible" });
|
|
18026
18148
|
function cloneIconWithFill(icon, selected) {
|
|
18027
|
-
if (!
|
|
18149
|
+
if (!React33.isValidElement(icon)) return icon;
|
|
18028
18150
|
if (icon.type === Icon) {
|
|
18029
|
-
return
|
|
18151
|
+
return React33.cloneElement(
|
|
18030
18152
|
icon,
|
|
18031
18153
|
{ fill: selected ? 1 : 0, animateFill: true }
|
|
18032
18154
|
);
|
|
@@ -18038,7 +18160,7 @@ function ActivePill({
|
|
|
18038
18160
|
width = 56,
|
|
18039
18161
|
height = 32
|
|
18040
18162
|
}) {
|
|
18041
|
-
const { activeIndicatorTransition } =
|
|
18163
|
+
const { activeIndicatorTransition } = React33.useContext(NavigationBarContext);
|
|
18042
18164
|
const shapeStyle = getNavigationShapeStyle(shape, width, height);
|
|
18043
18165
|
return /* @__PURE__ */ jsx(
|
|
18044
18166
|
m.div,
|
|
@@ -18110,7 +18232,7 @@ function IconContainer({ selected, badge, children }) {
|
|
|
18110
18232
|
}
|
|
18111
18233
|
);
|
|
18112
18234
|
}
|
|
18113
|
-
var NavigationBarItemComponent =
|
|
18235
|
+
var NavigationBarItemComponent = React33.forwardRef(
|
|
18114
18236
|
({
|
|
18115
18237
|
selected,
|
|
18116
18238
|
icon,
|
|
@@ -18134,7 +18256,7 @@ var NavigationBarItemComponent = React67.forwardRef(
|
|
|
18134
18256
|
labelVisibility: contextLabelVisibility,
|
|
18135
18257
|
shapeSize: contextShapeSize,
|
|
18136
18258
|
itemClassName: contextItemClassName
|
|
18137
|
-
} =
|
|
18259
|
+
} = React33.useContext(NavigationBarContext);
|
|
18138
18260
|
const activeShape = (_a = shapeProp != null ? shapeProp : contextShape) != null ? _a : "pill";
|
|
18139
18261
|
const isSquare = isSquareShape(activeShape);
|
|
18140
18262
|
const resolvedShapeSize = (_b = shapeSizeProp != null ? shapeSizeProp : contextShapeSize) != null ? _b : 56;
|
|
@@ -18148,7 +18270,7 @@ var NavigationBarItemComponent = React67.forwardRef(
|
|
|
18148
18270
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
18149
18271
|
disabled
|
|
18150
18272
|
});
|
|
18151
|
-
const handleClick =
|
|
18273
|
+
const handleClick = React33.useCallback(
|
|
18152
18274
|
(e) => {
|
|
18153
18275
|
if (disabled) {
|
|
18154
18276
|
e.preventDefault();
|
|
@@ -18175,7 +18297,7 @@ var NavigationBarItemComponent = React67.forwardRef(
|
|
|
18175
18297
|
const iconPillWidth = isSquare ? resolvedShapeSize : 56;
|
|
18176
18298
|
const iconPillHeight = isSquare ? resolvedShapeSize : 32;
|
|
18177
18299
|
if (asChild && children) {
|
|
18178
|
-
const child =
|
|
18300
|
+
const child = React33.Children.only(children);
|
|
18179
18301
|
const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18180
18302
|
/* @__PURE__ */ jsxs(
|
|
18181
18303
|
"div",
|
|
@@ -18300,7 +18422,7 @@ var NavigationBarItemComponent = React67.forwardRef(
|
|
|
18300
18422
|
onClick: handleClick,
|
|
18301
18423
|
onPointerDown,
|
|
18302
18424
|
className: itemClassName,
|
|
18303
|
-
children:
|
|
18425
|
+
children: React33.cloneElement(child, { children: innerContent })
|
|
18304
18426
|
}
|
|
18305
18427
|
);
|
|
18306
18428
|
}
|
|
@@ -18434,7 +18556,7 @@ var NavigationBarItemComponent = React67.forwardRef(
|
|
|
18434
18556
|
}
|
|
18435
18557
|
);
|
|
18436
18558
|
NavigationBarItemComponent.displayName = "NavigationBarItem";
|
|
18437
|
-
var NavigationBarItem =
|
|
18559
|
+
var NavigationBarItem = React33.memo(NavigationBarItemComponent);
|
|
18438
18560
|
var navContainerVariants = cva(
|
|
18439
18561
|
"flex items-center justify-center select-none transition-transform duration-300 z-50",
|
|
18440
18562
|
{
|
|
@@ -18460,7 +18582,7 @@ var navContainerVariants = cva(
|
|
|
18460
18582
|
}
|
|
18461
18583
|
}
|
|
18462
18584
|
);
|
|
18463
|
-
var NavigationBarComponent =
|
|
18585
|
+
var NavigationBarComponent = React33.forwardRef(
|
|
18464
18586
|
({
|
|
18465
18587
|
variant = "flexible",
|
|
18466
18588
|
itemLayout,
|
|
@@ -18477,18 +18599,18 @@ var NavigationBarComponent = React67.forwardRef(
|
|
|
18477
18599
|
className,
|
|
18478
18600
|
style
|
|
18479
18601
|
}, ref) => {
|
|
18480
|
-
const [isVisible, setIsVisible] =
|
|
18481
|
-
const lastScrollY =
|
|
18602
|
+
const [isVisible, setIsVisible] = React33.useState(true);
|
|
18603
|
+
const lastScrollY = React33.useRef(
|
|
18482
18604
|
typeof window !== "undefined" ? window.scrollY : 0
|
|
18483
18605
|
);
|
|
18484
18606
|
const isSquare = isSquareShape(shape);
|
|
18485
18607
|
const effectiveShapeSize = shapeSize != null ? shapeSize : isSquare ? 56 : 32;
|
|
18486
|
-
const computedMinHeight =
|
|
18608
|
+
const computedMinHeight = React33.useMemo(() => {
|
|
18487
18609
|
const baseHeight = variant === "baseline" ? 80 : 64;
|
|
18488
18610
|
const requiredHeight = itemLayout === "horizontal" || labelVisibility === "unlabeled" ? effectiveShapeSize + 16 : effectiveShapeSize + 32;
|
|
18489
18611
|
return Math.max(baseHeight, requiredHeight);
|
|
18490
18612
|
}, [variant, itemLayout, labelVisibility, effectiveShapeSize]);
|
|
18491
|
-
|
|
18613
|
+
React33.useEffect(() => {
|
|
18492
18614
|
if (typeof window === "undefined" || !hideOnScroll) {
|
|
18493
18615
|
setIsVisible(true);
|
|
18494
18616
|
return;
|
|
@@ -18572,8 +18694,8 @@ var NavigationBarComponent = React67.forwardRef(
|
|
|
18572
18694
|
}
|
|
18573
18695
|
);
|
|
18574
18696
|
NavigationBarComponent.displayName = "NavigationBar";
|
|
18575
|
-
var NavigationBar =
|
|
18576
|
-
var NavigationRailContext =
|
|
18697
|
+
var NavigationBar = React33.memo(NavigationBarComponent);
|
|
18698
|
+
var NavigationRailContext = React33.createContext({
|
|
18577
18699
|
variant: "collapsed",
|
|
18578
18700
|
labelVisibility: "labeled",
|
|
18579
18701
|
activeIndicatorWidth: "hug"
|
|
@@ -18609,9 +18731,9 @@ var railContainerVariants = cva(
|
|
|
18609
18731
|
}
|
|
18610
18732
|
);
|
|
18611
18733
|
function cloneIconWithFill2(icon, selected) {
|
|
18612
|
-
if (!
|
|
18734
|
+
if (!React33.isValidElement(icon)) return icon;
|
|
18613
18735
|
if (icon.type === Icon) {
|
|
18614
|
-
return
|
|
18736
|
+
return React33.cloneElement(
|
|
18615
18737
|
icon,
|
|
18616
18738
|
{ fill: selected ? 1 : 0, animateFill: true }
|
|
18617
18739
|
);
|
|
@@ -18640,7 +18762,7 @@ function ActivePill2({
|
|
|
18640
18762
|
width = 56,
|
|
18641
18763
|
height = 32
|
|
18642
18764
|
}) {
|
|
18643
|
-
const { activeIndicatorTransition } =
|
|
18765
|
+
const { activeIndicatorTransition } = React33.useContext(NavigationRailContext);
|
|
18644
18766
|
const shapeStyle = getNavigationShapeStyle(shape, width, height);
|
|
18645
18767
|
return /* @__PURE__ */ jsx(
|
|
18646
18768
|
m.div,
|
|
@@ -18715,7 +18837,7 @@ function IconContainer2({ selected, badge, children }) {
|
|
|
18715
18837
|
}
|
|
18716
18838
|
);
|
|
18717
18839
|
}
|
|
18718
|
-
var NavigationRailItemComponent =
|
|
18840
|
+
var NavigationRailItemComponent = React33.forwardRef(
|
|
18719
18841
|
({
|
|
18720
18842
|
selected,
|
|
18721
18843
|
icon,
|
|
@@ -18738,7 +18860,7 @@ var NavigationRailItemComponent = React67.forwardRef(
|
|
|
18738
18860
|
shape: contextShape,
|
|
18739
18861
|
shapeSize: contextShapeSize,
|
|
18740
18862
|
activeIndicatorWidth: contextActiveIndicatorWidth
|
|
18741
|
-
} =
|
|
18863
|
+
} = React33.useContext(NavigationRailContext);
|
|
18742
18864
|
const activeShape = (_a = shapeProp != null ? shapeProp : contextShape) != null ? _a : "pill";
|
|
18743
18865
|
const isSquare = isSquareShape(activeShape);
|
|
18744
18866
|
const resolvedShapeSize = (_b = shapeSizeProp != null ? shapeSizeProp : contextShapeSize) != null ? _b : 56;
|
|
@@ -18748,12 +18870,12 @@ var NavigationRailItemComponent = React67.forwardRef(
|
|
|
18748
18870
|
const enableLayout = !isModal;
|
|
18749
18871
|
const isExpandedPill = isExpanded && !isSquare;
|
|
18750
18872
|
const expandedPillWidthClass = activeIndicatorWidth === "fill" ? "w-full" : "w-fit";
|
|
18751
|
-
const activePillId = `rail-pill-${
|
|
18873
|
+
const activePillId = `rail-pill-${React33.useId()}`;
|
|
18752
18874
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
18753
18875
|
disabled
|
|
18754
18876
|
});
|
|
18755
18877
|
const showLabel = isExpanded || labelVisibility === "labeled" || labelVisibility === "auto" && selected;
|
|
18756
|
-
const handleClick =
|
|
18878
|
+
const handleClick = React33.useCallback(
|
|
18757
18879
|
(e) => {
|
|
18758
18880
|
if (disabled) {
|
|
18759
18881
|
e.preventDefault();
|
|
@@ -18775,7 +18897,7 @@ var NavigationRailItemComponent = React67.forwardRef(
|
|
|
18775
18897
|
const iconPillWidth = isSquare ? resolvedShapeSize : 56;
|
|
18776
18898
|
const iconPillHeight = isSquare ? resolvedShapeSize : 32;
|
|
18777
18899
|
if (asChild && children) {
|
|
18778
|
-
const child =
|
|
18900
|
+
const child = React33.Children.only(children);
|
|
18779
18901
|
const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18780
18902
|
/* @__PURE__ */ jsxs(
|
|
18781
18903
|
m.div,
|
|
@@ -18893,7 +19015,7 @@ var NavigationRailItemComponent = React67.forwardRef(
|
|
|
18893
19015
|
onPointerDown,
|
|
18894
19016
|
className: itemClassName,
|
|
18895
19017
|
tabIndex: -1,
|
|
18896
|
-
children:
|
|
19018
|
+
children: React33.cloneElement(child, { children: innerContent })
|
|
18897
19019
|
}
|
|
18898
19020
|
) });
|
|
18899
19021
|
}
|
|
@@ -19021,9 +19143,9 @@ var NavigationRailItemComponent = React67.forwardRef(
|
|
|
19021
19143
|
}
|
|
19022
19144
|
);
|
|
19023
19145
|
NavigationRailItemComponent.displayName = "NavigationRailItem";
|
|
19024
|
-
var NavigationRailItem =
|
|
19146
|
+
var NavigationRailItem = React33.memo(NavigationRailItemComponent);
|
|
19025
19147
|
function useRoving(navRef) {
|
|
19026
|
-
|
|
19148
|
+
React33.useEffect(() => {
|
|
19027
19149
|
if (!navRef.current) return;
|
|
19028
19150
|
const items = getMenuItems(navRef.current);
|
|
19029
19151
|
const selected = items.find(
|
|
@@ -19033,7 +19155,7 @@ function useRoving(navRef) {
|
|
|
19033
19155
|
const firstFocusable = selected != null ? selected : items[0];
|
|
19034
19156
|
if (firstFocusable) firstFocusable.tabIndex = 0;
|
|
19035
19157
|
}, [navRef]);
|
|
19036
|
-
return
|
|
19158
|
+
return React33.useCallback(
|
|
19037
19159
|
(e) => {
|
|
19038
19160
|
if (!navRef.current) return;
|
|
19039
19161
|
const items = getMenuItems(navRef.current);
|
|
@@ -19061,7 +19183,7 @@ function useRoving(navRef) {
|
|
|
19061
19183
|
[navRef]
|
|
19062
19184
|
);
|
|
19063
19185
|
}
|
|
19064
|
-
var NavigationRailComponent =
|
|
19186
|
+
var NavigationRailComponent = React33.forwardRef(
|
|
19065
19187
|
({
|
|
19066
19188
|
variant = "collapsed",
|
|
19067
19189
|
labelVisibility = "labeled",
|
|
@@ -19085,9 +19207,9 @@ var NavigationRailComponent = React67.forwardRef(
|
|
|
19085
19207
|
const isXr = variant === "xr";
|
|
19086
19208
|
const isSpatial = isXr && fabPlacement === "spatialized";
|
|
19087
19209
|
const applyAnimation = !isXr || !isSpatial;
|
|
19088
|
-
const navRef =
|
|
19210
|
+
const navRef = React33.useRef(null);
|
|
19089
19211
|
const handleKeyDown = useRoving(navRef);
|
|
19090
|
-
const setRefs =
|
|
19212
|
+
const setRefs = React33.useCallback(
|
|
19091
19213
|
(node) => {
|
|
19092
19214
|
navRef.current = node;
|
|
19093
19215
|
if (typeof ref === "function") ref(node);
|
|
@@ -19181,7 +19303,7 @@ var NavigationRailComponent = React67.forwardRef(
|
|
|
19181
19303
|
children: fab
|
|
19182
19304
|
}
|
|
19183
19305
|
),
|
|
19184
|
-
|
|
19306
|
+
React33.cloneElement(
|
|
19185
19307
|
navElement,
|
|
19186
19308
|
{
|
|
19187
19309
|
className: cn(navBaseClasses, "pointer-events-auto")
|
|
@@ -19226,7 +19348,7 @@ var NavigationRailComponent = React67.forwardRef(
|
|
|
19226
19348
|
}
|
|
19227
19349
|
);
|
|
19228
19350
|
NavigationRailComponent.displayName = "NavigationRail";
|
|
19229
|
-
var NavigationRail =
|
|
19351
|
+
var NavigationRail = React33.memo(NavigationRailComponent);
|
|
19230
19352
|
function useSearchKeyboard({
|
|
19231
19353
|
active,
|
|
19232
19354
|
onActiveChange,
|
|
@@ -19235,14 +19357,14 @@ function useSearchKeyboard({
|
|
|
19235
19357
|
itemCount,
|
|
19236
19358
|
onSelectSuggestion
|
|
19237
19359
|
}) {
|
|
19238
|
-
const [activeIndex, setActiveIndex] =
|
|
19239
|
-
const resetKeyRef =
|
|
19360
|
+
const [activeIndex, setActiveIndex] = React33.useState(-1);
|
|
19361
|
+
const resetKeyRef = React33.useRef(`${active}:${query}`);
|
|
19240
19362
|
const currentKey = `${active}:${query}`;
|
|
19241
19363
|
if (resetKeyRef.current !== currentKey) {
|
|
19242
19364
|
resetKeyRef.current = currentKey;
|
|
19243
19365
|
setActiveIndex(-1);
|
|
19244
19366
|
}
|
|
19245
|
-
const handleKeyDown =
|
|
19367
|
+
const handleKeyDown = React33.useCallback(
|
|
19246
19368
|
(e) => {
|
|
19247
19369
|
if (!active) return;
|
|
19248
19370
|
switch (e.key) {
|
|
@@ -19282,7 +19404,7 @@ function useSearchKeyboard({
|
|
|
19282
19404
|
query
|
|
19283
19405
|
]
|
|
19284
19406
|
);
|
|
19285
|
-
const resetActiveIndex =
|
|
19407
|
+
const resetActiveIndex = React33.useCallback(() => {
|
|
19286
19408
|
setActiveIndex(-1);
|
|
19287
19409
|
}, []);
|
|
19288
19410
|
return { activeIndex, handleKeyDown, resetActiveIndex };
|
|
@@ -19355,10 +19477,10 @@ function AnimatedPlaceholder({
|
|
|
19355
19477
|
className
|
|
19356
19478
|
}) {
|
|
19357
19479
|
const shouldReduceMotion = useReducedMotion();
|
|
19358
|
-
const containerRef =
|
|
19359
|
-
const spanRef =
|
|
19360
|
-
const [xOffset, setXOffset] =
|
|
19361
|
-
const recalculate =
|
|
19480
|
+
const containerRef = React33.useRef(null);
|
|
19481
|
+
const spanRef = React33.useRef(null);
|
|
19482
|
+
const [xOffset, setXOffset] = React33.useState(0);
|
|
19483
|
+
const recalculate = React33.useCallback(() => {
|
|
19362
19484
|
const container = containerRef.current;
|
|
19363
19485
|
const span = spanRef.current;
|
|
19364
19486
|
if (!container || !span || textAlign === "left") {
|
|
@@ -19373,10 +19495,10 @@ function AnimatedPlaceholder({
|
|
|
19373
19495
|
setXOffset(Math.max(0, containerWidth - textWidth));
|
|
19374
19496
|
}
|
|
19375
19497
|
}, [textAlign]);
|
|
19376
|
-
|
|
19498
|
+
React33.useLayoutEffect(() => {
|
|
19377
19499
|
recalculate();
|
|
19378
19500
|
}, [recalculate]);
|
|
19379
|
-
|
|
19501
|
+
React33.useEffect(() => {
|
|
19380
19502
|
const container = containerRef.current;
|
|
19381
19503
|
if (!container) return;
|
|
19382
19504
|
const observer = new ResizeObserver(recalculate);
|
|
@@ -19447,13 +19569,13 @@ function SearchBar({
|
|
|
19447
19569
|
activeIndex
|
|
19448
19570
|
}) {
|
|
19449
19571
|
const shouldReduceMotion = useReducedMotion();
|
|
19450
|
-
const inputRef =
|
|
19451
|
-
const prevActiveRef =
|
|
19452
|
-
const isRestoringFocusRef =
|
|
19453
|
-
const [isHovered, setIsHovered] =
|
|
19454
|
-
const [isPressed, setIsPressed] =
|
|
19455
|
-
const [isFocused, setIsFocused] =
|
|
19456
|
-
|
|
19572
|
+
const inputRef = React33.useRef(null);
|
|
19573
|
+
const prevActiveRef = React33.useRef(active);
|
|
19574
|
+
const isRestoringFocusRef = React33.useRef(false);
|
|
19575
|
+
const [isHovered, setIsHovered] = React33.useState(false);
|
|
19576
|
+
const [isPressed, setIsPressed] = React33.useState(false);
|
|
19577
|
+
const [isFocused, setIsFocused] = React33.useState(false);
|
|
19578
|
+
React33.useEffect(() => {
|
|
19457
19579
|
var _a;
|
|
19458
19580
|
let rafId;
|
|
19459
19581
|
if (prevActiveRef.current === true && active === false) {
|
|
@@ -19612,7 +19734,7 @@ function SearchBar({
|
|
|
19612
19734
|
) })
|
|
19613
19735
|
);
|
|
19614
19736
|
}
|
|
19615
|
-
var SearchContext =
|
|
19737
|
+
var SearchContext = React33.createContext(null);
|
|
19616
19738
|
function SearchProvider({
|
|
19617
19739
|
children,
|
|
19618
19740
|
value
|
|
@@ -19620,13 +19742,13 @@ function SearchProvider({
|
|
|
19620
19742
|
return /* @__PURE__ */ jsx(SearchContext.Provider, { value, children });
|
|
19621
19743
|
}
|
|
19622
19744
|
function useSearch() {
|
|
19623
|
-
const context =
|
|
19745
|
+
const context = React33.useContext(SearchContext);
|
|
19624
19746
|
if (!context) {
|
|
19625
19747
|
return { listboxId: "", activeIndex: -1 };
|
|
19626
19748
|
}
|
|
19627
19749
|
return context;
|
|
19628
19750
|
}
|
|
19629
|
-
function
|
|
19751
|
+
function useClickOutside2(handler, enabled = true) {
|
|
19630
19752
|
const ref = useRef(null);
|
|
19631
19753
|
useEffect(() => {
|
|
19632
19754
|
if (!enabled) return;
|
|
@@ -19647,7 +19769,7 @@ function useClickOutside(handler, enabled = true) {
|
|
|
19647
19769
|
return ref;
|
|
19648
19770
|
}
|
|
19649
19771
|
function useSearchViewFocus(inputRef, active) {
|
|
19650
|
-
|
|
19772
|
+
React33.useEffect(() => {
|
|
19651
19773
|
if (!active) return;
|
|
19652
19774
|
let raf2;
|
|
19653
19775
|
const raf1 = requestAnimationFrame(() => {
|
|
@@ -19760,9 +19882,9 @@ function SearchViewDocked({
|
|
|
19760
19882
|
activeIndex
|
|
19761
19883
|
}) {
|
|
19762
19884
|
const shouldReduceMotion = useReducedMotion();
|
|
19763
|
-
const inputRef =
|
|
19885
|
+
const inputRef = React33.useRef(null);
|
|
19764
19886
|
useSearchViewFocus(inputRef, active);
|
|
19765
|
-
const dropdownRef =
|
|
19887
|
+
const dropdownRef = useClickOutside2(() => {
|
|
19766
19888
|
onActiveChange(false);
|
|
19767
19889
|
}, active);
|
|
19768
19890
|
const handleFormSubmit = (e) => {
|
|
@@ -19911,10 +20033,10 @@ function SearchViewFullScreen({
|
|
|
19911
20033
|
activeIndex
|
|
19912
20034
|
}) {
|
|
19913
20035
|
const shouldReduceMotion = useReducedMotion();
|
|
19914
|
-
const inputRef =
|
|
20036
|
+
const inputRef = React33.useRef(null);
|
|
19915
20037
|
useSearchViewFocus(inputRef, active);
|
|
19916
|
-
const [mounted, setMounted] =
|
|
19917
|
-
|
|
20038
|
+
const [mounted, setMounted] = React33.useState(false);
|
|
20039
|
+
React33.useEffect(() => {
|
|
19918
20040
|
setMounted(true);
|
|
19919
20041
|
}, []);
|
|
19920
20042
|
const handleFormSubmit = (e) => {
|
|
@@ -20076,10 +20198,10 @@ function SearchComponent({
|
|
|
20076
20198
|
className,
|
|
20077
20199
|
viewClassName
|
|
20078
20200
|
}) {
|
|
20079
|
-
const generatedId =
|
|
20201
|
+
const generatedId = React33.useId();
|
|
20080
20202
|
const searchId = id != null ? id : generatedId;
|
|
20081
20203
|
const listboxId = `${searchId}-listbox`;
|
|
20082
|
-
const itemCount =
|
|
20204
|
+
const itemCount = React33.Children.count(children);
|
|
20083
20205
|
const { activeIndex, handleKeyDown } = useSearchKeyboard({
|
|
20084
20206
|
active,
|
|
20085
20207
|
onActiveChange,
|
|
@@ -20129,13 +20251,13 @@ function SearchComponent({
|
|
|
20129
20251
|
var Search = Object.assign(SearchComponent, { useSearch });
|
|
20130
20252
|
function useVirtualList(items, options = {}) {
|
|
20131
20253
|
const { batchSize = 50, rootMargin = "100px", root = null } = options;
|
|
20132
|
-
const [visibleCount, setVisibleCount] =
|
|
20133
|
-
const sentinelRef =
|
|
20134
|
-
|
|
20254
|
+
const [visibleCount, setVisibleCount] = React33.useState(batchSize);
|
|
20255
|
+
const sentinelRef = React33.useRef(null);
|
|
20256
|
+
React33.useEffect(() => {
|
|
20135
20257
|
setVisibleCount(batchSize);
|
|
20136
20258
|
}, [items, batchSize]);
|
|
20137
20259
|
const hasMore = visibleCount < items.length;
|
|
20138
|
-
|
|
20260
|
+
React33.useEffect(() => {
|
|
20139
20261
|
const target = sentinelRef.current;
|
|
20140
20262
|
if (!target || !hasMore) return;
|
|
20141
20263
|
if (typeof IntersectionObserver === "undefined") {
|
|
@@ -20159,11 +20281,11 @@ function useVirtualList(items, options = {}) {
|
|
|
20159
20281
|
observer.disconnect();
|
|
20160
20282
|
};
|
|
20161
20283
|
}, [hasMore, batchSize, items.length, rootMargin, root]);
|
|
20162
|
-
const visibleItems =
|
|
20284
|
+
const visibleItems = React33.useMemo(
|
|
20163
20285
|
() => items.slice(0, visibleCount),
|
|
20164
20286
|
[items, visibleCount]
|
|
20165
20287
|
);
|
|
20166
|
-
const reset =
|
|
20288
|
+
const reset = React33.useCallback(() => {
|
|
20167
20289
|
setVisibleCount(batchSize);
|
|
20168
20290
|
}, [batchSize]);
|
|
20169
20291
|
return {
|
|
@@ -20174,11 +20296,11 @@ function useVirtualList(items, options = {}) {
|
|
|
20174
20296
|
visibleCount
|
|
20175
20297
|
};
|
|
20176
20298
|
}
|
|
20177
|
-
var ToolbarContext =
|
|
20299
|
+
var ToolbarContext = React33.createContext(
|
|
20178
20300
|
null
|
|
20179
20301
|
);
|
|
20180
20302
|
function useToolbarContext() {
|
|
20181
|
-
return
|
|
20303
|
+
return React33.useContext(ToolbarContext);
|
|
20182
20304
|
}
|
|
20183
20305
|
|
|
20184
20306
|
// src/ui/text-field/text-field.tokens.ts
|
|
@@ -20218,7 +20340,7 @@ var TF_TYPOGRAPHY = {
|
|
|
20218
20340
|
var TF_CLASSES = {
|
|
20219
20341
|
// Prefix / Suffix
|
|
20220
20342
|
prefixSuffix: "text-base text-[var(--md-sys-color-on-surface-variant)] select-none shrink-0"};
|
|
20221
|
-
var ActiveIndicator =
|
|
20343
|
+
var ActiveIndicator = React33.memo(function ActiveIndicator2({
|
|
20222
20344
|
isFocused,
|
|
20223
20345
|
isError,
|
|
20224
20346
|
isDisabled,
|
|
@@ -20265,7 +20387,7 @@ function getLabelColor(isFloated, isFocused, isError, isDisabled) {
|
|
|
20265
20387
|
if (isFloated && isFocused) return TF_COLORS.primary;
|
|
20266
20388
|
return TF_COLORS.onSurfaceVariant;
|
|
20267
20389
|
}
|
|
20268
|
-
var FloatingLabel =
|
|
20390
|
+
var FloatingLabel = React33.memo(function FloatingLabel2({
|
|
20269
20391
|
text,
|
|
20270
20392
|
isFloated,
|
|
20271
20393
|
isFocused,
|
|
@@ -20324,7 +20446,7 @@ var FloatingLabel = React67.memo(function FloatingLabel2({
|
|
|
20324
20446
|
);
|
|
20325
20447
|
});
|
|
20326
20448
|
FloatingLabel.displayName = "FloatingLabel";
|
|
20327
|
-
var LeadingIcon =
|
|
20449
|
+
var LeadingIcon = React33.memo(function LeadingIcon2({
|
|
20328
20450
|
children,
|
|
20329
20451
|
isError,
|
|
20330
20452
|
isDisabled
|
|
@@ -20348,7 +20470,7 @@ function getOutlineColor(isFocused, isError, isHovered, isDisabled) {
|
|
|
20348
20470
|
if (isHovered) return TF_COLORS.inputText;
|
|
20349
20471
|
return TF_COLORS.outline;
|
|
20350
20472
|
}
|
|
20351
|
-
var OutlineContainer =
|
|
20473
|
+
var OutlineContainer = React33.memo(function OutlineContainer2({
|
|
20352
20474
|
isFloated,
|
|
20353
20475
|
isFocused,
|
|
20354
20476
|
isError,
|
|
@@ -20447,7 +20569,7 @@ var OutlineContainer = React67.memo(function OutlineContainer2({
|
|
|
20447
20569
|
);
|
|
20448
20570
|
});
|
|
20449
20571
|
OutlineContainer.displayName = "OutlineContainer";
|
|
20450
|
-
var PrefixSuffix =
|
|
20572
|
+
var PrefixSuffix = React33.memo(function PrefixSuffix2({
|
|
20451
20573
|
text,
|
|
20452
20574
|
type,
|
|
20453
20575
|
visible,
|
|
@@ -20489,7 +20611,7 @@ function AnimatedText({
|
|
|
20489
20611
|
motionKey
|
|
20490
20612
|
);
|
|
20491
20613
|
}
|
|
20492
|
-
var SupportingText =
|
|
20614
|
+
var SupportingText = React33.memo(function SupportingText2({
|
|
20493
20615
|
supportingText,
|
|
20494
20616
|
errorText,
|
|
20495
20617
|
isError,
|
|
@@ -20600,7 +20722,7 @@ function ClearIcon() {
|
|
|
20600
20722
|
}
|
|
20601
20723
|
);
|
|
20602
20724
|
}
|
|
20603
|
-
var TrailingIcon =
|
|
20725
|
+
var TrailingIcon = React33.memo(function TrailingIcon2({
|
|
20604
20726
|
mode,
|
|
20605
20727
|
children,
|
|
20606
20728
|
value,
|
|
@@ -20666,7 +20788,7 @@ var TrailingIcon = React67.memo(function TrailingIcon2({
|
|
|
20666
20788
|
});
|
|
20667
20789
|
TrailingIcon.displayName = "TrailingIcon";
|
|
20668
20790
|
var LINE_HEIGHT_PX = 24;
|
|
20669
|
-
var TextFieldComponent =
|
|
20791
|
+
var TextFieldComponent = React33.forwardRef(
|
|
20670
20792
|
({
|
|
20671
20793
|
// Core
|
|
20672
20794
|
variant = "filled",
|
|
@@ -20734,30 +20856,30 @@ var TextFieldComponent = React67.forwardRef(
|
|
|
20734
20856
|
const isInToolbar = !!toolbarContext;
|
|
20735
20857
|
const resolvedDense = isInToolbar ? true : dense;
|
|
20736
20858
|
const resolvedLabel = isInToolbar ? void 0 : label;
|
|
20737
|
-
const generatedId =
|
|
20859
|
+
const generatedId = React33.useId();
|
|
20738
20860
|
const inputId = idProp != null ? idProp : `tf-${generatedId}`;
|
|
20739
20861
|
const supportingId = `${inputId}-supporting`;
|
|
20740
20862
|
const isControlled = valueProp !== void 0;
|
|
20741
|
-
const [internalValue, setInternalValue] =
|
|
20863
|
+
const [internalValue, setInternalValue] = React33.useState(defaultValue);
|
|
20742
20864
|
const currentValue = isControlled ? valueProp : internalValue;
|
|
20743
|
-
const [isFocused, setIsFocused] =
|
|
20744
|
-
const [showPassword, setShowPassword] =
|
|
20865
|
+
const [isFocused, setIsFocused] = React33.useState(false);
|
|
20866
|
+
const [showPassword, setShowPassword] = React33.useState(false);
|
|
20745
20867
|
const resolvedInputType = type === "password" && showPassword ? "text" : type;
|
|
20746
|
-
const [nativeError, setNativeError] =
|
|
20747
|
-
const [labelWidth, setLabelWidth] =
|
|
20868
|
+
const [nativeError, setNativeError] = React33.useState("");
|
|
20869
|
+
const [labelWidth, setLabelWidth] = React33.useState(0);
|
|
20748
20870
|
const hasValue = currentValue.length > 0;
|
|
20749
20871
|
const isFloated = isFocused || hasValue;
|
|
20750
20872
|
const isError = errorProp || !!nativeError || maxLength !== void 0 && currentValue.length > maxLength;
|
|
20751
20873
|
const containerHeight = resolvedDense ? TF_SIZE.denseHeight : TF_SIZE.height;
|
|
20752
20874
|
const showAsterisk = required && !noAsterisk;
|
|
20753
|
-
const inputRef =
|
|
20754
|
-
const labelSpanRef =
|
|
20755
|
-
|
|
20875
|
+
const inputRef = React33.useRef(null);
|
|
20876
|
+
const labelSpanRef = React33.useRef(null);
|
|
20877
|
+
React33.useLayoutEffect(() => {
|
|
20756
20878
|
if (labelSpanRef.current) {
|
|
20757
20879
|
setLabelWidth(labelSpanRef.current.offsetWidth);
|
|
20758
20880
|
}
|
|
20759
20881
|
}, []);
|
|
20760
|
-
|
|
20882
|
+
React33.useLayoutEffect(() => {
|
|
20761
20883
|
if (type !== "textarea" || !inputRef.current) return;
|
|
20762
20884
|
const textarea = inputRef.current;
|
|
20763
20885
|
if (autoResize) {
|
|
@@ -20770,7 +20892,7 @@ var TextFieldComponent = React67.forwardRef(
|
|
|
20770
20892
|
textarea.style.overflowY = "";
|
|
20771
20893
|
}
|
|
20772
20894
|
}, [type, autoResize, currentValue]);
|
|
20773
|
-
const handleValueChange =
|
|
20895
|
+
const handleValueChange = React33.useCallback(
|
|
20774
20896
|
(newValue) => {
|
|
20775
20897
|
var _a2, _b;
|
|
20776
20898
|
if (!isControlled) setInternalValue(newValue);
|
|
@@ -20779,7 +20901,7 @@ var TextFieldComponent = React67.forwardRef(
|
|
|
20779
20901
|
},
|
|
20780
20902
|
[isControlled]
|
|
20781
20903
|
);
|
|
20782
|
-
const handleChange =
|
|
20904
|
+
const handleChange = React33.useCallback(
|
|
20783
20905
|
(e) => {
|
|
20784
20906
|
const newVal = e.target.value;
|
|
20785
20907
|
handleValueChange(newVal);
|
|
@@ -20787,14 +20909,14 @@ var TextFieldComponent = React67.forwardRef(
|
|
|
20787
20909
|
},
|
|
20788
20910
|
[handleValueChange, onChange]
|
|
20789
20911
|
);
|
|
20790
|
-
const handleFocus =
|
|
20912
|
+
const handleFocus = React33.useCallback(
|
|
20791
20913
|
(e) => {
|
|
20792
20914
|
setIsFocused(true);
|
|
20793
20915
|
onFocus == null ? void 0 : onFocus(e);
|
|
20794
20916
|
},
|
|
20795
20917
|
[onFocus]
|
|
20796
20918
|
);
|
|
20797
|
-
const handleBlur =
|
|
20919
|
+
const handleBlur = React33.useCallback(
|
|
20798
20920
|
(e) => {
|
|
20799
20921
|
setIsFocused(false);
|
|
20800
20922
|
const el = inputRef.current;
|
|
@@ -20807,7 +20929,7 @@ var TextFieldComponent = React67.forwardRef(
|
|
|
20807
20929
|
},
|
|
20808
20930
|
[onBlur]
|
|
20809
20931
|
);
|
|
20810
|
-
const handleClear =
|
|
20932
|
+
const handleClear = React33.useCallback(() => {
|
|
20811
20933
|
var _a2;
|
|
20812
20934
|
handleValueChange("");
|
|
20813
20935
|
onChange == null ? void 0 : onChange("", {
|
|
@@ -20815,12 +20937,12 @@ var TextFieldComponent = React67.forwardRef(
|
|
|
20815
20937
|
});
|
|
20816
20938
|
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
20817
20939
|
}, [handleValueChange, onChange]);
|
|
20818
|
-
const handlePasswordToggle =
|
|
20940
|
+
const handlePasswordToggle = React33.useCallback(() => {
|
|
20819
20941
|
var _a2;
|
|
20820
20942
|
setShowPassword((prev) => !prev);
|
|
20821
20943
|
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
20822
20944
|
}, []);
|
|
20823
|
-
|
|
20945
|
+
React33.useImperativeHandle(
|
|
20824
20946
|
ref,
|
|
20825
20947
|
() => ({
|
|
20826
20948
|
focus: () => {
|
|
@@ -21066,8 +21188,8 @@ var TextFieldComponent = React67.forwardRef(
|
|
|
21066
21188
|
}
|
|
21067
21189
|
);
|
|
21068
21190
|
TextFieldComponent.displayName = "TextField";
|
|
21069
|
-
var TextField =
|
|
21070
|
-
var Select =
|
|
21191
|
+
var TextField = React33.memo(TextFieldComponent);
|
|
21192
|
+
var Select = React33.forwardRef(
|
|
21071
21193
|
(_a, ref) => {
|
|
21072
21194
|
var _b = _a, {
|
|
21073
21195
|
options,
|
|
@@ -21121,17 +21243,17 @@ var Select = React67.forwardRef(
|
|
|
21121
21243
|
"children"
|
|
21122
21244
|
]);
|
|
21123
21245
|
var _a2, _b2;
|
|
21124
|
-
const [internalValue, setInternalValue] =
|
|
21246
|
+
const [internalValue, setInternalValue] = React33.useState(
|
|
21125
21247
|
() => defaultValue != null ? defaultValue : ""
|
|
21126
21248
|
);
|
|
21127
21249
|
const isControlled = controlledValue !== void 0;
|
|
21128
21250
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
21129
|
-
const [open, setOpen] =
|
|
21130
|
-
const openRef =
|
|
21251
|
+
const [open, setOpen] = React33.useState(false);
|
|
21252
|
+
const openRef = React33.useRef(open);
|
|
21131
21253
|
openRef.current = open;
|
|
21132
|
-
const [searchQuery, setSearchQuery] =
|
|
21133
|
-
const [scrollViewport, setScrollViewport] =
|
|
21134
|
-
|
|
21254
|
+
const [searchQuery, setSearchQuery] = React33.useState("");
|
|
21255
|
+
const [scrollViewport, setScrollViewport] = React33.useState(null);
|
|
21256
|
+
React33.useEffect(() => {
|
|
21135
21257
|
var _a3, _b3;
|
|
21136
21258
|
const isDev = ((_b3 = (_a3 = globalThis.process) == null ? void 0 : _a3.env) == null ? void 0 : _b3.NODE_ENV) !== "production";
|
|
21137
21259
|
if (isDev && onSearchChange && !searchable) {
|
|
@@ -21140,12 +21262,12 @@ var Select = React67.forwardRef(
|
|
|
21140
21262
|
);
|
|
21141
21263
|
}
|
|
21142
21264
|
}, [onSearchChange, searchable]);
|
|
21143
|
-
const selectedOption =
|
|
21265
|
+
const selectedOption = React33.useMemo(
|
|
21144
21266
|
() => options.find((opt) => opt.value === currentValue),
|
|
21145
21267
|
[options, currentValue]
|
|
21146
21268
|
);
|
|
21147
21269
|
const displayValue = searchable ? open ? searchQuery : (_a2 = selectedOption == null ? void 0 : selectedOption.label) != null ? _a2 : "" : (_b2 = selectedOption == null ? void 0 : selectedOption.label) != null ? _b2 : "";
|
|
21148
|
-
const filteredOptions =
|
|
21270
|
+
const filteredOptions = React33.useMemo(() => {
|
|
21149
21271
|
if (onSearchChange) return options;
|
|
21150
21272
|
if (!searchable || !searchQuery.trim()) return options;
|
|
21151
21273
|
const query = searchQuery.toLowerCase();
|
|
@@ -21158,7 +21280,7 @@ var Select = React67.forwardRef(
|
|
|
21158
21280
|
root: scrollViewport
|
|
21159
21281
|
}
|
|
21160
21282
|
);
|
|
21161
|
-
const handleSelect =
|
|
21283
|
+
const handleSelect = React33.useCallback(
|
|
21162
21284
|
(option) => {
|
|
21163
21285
|
if (option.disabled) return;
|
|
21164
21286
|
if (!isControlled) {
|
|
@@ -21170,7 +21292,7 @@ var Select = React67.forwardRef(
|
|
|
21170
21292
|
},
|
|
21171
21293
|
[isControlled, onChange]
|
|
21172
21294
|
);
|
|
21173
|
-
const handleInputChange =
|
|
21295
|
+
const handleInputChange = React33.useCallback(
|
|
21174
21296
|
(inputValue) => {
|
|
21175
21297
|
if (searchable) {
|
|
21176
21298
|
setSearchQuery(inputValue);
|
|
@@ -21180,7 +21302,7 @@ var Select = React67.forwardRef(
|
|
|
21180
21302
|
},
|
|
21181
21303
|
[searchable, onSearchChange]
|
|
21182
21304
|
);
|
|
21183
|
-
const handleInputFocus =
|
|
21305
|
+
const handleInputFocus = React33.useCallback(() => {
|
|
21184
21306
|
if (!disabled && !openRef.current) {
|
|
21185
21307
|
setOpen(true);
|
|
21186
21308
|
if (searchable) {
|
|
@@ -21189,7 +21311,7 @@ var Select = React67.forwardRef(
|
|
|
21189
21311
|
}
|
|
21190
21312
|
}
|
|
21191
21313
|
}, [disabled, searchable, onSearchChange]);
|
|
21192
|
-
const handleKeyDown =
|
|
21314
|
+
const handleKeyDown = React33.useCallback(
|
|
21193
21315
|
(e) => {
|
|
21194
21316
|
if (e.key === "ArrowDown" && !openRef.current) {
|
|
21195
21317
|
e.preventDefault();
|
|
@@ -21295,7 +21417,7 @@ var Select = React67.forwardRef(
|
|
|
21295
21417
|
}) : loading ? /* @__PURE__ */ jsx(SelectLoading, {}) : filteredOptions.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21296
21418
|
visibleItems.map((option, index) => {
|
|
21297
21419
|
if (renderOption) {
|
|
21298
|
-
return /* @__PURE__ */ jsx(
|
|
21420
|
+
return /* @__PURE__ */ jsx(React33.Fragment, { children: renderOption(option, {
|
|
21299
21421
|
selected: option.value === currentValue,
|
|
21300
21422
|
disabled: option.disabled,
|
|
21301
21423
|
handleSelect: () => handleSelect(option),
|
|
@@ -21919,7 +22041,7 @@ function useShapeSequenceMorph({
|
|
|
21919
22041
|
};
|
|
21920
22042
|
}
|
|
21921
22043
|
var INDICATOR = "h-1 w-8 rounded-full bg-m3-on-surface-variant/40";
|
|
21922
|
-
var DragHandle =
|
|
22044
|
+
var DragHandle = React33.forwardRef(
|
|
21923
22045
|
({ className, onCycle, "aria-label": ariaLabel }, ref) => {
|
|
21924
22046
|
const isInteractive = Boolean(onCycle);
|
|
21925
22047
|
if (isInteractive) {
|
|
@@ -22472,7 +22594,7 @@ function resolveMaxHeight(maxHeight, snapPoints) {
|
|
|
22472
22594
|
return ABSOLUTE_MAX_HEIGHT;
|
|
22473
22595
|
return maxHeight;
|
|
22474
22596
|
}
|
|
22475
|
-
var BottomSheet =
|
|
22597
|
+
var BottomSheet = React33.forwardRef(
|
|
22476
22598
|
({
|
|
22477
22599
|
isOpen,
|
|
22478
22600
|
onClose,
|
|
@@ -22505,27 +22627,27 @@ var BottomSheet = React67.forwardRef(
|
|
|
22505
22627
|
isModal: false,
|
|
22506
22628
|
maxHeight: resolveMaxHeight(maxHeight, snapPoints)
|
|
22507
22629
|
});
|
|
22508
|
-
|
|
22630
|
+
React33.useEffect(() => {
|
|
22509
22631
|
const node = scope.current;
|
|
22510
22632
|
if (node) {
|
|
22511
22633
|
node.snapTo = snapTo;
|
|
22512
22634
|
}
|
|
22513
22635
|
}, [snapTo, scope]);
|
|
22514
|
-
const [mounted, setMounted] =
|
|
22515
|
-
|
|
22636
|
+
const [mounted, setMounted] = React33.useState(false);
|
|
22637
|
+
React33.useEffect(() => {
|
|
22516
22638
|
setMounted(true);
|
|
22517
22639
|
}, []);
|
|
22518
|
-
const resolvedDividers =
|
|
22640
|
+
const resolvedDividers = React33.useMemo(
|
|
22519
22641
|
() => resolveDividers(divider),
|
|
22520
22642
|
[divider]
|
|
22521
22643
|
);
|
|
22522
|
-
const resolvedSheetMaxWidth =
|
|
22644
|
+
const resolvedSheetMaxWidth = React33.useMemo(() => {
|
|
22523
22645
|
if (sheetMaxWidth === void 0)
|
|
22524
22646
|
return "var(--m3-bottom-sheet-max-width, 640px)";
|
|
22525
22647
|
if (typeof sheetMaxWidth === "number") return `${sheetMaxWidth}px`;
|
|
22526
22648
|
return sheetMaxWidth;
|
|
22527
22649
|
}, [sheetMaxWidth]);
|
|
22528
|
-
const mergedRef =
|
|
22650
|
+
const mergedRef = React33.useCallback(
|
|
22529
22651
|
(node) => {
|
|
22530
22652
|
scope(node);
|
|
22531
22653
|
if (typeof ref === "function") ref(node);
|
|
@@ -22609,7 +22731,7 @@ var SCRIM_ANIM = {
|
|
|
22609
22731
|
},
|
|
22610
22732
|
exit: { opacity: 0, transition: { duration: 0.18, ease: "easeIn" } }
|
|
22611
22733
|
};
|
|
22612
|
-
var Scrim =
|
|
22734
|
+
var Scrim = React33.forwardRef(
|
|
22613
22735
|
({ onClick, className, style }, ref) => /* @__PURE__ */ jsx(
|
|
22614
22736
|
m.div,
|
|
22615
22737
|
__spreadValues({
|
|
@@ -22641,7 +22763,7 @@ function resolveSheetMaxWidth(value) {
|
|
|
22641
22763
|
if (typeof value === "number") return `${value}px`;
|
|
22642
22764
|
return value;
|
|
22643
22765
|
}
|
|
22644
|
-
var BottomSheetModal =
|
|
22766
|
+
var BottomSheetModal = React33.forwardRef(
|
|
22645
22767
|
({
|
|
22646
22768
|
isOpen,
|
|
22647
22769
|
onClose,
|
|
@@ -22680,21 +22802,21 @@ var BottomSheetModal = React67.forwardRef(
|
|
|
22680
22802
|
isModal: true,
|
|
22681
22803
|
maxHeight: resolveMaxHeight2(maxHeight, snapPoints)
|
|
22682
22804
|
});
|
|
22683
|
-
|
|
22805
|
+
React33.useEffect(() => {
|
|
22684
22806
|
const node = scope.current;
|
|
22685
22807
|
if (node) {
|
|
22686
22808
|
node.snapTo = snapTo;
|
|
22687
22809
|
}
|
|
22688
22810
|
}, [snapTo, scope]);
|
|
22689
|
-
const resolvedDividers =
|
|
22811
|
+
const resolvedDividers = React33.useMemo(
|
|
22690
22812
|
() => resolveDividers(divider),
|
|
22691
22813
|
[divider]
|
|
22692
22814
|
);
|
|
22693
|
-
const resolvedSheetMaxWidth =
|
|
22815
|
+
const resolvedSheetMaxWidth = React33.useMemo(
|
|
22694
22816
|
() => resolveSheetMaxWidth(sheetMaxWidth),
|
|
22695
22817
|
[sheetMaxWidth]
|
|
22696
22818
|
);
|
|
22697
|
-
const mergedRef =
|
|
22819
|
+
const mergedRef = React33.useCallback(
|
|
22698
22820
|
(node) => {
|
|
22699
22821
|
scope(node);
|
|
22700
22822
|
if (typeof ref === "function") ref(node);
|
|
@@ -22785,7 +22907,7 @@ var BottomSheetModal = React67.forwardRef(
|
|
|
22785
22907
|
);
|
|
22786
22908
|
BottomSheetModal.displayName = "BottomSheetModal";
|
|
22787
22909
|
var COPLANAR_TRANSITION = `margin ${getMotionTransitionCSS("default", "spatial")}`;
|
|
22788
|
-
var SideSheet =
|
|
22910
|
+
var SideSheet = React33.forwardRef(
|
|
22789
22911
|
({
|
|
22790
22912
|
isOpen,
|
|
22791
22913
|
children,
|
|
@@ -22801,16 +22923,16 @@ var SideSheet = React67.forwardRef(
|
|
|
22801
22923
|
divider,
|
|
22802
22924
|
scrollAreaProps
|
|
22803
22925
|
}, ref) => {
|
|
22804
|
-
const sheetAnim =
|
|
22805
|
-
const [mounted, setMounted] =
|
|
22806
|
-
|
|
22926
|
+
const sheetAnim = React33.useMemo(() => buildSideSheetAnim(edge), [edge]);
|
|
22927
|
+
const [mounted, setMounted] = React33.useState(false);
|
|
22928
|
+
React33.useEffect(() => {
|
|
22807
22929
|
setMounted(true);
|
|
22808
22930
|
}, []);
|
|
22809
|
-
const resolvedDividers =
|
|
22931
|
+
const resolvedDividers = React33.useMemo(
|
|
22810
22932
|
() => resolveDividers(divider),
|
|
22811
22933
|
[divider]
|
|
22812
22934
|
);
|
|
22813
|
-
|
|
22935
|
+
React33.useEffect(() => {
|
|
22814
22936
|
const sibling = coplanarSiblingRef == null ? void 0 : coplanarSiblingRef.current;
|
|
22815
22937
|
if (!sibling) return;
|
|
22816
22938
|
sibling.style.transition = COPLANAR_TRANSITION;
|
|
@@ -22874,7 +22996,7 @@ var SideSheet = React67.forwardRef(
|
|
|
22874
22996
|
}
|
|
22875
22997
|
);
|
|
22876
22998
|
SideSheet.displayName = "SideSheet";
|
|
22877
|
-
var SideSheetModal =
|
|
22999
|
+
var SideSheetModal = React33.forwardRef(
|
|
22878
23000
|
({
|
|
22879
23001
|
isOpen,
|
|
22880
23002
|
onClose,
|
|
@@ -22889,8 +23011,8 @@ var SideSheetModal = React67.forwardRef(
|
|
|
22889
23011
|
divider,
|
|
22890
23012
|
scrollAreaProps
|
|
22891
23013
|
}, ref) => {
|
|
22892
|
-
const sheetAnim =
|
|
22893
|
-
const resolvedDividers =
|
|
23014
|
+
const sheetAnim = React33.useMemo(() => buildSideSheetAnim(edge), [edge]);
|
|
23015
|
+
const resolvedDividers = React33.useMemo(
|
|
22894
23016
|
() => resolveDividers(divider),
|
|
22895
23017
|
[divider]
|
|
22896
23018
|
);
|
|
@@ -23149,7 +23271,7 @@ var SLIDER_INDICATOR_TRANSITION = {
|
|
|
23149
23271
|
stiffness: 450,
|
|
23150
23272
|
damping: 32
|
|
23151
23273
|
};
|
|
23152
|
-
var ValueIndicator =
|
|
23274
|
+
var ValueIndicator = React33.memo(function ValueIndicator2({
|
|
23153
23275
|
value,
|
|
23154
23276
|
visible,
|
|
23155
23277
|
orientation,
|
|
@@ -23196,7 +23318,7 @@ var ValueIndicator = React67.memo(function ValueIndicator2({
|
|
|
23196
23318
|
"value-indicator"
|
|
23197
23319
|
) });
|
|
23198
23320
|
});
|
|
23199
|
-
var SliderThumb =
|
|
23321
|
+
var SliderThumb = React33.memo(function SliderThumb2({
|
|
23200
23322
|
value,
|
|
23201
23323
|
percent,
|
|
23202
23324
|
min,
|
|
@@ -23225,11 +23347,11 @@ var SliderThumb = React67.memo(function SliderThumb2({
|
|
|
23225
23347
|
[posTarget]: `calc(${trackInset}px + ${percent} * (100% - ${trackInset * 2}px))`
|
|
23226
23348
|
};
|
|
23227
23349
|
const prefersReduced = (_a = useReducedMotion()) != null ? _a : false;
|
|
23228
|
-
const [isDragging, setIsDragging] =
|
|
23229
|
-
const [isHovered, setIsHovered] =
|
|
23230
|
-
const [isFocused, setIsFocused] =
|
|
23231
|
-
const pointerIdRef =
|
|
23232
|
-
const thumbRef =
|
|
23350
|
+
const [isDragging, setIsDragging] = React33.useState(false);
|
|
23351
|
+
const [isHovered, setIsHovered] = React33.useState(false);
|
|
23352
|
+
const [isFocused, setIsFocused] = React33.useState(false);
|
|
23353
|
+
const pointerIdRef = React33.useRef(null);
|
|
23354
|
+
const thumbRef = React33.useRef(null);
|
|
23233
23355
|
const showIndicator = showValueIndicator && (isDragging || isHovered || isFocused);
|
|
23234
23356
|
const positionStyle = isHorizontal ? __spreadProps(__spreadValues({
|
|
23235
23357
|
position: "absolute"
|
|
@@ -23244,7 +23366,7 @@ var SliderThumb = React67.memo(function SliderThumb2({
|
|
|
23244
23366
|
transform: "translate(-50%, 50%)",
|
|
23245
23367
|
zIndex
|
|
23246
23368
|
});
|
|
23247
|
-
const getDeltaFromPointer =
|
|
23369
|
+
const getDeltaFromPointer = React33.useCallback(
|
|
23248
23370
|
(e) => {
|
|
23249
23371
|
const trackEl = trackRef.current;
|
|
23250
23372
|
if (!trackEl) return percent;
|
|
@@ -23271,7 +23393,7 @@ var SliderThumb = React67.memo(function SliderThumb2({
|
|
|
23271
23393
|
},
|
|
23272
23394
|
[isHorizontal, max, min, percent, step, trackRef, size]
|
|
23273
23395
|
);
|
|
23274
|
-
const handlePointerDown =
|
|
23396
|
+
const handlePointerDown = React33.useCallback(
|
|
23275
23397
|
(e) => {
|
|
23276
23398
|
if (disabled) return;
|
|
23277
23399
|
e.preventDefault();
|
|
@@ -23282,7 +23404,7 @@ var SliderThumb = React67.memo(function SliderThumb2({
|
|
|
23282
23404
|
},
|
|
23283
23405
|
[disabled]
|
|
23284
23406
|
);
|
|
23285
|
-
const handlePointerMove =
|
|
23407
|
+
const handlePointerMove = React33.useCallback(
|
|
23286
23408
|
(e) => {
|
|
23287
23409
|
if (!isDragging || e.pointerId !== pointerIdRef.current) return;
|
|
23288
23410
|
const newValue = getDeltaFromPointer(e.nativeEvent);
|
|
@@ -23290,7 +23412,7 @@ var SliderThumb = React67.memo(function SliderThumb2({
|
|
|
23290
23412
|
},
|
|
23291
23413
|
[isDragging, getDeltaFromPointer, onValueChange]
|
|
23292
23414
|
);
|
|
23293
|
-
const handlePointerUp =
|
|
23415
|
+
const handlePointerUp = React33.useCallback(
|
|
23294
23416
|
(e) => {
|
|
23295
23417
|
if (e.pointerId !== pointerIdRef.current) return;
|
|
23296
23418
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
@@ -23300,7 +23422,7 @@ var SliderThumb = React67.memo(function SliderThumb2({
|
|
|
23300
23422
|
},
|
|
23301
23423
|
[onValueChangeEnd, value]
|
|
23302
23424
|
);
|
|
23303
|
-
const handleKeyDown =
|
|
23425
|
+
const handleKeyDown = React33.useCallback(
|
|
23304
23426
|
(e) => {
|
|
23305
23427
|
if (disabled) return;
|
|
23306
23428
|
if (e.key === "Home") {
|
|
@@ -23404,7 +23526,7 @@ var SliderThumb = React67.memo(function SliderThumb2({
|
|
|
23404
23526
|
}
|
|
23405
23527
|
);
|
|
23406
23528
|
});
|
|
23407
|
-
var RangeTrack =
|
|
23529
|
+
var RangeTrack = React33.memo(function RangeTrack2({
|
|
23408
23530
|
startPercent,
|
|
23409
23531
|
endPercent,
|
|
23410
23532
|
size,
|
|
@@ -23649,7 +23771,7 @@ var RangeTrack = React67.memo(function RangeTrack2({
|
|
|
23649
23771
|
}
|
|
23650
23772
|
);
|
|
23651
23773
|
});
|
|
23652
|
-
var RangeSliderComponent =
|
|
23774
|
+
var RangeSliderComponent = React33.forwardRef(
|
|
23653
23775
|
({
|
|
23654
23776
|
value: controlledValue,
|
|
23655
23777
|
defaultValue,
|
|
@@ -23673,7 +23795,7 @@ var RangeSliderComponent = React67.forwardRef(
|
|
|
23673
23795
|
const isHorizontal = orientation === "horizontal";
|
|
23674
23796
|
const defaultStart = (_a = defaultValue == null ? void 0 : defaultValue[0]) != null ? _a : min;
|
|
23675
23797
|
const defaultEnd = (_b = defaultValue == null ? void 0 : defaultValue[1]) != null ? _b : max;
|
|
23676
|
-
const [internalValue, setInternalValue] =
|
|
23798
|
+
const [internalValue, setInternalValue] = React33.useState([
|
|
23677
23799
|
defaultStart,
|
|
23678
23800
|
defaultEnd
|
|
23679
23801
|
]);
|
|
@@ -23687,10 +23809,10 @@ var RangeSliderComponent = React67.forwardRef(
|
|
|
23687
23809
|
const endValue = snap(coerce(resolvedValue[1]));
|
|
23688
23810
|
const startPercent = toPercent(startValue);
|
|
23689
23811
|
const endPercent = toPercent(endValue);
|
|
23690
|
-
const [topThumb, setTopThumb] =
|
|
23691
|
-
const trackRef =
|
|
23812
|
+
const [topThumb, setTopThumb] = React33.useState("end");
|
|
23813
|
+
const trackRef = React33.useRef(null);
|
|
23692
23814
|
const minGap = step > 0 ? step : (max - min) / 1e3;
|
|
23693
|
-
const handleStartChange =
|
|
23815
|
+
const handleStartChange = React33.useCallback(
|
|
23694
23816
|
(newStart) => {
|
|
23695
23817
|
setTopThumb("start");
|
|
23696
23818
|
const clamped = Math.min(newStart, endValue - minGap);
|
|
@@ -23702,7 +23824,7 @@ var RangeSliderComponent = React67.forwardRef(
|
|
|
23702
23824
|
},
|
|
23703
23825
|
[controlledValue, coerce, endValue, minGap, onValueChange, snap]
|
|
23704
23826
|
);
|
|
23705
|
-
const handleEndChange =
|
|
23827
|
+
const handleEndChange = React33.useCallback(
|
|
23706
23828
|
(newEnd) => {
|
|
23707
23829
|
setTopThumb("end");
|
|
23708
23830
|
const clamped = Math.max(newEnd, startValue + minGap);
|
|
@@ -23714,15 +23836,15 @@ var RangeSliderComponent = React67.forwardRef(
|
|
|
23714
23836
|
},
|
|
23715
23837
|
[controlledValue, coerce, minGap, onValueChange, snap, startValue]
|
|
23716
23838
|
);
|
|
23717
|
-
const handleStartChangeEnd =
|
|
23839
|
+
const handleStartChangeEnd = React33.useCallback(
|
|
23718
23840
|
(v) => onValueChangeEnd == null ? void 0 : onValueChangeEnd([v, endValue]),
|
|
23719
23841
|
[endValue, onValueChangeEnd]
|
|
23720
23842
|
);
|
|
23721
|
-
const handleEndChangeEnd =
|
|
23843
|
+
const handleEndChangeEnd = React33.useCallback(
|
|
23722
23844
|
(v) => onValueChangeEnd == null ? void 0 : onValueChangeEnd([startValue, v]),
|
|
23723
23845
|
[onValueChangeEnd, startValue]
|
|
23724
23846
|
);
|
|
23725
|
-
const handleTrackPointerDown =
|
|
23847
|
+
const handleTrackPointerDown = React33.useCallback(
|
|
23726
23848
|
(e) => {
|
|
23727
23849
|
if (disabled) return;
|
|
23728
23850
|
const trackEl = trackRef.current;
|
|
@@ -23766,7 +23888,7 @@ var RangeSliderComponent = React67.forwardRef(
|
|
|
23766
23888
|
size
|
|
23767
23889
|
]
|
|
23768
23890
|
);
|
|
23769
|
-
const id =
|
|
23891
|
+
const id = React33.useId();
|
|
23770
23892
|
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
|
|
23771
23893
|
"div",
|
|
23772
23894
|
{
|
|
@@ -23846,7 +23968,7 @@ var RangeSliderComponent = React67.forwardRef(
|
|
|
23846
23968
|
}
|
|
23847
23969
|
);
|
|
23848
23970
|
RangeSliderComponent.displayName = "RangeSlider";
|
|
23849
|
-
var RangeSlider =
|
|
23971
|
+
var RangeSlider = React33.memo(RangeSliderComponent);
|
|
23850
23972
|
function getHorizontalRadius(isLeading, innerR, outerR) {
|
|
23851
23973
|
if (isLeading) {
|
|
23852
23974
|
return {
|
|
@@ -23885,7 +24007,7 @@ var allInnerRadius = (innerR) => ({
|
|
|
23885
24007
|
borderTopRightRadius: innerR,
|
|
23886
24008
|
borderBottomRightRadius: innerR
|
|
23887
24009
|
});
|
|
23888
|
-
var InsetIcon =
|
|
24010
|
+
var InsetIcon = React33.memo(function InsetIcon2({
|
|
23889
24011
|
icon,
|
|
23890
24012
|
isOnActiveSegment,
|
|
23891
24013
|
position,
|
|
@@ -23979,7 +24101,7 @@ function Ticks({
|
|
|
23979
24101
|
return /* @__PURE__ */ jsx("div", { style, "aria-hidden": "true" }, tick);
|
|
23980
24102
|
}) });
|
|
23981
24103
|
}
|
|
23982
|
-
var SliderTrack =
|
|
24104
|
+
var SliderTrack = React33.memo(function SliderTrack2({
|
|
23983
24105
|
percent,
|
|
23984
24106
|
size,
|
|
23985
24107
|
orientation,
|
|
@@ -24014,8 +24136,8 @@ var SliderTrack = React67.memo(function SliderTrack2({
|
|
|
24014
24136
|
const gapWithThumbStr = `${thumbGap + thumbHalfWidth}px`;
|
|
24015
24137
|
const hasAnyInsetIcon = Boolean(insetIcon || insetIconTrailing);
|
|
24016
24138
|
const prefersReduced = (_a = useReducedMotion()) != null ? _a : false;
|
|
24017
|
-
const [trackWidth, setTrackWidth] =
|
|
24018
|
-
|
|
24139
|
+
const [trackWidth, setTrackWidth] = React33.useState(0);
|
|
24140
|
+
React33.useLayoutEffect(() => {
|
|
24019
24141
|
const el = trackRef.current;
|
|
24020
24142
|
if (!el || !hasAnyInsetIcon) return;
|
|
24021
24143
|
setTrackWidth(isHorizontal ? el.clientWidth : el.clientHeight);
|
|
@@ -24032,8 +24154,8 @@ var SliderTrack = React67.memo(function SliderTrack2({
|
|
|
24032
24154
|
const iconTotalWidth = activeIconSize + SliderTokens.insetIconPadding * 2 + thumbGap + thumbHalfWidth;
|
|
24033
24155
|
const iconThreshold = trackWidth > 0 ? iconTotalWidth / trackWidth : 0.15;
|
|
24034
24156
|
const HYSTERESIS_GAP = 0.04;
|
|
24035
|
-
const trailingActiveRef =
|
|
24036
|
-
const leadingActiveRef =
|
|
24157
|
+
const trailingActiveRef = React33.useRef(1 - percent <= iconThreshold);
|
|
24158
|
+
const leadingActiveRef = React33.useRef(percent > iconThreshold);
|
|
24037
24159
|
const trailingPercent = 1 - percent;
|
|
24038
24160
|
if (trailingActiveRef.current) {
|
|
24039
24161
|
if (trailingPercent > iconThreshold + HYSTERESIS_GAP) {
|
|
@@ -24540,7 +24662,7 @@ var SliderTrack = React67.memo(function SliderTrack2({
|
|
|
24540
24662
|
}
|
|
24541
24663
|
);
|
|
24542
24664
|
});
|
|
24543
|
-
var SliderComponent =
|
|
24665
|
+
var SliderComponent = React33.forwardRef(
|
|
24544
24666
|
({
|
|
24545
24667
|
value: controlledValue,
|
|
24546
24668
|
defaultValue,
|
|
@@ -24569,7 +24691,7 @@ var SliderComponent = React67.forwardRef(
|
|
|
24569
24691
|
const isHorizontal = orientation === "horizontal";
|
|
24570
24692
|
const midpoint = min + (max - min) / 2;
|
|
24571
24693
|
const initialValue = defaultValue != null ? defaultValue : midpoint;
|
|
24572
|
-
const [internalValue, setInternalValue] =
|
|
24694
|
+
const [internalValue, setInternalValue] = React33.useState(initialValue);
|
|
24573
24695
|
const resolvedValue = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
24574
24696
|
const { coerce, snap, toPercent, ticks } = useSliderMath({
|
|
24575
24697
|
min,
|
|
@@ -24578,8 +24700,8 @@ var SliderComponent = React67.forwardRef(
|
|
|
24578
24700
|
});
|
|
24579
24701
|
const safeValue = snap(coerce(resolvedValue));
|
|
24580
24702
|
const percent = toPercent(safeValue);
|
|
24581
|
-
const trackRef =
|
|
24582
|
-
const handleValueChange =
|
|
24703
|
+
const trackRef = React33.useRef(null);
|
|
24704
|
+
const handleValueChange = React33.useCallback(
|
|
24583
24705
|
(newValue) => {
|
|
24584
24706
|
const clamped = snap(coerce(newValue));
|
|
24585
24707
|
if (controlledValue === void 0) {
|
|
@@ -24589,13 +24711,13 @@ var SliderComponent = React67.forwardRef(
|
|
|
24589
24711
|
},
|
|
24590
24712
|
[coerce, controlledValue, onValueChange, snap]
|
|
24591
24713
|
);
|
|
24592
|
-
const handleValueChangeEnd =
|
|
24714
|
+
const handleValueChangeEnd = React33.useCallback(
|
|
24593
24715
|
(newValue) => {
|
|
24594
24716
|
onValueChangeEnd == null ? void 0 : onValueChangeEnd(snap(coerce(newValue)));
|
|
24595
24717
|
},
|
|
24596
24718
|
[coerce, onValueChangeEnd, snap]
|
|
24597
24719
|
);
|
|
24598
|
-
const handleTrackPointerDown =
|
|
24720
|
+
const handleTrackPointerDown = React33.useCallback(
|
|
24599
24721
|
(e) => {
|
|
24600
24722
|
if (disabled) return;
|
|
24601
24723
|
const trackEl = trackRef.current;
|
|
@@ -24621,7 +24743,7 @@ var SliderComponent = React67.forwardRef(
|
|
|
24621
24743
|
},
|
|
24622
24744
|
[coerce, disabled, handleValueChange, isHorizontal, max, min, snap, size]
|
|
24623
24745
|
);
|
|
24624
|
-
const id =
|
|
24746
|
+
const id = React33.useId();
|
|
24625
24747
|
const thumbId = `slider-thumb-${id}`;
|
|
24626
24748
|
const supportsInsetIcon = !isCentered && SliderTokens.trackSizes[size] >= 40;
|
|
24627
24749
|
const hasAnyInsetIcon = !!(insetIcon || insetIconTrailing);
|
|
@@ -24693,7 +24815,7 @@ var SliderComponent = React67.forwardRef(
|
|
|
24693
24815
|
}
|
|
24694
24816
|
);
|
|
24695
24817
|
SliderComponent.displayName = "Slider";
|
|
24696
|
-
var Slider =
|
|
24818
|
+
var Slider = React33.memo(SliderComponent);
|
|
24697
24819
|
var DURATION_MAP = {
|
|
24698
24820
|
short: 4e3,
|
|
24699
24821
|
long: 7e3
|
|
@@ -24735,9 +24857,9 @@ function toSnackbarData(item) {
|
|
|
24735
24857
|
return { id: generateId(), visuals: item.visuals, resolve: item.resolve };
|
|
24736
24858
|
}
|
|
24737
24859
|
function useSnackbarState() {
|
|
24738
|
-
const [current, setCurrent] =
|
|
24739
|
-
const queueRef =
|
|
24740
|
-
const showSnackbar =
|
|
24860
|
+
const [current, setCurrent] = React33.useState(null);
|
|
24861
|
+
const queueRef = React33.useRef([]);
|
|
24862
|
+
const showSnackbar = React33.useCallback(
|
|
24741
24863
|
(visuals) => {
|
|
24742
24864
|
return new Promise((resolve) => {
|
|
24743
24865
|
const item = { visuals, resolve };
|
|
@@ -24750,14 +24872,14 @@ function useSnackbarState() {
|
|
|
24750
24872
|
},
|
|
24751
24873
|
[]
|
|
24752
24874
|
);
|
|
24753
|
-
const _dismiss =
|
|
24875
|
+
const _dismiss = React33.useCallback((result) => {
|
|
24754
24876
|
setCurrent((prev) => {
|
|
24755
24877
|
if (prev) prev.resolve(result);
|
|
24756
24878
|
const next = queueRef.current.shift();
|
|
24757
24879
|
return next ? toSnackbarData(next) : null;
|
|
24758
24880
|
});
|
|
24759
24881
|
}, []);
|
|
24760
|
-
|
|
24882
|
+
React33.useEffect(() => {
|
|
24761
24883
|
return () => {
|
|
24762
24884
|
for (const item of queueRef.current) {
|
|
24763
24885
|
item.resolve(RESULT.DISMISSED);
|
|
@@ -24767,7 +24889,7 @@ function useSnackbarState() {
|
|
|
24767
24889
|
}, []);
|
|
24768
24890
|
return { current, showSnackbar, _dismiss };
|
|
24769
24891
|
}
|
|
24770
|
-
var Snackbar =
|
|
24892
|
+
var Snackbar = React33.memo(function Snackbar2({
|
|
24771
24893
|
data,
|
|
24772
24894
|
className
|
|
24773
24895
|
}) {
|
|
@@ -24781,15 +24903,15 @@ var Snackbar = React67.memo(function Snackbar2({
|
|
|
24781
24903
|
} = visuals;
|
|
24782
24904
|
const reducedMotion = useReducedMotion();
|
|
24783
24905
|
const durationMs = resolveDuration(duration);
|
|
24784
|
-
|
|
24906
|
+
React33.useEffect(() => {
|
|
24785
24907
|
const timer = setTimeout(() => resolve(RESULT.DISMISSED), durationMs);
|
|
24786
24908
|
return () => clearTimeout(timer);
|
|
24787
24909
|
}, [resolve, durationMs]);
|
|
24788
|
-
const handleAction =
|
|
24910
|
+
const handleAction = React33.useCallback(
|
|
24789
24911
|
() => resolve(RESULT.ACTION),
|
|
24790
24912
|
[resolve]
|
|
24791
24913
|
);
|
|
24792
|
-
const handleDismiss =
|
|
24914
|
+
const handleDismiss = React33.useCallback(
|
|
24793
24915
|
() => resolve(RESULT.DISMISSED),
|
|
24794
24916
|
[resolve]
|
|
24795
24917
|
);
|
|
@@ -24859,7 +24981,7 @@ var Snackbar = React67.memo(function Snackbar2({
|
|
|
24859
24981
|
Snackbar.displayName = "Snackbar";
|
|
24860
24982
|
function SnackbarHost({ state, className }) {
|
|
24861
24983
|
const { current, _dismiss } = state;
|
|
24862
|
-
const wrappedData =
|
|
24984
|
+
const wrappedData = React33.useMemo(() => {
|
|
24863
24985
|
if (!current) return null;
|
|
24864
24986
|
return __spreadProps(__spreadValues({}, current), { resolve: _dismiss });
|
|
24865
24987
|
}, [current, _dismiss]);
|
|
@@ -24877,12 +24999,12 @@ function SnackbarHost({ state, className }) {
|
|
|
24877
24999
|
) });
|
|
24878
25000
|
}
|
|
24879
25001
|
SnackbarHost.displayName = "SnackbarHost";
|
|
24880
|
-
var SnackbarContext =
|
|
25002
|
+
var SnackbarContext = React33.createContext(
|
|
24881
25003
|
null
|
|
24882
25004
|
);
|
|
24883
25005
|
function SnackbarProvider({ children }) {
|
|
24884
25006
|
const state = useSnackbarState();
|
|
24885
|
-
const contextValue =
|
|
25007
|
+
const contextValue = React33.useMemo(
|
|
24886
25008
|
() => ({ showSnackbar: state.showSnackbar }),
|
|
24887
25009
|
[state.showSnackbar]
|
|
24888
25010
|
);
|
|
@@ -24893,15 +25015,15 @@ function SnackbarProvider({ children }) {
|
|
|
24893
25015
|
}
|
|
24894
25016
|
SnackbarProvider.displayName = "SnackbarProvider";
|
|
24895
25017
|
function useSnackbar() {
|
|
24896
|
-
const ctx =
|
|
25018
|
+
const ctx = React33.useContext(SnackbarContext);
|
|
24897
25019
|
if (!ctx) {
|
|
24898
25020
|
throw new Error("useSnackbar must be used within a <SnackbarProvider>.");
|
|
24899
25021
|
}
|
|
24900
25022
|
return ctx;
|
|
24901
25023
|
}
|
|
24902
|
-
var TabsContext =
|
|
25024
|
+
var TabsContext = React33.createContext(null);
|
|
24903
25025
|
function useTabsContext() {
|
|
24904
|
-
const ctx =
|
|
25026
|
+
const ctx = React33.useContext(TabsContext);
|
|
24905
25027
|
if (!ctx) {
|
|
24906
25028
|
throw new Error(
|
|
24907
25029
|
"[MD3 Tabs] Component must be used within a <Tabs> root. Ensure <TabsList>, <Tab>, and <TabsContent> are descendants of <Tabs>."
|
|
@@ -24909,7 +25031,7 @@ function useTabsContext() {
|
|
|
24909
25031
|
}
|
|
24910
25032
|
return ctx;
|
|
24911
25033
|
}
|
|
24912
|
-
var TabsComponent =
|
|
25034
|
+
var TabsComponent = React33.forwardRef(
|
|
24913
25035
|
({
|
|
24914
25036
|
value: controlledValue,
|
|
24915
25037
|
defaultValue = "",
|
|
@@ -24918,35 +25040,35 @@ var TabsComponent = React67.forwardRef(
|
|
|
24918
25040
|
children,
|
|
24919
25041
|
className
|
|
24920
25042
|
}, ref) => {
|
|
24921
|
-
const [internalValue, setInternalValue] =
|
|
25043
|
+
const [internalValue, setInternalValue] = React33.useState(defaultValue);
|
|
24922
25044
|
const isControlled = controlledValue !== void 0;
|
|
24923
25045
|
const value = isControlled ? controlledValue : internalValue;
|
|
24924
|
-
const handleValueChange =
|
|
25046
|
+
const handleValueChange = React33.useCallback(
|
|
24925
25047
|
(newValue) => {
|
|
24926
25048
|
if (!isControlled) setInternalValue(newValue);
|
|
24927
25049
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
24928
25050
|
},
|
|
24929
25051
|
[isControlled, onValueChange]
|
|
24930
25052
|
);
|
|
24931
|
-
const [focusedValue, setFocusedValue] =
|
|
24932
|
-
|
|
25053
|
+
const [focusedValue, setFocusedValue] = React33.useState(value);
|
|
25054
|
+
React33.useEffect(() => {
|
|
24933
25055
|
setFocusedValue(value);
|
|
24934
25056
|
}, [value]);
|
|
24935
|
-
const [tabValues, setTabValues] =
|
|
24936
|
-
const registerTab =
|
|
25057
|
+
const [tabValues, setTabValues] = React33.useState([]);
|
|
25058
|
+
const registerTab = React33.useCallback((tabValue) => {
|
|
24937
25059
|
setTabValues((prev) => {
|
|
24938
25060
|
if (prev.includes(tabValue)) return prev;
|
|
24939
25061
|
return [...prev, tabValue];
|
|
24940
25062
|
});
|
|
24941
25063
|
}, []);
|
|
24942
|
-
const unregisterTab =
|
|
25064
|
+
const unregisterTab = React33.useCallback((tabValue) => {
|
|
24943
25065
|
setTabValues((prev) => prev.filter((v) => v !== tabValue));
|
|
24944
25066
|
}, []);
|
|
24945
|
-
const hasAutoSelected =
|
|
24946
|
-
const [disabledValues, setDisabledValues] =
|
|
25067
|
+
const hasAutoSelected = React33.useRef(false);
|
|
25068
|
+
const [disabledValues, setDisabledValues] = React33.useState(
|
|
24947
25069
|
/* @__PURE__ */ new Set()
|
|
24948
25070
|
);
|
|
24949
|
-
const markTabDisabled =
|
|
25071
|
+
const markTabDisabled = React33.useCallback(
|
|
24950
25072
|
(tabValue, disabled) => {
|
|
24951
25073
|
setDisabledValues((prev) => {
|
|
24952
25074
|
const next = new Set(prev);
|
|
@@ -24960,7 +25082,7 @@ var TabsComponent = React67.forwardRef(
|
|
|
24960
25082
|
},
|
|
24961
25083
|
[]
|
|
24962
25084
|
);
|
|
24963
|
-
|
|
25085
|
+
React33.useEffect(() => {
|
|
24964
25086
|
if (isControlled || hasAutoSelected.current || tabValues.length === 0) {
|
|
24965
25087
|
return;
|
|
24966
25088
|
}
|
|
@@ -24975,9 +25097,9 @@ var TabsComponent = React67.forwardRef(
|
|
|
24975
25097
|
setFocusedValue(firstEnabled);
|
|
24976
25098
|
}
|
|
24977
25099
|
}, [tabValues, disabledValues, isControlled, value]);
|
|
24978
|
-
const id =
|
|
25100
|
+
const id = React33.useId();
|
|
24979
25101
|
const layoutGroupId = `tabs-${id}`;
|
|
24980
|
-
const contextValue =
|
|
25102
|
+
const contextValue = React33.useMemo(
|
|
24981
25103
|
() => ({
|
|
24982
25104
|
value,
|
|
24983
25105
|
onValueChange: handleValueChange,
|
|
@@ -25008,12 +25130,12 @@ var TabsComponent = React67.forwardRef(
|
|
|
25008
25130
|
}
|
|
25009
25131
|
);
|
|
25010
25132
|
TabsComponent.displayName = "Tabs";
|
|
25011
|
-
var Tabs =
|
|
25012
|
-
var TabsListContext =
|
|
25133
|
+
var Tabs = React33.memo(TabsComponent);
|
|
25134
|
+
var TabsListContext = React33.createContext(
|
|
25013
25135
|
null
|
|
25014
25136
|
);
|
|
25015
25137
|
function useTabsListContext() {
|
|
25016
|
-
const ctx =
|
|
25138
|
+
const ctx = React33.useContext(TabsListContext);
|
|
25017
25139
|
return ctx != null ? ctx : { variant: "primary", scrollable: false };
|
|
25018
25140
|
}
|
|
25019
25141
|
|
|
@@ -25097,7 +25219,7 @@ var TABS_CONTENT_TRANSITION = {
|
|
|
25097
25219
|
ease: "easeInOut"
|
|
25098
25220
|
};
|
|
25099
25221
|
var INDICATOR_MIN_WIDTH = 24;
|
|
25100
|
-
var TabComponent =
|
|
25222
|
+
var TabComponent = React33.forwardRef(
|
|
25101
25223
|
({
|
|
25102
25224
|
value,
|
|
25103
25225
|
icon,
|
|
@@ -25127,9 +25249,9 @@ var TabComponent = React67.forwardRef(
|
|
|
25127
25249
|
const isFocused = focusedValue === value;
|
|
25128
25250
|
const hasIcon = icon != null;
|
|
25129
25251
|
const isStackedIcon = hasIcon && !inlineIcon;
|
|
25130
|
-
const buttonRef =
|
|
25131
|
-
const isFirstMount =
|
|
25132
|
-
const mergedRef =
|
|
25252
|
+
const buttonRef = React33.useRef(null);
|
|
25253
|
+
const isFirstMount = React33.useRef(true);
|
|
25254
|
+
const mergedRef = React33.useCallback(
|
|
25133
25255
|
(node) => {
|
|
25134
25256
|
buttonRef.current = node;
|
|
25135
25257
|
if (typeof ref === "function") ref(node);
|
|
@@ -25137,15 +25259,15 @@ var TabComponent = React67.forwardRef(
|
|
|
25137
25259
|
},
|
|
25138
25260
|
[ref]
|
|
25139
25261
|
);
|
|
25140
|
-
|
|
25262
|
+
React33.useEffect(() => {
|
|
25141
25263
|
registerTab(value);
|
|
25142
25264
|
return () => unregisterTab(value);
|
|
25143
25265
|
}, [value, registerTab, unregisterTab]);
|
|
25144
|
-
|
|
25266
|
+
React33.useEffect(() => {
|
|
25145
25267
|
markTabDisabled(value, disabled);
|
|
25146
25268
|
return () => markTabDisabled(value, false);
|
|
25147
25269
|
}, [value, disabled, markTabDisabled]);
|
|
25148
|
-
const handleKeyDown =
|
|
25270
|
+
const handleKeyDown = React33.useCallback(
|
|
25149
25271
|
(e) => {
|
|
25150
25272
|
const isRtl = buttonRef.current ? getComputedStyle(buttonRef.current).direction === "rtl" : false;
|
|
25151
25273
|
const enabledValues = tabValues.filter((v) => !disabledValues.has(v));
|
|
@@ -25199,7 +25321,7 @@ var TabComponent = React67.forwardRef(
|
|
|
25199
25321
|
autoActivate
|
|
25200
25322
|
]
|
|
25201
25323
|
);
|
|
25202
|
-
|
|
25324
|
+
React33.useEffect(() => {
|
|
25203
25325
|
if (isFirstMount.current) {
|
|
25204
25326
|
isFirstMount.current = false;
|
|
25205
25327
|
return;
|
|
@@ -25208,7 +25330,7 @@ var TabComponent = React67.forwardRef(
|
|
|
25208
25330
|
buttonRef.current.focus({ preventScroll: true });
|
|
25209
25331
|
}
|
|
25210
25332
|
}, [isFocused]);
|
|
25211
|
-
|
|
25333
|
+
React33.useEffect(() => {
|
|
25212
25334
|
if (!isActive || !scrollable || !buttonRef.current) return;
|
|
25213
25335
|
const btn = buttonRef.current;
|
|
25214
25336
|
let container = btn.parentElement;
|
|
@@ -25345,8 +25467,8 @@ var TabComponent = React67.forwardRef(
|
|
|
25345
25467
|
}
|
|
25346
25468
|
);
|
|
25347
25469
|
TabComponent.displayName = "Tab";
|
|
25348
|
-
var Tab =
|
|
25349
|
-
var TabsContentComponent =
|
|
25470
|
+
var Tab = React33.memo(TabComponent);
|
|
25471
|
+
var TabsContentComponent = React33.forwardRef(
|
|
25350
25472
|
({ value, className, children }, ref) => {
|
|
25351
25473
|
var _a;
|
|
25352
25474
|
const { value: selectedValue, layoutGroupId } = useTabsContext();
|
|
@@ -25380,8 +25502,8 @@ var TabsContentComponent = React67.forwardRef(
|
|
|
25380
25502
|
}
|
|
25381
25503
|
);
|
|
25382
25504
|
TabsContentComponent.displayName = "TabsContent";
|
|
25383
|
-
var TabsContent =
|
|
25384
|
-
var TabsListComponent =
|
|
25505
|
+
var TabsContent = React33.memo(TabsContentComponent);
|
|
25506
|
+
var TabsListComponent = React33.forwardRef(
|
|
25385
25507
|
({
|
|
25386
25508
|
variant,
|
|
25387
25509
|
scrollable = false,
|
|
@@ -25392,12 +25514,12 @@ var TabsListComponent = React67.forwardRef(
|
|
|
25392
25514
|
}, ref) => {
|
|
25393
25515
|
const { layoutGroupId, value, setFocusedValue } = useTabsContext();
|
|
25394
25516
|
const listLayoutId = `${layoutGroupId}-list`;
|
|
25395
|
-
const listContextValue =
|
|
25517
|
+
const listContextValue = React33.useMemo(
|
|
25396
25518
|
() => ({ variant, scrollable }),
|
|
25397
25519
|
[variant, scrollable]
|
|
25398
25520
|
);
|
|
25399
25521
|
const bgColor = backgroundColor != null ? backgroundColor : "var(--md-sys-color-surface)";
|
|
25400
|
-
const handleBlur =
|
|
25522
|
+
const handleBlur = React33.useCallback(
|
|
25401
25523
|
(e) => {
|
|
25402
25524
|
const listEl = e.currentTarget;
|
|
25403
25525
|
if (listEl.contains(e.relatedTarget)) return;
|
|
@@ -25446,7 +25568,7 @@ var TabsListComponent = React67.forwardRef(
|
|
|
25446
25568
|
}
|
|
25447
25569
|
);
|
|
25448
25570
|
TabsListComponent.displayName = "TabsList";
|
|
25449
|
-
var TabsList =
|
|
25571
|
+
var TabsList = React33.memo(TabsListComponent);
|
|
25450
25572
|
var typographyVariants = cva("m-0 p-0 text-m3-on-surface", {
|
|
25451
25573
|
variants: {
|
|
25452
25574
|
variant: {
|
|
@@ -25472,10 +25594,10 @@ var typographyVariants = cva("m-0 p-0 text-m3-on-surface", {
|
|
|
25472
25594
|
variant: "body-md"
|
|
25473
25595
|
}
|
|
25474
25596
|
});
|
|
25475
|
-
var Text =
|
|
25597
|
+
var Text = React33.forwardRef(
|
|
25476
25598
|
(_a, ref) => {
|
|
25477
25599
|
var _b = _a, { className, variant, as: Component, color, weight, style } = _b, props = __objRest(_b, ["className", "variant", "as", "color", "weight", "style"]);
|
|
25478
|
-
const defaultComponent =
|
|
25600
|
+
const defaultComponent = React33.useMemo(() => {
|
|
25479
25601
|
const v = variant ? String(variant).toLowerCase() : "";
|
|
25480
25602
|
if (v.startsWith("display") || v.startsWith("headline")) return "h1";
|
|
25481
25603
|
if (v.startsWith("title")) return "h2";
|
|
@@ -26475,7 +26597,7 @@ function getToolbarColors(variant = "standard", customColors) {
|
|
|
26475
26597
|
return standardFloatingToolbarColors;
|
|
26476
26598
|
}
|
|
26477
26599
|
}
|
|
26478
|
-
var BottomDockedToolbar =
|
|
26600
|
+
var BottomDockedToolbar = React33.forwardRef(
|
|
26479
26601
|
(_a, ref) => {
|
|
26480
26602
|
var _b = _a, {
|
|
26481
26603
|
variant = "standard",
|
|
@@ -26508,8 +26630,8 @@ var BottomDockedToolbar = React67.forwardRef(
|
|
|
26508
26630
|
const { scrollY } = useScroll(
|
|
26509
26631
|
scrollContainerRef ? { container: scrollContainerRef } : void 0
|
|
26510
26632
|
);
|
|
26511
|
-
const [isHidden, setIsHidden] =
|
|
26512
|
-
const lastScrollY =
|
|
26633
|
+
const [isHidden, setIsHidden] = React33.useState(false);
|
|
26634
|
+
const lastScrollY = React33.useRef(0);
|
|
26513
26635
|
useMotionValueEvent(scrollY, "change", (latest) => {
|
|
26514
26636
|
if (!hideOnScroll) return;
|
|
26515
26637
|
const diff = latest - lastScrollY.current;
|
|
@@ -26668,15 +26790,15 @@ function buildSlotVariants(xHidden, yHidden, isHorizontal) {
|
|
|
26668
26790
|
};
|
|
26669
26791
|
}
|
|
26670
26792
|
function applyItemClassName(nodes, itemClassName) {
|
|
26671
|
-
return
|
|
26672
|
-
if (!
|
|
26793
|
+
return React33.Children.map(nodes, (child) => {
|
|
26794
|
+
if (!React33.isValidElement(child)) return child;
|
|
26673
26795
|
const element = child;
|
|
26674
|
-
return
|
|
26796
|
+
return React33.cloneElement(element, {
|
|
26675
26797
|
className: cn(element.props.className, itemClassName)
|
|
26676
26798
|
});
|
|
26677
26799
|
});
|
|
26678
26800
|
}
|
|
26679
|
-
var FloatingToolbarBase =
|
|
26801
|
+
var FloatingToolbarBase = React33.forwardRef(
|
|
26680
26802
|
(_a, ref) => {
|
|
26681
26803
|
var _b = _a, {
|
|
26682
26804
|
expanded,
|
|
@@ -26848,11 +26970,11 @@ var FloatingToolbarBase = React67.forwardRef(
|
|
|
26848
26970
|
}
|
|
26849
26971
|
);
|
|
26850
26972
|
FloatingToolbarBase.displayName = "FloatingToolbarBase";
|
|
26851
|
-
var HorizontalFloatingToolbar =
|
|
26973
|
+
var HorizontalFloatingToolbar = React33.forwardRef((props, ref) => /* @__PURE__ */ jsx(FloatingToolbarBase, __spreadValues({ ref, orientation: "horizontal" }, props)));
|
|
26852
26974
|
HorizontalFloatingToolbar.displayName = "HorizontalFloatingToolbar";
|
|
26853
|
-
var VerticalFloatingToolbar =
|
|
26975
|
+
var VerticalFloatingToolbar = React33.forwardRef((props, ref) => /* @__PURE__ */ jsx(FloatingToolbarBase, __spreadValues({ ref, orientation: "vertical" }, props)));
|
|
26854
26976
|
VerticalFloatingToolbar.displayName = "VerticalFloatingToolbar";
|
|
26855
|
-
var FloatingToolbarWithFabBase =
|
|
26977
|
+
var FloatingToolbarWithFabBase = React33.forwardRef(
|
|
26856
26978
|
(_a, ref) => {
|
|
26857
26979
|
var _b = _a, {
|
|
26858
26980
|
expanded,
|
|
@@ -26980,9 +27102,9 @@ var FloatingToolbarWithFabBase = React67.forwardRef(
|
|
|
26980
27102
|
}
|
|
26981
27103
|
);
|
|
26982
27104
|
FloatingToolbarWithFabBase.displayName = "FloatingToolbarWithFabBase";
|
|
26983
|
-
var HorizontalFloatingToolbarWithFab =
|
|
27105
|
+
var HorizontalFloatingToolbarWithFab = React33.forwardRef((props, ref) => /* @__PURE__ */ jsx(FloatingToolbarWithFabBase, __spreadValues({ ref, orientation: "horizontal" }, props)));
|
|
26984
27106
|
HorizontalFloatingToolbarWithFab.displayName = "HorizontalFloatingToolbarWithFab";
|
|
26985
|
-
var VerticalFloatingToolbarWithFab =
|
|
27107
|
+
var VerticalFloatingToolbarWithFab = React33.forwardRef((props, ref) => /* @__PURE__ */ jsx(FloatingToolbarWithFabBase, __spreadValues({ ref, orientation: "vertical" }, props)));
|
|
26986
27108
|
VerticalFloatingToolbarWithFab.displayName = "VerticalFloatingToolbarWithFab";
|
|
26987
27109
|
var ToolbarDivider = ({
|
|
26988
27110
|
orientation: propsOrientation,
|
|
@@ -27018,7 +27140,7 @@ var VARIANT_TO_COLOR_STYLE = {
|
|
|
27018
27140
|
tonal: "tonal",
|
|
27019
27141
|
filled: "filled"
|
|
27020
27142
|
};
|
|
27021
|
-
var ToolbarIconButton =
|
|
27143
|
+
var ToolbarIconButton = React33.forwardRef(
|
|
27022
27144
|
(_a, ref) => {
|
|
27023
27145
|
var _b = _a, {
|
|
27024
27146
|
emphasis = "standard",
|
|
@@ -27162,7 +27284,7 @@ var MOTION_PROP_KEYS2 = [
|
|
|
27162
27284
|
"layoutId",
|
|
27163
27285
|
"onLayoutAnimationComplete"
|
|
27164
27286
|
];
|
|
27165
|
-
var ToolbarToggleButton =
|
|
27287
|
+
var ToolbarToggleButton = React33.forwardRef(
|
|
27166
27288
|
(_a, ref) => {
|
|
27167
27289
|
var _b = _a, {
|
|
27168
27290
|
emphasis = "standard",
|
|
@@ -27196,7 +27318,7 @@ var ToolbarToggleButton = React67.forwardRef(
|
|
|
27196
27318
|
"onPointerLeave"
|
|
27197
27319
|
]);
|
|
27198
27320
|
const context = useToolbarContext();
|
|
27199
|
-
const [isPressed, setIsPressed] =
|
|
27321
|
+
const [isPressed, setIsPressed] = React33.useState(false);
|
|
27200
27322
|
const {
|
|
27201
27323
|
ripples,
|
|
27202
27324
|
onPointerDown: handleRipplePointerDown,
|
|
@@ -27204,7 +27326,7 @@ var ToolbarToggleButton = React67.forwardRef(
|
|
|
27204
27326
|
} = useRippleState({
|
|
27205
27327
|
disabled: Boolean(disabled) || !ripple
|
|
27206
27328
|
});
|
|
27207
|
-
const handlePointerDown =
|
|
27329
|
+
const handlePointerDown = React33.useCallback(
|
|
27208
27330
|
(e) => {
|
|
27209
27331
|
setIsPressed(true);
|
|
27210
27332
|
if (!disabled && ripple) {
|
|
@@ -27214,14 +27336,14 @@ var ToolbarToggleButton = React67.forwardRef(
|
|
|
27214
27336
|
},
|
|
27215
27337
|
[disabled, ripple, handleRipplePointerDown, onPointerDownProp]
|
|
27216
27338
|
);
|
|
27217
|
-
const handlePointerUp =
|
|
27339
|
+
const handlePointerUp = React33.useCallback(
|
|
27218
27340
|
(e) => {
|
|
27219
27341
|
setIsPressed(false);
|
|
27220
27342
|
onPointerUpProp == null ? void 0 : onPointerUpProp(e);
|
|
27221
27343
|
},
|
|
27222
27344
|
[onPointerUpProp]
|
|
27223
27345
|
);
|
|
27224
|
-
const handlePointerLeave =
|
|
27346
|
+
const handlePointerLeave = React33.useCallback(
|
|
27225
27347
|
(e) => {
|
|
27226
27348
|
setIsPressed(false);
|
|
27227
27349
|
onPointerLeaveProp == null ? void 0 : onPointerLeaveProp(e);
|
|
@@ -27240,14 +27362,14 @@ var ToolbarToggleButton = React67.forwardRef(
|
|
|
27240
27362
|
context == null ? void 0 : context.itemClassName,
|
|
27241
27363
|
className
|
|
27242
27364
|
);
|
|
27243
|
-
const animateConfig =
|
|
27365
|
+
const animateConfig = React33.useMemo(
|
|
27244
27366
|
() => ({
|
|
27245
27367
|
scaleX: pressExpand && isPressed ? 1 + pressExpandRatio : 1,
|
|
27246
27368
|
borderRadius: isPressed ? ToolbarToggleButtonRadiusTokens.pressedRadius : ToolbarToggleButtonRadiusTokens.pillRadius
|
|
27247
27369
|
}),
|
|
27248
27370
|
[pressExpand, pressExpandRatio, isPressed]
|
|
27249
27371
|
);
|
|
27250
|
-
const transitionConfig =
|
|
27372
|
+
const transitionConfig = React33.useMemo(
|
|
27251
27373
|
() => ({
|
|
27252
27374
|
scaleX: FAST_SPATIAL_SPRING,
|
|
27253
27375
|
borderRadius: BUTTON_RADIUS_SPRING
|
|
@@ -27269,7 +27391,7 @@ var ToolbarToggleButton = React67.forwardRef(
|
|
|
27269
27391
|
children && (typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx("span", { children }) : children)
|
|
27270
27392
|
] });
|
|
27271
27393
|
if (asChild) {
|
|
27272
|
-
const child =
|
|
27394
|
+
const child = React33.Children.only(children);
|
|
27273
27395
|
const childContent = child.props.children;
|
|
27274
27396
|
const innerChildContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
27275
27397
|
ripple && /* @__PURE__ */ jsx(
|
|
@@ -27308,7 +27430,7 @@ var ToolbarToggleButton = React67.forwardRef(
|
|
|
27308
27430
|
onPointerUp: handlePointerUp,
|
|
27309
27431
|
onPointerLeave: handlePointerLeave
|
|
27310
27432
|
}, strippedProps), {
|
|
27311
|
-
children:
|
|
27433
|
+
children: React33.cloneElement(child, { children: innerChildContent })
|
|
27312
27434
|
})
|
|
27313
27435
|
) });
|
|
27314
27436
|
}
|
|
@@ -27916,7 +28038,7 @@ function TooltipBox({
|
|
|
27916
28038
|
onKeyDown: handleKeyDown,
|
|
27917
28039
|
"aria-label": ariaLabel,
|
|
27918
28040
|
"aria-describedby": state.isVisible ? tooltipId : void 0,
|
|
27919
|
-
children:
|
|
28041
|
+
children: React33.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children })
|
|
27920
28042
|
}
|
|
27921
28043
|
),
|
|
27922
28044
|
mounted && createPortal(
|