@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/pickers.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var react = require('motion/react');
|
|
5
|
-
var
|
|
5
|
+
var React13 = require('react');
|
|
6
6
|
var clsx = require('clsx');
|
|
7
7
|
var tailwindMerge = require('tailwind-merge');
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
9
10
|
var RadixDialog = require('@radix-ui/react-dialog');
|
|
10
11
|
var RadixScrollArea = require('@radix-ui/react-scroll-area');
|
|
11
12
|
|
|
@@ -27,7 +28,7 @@ function _interopNamespace(e) {
|
|
|
27
28
|
return Object.freeze(n);
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
var
|
|
31
|
+
var React13__namespace = /*#__PURE__*/_interopNamespace(React13);
|
|
31
32
|
var RadixDialog__namespace = /*#__PURE__*/_interopNamespace(RadixDialog);
|
|
32
33
|
var RadixScrollArea__namespace = /*#__PURE__*/_interopNamespace(RadixScrollArea);
|
|
33
34
|
|
|
@@ -192,13 +193,13 @@ var DatePickerInput = ({
|
|
|
192
193
|
locale,
|
|
193
194
|
className
|
|
194
195
|
}) => {
|
|
195
|
-
const inputId =
|
|
196
|
+
const inputId = React13__namespace.useId();
|
|
196
197
|
const errorId = `${inputId}-error`;
|
|
197
|
-
const placeholder =
|
|
198
|
+
const placeholder = React13__namespace.useMemo(() => {
|
|
198
199
|
if (locale == null ? void 0 : locale.startsWith("vi")) return "DD/MM/YYYY";
|
|
199
200
|
return "MM/DD/YYYY";
|
|
200
201
|
}, [locale]);
|
|
201
|
-
const handleKeyDown =
|
|
202
|
+
const handleKeyDown = React13__namespace.useCallback(
|
|
202
203
|
(e) => {
|
|
203
204
|
if (e.key === "Enter") {
|
|
204
205
|
const parsed = parseDateInput(value);
|
|
@@ -207,11 +208,11 @@ var DatePickerInput = ({
|
|
|
207
208
|
},
|
|
208
209
|
[value, onCommit]
|
|
209
210
|
);
|
|
210
|
-
const handleBlur =
|
|
211
|
+
const handleBlur = React13__namespace.useCallback(() => {
|
|
211
212
|
const parsed = parseDateInput(value);
|
|
212
213
|
onCommit(parsed);
|
|
213
214
|
}, [value, onCommit]);
|
|
214
|
-
const handleChange =
|
|
215
|
+
const handleChange = React13__namespace.useCallback(
|
|
215
216
|
(e) => {
|
|
216
217
|
let raw = e.target.value.replace(/\D/g, "");
|
|
217
218
|
if (raw.length > 8) raw = raw.slice(0, 8);
|
|
@@ -381,11 +382,11 @@ var DayCell = ({
|
|
|
381
382
|
// Disabled
|
|
382
383
|
isDisabled && "opacity-[0.38]"
|
|
383
384
|
);
|
|
384
|
-
const handleClick =
|
|
385
|
+
const handleClick = React13__namespace.useCallback(() => {
|
|
385
386
|
if (isDisabled) return;
|
|
386
387
|
onSelect(utcMs);
|
|
387
388
|
}, [isDisabled, utcMs, onSelect]);
|
|
388
|
-
const handleKeyDown =
|
|
389
|
+
const handleKeyDown = React13__namespace.useCallback(
|
|
389
390
|
(e) => {
|
|
390
391
|
if (e.key === "Enter" || e.key === " ") {
|
|
391
392
|
e.preventDefault();
|
|
@@ -421,7 +422,7 @@ var DayCell = ({
|
|
|
421
422
|
};
|
|
422
423
|
DayCell.displayName = "DayCell";
|
|
423
424
|
var WeekdayRow = ({ locale }) => {
|
|
424
|
-
const names =
|
|
425
|
+
const names = React13__namespace.useMemo(() => getWeekdayNames(locale), [locale]);
|
|
425
426
|
return /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "grid grid-cols-7 mb-1", children: names.map((name, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
426
427
|
"th",
|
|
427
428
|
{
|
|
@@ -448,7 +449,7 @@ var CalendarGrid = ({
|
|
|
448
449
|
const d = new Date(displayedMonthMs);
|
|
449
450
|
const year = d.getUTCFullYear();
|
|
450
451
|
const month = d.getUTCMonth();
|
|
451
|
-
const weeks =
|
|
452
|
+
const weeks = React13__namespace.useMemo(
|
|
452
453
|
() => getWeeksInMonth(year, month, locale.weekStartsOn),
|
|
453
454
|
[year, month, locale.weekStartsOn]
|
|
454
455
|
);
|
|
@@ -550,11 +551,11 @@ var ROTATE_KEY_SPLINES = [
|
|
|
550
551
|
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";
|
|
551
552
|
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";
|
|
552
553
|
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";
|
|
553
|
-
var IndeterminateSvg =
|
|
554
|
+
var IndeterminateSvg = React13__namespace.memo(function IndeterminateSvg2({
|
|
554
555
|
size
|
|
555
556
|
}) {
|
|
556
|
-
const [ready, setReady] =
|
|
557
|
-
|
|
557
|
+
const [ready, setReady] = React13__namespace.useState(false);
|
|
558
|
+
React13__namespace.useEffect(() => {
|
|
558
559
|
const raf = requestAnimationFrame(() => setReady(true));
|
|
559
560
|
return () => cancelAnimationFrame(raf);
|
|
560
561
|
}, []);
|
|
@@ -599,7 +600,7 @@ var IndeterminateSvg = React17__namespace.memo(function IndeterminateSvg2({
|
|
|
599
600
|
}
|
|
600
601
|
);
|
|
601
602
|
});
|
|
602
|
-
var DeterminateSvg =
|
|
603
|
+
var DeterminateSvg = React13__namespace.memo(function DeterminateSvg2({
|
|
603
604
|
size,
|
|
604
605
|
progress
|
|
605
606
|
}) {
|
|
@@ -624,7 +625,7 @@ var DeterminateSvg = React17__namespace.memo(function DeterminateSvg2({
|
|
|
624
625
|
}
|
|
625
626
|
);
|
|
626
627
|
});
|
|
627
|
-
var LoadingIndicator =
|
|
628
|
+
var LoadingIndicator = React13__namespace.forwardRef(
|
|
628
629
|
(_a, ref) => {
|
|
629
630
|
var _b = _a, {
|
|
630
631
|
variant = "uncontained",
|
|
@@ -739,7 +740,7 @@ function getSinePath(startX, endX, phase, wl, amp) {
|
|
|
739
740
|
d += ` L ${endX.toFixed(2)} ${yEnd.toFixed(2)}`;
|
|
740
741
|
return d;
|
|
741
742
|
}
|
|
742
|
-
var CircularProgress =
|
|
743
|
+
var CircularProgress = React13__namespace.forwardRef(
|
|
743
744
|
(_a, ref) => {
|
|
744
745
|
var _b = _a, {
|
|
745
746
|
value,
|
|
@@ -777,15 +778,15 @@ var CircularProgress = React17__namespace.forwardRef(
|
|
|
777
778
|
const isWavy = shape === "wavy";
|
|
778
779
|
const BASELINE_SIZE = 48;
|
|
779
780
|
const scaleFactor = size / BASELINE_SIZE;
|
|
780
|
-
const effectiveAmplitude =
|
|
781
|
+
const effectiveAmplitude = React13__namespace.useMemo(
|
|
781
782
|
() => amplitude != null ? amplitude : 1.6 * scaleFactor,
|
|
782
783
|
[amplitude, scaleFactor]
|
|
783
784
|
);
|
|
784
|
-
const effectiveWavelength =
|
|
785
|
+
const effectiveWavelength = React13__namespace.useMemo(
|
|
785
786
|
() => wavelength != null ? wavelength : 15 * scaleFactor,
|
|
786
787
|
[wavelength, scaleFactor]
|
|
787
788
|
);
|
|
788
|
-
const wavyActivePath =
|
|
789
|
+
const wavyActivePath = React13__namespace.useMemo(
|
|
789
790
|
() => isWavy ? generateWavyCircularPath(
|
|
790
791
|
center,
|
|
791
792
|
radius,
|
|
@@ -794,8 +795,8 @@ var CircularProgress = React17__namespace.forwardRef(
|
|
|
794
795
|
) : null,
|
|
795
796
|
[isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
|
|
796
797
|
);
|
|
797
|
-
const circumference =
|
|
798
|
-
const gapForTrack =
|
|
798
|
+
const circumference = React13__namespace.useMemo(() => 2 * Math.PI * radius, [radius]);
|
|
799
|
+
const gapForTrack = React13__namespace.useMemo(
|
|
799
800
|
() => (gapSize + trackHeight) / circumference,
|
|
800
801
|
[gapSize, trackHeight, circumference]
|
|
801
802
|
);
|
|
@@ -984,9 +985,9 @@ var CircularProgress = React17__namespace.forwardRef(
|
|
|
984
985
|
);
|
|
985
986
|
CircularProgress.displayName = "CircularProgress";
|
|
986
987
|
function useContainerWidth() {
|
|
987
|
-
const [width, setWidth] =
|
|
988
|
-
const observerRef =
|
|
989
|
-
const ref =
|
|
988
|
+
const [width, setWidth] = React13__namespace.useState(0);
|
|
989
|
+
const observerRef = React13__namespace.useRef(null);
|
|
990
|
+
const ref = React13__namespace.useCallback((node) => {
|
|
990
991
|
if (observerRef.current) {
|
|
991
992
|
observerRef.current.disconnect();
|
|
992
993
|
observerRef.current = null;
|
|
@@ -1000,7 +1001,7 @@ function useContainerWidth() {
|
|
|
1000
1001
|
observerRef.current = obs;
|
|
1001
1002
|
}
|
|
1002
1003
|
}, []);
|
|
1003
|
-
|
|
1004
|
+
React13__namespace.useEffect(() => {
|
|
1004
1005
|
return () => {
|
|
1005
1006
|
if (observerRef.current) {
|
|
1006
1007
|
observerRef.current.disconnect();
|
|
@@ -1010,7 +1011,7 @@ function useContainerWidth() {
|
|
|
1010
1011
|
return [ref, width];
|
|
1011
1012
|
}
|
|
1012
1013
|
function useMergedRef(...refs) {
|
|
1013
|
-
return
|
|
1014
|
+
return React13__namespace.useCallback(
|
|
1014
1015
|
(node) => {
|
|
1015
1016
|
for (const ref of refs) {
|
|
1016
1017
|
if (typeof ref === "function") {
|
|
@@ -1024,7 +1025,7 @@ function useMergedRef(...refs) {
|
|
|
1024
1025
|
[refs]
|
|
1025
1026
|
);
|
|
1026
1027
|
}
|
|
1027
|
-
var FlatLinearTrack =
|
|
1028
|
+
var FlatLinearTrack = React13__namespace.memo(function FlatLinearTrack2({
|
|
1028
1029
|
trackHeight,
|
|
1029
1030
|
activeColor,
|
|
1030
1031
|
trackColor,
|
|
@@ -1100,7 +1101,7 @@ var FlatLinearTrack = React17__namespace.memo(function FlatLinearTrack2({
|
|
|
1100
1101
|
}
|
|
1101
1102
|
);
|
|
1102
1103
|
});
|
|
1103
|
-
var WavyLinearTrack =
|
|
1104
|
+
var WavyLinearTrack = React13__namespace.memo(function WavyLinearTrack2({
|
|
1104
1105
|
trackHeight,
|
|
1105
1106
|
svgHeight,
|
|
1106
1107
|
amplitude,
|
|
@@ -1119,13 +1120,13 @@ var WavyLinearTrack = React17__namespace.memo(function WavyLinearTrack2({
|
|
|
1119
1120
|
}) {
|
|
1120
1121
|
const isDeterminate = typeof value === "number";
|
|
1121
1122
|
const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
|
|
1122
|
-
const titleId =
|
|
1123
|
+
const titleId = React13__namespace.useId();
|
|
1123
1124
|
const [containerRef, width] = useContainerWidth();
|
|
1124
|
-
const activePathRef =
|
|
1125
|
-
const trackPathRef =
|
|
1125
|
+
const activePathRef = React13__namespace.useRef(null);
|
|
1126
|
+
const trackPathRef = React13__namespace.useRef(null);
|
|
1126
1127
|
const amplitudeMV = react.useMotionValue(amplitude);
|
|
1127
1128
|
const fractionMV = react.useMotionValue(isDeterminate ? clampedValue / 100 : 1);
|
|
1128
|
-
|
|
1129
|
+
React13__namespace.useEffect(() => {
|
|
1129
1130
|
if (isDeterminate) {
|
|
1130
1131
|
const fraction = clampedValue / 100;
|
|
1131
1132
|
let targetAmp = amplitude;
|
|
@@ -1296,7 +1297,7 @@ var WavyLinearTrack = React17__namespace.memo(function WavyLinearTrack2({
|
|
|
1296
1297
|
}
|
|
1297
1298
|
);
|
|
1298
1299
|
});
|
|
1299
|
-
var LinearProgress =
|
|
1300
|
+
var LinearProgress = React13__namespace.forwardRef(
|
|
1300
1301
|
(_a, ref) => {
|
|
1301
1302
|
var _b = _a, {
|
|
1302
1303
|
value,
|
|
@@ -1337,10 +1338,10 @@ var LinearProgress = React17__namespace.forwardRef(
|
|
|
1337
1338
|
]);
|
|
1338
1339
|
const isDeterminate = value !== void 0;
|
|
1339
1340
|
const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
|
|
1340
|
-
const containerRef =
|
|
1341
|
+
const containerRef = React13__namespace.useRef(null);
|
|
1341
1342
|
const mergedRef = useMergedRef(ref, containerRef);
|
|
1342
|
-
const [isRtl, setIsRtl] =
|
|
1343
|
-
|
|
1343
|
+
const [isRtl, setIsRtl] = React13__namespace.useState(false);
|
|
1344
|
+
React13__namespace.useEffect(() => {
|
|
1344
1345
|
if (containerRef.current) {
|
|
1345
1346
|
const dir = getComputedStyle(containerRef.current).direction;
|
|
1346
1347
|
setIsRtl(dir === "rtl");
|
|
@@ -1348,16 +1349,16 @@ var LinearProgress = React17__namespace.forwardRef(
|
|
|
1348
1349
|
}, []);
|
|
1349
1350
|
const isWavy = shape === "wavy";
|
|
1350
1351
|
const resolvedTrackShape = trackShape != null ? trackShape : shape;
|
|
1351
|
-
const effectiveAmplitude =
|
|
1352
|
-
const svgHeight =
|
|
1352
|
+
const effectiveAmplitude = React13__namespace.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
|
|
1353
|
+
const svgHeight = React13__namespace.useMemo(
|
|
1353
1354
|
() => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
|
|
1354
1355
|
[isWavy, trackHeight, effectiveAmplitude]
|
|
1355
1356
|
);
|
|
1356
|
-
const shouldShowStop =
|
|
1357
|
+
const shouldShowStop = React13__namespace.useMemo(
|
|
1357
1358
|
() => isDeterminate && resolvedTrackShape === "flat" && (showStopIndicator === true || showStopIndicator === "auto" && isDeterminate),
|
|
1358
1359
|
[isDeterminate, resolvedTrackShape, showStopIndicator]
|
|
1359
1360
|
);
|
|
1360
|
-
const stopSize =
|
|
1361
|
+
const stopSize = React13__namespace.useMemo(
|
|
1361
1362
|
() => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
|
|
1362
1363
|
[trackHeight]
|
|
1363
1364
|
);
|
|
@@ -1430,14 +1431,14 @@ var LinearProgress = React17__namespace.forwardRef(
|
|
|
1430
1431
|
}
|
|
1431
1432
|
);
|
|
1432
1433
|
LinearProgress.displayName = "LinearProgress";
|
|
1433
|
-
var ProgressIndicator =
|
|
1434
|
+
var ProgressIndicator = React13__namespace.forwardRef((props, ref) => {
|
|
1434
1435
|
if (props.variant === "circular") {
|
|
1435
1436
|
return /* @__PURE__ */ jsxRuntime.jsx(CircularProgress, __spreadValues({ ref }, props));
|
|
1436
1437
|
}
|
|
1437
1438
|
return /* @__PURE__ */ jsxRuntime.jsx(LinearProgress, __spreadValues({ ref }, props));
|
|
1438
1439
|
});
|
|
1439
1440
|
ProgressIndicator.displayName = "ProgressIndicator";
|
|
1440
|
-
var RippleItem =
|
|
1441
|
+
var RippleItem = React13__namespace.memo(function RippleItem2({
|
|
1441
1442
|
ripple,
|
|
1442
1443
|
onDone
|
|
1443
1444
|
}) {
|
|
@@ -1481,8 +1482,8 @@ function Ripple({
|
|
|
1481
1482
|
}
|
|
1482
1483
|
function useRippleState(options = {}) {
|
|
1483
1484
|
const { disabled = false } = options;
|
|
1484
|
-
const [ripples, setRipples] =
|
|
1485
|
-
const onPointerDown =
|
|
1485
|
+
const [ripples, setRipples] = React13__namespace.useState([]);
|
|
1486
|
+
const onPointerDown = React13__namespace.useCallback(
|
|
1486
1487
|
(e) => {
|
|
1487
1488
|
if (disabled) return;
|
|
1488
1489
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -1496,7 +1497,7 @@ function useRippleState(options = {}) {
|
|
|
1496
1497
|
},
|
|
1497
1498
|
[disabled]
|
|
1498
1499
|
);
|
|
1499
|
-
const removeRipple =
|
|
1500
|
+
const removeRipple = React13__namespace.useCallback((id) => {
|
|
1500
1501
|
setRipples((prev) => prev.filter((r) => r.id !== id));
|
|
1501
1502
|
}, []);
|
|
1502
1503
|
return { ripples, onPointerDown, removeRipple };
|
|
@@ -1617,7 +1618,7 @@ function resolveDisabledBgClass(colorStyle) {
|
|
|
1617
1618
|
}
|
|
1618
1619
|
return "disabled:text-m3-on-surface/[0.38]";
|
|
1619
1620
|
}
|
|
1620
|
-
var IconButtonComponent =
|
|
1621
|
+
var IconButtonComponent = React13__namespace.forwardRef(
|
|
1621
1622
|
(_a, ref) => {
|
|
1622
1623
|
var _b = _a, {
|
|
1623
1624
|
className,
|
|
@@ -1630,6 +1631,7 @@ var IconButtonComponent = React17__namespace.forwardRef(
|
|
|
1630
1631
|
loading = false,
|
|
1631
1632
|
loadingVariant = "loading-indicator",
|
|
1632
1633
|
iconSize,
|
|
1634
|
+
asChild = false,
|
|
1633
1635
|
children,
|
|
1634
1636
|
onClick,
|
|
1635
1637
|
onKeyDown,
|
|
@@ -1645,6 +1647,7 @@ var IconButtonComponent = React17__namespace.forwardRef(
|
|
|
1645
1647
|
"loading",
|
|
1646
1648
|
"loadingVariant",
|
|
1647
1649
|
"iconSize",
|
|
1650
|
+
"asChild",
|
|
1648
1651
|
"children",
|
|
1649
1652
|
"onClick",
|
|
1650
1653
|
"onKeyDown",
|
|
@@ -1653,18 +1656,18 @@ var IconButtonComponent = React17__namespace.forwardRef(
|
|
|
1653
1656
|
var _a2, _b2;
|
|
1654
1657
|
const isToggle = variant === "toggle";
|
|
1655
1658
|
const isSelected = isToggle && !!selected;
|
|
1656
|
-
const resolvedColorClass =
|
|
1659
|
+
const resolvedColorClass = React13__namespace.useMemo(
|
|
1657
1660
|
() => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
|
|
1658
1661
|
[isSelected, colorStyle]
|
|
1659
1662
|
);
|
|
1660
|
-
const outlineWidthClass =
|
|
1663
|
+
const outlineWidthClass = React13__namespace.useMemo(
|
|
1661
1664
|
() => {
|
|
1662
1665
|
var _a3;
|
|
1663
1666
|
return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
|
|
1664
1667
|
},
|
|
1665
1668
|
[colorStyle, isSelected, size]
|
|
1666
1669
|
);
|
|
1667
|
-
const disabledBgClass =
|
|
1670
|
+
const disabledBgClass = React13__namespace.useMemo(
|
|
1668
1671
|
() => resolveDisabledBgClass(colorStyle),
|
|
1669
1672
|
[colorStyle]
|
|
1670
1673
|
);
|
|
@@ -1685,7 +1688,7 @@ var IconButtonComponent = React17__namespace.forwardRef(
|
|
|
1685
1688
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
1686
1689
|
disabled: loading
|
|
1687
1690
|
});
|
|
1688
|
-
const handleClick =
|
|
1691
|
+
const handleClick = React13__namespace.useCallback(
|
|
1689
1692
|
(e) => {
|
|
1690
1693
|
if (loading) {
|
|
1691
1694
|
e.preventDefault();
|
|
@@ -1695,7 +1698,7 @@ var IconButtonComponent = React17__namespace.forwardRef(
|
|
|
1695
1698
|
},
|
|
1696
1699
|
[loading, onClick]
|
|
1697
1700
|
);
|
|
1698
|
-
const handleKeyDown =
|
|
1701
|
+
const handleKeyDown = React13__namespace.useCallback(
|
|
1699
1702
|
(e) => {
|
|
1700
1703
|
if (loading) return;
|
|
1701
1704
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -1706,7 +1709,87 @@ var IconButtonComponent = React17__namespace.forwardRef(
|
|
|
1706
1709
|
},
|
|
1707
1710
|
[loading, onClick, onKeyDown]
|
|
1708
1711
|
);
|
|
1709
|
-
|
|
1712
|
+
const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1713
|
+
needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
|
|
1714
|
+
/* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
1715
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1716
|
+
react.m.span,
|
|
1717
|
+
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
1718
|
+
transition: SPRING_TRANSITION,
|
|
1719
|
+
className: cn(
|
|
1720
|
+
"flex items-center justify-center shrink-0",
|
|
1721
|
+
iconSize != null ? void 0 : iconClass
|
|
1722
|
+
),
|
|
1723
|
+
style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
|
|
1724
|
+
children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1725
|
+
LoadingIndicator,
|
|
1726
|
+
{
|
|
1727
|
+
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
1728
|
+
color: "currentColor",
|
|
1729
|
+
"aria-label": "Loading"
|
|
1730
|
+
}
|
|
1731
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1732
|
+
ProgressIndicator,
|
|
1733
|
+
{
|
|
1734
|
+
variant: "circular",
|
|
1735
|
+
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
1736
|
+
color: "currentColor",
|
|
1737
|
+
trackColor: "transparent",
|
|
1738
|
+
"aria-label": "Loading"
|
|
1739
|
+
}
|
|
1740
|
+
)
|
|
1741
|
+
}),
|
|
1742
|
+
"loading"
|
|
1743
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1744
|
+
react.m.span,
|
|
1745
|
+
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
1746
|
+
transition: SPRING_TRANSITION,
|
|
1747
|
+
"aria-hidden": "true",
|
|
1748
|
+
className: cn(
|
|
1749
|
+
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
|
|
1750
|
+
iconSize != null ? void 0 : iconClass
|
|
1751
|
+
),
|
|
1752
|
+
style: {
|
|
1753
|
+
fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
|
|
1754
|
+
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
1755
|
+
height: isCustomSize ? `${iconSize}px` : void 0
|
|
1756
|
+
},
|
|
1757
|
+
children: asChild ? React13__namespace.Children.only(children).props.children : children
|
|
1758
|
+
}),
|
|
1759
|
+
"content"
|
|
1760
|
+
) })
|
|
1761
|
+
] });
|
|
1762
|
+
const containerClassName = cn(
|
|
1763
|
+
baseIconButtonClasses,
|
|
1764
|
+
resolvedColorClass,
|
|
1765
|
+
outlineWidthClass,
|
|
1766
|
+
disabledBgClass,
|
|
1767
|
+
"overflow-hidden",
|
|
1768
|
+
SIZE_STYLES[size],
|
|
1769
|
+
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
1770
|
+
className
|
|
1771
|
+
);
|
|
1772
|
+
if (asChild) {
|
|
1773
|
+
const child = React13__namespace.Children.only(children);
|
|
1774
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1775
|
+
reactSlot.Slot,
|
|
1776
|
+
__spreadProps(__spreadValues({
|
|
1777
|
+
ref,
|
|
1778
|
+
"aria-pressed": isToggle ? isSelected : void 0,
|
|
1779
|
+
"aria-label": ariaLabel,
|
|
1780
|
+
"aria-busy": loading || void 0,
|
|
1781
|
+
"aria-disabled": loading || restProps.disabled,
|
|
1782
|
+
onClick: handleClick,
|
|
1783
|
+
onPointerDown,
|
|
1784
|
+
onKeyDown: handleKeyDown,
|
|
1785
|
+
style: __spreadProps(__spreadValues({}, style), { borderRadius: `${animateRadius}px` }),
|
|
1786
|
+
className: containerClassName
|
|
1787
|
+
}, restProps), {
|
|
1788
|
+
children: React13__namespace.cloneElement(child, { children: innerContent })
|
|
1789
|
+
})
|
|
1790
|
+
) });
|
|
1791
|
+
}
|
|
1792
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1710
1793
|
react.m.button,
|
|
1711
1794
|
__spreadProps(__spreadValues({
|
|
1712
1795
|
ref,
|
|
@@ -1722,79 +1805,21 @@ var IconButtonComponent = React17__namespace.forwardRef(
|
|
|
1722
1805
|
animate: { borderRadius: animateRadius },
|
|
1723
1806
|
whileTap: { borderRadius: pressedRadius },
|
|
1724
1807
|
transition: { borderRadius: SPRING_TRANSITION_FAST },
|
|
1725
|
-
className:
|
|
1726
|
-
baseIconButtonClasses,
|
|
1727
|
-
resolvedColorClass,
|
|
1728
|
-
outlineWidthClass,
|
|
1729
|
-
disabledBgClass,
|
|
1730
|
-
"overflow-hidden",
|
|
1731
|
-
SIZE_STYLES[size],
|
|
1732
|
-
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
1733
|
-
className
|
|
1734
|
-
)
|
|
1808
|
+
className: containerClassName
|
|
1735
1809
|
}, restProps), {
|
|
1736
|
-
children:
|
|
1737
|
-
needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
|
|
1738
|
-
/* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
1739
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1740
|
-
react.m.span,
|
|
1741
|
-
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
1742
|
-
transition: SPRING_TRANSITION,
|
|
1743
|
-
className: cn(
|
|
1744
|
-
"flex items-center justify-center shrink-0",
|
|
1745
|
-
iconSize != null ? void 0 : iconClass
|
|
1746
|
-
),
|
|
1747
|
-
style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
|
|
1748
|
-
children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1749
|
-
LoadingIndicator,
|
|
1750
|
-
{
|
|
1751
|
-
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
1752
|
-
color: "currentColor",
|
|
1753
|
-
"aria-label": "Loading"
|
|
1754
|
-
}
|
|
1755
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1756
|
-
ProgressIndicator,
|
|
1757
|
-
{
|
|
1758
|
-
variant: "circular",
|
|
1759
|
-
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
1760
|
-
color: "currentColor",
|
|
1761
|
-
trackColor: "transparent",
|
|
1762
|
-
"aria-label": "Loading"
|
|
1763
|
-
}
|
|
1764
|
-
)
|
|
1765
|
-
}),
|
|
1766
|
-
"loading"
|
|
1767
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1768
|
-
react.m.span,
|
|
1769
|
-
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
1770
|
-
transition: SPRING_TRANSITION,
|
|
1771
|
-
"aria-hidden": "true",
|
|
1772
|
-
className: cn(
|
|
1773
|
-
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
|
|
1774
|
-
iconSize != null ? void 0 : iconClass
|
|
1775
|
-
),
|
|
1776
|
-
style: {
|
|
1777
|
-
fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
|
|
1778
|
-
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
1779
|
-
height: isCustomSize ? `${iconSize}px` : void 0
|
|
1780
|
-
},
|
|
1781
|
-
children
|
|
1782
|
-
}),
|
|
1783
|
-
"content"
|
|
1784
|
-
) })
|
|
1785
|
-
]
|
|
1810
|
+
children: innerContent
|
|
1786
1811
|
})
|
|
1787
1812
|
) });
|
|
1788
1813
|
}
|
|
1789
1814
|
);
|
|
1790
1815
|
IconButtonComponent.displayName = "IconButton";
|
|
1791
|
-
var IconButton =
|
|
1816
|
+
var IconButton = React13__namespace.memo(IconButtonComponent);
|
|
1792
1817
|
var VARIANT_FONT = {
|
|
1793
1818
|
outlined: "'Material Symbols Outlined'",
|
|
1794
1819
|
rounded: "'Material Symbols Rounded'",
|
|
1795
1820
|
sharp: "'Material Symbols Sharp'"
|
|
1796
1821
|
};
|
|
1797
|
-
var IconComponent =
|
|
1822
|
+
var IconComponent = React13__namespace.forwardRef(
|
|
1798
1823
|
(_a, ref) => {
|
|
1799
1824
|
var _b = _a, {
|
|
1800
1825
|
name,
|
|
@@ -1860,7 +1885,7 @@ var IconComponent = React17__namespace.forwardRef(
|
|
|
1860
1885
|
}
|
|
1861
1886
|
);
|
|
1862
1887
|
IconComponent.displayName = "Icon";
|
|
1863
|
-
var Icon =
|
|
1888
|
+
var Icon = React13__namespace.memo(IconComponent);
|
|
1864
1889
|
var selectorClassName = "flex items-center gap-1 rounded-m3-full px-2 py-1 text-[length:var(--md-typescale-title-small-size,14px)] font-[number:var(--md-typescale-title-small-weight,500)] text-m3-on-surface transition-m3-fast-effects hover:bg-m3-on-surface/8 focus-visible:outline-2 focus-visible:outline-m3-primary";
|
|
1865
1890
|
var CalendarHeader = ({
|
|
1866
1891
|
displayedMonthMs,
|
|
@@ -2018,15 +2043,15 @@ var MonthPickerList = ({
|
|
|
2018
2043
|
locale,
|
|
2019
2044
|
onMonthSelect
|
|
2020
2045
|
}) => {
|
|
2021
|
-
const selectedRef =
|
|
2022
|
-
|
|
2046
|
+
const selectedRef = React13__namespace.useRef(null);
|
|
2047
|
+
React13__namespace.useEffect(() => {
|
|
2023
2048
|
var _a, _b;
|
|
2024
2049
|
(_b = (_a = selectedRef.current) == null ? void 0 : _a.scrollIntoView) == null ? void 0 : _b.call(_a, {
|
|
2025
2050
|
block: "center",
|
|
2026
2051
|
behavior: "instant"
|
|
2027
2052
|
});
|
|
2028
2053
|
}, []);
|
|
2029
|
-
const months =
|
|
2054
|
+
const months = React13__namespace.useMemo(
|
|
2030
2055
|
() => Array.from({ length: 12 }, (_, month) => month),
|
|
2031
2056
|
[]
|
|
2032
2057
|
);
|
|
@@ -2071,12 +2096,12 @@ var YearPickerList = ({
|
|
|
2071
2096
|
selectableDates,
|
|
2072
2097
|
onYearSelect
|
|
2073
2098
|
}) => {
|
|
2074
|
-
const selectedRef =
|
|
2075
|
-
const years =
|
|
2099
|
+
const selectedRef = React13__namespace.useRef(null);
|
|
2100
|
+
const years = React13__namespace.useMemo(() => {
|
|
2076
2101
|
const [min, max] = yearRange;
|
|
2077
2102
|
return Array.from({ length: max - min + 1 }, (_, index) => min + index);
|
|
2078
2103
|
}, [yearRange]);
|
|
2079
|
-
|
|
2104
|
+
React13__namespace.useEffect(() => {
|
|
2080
2105
|
var _a, _b;
|
|
2081
2106
|
(_b = (_a = selectedRef.current) == null ? void 0 : _a.scrollIntoView) == null ? void 0 : _b.call(_a, {
|
|
2082
2107
|
block: "center",
|
|
@@ -2147,17 +2172,17 @@ var DatePicker = ({
|
|
|
2147
2172
|
navigateToMonth,
|
|
2148
2173
|
setDisplayMode
|
|
2149
2174
|
} = state;
|
|
2150
|
-
const [activeSelector, setActiveSelector] =
|
|
2151
|
-
const [slideDirection, setSlideDirection] =
|
|
2152
|
-
const handlePrev =
|
|
2175
|
+
const [activeSelector, setActiveSelector] = React13__namespace.useState(null);
|
|
2176
|
+
const [slideDirection, setSlideDirection] = React13__namespace.useState(null);
|
|
2177
|
+
const handlePrev = React13__namespace.useCallback(() => {
|
|
2153
2178
|
setSlideDirection("prev");
|
|
2154
2179
|
navigateMonth2("prev");
|
|
2155
2180
|
}, [navigateMonth2]);
|
|
2156
|
-
const handleNext =
|
|
2181
|
+
const handleNext = React13__namespace.useCallback(() => {
|
|
2157
2182
|
setSlideDirection("next");
|
|
2158
2183
|
navigateMonth2("next");
|
|
2159
2184
|
}, [navigateMonth2]);
|
|
2160
|
-
const handleYearSelect =
|
|
2185
|
+
const handleYearSelect = React13__namespace.useCallback(
|
|
2161
2186
|
(year) => {
|
|
2162
2187
|
const d = new Date(displayedMonthMs);
|
|
2163
2188
|
navigateToMonth(year, d.getUTCMonth());
|
|
@@ -2165,7 +2190,7 @@ var DatePicker = ({
|
|
|
2165
2190
|
},
|
|
2166
2191
|
[displayedMonthMs, navigateToMonth]
|
|
2167
2192
|
);
|
|
2168
|
-
const handleMonthSelect =
|
|
2193
|
+
const handleMonthSelect = React13__namespace.useCallback(
|
|
2169
2194
|
(month) => {
|
|
2170
2195
|
const d = new Date(displayedMonthMs);
|
|
2171
2196
|
navigateToMonth(d.getUTCFullYear(), month);
|
|
@@ -2173,11 +2198,11 @@ var DatePicker = ({
|
|
|
2173
2198
|
},
|
|
2174
2199
|
[displayedMonthMs, navigateToMonth]
|
|
2175
2200
|
);
|
|
2176
|
-
const [inputValue, setInputValue] =
|
|
2201
|
+
const [inputValue, setInputValue] = React13__namespace.useState(
|
|
2177
2202
|
() => selectedDateMs !== null ? formatInputDate(selectedDateMs) : ""
|
|
2178
2203
|
);
|
|
2179
|
-
const [inputError, setInputError] =
|
|
2180
|
-
const handleInputCommit =
|
|
2204
|
+
const [inputError, setInputError] = React13__namespace.useState();
|
|
2205
|
+
const handleInputCommit = React13__namespace.useCallback(
|
|
2181
2206
|
(ms) => {
|
|
2182
2207
|
if (ms === null && inputValue.length > 0) {
|
|
2183
2208
|
setInputError("Invalid date");
|
|
@@ -2411,7 +2436,7 @@ var DP_CLASSES = {
|
|
|
2411
2436
|
/** Weekday header row */
|
|
2412
2437
|
weekdayRow: "text-[length:var(--md-typescale-body-large-size,14px)] text-m3-on-surface"
|
|
2413
2438
|
};
|
|
2414
|
-
var ScrollArea =
|
|
2439
|
+
var ScrollArea = React13__namespace.forwardRef(
|
|
2415
2440
|
(_a, ref) => {
|
|
2416
2441
|
var _b = _a, {
|
|
2417
2442
|
className,
|
|
@@ -2432,15 +2457,15 @@ var ScrollArea = React17__namespace.forwardRef(
|
|
|
2432
2457
|
"viewportRef",
|
|
2433
2458
|
"viewportProps"
|
|
2434
2459
|
]);
|
|
2435
|
-
const [isTouchDevice, setIsTouchDevice] =
|
|
2436
|
-
|
|
2460
|
+
const [isTouchDevice, setIsTouchDevice] = React13__namespace.useState(false);
|
|
2461
|
+
React13__namespace.useEffect(() => {
|
|
2437
2462
|
if (typeof window !== "undefined") {
|
|
2438
2463
|
setIsTouchDevice(
|
|
2439
2464
|
"ontouchstart" in window || navigator.maxTouchPoints > 0
|
|
2440
2465
|
);
|
|
2441
2466
|
}
|
|
2442
2467
|
}, []);
|
|
2443
|
-
const resolvedType =
|
|
2468
|
+
const resolvedType = React13__namespace.useMemo(() => {
|
|
2444
2469
|
if (type === "hover" && isTouchDevice) {
|
|
2445
2470
|
return "scroll";
|
|
2446
2471
|
}
|
|
@@ -2491,7 +2516,7 @@ var ScrollArea = React17__namespace.forwardRef(
|
|
|
2491
2516
|
}
|
|
2492
2517
|
);
|
|
2493
2518
|
ScrollArea.displayName = "ScrollArea";
|
|
2494
|
-
var ScrollAreaScrollbar =
|
|
2519
|
+
var ScrollAreaScrollbar = React13__namespace.forwardRef((_a, ref) => {
|
|
2495
2520
|
var _b = _a, { className, orientation = "vertical" } = _b, props = __objRest(_b, ["className", "orientation"]);
|
|
2496
2521
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2497
2522
|
RadixScrollArea__namespace.Scrollbar,
|
|
@@ -2521,7 +2546,7 @@ var ScrollAreaScrollbar = React17__namespace.forwardRef((_a, ref) => {
|
|
|
2521
2546
|
);
|
|
2522
2547
|
});
|
|
2523
2548
|
ScrollAreaScrollbar.displayName = RadixScrollArea__namespace.Scrollbar.displayName;
|
|
2524
|
-
var ScrollAreaCorner =
|
|
2549
|
+
var ScrollAreaCorner = React13__namespace.forwardRef((_a, ref) => {
|
|
2525
2550
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2526
2551
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2527
2552
|
RadixScrollArea__namespace.Corner,
|
|
@@ -2563,9 +2588,9 @@ DialogTrigger.displayName = "DialogTrigger";
|
|
|
2563
2588
|
var DialogPortal = ({
|
|
2564
2589
|
open,
|
|
2565
2590
|
children
|
|
2566
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Portal, { forceMount: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: open ?
|
|
2591
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Portal, { forceMount: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: open ? React13__namespace.Children.toArray(children) : null }) });
|
|
2567
2592
|
DialogPortal.displayName = "DialogPortal";
|
|
2568
|
-
var DialogOverlay =
|
|
2593
|
+
var DialogOverlay = React13__namespace.forwardRef((_a, ref) => {
|
|
2569
2594
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2570
2595
|
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Overlay, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2571
2596
|
react.m.div,
|
|
@@ -2576,7 +2601,7 @@ var DialogOverlay = React17__namespace.forwardRef((_a, ref) => {
|
|
|
2576
2601
|
) }));
|
|
2577
2602
|
});
|
|
2578
2603
|
DialogOverlay.displayName = "DialogOverlay";
|
|
2579
|
-
var DialogContent =
|
|
2604
|
+
var DialogContent = React13__namespace.forwardRef((_a, ref) => {
|
|
2580
2605
|
var _b = _a, { className, children, hideCloseButton = false } = _b, props = __objRest(_b, ["className", "children", "hideCloseButton"]);
|
|
2581
2606
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2582
2607
|
RadixDialog__namespace.Content,
|
|
@@ -2616,7 +2641,7 @@ var DialogContent = React17__namespace.forwardRef((_a, ref) => {
|
|
|
2616
2641
|
);
|
|
2617
2642
|
});
|
|
2618
2643
|
DialogContent.displayName = "DialogContent";
|
|
2619
|
-
var DialogIcon =
|
|
2644
|
+
var DialogIcon = React13__namespace.forwardRef((_a, ref) => {
|
|
2620
2645
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
2621
2646
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2622
2647
|
"div",
|
|
@@ -2630,7 +2655,7 @@ var DialogIcon = React17__namespace.forwardRef((_a, ref) => {
|
|
|
2630
2655
|
);
|
|
2631
2656
|
});
|
|
2632
2657
|
DialogIcon.displayName = "DialogIcon";
|
|
2633
|
-
var DialogTitle =
|
|
2658
|
+
var DialogTitle = React13__namespace.forwardRef((_a, ref) => {
|
|
2634
2659
|
var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
2635
2660
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2636
2661
|
RadixDialog__namespace.Title,
|
|
@@ -2645,7 +2670,7 @@ var DialogTitle = React17__namespace.forwardRef((_a, ref) => {
|
|
|
2645
2670
|
);
|
|
2646
2671
|
});
|
|
2647
2672
|
DialogTitle.displayName = "DialogTitle";
|
|
2648
|
-
var DialogDescription =
|
|
2673
|
+
var DialogDescription = React13__namespace.forwardRef((_a, ref) => {
|
|
2649
2674
|
var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
2650
2675
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2651
2676
|
RadixDialog__namespace.Description,
|
|
@@ -2657,7 +2682,7 @@ var DialogDescription = React17__namespace.forwardRef((_a, ref) => {
|
|
|
2657
2682
|
);
|
|
2658
2683
|
});
|
|
2659
2684
|
DialogDescription.displayName = "DialogDescription";
|
|
2660
|
-
var DialogBody =
|
|
2685
|
+
var DialogBody = React13__namespace.forwardRef((_a, ref) => {
|
|
2661
2686
|
var _b = _a, { className, children, dir } = _b, props = __objRest(_b, ["className", "children", "dir"]);
|
|
2662
2687
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2663
2688
|
ScrollArea,
|
|
@@ -2673,7 +2698,7 @@ var DialogBody = React17__namespace.forwardRef((_a, ref) => {
|
|
|
2673
2698
|
);
|
|
2674
2699
|
});
|
|
2675
2700
|
DialogBody.displayName = "DialogBody";
|
|
2676
|
-
var DialogFullScreenContent =
|
|
2701
|
+
var DialogFullScreenContent = React13__namespace.forwardRef(
|
|
2677
2702
|
(_a, ref) => {
|
|
2678
2703
|
var _b = _a, {
|
|
2679
2704
|
className,
|
|
@@ -2821,17 +2846,17 @@ var DateRangePicker = ({
|
|
|
2821
2846
|
navigateToMonth,
|
|
2822
2847
|
setDisplayMode
|
|
2823
2848
|
} = state;
|
|
2824
|
-
const [activeSelector, setActiveSelector] =
|
|
2825
|
-
const [slideDirection, setSlideDirection] =
|
|
2826
|
-
const handlePrev =
|
|
2849
|
+
const [activeSelector, setActiveSelector] = React13__namespace.useState(null);
|
|
2850
|
+
const [slideDirection, setSlideDirection] = React13__namespace.useState(null);
|
|
2851
|
+
const handlePrev = React13__namespace.useCallback(() => {
|
|
2827
2852
|
setSlideDirection("prev");
|
|
2828
2853
|
navigateMonth2("prev");
|
|
2829
2854
|
}, [navigateMonth2]);
|
|
2830
|
-
const handleNext =
|
|
2855
|
+
const handleNext = React13__namespace.useCallback(() => {
|
|
2831
2856
|
setSlideDirection("next");
|
|
2832
2857
|
navigateMonth2("next");
|
|
2833
2858
|
}, [navigateMonth2]);
|
|
2834
|
-
const handleYearSelect =
|
|
2859
|
+
const handleYearSelect = React13__namespace.useCallback(
|
|
2835
2860
|
(year) => {
|
|
2836
2861
|
const d = new Date(displayedMonthMs);
|
|
2837
2862
|
navigateToMonth(year, d.getUTCMonth());
|
|
@@ -2839,7 +2864,7 @@ var DateRangePicker = ({
|
|
|
2839
2864
|
},
|
|
2840
2865
|
[displayedMonthMs, navigateToMonth]
|
|
2841
2866
|
);
|
|
2842
|
-
const handleMonthSelect =
|
|
2867
|
+
const handleMonthSelect = React13__namespace.useCallback(
|
|
2843
2868
|
(month) => {
|
|
2844
2869
|
const d = new Date(displayedMonthMs);
|
|
2845
2870
|
navigateToMonth(d.getUTCFullYear(), month);
|
|
@@ -2847,7 +2872,7 @@ var DateRangePicker = ({
|
|
|
2847
2872
|
},
|
|
2848
2873
|
[displayedMonthMs, navigateToMonth]
|
|
2849
2874
|
);
|
|
2850
|
-
const formatShort =
|
|
2875
|
+
const formatShort = React13__namespace.useCallback(
|
|
2851
2876
|
(ms) => {
|
|
2852
2877
|
if (ms === null) return "\u2014";
|
|
2853
2878
|
return formatDate(ms, locale, {
|
|
@@ -2985,12 +3010,12 @@ var useDatePickerState = (options) => {
|
|
|
2985
3010
|
const selectableDates = (_d = options == null ? void 0 : options.selectableDates) != null ? _d : ALL_DATES_SELECTABLE;
|
|
2986
3011
|
const initialDisplayMode = (_e = options == null ? void 0 : options.initialDisplayMode) != null ? _e : DEFAULT_DISPLAY_MODE;
|
|
2987
3012
|
const locale = resolveLocale(options == null ? void 0 : options.locale);
|
|
2988
|
-
const [selectedDateMs, setSelectedDateMs] =
|
|
3013
|
+
const [selectedDateMs, setSelectedDateMs] = React13.useState(
|
|
2989
3014
|
initialSelectedMs !== null ? startOfDayUTC(initialSelectedMs) : null
|
|
2990
3015
|
);
|
|
2991
|
-
const [displayedMonthMs, setDisplayedMonthMs] =
|
|
2992
|
-
const [displayMode, setDisplayModeState] =
|
|
2993
|
-
const selectDate =
|
|
3016
|
+
const [displayedMonthMs, setDisplayedMonthMs] = React13.useState(initialMonthMs);
|
|
3017
|
+
const [displayMode, setDisplayModeState] = React13.useState(initialDisplayMode);
|
|
3018
|
+
const selectDate = React13.useCallback(
|
|
2994
3019
|
(ms) => {
|
|
2995
3020
|
if (ms === null) {
|
|
2996
3021
|
setSelectedDateMs(null);
|
|
@@ -3003,7 +3028,7 @@ var useDatePickerState = (options) => {
|
|
|
3003
3028
|
},
|
|
3004
3029
|
[selectableDates]
|
|
3005
3030
|
);
|
|
3006
|
-
const navigateMonthAction =
|
|
3031
|
+
const navigateMonthAction = React13.useCallback(
|
|
3007
3032
|
(direction) => {
|
|
3008
3033
|
setDisplayedMonthMs(
|
|
3009
3034
|
(prev) => {
|
|
@@ -3014,24 +3039,24 @@ var useDatePickerState = (options) => {
|
|
|
3014
3039
|
},
|
|
3015
3040
|
[yearRange, selectableDates]
|
|
3016
3041
|
);
|
|
3017
|
-
const navigateToMonth =
|
|
3042
|
+
const navigateToMonth = React13.useCallback(
|
|
3018
3043
|
(year, month) => {
|
|
3019
3044
|
if (!isMonthNavigable(year, yearRange, selectableDates)) return;
|
|
3020
3045
|
setDisplayedMonthMs(Date.UTC(year, month, 1));
|
|
3021
3046
|
},
|
|
3022
3047
|
[yearRange, selectableDates]
|
|
3023
3048
|
);
|
|
3024
|
-
const setDisplayMode =
|
|
3049
|
+
const setDisplayMode = React13.useCallback((mode) => {
|
|
3025
3050
|
setDisplayModeState(mode);
|
|
3026
3051
|
}, []);
|
|
3027
|
-
const reset =
|
|
3052
|
+
const reset = React13.useCallback(() => {
|
|
3028
3053
|
setSelectedDateMs(
|
|
3029
3054
|
initialSelectedMs !== null ? startOfDayUTC(initialSelectedMs) : null
|
|
3030
3055
|
);
|
|
3031
3056
|
setDisplayedMonthMs(initialMonthMs);
|
|
3032
3057
|
setDisplayModeState(initialDisplayMode);
|
|
3033
3058
|
}, [initialSelectedMs, initialMonthMs, initialDisplayMode]);
|
|
3034
|
-
return
|
|
3059
|
+
return React13.useMemo(
|
|
3035
3060
|
() => ({
|
|
3036
3061
|
selectedDateMs,
|
|
3037
3062
|
displayedMonthMs,
|
|
@@ -3090,13 +3115,13 @@ var useDateRangePickerState = (options) => {
|
|
|
3090
3115
|
const selectableDates = (_c = options == null ? void 0 : options.selectableDates) != null ? _c : ALL_DATES_SELECTABLE;
|
|
3091
3116
|
const initialDisplayMode = (_d = options == null ? void 0 : options.initialDisplayMode) != null ? _d : "picker";
|
|
3092
3117
|
const locale = resolveLocale(options == null ? void 0 : options.locale);
|
|
3093
|
-
const [{ startMs: selectedStartMs, endMs: selectedEndMs }, dispatch] =
|
|
3118
|
+
const [{ startMs: selectedStartMs, endMs: selectedEndMs }, dispatch] = React13.useReducer(rangeReducer, {
|
|
3094
3119
|
startMs: initialStartMs,
|
|
3095
3120
|
endMs: initialEndMs
|
|
3096
3121
|
});
|
|
3097
|
-
const [displayedMonthMs, setDisplayedMonthMs] =
|
|
3098
|
-
const [displayMode, setDisplayModeState] =
|
|
3099
|
-
const selectDate =
|
|
3122
|
+
const [displayedMonthMs, setDisplayedMonthMs] = React13.useState(initialMonthMs);
|
|
3123
|
+
const [displayMode, setDisplayModeState] = React13.useState(initialDisplayMode);
|
|
3124
|
+
const selectDate = React13.useCallback(
|
|
3100
3125
|
(ms) => {
|
|
3101
3126
|
const normalized = startOfDayUTC(ms);
|
|
3102
3127
|
if (!selectableDates.isSelectableDate(normalized)) return;
|
|
@@ -3104,10 +3129,10 @@ var useDateRangePickerState = (options) => {
|
|
|
3104
3129
|
},
|
|
3105
3130
|
[selectableDates]
|
|
3106
3131
|
);
|
|
3107
|
-
const clearRange =
|
|
3132
|
+
const clearRange = React13.useCallback(() => {
|
|
3108
3133
|
dispatch({ type: "CLEAR" });
|
|
3109
3134
|
}, []);
|
|
3110
|
-
const navigateMonthAction =
|
|
3135
|
+
const navigateMonthAction = React13.useCallback(
|
|
3111
3136
|
(direction) => {
|
|
3112
3137
|
setDisplayedMonthMs(
|
|
3113
3138
|
(prev) => {
|
|
@@ -3118,22 +3143,22 @@ var useDateRangePickerState = (options) => {
|
|
|
3118
3143
|
},
|
|
3119
3144
|
[yearRange, selectableDates]
|
|
3120
3145
|
);
|
|
3121
|
-
const navigateToMonth =
|
|
3146
|
+
const navigateToMonth = React13.useCallback(
|
|
3122
3147
|
(year, month) => {
|
|
3123
3148
|
if (!isMonthNavigable(year, yearRange, selectableDates)) return;
|
|
3124
3149
|
setDisplayedMonthMs(Date.UTC(year, month, 1));
|
|
3125
3150
|
},
|
|
3126
3151
|
[yearRange, selectableDates]
|
|
3127
3152
|
);
|
|
3128
|
-
const setDisplayMode =
|
|
3153
|
+
const setDisplayMode = React13.useCallback((mode) => {
|
|
3129
3154
|
setDisplayModeState(mode);
|
|
3130
3155
|
}, []);
|
|
3131
|
-
const reset =
|
|
3156
|
+
const reset = React13.useCallback(() => {
|
|
3132
3157
|
dispatch({ type: "RESET", startMs: initialStartMs, endMs: initialEndMs });
|
|
3133
3158
|
setDisplayedMonthMs(initialMonthMs);
|
|
3134
3159
|
setDisplayModeState(initialDisplayMode);
|
|
3135
3160
|
}, [initialStartMs, initialEndMs, initialMonthMs, initialDisplayMode]);
|
|
3136
|
-
return
|
|
3161
|
+
return React13.useMemo(
|
|
3137
3162
|
() => ({
|
|
3138
3163
|
selectedStartMs,
|
|
3139
3164
|
selectedEndMs,
|
|
@@ -3452,16 +3477,16 @@ var InputField = ({
|
|
|
3452
3477
|
onBlur,
|
|
3453
3478
|
className
|
|
3454
3479
|
}) => {
|
|
3455
|
-
const [inputText, setInputText] =
|
|
3480
|
+
const [inputText, setInputText] = React13__namespace.useState(
|
|
3456
3481
|
String(value).padStart(2, "0")
|
|
3457
3482
|
);
|
|
3458
|
-
const inputRef =
|
|
3459
|
-
|
|
3483
|
+
const inputRef = React13__namespace.useRef(null);
|
|
3484
|
+
React13__namespace.useEffect(() => {
|
|
3460
3485
|
if (!isFocused) {
|
|
3461
3486
|
setInputText(String(value).padStart(2, "0"));
|
|
3462
3487
|
}
|
|
3463
3488
|
}, [value, isFocused]);
|
|
3464
|
-
|
|
3489
|
+
React13__namespace.useEffect(() => {
|
|
3465
3490
|
var _a, _b;
|
|
3466
3491
|
if (isFocused) {
|
|
3467
3492
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
@@ -3551,7 +3576,7 @@ var InputField = ({
|
|
|
3551
3576
|
};
|
|
3552
3577
|
var TimeInput = ({ state, className }) => {
|
|
3553
3578
|
const { is24hour, setHourInput, setMinuteInput, setSelection } = state;
|
|
3554
|
-
const [focusedField, setFocusedField] =
|
|
3579
|
+
const [focusedField, setFocusedField] = React13__namespace.useState(null);
|
|
3555
3580
|
const handleHourAutoAdvance = () => {
|
|
3556
3581
|
setFocusedField("minute");
|
|
3557
3582
|
setSelection("minute");
|
|
@@ -3745,17 +3770,17 @@ var ClockDial = ({
|
|
|
3745
3770
|
setMinute,
|
|
3746
3771
|
setSelection
|
|
3747
3772
|
} = state;
|
|
3748
|
-
const displayAngle =
|
|
3773
|
+
const displayAngle = React13__namespace.useMemo(() => {
|
|
3749
3774
|
if (selection === "hour") {
|
|
3750
3775
|
return valueToAngle(hour, "hour");
|
|
3751
3776
|
}
|
|
3752
3777
|
return valueToAngle(minute, "minute");
|
|
3753
3778
|
}, [selection, hour, minute]);
|
|
3754
|
-
const selectorPos =
|
|
3779
|
+
const selectorPos = React13__namespace.useMemo(
|
|
3755
3780
|
() => getSelectorPosition(displayAngle, selection, is24hour, isPm),
|
|
3756
3781
|
[displayAngle, selection, is24hour, isPm]
|
|
3757
3782
|
);
|
|
3758
|
-
const trackEnd =
|
|
3783
|
+
const trackEnd = React13__namespace.useMemo(() => {
|
|
3759
3784
|
const dx = selectorPos.x - CENTER;
|
|
3760
3785
|
const dy = selectorPos.y - CENTER;
|
|
3761
3786
|
const length = Math.hypot(dx, dy);
|
|
@@ -3765,13 +3790,13 @@ var ClockDial = ({
|
|
|
3765
3790
|
y: selectorPos.y - dy / length * HANDLE_RADIUS
|
|
3766
3791
|
};
|
|
3767
3792
|
}, [selectorPos]);
|
|
3768
|
-
const numbers =
|
|
3793
|
+
const numbers = React13__namespace.useMemo(() => {
|
|
3769
3794
|
if (selection === "minute") return buildMinuteNumbers();
|
|
3770
3795
|
if (is24hour) return buildHour24Numbers();
|
|
3771
3796
|
return buildHour12Numbers();
|
|
3772
3797
|
}, [selection, is24hour]);
|
|
3773
|
-
const isDragging =
|
|
3774
|
-
const svgRef =
|
|
3798
|
+
const isDragging = React13__namespace.useRef(false);
|
|
3799
|
+
const svgRef = React13__namespace.useRef(null);
|
|
3775
3800
|
const getSVGPoint = (e) => {
|
|
3776
3801
|
const svg = svgRef.current;
|
|
3777
3802
|
if (!svg) return { x: e.clientX, y: e.clientY };
|
|
@@ -3921,8 +3946,8 @@ var getAutoLayout = () => {
|
|
|
3921
3946
|
return innerWidth >= 600 && innerHeight >= 300 && innerWidth >= innerHeight ? "horizontal" : "vertical";
|
|
3922
3947
|
};
|
|
3923
3948
|
var useResolvedLayout = (layout) => {
|
|
3924
|
-
const [autoLayout, setAutoLayout] =
|
|
3925
|
-
|
|
3949
|
+
const [autoLayout, setAutoLayout] = React13__namespace.useState("vertical");
|
|
3950
|
+
React13__namespace.useEffect(() => {
|
|
3926
3951
|
if (layout !== "auto") return;
|
|
3927
3952
|
const updateLayout = () => setAutoLayout(getAutoLayout());
|
|
3928
3953
|
updateLayout();
|
|
@@ -4116,18 +4141,18 @@ var useTimePickerState = (options) => {
|
|
|
4116
4141
|
const initialHour = clamp((_a = options == null ? void 0 : options.initialHour) != null ? _a : 0, 0, 23);
|
|
4117
4142
|
const initialMinute = clamp((_b = options == null ? void 0 : options.initialMinute) != null ? _b : 0, 0, 59);
|
|
4118
4143
|
const is24hour = (_c = options == null ? void 0 : options.is24hour) != null ? _c : false;
|
|
4119
|
-
const [hour, setHourState] =
|
|
4120
|
-
const [minute, setMinuteState] =
|
|
4121
|
-
const [hourInput, setHourInputState] =
|
|
4144
|
+
const [hour, setHourState] = React13.useState(initialHour);
|
|
4145
|
+
const [minute, setMinuteState] = React13.useState(initialMinute);
|
|
4146
|
+
const [hourInput, setHourInputState] = React13.useState(
|
|
4122
4147
|
is24hour ? initialHour : to12Hour(initialHour)
|
|
4123
4148
|
);
|
|
4124
|
-
const [minuteInput, setMinuteInputState] =
|
|
4125
|
-
const [selection, setSelectionState] =
|
|
4149
|
+
const [minuteInput, setMinuteInputState] = React13.useState(initialMinute);
|
|
4150
|
+
const [selection, setSelectionState] = React13.useState("hour");
|
|
4126
4151
|
const isPm = hour >= 12;
|
|
4127
4152
|
const isHourInputValid = isValidHourInput(hourInput, is24hour);
|
|
4128
4153
|
const isMinuteInputValid = isValidMinuteInput(minuteInput);
|
|
4129
4154
|
const isInputValid = isHourInputValid && isMinuteInputValid;
|
|
4130
|
-
const setHour =
|
|
4155
|
+
const setHour = React13.useCallback(
|
|
4131
4156
|
(h) => {
|
|
4132
4157
|
const clamped = clamp(h, 0, 23);
|
|
4133
4158
|
setHourState(clamped);
|
|
@@ -4135,12 +4160,12 @@ var useTimePickerState = (options) => {
|
|
|
4135
4160
|
},
|
|
4136
4161
|
[is24hour]
|
|
4137
4162
|
);
|
|
4138
|
-
const setMinute =
|
|
4163
|
+
const setMinute = React13.useCallback((m11) => {
|
|
4139
4164
|
const clamped = clamp(m11, 0, 59);
|
|
4140
4165
|
setMinuteState(clamped);
|
|
4141
4166
|
setMinuteInputState(clamped);
|
|
4142
4167
|
}, []);
|
|
4143
|
-
const setHourInput =
|
|
4168
|
+
const setHourInput = React13.useCallback(
|
|
4144
4169
|
(h) => {
|
|
4145
4170
|
setHourInputState(h);
|
|
4146
4171
|
if (isValidHourInput(h, is24hour)) {
|
|
@@ -4150,16 +4175,16 @@ var useTimePickerState = (options) => {
|
|
|
4150
4175
|
},
|
|
4151
4176
|
[is24hour, isPm]
|
|
4152
4177
|
);
|
|
4153
|
-
const setMinuteInput =
|
|
4178
|
+
const setMinuteInput = React13.useCallback((m11) => {
|
|
4154
4179
|
setMinuteInputState(m11);
|
|
4155
4180
|
if (isValidMinuteInput(m11)) {
|
|
4156
4181
|
setMinuteState(m11);
|
|
4157
4182
|
}
|
|
4158
4183
|
}, []);
|
|
4159
|
-
const setSelection =
|
|
4184
|
+
const setSelection = React13.useCallback((mode) => {
|
|
4160
4185
|
setSelectionState(mode);
|
|
4161
4186
|
}, []);
|
|
4162
|
-
const setIsPm =
|
|
4187
|
+
const setIsPm = React13.useCallback((pm) => {
|
|
4163
4188
|
setHourState((prev) => {
|
|
4164
4189
|
const wasAlreadyPm = prev >= 12;
|
|
4165
4190
|
if (pm === wasAlreadyPm) return prev;
|
|
@@ -4169,14 +4194,14 @@ var useTimePickerState = (options) => {
|
|
|
4169
4194
|
return clamped;
|
|
4170
4195
|
});
|
|
4171
4196
|
}, []);
|
|
4172
|
-
const reset =
|
|
4197
|
+
const reset = React13.useCallback(() => {
|
|
4173
4198
|
setHourState(initialHour);
|
|
4174
4199
|
setMinuteState(initialMinute);
|
|
4175
4200
|
setHourInputState(is24hour ? initialHour : to12Hour(initialHour));
|
|
4176
4201
|
setMinuteInputState(initialMinute);
|
|
4177
4202
|
setSelectionState("hour");
|
|
4178
4203
|
}, [initialHour, initialMinute, is24hour]);
|
|
4179
|
-
return
|
|
4204
|
+
return React13.useMemo(
|
|
4180
4205
|
() => ({
|
|
4181
4206
|
hour,
|
|
4182
4207
|
minute,
|