@bug-on/m3-expressive 1.2.0 → 1.2.1
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 +2 -2
- package/dist/buttons.d.ts +2 -2
- package/dist/buttons.js +678 -605
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +677 -604
- package/dist/buttons.mjs.map +1 -1
- package/dist/core.js +86 -61
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +86 -61
- package/dist/core.mjs.map +1 -1
- package/dist/feedback.js +85 -61
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs +85 -61
- package/dist/feedback.mjs.map +1 -1
- package/dist/forms.d.mts +2 -2
- package/dist/forms.d.ts +2 -2
- package/dist/forms.js +70 -8
- package/dist/forms.js.map +1 -1
- package/dist/forms.mjs +70 -8
- package/dist/forms.mjs.map +1 -1
- package/dist/{icon-button-D-gs0gfj.d.mts → icon-button-sSt6PPLg.d.mts} +6 -0
- package/dist/{icon-button-D-gs0gfj.d.ts → icon-button-sSt6PPLg.d.ts} +6 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +973 -496
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +967 -497
- package/dist/index.mjs.map +1 -1
- package/dist/layout.d.mts +18 -1
- package/dist/layout.d.ts +18 -1
- package/dist/layout.js +65 -8
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +65 -8
- package/dist/layout.mjs.map +1 -1
- package/dist/navigation.d.mts +134 -9
- package/dist/navigation.d.ts +134 -9
- package/dist/navigation.js +403 -93
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +397 -94
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.js +214 -189
- package/dist/overlays.js.map +1 -1
- package/dist/overlays.mjs +176 -151
- package/dist/overlays.mjs.map +1 -1
- package/dist/pickers.js +222 -197
- package/dist/pickers.js.map +1 -1
- package/dist/pickers.mjs +189 -164
- package/dist/pickers.mjs.map +1 -1
- package/dist/{split-button-trailing-uncheckable-BkPbiBo3.d.ts → split-button-trailing-uncheckable-BcPD_7uK.d.ts} +44 -6
- package/dist/{split-button-trailing-uncheckable-D_PLPb-u.d.mts → split-button-trailing-uncheckable-DtFJkTFr.d.mts} +44 -6
- package/dist/{text-field-eAIpz9z1.d.mts → text-field-T4Rg-9Bw.d.mts} +7 -0
- package/dist/{text-field-eAIpz9z1.d.ts → text-field-T4Rg-9Bw.d.ts} +7 -0
- package/package.json +1 -1
package/dist/buttons.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
var reactSlot = require('@radix-ui/react-slot');
|
|
5
5
|
var react = require('motion/react');
|
|
6
|
-
var
|
|
6
|
+
var React14 = require('react');
|
|
7
7
|
var clsx = require('clsx');
|
|
8
8
|
var tailwindMerge = require('tailwind-merge');
|
|
9
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -28,7 +28,7 @@ function _interopNamespace(e) {
|
|
|
28
28
|
return Object.freeze(n);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var React14__namespace = /*#__PURE__*/_interopNamespace(React14);
|
|
32
32
|
|
|
33
33
|
var __defProp = Object.defineProperty;
|
|
34
34
|
var __defProps = Object.defineProperties;
|
|
@@ -109,11 +109,11 @@ var ROTATE_KEY_SPLINES = [
|
|
|
109
109
|
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";
|
|
110
110
|
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";
|
|
111
111
|
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";
|
|
112
|
-
var IndeterminateSvg =
|
|
112
|
+
var IndeterminateSvg = React14__namespace.memo(function IndeterminateSvg2({
|
|
113
113
|
size
|
|
114
114
|
}) {
|
|
115
|
-
const [ready, setReady] =
|
|
116
|
-
|
|
115
|
+
const [ready, setReady] = React14__namespace.useState(false);
|
|
116
|
+
React14__namespace.useEffect(() => {
|
|
117
117
|
const raf = requestAnimationFrame(() => setReady(true));
|
|
118
118
|
return () => cancelAnimationFrame(raf);
|
|
119
119
|
}, []);
|
|
@@ -158,7 +158,7 @@ var IndeterminateSvg = React11__namespace.memo(function IndeterminateSvg2({
|
|
|
158
158
|
}
|
|
159
159
|
);
|
|
160
160
|
});
|
|
161
|
-
var DeterminateSvg =
|
|
161
|
+
var DeterminateSvg = React14__namespace.memo(function DeterminateSvg2({
|
|
162
162
|
size,
|
|
163
163
|
progress
|
|
164
164
|
}) {
|
|
@@ -183,7 +183,7 @@ var DeterminateSvg = React11__namespace.memo(function DeterminateSvg2({
|
|
|
183
183
|
}
|
|
184
184
|
);
|
|
185
185
|
});
|
|
186
|
-
var LoadingIndicator =
|
|
186
|
+
var LoadingIndicator = React14__namespace.forwardRef(
|
|
187
187
|
(_a, ref) => {
|
|
188
188
|
var _b = _a, {
|
|
189
189
|
variant = "uncontained",
|
|
@@ -298,7 +298,7 @@ function getSinePath(startX, endX, phase, wl, amp) {
|
|
|
298
298
|
d += ` L ${endX.toFixed(2)} ${yEnd.toFixed(2)}`;
|
|
299
299
|
return d;
|
|
300
300
|
}
|
|
301
|
-
var CircularProgress =
|
|
301
|
+
var CircularProgress = React14__namespace.forwardRef(
|
|
302
302
|
(_a, ref) => {
|
|
303
303
|
var _b = _a, {
|
|
304
304
|
value,
|
|
@@ -336,15 +336,15 @@ var CircularProgress = React11__namespace.forwardRef(
|
|
|
336
336
|
const isWavy = shape === "wavy";
|
|
337
337
|
const BASELINE_SIZE = 48;
|
|
338
338
|
const scaleFactor = size / BASELINE_SIZE;
|
|
339
|
-
const effectiveAmplitude =
|
|
339
|
+
const effectiveAmplitude = React14__namespace.useMemo(
|
|
340
340
|
() => amplitude != null ? amplitude : 1.6 * scaleFactor,
|
|
341
341
|
[amplitude, scaleFactor]
|
|
342
342
|
);
|
|
343
|
-
const effectiveWavelength =
|
|
343
|
+
const effectiveWavelength = React14__namespace.useMemo(
|
|
344
344
|
() => wavelength != null ? wavelength : 15 * scaleFactor,
|
|
345
345
|
[wavelength, scaleFactor]
|
|
346
346
|
);
|
|
347
|
-
const wavyActivePath =
|
|
347
|
+
const wavyActivePath = React14__namespace.useMemo(
|
|
348
348
|
() => isWavy ? generateWavyCircularPath(
|
|
349
349
|
center,
|
|
350
350
|
radius,
|
|
@@ -353,8 +353,8 @@ var CircularProgress = React11__namespace.forwardRef(
|
|
|
353
353
|
) : null,
|
|
354
354
|
[isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
|
|
355
355
|
);
|
|
356
|
-
const circumference =
|
|
357
|
-
const gapForTrack =
|
|
356
|
+
const circumference = React14__namespace.useMemo(() => 2 * Math.PI * radius, [radius]);
|
|
357
|
+
const gapForTrack = React14__namespace.useMemo(
|
|
358
358
|
() => (gapSize + trackHeight) / circumference,
|
|
359
359
|
[gapSize, trackHeight, circumference]
|
|
360
360
|
);
|
|
@@ -543,9 +543,9 @@ var CircularProgress = React11__namespace.forwardRef(
|
|
|
543
543
|
);
|
|
544
544
|
CircularProgress.displayName = "CircularProgress";
|
|
545
545
|
function useContainerWidth() {
|
|
546
|
-
const [width, setWidth] =
|
|
547
|
-
const observerRef =
|
|
548
|
-
const ref =
|
|
546
|
+
const [width, setWidth] = React14__namespace.useState(0);
|
|
547
|
+
const observerRef = React14__namespace.useRef(null);
|
|
548
|
+
const ref = React14__namespace.useCallback((node) => {
|
|
549
549
|
if (observerRef.current) {
|
|
550
550
|
observerRef.current.disconnect();
|
|
551
551
|
observerRef.current = null;
|
|
@@ -559,7 +559,7 @@ function useContainerWidth() {
|
|
|
559
559
|
observerRef.current = obs;
|
|
560
560
|
}
|
|
561
561
|
}, []);
|
|
562
|
-
|
|
562
|
+
React14__namespace.useEffect(() => {
|
|
563
563
|
return () => {
|
|
564
564
|
if (observerRef.current) {
|
|
565
565
|
observerRef.current.disconnect();
|
|
@@ -569,7 +569,7 @@ function useContainerWidth() {
|
|
|
569
569
|
return [ref, width];
|
|
570
570
|
}
|
|
571
571
|
function useMergedRef(...refs) {
|
|
572
|
-
return
|
|
572
|
+
return React14__namespace.useCallback(
|
|
573
573
|
(node) => {
|
|
574
574
|
for (const ref of refs) {
|
|
575
575
|
if (typeof ref === "function") {
|
|
@@ -583,7 +583,7 @@ function useMergedRef(...refs) {
|
|
|
583
583
|
[refs]
|
|
584
584
|
);
|
|
585
585
|
}
|
|
586
|
-
var FlatLinearTrack =
|
|
586
|
+
var FlatLinearTrack = React14__namespace.memo(function FlatLinearTrack2({
|
|
587
587
|
trackHeight,
|
|
588
588
|
activeColor,
|
|
589
589
|
trackColor,
|
|
@@ -659,7 +659,7 @@ var FlatLinearTrack = React11__namespace.memo(function FlatLinearTrack2({
|
|
|
659
659
|
}
|
|
660
660
|
);
|
|
661
661
|
});
|
|
662
|
-
var WavyLinearTrack =
|
|
662
|
+
var WavyLinearTrack = React14__namespace.memo(function WavyLinearTrack2({
|
|
663
663
|
trackHeight,
|
|
664
664
|
svgHeight,
|
|
665
665
|
amplitude,
|
|
@@ -678,13 +678,13 @@ var WavyLinearTrack = React11__namespace.memo(function WavyLinearTrack2({
|
|
|
678
678
|
}) {
|
|
679
679
|
const isDeterminate = typeof value === "number";
|
|
680
680
|
const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
|
|
681
|
-
const titleId =
|
|
681
|
+
const titleId = React14__namespace.useId();
|
|
682
682
|
const [containerRef, width] = useContainerWidth();
|
|
683
|
-
const activePathRef =
|
|
684
|
-
const trackPathRef =
|
|
683
|
+
const activePathRef = React14__namespace.useRef(null);
|
|
684
|
+
const trackPathRef = React14__namespace.useRef(null);
|
|
685
685
|
const amplitudeMV = react.useMotionValue(amplitude);
|
|
686
686
|
const fractionMV = react.useMotionValue(isDeterminate ? clampedValue / 100 : 1);
|
|
687
|
-
|
|
687
|
+
React14__namespace.useEffect(() => {
|
|
688
688
|
if (isDeterminate) {
|
|
689
689
|
const fraction = clampedValue / 100;
|
|
690
690
|
let targetAmp = amplitude;
|
|
@@ -855,7 +855,7 @@ var WavyLinearTrack = React11__namespace.memo(function WavyLinearTrack2({
|
|
|
855
855
|
}
|
|
856
856
|
);
|
|
857
857
|
});
|
|
858
|
-
var LinearProgress =
|
|
858
|
+
var LinearProgress = React14__namespace.forwardRef(
|
|
859
859
|
(_a, ref) => {
|
|
860
860
|
var _b = _a, {
|
|
861
861
|
value,
|
|
@@ -896,10 +896,10 @@ var LinearProgress = React11__namespace.forwardRef(
|
|
|
896
896
|
]);
|
|
897
897
|
const isDeterminate = value !== void 0;
|
|
898
898
|
const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
|
|
899
|
-
const containerRef =
|
|
899
|
+
const containerRef = React14__namespace.useRef(null);
|
|
900
900
|
const mergedRef = useMergedRef(ref, containerRef);
|
|
901
|
-
const [isRtl, setIsRtl] =
|
|
902
|
-
|
|
901
|
+
const [isRtl, setIsRtl] = React14__namespace.useState(false);
|
|
902
|
+
React14__namespace.useEffect(() => {
|
|
903
903
|
if (containerRef.current) {
|
|
904
904
|
const dir = getComputedStyle(containerRef.current).direction;
|
|
905
905
|
setIsRtl(dir === "rtl");
|
|
@@ -907,16 +907,16 @@ var LinearProgress = React11__namespace.forwardRef(
|
|
|
907
907
|
}, []);
|
|
908
908
|
const isWavy = shape === "wavy";
|
|
909
909
|
const resolvedTrackShape = trackShape != null ? trackShape : shape;
|
|
910
|
-
const effectiveAmplitude =
|
|
911
|
-
const svgHeight =
|
|
910
|
+
const effectiveAmplitude = React14__namespace.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
|
|
911
|
+
const svgHeight = React14__namespace.useMemo(
|
|
912
912
|
() => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
|
|
913
913
|
[isWavy, trackHeight, effectiveAmplitude]
|
|
914
914
|
);
|
|
915
|
-
const shouldShowStop =
|
|
915
|
+
const shouldShowStop = React14__namespace.useMemo(
|
|
916
916
|
() => isDeterminate && resolvedTrackShape === "flat" && (showStopIndicator === true || showStopIndicator === "auto" && isDeterminate),
|
|
917
917
|
[isDeterminate, resolvedTrackShape, showStopIndicator]
|
|
918
918
|
);
|
|
919
|
-
const stopSize =
|
|
919
|
+
const stopSize = React14__namespace.useMemo(
|
|
920
920
|
() => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
|
|
921
921
|
[trackHeight]
|
|
922
922
|
);
|
|
@@ -989,14 +989,14 @@ var LinearProgress = React11__namespace.forwardRef(
|
|
|
989
989
|
}
|
|
990
990
|
);
|
|
991
991
|
LinearProgress.displayName = "LinearProgress";
|
|
992
|
-
var ProgressIndicator =
|
|
992
|
+
var ProgressIndicator = React14__namespace.forwardRef((props, ref) => {
|
|
993
993
|
if (props.variant === "circular") {
|
|
994
994
|
return /* @__PURE__ */ jsxRuntime.jsx(CircularProgress, __spreadValues({ ref }, props));
|
|
995
995
|
}
|
|
996
996
|
return /* @__PURE__ */ jsxRuntime.jsx(LinearProgress, __spreadValues({ ref }, props));
|
|
997
997
|
});
|
|
998
998
|
ProgressIndicator.displayName = "ProgressIndicator";
|
|
999
|
-
var RippleItem =
|
|
999
|
+
var RippleItem = React14__namespace.memo(function RippleItem2({
|
|
1000
1000
|
ripple,
|
|
1001
1001
|
onDone
|
|
1002
1002
|
}) {
|
|
@@ -1040,8 +1040,8 @@ function Ripple({
|
|
|
1040
1040
|
}
|
|
1041
1041
|
function useRippleState(options = {}) {
|
|
1042
1042
|
const { disabled = false } = options;
|
|
1043
|
-
const [ripples, setRipples] =
|
|
1044
|
-
const onPointerDown =
|
|
1043
|
+
const [ripples, setRipples] = React14__namespace.useState([]);
|
|
1044
|
+
const onPointerDown = React14__namespace.useCallback(
|
|
1045
1045
|
(e) => {
|
|
1046
1046
|
if (disabled) return;
|
|
1047
1047
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -1055,7 +1055,7 @@ function useRippleState(options = {}) {
|
|
|
1055
1055
|
},
|
|
1056
1056
|
[disabled]
|
|
1057
1057
|
);
|
|
1058
|
-
const removeRipple =
|
|
1058
|
+
const removeRipple = React14__namespace.useCallback((id) => {
|
|
1059
1059
|
setRipples((prev) => prev.filter((r) => r.id !== id));
|
|
1060
1060
|
}, []);
|
|
1061
1061
|
return { ripples, onPointerDown, removeRipple };
|
|
@@ -1311,7 +1311,7 @@ function AnimatedIconSlot({
|
|
|
1311
1311
|
}
|
|
1312
1312
|
);
|
|
1313
1313
|
}
|
|
1314
|
-
var ButtonComponent =
|
|
1314
|
+
var ButtonComponent = React14__namespace.forwardRef(
|
|
1315
1315
|
(_a, ref) => {
|
|
1316
1316
|
var _b = _a, {
|
|
1317
1317
|
className,
|
|
@@ -1373,9 +1373,9 @@ var ButtonComponent = React11__namespace.forwardRef(
|
|
|
1373
1373
|
borderWidth: outlineWidth != null ? outlineWidth : colorStyle === "outlined" ? sizeTokens.outlineWidth : 0,
|
|
1374
1374
|
borderStyle: colorStyle === "outlined" ? "solid" : void 0
|
|
1375
1375
|
}, style);
|
|
1376
|
-
const labelText =
|
|
1376
|
+
const labelText = React14__namespace.useMemo(() => {
|
|
1377
1377
|
if (asChild) {
|
|
1378
|
-
const child =
|
|
1378
|
+
const child = React14__namespace.Children.only(children);
|
|
1379
1379
|
return child.props.children;
|
|
1380
1380
|
}
|
|
1381
1381
|
return children;
|
|
@@ -1383,8 +1383,8 @@ var ButtonComponent = React11__namespace.forwardRef(
|
|
|
1383
1383
|
const computedAriaLabel = ariaLabelProp || (typeof children === "string" ? children : void 0);
|
|
1384
1384
|
const needsTouchTarget = size === "xs" || size === "sm";
|
|
1385
1385
|
const motionRadius = react.useMotionValue(animateRadius);
|
|
1386
|
-
const asChildRef =
|
|
1387
|
-
const mergedRef =
|
|
1386
|
+
const asChildRef = React14__namespace.useRef(null);
|
|
1387
|
+
const mergedRef = React14__namespace.useCallback(
|
|
1388
1388
|
(node) => {
|
|
1389
1389
|
asChildRef.current = node;
|
|
1390
1390
|
if (typeof ref === "function") ref(node);
|
|
@@ -1393,14 +1393,14 @@ var ButtonComponent = React11__namespace.forwardRef(
|
|
|
1393
1393
|
},
|
|
1394
1394
|
[ref]
|
|
1395
1395
|
);
|
|
1396
|
-
|
|
1396
|
+
React14__namespace.useEffect(() => {
|
|
1397
1397
|
if (!asChild) return;
|
|
1398
1398
|
return motionRadius.on("change", (v) => {
|
|
1399
1399
|
if (asChildRef.current)
|
|
1400
1400
|
asChildRef.current.style.borderRadius = `${v}px`;
|
|
1401
1401
|
});
|
|
1402
1402
|
}, [motionRadius, asChild]);
|
|
1403
|
-
|
|
1403
|
+
React14__namespace.useEffect(() => {
|
|
1404
1404
|
if (!asChild) return;
|
|
1405
1405
|
const controls = springAnimate(motionRadius, animateRadius);
|
|
1406
1406
|
return () => controls.stop();
|
|
@@ -1408,14 +1408,14 @@ var ButtonComponent = React11__namespace.forwardRef(
|
|
|
1408
1408
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
1409
1409
|
disabled: loading
|
|
1410
1410
|
});
|
|
1411
|
-
const handleClick =
|
|
1411
|
+
const handleClick = React14__namespace.useCallback(
|
|
1412
1412
|
(e) => {
|
|
1413
1413
|
if (loading) return e.preventDefault();
|
|
1414
1414
|
onClick == null ? void 0 : onClick(e);
|
|
1415
1415
|
},
|
|
1416
1416
|
[loading, onClick]
|
|
1417
1417
|
);
|
|
1418
|
-
const handleKeyDown =
|
|
1418
|
+
const handleKeyDown = React14__namespace.useCallback(
|
|
1419
1419
|
(e) => {
|
|
1420
1420
|
if (loading) return;
|
|
1421
1421
|
if (onClick && (e.key === "Enter" || e.key === " ")) {
|
|
@@ -1490,17 +1490,17 @@ var ButtonComponent = React11__namespace.forwardRef(
|
|
|
1490
1490
|
}
|
|
1491
1491
|
) })
|
|
1492
1492
|
] });
|
|
1493
|
-
const handleAsChildPointerDown =
|
|
1493
|
+
const handleAsChildPointerDown = React14__namespace.useCallback(
|
|
1494
1494
|
(e) => {
|
|
1495
1495
|
springAnimate(motionRadius, pressedRadius);
|
|
1496
1496
|
onPointerDown == null ? void 0 : onPointerDown(e);
|
|
1497
1497
|
},
|
|
1498
1498
|
[motionRadius, pressedRadius, onPointerDown]
|
|
1499
1499
|
);
|
|
1500
|
-
const handleAsChildPointerUp =
|
|
1500
|
+
const handleAsChildPointerUp = React14__namespace.useCallback(() => {
|
|
1501
1501
|
springAnimate(motionRadius, animateRadius);
|
|
1502
1502
|
}, [motionRadius, animateRadius]);
|
|
1503
|
-
const handlePointerDown =
|
|
1503
|
+
const handlePointerDown = React14__namespace.useCallback(
|
|
1504
1504
|
(e) => {
|
|
1505
1505
|
onPointerDown(e);
|
|
1506
1506
|
},
|
|
@@ -1510,7 +1510,7 @@ var ButtonComponent = React11__namespace.forwardRef(
|
|
|
1510
1510
|
const strippedProps = __spreadValues({}, restProps);
|
|
1511
1511
|
for (const key of MOTION_PROP_KEYS) delete strippedProps[key];
|
|
1512
1512
|
const htmlProps = strippedProps;
|
|
1513
|
-
const child =
|
|
1513
|
+
const child = React14__namespace.Children.only(children);
|
|
1514
1514
|
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1515
1515
|
reactSlot.Slot,
|
|
1516
1516
|
__spreadProps(__spreadValues({
|
|
@@ -1527,7 +1527,7 @@ var ButtonComponent = React11__namespace.forwardRef(
|
|
|
1527
1527
|
}),
|
|
1528
1528
|
className: buttonClassName
|
|
1529
1529
|
}, htmlProps), {
|
|
1530
|
-
children:
|
|
1530
|
+
children: React14__namespace.cloneElement(child, { children: innerContent })
|
|
1531
1531
|
})
|
|
1532
1532
|
) });
|
|
1533
1533
|
}
|
|
@@ -1556,13 +1556,13 @@ var ButtonComponent = React11__namespace.forwardRef(
|
|
|
1556
1556
|
}
|
|
1557
1557
|
);
|
|
1558
1558
|
ButtonComponent.displayName = "Button";
|
|
1559
|
-
var Button =
|
|
1559
|
+
var Button = React14__namespace.memo(ButtonComponent);
|
|
1560
1560
|
var VARIANT_FONT = {
|
|
1561
1561
|
outlined: "'Material Symbols Outlined'",
|
|
1562
1562
|
rounded: "'Material Symbols Rounded'",
|
|
1563
1563
|
sharp: "'Material Symbols Sharp'"
|
|
1564
1564
|
};
|
|
1565
|
-
var IconComponent =
|
|
1565
|
+
var IconComponent = React14__namespace.forwardRef(
|
|
1566
1566
|
(_a, ref) => {
|
|
1567
1567
|
var _b = _a, {
|
|
1568
1568
|
name,
|
|
@@ -1628,7 +1628,7 @@ var IconComponent = React11__namespace.forwardRef(
|
|
|
1628
1628
|
}
|
|
1629
1629
|
);
|
|
1630
1630
|
IconComponent.displayName = "Icon";
|
|
1631
|
-
var Icon =
|
|
1631
|
+
var Icon = React14__namespace.memo(IconComponent);
|
|
1632
1632
|
var BUTTON_GROUP_TOKENS = {
|
|
1633
1633
|
standard: {
|
|
1634
1634
|
betweenSpace: 12,
|
|
@@ -1736,13 +1736,7 @@ var WIDTH_MORPH_SPRING = {
|
|
|
1736
1736
|
damping: 38,
|
|
1737
1737
|
mass: 0.85
|
|
1738
1738
|
};
|
|
1739
|
-
var
|
|
1740
|
-
type: "spring",
|
|
1741
|
-
stiffness: 430,
|
|
1742
|
-
damping: 38,
|
|
1743
|
-
mass: 0.8
|
|
1744
|
-
};
|
|
1745
|
-
var AnimatedCheckLabel = React11__namespace.memo(function AnimatedCheckLabel2({
|
|
1739
|
+
var AnimatedCheckLabel = React14__namespace.memo(function AnimatedCheckLabel2({
|
|
1746
1740
|
selected,
|
|
1747
1741
|
size,
|
|
1748
1742
|
children
|
|
@@ -1779,23 +1773,6 @@ var AnimatedCheckLabel = React11__namespace.memo(function AnimatedCheckLabel2({
|
|
|
1779
1773
|
}
|
|
1780
1774
|
);
|
|
1781
1775
|
});
|
|
1782
|
-
var AnimatedNavbarLabel = React11__namespace.memo(function AnimatedNavbarLabel2({
|
|
1783
|
-
show,
|
|
1784
|
-
children
|
|
1785
|
-
}) {
|
|
1786
|
-
return /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, mode: "popLayout", children: show && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1787
|
-
react.m.span,
|
|
1788
|
-
{
|
|
1789
|
-
initial: { width: 0, opacity: 0, scale: 0.8 },
|
|
1790
|
-
animate: { width: "auto", opacity: 1, scale: 1 },
|
|
1791
|
-
exit: { width: 0, opacity: 0, scale: 0.8 },
|
|
1792
|
-
transition: NAVBAR_EXPRESSIVE_SPRING,
|
|
1793
|
-
className: "overflow-hidden whitespace-nowrap text-sm font-semibold tracking-[0.01em] ml-1.5",
|
|
1794
|
-
children
|
|
1795
|
-
},
|
|
1796
|
-
"navbar-label"
|
|
1797
|
-
) });
|
|
1798
|
-
});
|
|
1799
1776
|
function resolveConnectedShapes(variant, orientation, isFirst, isLast, itemSize) {
|
|
1800
1777
|
const defaults = ButtonGroupDefaults.connectedLeadingButtonShapes(itemSize);
|
|
1801
1778
|
if (variant !== "connected") return defaults;
|
|
@@ -1816,7 +1793,7 @@ function resolveConnectedShapes(variant, orientation, isFirst, isLast, itemSize)
|
|
|
1816
1793
|
}
|
|
1817
1794
|
return defaults;
|
|
1818
1795
|
}
|
|
1819
|
-
function resolveIconAndLabel(element, isSelected, itemSize,
|
|
1796
|
+
function resolveIconAndLabel(element, isSelected, itemSize, showCheck, iconBehavior, labelBehavior) {
|
|
1820
1797
|
let icon = element.props.icon;
|
|
1821
1798
|
let label = element.props.children;
|
|
1822
1799
|
const animateCheckInLabel = showCheck && iconBehavior !== "none" && iconBehavior !== "selected" && label !== void 0;
|
|
@@ -1832,9 +1809,6 @@ function resolveIconAndLabel(element, isSelected, itemSize, variant, showCheck,
|
|
|
1832
1809
|
}
|
|
1833
1810
|
if (animateCheckInLabel && label !== void 0) {
|
|
1834
1811
|
label = /* @__PURE__ */ jsxRuntime.jsx(AnimatedCheckLabel, { selected: isSelected, size: itemSize, children: label });
|
|
1835
|
-
} else if (variant === "navbar" && label !== void 0) {
|
|
1836
|
-
const showLabel = !labelBehavior || labelBehavior === "all" || labelBehavior === "selected" && isSelected;
|
|
1837
|
-
label = /* @__PURE__ */ jsxRuntime.jsx(AnimatedNavbarLabel, { show: showLabel, children: label });
|
|
1838
1812
|
}
|
|
1839
1813
|
return { icon, label };
|
|
1840
1814
|
}
|
|
@@ -1869,13 +1843,11 @@ function resolveFlexTargets(variant, orientation, isSelected, isPressed, hasSele
|
|
|
1869
1843
|
function buildMotionProps(variant, isSelected, isPressed, itemSize, shapes, flex, existingAnimate, existingWhileTap) {
|
|
1870
1844
|
var _a, _b;
|
|
1871
1845
|
const props = { animate: __spreadValues({}, existingAnimate) };
|
|
1872
|
-
if (
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
props.animate.paddingInline = flex.paddingInline;
|
|
1878
|
-
}
|
|
1846
|
+
if (flex.flexGrow !== void 0) {
|
|
1847
|
+
props.animate.flexGrow = flex.flexGrow;
|
|
1848
|
+
}
|
|
1849
|
+
if (flex.paddingInline !== void 0) {
|
|
1850
|
+
props.animate.paddingInline = flex.paddingInline;
|
|
1879
1851
|
}
|
|
1880
1852
|
if (variant === "standard") {
|
|
1881
1853
|
const pressedRadius = (_a = PRESSED_RADIUS_MAP[itemSize]) != null ? _a : PRESSED_RADIUS_MAP.sm;
|
|
@@ -1926,16 +1898,9 @@ function buildMotionProps(variant, isSelected, isPressed, itemSize, shapes, flex
|
|
|
1926
1898
|
});
|
|
1927
1899
|
props.layout = true;
|
|
1928
1900
|
}
|
|
1929
|
-
if (variant === "navbar") {
|
|
1930
|
-
props.layout = true;
|
|
1931
|
-
props.transition = {
|
|
1932
|
-
layout: WIDTH_MORPH_SPRING,
|
|
1933
|
-
default: BUTTON_SHAPE_MORPH_SPRING
|
|
1934
|
-
};
|
|
1935
|
-
}
|
|
1936
1901
|
return props;
|
|
1937
1902
|
}
|
|
1938
|
-
var ButtonGroupComponent =
|
|
1903
|
+
var ButtonGroupComponent = React14__namespace.forwardRef(
|
|
1939
1904
|
(_a, ref) => {
|
|
1940
1905
|
var _b = _a, {
|
|
1941
1906
|
className,
|
|
@@ -1968,13 +1933,12 @@ var ButtonGroupComponent = React11__namespace.forwardRef(
|
|
|
1968
1933
|
"labelBehavior",
|
|
1969
1934
|
"style"
|
|
1970
1935
|
]);
|
|
1971
|
-
const [pressedIndex, setPressedIndex] =
|
|
1972
|
-
const [lockedGroupSize, setLockedGroupSize] =
|
|
1936
|
+
const [pressedIndex, setPressedIndex] = React14__namespace.useState(null);
|
|
1937
|
+
const [lockedGroupSize, setLockedGroupSize] = React14__namespace.useState(
|
|
1973
1938
|
null
|
|
1974
1939
|
);
|
|
1975
|
-
const
|
|
1976
|
-
const
|
|
1977
|
-
const setRootRef = React11__namespace.useCallback(
|
|
1940
|
+
const rootRef = React14__namespace.useRef(null);
|
|
1941
|
+
const setRootRef = React14__namespace.useCallback(
|
|
1978
1942
|
(node) => {
|
|
1979
1943
|
rootRef.current = node;
|
|
1980
1944
|
if (typeof ref === "function") {
|
|
@@ -1985,12 +1949,12 @@ var ButtonGroupComponent = React11__namespace.forwardRef(
|
|
|
1985
1949
|
},
|
|
1986
1950
|
[ref]
|
|
1987
1951
|
);
|
|
1988
|
-
const childrenArray =
|
|
1989
|
-
() =>
|
|
1952
|
+
const childrenArray = React14__namespace.useMemo(
|
|
1953
|
+
() => React14__namespace.Children.toArray(children).filter(React14__namespace.isValidElement),
|
|
1990
1954
|
[children]
|
|
1991
1955
|
);
|
|
1992
1956
|
const count = childrenArray.length;
|
|
1993
|
-
const groupSizeSignature =
|
|
1957
|
+
const groupSizeSignature = React14__namespace.useMemo(
|
|
1994
1958
|
() => `${childrenArray.map((child, index) => {
|
|
1995
1959
|
var _a2, _b2, _c, _d, _e;
|
|
1996
1960
|
const element = child;
|
|
@@ -2005,8 +1969,8 @@ var ButtonGroupComponent = React11__namespace.forwardRef(
|
|
|
2005
1969
|
}).join("|")}|${variant}|${orientation}|${showCheck}`,
|
|
2006
1970
|
[childrenArray, orientation, showCheck, size, variant]
|
|
2007
1971
|
);
|
|
2008
|
-
const groupSizeSignatureRef =
|
|
2009
|
-
|
|
1972
|
+
const groupSizeSignatureRef = React14__namespace.useRef(groupSizeSignature);
|
|
1973
|
+
React14__namespace.useLayoutEffect(() => {
|
|
2010
1974
|
if (groupSizeSignatureRef.current !== groupSizeSignature) {
|
|
2011
1975
|
groupSizeSignatureRef.current = groupSizeSignature;
|
|
2012
1976
|
setLockedGroupSize(null);
|
|
@@ -2014,7 +1978,7 @@ var ButtonGroupComponent = React11__namespace.forwardRef(
|
|
|
2014
1978
|
}, [groupSizeSignature]);
|
|
2015
1979
|
const hasExplicitGroupSize = orientation === "horizontal" ? (style == null ? void 0 : style.width) !== void 0 || (style == null ? void 0 : style.inlineSize) !== void 0 : (style == null ? void 0 : style.height) !== void 0 || (style == null ? void 0 : style.blockSize) !== void 0;
|
|
2016
1980
|
const shouldLockGroupSize = activeMorphing && !fullWidth && !hasExplicitGroupSize && count > 1;
|
|
2017
|
-
|
|
1981
|
+
React14__namespace.useLayoutEffect(() => {
|
|
2018
1982
|
if (!shouldLockGroupSize) {
|
|
2019
1983
|
if (lockedGroupSize !== null) setLockedGroupSize(null);
|
|
2020
1984
|
return;
|
|
@@ -2028,7 +1992,7 @@ var ButtonGroupComponent = React11__namespace.forwardRef(
|
|
|
2028
1992
|
setLockedGroupSize(Math.ceil(nextSize * 100) / 100);
|
|
2029
1993
|
}
|
|
2030
1994
|
}, [lockedGroupSize, orientation, shouldLockGroupSize]);
|
|
2031
|
-
const groupStyle =
|
|
1995
|
+
const groupStyle = React14__namespace.useMemo(() => {
|
|
2032
1996
|
const nextStyle = __spreadValues({}, style);
|
|
2033
1997
|
if (shouldLockGroupSize && lockedGroupSize !== null) {
|
|
2034
1998
|
if (orientation === "horizontal") {
|
|
@@ -2039,13 +2003,13 @@ var ButtonGroupComponent = React11__namespace.forwardRef(
|
|
|
2039
2003
|
}
|
|
2040
2004
|
return nextStyle;
|
|
2041
2005
|
}, [lockedGroupSize, orientation, shouldLockGroupSize, style]);
|
|
2042
|
-
const hasSelected =
|
|
2006
|
+
const hasSelected = React14__namespace.useMemo(
|
|
2043
2007
|
() => childrenArray.some(
|
|
2044
2008
|
(child) => child.props.selected
|
|
2045
2009
|
),
|
|
2046
2010
|
[childrenArray]
|
|
2047
2011
|
);
|
|
2048
|
-
const handlePointerLeaveAndUp =
|
|
2012
|
+
const handlePointerLeaveAndUp = React14__namespace.useCallback(() => {
|
|
2049
2013
|
setPressedIndex(null);
|
|
2050
2014
|
}, []);
|
|
2051
2015
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2055,7 +2019,7 @@ var ButtonGroupComponent = React11__namespace.forwardRef(
|
|
|
2055
2019
|
className: cn(
|
|
2056
2020
|
"inline-flex p-0 m-0 border-none max-w-full [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
2057
2021
|
orientation === "vertical" ? "flex-col items-stretch overflow-y-auto overflow-x-hidden" : "flex-row overflow-x-auto overflow-y-hidden",
|
|
2058
|
-
variant === "standard" ? "gap-3" :
|
|
2022
|
+
variant === "standard" ? "gap-3" : "gap-0.5",
|
|
2059
2023
|
fullWidth && "w-full",
|
|
2060
2024
|
fullWidth && orientation === "vertical" && "h-full",
|
|
2061
2025
|
className
|
|
@@ -2065,7 +2029,7 @@ var ButtonGroupComponent = React11__namespace.forwardRef(
|
|
|
2065
2029
|
onPointerUp: handlePointerLeaveAndUp
|
|
2066
2030
|
}, props), {
|
|
2067
2031
|
children: childrenArray.map((child, index) => {
|
|
2068
|
-
var _a2, _b2
|
|
2032
|
+
var _a2, _b2;
|
|
2069
2033
|
const element = child;
|
|
2070
2034
|
const isSelected = element.props.selected === true;
|
|
2071
2035
|
const isFirst = index === 0;
|
|
@@ -2077,7 +2041,6 @@ var ButtonGroupComponent = React11__namespace.forwardRef(
|
|
|
2077
2041
|
element,
|
|
2078
2042
|
isSelected,
|
|
2079
2043
|
itemSize,
|
|
2080
|
-
variant,
|
|
2081
2044
|
showCheck,
|
|
2082
2045
|
iconBehavior,
|
|
2083
2046
|
labelBehavior
|
|
@@ -2103,7 +2066,7 @@ var ButtonGroupComponent = React11__namespace.forwardRef(
|
|
|
2103
2066
|
basePx
|
|
2104
2067
|
);
|
|
2105
2068
|
const dynamicStyle = __spreadValues({}, element.props.style);
|
|
2106
|
-
if (
|
|
2069
|
+
if (flex.flexGrow !== void 0 && fullWidth) {
|
|
2107
2070
|
dynamicStyle.flexBasis = 0;
|
|
2108
2071
|
dynamicStyle.flexShrink = 1;
|
|
2109
2072
|
dynamicStyle.minWidth = 0;
|
|
@@ -2121,13 +2084,7 @@ var ButtonGroupComponent = React11__namespace.forwardRef(
|
|
|
2121
2084
|
existingWhileTap
|
|
2122
2085
|
);
|
|
2123
2086
|
const connectedClasses = variant === "connected" && isSelected ? "z-20" : "";
|
|
2124
|
-
const
|
|
2125
|
-
flexBasis: fullWidth && labelBehavior !== "selected" ? 0 : "auto",
|
|
2126
|
-
flexShrink: fullWidth ? 1 : 0,
|
|
2127
|
-
flexGrow: flex.flexGrow,
|
|
2128
|
-
minWidth: labelBehavior !== "selected" ? 0 : "fit-content"
|
|
2129
|
-
} : {};
|
|
2130
|
-
const clonedElement = React11__namespace.cloneElement(element, __spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues({
|
|
2087
|
+
const clonedElement = React14__namespace.cloneElement(element, __spreadValues(__spreadProps(__spreadValues({
|
|
2131
2088
|
key: (_b2 = element.key) != null ? _b2 : index,
|
|
2132
2089
|
tabIndex: isFirst ? 0 : -1,
|
|
2133
2090
|
size: size || element.props.size,
|
|
@@ -2136,71 +2093,20 @@ var ButtonGroupComponent = React11__namespace.forwardRef(
|
|
|
2136
2093
|
}, variant === "connected" && {
|
|
2137
2094
|
colorStyle: element.props.colorStyle || "tonal",
|
|
2138
2095
|
selectedColorStyle: element.props.selectedColorStyle || "filled"
|
|
2139
|
-
}),
|
|
2140
|
-
colorStyle: "text",
|
|
2141
|
-
selectedColorStyle: "text",
|
|
2142
|
-
className: cn(
|
|
2143
|
-
element.props.className,
|
|
2144
|
-
"w-full! h-full! px-3! min-w-0! relative z-20 flex items-center justify-center",
|
|
2145
|
-
isSelected ? "text-m3-on-secondary-container! hover:bg-transparent! active:bg-transparent!" : "text-m3-on-surface-variant! hover:bg-transparent! active:bg-transparent!",
|
|
2146
|
-
itemClassName
|
|
2147
|
-
)
|
|
2148
|
-
}), variant !== "navbar" && {
|
|
2096
|
+
}), {
|
|
2149
2097
|
className: cn(
|
|
2150
2098
|
element.props.className,
|
|
2151
2099
|
connectedClasses,
|
|
2152
2100
|
"focus-visible:z-10 hover:z-10 relative min-w-0",
|
|
2153
2101
|
orientation === "vertical" && "w-full",
|
|
2154
2102
|
itemClassName
|
|
2155
|
-
)
|
|
2156
|
-
|
|
2157
|
-
style: variant === "navbar" ? __spreadProps(__spreadValues({}, dynamicStyle), { minWidth: 0 }) : dynamicStyle,
|
|
2103
|
+
),
|
|
2104
|
+
style: dynamicStyle,
|
|
2158
2105
|
onPointerDown: (e) => {
|
|
2159
2106
|
setPressedIndex(index);
|
|
2160
2107
|
if (element.props.onPointerDown) element.props.onPointerDown(e);
|
|
2161
2108
|
}
|
|
2162
2109
|
}), motionProps));
|
|
2163
|
-
if (variant === "navbar") {
|
|
2164
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2165
|
-
react.m.div,
|
|
2166
|
-
{
|
|
2167
|
-
layout: true,
|
|
2168
|
-
whileTap: { scale: 0.96 },
|
|
2169
|
-
transition: NAVBAR_EXPRESSIVE_SPRING,
|
|
2170
|
-
className: "group relative h-full flex items-center justify-center min-w-0",
|
|
2171
|
-
style: navbarFlexStyle,
|
|
2172
|
-
children: [
|
|
2173
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2174
|
-
"div",
|
|
2175
|
-
{
|
|
2176
|
-
className: "absolute inset-x-1 inset-y-0 m-auto flex items-center justify-center pointer-events-none",
|
|
2177
|
-
style: { zIndex: 1 },
|
|
2178
|
-
children: [
|
|
2179
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2180
|
-
"div",
|
|
2181
|
-
{
|
|
2182
|
-
className: "w-full h-[40px] bg-m3-on-surface-variant/8 opacity-0 group-hover:opacity-100 transition-opacity duration-200",
|
|
2183
|
-
style: { borderRadius: PILL_BORDER_RADIUS }
|
|
2184
|
-
}
|
|
2185
|
-
),
|
|
2186
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: isSelected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2187
|
-
react.m.div,
|
|
2188
|
-
{
|
|
2189
|
-
layoutId: `navbar-active-indicator-${layoutIdGroup}`,
|
|
2190
|
-
className: "absolute inset-0 m-auto w-full h-[40px] bg-m3-secondary-container",
|
|
2191
|
-
style: { borderRadius: PILL_BORDER_RADIUS },
|
|
2192
|
-
transition: NAVBAR_EXPRESSIVE_SPRING
|
|
2193
|
-
}
|
|
2194
|
-
) })
|
|
2195
|
-
]
|
|
2196
|
-
}
|
|
2197
|
-
),
|
|
2198
|
-
clonedElement
|
|
2199
|
-
]
|
|
2200
|
-
},
|
|
2201
|
-
(_c = element.key) != null ? _c : index
|
|
2202
|
-
);
|
|
2203
|
-
}
|
|
2204
2110
|
return clonedElement;
|
|
2205
2111
|
})
|
|
2206
2112
|
})
|
|
@@ -2208,7 +2114,7 @@ var ButtonGroupComponent = React11__namespace.forwardRef(
|
|
|
2208
2114
|
}
|
|
2209
2115
|
);
|
|
2210
2116
|
ButtonGroupComponent.displayName = "ButtonGroup";
|
|
2211
|
-
var ButtonGroup =
|
|
2117
|
+
var ButtonGroup = React14__namespace.memo(ButtonGroupComponent);
|
|
2212
2118
|
var SIZE_HEIGHT = {
|
|
2213
2119
|
sm: "h-14",
|
|
2214
2120
|
md: "h-20",
|
|
@@ -2263,9 +2169,9 @@ var COLOR_CLASSES = {
|
|
|
2263
2169
|
}
|
|
2264
2170
|
};
|
|
2265
2171
|
function useScrollCollapse(enabled, scrollThreshold, onCollapsedChange) {
|
|
2266
|
-
const [collapsed, setCollapsed] =
|
|
2267
|
-
const lastScrollY =
|
|
2268
|
-
|
|
2172
|
+
const [collapsed, setCollapsed] = React14__namespace.useState(false);
|
|
2173
|
+
const lastScrollY = React14__namespace.useRef(0);
|
|
2174
|
+
React14__namespace.useEffect(() => {
|
|
2269
2175
|
if (!enabled || typeof window === "undefined") return;
|
|
2270
2176
|
lastScrollY.current = window.scrollY;
|
|
2271
2177
|
const handleScroll = () => {
|
|
@@ -2288,7 +2194,7 @@ function useScrollCollapse(enabled, scrollThreshold, onCollapsedChange) {
|
|
|
2288
2194
|
}, [enabled, scrollThreshold, collapsed, onCollapsedChange]);
|
|
2289
2195
|
return collapsed;
|
|
2290
2196
|
}
|
|
2291
|
-
var ExtendedFABComponent =
|
|
2197
|
+
var ExtendedFABComponent = React14__namespace.forwardRef(
|
|
2292
2198
|
(_a, ref) => {
|
|
2293
2199
|
var _b = _a, {
|
|
2294
2200
|
className,
|
|
@@ -2305,6 +2211,8 @@ var ExtendedFABComponent = React11__namespace.forwardRef(
|
|
|
2305
2211
|
scrollThreshold = 50,
|
|
2306
2212
|
collapsed,
|
|
2307
2213
|
onCollapsedChange,
|
|
2214
|
+
asChild = false,
|
|
2215
|
+
children,
|
|
2308
2216
|
onClick,
|
|
2309
2217
|
onKeyDown,
|
|
2310
2218
|
layoutId,
|
|
@@ -2324,16 +2232,18 @@ var ExtendedFABComponent = React11__namespace.forwardRef(
|
|
|
2324
2232
|
"scrollThreshold",
|
|
2325
2233
|
"collapsed",
|
|
2326
2234
|
"onCollapsedChange",
|
|
2235
|
+
"asChild",
|
|
2236
|
+
"children",
|
|
2327
2237
|
"onClick",
|
|
2328
2238
|
"onKeyDown",
|
|
2329
2239
|
"layoutId",
|
|
2330
2240
|
"aria-label"
|
|
2331
2241
|
]);
|
|
2332
2242
|
var _a2, _b2, _c, _d;
|
|
2333
|
-
const localRef =
|
|
2334
|
-
|
|
2335
|
-
const [dir, setDir] =
|
|
2336
|
-
|
|
2243
|
+
const localRef = React14__namespace.useRef(null);
|
|
2244
|
+
React14__namespace.useImperativeHandle(ref, () => localRef.current);
|
|
2245
|
+
const [dir, setDir] = React14__namespace.useState("ltr");
|
|
2246
|
+
React14__namespace.useEffect(() => {
|
|
2337
2247
|
var _a3;
|
|
2338
2248
|
if (!localRef.current) return;
|
|
2339
2249
|
const closestDir = (_a3 = localRef.current.closest("[dir]")) == null ? void 0 : _a3.getAttribute("dir");
|
|
@@ -2354,7 +2264,7 @@ var ExtendedFABComponent = React11__namespace.forwardRef(
|
|
|
2354
2264
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
2355
2265
|
disabled: loading
|
|
2356
2266
|
});
|
|
2357
|
-
const handleClick =
|
|
2267
|
+
const handleClick = React14__namespace.useCallback(
|
|
2358
2268
|
(e) => {
|
|
2359
2269
|
if (loading) {
|
|
2360
2270
|
e.preventDefault();
|
|
@@ -2364,7 +2274,7 @@ var ExtendedFABComponent = React11__namespace.forwardRef(
|
|
|
2364
2274
|
},
|
|
2365
2275
|
[loading, onClick]
|
|
2366
2276
|
);
|
|
2367
|
-
const handleKeyDown =
|
|
2277
|
+
const handleKeyDown = React14__namespace.useCallback(
|
|
2368
2278
|
(e) => {
|
|
2369
2279
|
if (loading) return;
|
|
2370
2280
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -2375,7 +2285,109 @@ var ExtendedFABComponent = React11__namespace.forwardRef(
|
|
|
2375
2285
|
},
|
|
2376
2286
|
[loading, onClick, onKeyDown]
|
|
2377
2287
|
);
|
|
2378
|
-
|
|
2288
|
+
const containerClassName = cn(
|
|
2289
|
+
"relative shrink-0 inline-flex items-center select-none cursor-pointer overflow-hidden",
|
|
2290
|
+
"transition-[box-shadow,filter] duration-200",
|
|
2291
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
|
|
2292
|
+
"disabled:pointer-events-none disabled:opacity-[0.38] disabled:shadow-none",
|
|
2293
|
+
colors.bg,
|
|
2294
|
+
colors.text,
|
|
2295
|
+
lowered ? "shadow-sm" : "shadow-md",
|
|
2296
|
+
(_d = SIZE_HEIGHT[size]) != null ? _d : "h-14",
|
|
2297
|
+
SIZE_TEXT[size],
|
|
2298
|
+
isCollapsed ? cn("px-0 justify-center", SIZE_WIDTH_COLLAPSED[size]) : cn(
|
|
2299
|
+
hasIcon ? "justify-start" : "justify-center",
|
|
2300
|
+
SIZE_PADDING[size],
|
|
2301
|
+
hasIcon && SIZE_GAP[size]
|
|
2302
|
+
),
|
|
2303
|
+
dir === "rtl" || restProps.dir === "rtl" ? "flex-row-reverse" : "flex-row",
|
|
2304
|
+
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
2305
|
+
className
|
|
2306
|
+
);
|
|
2307
|
+
const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2308
|
+
/* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
2309
|
+
hasIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2310
|
+
react.m.span,
|
|
2311
|
+
{
|
|
2312
|
+
layout: "position",
|
|
2313
|
+
className: cn(
|
|
2314
|
+
"flex items-center justify-center shrink-0",
|
|
2315
|
+
sizeIcon.cls
|
|
2316
|
+
),
|
|
2317
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2318
|
+
react.m.span,
|
|
2319
|
+
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
2320
|
+
transition: SPRING_TRANSITION,
|
|
2321
|
+
className: "flex items-center justify-center shrink-0 w-full h-full",
|
|
2322
|
+
children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2323
|
+
LoadingIndicator,
|
|
2324
|
+
{
|
|
2325
|
+
size: sizeIcon.px,
|
|
2326
|
+
color: "currentColor",
|
|
2327
|
+
"aria-label": "Loading"
|
|
2328
|
+
}
|
|
2329
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2330
|
+
ProgressIndicator,
|
|
2331
|
+
{
|
|
2332
|
+
variant: "circular",
|
|
2333
|
+
size: sizeIcon.px,
|
|
2334
|
+
color: "currentColor",
|
|
2335
|
+
trackColor: "transparent",
|
|
2336
|
+
"aria-label": "Loading"
|
|
2337
|
+
}
|
|
2338
|
+
)
|
|
2339
|
+
}),
|
|
2340
|
+
"loading"
|
|
2341
|
+
) : icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2342
|
+
react.m.span,
|
|
2343
|
+
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
2344
|
+
transition: SPRING_TRANSITION,
|
|
2345
|
+
"aria-hidden": "true",
|
|
2346
|
+
className: "flex items-center justify-center shrink-0 w-full h-full [&>svg]:w-full [&>svg]:h-full",
|
|
2347
|
+
children: icon
|
|
2348
|
+
}),
|
|
2349
|
+
"icon"
|
|
2350
|
+
) })
|
|
2351
|
+
}
|
|
2352
|
+
),
|
|
2353
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: !isCollapsed && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2354
|
+
react.m.span,
|
|
2355
|
+
{
|
|
2356
|
+
layout: "position",
|
|
2357
|
+
initial: { opacity: 0, width: 0 },
|
|
2358
|
+
animate: { opacity: 1, width: "auto" },
|
|
2359
|
+
exit: { opacity: 0, width: 0 },
|
|
2360
|
+
transition: {
|
|
2361
|
+
opacity: { duration: 0.15, ease: "linear" },
|
|
2362
|
+
width: SPRING_TRANSITION
|
|
2363
|
+
},
|
|
2364
|
+
className: "overflow-hidden whitespace-nowrap",
|
|
2365
|
+
children: label
|
|
2366
|
+
},
|
|
2367
|
+
"label"
|
|
2368
|
+
) })
|
|
2369
|
+
] });
|
|
2370
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: visible && !(isCollapsed && !hasIcon) && (asChild ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2371
|
+
reactSlot.Slot,
|
|
2372
|
+
__spreadProps(__spreadValues({
|
|
2373
|
+
ref: localRef,
|
|
2374
|
+
"aria-label": ariaLabel || label,
|
|
2375
|
+
"aria-busy": loading || void 0,
|
|
2376
|
+
"aria-disabled": loading || restProps.disabled,
|
|
2377
|
+
onClick: handleClick,
|
|
2378
|
+
onPointerDown,
|
|
2379
|
+
onKeyDown: handleKeyDown,
|
|
2380
|
+
style: __spreadProps(__spreadValues({}, style), {
|
|
2381
|
+
borderRadius: `${radiusConfig.default}px`
|
|
2382
|
+
}),
|
|
2383
|
+
className: containerClassName
|
|
2384
|
+
}, restProps), {
|
|
2385
|
+
children: React14__namespace.cloneElement(
|
|
2386
|
+
React14__namespace.Children.only(children),
|
|
2387
|
+
{ children: innerContent }
|
|
2388
|
+
)
|
|
2389
|
+
})
|
|
2390
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2379
2391
|
react.m.button,
|
|
2380
2392
|
__spreadProps(__spreadValues({
|
|
2381
2393
|
ref: localRef,
|
|
@@ -2407,95 +2419,15 @@ var ExtendedFABComponent = React11__namespace.forwardRef(
|
|
|
2407
2419
|
opacity: { duration: 0.2, ease: "linear" },
|
|
2408
2420
|
layout: SPRING_TRANSITION
|
|
2409
2421
|
},
|
|
2410
|
-
className:
|
|
2411
|
-
"relative shrink-0 inline-flex items-center select-none cursor-pointer overflow-hidden",
|
|
2412
|
-
"transition-[box-shadow,filter] duration-200",
|
|
2413
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
|
|
2414
|
-
"disabled:pointer-events-none disabled:opacity-[0.38] disabled:shadow-none",
|
|
2415
|
-
colors.bg,
|
|
2416
|
-
colors.text,
|
|
2417
|
-
lowered ? "shadow-sm" : "shadow-md",
|
|
2418
|
-
(_d = SIZE_HEIGHT[size]) != null ? _d : "h-14",
|
|
2419
|
-
SIZE_TEXT[size],
|
|
2420
|
-
isCollapsed ? cn("px-0 justify-center", SIZE_WIDTH_COLLAPSED[size]) : cn(
|
|
2421
|
-
hasIcon ? "justify-start" : "justify-center",
|
|
2422
|
-
SIZE_PADDING[size],
|
|
2423
|
-
hasIcon && SIZE_GAP[size]
|
|
2424
|
-
),
|
|
2425
|
-
dir === "rtl" || restProps.dir === "rtl" ? "flex-row-reverse" : "flex-row",
|
|
2426
|
-
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
2427
|
-
className
|
|
2428
|
-
)
|
|
2422
|
+
className: containerClassName
|
|
2429
2423
|
}, restProps), {
|
|
2430
|
-
children:
|
|
2431
|
-
/* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
2432
|
-
hasIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2433
|
-
react.m.span,
|
|
2434
|
-
{
|
|
2435
|
-
layout: "position",
|
|
2436
|
-
className: cn(
|
|
2437
|
-
"flex items-center justify-center shrink-0",
|
|
2438
|
-
sizeIcon.cls
|
|
2439
|
-
),
|
|
2440
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2441
|
-
react.m.span,
|
|
2442
|
-
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
2443
|
-
transition: SPRING_TRANSITION,
|
|
2444
|
-
className: "flex items-center justify-center shrink-0 w-full h-full",
|
|
2445
|
-
children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2446
|
-
LoadingIndicator,
|
|
2447
|
-
{
|
|
2448
|
-
size: sizeIcon.px,
|
|
2449
|
-
color: "currentColor",
|
|
2450
|
-
"aria-label": "Loading"
|
|
2451
|
-
}
|
|
2452
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2453
|
-
ProgressIndicator,
|
|
2454
|
-
{
|
|
2455
|
-
variant: "circular",
|
|
2456
|
-
size: sizeIcon.px,
|
|
2457
|
-
color: "currentColor",
|
|
2458
|
-
trackColor: "transparent",
|
|
2459
|
-
"aria-label": "Loading"
|
|
2460
|
-
}
|
|
2461
|
-
)
|
|
2462
|
-
}),
|
|
2463
|
-
"loading"
|
|
2464
|
-
) : icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2465
|
-
react.m.span,
|
|
2466
|
-
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
2467
|
-
transition: SPRING_TRANSITION,
|
|
2468
|
-
"aria-hidden": "true",
|
|
2469
|
-
className: "flex items-center justify-center shrink-0 w-full h-full [&>svg]:w-full [&>svg]:h-full",
|
|
2470
|
-
children: icon
|
|
2471
|
-
}),
|
|
2472
|
-
"icon"
|
|
2473
|
-
) })
|
|
2474
|
-
}
|
|
2475
|
-
),
|
|
2476
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: !isCollapsed && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2477
|
-
react.m.span,
|
|
2478
|
-
{
|
|
2479
|
-
layout: "position",
|
|
2480
|
-
initial: { opacity: 0, width: 0 },
|
|
2481
|
-
animate: { opacity: 1, width: "auto" },
|
|
2482
|
-
exit: { opacity: 0, width: 0 },
|
|
2483
|
-
transition: {
|
|
2484
|
-
opacity: { duration: 0.15, ease: "linear" },
|
|
2485
|
-
width: SPRING_TRANSITION
|
|
2486
|
-
},
|
|
2487
|
-
className: "overflow-hidden whitespace-nowrap",
|
|
2488
|
-
children: label
|
|
2489
|
-
},
|
|
2490
|
-
"label"
|
|
2491
|
-
) })
|
|
2492
|
-
]
|
|
2424
|
+
children: innerContent
|
|
2493
2425
|
})
|
|
2494
|
-
) }) });
|
|
2426
|
+
)) }) });
|
|
2495
2427
|
}
|
|
2496
2428
|
);
|
|
2497
2429
|
ExtendedFABComponent.displayName = "ExtendedFAB";
|
|
2498
|
-
var ExtendedFAB =
|
|
2430
|
+
var ExtendedFAB = React14__namespace.memo(ExtendedFABComponent);
|
|
2499
2431
|
var SIZE_STYLES = {
|
|
2500
2432
|
sm: "h-10 w-10",
|
|
2501
2433
|
md: "h-14 w-14",
|
|
@@ -2566,7 +2498,7 @@ function FABPosition({
|
|
|
2566
2498
|
}
|
|
2567
2499
|
);
|
|
2568
2500
|
}
|
|
2569
|
-
var FABComponent =
|
|
2501
|
+
var FABComponent = React14__namespace.forwardRef(
|
|
2570
2502
|
(_a, ref) => {
|
|
2571
2503
|
var _b = _a, {
|
|
2572
2504
|
className,
|
|
@@ -2580,6 +2512,7 @@ var FABComponent = React11__namespace.forwardRef(
|
|
|
2580
2512
|
loading = false,
|
|
2581
2513
|
loadingVariant = "loading-indicator",
|
|
2582
2514
|
visible = true,
|
|
2515
|
+
asChild = false,
|
|
2583
2516
|
onClick,
|
|
2584
2517
|
onKeyDown,
|
|
2585
2518
|
"aria-label": ariaLabel
|
|
@@ -2595,6 +2528,7 @@ var FABComponent = React11__namespace.forwardRef(
|
|
|
2595
2528
|
"loading",
|
|
2596
2529
|
"loadingVariant",
|
|
2597
2530
|
"visible",
|
|
2531
|
+
"asChild",
|
|
2598
2532
|
"onClick",
|
|
2599
2533
|
"onKeyDown",
|
|
2600
2534
|
"aria-label"
|
|
@@ -2611,7 +2545,7 @@ var FABComponent = React11__namespace.forwardRef(
|
|
|
2611
2545
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
2612
2546
|
disabled: loading
|
|
2613
2547
|
});
|
|
2614
|
-
const handleClick =
|
|
2548
|
+
const handleClick = React14__namespace.useCallback(
|
|
2615
2549
|
(e) => {
|
|
2616
2550
|
if (loading) {
|
|
2617
2551
|
e.preventDefault();
|
|
@@ -2621,7 +2555,7 @@ var FABComponent = React11__namespace.forwardRef(
|
|
|
2621
2555
|
},
|
|
2622
2556
|
[loading, onClick]
|
|
2623
2557
|
);
|
|
2624
|
-
const handleKeyDown =
|
|
2558
|
+
const handleKeyDown = React14__namespace.useCallback(
|
|
2625
2559
|
(e) => {
|
|
2626
2560
|
if (loading) return;
|
|
2627
2561
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -2632,19 +2566,116 @@ var FABComponent = React11__namespace.forwardRef(
|
|
|
2632
2566
|
},
|
|
2633
2567
|
[loading, onClick, onKeyDown]
|
|
2634
2568
|
);
|
|
2635
|
-
|
|
2569
|
+
const labelContent = asChild ? React14__namespace.Children.only(children).props.children : children;
|
|
2570
|
+
const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2571
|
+
needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
|
|
2572
|
+
/* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
2573
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2574
|
+
react.m.span,
|
|
2575
|
+
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
2576
|
+
transition: SPRING_TRANSITION,
|
|
2577
|
+
className: cn(
|
|
2578
|
+
"flex items-center justify-center shrink-0",
|
|
2579
|
+
iconClass
|
|
2580
|
+
),
|
|
2581
|
+
children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2582
|
+
LoadingIndicator,
|
|
2583
|
+
{
|
|
2584
|
+
size: iconPx,
|
|
2585
|
+
color: "currentColor",
|
|
2586
|
+
"aria-label": "Loading"
|
|
2587
|
+
}
|
|
2588
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2589
|
+
ProgressIndicator,
|
|
2590
|
+
{
|
|
2591
|
+
variant: "circular",
|
|
2592
|
+
size: iconPx,
|
|
2593
|
+
color: "currentColor",
|
|
2594
|
+
trackColor: "transparent",
|
|
2595
|
+
"aria-label": "Loading"
|
|
2596
|
+
}
|
|
2597
|
+
)
|
|
2598
|
+
}),
|
|
2599
|
+
"loading"
|
|
2600
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2601
|
+
react.m.span,
|
|
2602
|
+
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
2603
|
+
transition: SPRING_TRANSITION,
|
|
2604
|
+
"aria-hidden": "true",
|
|
2605
|
+
className: cn(
|
|
2606
|
+
"flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full",
|
|
2607
|
+
iconClass
|
|
2608
|
+
),
|
|
2609
|
+
children: icon
|
|
2610
|
+
}),
|
|
2611
|
+
"icon"
|
|
2612
|
+
) }),
|
|
2613
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: extended && labelContent && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2614
|
+
react.m.span,
|
|
2615
|
+
{
|
|
2616
|
+
initial: { width: 0, opacity: 0 },
|
|
2617
|
+
animate: { width: "auto", opacity: 1 },
|
|
2618
|
+
exit: { width: 0, opacity: 0 },
|
|
2619
|
+
transition: SPRING_TRANSITION,
|
|
2620
|
+
className: "overflow-hidden whitespace-nowrap ml-3",
|
|
2621
|
+
children: labelContent
|
|
2622
|
+
},
|
|
2623
|
+
"label"
|
|
2624
|
+
) })
|
|
2625
|
+
] });
|
|
2626
|
+
const containerClassName = cn(
|
|
2627
|
+
"relative shrink-0 inline-flex items-center justify-center",
|
|
2628
|
+
"select-none cursor-pointer overflow-hidden",
|
|
2629
|
+
"transition-[box-shadow,opacity,filter] duration-200",
|
|
2630
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
|
|
2631
|
+
"disabled:pointer-events-none disabled:opacity-[0.38] disabled:shadow-none",
|
|
2632
|
+
colors.bg,
|
|
2633
|
+
colors.text,
|
|
2634
|
+
lowered ? "shadow-sm" : colors.shadow,
|
|
2635
|
+
(_d = SIZE_STYLES[size]) != null ? _d : "h-14 w-14",
|
|
2636
|
+
extended && "w-auto px-6",
|
|
2637
|
+
SIZE_TEXT_CLASS[size],
|
|
2638
|
+
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
2639
|
+
className
|
|
2640
|
+
);
|
|
2641
|
+
const computedAriaLabel = ariaLabel || (typeof children === "string" ? children : void 0);
|
|
2642
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: visible && (asChild ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2643
|
+
reactSlot.Slot,
|
|
2644
|
+
__spreadProps(__spreadValues({
|
|
2645
|
+
ref,
|
|
2646
|
+
"aria-label": computedAriaLabel,
|
|
2647
|
+
"aria-busy": loading || void 0,
|
|
2648
|
+
"aria-disabled": loading || restProps.disabled,
|
|
2649
|
+
onClick: handleClick,
|
|
2650
|
+
onPointerDown,
|
|
2651
|
+
onKeyDown: handleKeyDown,
|
|
2652
|
+
style: __spreadProps(__spreadValues({}, style), {
|
|
2653
|
+
borderRadius: `${animateRadius}px`
|
|
2654
|
+
}),
|
|
2655
|
+
className: containerClassName
|
|
2656
|
+
}, restProps), {
|
|
2657
|
+
children: React14__namespace.cloneElement(
|
|
2658
|
+
React14__namespace.Children.only(children),
|
|
2659
|
+
{ children: innerContent }
|
|
2660
|
+
)
|
|
2661
|
+
})
|
|
2662
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2636
2663
|
react.m.button,
|
|
2637
2664
|
__spreadProps(__spreadValues({
|
|
2638
2665
|
ref,
|
|
2639
2666
|
type: "button",
|
|
2640
|
-
"aria-label":
|
|
2667
|
+
"aria-label": computedAriaLabel,
|
|
2641
2668
|
"aria-busy": loading || void 0,
|
|
2642
2669
|
"aria-disabled": loading || restProps.disabled,
|
|
2643
2670
|
onClick: handleClick,
|
|
2644
2671
|
onPointerDown,
|
|
2645
2672
|
onKeyDown: handleKeyDown,
|
|
2646
2673
|
style,
|
|
2647
|
-
initial: {
|
|
2674
|
+
initial: {
|
|
2675
|
+
scale: 0.5,
|
|
2676
|
+
opacity: 0,
|
|
2677
|
+
borderRadius: animateRadius
|
|
2678
|
+
},
|
|
2648
2679
|
animate: { scale: 1, opacity: 1, borderRadius: animateRadius },
|
|
2649
2680
|
exit: { scale: 0.5, opacity: 0 },
|
|
2650
2681
|
whileTap: { borderRadius: pressedRadius },
|
|
@@ -2653,84 +2684,15 @@ var FABComponent = React11__namespace.forwardRef(
|
|
|
2653
2684
|
scale: SPRING_TRANSITION,
|
|
2654
2685
|
opacity: { duration: 0.25, ease: "easeOut" }
|
|
2655
2686
|
},
|
|
2656
|
-
className:
|
|
2657
|
-
"relative shrink-0 inline-flex items-center justify-center",
|
|
2658
|
-
"select-none cursor-pointer overflow-hidden",
|
|
2659
|
-
"transition-[box-shadow,opacity,filter] duration-200",
|
|
2660
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
|
|
2661
|
-
"disabled:pointer-events-none disabled:opacity-[0.38] disabled:shadow-none",
|
|
2662
|
-
colors.bg,
|
|
2663
|
-
colors.text,
|
|
2664
|
-
lowered ? "shadow-sm" : colors.shadow,
|
|
2665
|
-
(_d = SIZE_STYLES[size]) != null ? _d : "h-14 w-14",
|
|
2666
|
-
extended && "w-auto px-6",
|
|
2667
|
-
SIZE_TEXT_CLASS[size],
|
|
2668
|
-
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
2669
|
-
className
|
|
2670
|
-
)
|
|
2687
|
+
className: containerClassName
|
|
2671
2688
|
}, restProps), {
|
|
2672
|
-
children:
|
|
2673
|
-
needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
|
|
2674
|
-
/* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
2675
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2676
|
-
react.m.span,
|
|
2677
|
-
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
2678
|
-
transition: SPRING_TRANSITION,
|
|
2679
|
-
className: cn(
|
|
2680
|
-
"flex items-center justify-center shrink-0",
|
|
2681
|
-
iconClass
|
|
2682
|
-
),
|
|
2683
|
-
children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2684
|
-
LoadingIndicator,
|
|
2685
|
-
{
|
|
2686
|
-
size: iconPx,
|
|
2687
|
-
color: "currentColor",
|
|
2688
|
-
"aria-label": "Loading"
|
|
2689
|
-
}
|
|
2690
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2691
|
-
ProgressIndicator,
|
|
2692
|
-
{
|
|
2693
|
-
variant: "circular",
|
|
2694
|
-
size: iconPx,
|
|
2695
|
-
color: "currentColor",
|
|
2696
|
-
trackColor: "transparent",
|
|
2697
|
-
"aria-label": "Loading"
|
|
2698
|
-
}
|
|
2699
|
-
)
|
|
2700
|
-
}),
|
|
2701
|
-
"loading"
|
|
2702
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2703
|
-
react.m.span,
|
|
2704
|
-
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
2705
|
-
transition: SPRING_TRANSITION,
|
|
2706
|
-
"aria-hidden": "true",
|
|
2707
|
-
className: cn(
|
|
2708
|
-
"flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full",
|
|
2709
|
-
iconClass
|
|
2710
|
-
),
|
|
2711
|
-
children: icon
|
|
2712
|
-
}),
|
|
2713
|
-
"icon"
|
|
2714
|
-
) }),
|
|
2715
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: extended && children && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2716
|
-
react.m.span,
|
|
2717
|
-
{
|
|
2718
|
-
initial: { width: 0, opacity: 0 },
|
|
2719
|
-
animate: { width: "auto", opacity: 1 },
|
|
2720
|
-
exit: { width: 0, opacity: 0 },
|
|
2721
|
-
transition: SPRING_TRANSITION,
|
|
2722
|
-
className: "overflow-hidden whitespace-nowrap ml-3",
|
|
2723
|
-
children
|
|
2724
|
-
},
|
|
2725
|
-
"label"
|
|
2726
|
-
) })
|
|
2727
|
-
]
|
|
2689
|
+
children: innerContent
|
|
2728
2690
|
})
|
|
2729
|
-
) }) });
|
|
2691
|
+
)) }) });
|
|
2730
2692
|
}
|
|
2731
2693
|
);
|
|
2732
2694
|
FABComponent.displayName = "FAB";
|
|
2733
|
-
var FAB =
|
|
2695
|
+
var FAB = React14__namespace.memo(FABComponent);
|
|
2734
2696
|
var SPRING_NORMAL = { stiffness: 700, damping: 40 };
|
|
2735
2697
|
var SPRING_REDUCED = { stiffness: 1e4, damping: 100 };
|
|
2736
2698
|
var FOCUS_DELAY_MS = 50;
|
|
@@ -2838,7 +2800,7 @@ function CloseIcon() {
|
|
|
2838
2800
|
function defaultFabIcon(progress) {
|
|
2839
2801
|
return progress > 0.5 ? /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {}) : /* @__PURE__ */ jsxRuntime.jsx(AddIcon, {});
|
|
2840
2802
|
}
|
|
2841
|
-
var ToggleFABComponent =
|
|
2803
|
+
var ToggleFABComponent = React14__namespace.forwardRef(
|
|
2842
2804
|
({
|
|
2843
2805
|
expanded,
|
|
2844
2806
|
onToggle,
|
|
@@ -2856,7 +2818,7 @@ var ToggleFABComponent = React11__namespace.forwardRef(
|
|
|
2856
2818
|
const sizeTokens = (_b = TOGGLE_FAB_SIZES[fabSize]) != null ? _b : TOGGLE_FAB_SIZES.baseline;
|
|
2857
2819
|
const springConfig = prefersReduced ? SPRING_REDUCED : SPRING_NORMAL;
|
|
2858
2820
|
const checkedProgress = react.useSpring(expanded ? 1 : 0, springConfig);
|
|
2859
|
-
|
|
2821
|
+
React14__namespace.useEffect(() => {
|
|
2860
2822
|
checkedProgress.set(expanded ? 1 : 0);
|
|
2861
2823
|
}, [expanded, checkedProgress]);
|
|
2862
2824
|
const borderRadius = react.useTransform(
|
|
@@ -2864,12 +2826,12 @@ var ToggleFABComponent = React11__namespace.forwardRef(
|
|
|
2864
2826
|
[0, 1],
|
|
2865
2827
|
[`${sizeTokens.initialRadius}px`, `${sizeTokens.finalRadius}px`]
|
|
2866
2828
|
);
|
|
2867
|
-
const [iconProgress, setIconProgress] =
|
|
2868
|
-
|
|
2829
|
+
const [iconProgress, setIconProgress] = React14__namespace.useState(expanded ? 1 : 0);
|
|
2830
|
+
React14__namespace.useEffect(() => {
|
|
2869
2831
|
return checkedProgress.on("change", setIconProgress);
|
|
2870
2832
|
}, [checkedProgress]);
|
|
2871
2833
|
const { ripples, onPointerDown, removeRipple } = useRippleState();
|
|
2872
|
-
const handleClick =
|
|
2834
|
+
const handleClick = React14__namespace.useCallback(() => {
|
|
2873
2835
|
onToggle(!expanded);
|
|
2874
2836
|
}, [expanded, onToggle]);
|
|
2875
2837
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2918,7 +2880,7 @@ var ToggleFABComponent = React11__namespace.forwardRef(
|
|
|
2918
2880
|
}
|
|
2919
2881
|
);
|
|
2920
2882
|
ToggleFABComponent.displayName = "ToggleFAB";
|
|
2921
|
-
var ToggleFAB =
|
|
2883
|
+
var ToggleFAB = React14__namespace.memo(ToggleFABComponent);
|
|
2922
2884
|
function FABMenuItem({
|
|
2923
2885
|
icon,
|
|
2924
2886
|
label,
|
|
@@ -2926,12 +2888,14 @@ function FABMenuItem({
|
|
|
2926
2888
|
disabled = false,
|
|
2927
2889
|
colorVariant = "primary",
|
|
2928
2890
|
className,
|
|
2929
|
-
tabIndex = 0
|
|
2891
|
+
tabIndex = 0,
|
|
2892
|
+
asChild = false,
|
|
2893
|
+
children
|
|
2930
2894
|
}) {
|
|
2931
2895
|
var _a;
|
|
2932
2896
|
const colors = (_a = MENU_ITEM_COLORS[colorVariant]) != null ? _a : MENU_ITEM_COLORS.primary;
|
|
2933
2897
|
const { ripples, onPointerDown, removeRipple } = useRippleState({ disabled });
|
|
2934
|
-
const handleClick =
|
|
2898
|
+
const handleClick = React14__namespace.useCallback(
|
|
2935
2899
|
(e) => {
|
|
2936
2900
|
if (disabled) {
|
|
2937
2901
|
e.preventDefault();
|
|
@@ -2941,7 +2905,7 @@ function FABMenuItem({
|
|
|
2941
2905
|
},
|
|
2942
2906
|
[disabled, onClick]
|
|
2943
2907
|
);
|
|
2944
|
-
const handleKeyDown =
|
|
2908
|
+
const handleKeyDown = React14__namespace.useCallback(
|
|
2945
2909
|
(e) => {
|
|
2946
2910
|
if (disabled) return;
|
|
2947
2911
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -2951,7 +2915,55 @@ function FABMenuItem({
|
|
|
2951
2915
|
},
|
|
2952
2916
|
[disabled, onClick]
|
|
2953
2917
|
);
|
|
2954
|
-
|
|
2918
|
+
const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2919
|
+
/* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
|
|
2920
|
+
/* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
2921
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2922
|
+
"span",
|
|
2923
|
+
{
|
|
2924
|
+
"aria-hidden": "true",
|
|
2925
|
+
className: "relative z-10 flex items-center justify-center size-6 shrink-0 [&>svg]:w-full [&>svg]:h-full pointer-events-none",
|
|
2926
|
+
children: icon
|
|
2927
|
+
}
|
|
2928
|
+
),
|
|
2929
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative z-10 text-base font-medium leading-none pointer-events-none", children: label })
|
|
2930
|
+
] });
|
|
2931
|
+
const containerClassName = cn(
|
|
2932
|
+
"relative inline-flex flex-row items-center",
|
|
2933
|
+
"select-none cursor-pointer overflow-hidden",
|
|
2934
|
+
"whitespace-nowrap",
|
|
2935
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-1",
|
|
2936
|
+
MENU_ITEM_STYLES.size,
|
|
2937
|
+
MENU_ITEM_STYLES.gap,
|
|
2938
|
+
label ? MENU_ITEM_STYLES.padding : "px-4",
|
|
2939
|
+
!label && "justify-center",
|
|
2940
|
+
colors.bg,
|
|
2941
|
+
colors.text,
|
|
2942
|
+
disabled && "opacity-[0.38] pointer-events-none",
|
|
2943
|
+
className
|
|
2944
|
+
);
|
|
2945
|
+
const containerStyle = {
|
|
2946
|
+
transformOrigin: "right",
|
|
2947
|
+
borderRadius: `${MENU_ITEM_STYLES.cornerRadius}px`
|
|
2948
|
+
};
|
|
2949
|
+
if (asChild) {
|
|
2950
|
+
const child = React14__namespace.Children.only(children);
|
|
2951
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.m.div, { variants: MENU_ITEM_VARIANTS, style: containerStyle, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2952
|
+
reactSlot.Slot,
|
|
2953
|
+
{
|
|
2954
|
+
role: "menuitem",
|
|
2955
|
+
tabIndex,
|
|
2956
|
+
"aria-disabled": disabled ? "true" : void 0,
|
|
2957
|
+
"data-disabled": disabled ? "true" : void 0,
|
|
2958
|
+
onClick: handleClick,
|
|
2959
|
+
onPointerDown,
|
|
2960
|
+
onKeyDown: handleKeyDown,
|
|
2961
|
+
className: containerClassName,
|
|
2962
|
+
children: React14__namespace.cloneElement(child, { children: innerContent })
|
|
2963
|
+
}
|
|
2964
|
+
) });
|
|
2965
|
+
}
|
|
2966
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2955
2967
|
react.m.div,
|
|
2956
2968
|
{
|
|
2957
2969
|
role: "menuitem",
|
|
@@ -2962,37 +2974,9 @@ function FABMenuItem({
|
|
|
2962
2974
|
onPointerDown,
|
|
2963
2975
|
onKeyDown: handleKeyDown,
|
|
2964
2976
|
variants: MENU_ITEM_VARIANTS,
|
|
2965
|
-
style:
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
},
|
|
2969
|
-
className: cn(
|
|
2970
|
-
"relative inline-flex flex-row items-center",
|
|
2971
|
-
"select-none cursor-pointer overflow-hidden",
|
|
2972
|
-
"whitespace-nowrap",
|
|
2973
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-1",
|
|
2974
|
-
MENU_ITEM_STYLES.size,
|
|
2975
|
-
MENU_ITEM_STYLES.gap,
|
|
2976
|
-
label ? MENU_ITEM_STYLES.padding : "px-4",
|
|
2977
|
-
!label && "justify-center",
|
|
2978
|
-
colors.bg,
|
|
2979
|
-
colors.text,
|
|
2980
|
-
disabled && "opacity-[0.38] pointer-events-none",
|
|
2981
|
-
className
|
|
2982
|
-
),
|
|
2983
|
-
children: [
|
|
2984
|
-
/* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
|
|
2985
|
-
/* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
2986
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2987
|
-
"span",
|
|
2988
|
-
{
|
|
2989
|
-
"aria-hidden": "true",
|
|
2990
|
-
className: "relative z-10 flex items-center justify-center size-6 shrink-0 [&>svg]:w-full [&>svg]:h-full pointer-events-none",
|
|
2991
|
-
children: icon
|
|
2992
|
-
}
|
|
2993
|
-
),
|
|
2994
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative z-10 text-base font-medium leading-none pointer-events-none", children: label })
|
|
2995
|
-
]
|
|
2977
|
+
style: containerStyle,
|
|
2978
|
+
className: containerClassName,
|
|
2979
|
+
children: innerContent
|
|
2996
2980
|
}
|
|
2997
2981
|
);
|
|
2998
2982
|
}
|
|
@@ -3008,13 +2992,13 @@ function FABMenu({
|
|
|
3008
2992
|
focusLast = true,
|
|
3009
2993
|
"aria-label": ariaLabel
|
|
3010
2994
|
}) {
|
|
3011
|
-
const fabId =
|
|
3012
|
-
const menuId =
|
|
3013
|
-
const toggleRef =
|
|
3014
|
-
const itemRefs =
|
|
3015
|
-
const [focusedIndex, setFocusedIndex] =
|
|
3016
|
-
const reversedItems =
|
|
3017
|
-
const focusItem =
|
|
2995
|
+
const fabId = React14__namespace.useId();
|
|
2996
|
+
const menuId = React14__namespace.useId();
|
|
2997
|
+
const toggleRef = React14__namespace.useRef(null);
|
|
2998
|
+
const itemRefs = React14__namespace.useRef([]);
|
|
2999
|
+
const [focusedIndex, setFocusedIndex] = React14__namespace.useState(-1);
|
|
3000
|
+
const reversedItems = React14__namespace.useMemo(() => [...items].reverse(), [items]);
|
|
3001
|
+
const focusItem = React14__namespace.useCallback((index) => {
|
|
3018
3002
|
var _a;
|
|
3019
3003
|
const clampedIndex = Math.max(
|
|
3020
3004
|
0,
|
|
@@ -3023,8 +3007,8 @@ function FABMenu({
|
|
|
3023
3007
|
setFocusedIndex(clampedIndex);
|
|
3024
3008
|
(_a = itemRefs.current[clampedIndex]) == null ? void 0 : _a.focus();
|
|
3025
3009
|
}, []);
|
|
3026
|
-
const wasExpandedRef =
|
|
3027
|
-
|
|
3010
|
+
const wasExpandedRef = React14__namespace.useRef(false);
|
|
3011
|
+
React14__namespace.useEffect(() => {
|
|
3028
3012
|
var _a;
|
|
3029
3013
|
if (expanded) {
|
|
3030
3014
|
wasExpandedRef.current = true;
|
|
@@ -3039,7 +3023,7 @@ function FABMenu({
|
|
|
3039
3023
|
wasExpandedRef.current = false;
|
|
3040
3024
|
setFocusedIndex(-1);
|
|
3041
3025
|
}, [expanded, focusLast, items.length, focusItem]);
|
|
3042
|
-
const handleMenuKeyDown =
|
|
3026
|
+
const handleMenuKeyDown = React14__namespace.useCallback(
|
|
3043
3027
|
(e) => {
|
|
3044
3028
|
if (!expanded) return;
|
|
3045
3029
|
const lastIndex = items.length - 1;
|
|
@@ -3261,7 +3245,7 @@ function resolveDisabledBgClass(colorStyle) {
|
|
|
3261
3245
|
}
|
|
3262
3246
|
return "disabled:text-m3-on-surface/[0.38]";
|
|
3263
3247
|
}
|
|
3264
|
-
var IconButtonComponent =
|
|
3248
|
+
var IconButtonComponent = React14__namespace.forwardRef(
|
|
3265
3249
|
(_a, ref) => {
|
|
3266
3250
|
var _b = _a, {
|
|
3267
3251
|
className,
|
|
@@ -3274,6 +3258,7 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
3274
3258
|
loading = false,
|
|
3275
3259
|
loadingVariant = "loading-indicator",
|
|
3276
3260
|
iconSize,
|
|
3261
|
+
asChild = false,
|
|
3277
3262
|
children,
|
|
3278
3263
|
onClick,
|
|
3279
3264
|
onKeyDown,
|
|
@@ -3289,6 +3274,7 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
3289
3274
|
"loading",
|
|
3290
3275
|
"loadingVariant",
|
|
3291
3276
|
"iconSize",
|
|
3277
|
+
"asChild",
|
|
3292
3278
|
"children",
|
|
3293
3279
|
"onClick",
|
|
3294
3280
|
"onKeyDown",
|
|
@@ -3297,18 +3283,18 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
3297
3283
|
var _a2, _b2;
|
|
3298
3284
|
const isToggle = variant === "toggle";
|
|
3299
3285
|
const isSelected = isToggle && !!selected;
|
|
3300
|
-
const resolvedColorClass =
|
|
3286
|
+
const resolvedColorClass = React14__namespace.useMemo(
|
|
3301
3287
|
() => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
|
|
3302
3288
|
[isSelected, colorStyle]
|
|
3303
3289
|
);
|
|
3304
|
-
const outlineWidthClass =
|
|
3290
|
+
const outlineWidthClass = React14__namespace.useMemo(
|
|
3305
3291
|
() => {
|
|
3306
3292
|
var _a3;
|
|
3307
3293
|
return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
|
|
3308
3294
|
},
|
|
3309
3295
|
[colorStyle, isSelected, size]
|
|
3310
3296
|
);
|
|
3311
|
-
const disabledBgClass =
|
|
3297
|
+
const disabledBgClass = React14__namespace.useMemo(
|
|
3312
3298
|
() => resolveDisabledBgClass(colorStyle),
|
|
3313
3299
|
[colorStyle]
|
|
3314
3300
|
);
|
|
@@ -3329,7 +3315,7 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
3329
3315
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
3330
3316
|
disabled: loading
|
|
3331
3317
|
});
|
|
3332
|
-
const handleClick =
|
|
3318
|
+
const handleClick = React14__namespace.useCallback(
|
|
3333
3319
|
(e) => {
|
|
3334
3320
|
if (loading) {
|
|
3335
3321
|
e.preventDefault();
|
|
@@ -3339,7 +3325,7 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
3339
3325
|
},
|
|
3340
3326
|
[loading, onClick]
|
|
3341
3327
|
);
|
|
3342
|
-
const handleKeyDown =
|
|
3328
|
+
const handleKeyDown = React14__namespace.useCallback(
|
|
3343
3329
|
(e) => {
|
|
3344
3330
|
if (loading) return;
|
|
3345
3331
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -3350,7 +3336,87 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
3350
3336
|
},
|
|
3351
3337
|
[loading, onClick, onKeyDown]
|
|
3352
3338
|
);
|
|
3353
|
-
|
|
3339
|
+
const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3340
|
+
needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
|
|
3341
|
+
/* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
3342
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3343
|
+
react.m.span,
|
|
3344
|
+
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
3345
|
+
transition: SPRING_TRANSITION,
|
|
3346
|
+
className: cn(
|
|
3347
|
+
"flex items-center justify-center shrink-0",
|
|
3348
|
+
iconSize != null ? void 0 : iconClass
|
|
3349
|
+
),
|
|
3350
|
+
style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
|
|
3351
|
+
children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3352
|
+
LoadingIndicator,
|
|
3353
|
+
{
|
|
3354
|
+
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
3355
|
+
color: "currentColor",
|
|
3356
|
+
"aria-label": "Loading"
|
|
3357
|
+
}
|
|
3358
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3359
|
+
ProgressIndicator,
|
|
3360
|
+
{
|
|
3361
|
+
variant: "circular",
|
|
3362
|
+
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
3363
|
+
color: "currentColor",
|
|
3364
|
+
trackColor: "transparent",
|
|
3365
|
+
"aria-label": "Loading"
|
|
3366
|
+
}
|
|
3367
|
+
)
|
|
3368
|
+
}),
|
|
3369
|
+
"loading"
|
|
3370
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3371
|
+
react.m.span,
|
|
3372
|
+
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
3373
|
+
transition: SPRING_TRANSITION,
|
|
3374
|
+
"aria-hidden": "true",
|
|
3375
|
+
className: cn(
|
|
3376
|
+
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
|
|
3377
|
+
iconSize != null ? void 0 : iconClass
|
|
3378
|
+
),
|
|
3379
|
+
style: {
|
|
3380
|
+
fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
|
|
3381
|
+
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
3382
|
+
height: isCustomSize ? `${iconSize}px` : void 0
|
|
3383
|
+
},
|
|
3384
|
+
children: asChild ? React14__namespace.Children.only(children).props.children : children
|
|
3385
|
+
}),
|
|
3386
|
+
"content"
|
|
3387
|
+
) })
|
|
3388
|
+
] });
|
|
3389
|
+
const containerClassName = cn(
|
|
3390
|
+
baseIconButtonClasses,
|
|
3391
|
+
resolvedColorClass,
|
|
3392
|
+
outlineWidthClass,
|
|
3393
|
+
disabledBgClass,
|
|
3394
|
+
"overflow-hidden",
|
|
3395
|
+
SIZE_STYLES2[size],
|
|
3396
|
+
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
3397
|
+
className
|
|
3398
|
+
);
|
|
3399
|
+
if (asChild) {
|
|
3400
|
+
const child = React14__namespace.Children.only(children);
|
|
3401
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3402
|
+
reactSlot.Slot,
|
|
3403
|
+
__spreadProps(__spreadValues({
|
|
3404
|
+
ref,
|
|
3405
|
+
"aria-pressed": isToggle ? isSelected : void 0,
|
|
3406
|
+
"aria-label": ariaLabel,
|
|
3407
|
+
"aria-busy": loading || void 0,
|
|
3408
|
+
"aria-disabled": loading || restProps.disabled,
|
|
3409
|
+
onClick: handleClick,
|
|
3410
|
+
onPointerDown,
|
|
3411
|
+
onKeyDown: handleKeyDown,
|
|
3412
|
+
style: __spreadProps(__spreadValues({}, style), { borderRadius: `${animateRadius}px` }),
|
|
3413
|
+
className: containerClassName
|
|
3414
|
+
}, restProps), {
|
|
3415
|
+
children: React14__namespace.cloneElement(child, { children: innerContent })
|
|
3416
|
+
})
|
|
3417
|
+
) });
|
|
3418
|
+
}
|
|
3419
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3354
3420
|
react.m.button,
|
|
3355
3421
|
__spreadProps(__spreadValues({
|
|
3356
3422
|
ref,
|
|
@@ -3366,78 +3432,20 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
3366
3432
|
animate: { borderRadius: animateRadius },
|
|
3367
3433
|
whileTap: { borderRadius: pressedRadius },
|
|
3368
3434
|
transition: { borderRadius: SPRING_TRANSITION_FAST },
|
|
3369
|
-
className:
|
|
3370
|
-
baseIconButtonClasses,
|
|
3371
|
-
resolvedColorClass,
|
|
3372
|
-
outlineWidthClass,
|
|
3373
|
-
disabledBgClass,
|
|
3374
|
-
"overflow-hidden",
|
|
3375
|
-
SIZE_STYLES2[size],
|
|
3376
|
-
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
3377
|
-
className
|
|
3378
|
-
)
|
|
3435
|
+
className: containerClassName
|
|
3379
3436
|
}, restProps), {
|
|
3380
|
-
children:
|
|
3381
|
-
needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
|
|
3382
|
-
/* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
3383
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3384
|
-
react.m.span,
|
|
3385
|
-
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
3386
|
-
transition: SPRING_TRANSITION,
|
|
3387
|
-
className: cn(
|
|
3388
|
-
"flex items-center justify-center shrink-0",
|
|
3389
|
-
iconSize != null ? void 0 : iconClass
|
|
3390
|
-
),
|
|
3391
|
-
style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
|
|
3392
|
-
children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3393
|
-
LoadingIndicator,
|
|
3394
|
-
{
|
|
3395
|
-
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
3396
|
-
color: "currentColor",
|
|
3397
|
-
"aria-label": "Loading"
|
|
3398
|
-
}
|
|
3399
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3400
|
-
ProgressIndicator,
|
|
3401
|
-
{
|
|
3402
|
-
variant: "circular",
|
|
3403
|
-
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
3404
|
-
color: "currentColor",
|
|
3405
|
-
trackColor: "transparent",
|
|
3406
|
-
"aria-label": "Loading"
|
|
3407
|
-
}
|
|
3408
|
-
)
|
|
3409
|
-
}),
|
|
3410
|
-
"loading"
|
|
3411
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3412
|
-
react.m.span,
|
|
3413
|
-
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
3414
|
-
transition: SPRING_TRANSITION,
|
|
3415
|
-
"aria-hidden": "true",
|
|
3416
|
-
className: cn(
|
|
3417
|
-
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
|
|
3418
|
-
iconSize != null ? void 0 : iconClass
|
|
3419
|
-
),
|
|
3420
|
-
style: {
|
|
3421
|
-
fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
|
|
3422
|
-
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
3423
|
-
height: isCustomSize ? `${iconSize}px` : void 0
|
|
3424
|
-
},
|
|
3425
|
-
children
|
|
3426
|
-
}),
|
|
3427
|
-
"content"
|
|
3428
|
-
) })
|
|
3429
|
-
]
|
|
3437
|
+
children: innerContent
|
|
3430
3438
|
})
|
|
3431
3439
|
) });
|
|
3432
3440
|
}
|
|
3433
3441
|
);
|
|
3434
3442
|
IconButtonComponent.displayName = "IconButton";
|
|
3435
|
-
var IconButton =
|
|
3436
|
-
var SplitButtonContext =
|
|
3443
|
+
var IconButton = React14__namespace.memo(IconButtonComponent);
|
|
3444
|
+
var SplitButtonContext = React14__namespace.createContext(null);
|
|
3437
3445
|
function useSplitButtonContext() {
|
|
3438
|
-
return
|
|
3446
|
+
return React14__namespace.useContext(SplitButtonContext);
|
|
3439
3447
|
}
|
|
3440
|
-
var SplitButtonLayoutComponent =
|
|
3448
|
+
var SplitButtonLayoutComponent = React14__namespace.forwardRef(
|
|
3441
3449
|
(_a, ref) => {
|
|
3442
3450
|
var _b = _a, {
|
|
3443
3451
|
leadingButton,
|
|
@@ -3454,10 +3462,10 @@ var SplitButtonLayoutComponent = React11__namespace.forwardRef(
|
|
|
3454
3462
|
"variant",
|
|
3455
3463
|
"size"
|
|
3456
3464
|
]);
|
|
3457
|
-
const leadingProps =
|
|
3465
|
+
const leadingProps = React14__namespace.isValidElement(leadingButton) ? leadingButton.props : {};
|
|
3458
3466
|
const size = layoutSize || leadingProps.size;
|
|
3459
3467
|
const variant = layoutVariant || leadingProps.variant;
|
|
3460
|
-
const contextValue =
|
|
3468
|
+
const contextValue = React14__namespace.useMemo(
|
|
3461
3469
|
() => ({
|
|
3462
3470
|
size,
|
|
3463
3471
|
variant
|
|
@@ -3483,8 +3491,8 @@ var SplitButtonLayoutComponent = React11__namespace.forwardRef(
|
|
|
3483
3491
|
}
|
|
3484
3492
|
);
|
|
3485
3493
|
SplitButtonLayoutComponent.displayName = "SplitButtonLayout";
|
|
3486
|
-
var SplitButtonLayout =
|
|
3487
|
-
var StateLayer =
|
|
3494
|
+
var SplitButtonLayout = React14__namespace.memo(SplitButtonLayoutComponent);
|
|
3495
|
+
var StateLayer = React14__namespace.forwardRef(
|
|
3488
3496
|
(_a, ref) => {
|
|
3489
3497
|
var _b = _a, { className, hovered, focused, pressed } = _b, props = __objRest(_b, ["className", "hovered", "focused", "pressed"]);
|
|
3490
3498
|
let opacity = 0;
|
|
@@ -3736,7 +3744,7 @@ var splitButtonVariants = classVarianceAuthority.cva(
|
|
|
3736
3744
|
}
|
|
3737
3745
|
}
|
|
3738
3746
|
);
|
|
3739
|
-
var SplitButtonLeadingComponent =
|
|
3747
|
+
var SplitButtonLeadingComponent = React14__namespace.forwardRef(
|
|
3740
3748
|
(_a, ref) => {
|
|
3741
3749
|
var _b = _a, {
|
|
3742
3750
|
className,
|
|
@@ -3746,6 +3754,7 @@ var SplitButtonLeadingComponent = React11__namespace.forwardRef(
|
|
|
3746
3754
|
icon,
|
|
3747
3755
|
children,
|
|
3748
3756
|
disabled,
|
|
3757
|
+
asChild = false,
|
|
3749
3758
|
onClick,
|
|
3750
3759
|
onPointerDown,
|
|
3751
3760
|
onPointerUp,
|
|
@@ -3761,6 +3770,7 @@ var SplitButtonLeadingComponent = React11__namespace.forwardRef(
|
|
|
3761
3770
|
"icon",
|
|
3762
3771
|
"children",
|
|
3763
3772
|
"disabled",
|
|
3773
|
+
"asChild",
|
|
3764
3774
|
"onClick",
|
|
3765
3775
|
"onPointerDown",
|
|
3766
3776
|
"onPointerUp",
|
|
@@ -3773,9 +3783,9 @@ var SplitButtonLeadingComponent = React11__namespace.forwardRef(
|
|
|
3773
3783
|
const context = useSplitButtonContext();
|
|
3774
3784
|
const actualSize = (_a2 = context == null ? void 0 : context.size) != null ? _a2 : size;
|
|
3775
3785
|
const actualVariant = (_b2 = context == null ? void 0 : context.variant) != null ? _b2 : variant;
|
|
3776
|
-
const [isHovered, setIsHovered] =
|
|
3777
|
-
const [isFocused, setIsFocused] =
|
|
3778
|
-
const [isPressed, setIsPressed] =
|
|
3786
|
+
const [isHovered, setIsHovered] = React14__namespace.useState(false);
|
|
3787
|
+
const [isFocused, setIsFocused] = React14__namespace.useState(false);
|
|
3788
|
+
const [isPressed, setIsPressed] = React14__namespace.useState(false);
|
|
3779
3789
|
const tokens = SPLIT_BUTTON_TOKENS[actualSize];
|
|
3780
3790
|
const typographyClass = (_c = BUTTON_TYPOGRAPHY_TOKENS[actualSize]) != null ? _c : BUTTON_TYPOGRAPHY_TOKENS.sm;
|
|
3781
3791
|
const needsTouchTarget = actualSize === "xs" || actualSize === "sm";
|
|
@@ -3787,7 +3797,7 @@ var SplitButtonLeadingComponent = React11__namespace.forwardRef(
|
|
|
3787
3797
|
const innerCornerRadius = isPressed || isFocused ? tokens.innerCorner.pressed : isHovered ? tokens.innerCorner.hovered : tokens.innerCorner.default;
|
|
3788
3798
|
const outerRadius = tokens.containerHeight * tokens.outerCornerPercent / 100;
|
|
3789
3799
|
const borderRadius = `${outerRadius}px ${innerCornerRadius}px ${innerCornerRadius}px ${outerRadius}px`;
|
|
3790
|
-
const handleClick =
|
|
3800
|
+
const handleClick = React14__namespace.useCallback(
|
|
3791
3801
|
(e) => {
|
|
3792
3802
|
if (disabled) {
|
|
3793
3803
|
e.preventDefault();
|
|
@@ -3797,7 +3807,7 @@ var SplitButtonLeadingComponent = React11__namespace.forwardRef(
|
|
|
3797
3807
|
},
|
|
3798
3808
|
[disabled, onClick]
|
|
3799
3809
|
);
|
|
3800
|
-
const handlePointerDown =
|
|
3810
|
+
const handlePointerDown = React14__namespace.useCallback(
|
|
3801
3811
|
(e) => {
|
|
3802
3812
|
onRipplePointerDown(e);
|
|
3803
3813
|
setIsPressed(true);
|
|
@@ -3805,19 +3815,19 @@ var SplitButtonLeadingComponent = React11__namespace.forwardRef(
|
|
|
3805
3815
|
},
|
|
3806
3816
|
[onRipplePointerDown, onPointerDown]
|
|
3807
3817
|
);
|
|
3808
|
-
const handlePointerUp =
|
|
3818
|
+
const handlePointerUp = React14__namespace.useCallback(
|
|
3809
3819
|
(e) => {
|
|
3810
3820
|
setIsPressed(false);
|
|
3811
3821
|
onPointerUp == null ? void 0 : onPointerUp(e);
|
|
3812
3822
|
},
|
|
3813
3823
|
[onPointerUp]
|
|
3814
3824
|
);
|
|
3815
|
-
const handlePointerEnter =
|
|
3825
|
+
const handlePointerEnter = React14__namespace.useCallback(() => {
|
|
3816
3826
|
if (!disabled) {
|
|
3817
3827
|
setIsHovered(true);
|
|
3818
3828
|
}
|
|
3819
3829
|
}, [disabled]);
|
|
3820
|
-
const handlePointerLeave =
|
|
3830
|
+
const handlePointerLeave = React14__namespace.useCallback(
|
|
3821
3831
|
(e) => {
|
|
3822
3832
|
setIsHovered(false);
|
|
3823
3833
|
setIsPressed(false);
|
|
@@ -3825,21 +3835,21 @@ var SplitButtonLeadingComponent = React11__namespace.forwardRef(
|
|
|
3825
3835
|
},
|
|
3826
3836
|
[onPointerLeave]
|
|
3827
3837
|
);
|
|
3828
|
-
const handlePointerCancel =
|
|
3838
|
+
const handlePointerCancel = React14__namespace.useCallback(
|
|
3829
3839
|
(e) => {
|
|
3830
3840
|
setIsPressed(false);
|
|
3831
3841
|
onPointerCancel == null ? void 0 : onPointerCancel(e);
|
|
3832
3842
|
},
|
|
3833
3843
|
[onPointerCancel]
|
|
3834
3844
|
);
|
|
3835
|
-
const handleFocus =
|
|
3845
|
+
const handleFocus = React14__namespace.useCallback(
|
|
3836
3846
|
(e) => {
|
|
3837
3847
|
if (!disabled) setIsFocused(true);
|
|
3838
3848
|
onFocus == null ? void 0 : onFocus(e);
|
|
3839
3849
|
},
|
|
3840
3850
|
[disabled, onFocus]
|
|
3841
3851
|
);
|
|
3842
|
-
const handleBlur =
|
|
3852
|
+
const handleBlur = React14__namespace.useCallback(
|
|
3843
3853
|
(e) => {
|
|
3844
3854
|
setIsFocused(false);
|
|
3845
3855
|
onBlur == null ? void 0 : onBlur(e);
|
|
@@ -3847,12 +3857,73 @@ var SplitButtonLeadingComponent = React11__namespace.forwardRef(
|
|
|
3847
3857
|
[onBlur]
|
|
3848
3858
|
);
|
|
3849
3859
|
const leadingIconSize = LEADING_ICON_SIZE_FOR_SIZE[actualSize];
|
|
3850
|
-
|
|
3860
|
+
const labelContent = asChild ? React14__namespace.Children.only(children).props.children : children;
|
|
3861
|
+
const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3862
|
+
needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
|
|
3863
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3864
|
+
StateLayer,
|
|
3865
|
+
{
|
|
3866
|
+
hovered: isHovered,
|
|
3867
|
+
focused: isFocused,
|
|
3868
|
+
pressed: isPressed
|
|
3869
|
+
}
|
|
3870
|
+
),
|
|
3871
|
+
/* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
3872
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3873
|
+
"span",
|
|
3874
|
+
{
|
|
3875
|
+
className: "flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full overflow-hidden [&_.md-icon]:text-[length:inherit]!",
|
|
3876
|
+
style: {
|
|
3877
|
+
fontSize: leadingIconSize,
|
|
3878
|
+
width: leadingIconSize,
|
|
3879
|
+
height: leadingIconSize
|
|
3880
|
+
},
|
|
3881
|
+
children: icon
|
|
3882
|
+
}
|
|
3883
|
+
),
|
|
3884
|
+
labelContent && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center h-full gap-[inherit]", children: labelContent })
|
|
3885
|
+
] });
|
|
3886
|
+
const containerClassName = cn(
|
|
3887
|
+
splitButtonVariants({
|
|
3888
|
+
variant: actualVariant,
|
|
3889
|
+
size: actualSize,
|
|
3890
|
+
disabled
|
|
3891
|
+
}),
|
|
3892
|
+
typographyClass,
|
|
3893
|
+
className
|
|
3894
|
+
);
|
|
3895
|
+
const mergedStyle = __spreadValues({
|
|
3896
|
+
paddingInlineStart: tokens.leadingPadding.start,
|
|
3897
|
+
paddingInlineEnd: tokens.leadingPadding.end,
|
|
3898
|
+
gap: "8px",
|
|
3899
|
+
borderRadius
|
|
3900
|
+
}, style);
|
|
3901
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: asChild ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3902
|
+
reactSlot.Slot,
|
|
3903
|
+
__spreadProps(__spreadValues({
|
|
3904
|
+
ref,
|
|
3905
|
+
"aria-disabled": disabled || void 0,
|
|
3906
|
+
onClick: handleClick,
|
|
3907
|
+
onPointerDown: handlePointerDown,
|
|
3908
|
+
onPointerUp: handlePointerUp,
|
|
3909
|
+
onPointerEnter: handlePointerEnter,
|
|
3910
|
+
onPointerLeave: handlePointerLeave,
|
|
3911
|
+
onPointerCancel: handlePointerCancel,
|
|
3912
|
+
onFocus: handleFocus,
|
|
3913
|
+
onBlur: handleBlur,
|
|
3914
|
+
style: mergedStyle,
|
|
3915
|
+
className: containerClassName
|
|
3916
|
+
}, restProps), {
|
|
3917
|
+
children: React14__namespace.cloneElement(
|
|
3918
|
+
React14__namespace.Children.only(children),
|
|
3919
|
+
{ children: innerContent }
|
|
3920
|
+
)
|
|
3921
|
+
})
|
|
3922
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3851
3923
|
react.m.button,
|
|
3852
3924
|
__spreadProps(__spreadValues({
|
|
3853
3925
|
ref,
|
|
3854
3926
|
type: "button",
|
|
3855
|
-
"aria-disabled": disabled,
|
|
3856
3927
|
disabled,
|
|
3857
3928
|
onClick: handleClick,
|
|
3858
3929
|
onPointerDown: handlePointerDown,
|
|
@@ -3869,56 +3940,24 @@ var SplitButtonLeadingComponent = React11__namespace.forwardRef(
|
|
|
3869
3940
|
paddingInlineEnd: tokens.leadingPadding.end,
|
|
3870
3941
|
gap: "8px"
|
|
3871
3942
|
}, style),
|
|
3872
|
-
className:
|
|
3873
|
-
splitButtonVariants({
|
|
3874
|
-
variant: actualVariant,
|
|
3875
|
-
size: actualSize,
|
|
3876
|
-
disabled
|
|
3877
|
-
}),
|
|
3878
|
-
typographyClass,
|
|
3879
|
-
className
|
|
3880
|
-
)
|
|
3943
|
+
className: containerClassName
|
|
3881
3944
|
}, restProps), {
|
|
3882
|
-
children:
|
|
3883
|
-
needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
|
|
3884
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3885
|
-
StateLayer,
|
|
3886
|
-
{
|
|
3887
|
-
hovered: isHovered,
|
|
3888
|
-
focused: isFocused,
|
|
3889
|
-
pressed: isPressed
|
|
3890
|
-
}
|
|
3891
|
-
),
|
|
3892
|
-
/* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
3893
|
-
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3894
|
-
"span",
|
|
3895
|
-
{
|
|
3896
|
-
className: "flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full overflow-hidden [&_.md-icon]:text-[length:inherit]!",
|
|
3897
|
-
style: {
|
|
3898
|
-
fontSize: leadingIconSize,
|
|
3899
|
-
width: leadingIconSize,
|
|
3900
|
-
height: leadingIconSize
|
|
3901
|
-
},
|
|
3902
|
-
children: icon
|
|
3903
|
-
}
|
|
3904
|
-
),
|
|
3905
|
-
children && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center h-full gap-[inherit]", children })
|
|
3906
|
-
]
|
|
3945
|
+
children: innerContent
|
|
3907
3946
|
})
|
|
3908
3947
|
) });
|
|
3909
3948
|
}
|
|
3910
3949
|
);
|
|
3911
3950
|
SplitButtonLeadingComponent.displayName = "SplitButtonLeading";
|
|
3912
|
-
var SplitButtonLeading =
|
|
3913
|
-
var FilledSplitButtonLeading =
|
|
3951
|
+
var SplitButtonLeading = React14__namespace.memo(SplitButtonLeadingComponent);
|
|
3952
|
+
var FilledSplitButtonLeading = React14__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(SplitButtonLeading, __spreadValues({ ref, variant: "filled" }, props)));
|
|
3914
3953
|
FilledSplitButtonLeading.displayName = "FilledSplitButtonLeading";
|
|
3915
|
-
var TonalSplitButtonLeading =
|
|
3954
|
+
var TonalSplitButtonLeading = React14__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(SplitButtonLeading, __spreadValues({ ref, variant: "tonal" }, props)));
|
|
3916
3955
|
TonalSplitButtonLeading.displayName = "TonalSplitButtonLeading";
|
|
3917
|
-
var ElevatedSplitButtonLeading =
|
|
3956
|
+
var ElevatedSplitButtonLeading = React14__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(SplitButtonLeading, __spreadValues({ ref, variant: "elevated" }, props)));
|
|
3918
3957
|
ElevatedSplitButtonLeading.displayName = "ElevatedSplitButtonLeading";
|
|
3919
|
-
var OutlinedSplitButtonLeading =
|
|
3958
|
+
var OutlinedSplitButtonLeading = React14__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(SplitButtonLeading, __spreadValues({ ref, variant: "outlined" }, props)));
|
|
3920
3959
|
OutlinedSplitButtonLeading.displayName = "OutlinedSplitButtonLeading";
|
|
3921
|
-
var SplitButtonTrailingComponent =
|
|
3960
|
+
var SplitButtonTrailingComponent = React14__namespace.forwardRef(
|
|
3922
3961
|
(_a, ref) => {
|
|
3923
3962
|
var _b = _a, {
|
|
3924
3963
|
className,
|
|
@@ -3935,6 +3974,8 @@ var SplitButtonTrailingComponent = React11__namespace.forwardRef(
|
|
|
3935
3974
|
onPointerCancel,
|
|
3936
3975
|
onFocus,
|
|
3937
3976
|
onBlur,
|
|
3977
|
+
asChild = false,
|
|
3978
|
+
children,
|
|
3938
3979
|
"aria-label": ariaLabel
|
|
3939
3980
|
} = _b, restProps = __objRest(_b, [
|
|
3940
3981
|
"className",
|
|
@@ -3951,15 +3992,17 @@ var SplitButtonTrailingComponent = React11__namespace.forwardRef(
|
|
|
3951
3992
|
"onPointerCancel",
|
|
3952
3993
|
"onFocus",
|
|
3953
3994
|
"onBlur",
|
|
3995
|
+
"asChild",
|
|
3996
|
+
"children",
|
|
3954
3997
|
"aria-label"
|
|
3955
3998
|
]);
|
|
3956
3999
|
var _a2, _b2;
|
|
3957
4000
|
const context = useSplitButtonContext();
|
|
3958
4001
|
const actualSize = (_a2 = context == null ? void 0 : context.size) != null ? _a2 : size;
|
|
3959
4002
|
const actualVariant = (_b2 = context == null ? void 0 : context.variant) != null ? _b2 : variant;
|
|
3960
|
-
const [isHovered, setIsHovered] =
|
|
3961
|
-
const [isFocused, setIsFocused] =
|
|
3962
|
-
const [isPressed, setIsPressed] =
|
|
4003
|
+
const [isHovered, setIsHovered] = React14__namespace.useState(false);
|
|
4004
|
+
const [isFocused, setIsFocused] = React14__namespace.useState(false);
|
|
4005
|
+
const [isPressed, setIsPressed] = React14__namespace.useState(false);
|
|
3963
4006
|
const tokens = SPLIT_BUTTON_TOKENS[actualSize];
|
|
3964
4007
|
const prefersReducedMotion = react.useReducedMotion();
|
|
3965
4008
|
const needsTouchTarget = actualSize === "xs" || actualSize === "sm";
|
|
@@ -3971,12 +4014,12 @@ var SplitButtonTrailingComponent = React11__namespace.forwardRef(
|
|
|
3971
4014
|
const innerCornerRadius = isPressed || isFocused ? tokens.innerCorner.pressed : isHovered ? tokens.innerCorner.hovered : tokens.innerCorner.default;
|
|
3972
4015
|
const outerRadius = tokens.containerHeight * tokens.outerCornerPercent / 100;
|
|
3973
4016
|
const borderRadius = checked ? `${outerRadius}px ${outerRadius}px ${outerRadius}px ${outerRadius}px` : `${innerCornerRadius}px ${outerRadius}px ${outerRadius}px ${innerCornerRadius}px`;
|
|
3974
|
-
const handleToggle =
|
|
4017
|
+
const handleToggle = React14__namespace.useCallback(() => {
|
|
3975
4018
|
if (!disabled) {
|
|
3976
4019
|
onCheckedChange(!checked);
|
|
3977
4020
|
}
|
|
3978
4021
|
}, [disabled, checked, onCheckedChange]);
|
|
3979
|
-
const handlePointerDown =
|
|
4022
|
+
const handlePointerDown = React14__namespace.useCallback(
|
|
3980
4023
|
(e) => {
|
|
3981
4024
|
onRipplePointerDown(e);
|
|
3982
4025
|
setIsPressed(true);
|
|
@@ -3984,19 +4027,19 @@ var SplitButtonTrailingComponent = React11__namespace.forwardRef(
|
|
|
3984
4027
|
},
|
|
3985
4028
|
[onRipplePointerDown, onPointerDown]
|
|
3986
4029
|
);
|
|
3987
|
-
const handlePointerUp =
|
|
4030
|
+
const handlePointerUp = React14__namespace.useCallback(
|
|
3988
4031
|
(e) => {
|
|
3989
4032
|
setIsPressed(false);
|
|
3990
4033
|
onPointerUp == null ? void 0 : onPointerUp(e);
|
|
3991
4034
|
},
|
|
3992
4035
|
[onPointerUp]
|
|
3993
4036
|
);
|
|
3994
|
-
const handlePointerEnter =
|
|
4037
|
+
const handlePointerEnter = React14__namespace.useCallback(() => {
|
|
3995
4038
|
if (!disabled) {
|
|
3996
4039
|
setIsHovered(true);
|
|
3997
4040
|
}
|
|
3998
4041
|
}, [disabled]);
|
|
3999
|
-
const handlePointerLeave =
|
|
4042
|
+
const handlePointerLeave = React14__namespace.useCallback(
|
|
4000
4043
|
(e) => {
|
|
4001
4044
|
setIsHovered(false);
|
|
4002
4045
|
setIsPressed(false);
|
|
@@ -4004,35 +4047,102 @@ var SplitButtonTrailingComponent = React11__namespace.forwardRef(
|
|
|
4004
4047
|
},
|
|
4005
4048
|
[onPointerLeave]
|
|
4006
4049
|
);
|
|
4007
|
-
const handlePointerCancel =
|
|
4050
|
+
const handlePointerCancel = React14__namespace.useCallback(
|
|
4008
4051
|
(e) => {
|
|
4009
4052
|
setIsPressed(false);
|
|
4010
4053
|
onPointerCancel == null ? void 0 : onPointerCancel(e);
|
|
4011
4054
|
},
|
|
4012
4055
|
[onPointerCancel]
|
|
4013
4056
|
);
|
|
4014
|
-
const handleFocus =
|
|
4057
|
+
const handleFocus = React14__namespace.useCallback(
|
|
4015
4058
|
(e) => {
|
|
4016
4059
|
if (!disabled) setIsFocused(true);
|
|
4017
4060
|
onFocus == null ? void 0 : onFocus(e);
|
|
4018
4061
|
},
|
|
4019
4062
|
[disabled, onFocus]
|
|
4020
4063
|
);
|
|
4021
|
-
const handleBlur =
|
|
4064
|
+
const handleBlur = React14__namespace.useCallback(
|
|
4022
4065
|
(e) => {
|
|
4023
4066
|
setIsFocused(false);
|
|
4024
4067
|
onBlur == null ? void 0 : onBlur(e);
|
|
4025
4068
|
},
|
|
4026
4069
|
[onBlur]
|
|
4027
4070
|
);
|
|
4028
|
-
|
|
4071
|
+
const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4072
|
+
needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
|
|
4073
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4074
|
+
StateLayer,
|
|
4075
|
+
{
|
|
4076
|
+
hovered: isHovered,
|
|
4077
|
+
focused: isFocused,
|
|
4078
|
+
pressed: isPressed
|
|
4079
|
+
}
|
|
4080
|
+
),
|
|
4081
|
+
/* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
4082
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4083
|
+
react.m.div,
|
|
4084
|
+
{
|
|
4085
|
+
animate: {
|
|
4086
|
+
rotate: checked ? 180 : 0,
|
|
4087
|
+
x: checked ? 0 : tokens.opticalCenterOffset
|
|
4088
|
+
},
|
|
4089
|
+
transition: prefersReducedMotion ? { duration: 0 } : SPLIT_BUTTON_CHEVRON_SPRING,
|
|
4090
|
+
className: "flex items-center justify-center shrink-0",
|
|
4091
|
+
children: icon != null ? icon : /* @__PURE__ */ jsxRuntime.jsx(
|
|
4092
|
+
Icon,
|
|
4093
|
+
{
|
|
4094
|
+
name: "arrow_drop_down",
|
|
4095
|
+
size: tokens.trailingIconSize,
|
|
4096
|
+
opticalSize: 24
|
|
4097
|
+
}
|
|
4098
|
+
)
|
|
4099
|
+
}
|
|
4100
|
+
)
|
|
4101
|
+
] });
|
|
4102
|
+
const containerClassName = cn(
|
|
4103
|
+
splitButtonVariants({
|
|
4104
|
+
variant: actualVariant,
|
|
4105
|
+
size: actualSize,
|
|
4106
|
+
disabled
|
|
4107
|
+
}),
|
|
4108
|
+
className
|
|
4109
|
+
);
|
|
4110
|
+
const mergedStyle = __spreadValues({
|
|
4111
|
+
paddingInlineStart: tokens.trailingPadding.start,
|
|
4112
|
+
paddingInlineEnd: tokens.trailingPadding.end,
|
|
4113
|
+
borderRadius
|
|
4114
|
+
}, style);
|
|
4115
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: asChild ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4116
|
+
reactSlot.Slot,
|
|
4117
|
+
__spreadProps(__spreadValues({
|
|
4118
|
+
ref,
|
|
4119
|
+
"aria-label": ariaLabel,
|
|
4120
|
+
"aria-expanded": checked,
|
|
4121
|
+
"aria-disabled": disabled,
|
|
4122
|
+
onClick: handleToggle,
|
|
4123
|
+
onPointerDown: handlePointerDown,
|
|
4124
|
+
onPointerUp: handlePointerUp,
|
|
4125
|
+
onPointerEnter: handlePointerEnter,
|
|
4126
|
+
onPointerLeave: handlePointerLeave,
|
|
4127
|
+
onPointerCancel: handlePointerCancel,
|
|
4128
|
+
onFocus: handleFocus,
|
|
4129
|
+
onBlur: handleBlur,
|
|
4130
|
+
style: mergedStyle,
|
|
4131
|
+
className: containerClassName
|
|
4132
|
+
}, restProps), {
|
|
4133
|
+
children: React14__namespace.cloneElement(
|
|
4134
|
+
React14__namespace.Children.only(children),
|
|
4135
|
+
{ children: innerContent }
|
|
4136
|
+
)
|
|
4137
|
+
})
|
|
4138
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
4029
4139
|
react.m.button,
|
|
4030
4140
|
__spreadProps(__spreadValues({
|
|
4031
4141
|
ref,
|
|
4032
4142
|
type: "button",
|
|
4033
|
-
"aria-pressed": checked,
|
|
4034
|
-
"aria-expanded": checked,
|
|
4035
4143
|
"aria-label": ariaLabel,
|
|
4144
|
+
"aria-expanded": checked,
|
|
4145
|
+
"aria-disabled": disabled,
|
|
4036
4146
|
disabled,
|
|
4037
4147
|
onClick: handleToggle,
|
|
4038
4148
|
onPointerDown: handlePointerDown,
|
|
@@ -4048,61 +4158,24 @@ var SplitButtonTrailingComponent = React11__namespace.forwardRef(
|
|
|
4048
4158
|
paddingInlineStart: tokens.trailingPadding.start,
|
|
4049
4159
|
paddingInlineEnd: tokens.trailingPadding.end
|
|
4050
4160
|
}, style),
|
|
4051
|
-
className:
|
|
4052
|
-
splitButtonVariants({
|
|
4053
|
-
variant: actualVariant,
|
|
4054
|
-
size: actualSize,
|
|
4055
|
-
disabled
|
|
4056
|
-
}),
|
|
4057
|
-
className
|
|
4058
|
-
)
|
|
4161
|
+
className: containerClassName
|
|
4059
4162
|
}, restProps), {
|
|
4060
|
-
children:
|
|
4061
|
-
needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
|
|
4062
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4063
|
-
StateLayer,
|
|
4064
|
-
{
|
|
4065
|
-
hovered: isHovered,
|
|
4066
|
-
focused: isFocused,
|
|
4067
|
-
pressed: isPressed
|
|
4068
|
-
}
|
|
4069
|
-
),
|
|
4070
|
-
/* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
4071
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4072
|
-
react.m.div,
|
|
4073
|
-
{
|
|
4074
|
-
animate: {
|
|
4075
|
-
rotate: checked ? 180 : 0,
|
|
4076
|
-
x: checked ? 0 : tokens.opticalCenterOffset
|
|
4077
|
-
},
|
|
4078
|
-
transition: prefersReducedMotion ? { duration: 0 } : SPLIT_BUTTON_CHEVRON_SPRING,
|
|
4079
|
-
className: "flex items-center justify-center shrink-0",
|
|
4080
|
-
children: icon != null ? icon : /* @__PURE__ */ jsxRuntime.jsx(
|
|
4081
|
-
Icon,
|
|
4082
|
-
{
|
|
4083
|
-
name: "arrow_drop_down",
|
|
4084
|
-
size: tokens.trailingIconSize,
|
|
4085
|
-
opticalSize: 24
|
|
4086
|
-
}
|
|
4087
|
-
)
|
|
4088
|
-
}
|
|
4089
|
-
)
|
|
4090
|
-
]
|
|
4163
|
+
children: innerContent
|
|
4091
4164
|
})
|
|
4092
4165
|
) });
|
|
4093
4166
|
}
|
|
4094
4167
|
);
|
|
4095
4168
|
SplitButtonTrailingComponent.displayName = "SplitButtonTrailing";
|
|
4096
|
-
var SplitButtonTrailing =
|
|
4097
|
-
var FilledSplitButtonTrailing =
|
|
4169
|
+
var SplitButtonTrailing = React14__namespace.memo(SplitButtonTrailingComponent);
|
|
4170
|
+
var FilledSplitButtonTrailing = React14__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "filled" }, props)));
|
|
4098
4171
|
FilledSplitButtonTrailing.displayName = "FilledSplitButtonTrailing";
|
|
4099
|
-
var TonalSplitButtonTrailing =
|
|
4172
|
+
var TonalSplitButtonTrailing = React14__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "tonal" }, props)));
|
|
4100
4173
|
TonalSplitButtonTrailing.displayName = "TonalSplitButtonTrailing";
|
|
4101
|
-
var ElevatedSplitButtonTrailing =
|
|
4174
|
+
var ElevatedSplitButtonTrailing = React14__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "elevated" }, props)));
|
|
4102
4175
|
ElevatedSplitButtonTrailing.displayName = "ElevatedSplitButtonTrailing";
|
|
4103
|
-
var OutlinedSplitButtonTrailing =
|
|
4176
|
+
var OutlinedSplitButtonTrailing = React14__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "outlined" }, props)));
|
|
4104
4177
|
OutlinedSplitButtonTrailing.displayName = "OutlinedSplitButtonTrailing";
|
|
4105
|
-
var SplitButtonTrailingUncheckableComponent =
|
|
4178
|
+
var SplitButtonTrailingUncheckableComponent = React14__namespace.forwardRef(
|
|
4106
4179
|
(_a, ref) => {
|
|
4107
4180
|
var _b = _a, {
|
|
4108
4181
|
className,
|
|
@@ -4139,9 +4212,9 @@ var SplitButtonTrailingUncheckableComponent = React11__namespace.forwardRef(
|
|
|
4139
4212
|
const context = useSplitButtonContext();
|
|
4140
4213
|
const actualSize = (_a2 = context == null ? void 0 : context.size) != null ? _a2 : size;
|
|
4141
4214
|
const actualVariant = (_b2 = context == null ? void 0 : context.variant) != null ? _b2 : variant;
|
|
4142
|
-
const [isHovered, setIsHovered] =
|
|
4143
|
-
const [isFocused, setIsFocused] =
|
|
4144
|
-
const [isPressed, setIsPressed] =
|
|
4215
|
+
const [isHovered, setIsHovered] = React14__namespace.useState(false);
|
|
4216
|
+
const [isFocused, setIsFocused] = React14__namespace.useState(false);
|
|
4217
|
+
const [isPressed, setIsPressed] = React14__namespace.useState(false);
|
|
4145
4218
|
const tokens = SPLIT_BUTTON_TOKENS[actualSize];
|
|
4146
4219
|
const needsTouchTarget = actualSize === "xs" || actualSize === "sm";
|
|
4147
4220
|
const {
|
|
@@ -4152,7 +4225,7 @@ var SplitButtonTrailingUncheckableComponent = React11__namespace.forwardRef(
|
|
|
4152
4225
|
const innerCornerRadius = isPressed || isFocused ? tokens.innerCorner.pressed : isHovered ? tokens.innerCorner.hovered : tokens.innerCorner.default;
|
|
4153
4226
|
const outerRadius = tokens.containerHeight * tokens.outerCornerPercent / 100;
|
|
4154
4227
|
const borderRadius = `${innerCornerRadius}px ${outerRadius}px ${outerRadius}px ${innerCornerRadius}px`;
|
|
4155
|
-
const handlePointerDown =
|
|
4228
|
+
const handlePointerDown = React14__namespace.useCallback(
|
|
4156
4229
|
(e) => {
|
|
4157
4230
|
onRipplePointerDown(e);
|
|
4158
4231
|
setIsPressed(true);
|
|
@@ -4160,19 +4233,19 @@ var SplitButtonTrailingUncheckableComponent = React11__namespace.forwardRef(
|
|
|
4160
4233
|
},
|
|
4161
4234
|
[onRipplePointerDown, onPointerDown]
|
|
4162
4235
|
);
|
|
4163
|
-
const handlePointerUp =
|
|
4236
|
+
const handlePointerUp = React14__namespace.useCallback(
|
|
4164
4237
|
(e) => {
|
|
4165
4238
|
setIsPressed(false);
|
|
4166
4239
|
onPointerUp == null ? void 0 : onPointerUp(e);
|
|
4167
4240
|
},
|
|
4168
4241
|
[onPointerUp]
|
|
4169
4242
|
);
|
|
4170
|
-
const handlePointerEnter =
|
|
4243
|
+
const handlePointerEnter = React14__namespace.useCallback(() => {
|
|
4171
4244
|
if (!disabled) {
|
|
4172
4245
|
setIsHovered(true);
|
|
4173
4246
|
}
|
|
4174
4247
|
}, [disabled]);
|
|
4175
|
-
const handlePointerLeave =
|
|
4248
|
+
const handlePointerLeave = React14__namespace.useCallback(
|
|
4176
4249
|
(e) => {
|
|
4177
4250
|
setIsHovered(false);
|
|
4178
4251
|
setIsPressed(false);
|
|
@@ -4180,21 +4253,21 @@ var SplitButtonTrailingUncheckableComponent = React11__namespace.forwardRef(
|
|
|
4180
4253
|
},
|
|
4181
4254
|
[onPointerLeave]
|
|
4182
4255
|
);
|
|
4183
|
-
const handlePointerCancel =
|
|
4256
|
+
const handlePointerCancel = React14__namespace.useCallback(
|
|
4184
4257
|
(e) => {
|
|
4185
4258
|
setIsPressed(false);
|
|
4186
4259
|
onPointerCancel == null ? void 0 : onPointerCancel(e);
|
|
4187
4260
|
},
|
|
4188
4261
|
[onPointerCancel]
|
|
4189
4262
|
);
|
|
4190
|
-
const handleFocus =
|
|
4263
|
+
const handleFocus = React14__namespace.useCallback(
|
|
4191
4264
|
(e) => {
|
|
4192
4265
|
if (!disabled) setIsFocused(true);
|
|
4193
4266
|
onFocus == null ? void 0 : onFocus(e);
|
|
4194
4267
|
},
|
|
4195
4268
|
[disabled, onFocus]
|
|
4196
4269
|
);
|
|
4197
|
-
const handleBlur =
|
|
4270
|
+
const handleBlur = React14__namespace.useCallback(
|
|
4198
4271
|
(e) => {
|
|
4199
4272
|
setIsFocused(false);
|
|
4200
4273
|
onBlur == null ? void 0 : onBlur(e);
|
|
@@ -4261,16 +4334,16 @@ var SplitButtonTrailingUncheckableComponent = React11__namespace.forwardRef(
|
|
|
4261
4334
|
}
|
|
4262
4335
|
);
|
|
4263
4336
|
SplitButtonTrailingUncheckableComponent.displayName = "SplitButtonTrailingUncheckable";
|
|
4264
|
-
var SplitButtonTrailingUncheckable =
|
|
4337
|
+
var SplitButtonTrailingUncheckable = React14__namespace.memo(
|
|
4265
4338
|
SplitButtonTrailingUncheckableComponent
|
|
4266
4339
|
);
|
|
4267
|
-
var FilledSplitButtonTrailingUncheckable =
|
|
4340
|
+
var FilledSplitButtonTrailingUncheckable = React14__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "filled" }, props)));
|
|
4268
4341
|
FilledSplitButtonTrailingUncheckable.displayName = "FilledSplitButtonTrailingUncheckable";
|
|
4269
|
-
var TonalSplitButtonTrailingUncheckable =
|
|
4342
|
+
var TonalSplitButtonTrailingUncheckable = React14__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "tonal" }, props)));
|
|
4270
4343
|
TonalSplitButtonTrailingUncheckable.displayName = "TonalSplitButtonTrailingUncheckable";
|
|
4271
|
-
var ElevatedSplitButtonTrailingUncheckable =
|
|
4344
|
+
var ElevatedSplitButtonTrailingUncheckable = React14__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "elevated" }, props)));
|
|
4272
4345
|
ElevatedSplitButtonTrailingUncheckable.displayName = "ElevatedSplitButtonTrailingUncheckable";
|
|
4273
|
-
var OutlinedSplitButtonTrailingUncheckable =
|
|
4346
|
+
var OutlinedSplitButtonTrailingUncheckable = React14__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "outlined" }, props)));
|
|
4274
4347
|
OutlinedSplitButtonTrailingUncheckable.displayName = "OutlinedSplitButtonTrailingUncheckable";
|
|
4275
4348
|
|
|
4276
4349
|
exports.BUTTON_COLOR_TOKENS = BUTTON_COLOR_TOKENS;
|