@bug-on/m3-expressive 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/buttons.d.mts +26 -5
- package/dist/buttons.d.ts +26 -5
- package/dist/buttons.js +1074 -765
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +1066 -765
- package/dist/buttons.mjs.map +1 -1
- package/dist/core.js +133 -69
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +133 -69
- package/dist/core.mjs.map +1 -1
- package/dist/feedback.js +132 -69
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs +132 -69
- package/dist/feedback.mjs.map +1 -1
- package/dist/forms.d.mts +2 -2
- package/dist/forms.d.ts +2 -2
- package/dist/forms.js +74 -9
- package/dist/forms.js.map +1 -1
- package/dist/forms.mjs +74 -9
- package/dist/forms.mjs.map +1 -1
- package/dist/{icon-button-D-gs0gfj.d.mts → icon-button-CSsDmuQC.d.mts} +19 -0
- package/dist/{icon-button-D-gs0gfj.d.ts → icon-button-CSsDmuQC.d.ts} +19 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2204 -1464
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2056 -1324
- package/dist/index.mjs.map +1 -1
- package/dist/layout.d.mts +18 -1
- package/dist/layout.d.ts +18 -1
- package/dist/layout.js +80 -15
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +80 -15
- package/dist/layout.mjs.map +1 -1
- package/dist/navigation.d.mts +134 -9
- package/dist/navigation.d.ts +134 -9
- package/dist/navigation.js +461 -101
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +455 -102
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.js +261 -197
- package/dist/overlays.js.map +1 -1
- package/dist/overlays.mjs +223 -159
- package/dist/overlays.mjs.map +1 -1
- package/dist/pickers.js +392 -301
- package/dist/pickers.js.map +1 -1
- package/dist/pickers.mjs +361 -270
- package/dist/pickers.mjs.map +1 -1
- package/dist/{split-button-trailing-uncheckable-BkPbiBo3.d.ts → split-button-trailing-uncheckable-C-qQlyZx.d.ts} +118 -25
- package/dist/{split-button-trailing-uncheckable-D_PLPb-u.d.mts → split-button-trailing-uncheckable-DHJqNeq_.d.mts} +118 -25
- package/dist/{text-field-eAIpz9z1.d.mts → text-field-T4Rg-9Bw.d.mts} +7 -0
- package/dist/{text-field-eAIpz9z1.d.ts → text-field-T4Rg-9Bw.d.ts} +7 -0
- package/package.json +3 -3
package/dist/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,14 +1020,17 @@ 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();
|
|
1027
1028
|
const x = e.clientX - rect.left;
|
|
1028
1029
|
const y = e.clientY - rect.top;
|
|
1029
|
-
const rippleSize = Math.
|
|
1030
|
+
const rippleSize = Math.max(
|
|
1031
|
+
Math.hypot(rect.width, rect.height) * 2.5,
|
|
1032
|
+
320
|
|
1033
|
+
);
|
|
1030
1034
|
setRipples((prev) => [
|
|
1031
1035
|
...prev,
|
|
1032
1036
|
{ id: Date.now(), x, y, size: rippleSize }
|
|
@@ -1034,7 +1038,7 @@ function useRippleState(options = {}) {
|
|
|
1034
1038
|
},
|
|
1035
1039
|
[disabled]
|
|
1036
1040
|
);
|
|
1037
|
-
const removeRipple =
|
|
1041
|
+
const removeRipple = React9.useCallback((id) => {
|
|
1038
1042
|
setRipples((prev) => prev.filter((r) => r.id !== id));
|
|
1039
1043
|
}, []);
|
|
1040
1044
|
return { ripples, onPointerDown, removeRipple };
|
|
@@ -1144,12 +1148,39 @@ function TouchTarget() {
|
|
|
1144
1148
|
}
|
|
1145
1149
|
);
|
|
1146
1150
|
}
|
|
1147
|
-
var
|
|
1148
|
-
xs: "h-8
|
|
1149
|
-
sm: "h-10
|
|
1150
|
-
md: "h-14
|
|
1151
|
-
lg: "h-24
|
|
1152
|
-
xl: "h-[8.5rem]
|
|
1151
|
+
var SIZE_HEIGHT_STYLES = {
|
|
1152
|
+
xs: "h-8",
|
|
1153
|
+
sm: "h-10",
|
|
1154
|
+
md: "h-14",
|
|
1155
|
+
lg: "h-24",
|
|
1156
|
+
xl: "h-[8.5rem]"
|
|
1157
|
+
};
|
|
1158
|
+
var WIDTH_SIZE_STYLES = {
|
|
1159
|
+
xs: {
|
|
1160
|
+
default: "w-8",
|
|
1161
|
+
narrow: "w-8",
|
|
1162
|
+
wide: "w-12"
|
|
1163
|
+
},
|
|
1164
|
+
sm: {
|
|
1165
|
+
default: "w-10",
|
|
1166
|
+
narrow: "w-12",
|
|
1167
|
+
wide: "w-[3.25rem]"
|
|
1168
|
+
},
|
|
1169
|
+
md: {
|
|
1170
|
+
default: "w-14",
|
|
1171
|
+
narrow: "w-12",
|
|
1172
|
+
wide: "w-[4.5rem]"
|
|
1173
|
+
},
|
|
1174
|
+
lg: {
|
|
1175
|
+
default: "w-24",
|
|
1176
|
+
narrow: "w-16",
|
|
1177
|
+
wide: "w-32"
|
|
1178
|
+
},
|
|
1179
|
+
xl: {
|
|
1180
|
+
default: "w-[8.5rem]",
|
|
1181
|
+
narrow: "w-[6.5rem]",
|
|
1182
|
+
wide: "w-[11.5rem]"
|
|
1183
|
+
}
|
|
1153
1184
|
};
|
|
1154
1185
|
var SIZE_ICON = {
|
|
1155
1186
|
xs: { cls: "size-5", px: 20 },
|
|
@@ -1242,7 +1273,7 @@ function resolveDisabledBgClass(colorStyle) {
|
|
|
1242
1273
|
}
|
|
1243
1274
|
return "disabled:text-m3-on-surface/[0.38]";
|
|
1244
1275
|
}
|
|
1245
|
-
var IconButtonComponent =
|
|
1276
|
+
var IconButtonComponent = React9.forwardRef(
|
|
1246
1277
|
(_a, ref) => {
|
|
1247
1278
|
var _b = _a, {
|
|
1248
1279
|
className,
|
|
@@ -1250,11 +1281,14 @@ var IconButtonComponent = React6.forwardRef(
|
|
|
1250
1281
|
variant = "default",
|
|
1251
1282
|
colorStyle = "standard",
|
|
1252
1283
|
size = "sm",
|
|
1284
|
+
widthVariant = "default",
|
|
1253
1285
|
shape = "round",
|
|
1254
1286
|
selected,
|
|
1287
|
+
selectedIcon,
|
|
1255
1288
|
loading = false,
|
|
1256
1289
|
loadingVariant = "loading-indicator",
|
|
1257
1290
|
iconSize,
|
|
1291
|
+
asChild = false,
|
|
1258
1292
|
children,
|
|
1259
1293
|
onClick,
|
|
1260
1294
|
onKeyDown,
|
|
@@ -1265,31 +1299,34 @@ var IconButtonComponent = React6.forwardRef(
|
|
|
1265
1299
|
"variant",
|
|
1266
1300
|
"colorStyle",
|
|
1267
1301
|
"size",
|
|
1302
|
+
"widthVariant",
|
|
1268
1303
|
"shape",
|
|
1269
1304
|
"selected",
|
|
1305
|
+
"selectedIcon",
|
|
1270
1306
|
"loading",
|
|
1271
1307
|
"loadingVariant",
|
|
1272
1308
|
"iconSize",
|
|
1309
|
+
"asChild",
|
|
1273
1310
|
"children",
|
|
1274
1311
|
"onClick",
|
|
1275
1312
|
"onKeyDown",
|
|
1276
1313
|
"aria-label"
|
|
1277
1314
|
]);
|
|
1278
|
-
var _a2, _b2;
|
|
1315
|
+
var _a2, _b2, _c, _d, _e;
|
|
1279
1316
|
const isToggle = variant === "toggle";
|
|
1280
1317
|
const isSelected = isToggle && !!selected;
|
|
1281
|
-
const resolvedColorClass =
|
|
1318
|
+
const resolvedColorClass = React9.useMemo(
|
|
1282
1319
|
() => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
|
|
1283
1320
|
[isSelected, colorStyle]
|
|
1284
1321
|
);
|
|
1285
|
-
const outlineWidthClass =
|
|
1322
|
+
const outlineWidthClass = React9.useMemo(
|
|
1286
1323
|
() => {
|
|
1287
1324
|
var _a3;
|
|
1288
1325
|
return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
|
|
1289
1326
|
},
|
|
1290
1327
|
[colorStyle, isSelected, size]
|
|
1291
1328
|
);
|
|
1292
|
-
const disabledBgClass =
|
|
1329
|
+
const disabledBgClass = React9.useMemo(
|
|
1293
1330
|
() => resolveDisabledBgClass(colorStyle),
|
|
1294
1331
|
[colorStyle]
|
|
1295
1332
|
);
|
|
@@ -1306,11 +1343,13 @@ var IconButtonComponent = React6.forwardRef(
|
|
|
1306
1343
|
const defaultIconPx = sizeIcon.px;
|
|
1307
1344
|
const iconPx = iconSize != null ? iconSize : defaultIconPx;
|
|
1308
1345
|
const isCustomSize = iconSize != null && iconSize !== "inherit";
|
|
1346
|
+
const heightClass = (_c = SIZE_HEIGHT_STYLES[size]) != null ? _c : SIZE_HEIGHT_STYLES.sm;
|
|
1347
|
+
const widthClass = (_e = ((_d = WIDTH_SIZE_STYLES[size]) != null ? _d : WIDTH_SIZE_STYLES.sm)[widthVariant]) != null ? _e : WIDTH_SIZE_STYLES.sm.default;
|
|
1309
1348
|
const needsTouchTarget = size === "xs" || size === "sm";
|
|
1310
1349
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
1311
1350
|
disabled: loading
|
|
1312
1351
|
});
|
|
1313
|
-
const handleClick =
|
|
1352
|
+
const handleClick = React9.useCallback(
|
|
1314
1353
|
(e) => {
|
|
1315
1354
|
if (loading) {
|
|
1316
1355
|
e.preventDefault();
|
|
@@ -1320,7 +1359,7 @@ var IconButtonComponent = React6.forwardRef(
|
|
|
1320
1359
|
},
|
|
1321
1360
|
[loading, onClick]
|
|
1322
1361
|
);
|
|
1323
|
-
const handleKeyDown =
|
|
1362
|
+
const handleKeyDown = React9.useCallback(
|
|
1324
1363
|
(e) => {
|
|
1325
1364
|
if (loading) return;
|
|
1326
1365
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -1331,7 +1370,90 @@ var IconButtonComponent = React6.forwardRef(
|
|
|
1331
1370
|
},
|
|
1332
1371
|
[loading, onClick, onKeyDown]
|
|
1333
1372
|
);
|
|
1334
|
-
|
|
1373
|
+
const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1374
|
+
needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
|
|
1375
|
+
/* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
1376
|
+
/* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsx(
|
|
1377
|
+
m.span,
|
|
1378
|
+
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
1379
|
+
transition: SPRING_TRANSITION,
|
|
1380
|
+
className: cn(
|
|
1381
|
+
"flex items-center justify-center shrink-0",
|
|
1382
|
+
iconSize != null ? void 0 : iconClass
|
|
1383
|
+
),
|
|
1384
|
+
style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
|
|
1385
|
+
children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsx(
|
|
1386
|
+
LoadingIndicator,
|
|
1387
|
+
{
|
|
1388
|
+
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
1389
|
+
color: "currentColor",
|
|
1390
|
+
"aria-label": "Loading"
|
|
1391
|
+
}
|
|
1392
|
+
) : /* @__PURE__ */ jsx(
|
|
1393
|
+
ProgressIndicator,
|
|
1394
|
+
{
|
|
1395
|
+
variant: "circular",
|
|
1396
|
+
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
1397
|
+
color: "currentColor",
|
|
1398
|
+
trackColor: "transparent",
|
|
1399
|
+
"aria-label": "Loading"
|
|
1400
|
+
}
|
|
1401
|
+
)
|
|
1402
|
+
}),
|
|
1403
|
+
"loading"
|
|
1404
|
+
) : /* @__PURE__ */ jsx(
|
|
1405
|
+
m.span,
|
|
1406
|
+
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
1407
|
+
transition: SPRING_TRANSITION,
|
|
1408
|
+
"aria-hidden": "true",
|
|
1409
|
+
className: cn(
|
|
1410
|
+
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]",
|
|
1411
|
+
iconSize != null ? void 0 : iconClass
|
|
1412
|
+
),
|
|
1413
|
+
style: {
|
|
1414
|
+
fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
|
|
1415
|
+
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
1416
|
+
height: isCustomSize ? `${iconSize}px` : void 0
|
|
1417
|
+
},
|
|
1418
|
+
children: isSelected && selectedIcon ? selectedIcon : asChild ? React9.Children.only(children).props.children : children
|
|
1419
|
+
}),
|
|
1420
|
+
isSelected && selectedIcon ? "selected-content" : "content"
|
|
1421
|
+
) })
|
|
1422
|
+
] });
|
|
1423
|
+
const containerClassName = cn(
|
|
1424
|
+
baseIconButtonClasses,
|
|
1425
|
+
resolvedColorClass,
|
|
1426
|
+
outlineWidthClass,
|
|
1427
|
+
disabledBgClass,
|
|
1428
|
+
"overflow-hidden",
|
|
1429
|
+
heightClass,
|
|
1430
|
+
widthClass,
|
|
1431
|
+
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
1432
|
+
className
|
|
1433
|
+
);
|
|
1434
|
+
if (asChild) {
|
|
1435
|
+
const child = React9.Children.only(children);
|
|
1436
|
+
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
|
|
1437
|
+
Slot,
|
|
1438
|
+
__spreadProps(__spreadValues({
|
|
1439
|
+
ref,
|
|
1440
|
+
"aria-pressed": isToggle ? isSelected : void 0,
|
|
1441
|
+
"aria-label": ariaLabel,
|
|
1442
|
+
"aria-busy": loading || void 0,
|
|
1443
|
+
"aria-disabled": loading || restProps.disabled,
|
|
1444
|
+
onClick: handleClick,
|
|
1445
|
+
onPointerDown,
|
|
1446
|
+
onKeyDown: handleKeyDown,
|
|
1447
|
+
style: __spreadProps(__spreadValues({}, style), {
|
|
1448
|
+
borderRadius: `${animateRadius}px`
|
|
1449
|
+
}),
|
|
1450
|
+
className: containerClassName
|
|
1451
|
+
}, restProps), {
|
|
1452
|
+
children: React9.cloneElement(child, { children: innerContent })
|
|
1453
|
+
})
|
|
1454
|
+
) });
|
|
1455
|
+
}
|
|
1456
|
+
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
|
|
1335
1457
|
m.button,
|
|
1336
1458
|
__spreadProps(__spreadValues({
|
|
1337
1459
|
ref,
|
|
@@ -1347,79 +1469,21 @@ var IconButtonComponent = React6.forwardRef(
|
|
|
1347
1469
|
animate: { borderRadius: animateRadius },
|
|
1348
1470
|
whileTap: { borderRadius: pressedRadius },
|
|
1349
1471
|
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
|
-
)
|
|
1472
|
+
className: containerClassName
|
|
1360
1473
|
}, 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
|
-
]
|
|
1474
|
+
children: innerContent
|
|
1411
1475
|
})
|
|
1412
1476
|
) });
|
|
1413
1477
|
}
|
|
1414
1478
|
);
|
|
1415
1479
|
IconButtonComponent.displayName = "IconButton";
|
|
1416
|
-
var IconButton =
|
|
1480
|
+
var IconButton = React9.memo(IconButtonComponent);
|
|
1417
1481
|
var VARIANT_FONT = {
|
|
1418
1482
|
outlined: "'Material Symbols Outlined'",
|
|
1419
1483
|
rounded: "'Material Symbols Rounded'",
|
|
1420
1484
|
sharp: "'Material Symbols Sharp'"
|
|
1421
1485
|
};
|
|
1422
|
-
var IconComponent =
|
|
1486
|
+
var IconComponent = React9.forwardRef(
|
|
1423
1487
|
(_a, ref) => {
|
|
1424
1488
|
var _b = _a, {
|
|
1425
1489
|
name,
|
|
@@ -1485,8 +1549,8 @@ var IconComponent = React6.forwardRef(
|
|
|
1485
1549
|
}
|
|
1486
1550
|
);
|
|
1487
1551
|
IconComponent.displayName = "Icon";
|
|
1488
|
-
var Icon =
|
|
1489
|
-
var ScrollArea =
|
|
1552
|
+
var Icon = React9.memo(IconComponent);
|
|
1553
|
+
var ScrollArea = React9.forwardRef(
|
|
1490
1554
|
(_a, ref) => {
|
|
1491
1555
|
var _b = _a, {
|
|
1492
1556
|
className,
|
|
@@ -1507,15 +1571,15 @@ var ScrollArea = React6.forwardRef(
|
|
|
1507
1571
|
"viewportRef",
|
|
1508
1572
|
"viewportProps"
|
|
1509
1573
|
]);
|
|
1510
|
-
const [isTouchDevice, setIsTouchDevice] =
|
|
1511
|
-
|
|
1574
|
+
const [isTouchDevice, setIsTouchDevice] = React9.useState(false);
|
|
1575
|
+
React9.useEffect(() => {
|
|
1512
1576
|
if (typeof window !== "undefined") {
|
|
1513
1577
|
setIsTouchDevice(
|
|
1514
1578
|
"ontouchstart" in window || navigator.maxTouchPoints > 0
|
|
1515
1579
|
);
|
|
1516
1580
|
}
|
|
1517
1581
|
}, []);
|
|
1518
|
-
const resolvedType =
|
|
1582
|
+
const resolvedType = React9.useMemo(() => {
|
|
1519
1583
|
if (type === "hover" && isTouchDevice) {
|
|
1520
1584
|
return "scroll";
|
|
1521
1585
|
}
|
|
@@ -1566,7 +1630,7 @@ var ScrollArea = React6.forwardRef(
|
|
|
1566
1630
|
}
|
|
1567
1631
|
);
|
|
1568
1632
|
ScrollArea.displayName = "ScrollArea";
|
|
1569
|
-
var ScrollAreaScrollbar =
|
|
1633
|
+
var ScrollAreaScrollbar = React9.forwardRef((_a, ref) => {
|
|
1570
1634
|
var _b = _a, { className, orientation = "vertical" } = _b, props = __objRest(_b, ["className", "orientation"]);
|
|
1571
1635
|
return /* @__PURE__ */ jsx(
|
|
1572
1636
|
RadixScrollArea.Scrollbar,
|
|
@@ -1596,7 +1660,7 @@ var ScrollAreaScrollbar = React6.forwardRef((_a, ref) => {
|
|
|
1596
1660
|
);
|
|
1597
1661
|
});
|
|
1598
1662
|
ScrollAreaScrollbar.displayName = RadixScrollArea.Scrollbar.displayName;
|
|
1599
|
-
var ScrollAreaCorner =
|
|
1663
|
+
var ScrollAreaCorner = React9.forwardRef((_a, ref) => {
|
|
1600
1664
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1601
1665
|
return /* @__PURE__ */ jsx(
|
|
1602
1666
|
RadixScrollArea.Corner,
|
|
@@ -1638,9 +1702,9 @@ DialogTrigger.displayName = "DialogTrigger";
|
|
|
1638
1702
|
var DialogPortal = ({
|
|
1639
1703
|
open,
|
|
1640
1704
|
children
|
|
1641
|
-
}) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { children: open ?
|
|
1705
|
+
}) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { children: open ? React9.Children.toArray(children) : null }) });
|
|
1642
1706
|
DialogPortal.displayName = "DialogPortal";
|
|
1643
|
-
var DialogOverlay =
|
|
1707
|
+
var DialogOverlay = React9.forwardRef((_a, ref) => {
|
|
1644
1708
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1645
1709
|
return /* @__PURE__ */ jsx(RadixDialog.Overlay, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children: /* @__PURE__ */ jsx(
|
|
1646
1710
|
m.div,
|
|
@@ -1651,7 +1715,7 @@ var DialogOverlay = React6.forwardRef((_a, ref) => {
|
|
|
1651
1715
|
) }));
|
|
1652
1716
|
});
|
|
1653
1717
|
DialogOverlay.displayName = "DialogOverlay";
|
|
1654
|
-
var DialogContent =
|
|
1718
|
+
var DialogContent = React9.forwardRef((_a, ref) => {
|
|
1655
1719
|
var _b = _a, { className, children, hideCloseButton = false } = _b, props = __objRest(_b, ["className", "children", "hideCloseButton"]);
|
|
1656
1720
|
return /* @__PURE__ */ jsx(
|
|
1657
1721
|
RadixDialog.Content,
|
|
@@ -1691,7 +1755,7 @@ var DialogContent = React6.forwardRef((_a, ref) => {
|
|
|
1691
1755
|
);
|
|
1692
1756
|
});
|
|
1693
1757
|
DialogContent.displayName = "DialogContent";
|
|
1694
|
-
var DialogIcon =
|
|
1758
|
+
var DialogIcon = React9.forwardRef((_a, ref) => {
|
|
1695
1759
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
1696
1760
|
return /* @__PURE__ */ jsx(
|
|
1697
1761
|
"div",
|
|
@@ -1714,7 +1778,7 @@ var DialogHeader = (_a) => {
|
|
|
1714
1778
|
return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("flex flex-col gap-2 mb-4", className) }, props));
|
|
1715
1779
|
};
|
|
1716
1780
|
DialogHeader.displayName = "DialogHeader";
|
|
1717
|
-
var DialogTitle =
|
|
1781
|
+
var DialogTitle = React9.forwardRef((_a, ref) => {
|
|
1718
1782
|
var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
1719
1783
|
return /* @__PURE__ */ jsx(
|
|
1720
1784
|
RadixDialog.Title,
|
|
@@ -1729,7 +1793,7 @@ var DialogTitle = React6.forwardRef((_a, ref) => {
|
|
|
1729
1793
|
);
|
|
1730
1794
|
});
|
|
1731
1795
|
DialogTitle.displayName = "DialogTitle";
|
|
1732
|
-
var DialogDescription =
|
|
1796
|
+
var DialogDescription = React9.forwardRef((_a, ref) => {
|
|
1733
1797
|
var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
1734
1798
|
return /* @__PURE__ */ jsx(
|
|
1735
1799
|
RadixDialog.Description,
|
|
@@ -1741,7 +1805,7 @@ var DialogDescription = React6.forwardRef((_a, ref) => {
|
|
|
1741
1805
|
);
|
|
1742
1806
|
});
|
|
1743
1807
|
DialogDescription.displayName = "DialogDescription";
|
|
1744
|
-
var DialogBody =
|
|
1808
|
+
var DialogBody = React9.forwardRef((_a, ref) => {
|
|
1745
1809
|
var _b = _a, { className, children, dir } = _b, props = __objRest(_b, ["className", "children", "dir"]);
|
|
1746
1810
|
return /* @__PURE__ */ jsx(
|
|
1747
1811
|
ScrollArea,
|
|
@@ -1772,7 +1836,7 @@ var DialogFooter = (_a) => {
|
|
|
1772
1836
|
};
|
|
1773
1837
|
DialogFooter.displayName = "DialogFooter";
|
|
1774
1838
|
var DialogClose = RadixDialog.Close;
|
|
1775
|
-
var DialogFullScreenContent =
|
|
1839
|
+
var DialogFullScreenContent = React9.forwardRef(
|
|
1776
1840
|
(_a, ref) => {
|
|
1777
1841
|
var _b = _a, {
|
|
1778
1842
|
className,
|
|
@@ -1869,7 +1933,7 @@ var DrawerPortal = ({
|
|
|
1869
1933
|
open,
|
|
1870
1934
|
children
|
|
1871
1935
|
}) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: open && children }) });
|
|
1872
|
-
var DrawerOverlay =
|
|
1936
|
+
var DrawerOverlay = React9.forwardRef((_a, ref) => {
|
|
1873
1937
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1874
1938
|
return /* @__PURE__ */ jsx(RadixDialog.Overlay, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children: /* @__PURE__ */ jsx(
|
|
1875
1939
|
m.div,
|
|
@@ -1880,7 +1944,7 @@ var DrawerOverlay = React6.forwardRef((_a, ref) => {
|
|
|
1880
1944
|
) }));
|
|
1881
1945
|
});
|
|
1882
1946
|
DrawerOverlay.displayName = "DrawerOverlay";
|
|
1883
|
-
var DrawerContent =
|
|
1947
|
+
var DrawerContent = React9.forwardRef(
|
|
1884
1948
|
(_a, ref) => {
|
|
1885
1949
|
var _b = _a, {
|
|
1886
1950
|
className,
|
|
@@ -1959,7 +2023,7 @@ var DrawerFooter = (_a) => {
|
|
|
1959
2023
|
return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("flex flex-col gap-2 mt-4", className) }, props));
|
|
1960
2024
|
};
|
|
1961
2025
|
DrawerFooter.displayName = "DrawerFooter";
|
|
1962
|
-
var DrawerTitle =
|
|
2026
|
+
var DrawerTitle = React9.forwardRef((_a, ref) => {
|
|
1963
2027
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1964
2028
|
return /* @__PURE__ */ jsx(
|
|
1965
2029
|
RadixDialog.Title,
|
|
@@ -1973,7 +2037,7 @@ var DrawerTitle = React6.forwardRef((_a, ref) => {
|
|
|
1973
2037
|
);
|
|
1974
2038
|
});
|
|
1975
2039
|
DrawerTitle.displayName = "DrawerTitle";
|
|
1976
|
-
var DrawerDescription =
|
|
2040
|
+
var DrawerDescription = React9.forwardRef((_a, ref) => {
|
|
1977
2041
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1978
2042
|
return /* @__PURE__ */ jsx(
|
|
1979
2043
|
RadixDialog.Description,
|
|
@@ -1985,7 +2049,7 @@ var DrawerDescription = React6.forwardRef((_a, ref) => {
|
|
|
1985
2049
|
});
|
|
1986
2050
|
DrawerDescription.displayName = "DrawerDescription";
|
|
1987
2051
|
var INDICATOR = "h-1 w-8 rounded-full bg-m3-on-surface-variant/40";
|
|
1988
|
-
var DragHandle =
|
|
2052
|
+
var DragHandle = React9.forwardRef(
|
|
1989
2053
|
({ className, onCycle, "aria-label": ariaLabel }, ref) => {
|
|
1990
2054
|
const isInteractive = Boolean(onCycle);
|
|
1991
2055
|
if (isInteractive) {
|
|
@@ -2538,7 +2602,7 @@ function resolveMaxHeight(maxHeight, snapPoints) {
|
|
|
2538
2602
|
return ABSOLUTE_MAX_HEIGHT;
|
|
2539
2603
|
return maxHeight;
|
|
2540
2604
|
}
|
|
2541
|
-
var BottomSheet =
|
|
2605
|
+
var BottomSheet = React9.forwardRef(
|
|
2542
2606
|
({
|
|
2543
2607
|
isOpen,
|
|
2544
2608
|
onClose,
|
|
@@ -2571,27 +2635,27 @@ var BottomSheet = React6.forwardRef(
|
|
|
2571
2635
|
isModal: false,
|
|
2572
2636
|
maxHeight: resolveMaxHeight(maxHeight, snapPoints)
|
|
2573
2637
|
});
|
|
2574
|
-
|
|
2638
|
+
React9.useEffect(() => {
|
|
2575
2639
|
const node = scope.current;
|
|
2576
2640
|
if (node) {
|
|
2577
2641
|
node.snapTo = snapTo;
|
|
2578
2642
|
}
|
|
2579
2643
|
}, [snapTo, scope]);
|
|
2580
|
-
const [mounted, setMounted] =
|
|
2581
|
-
|
|
2644
|
+
const [mounted, setMounted] = React9.useState(false);
|
|
2645
|
+
React9.useEffect(() => {
|
|
2582
2646
|
setMounted(true);
|
|
2583
2647
|
}, []);
|
|
2584
|
-
const resolvedDividers =
|
|
2648
|
+
const resolvedDividers = React9.useMemo(
|
|
2585
2649
|
() => resolveDividers(divider),
|
|
2586
2650
|
[divider]
|
|
2587
2651
|
);
|
|
2588
|
-
const resolvedSheetMaxWidth =
|
|
2652
|
+
const resolvedSheetMaxWidth = React9.useMemo(() => {
|
|
2589
2653
|
if (sheetMaxWidth === void 0)
|
|
2590
2654
|
return "var(--m3-bottom-sheet-max-width, 640px)";
|
|
2591
2655
|
if (typeof sheetMaxWidth === "number") return `${sheetMaxWidth}px`;
|
|
2592
2656
|
return sheetMaxWidth;
|
|
2593
2657
|
}, [sheetMaxWidth]);
|
|
2594
|
-
const mergedRef =
|
|
2658
|
+
const mergedRef = React9.useCallback(
|
|
2595
2659
|
(node) => {
|
|
2596
2660
|
scope(node);
|
|
2597
2661
|
if (typeof ref === "function") ref(node);
|
|
@@ -2675,7 +2739,7 @@ var SCRIM_ANIM = {
|
|
|
2675
2739
|
},
|
|
2676
2740
|
exit: { opacity: 0, transition: { duration: 0.18, ease: "easeIn" } }
|
|
2677
2741
|
};
|
|
2678
|
-
var Scrim =
|
|
2742
|
+
var Scrim = React9.forwardRef(
|
|
2679
2743
|
({ onClick, className, style }, ref) => /* @__PURE__ */ jsx(
|
|
2680
2744
|
m.div,
|
|
2681
2745
|
__spreadValues({
|
|
@@ -2707,7 +2771,7 @@ function resolveSheetMaxWidth(value) {
|
|
|
2707
2771
|
if (typeof value === "number") return `${value}px`;
|
|
2708
2772
|
return value;
|
|
2709
2773
|
}
|
|
2710
|
-
var BottomSheetModal =
|
|
2774
|
+
var BottomSheetModal = React9.forwardRef(
|
|
2711
2775
|
({
|
|
2712
2776
|
isOpen,
|
|
2713
2777
|
onClose,
|
|
@@ -2746,21 +2810,21 @@ var BottomSheetModal = React6.forwardRef(
|
|
|
2746
2810
|
isModal: true,
|
|
2747
2811
|
maxHeight: resolveMaxHeight2(maxHeight, snapPoints)
|
|
2748
2812
|
});
|
|
2749
|
-
|
|
2813
|
+
React9.useEffect(() => {
|
|
2750
2814
|
const node = scope.current;
|
|
2751
2815
|
if (node) {
|
|
2752
2816
|
node.snapTo = snapTo;
|
|
2753
2817
|
}
|
|
2754
2818
|
}, [snapTo, scope]);
|
|
2755
|
-
const resolvedDividers =
|
|
2819
|
+
const resolvedDividers = React9.useMemo(
|
|
2756
2820
|
() => resolveDividers(divider),
|
|
2757
2821
|
[divider]
|
|
2758
2822
|
);
|
|
2759
|
-
const resolvedSheetMaxWidth =
|
|
2823
|
+
const resolvedSheetMaxWidth = React9.useMemo(
|
|
2760
2824
|
() => resolveSheetMaxWidth(sheetMaxWidth),
|
|
2761
2825
|
[sheetMaxWidth]
|
|
2762
2826
|
);
|
|
2763
|
-
const mergedRef =
|
|
2827
|
+
const mergedRef = React9.useCallback(
|
|
2764
2828
|
(node) => {
|
|
2765
2829
|
scope(node);
|
|
2766
2830
|
if (typeof ref === "function") ref(node);
|
|
@@ -2959,7 +3023,7 @@ function useBottomSheetScaffold({
|
|
|
2959
3023
|
containerRef
|
|
2960
3024
|
};
|
|
2961
3025
|
}
|
|
2962
|
-
var BottomSheetScaffold =
|
|
3026
|
+
var BottomSheetScaffold = React9.forwardRef(
|
|
2963
3027
|
({
|
|
2964
3028
|
sheetContent,
|
|
2965
3029
|
children,
|
|
@@ -2988,13 +3052,13 @@ var BottomSheetScaffold = React6.forwardRef(
|
|
|
2988
3052
|
onStateChange: onSheetStateChange,
|
|
2989
3053
|
initialState: initialSheetState
|
|
2990
3054
|
});
|
|
2991
|
-
const resolvedSheetMaxWidth =
|
|
3055
|
+
const resolvedSheetMaxWidth = React9.useMemo(() => {
|
|
2992
3056
|
if (sheetMaxWidth === void 0)
|
|
2993
3057
|
return "var(--m3-bottom-sheet-max-width, 640px)";
|
|
2994
3058
|
if (typeof sheetMaxWidth === "number") return `${sheetMaxWidth}px`;
|
|
2995
3059
|
return sheetMaxWidth;
|
|
2996
3060
|
}, [sheetMaxWidth]);
|
|
2997
|
-
const mergedRef =
|
|
3061
|
+
const mergedRef = React9.useCallback(
|
|
2998
3062
|
(node) => {
|
|
2999
3063
|
containerRef(node);
|
|
3000
3064
|
if (typeof ref === "function") ref(node);
|
|
@@ -3002,7 +3066,7 @@ var BottomSheetScaffold = React6.forwardRef(
|
|
|
3002
3066
|
},
|
|
3003
3067
|
[containerRef, ref]
|
|
3004
3068
|
);
|
|
3005
|
-
const resolvedDragHandle =
|
|
3069
|
+
const resolvedDragHandle = React9.useMemo(() => {
|
|
3006
3070
|
if (sheetDragHandle === null) return null;
|
|
3007
3071
|
if (sheetDragHandle !== void 0) return sheetDragHandle;
|
|
3008
3072
|
return /* @__PURE__ */ jsx(DragHandle, { onCycle: toggle });
|
|
@@ -3065,7 +3129,7 @@ var BottomSheetScaffold = React6.forwardRef(
|
|
|
3065
3129
|
);
|
|
3066
3130
|
BottomSheetScaffold.displayName = "BottomSheetScaffold";
|
|
3067
3131
|
var COPLANAR_TRANSITION = `margin ${getMotionTransitionCSS("default", "spatial")}`;
|
|
3068
|
-
var SideSheet =
|
|
3132
|
+
var SideSheet = React9.forwardRef(
|
|
3069
3133
|
({
|
|
3070
3134
|
isOpen,
|
|
3071
3135
|
children,
|
|
@@ -3081,16 +3145,16 @@ var SideSheet = React6.forwardRef(
|
|
|
3081
3145
|
divider,
|
|
3082
3146
|
scrollAreaProps
|
|
3083
3147
|
}, ref) => {
|
|
3084
|
-
const sheetAnim =
|
|
3085
|
-
const [mounted, setMounted] =
|
|
3086
|
-
|
|
3148
|
+
const sheetAnim = React9.useMemo(() => buildSideSheetAnim(edge), [edge]);
|
|
3149
|
+
const [mounted, setMounted] = React9.useState(false);
|
|
3150
|
+
React9.useEffect(() => {
|
|
3087
3151
|
setMounted(true);
|
|
3088
3152
|
}, []);
|
|
3089
|
-
const resolvedDividers =
|
|
3153
|
+
const resolvedDividers = React9.useMemo(
|
|
3090
3154
|
() => resolveDividers(divider),
|
|
3091
3155
|
[divider]
|
|
3092
3156
|
);
|
|
3093
|
-
|
|
3157
|
+
React9.useEffect(() => {
|
|
3094
3158
|
const sibling = coplanarSiblingRef == null ? void 0 : coplanarSiblingRef.current;
|
|
3095
3159
|
if (!sibling) return;
|
|
3096
3160
|
sibling.style.transition = COPLANAR_TRANSITION;
|
|
@@ -3154,7 +3218,7 @@ var SideSheet = React6.forwardRef(
|
|
|
3154
3218
|
}
|
|
3155
3219
|
);
|
|
3156
3220
|
SideSheet.displayName = "SideSheet";
|
|
3157
|
-
var SideSheetModal =
|
|
3221
|
+
var SideSheetModal = React9.forwardRef(
|
|
3158
3222
|
({
|
|
3159
3223
|
isOpen,
|
|
3160
3224
|
onClose,
|
|
@@ -3169,8 +3233,8 @@ var SideSheetModal = React6.forwardRef(
|
|
|
3169
3233
|
divider,
|
|
3170
3234
|
scrollAreaProps
|
|
3171
3235
|
}, ref) => {
|
|
3172
|
-
const sheetAnim =
|
|
3173
|
-
const resolvedDividers =
|
|
3236
|
+
const sheetAnim = React9.useMemo(() => buildSideSheetAnim(edge), [edge]);
|
|
3237
|
+
const resolvedDividers = React9.useMemo(
|
|
3174
3238
|
() => resolveDividers(divider),
|
|
3175
3239
|
[divider]
|
|
3176
3240
|
);
|