@bug-on/m3-expressive 1.1.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 +18 -0
- package/dist/buttons.d.mts +3 -3
- package/dist/buttons.d.ts +3 -3
- package/dist/buttons.js +708 -606
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +707 -605
- package/dist/buttons.mjs.map +1 -1
- package/dist/core-Bc5Wj_pc.d.ts +497 -0
- package/dist/core-D4048_K5.d.mts +497 -0
- package/dist/core.d.mts +6 -422
- package/dist/core.d.ts +6 -422
- package/dist/core.js +223 -129
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +224 -130
- 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.css +6 -1
- package/dist/index.d.mts +68 -6
- package/dist/index.d.ts +68 -6
- package/dist/index.js +1177 -580
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1172 -583
- 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 +94 -8
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +94 -8
- package/dist/layout.mjs.map +1 -1
- package/dist/{md3-DFhj-NZj.d.mts → md3-Dty-Qcad.d.mts} +7 -1
- package/dist/{md3-DFhj-NZj.d.ts → md3-Dty-Qcad.d.ts} +7 -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-BRPuTqi1.d.mts → split-button-trailing-uncheckable-BcPD_7uK.d.ts} +73 -7
- package/dist/{split-button-trailing-uncheckable-CjOFCoyW.d.ts → split-button-trailing-uncheckable-DtFJkTFr.d.mts} +73 -7
- 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 +4 -4
package/dist/overlays.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
3
3
|
import { m, LazyMotion, domMax, useMotionValue, animate, useAnimationFrame, AnimatePresence, useReducedMotion, useTransform } from 'motion/react';
|
|
4
|
-
import * as
|
|
4
|
+
import * as React9 from 'react';
|
|
5
5
|
import { useState, useRef, useCallback, useMemo, useEffect, useLayoutEffect } from 'react';
|
|
6
6
|
import { clsx } from 'clsx';
|
|
7
7
|
import { twMerge } from 'tailwind-merge';
|
|
8
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
8
9
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
10
|
import * as RadixScrollArea from '@radix-ui/react-scroll-area';
|
|
10
11
|
import { createPortal } from 'react-dom';
|
|
@@ -88,11 +89,11 @@ var ROTATE_KEY_SPLINES = [
|
|
|
88
89
|
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";
|
|
89
90
|
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";
|
|
90
91
|
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";
|
|
91
|
-
var IndeterminateSvg =
|
|
92
|
+
var IndeterminateSvg = React9.memo(function IndeterminateSvg2({
|
|
92
93
|
size
|
|
93
94
|
}) {
|
|
94
|
-
const [ready, setReady] =
|
|
95
|
-
|
|
95
|
+
const [ready, setReady] = React9.useState(false);
|
|
96
|
+
React9.useEffect(() => {
|
|
96
97
|
const raf = requestAnimationFrame(() => setReady(true));
|
|
97
98
|
return () => cancelAnimationFrame(raf);
|
|
98
99
|
}, []);
|
|
@@ -137,7 +138,7 @@ var IndeterminateSvg = React6.memo(function IndeterminateSvg2({
|
|
|
137
138
|
}
|
|
138
139
|
);
|
|
139
140
|
});
|
|
140
|
-
var DeterminateSvg =
|
|
141
|
+
var DeterminateSvg = React9.memo(function DeterminateSvg2({
|
|
141
142
|
size,
|
|
142
143
|
progress
|
|
143
144
|
}) {
|
|
@@ -162,7 +163,7 @@ var DeterminateSvg = React6.memo(function DeterminateSvg2({
|
|
|
162
163
|
}
|
|
163
164
|
);
|
|
164
165
|
});
|
|
165
|
-
var LoadingIndicator =
|
|
166
|
+
var LoadingIndicator = React9.forwardRef(
|
|
166
167
|
(_a, ref) => {
|
|
167
168
|
var _b = _a, {
|
|
168
169
|
variant = "uncontained",
|
|
@@ -277,7 +278,7 @@ function getSinePath(startX, endX, phase, wl, amp) {
|
|
|
277
278
|
d += ` L ${endX.toFixed(2)} ${yEnd.toFixed(2)}`;
|
|
278
279
|
return d;
|
|
279
280
|
}
|
|
280
|
-
var CircularProgress =
|
|
281
|
+
var CircularProgress = React9.forwardRef(
|
|
281
282
|
(_a, ref) => {
|
|
282
283
|
var _b = _a, {
|
|
283
284
|
value,
|
|
@@ -315,15 +316,15 @@ var CircularProgress = React6.forwardRef(
|
|
|
315
316
|
const isWavy = shape === "wavy";
|
|
316
317
|
const BASELINE_SIZE = 48;
|
|
317
318
|
const scaleFactor = size / BASELINE_SIZE;
|
|
318
|
-
const effectiveAmplitude =
|
|
319
|
+
const effectiveAmplitude = React9.useMemo(
|
|
319
320
|
() => amplitude != null ? amplitude : 1.6 * scaleFactor,
|
|
320
321
|
[amplitude, scaleFactor]
|
|
321
322
|
);
|
|
322
|
-
const effectiveWavelength =
|
|
323
|
+
const effectiveWavelength = React9.useMemo(
|
|
323
324
|
() => wavelength != null ? wavelength : 15 * scaleFactor,
|
|
324
325
|
[wavelength, scaleFactor]
|
|
325
326
|
);
|
|
326
|
-
const wavyActivePath =
|
|
327
|
+
const wavyActivePath = React9.useMemo(
|
|
327
328
|
() => isWavy ? generateWavyCircularPath(
|
|
328
329
|
center,
|
|
329
330
|
radius,
|
|
@@ -332,8 +333,8 @@ var CircularProgress = React6.forwardRef(
|
|
|
332
333
|
) : null,
|
|
333
334
|
[isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
|
|
334
335
|
);
|
|
335
|
-
const circumference =
|
|
336
|
-
const gapForTrack =
|
|
336
|
+
const circumference = React9.useMemo(() => 2 * Math.PI * radius, [radius]);
|
|
337
|
+
const gapForTrack = React9.useMemo(
|
|
337
338
|
() => (gapSize + trackHeight) / circumference,
|
|
338
339
|
[gapSize, trackHeight, circumference]
|
|
339
340
|
);
|
|
@@ -522,9 +523,9 @@ var CircularProgress = React6.forwardRef(
|
|
|
522
523
|
);
|
|
523
524
|
CircularProgress.displayName = "CircularProgress";
|
|
524
525
|
function useContainerWidth() {
|
|
525
|
-
const [width, setWidth] =
|
|
526
|
-
const observerRef =
|
|
527
|
-
const ref =
|
|
526
|
+
const [width, setWidth] = React9.useState(0);
|
|
527
|
+
const observerRef = React9.useRef(null);
|
|
528
|
+
const ref = React9.useCallback((node) => {
|
|
528
529
|
if (observerRef.current) {
|
|
529
530
|
observerRef.current.disconnect();
|
|
530
531
|
observerRef.current = null;
|
|
@@ -538,7 +539,7 @@ function useContainerWidth() {
|
|
|
538
539
|
observerRef.current = obs;
|
|
539
540
|
}
|
|
540
541
|
}, []);
|
|
541
|
-
|
|
542
|
+
React9.useEffect(() => {
|
|
542
543
|
return () => {
|
|
543
544
|
if (observerRef.current) {
|
|
544
545
|
observerRef.current.disconnect();
|
|
@@ -548,7 +549,7 @@ function useContainerWidth() {
|
|
|
548
549
|
return [ref, width];
|
|
549
550
|
}
|
|
550
551
|
function useMergedRef(...refs) {
|
|
551
|
-
return
|
|
552
|
+
return React9.useCallback(
|
|
552
553
|
(node) => {
|
|
553
554
|
for (const ref of refs) {
|
|
554
555
|
if (typeof ref === "function") {
|
|
@@ -562,7 +563,7 @@ function useMergedRef(...refs) {
|
|
|
562
563
|
[refs]
|
|
563
564
|
);
|
|
564
565
|
}
|
|
565
|
-
var FlatLinearTrack =
|
|
566
|
+
var FlatLinearTrack = React9.memo(function FlatLinearTrack2({
|
|
566
567
|
trackHeight,
|
|
567
568
|
activeColor,
|
|
568
569
|
trackColor,
|
|
@@ -638,7 +639,7 @@ var FlatLinearTrack = React6.memo(function FlatLinearTrack2({
|
|
|
638
639
|
}
|
|
639
640
|
);
|
|
640
641
|
});
|
|
641
|
-
var WavyLinearTrack =
|
|
642
|
+
var WavyLinearTrack = React9.memo(function WavyLinearTrack2({
|
|
642
643
|
trackHeight,
|
|
643
644
|
svgHeight,
|
|
644
645
|
amplitude,
|
|
@@ -657,13 +658,13 @@ var WavyLinearTrack = React6.memo(function WavyLinearTrack2({
|
|
|
657
658
|
}) {
|
|
658
659
|
const isDeterminate = typeof value === "number";
|
|
659
660
|
const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
|
|
660
|
-
const titleId =
|
|
661
|
+
const titleId = React9.useId();
|
|
661
662
|
const [containerRef, width] = useContainerWidth();
|
|
662
|
-
const activePathRef =
|
|
663
|
-
const trackPathRef =
|
|
663
|
+
const activePathRef = React9.useRef(null);
|
|
664
|
+
const trackPathRef = React9.useRef(null);
|
|
664
665
|
const amplitudeMV = useMotionValue(amplitude);
|
|
665
666
|
const fractionMV = useMotionValue(isDeterminate ? clampedValue / 100 : 1);
|
|
666
|
-
|
|
667
|
+
React9.useEffect(() => {
|
|
667
668
|
if (isDeterminate) {
|
|
668
669
|
const fraction = clampedValue / 100;
|
|
669
670
|
let targetAmp = amplitude;
|
|
@@ -834,7 +835,7 @@ var WavyLinearTrack = React6.memo(function WavyLinearTrack2({
|
|
|
834
835
|
}
|
|
835
836
|
);
|
|
836
837
|
});
|
|
837
|
-
var LinearProgress =
|
|
838
|
+
var LinearProgress = React9.forwardRef(
|
|
838
839
|
(_a, ref) => {
|
|
839
840
|
var _b = _a, {
|
|
840
841
|
value,
|
|
@@ -875,10 +876,10 @@ var LinearProgress = React6.forwardRef(
|
|
|
875
876
|
]);
|
|
876
877
|
const isDeterminate = value !== void 0;
|
|
877
878
|
const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
|
|
878
|
-
const containerRef =
|
|
879
|
+
const containerRef = React9.useRef(null);
|
|
879
880
|
const mergedRef = useMergedRef(ref, containerRef);
|
|
880
|
-
const [isRtl, setIsRtl] =
|
|
881
|
-
|
|
881
|
+
const [isRtl, setIsRtl] = React9.useState(false);
|
|
882
|
+
React9.useEffect(() => {
|
|
882
883
|
if (containerRef.current) {
|
|
883
884
|
const dir = getComputedStyle(containerRef.current).direction;
|
|
884
885
|
setIsRtl(dir === "rtl");
|
|
@@ -886,16 +887,16 @@ var LinearProgress = React6.forwardRef(
|
|
|
886
887
|
}, []);
|
|
887
888
|
const isWavy = shape === "wavy";
|
|
888
889
|
const resolvedTrackShape = trackShape != null ? trackShape : shape;
|
|
889
|
-
const effectiveAmplitude =
|
|
890
|
-
const svgHeight =
|
|
890
|
+
const effectiveAmplitude = React9.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
|
|
891
|
+
const svgHeight = React9.useMemo(
|
|
891
892
|
() => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
|
|
892
893
|
[isWavy, trackHeight, effectiveAmplitude]
|
|
893
894
|
);
|
|
894
|
-
const shouldShowStop =
|
|
895
|
+
const shouldShowStop = React9.useMemo(
|
|
895
896
|
() => isDeterminate && resolvedTrackShape === "flat" && (showStopIndicator === true || showStopIndicator === "auto" && isDeterminate),
|
|
896
897
|
[isDeterminate, resolvedTrackShape, showStopIndicator]
|
|
897
898
|
);
|
|
898
|
-
const stopSize =
|
|
899
|
+
const stopSize = React9.useMemo(
|
|
899
900
|
() => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
|
|
900
901
|
[trackHeight]
|
|
901
902
|
);
|
|
@@ -968,14 +969,14 @@ var LinearProgress = React6.forwardRef(
|
|
|
968
969
|
}
|
|
969
970
|
);
|
|
970
971
|
LinearProgress.displayName = "LinearProgress";
|
|
971
|
-
var ProgressIndicator =
|
|
972
|
+
var ProgressIndicator = React9.forwardRef((props, ref) => {
|
|
972
973
|
if (props.variant === "circular") {
|
|
973
974
|
return /* @__PURE__ */ jsx(CircularProgress, __spreadValues({ ref }, props));
|
|
974
975
|
}
|
|
975
976
|
return /* @__PURE__ */ jsx(LinearProgress, __spreadValues({ ref }, props));
|
|
976
977
|
});
|
|
977
978
|
ProgressIndicator.displayName = "ProgressIndicator";
|
|
978
|
-
var RippleItem =
|
|
979
|
+
var RippleItem = React9.memo(function RippleItem2({
|
|
979
980
|
ripple,
|
|
980
981
|
onDone
|
|
981
982
|
}) {
|
|
@@ -1019,8 +1020,8 @@ function Ripple({
|
|
|
1019
1020
|
}
|
|
1020
1021
|
function useRippleState(options = {}) {
|
|
1021
1022
|
const { disabled = false } = options;
|
|
1022
|
-
const [ripples, setRipples] =
|
|
1023
|
-
const onPointerDown =
|
|
1023
|
+
const [ripples, setRipples] = React9.useState([]);
|
|
1024
|
+
const onPointerDown = React9.useCallback(
|
|
1024
1025
|
(e) => {
|
|
1025
1026
|
if (disabled) return;
|
|
1026
1027
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -1034,7 +1035,7 @@ function useRippleState(options = {}) {
|
|
|
1034
1035
|
},
|
|
1035
1036
|
[disabled]
|
|
1036
1037
|
);
|
|
1037
|
-
const removeRipple =
|
|
1038
|
+
const removeRipple = React9.useCallback((id) => {
|
|
1038
1039
|
setRipples((prev) => prev.filter((r) => r.id !== id));
|
|
1039
1040
|
}, []);
|
|
1040
1041
|
return { ripples, onPointerDown, removeRipple };
|
|
@@ -1242,7 +1243,7 @@ function resolveDisabledBgClass(colorStyle) {
|
|
|
1242
1243
|
}
|
|
1243
1244
|
return "disabled:text-m3-on-surface/[0.38]";
|
|
1244
1245
|
}
|
|
1245
|
-
var IconButtonComponent =
|
|
1246
|
+
var IconButtonComponent = React9.forwardRef(
|
|
1246
1247
|
(_a, ref) => {
|
|
1247
1248
|
var _b = _a, {
|
|
1248
1249
|
className,
|
|
@@ -1255,6 +1256,7 @@ var IconButtonComponent = React6.forwardRef(
|
|
|
1255
1256
|
loading = false,
|
|
1256
1257
|
loadingVariant = "loading-indicator",
|
|
1257
1258
|
iconSize,
|
|
1259
|
+
asChild = false,
|
|
1258
1260
|
children,
|
|
1259
1261
|
onClick,
|
|
1260
1262
|
onKeyDown,
|
|
@@ -1270,6 +1272,7 @@ var IconButtonComponent = React6.forwardRef(
|
|
|
1270
1272
|
"loading",
|
|
1271
1273
|
"loadingVariant",
|
|
1272
1274
|
"iconSize",
|
|
1275
|
+
"asChild",
|
|
1273
1276
|
"children",
|
|
1274
1277
|
"onClick",
|
|
1275
1278
|
"onKeyDown",
|
|
@@ -1278,18 +1281,18 @@ var IconButtonComponent = React6.forwardRef(
|
|
|
1278
1281
|
var _a2, _b2;
|
|
1279
1282
|
const isToggle = variant === "toggle";
|
|
1280
1283
|
const isSelected = isToggle && !!selected;
|
|
1281
|
-
const resolvedColorClass =
|
|
1284
|
+
const resolvedColorClass = React9.useMemo(
|
|
1282
1285
|
() => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
|
|
1283
1286
|
[isSelected, colorStyle]
|
|
1284
1287
|
);
|
|
1285
|
-
const outlineWidthClass =
|
|
1288
|
+
const outlineWidthClass = React9.useMemo(
|
|
1286
1289
|
() => {
|
|
1287
1290
|
var _a3;
|
|
1288
1291
|
return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
|
|
1289
1292
|
},
|
|
1290
1293
|
[colorStyle, isSelected, size]
|
|
1291
1294
|
);
|
|
1292
|
-
const disabledBgClass =
|
|
1295
|
+
const disabledBgClass = React9.useMemo(
|
|
1293
1296
|
() => resolveDisabledBgClass(colorStyle),
|
|
1294
1297
|
[colorStyle]
|
|
1295
1298
|
);
|
|
@@ -1310,7 +1313,7 @@ var IconButtonComponent = React6.forwardRef(
|
|
|
1310
1313
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
1311
1314
|
disabled: loading
|
|
1312
1315
|
});
|
|
1313
|
-
const handleClick =
|
|
1316
|
+
const handleClick = React9.useCallback(
|
|
1314
1317
|
(e) => {
|
|
1315
1318
|
if (loading) {
|
|
1316
1319
|
e.preventDefault();
|
|
@@ -1320,7 +1323,7 @@ var IconButtonComponent = React6.forwardRef(
|
|
|
1320
1323
|
},
|
|
1321
1324
|
[loading, onClick]
|
|
1322
1325
|
);
|
|
1323
|
-
const handleKeyDown =
|
|
1326
|
+
const handleKeyDown = React9.useCallback(
|
|
1324
1327
|
(e) => {
|
|
1325
1328
|
if (loading) return;
|
|
1326
1329
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -1331,7 +1334,87 @@ var IconButtonComponent = React6.forwardRef(
|
|
|
1331
1334
|
},
|
|
1332
1335
|
[loading, onClick, onKeyDown]
|
|
1333
1336
|
);
|
|
1334
|
-
|
|
1337
|
+
const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1338
|
+
needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
|
|
1339
|
+
/* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
1340
|
+
/* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsx(
|
|
1341
|
+
m.span,
|
|
1342
|
+
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
1343
|
+
transition: SPRING_TRANSITION,
|
|
1344
|
+
className: cn(
|
|
1345
|
+
"flex items-center justify-center shrink-0",
|
|
1346
|
+
iconSize != null ? void 0 : iconClass
|
|
1347
|
+
),
|
|
1348
|
+
style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
|
|
1349
|
+
children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsx(
|
|
1350
|
+
LoadingIndicator,
|
|
1351
|
+
{
|
|
1352
|
+
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
1353
|
+
color: "currentColor",
|
|
1354
|
+
"aria-label": "Loading"
|
|
1355
|
+
}
|
|
1356
|
+
) : /* @__PURE__ */ jsx(
|
|
1357
|
+
ProgressIndicator,
|
|
1358
|
+
{
|
|
1359
|
+
variant: "circular",
|
|
1360
|
+
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
1361
|
+
color: "currentColor",
|
|
1362
|
+
trackColor: "transparent",
|
|
1363
|
+
"aria-label": "Loading"
|
|
1364
|
+
}
|
|
1365
|
+
)
|
|
1366
|
+
}),
|
|
1367
|
+
"loading"
|
|
1368
|
+
) : /* @__PURE__ */ jsx(
|
|
1369
|
+
m.span,
|
|
1370
|
+
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
1371
|
+
transition: SPRING_TRANSITION,
|
|
1372
|
+
"aria-hidden": "true",
|
|
1373
|
+
className: cn(
|
|
1374
|
+
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
|
|
1375
|
+
iconSize != null ? void 0 : iconClass
|
|
1376
|
+
),
|
|
1377
|
+
style: {
|
|
1378
|
+
fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
|
|
1379
|
+
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
1380
|
+
height: isCustomSize ? `${iconSize}px` : void 0
|
|
1381
|
+
},
|
|
1382
|
+
children: asChild ? React9.Children.only(children).props.children : children
|
|
1383
|
+
}),
|
|
1384
|
+
"content"
|
|
1385
|
+
) })
|
|
1386
|
+
] });
|
|
1387
|
+
const containerClassName = cn(
|
|
1388
|
+
baseIconButtonClasses,
|
|
1389
|
+
resolvedColorClass,
|
|
1390
|
+
outlineWidthClass,
|
|
1391
|
+
disabledBgClass,
|
|
1392
|
+
"overflow-hidden",
|
|
1393
|
+
SIZE_STYLES[size],
|
|
1394
|
+
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
1395
|
+
className
|
|
1396
|
+
);
|
|
1397
|
+
if (asChild) {
|
|
1398
|
+
const child = React9.Children.only(children);
|
|
1399
|
+
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
|
|
1400
|
+
Slot,
|
|
1401
|
+
__spreadProps(__spreadValues({
|
|
1402
|
+
ref,
|
|
1403
|
+
"aria-pressed": isToggle ? isSelected : void 0,
|
|
1404
|
+
"aria-label": ariaLabel,
|
|
1405
|
+
"aria-busy": loading || void 0,
|
|
1406
|
+
"aria-disabled": loading || restProps.disabled,
|
|
1407
|
+
onClick: handleClick,
|
|
1408
|
+
onPointerDown,
|
|
1409
|
+
onKeyDown: handleKeyDown,
|
|
1410
|
+
style: __spreadProps(__spreadValues({}, style), { borderRadius: `${animateRadius}px` }),
|
|
1411
|
+
className: containerClassName
|
|
1412
|
+
}, restProps), {
|
|
1413
|
+
children: React9.cloneElement(child, { children: innerContent })
|
|
1414
|
+
})
|
|
1415
|
+
) });
|
|
1416
|
+
}
|
|
1417
|
+
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
|
|
1335
1418
|
m.button,
|
|
1336
1419
|
__spreadProps(__spreadValues({
|
|
1337
1420
|
ref,
|
|
@@ -1347,79 +1430,21 @@ var IconButtonComponent = React6.forwardRef(
|
|
|
1347
1430
|
animate: { borderRadius: animateRadius },
|
|
1348
1431
|
whileTap: { borderRadius: pressedRadius },
|
|
1349
1432
|
transition: { borderRadius: SPRING_TRANSITION_FAST },
|
|
1350
|
-
className:
|
|
1351
|
-
baseIconButtonClasses,
|
|
1352
|
-
resolvedColorClass,
|
|
1353
|
-
outlineWidthClass,
|
|
1354
|
-
disabledBgClass,
|
|
1355
|
-
"overflow-hidden",
|
|
1356
|
-
SIZE_STYLES[size],
|
|
1357
|
-
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
1358
|
-
className
|
|
1359
|
-
)
|
|
1433
|
+
className: containerClassName
|
|
1360
1434
|
}, restProps), {
|
|
1361
|
-
children:
|
|
1362
|
-
needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
|
|
1363
|
-
/* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
1364
|
-
/* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsx(
|
|
1365
|
-
m.span,
|
|
1366
|
-
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
1367
|
-
transition: SPRING_TRANSITION,
|
|
1368
|
-
className: cn(
|
|
1369
|
-
"flex items-center justify-center shrink-0",
|
|
1370
|
-
iconSize != null ? void 0 : iconClass
|
|
1371
|
-
),
|
|
1372
|
-
style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
|
|
1373
|
-
children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsx(
|
|
1374
|
-
LoadingIndicator,
|
|
1375
|
-
{
|
|
1376
|
-
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
1377
|
-
color: "currentColor",
|
|
1378
|
-
"aria-label": "Loading"
|
|
1379
|
-
}
|
|
1380
|
-
) : /* @__PURE__ */ jsx(
|
|
1381
|
-
ProgressIndicator,
|
|
1382
|
-
{
|
|
1383
|
-
variant: "circular",
|
|
1384
|
-
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
1385
|
-
color: "currentColor",
|
|
1386
|
-
trackColor: "transparent",
|
|
1387
|
-
"aria-label": "Loading"
|
|
1388
|
-
}
|
|
1389
|
-
)
|
|
1390
|
-
}),
|
|
1391
|
-
"loading"
|
|
1392
|
-
) : /* @__PURE__ */ jsx(
|
|
1393
|
-
m.span,
|
|
1394
|
-
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
1395
|
-
transition: SPRING_TRANSITION,
|
|
1396
|
-
"aria-hidden": "true",
|
|
1397
|
-
className: cn(
|
|
1398
|
-
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
|
|
1399
|
-
iconSize != null ? void 0 : iconClass
|
|
1400
|
-
),
|
|
1401
|
-
style: {
|
|
1402
|
-
fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
|
|
1403
|
-
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
1404
|
-
height: isCustomSize ? `${iconSize}px` : void 0
|
|
1405
|
-
},
|
|
1406
|
-
children
|
|
1407
|
-
}),
|
|
1408
|
-
"content"
|
|
1409
|
-
) })
|
|
1410
|
-
]
|
|
1435
|
+
children: innerContent
|
|
1411
1436
|
})
|
|
1412
1437
|
) });
|
|
1413
1438
|
}
|
|
1414
1439
|
);
|
|
1415
1440
|
IconButtonComponent.displayName = "IconButton";
|
|
1416
|
-
var IconButton =
|
|
1441
|
+
var IconButton = React9.memo(IconButtonComponent);
|
|
1417
1442
|
var VARIANT_FONT = {
|
|
1418
1443
|
outlined: "'Material Symbols Outlined'",
|
|
1419
1444
|
rounded: "'Material Symbols Rounded'",
|
|
1420
1445
|
sharp: "'Material Symbols Sharp'"
|
|
1421
1446
|
};
|
|
1422
|
-
var IconComponent =
|
|
1447
|
+
var IconComponent = React9.forwardRef(
|
|
1423
1448
|
(_a, ref) => {
|
|
1424
1449
|
var _b = _a, {
|
|
1425
1450
|
name,
|
|
@@ -1485,8 +1510,8 @@ var IconComponent = React6.forwardRef(
|
|
|
1485
1510
|
}
|
|
1486
1511
|
);
|
|
1487
1512
|
IconComponent.displayName = "Icon";
|
|
1488
|
-
var Icon =
|
|
1489
|
-
var ScrollArea =
|
|
1513
|
+
var Icon = React9.memo(IconComponent);
|
|
1514
|
+
var ScrollArea = React9.forwardRef(
|
|
1490
1515
|
(_a, ref) => {
|
|
1491
1516
|
var _b = _a, {
|
|
1492
1517
|
className,
|
|
@@ -1507,15 +1532,15 @@ var ScrollArea = React6.forwardRef(
|
|
|
1507
1532
|
"viewportRef",
|
|
1508
1533
|
"viewportProps"
|
|
1509
1534
|
]);
|
|
1510
|
-
const [isTouchDevice, setIsTouchDevice] =
|
|
1511
|
-
|
|
1535
|
+
const [isTouchDevice, setIsTouchDevice] = React9.useState(false);
|
|
1536
|
+
React9.useEffect(() => {
|
|
1512
1537
|
if (typeof window !== "undefined") {
|
|
1513
1538
|
setIsTouchDevice(
|
|
1514
1539
|
"ontouchstart" in window || navigator.maxTouchPoints > 0
|
|
1515
1540
|
);
|
|
1516
1541
|
}
|
|
1517
1542
|
}, []);
|
|
1518
|
-
const resolvedType =
|
|
1543
|
+
const resolvedType = React9.useMemo(() => {
|
|
1519
1544
|
if (type === "hover" && isTouchDevice) {
|
|
1520
1545
|
return "scroll";
|
|
1521
1546
|
}
|
|
@@ -1566,7 +1591,7 @@ var ScrollArea = React6.forwardRef(
|
|
|
1566
1591
|
}
|
|
1567
1592
|
);
|
|
1568
1593
|
ScrollArea.displayName = "ScrollArea";
|
|
1569
|
-
var ScrollAreaScrollbar =
|
|
1594
|
+
var ScrollAreaScrollbar = React9.forwardRef((_a, ref) => {
|
|
1570
1595
|
var _b = _a, { className, orientation = "vertical" } = _b, props = __objRest(_b, ["className", "orientation"]);
|
|
1571
1596
|
return /* @__PURE__ */ jsx(
|
|
1572
1597
|
RadixScrollArea.Scrollbar,
|
|
@@ -1596,7 +1621,7 @@ var ScrollAreaScrollbar = React6.forwardRef((_a, ref) => {
|
|
|
1596
1621
|
);
|
|
1597
1622
|
});
|
|
1598
1623
|
ScrollAreaScrollbar.displayName = RadixScrollArea.Scrollbar.displayName;
|
|
1599
|
-
var ScrollAreaCorner =
|
|
1624
|
+
var ScrollAreaCorner = React9.forwardRef((_a, ref) => {
|
|
1600
1625
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1601
1626
|
return /* @__PURE__ */ jsx(
|
|
1602
1627
|
RadixScrollArea.Corner,
|
|
@@ -1638,9 +1663,9 @@ DialogTrigger.displayName = "DialogTrigger";
|
|
|
1638
1663
|
var DialogPortal = ({
|
|
1639
1664
|
open,
|
|
1640
1665
|
children
|
|
1641
|
-
}) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { children: open ?
|
|
1666
|
+
}) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { children: open ? React9.Children.toArray(children) : null }) });
|
|
1642
1667
|
DialogPortal.displayName = "DialogPortal";
|
|
1643
|
-
var DialogOverlay =
|
|
1668
|
+
var DialogOverlay = React9.forwardRef((_a, ref) => {
|
|
1644
1669
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1645
1670
|
return /* @__PURE__ */ jsx(RadixDialog.Overlay, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children: /* @__PURE__ */ jsx(
|
|
1646
1671
|
m.div,
|
|
@@ -1651,7 +1676,7 @@ var DialogOverlay = React6.forwardRef((_a, ref) => {
|
|
|
1651
1676
|
) }));
|
|
1652
1677
|
});
|
|
1653
1678
|
DialogOverlay.displayName = "DialogOverlay";
|
|
1654
|
-
var DialogContent =
|
|
1679
|
+
var DialogContent = React9.forwardRef((_a, ref) => {
|
|
1655
1680
|
var _b = _a, { className, children, hideCloseButton = false } = _b, props = __objRest(_b, ["className", "children", "hideCloseButton"]);
|
|
1656
1681
|
return /* @__PURE__ */ jsx(
|
|
1657
1682
|
RadixDialog.Content,
|
|
@@ -1691,7 +1716,7 @@ var DialogContent = React6.forwardRef((_a, ref) => {
|
|
|
1691
1716
|
);
|
|
1692
1717
|
});
|
|
1693
1718
|
DialogContent.displayName = "DialogContent";
|
|
1694
|
-
var DialogIcon =
|
|
1719
|
+
var DialogIcon = React9.forwardRef((_a, ref) => {
|
|
1695
1720
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
1696
1721
|
return /* @__PURE__ */ jsx(
|
|
1697
1722
|
"div",
|
|
@@ -1714,7 +1739,7 @@ var DialogHeader = (_a) => {
|
|
|
1714
1739
|
return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("flex flex-col gap-2 mb-4", className) }, props));
|
|
1715
1740
|
};
|
|
1716
1741
|
DialogHeader.displayName = "DialogHeader";
|
|
1717
|
-
var DialogTitle =
|
|
1742
|
+
var DialogTitle = React9.forwardRef((_a, ref) => {
|
|
1718
1743
|
var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
1719
1744
|
return /* @__PURE__ */ jsx(
|
|
1720
1745
|
RadixDialog.Title,
|
|
@@ -1729,7 +1754,7 @@ var DialogTitle = React6.forwardRef((_a, ref) => {
|
|
|
1729
1754
|
);
|
|
1730
1755
|
});
|
|
1731
1756
|
DialogTitle.displayName = "DialogTitle";
|
|
1732
|
-
var DialogDescription =
|
|
1757
|
+
var DialogDescription = React9.forwardRef((_a, ref) => {
|
|
1733
1758
|
var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
1734
1759
|
return /* @__PURE__ */ jsx(
|
|
1735
1760
|
RadixDialog.Description,
|
|
@@ -1741,7 +1766,7 @@ var DialogDescription = React6.forwardRef((_a, ref) => {
|
|
|
1741
1766
|
);
|
|
1742
1767
|
});
|
|
1743
1768
|
DialogDescription.displayName = "DialogDescription";
|
|
1744
|
-
var DialogBody =
|
|
1769
|
+
var DialogBody = React9.forwardRef((_a, ref) => {
|
|
1745
1770
|
var _b = _a, { className, children, dir } = _b, props = __objRest(_b, ["className", "children", "dir"]);
|
|
1746
1771
|
return /* @__PURE__ */ jsx(
|
|
1747
1772
|
ScrollArea,
|
|
@@ -1772,7 +1797,7 @@ var DialogFooter = (_a) => {
|
|
|
1772
1797
|
};
|
|
1773
1798
|
DialogFooter.displayName = "DialogFooter";
|
|
1774
1799
|
var DialogClose = RadixDialog.Close;
|
|
1775
|
-
var DialogFullScreenContent =
|
|
1800
|
+
var DialogFullScreenContent = React9.forwardRef(
|
|
1776
1801
|
(_a, ref) => {
|
|
1777
1802
|
var _b = _a, {
|
|
1778
1803
|
className,
|
|
@@ -1869,7 +1894,7 @@ var DrawerPortal = ({
|
|
|
1869
1894
|
open,
|
|
1870
1895
|
children
|
|
1871
1896
|
}) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: open && children }) });
|
|
1872
|
-
var DrawerOverlay =
|
|
1897
|
+
var DrawerOverlay = React9.forwardRef((_a, ref) => {
|
|
1873
1898
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1874
1899
|
return /* @__PURE__ */ jsx(RadixDialog.Overlay, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children: /* @__PURE__ */ jsx(
|
|
1875
1900
|
m.div,
|
|
@@ -1880,7 +1905,7 @@ var DrawerOverlay = React6.forwardRef((_a, ref) => {
|
|
|
1880
1905
|
) }));
|
|
1881
1906
|
});
|
|
1882
1907
|
DrawerOverlay.displayName = "DrawerOverlay";
|
|
1883
|
-
var DrawerContent =
|
|
1908
|
+
var DrawerContent = React9.forwardRef(
|
|
1884
1909
|
(_a, ref) => {
|
|
1885
1910
|
var _b = _a, {
|
|
1886
1911
|
className,
|
|
@@ -1959,7 +1984,7 @@ var DrawerFooter = (_a) => {
|
|
|
1959
1984
|
return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("flex flex-col gap-2 mt-4", className) }, props));
|
|
1960
1985
|
};
|
|
1961
1986
|
DrawerFooter.displayName = "DrawerFooter";
|
|
1962
|
-
var DrawerTitle =
|
|
1987
|
+
var DrawerTitle = React9.forwardRef((_a, ref) => {
|
|
1963
1988
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1964
1989
|
return /* @__PURE__ */ jsx(
|
|
1965
1990
|
RadixDialog.Title,
|
|
@@ -1973,7 +1998,7 @@ var DrawerTitle = React6.forwardRef((_a, ref) => {
|
|
|
1973
1998
|
);
|
|
1974
1999
|
});
|
|
1975
2000
|
DrawerTitle.displayName = "DrawerTitle";
|
|
1976
|
-
var DrawerDescription =
|
|
2001
|
+
var DrawerDescription = React9.forwardRef((_a, ref) => {
|
|
1977
2002
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1978
2003
|
return /* @__PURE__ */ jsx(
|
|
1979
2004
|
RadixDialog.Description,
|
|
@@ -1985,7 +2010,7 @@ var DrawerDescription = React6.forwardRef((_a, ref) => {
|
|
|
1985
2010
|
});
|
|
1986
2011
|
DrawerDescription.displayName = "DrawerDescription";
|
|
1987
2012
|
var INDICATOR = "h-1 w-8 rounded-full bg-m3-on-surface-variant/40";
|
|
1988
|
-
var DragHandle =
|
|
2013
|
+
var DragHandle = React9.forwardRef(
|
|
1989
2014
|
({ className, onCycle, "aria-label": ariaLabel }, ref) => {
|
|
1990
2015
|
const isInteractive = Boolean(onCycle);
|
|
1991
2016
|
if (isInteractive) {
|
|
@@ -2538,7 +2563,7 @@ function resolveMaxHeight(maxHeight, snapPoints) {
|
|
|
2538
2563
|
return ABSOLUTE_MAX_HEIGHT;
|
|
2539
2564
|
return maxHeight;
|
|
2540
2565
|
}
|
|
2541
|
-
var BottomSheet =
|
|
2566
|
+
var BottomSheet = React9.forwardRef(
|
|
2542
2567
|
({
|
|
2543
2568
|
isOpen,
|
|
2544
2569
|
onClose,
|
|
@@ -2571,27 +2596,27 @@ var BottomSheet = React6.forwardRef(
|
|
|
2571
2596
|
isModal: false,
|
|
2572
2597
|
maxHeight: resolveMaxHeight(maxHeight, snapPoints)
|
|
2573
2598
|
});
|
|
2574
|
-
|
|
2599
|
+
React9.useEffect(() => {
|
|
2575
2600
|
const node = scope.current;
|
|
2576
2601
|
if (node) {
|
|
2577
2602
|
node.snapTo = snapTo;
|
|
2578
2603
|
}
|
|
2579
2604
|
}, [snapTo, scope]);
|
|
2580
|
-
const [mounted, setMounted] =
|
|
2581
|
-
|
|
2605
|
+
const [mounted, setMounted] = React9.useState(false);
|
|
2606
|
+
React9.useEffect(() => {
|
|
2582
2607
|
setMounted(true);
|
|
2583
2608
|
}, []);
|
|
2584
|
-
const resolvedDividers =
|
|
2609
|
+
const resolvedDividers = React9.useMemo(
|
|
2585
2610
|
() => resolveDividers(divider),
|
|
2586
2611
|
[divider]
|
|
2587
2612
|
);
|
|
2588
|
-
const resolvedSheetMaxWidth =
|
|
2613
|
+
const resolvedSheetMaxWidth = React9.useMemo(() => {
|
|
2589
2614
|
if (sheetMaxWidth === void 0)
|
|
2590
2615
|
return "var(--m3-bottom-sheet-max-width, 640px)";
|
|
2591
2616
|
if (typeof sheetMaxWidth === "number") return `${sheetMaxWidth}px`;
|
|
2592
2617
|
return sheetMaxWidth;
|
|
2593
2618
|
}, [sheetMaxWidth]);
|
|
2594
|
-
const mergedRef =
|
|
2619
|
+
const mergedRef = React9.useCallback(
|
|
2595
2620
|
(node) => {
|
|
2596
2621
|
scope(node);
|
|
2597
2622
|
if (typeof ref === "function") ref(node);
|
|
@@ -2675,7 +2700,7 @@ var SCRIM_ANIM = {
|
|
|
2675
2700
|
},
|
|
2676
2701
|
exit: { opacity: 0, transition: { duration: 0.18, ease: "easeIn" } }
|
|
2677
2702
|
};
|
|
2678
|
-
var Scrim =
|
|
2703
|
+
var Scrim = React9.forwardRef(
|
|
2679
2704
|
({ onClick, className, style }, ref) => /* @__PURE__ */ jsx(
|
|
2680
2705
|
m.div,
|
|
2681
2706
|
__spreadValues({
|
|
@@ -2707,7 +2732,7 @@ function resolveSheetMaxWidth(value) {
|
|
|
2707
2732
|
if (typeof value === "number") return `${value}px`;
|
|
2708
2733
|
return value;
|
|
2709
2734
|
}
|
|
2710
|
-
var BottomSheetModal =
|
|
2735
|
+
var BottomSheetModal = React9.forwardRef(
|
|
2711
2736
|
({
|
|
2712
2737
|
isOpen,
|
|
2713
2738
|
onClose,
|
|
@@ -2746,21 +2771,21 @@ var BottomSheetModal = React6.forwardRef(
|
|
|
2746
2771
|
isModal: true,
|
|
2747
2772
|
maxHeight: resolveMaxHeight2(maxHeight, snapPoints)
|
|
2748
2773
|
});
|
|
2749
|
-
|
|
2774
|
+
React9.useEffect(() => {
|
|
2750
2775
|
const node = scope.current;
|
|
2751
2776
|
if (node) {
|
|
2752
2777
|
node.snapTo = snapTo;
|
|
2753
2778
|
}
|
|
2754
2779
|
}, [snapTo, scope]);
|
|
2755
|
-
const resolvedDividers =
|
|
2780
|
+
const resolvedDividers = React9.useMemo(
|
|
2756
2781
|
() => resolveDividers(divider),
|
|
2757
2782
|
[divider]
|
|
2758
2783
|
);
|
|
2759
|
-
const resolvedSheetMaxWidth =
|
|
2784
|
+
const resolvedSheetMaxWidth = React9.useMemo(
|
|
2760
2785
|
() => resolveSheetMaxWidth(sheetMaxWidth),
|
|
2761
2786
|
[sheetMaxWidth]
|
|
2762
2787
|
);
|
|
2763
|
-
const mergedRef =
|
|
2788
|
+
const mergedRef = React9.useCallback(
|
|
2764
2789
|
(node) => {
|
|
2765
2790
|
scope(node);
|
|
2766
2791
|
if (typeof ref === "function") ref(node);
|
|
@@ -2959,7 +2984,7 @@ function useBottomSheetScaffold({
|
|
|
2959
2984
|
containerRef
|
|
2960
2985
|
};
|
|
2961
2986
|
}
|
|
2962
|
-
var BottomSheetScaffold =
|
|
2987
|
+
var BottomSheetScaffold = React9.forwardRef(
|
|
2963
2988
|
({
|
|
2964
2989
|
sheetContent,
|
|
2965
2990
|
children,
|
|
@@ -2988,13 +3013,13 @@ var BottomSheetScaffold = React6.forwardRef(
|
|
|
2988
3013
|
onStateChange: onSheetStateChange,
|
|
2989
3014
|
initialState: initialSheetState
|
|
2990
3015
|
});
|
|
2991
|
-
const resolvedSheetMaxWidth =
|
|
3016
|
+
const resolvedSheetMaxWidth = React9.useMemo(() => {
|
|
2992
3017
|
if (sheetMaxWidth === void 0)
|
|
2993
3018
|
return "var(--m3-bottom-sheet-max-width, 640px)";
|
|
2994
3019
|
if (typeof sheetMaxWidth === "number") return `${sheetMaxWidth}px`;
|
|
2995
3020
|
return sheetMaxWidth;
|
|
2996
3021
|
}, [sheetMaxWidth]);
|
|
2997
|
-
const mergedRef =
|
|
3022
|
+
const mergedRef = React9.useCallback(
|
|
2998
3023
|
(node) => {
|
|
2999
3024
|
containerRef(node);
|
|
3000
3025
|
if (typeof ref === "function") ref(node);
|
|
@@ -3002,7 +3027,7 @@ var BottomSheetScaffold = React6.forwardRef(
|
|
|
3002
3027
|
},
|
|
3003
3028
|
[containerRef, ref]
|
|
3004
3029
|
);
|
|
3005
|
-
const resolvedDragHandle =
|
|
3030
|
+
const resolvedDragHandle = React9.useMemo(() => {
|
|
3006
3031
|
if (sheetDragHandle === null) return null;
|
|
3007
3032
|
if (sheetDragHandle !== void 0) return sheetDragHandle;
|
|
3008
3033
|
return /* @__PURE__ */ jsx(DragHandle, { onCycle: toggle });
|
|
@@ -3065,7 +3090,7 @@ var BottomSheetScaffold = React6.forwardRef(
|
|
|
3065
3090
|
);
|
|
3066
3091
|
BottomSheetScaffold.displayName = "BottomSheetScaffold";
|
|
3067
3092
|
var COPLANAR_TRANSITION = `margin ${getMotionTransitionCSS("default", "spatial")}`;
|
|
3068
|
-
var SideSheet =
|
|
3093
|
+
var SideSheet = React9.forwardRef(
|
|
3069
3094
|
({
|
|
3070
3095
|
isOpen,
|
|
3071
3096
|
children,
|
|
@@ -3081,16 +3106,16 @@ var SideSheet = React6.forwardRef(
|
|
|
3081
3106
|
divider,
|
|
3082
3107
|
scrollAreaProps
|
|
3083
3108
|
}, ref) => {
|
|
3084
|
-
const sheetAnim =
|
|
3085
|
-
const [mounted, setMounted] =
|
|
3086
|
-
|
|
3109
|
+
const sheetAnim = React9.useMemo(() => buildSideSheetAnim(edge), [edge]);
|
|
3110
|
+
const [mounted, setMounted] = React9.useState(false);
|
|
3111
|
+
React9.useEffect(() => {
|
|
3087
3112
|
setMounted(true);
|
|
3088
3113
|
}, []);
|
|
3089
|
-
const resolvedDividers =
|
|
3114
|
+
const resolvedDividers = React9.useMemo(
|
|
3090
3115
|
() => resolveDividers(divider),
|
|
3091
3116
|
[divider]
|
|
3092
3117
|
);
|
|
3093
|
-
|
|
3118
|
+
React9.useEffect(() => {
|
|
3094
3119
|
const sibling = coplanarSiblingRef == null ? void 0 : coplanarSiblingRef.current;
|
|
3095
3120
|
if (!sibling) return;
|
|
3096
3121
|
sibling.style.transition = COPLANAR_TRANSITION;
|
|
@@ -3154,7 +3179,7 @@ var SideSheet = React6.forwardRef(
|
|
|
3154
3179
|
}
|
|
3155
3180
|
);
|
|
3156
3181
|
SideSheet.displayName = "SideSheet";
|
|
3157
|
-
var SideSheetModal =
|
|
3182
|
+
var SideSheetModal = React9.forwardRef(
|
|
3158
3183
|
({
|
|
3159
3184
|
isOpen,
|
|
3160
3185
|
onClose,
|
|
@@ -3169,8 +3194,8 @@ var SideSheetModal = React6.forwardRef(
|
|
|
3169
3194
|
divider,
|
|
3170
3195
|
scrollAreaProps
|
|
3171
3196
|
}, ref) => {
|
|
3172
|
-
const sheetAnim =
|
|
3173
|
-
const resolvedDividers =
|
|
3197
|
+
const sheetAnim = React9.useMemo(() => buildSideSheetAnim(edge), [edge]);
|
|
3198
|
+
const resolvedDividers = React9.useMemo(
|
|
3174
3199
|
() => resolveDividers(divider),
|
|
3175
3200
|
[divider]
|
|
3176
3201
|
);
|