@bug-on/m3-expressive 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/buttons.js +53 -39
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +53 -39
- package/dist/buttons.mjs.map +1 -1
- package/dist/core.js +54 -40
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +54 -40
- package/dist/core.mjs.map +1 -1
- package/dist/feedback.js +53 -39
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs +53 -39
- package/dist/feedback.mjs.map +1 -1
- package/dist/index.js +54 -40
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -40
- package/dist/index.mjs.map +1 -1
- package/dist/layout.js +54 -40
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +54 -40
- package/dist/layout.mjs.map +1 -1
- package/dist/navigation.js +53 -39
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +53 -39
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.js +53 -39
- package/dist/overlays.js.map +1 -1
- package/dist/overlays.mjs +53 -39
- package/dist/overlays.mjs.map +1 -1
- package/dist/pickers.js +53 -39
- package/dist/pickers.js.map +1 -1
- package/dist/pickers.mjs +53 -39
- package/dist/pickers.mjs.map +1 -1
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -667,24 +667,36 @@ function generateWavyCircularPath(center, radius, amplitude, wavelength) {
|
|
|
667
667
|
if (i === 0) d += `M ${xAt(t0).toFixed(2)} ${yAt(t0).toFixed(2)}`;
|
|
668
668
|
d += ` C ${cp1x.toFixed(2)} ${cp1y.toFixed(2)}, ${cp2x.toFixed(2)} ${cp2y.toFixed(2)}, ${xAt(t1).toFixed(2)} ${yAt(t1).toFixed(2)}`;
|
|
669
669
|
}
|
|
670
|
-
d += " Z";
|
|
671
670
|
return d;
|
|
672
671
|
}
|
|
673
672
|
function getSinePath(startX, endX, phase, wl, amp) {
|
|
674
673
|
if (startX >= endX) return "";
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
674
|
+
if (amp <= 0.01) {
|
|
675
|
+
return `M ${startX.toFixed(2)} 0 L ${endX.toFixed(2)} 0`;
|
|
676
|
+
}
|
|
677
|
+
const safeWl = Math.max(1, wl);
|
|
678
|
+
const k = 2 * Math.PI / safeWl;
|
|
679
|
+
const phi = phase / safeWl * 2 * Math.PI;
|
|
680
|
+
const yAt = (x) => amp * Math.sin(k * x + phi);
|
|
681
|
+
const dyAt = (x) => amp * k * Math.cos(k * x + phi);
|
|
682
|
+
const step = safeWl / 4;
|
|
683
|
+
let d = `M ${startX.toFixed(2)} ${yAt(startX).toFixed(2)}`;
|
|
684
|
+
let currentX = startX;
|
|
685
|
+
while (currentX < endX) {
|
|
686
|
+
const nextX = Math.min(endX, currentX + step);
|
|
687
|
+
const dx = nextX - currentX;
|
|
688
|
+
const scale = dx / 3;
|
|
689
|
+
const y0 = yAt(currentX);
|
|
690
|
+
const dy0 = dyAt(currentX);
|
|
691
|
+
const y1 = yAt(nextX);
|
|
692
|
+
const dy1 = dyAt(nextX);
|
|
693
|
+
const cp1x = currentX + scale;
|
|
694
|
+
const cp1y = y0 + scale * dy0;
|
|
695
|
+
const cp2x = nextX - scale;
|
|
696
|
+
const cp2y = y1 - scale * dy1;
|
|
697
|
+
d += ` C ${cp1x.toFixed(2)} ${cp1y.toFixed(2)}, ${cp2x.toFixed(2)} ${cp2y.toFixed(2)}, ${nextX.toFixed(2)} ${y1.toFixed(2)}`;
|
|
698
|
+
currentX = nextX;
|
|
699
|
+
}
|
|
688
700
|
return d;
|
|
689
701
|
}
|
|
690
702
|
var CircularProgress = React11__namespace.forwardRef(
|
|
@@ -839,16 +851,13 @@ var CircularProgress = React11__namespace.forwardRef(
|
|
|
839
851
|
position: "absolute",
|
|
840
852
|
inset: 0,
|
|
841
853
|
overflow: "visible",
|
|
842
|
-
rotate: "-90deg",
|
|
843
854
|
transformOrigin: "center"
|
|
844
855
|
},
|
|
845
|
-
animate: { rotate: [
|
|
856
|
+
animate: { rotate: [0, 360] },
|
|
846
857
|
transition: {
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
ease: "linear"
|
|
851
|
-
}
|
|
858
|
+
duration: 2 / Math.max(0.1, crawlerSpeed),
|
|
859
|
+
repeat: Number.POSITIVE_INFINITY,
|
|
860
|
+
ease: "linear"
|
|
852
861
|
},
|
|
853
862
|
children: [
|
|
854
863
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -861,17 +870,16 @@ var CircularProgress = React11__namespace.forwardRef(
|
|
|
861
870
|
stroke: bgTrackColor,
|
|
862
871
|
strokeWidth: trackHeight,
|
|
863
872
|
strokeLinecap: "round",
|
|
864
|
-
style: { originX: "50%", originY: "50%" },
|
|
865
873
|
animate: {
|
|
866
874
|
pathLength: [
|
|
867
|
-
Math.max(1e-3,
|
|
868
|
-
Math.max(1e-3,
|
|
869
|
-
Math.max(1e-3,
|
|
875
|
+
Math.max(1e-3, 0.9 - 2 * gapForTrack),
|
|
876
|
+
Math.max(1e-3, 0.25 - 2 * gapForTrack),
|
|
877
|
+
Math.max(1e-3, 0.9 - 2 * gapForTrack)
|
|
870
878
|
],
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
879
|
+
pathOffset: [
|
|
880
|
+
0.1 + gapForTrack,
|
|
881
|
+
0.75 + gapForTrack,
|
|
882
|
+
0.1 + gapForTrack
|
|
875
883
|
]
|
|
876
884
|
},
|
|
877
885
|
transition: {
|
|
@@ -889,10 +897,9 @@ var CircularProgress = React11__namespace.forwardRef(
|
|
|
889
897
|
stroke: activeColor,
|
|
890
898
|
strokeWidth: trackHeight,
|
|
891
899
|
strokeLinecap: "round",
|
|
892
|
-
style: { originX: "50%", originY: "50%" },
|
|
893
900
|
animate: {
|
|
894
901
|
pathLength: [0.1, 0.75, 0.1],
|
|
895
|
-
|
|
902
|
+
pathOffset: [0, 0.65, 1]
|
|
896
903
|
},
|
|
897
904
|
transition: {
|
|
898
905
|
duration: 2 / Math.max(0.1, crawlerSpeed),
|
|
@@ -910,10 +917,9 @@ var CircularProgress = React11__namespace.forwardRef(
|
|
|
910
917
|
stroke: activeColor,
|
|
911
918
|
strokeWidth: trackHeight,
|
|
912
919
|
strokeLinecap: "round",
|
|
913
|
-
style: { originX: "50%", originY: "50%" },
|
|
914
920
|
animate: {
|
|
915
921
|
pathLength: [0.1, 0.75, 0.1],
|
|
916
|
-
|
|
922
|
+
pathOffset: [0, 0.65, 1]
|
|
917
923
|
},
|
|
918
924
|
transition: {
|
|
919
925
|
duration: 2 / Math.max(0.1, crawlerSpeed),
|
|
@@ -1086,6 +1092,12 @@ var WavyLinearTrack = React11__namespace.memo(function WavyLinearTrack2({
|
|
|
1086
1092
|
duration: 0.5
|
|
1087
1093
|
});
|
|
1088
1094
|
react.animate(fractionMV, fraction, { duration: 0.4, ease: [0.2, 0, 0, 1] });
|
|
1095
|
+
} else {
|
|
1096
|
+
react.animate(amplitudeMV, amplitude, {
|
|
1097
|
+
type: "spring",
|
|
1098
|
+
bounce: 0,
|
|
1099
|
+
duration: 0.5
|
|
1100
|
+
});
|
|
1089
1101
|
}
|
|
1090
1102
|
}, [
|
|
1091
1103
|
clampedValue,
|
|
@@ -1099,10 +1111,10 @@ var WavyLinearTrack = React11__namespace.memo(function WavyLinearTrack2({
|
|
|
1099
1111
|
1,
|
|
1100
1112
|
isDeterminate ? wavelength : indeterminateWavelength
|
|
1101
1113
|
);
|
|
1102
|
-
const trackAmp = trackShape === "wavy" ? amplitude : 0;
|
|
1103
1114
|
react.useAnimationFrame((time) => {
|
|
1104
1115
|
if (width === 0) return;
|
|
1105
1116
|
const currentAmp = amplitudeMV.get();
|
|
1117
|
+
const trackAmp = trackShape === "wavy" ? amplitude : 0;
|
|
1106
1118
|
const phase = time / 1e3 * waveSpeed * activeWavelength;
|
|
1107
1119
|
const capWidth = trackHeight / 2;
|
|
1108
1120
|
let activePathD = "";
|
|
@@ -1203,7 +1215,7 @@ var WavyLinearTrack = React11__namespace.memo(function WavyLinearTrack2({
|
|
|
1203
1215
|
"div",
|
|
1204
1216
|
{
|
|
1205
1217
|
ref: containerRef,
|
|
1206
|
-
className: "relative w-full
|
|
1218
|
+
className: "relative w-full",
|
|
1207
1219
|
style: { height: svgHeight },
|
|
1208
1220
|
children: width > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1209
1221
|
"svg",
|
|
@@ -1257,7 +1269,7 @@ var LinearProgress = React11__namespace.forwardRef(
|
|
|
1257
1269
|
waveSpeed = 1,
|
|
1258
1270
|
crawlerSpeed = 1,
|
|
1259
1271
|
determinateAnimation = "md3",
|
|
1260
|
-
indeterminateAnimation = "
|
|
1272
|
+
indeterminateAnimation = "md3",
|
|
1261
1273
|
gapSize = 4,
|
|
1262
1274
|
showStopIndicator = "auto",
|
|
1263
1275
|
color,
|
|
@@ -1294,15 +1306,15 @@ var LinearProgress = React11__namespace.forwardRef(
|
|
|
1294
1306
|
setIsRtl(dir === "rtl");
|
|
1295
1307
|
}
|
|
1296
1308
|
}, []);
|
|
1297
|
-
const isWavy = shape === "wavy";
|
|
1298
1309
|
const resolvedTrackShape = trackShape != null ? trackShape : shape;
|
|
1310
|
+
const isWavy = shape === "wavy" || resolvedTrackShape === "wavy";
|
|
1299
1311
|
const effectiveAmplitude = React11__namespace.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
|
|
1300
1312
|
const svgHeight = React11__namespace.useMemo(
|
|
1301
1313
|
() => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
|
|
1302
1314
|
[isWavy, trackHeight, effectiveAmplitude]
|
|
1303
1315
|
);
|
|
1304
1316
|
const shouldShowStop = React11__namespace.useMemo(
|
|
1305
|
-
() => isDeterminate && resolvedTrackShape === "flat" &&
|
|
1317
|
+
() => isDeterminate && resolvedTrackShape === "flat" && showStopIndicator !== false,
|
|
1306
1318
|
[isDeterminate, resolvedTrackShape, showStopIndicator]
|
|
1307
1319
|
);
|
|
1308
1320
|
const stopSize = React11__namespace.useMemo(
|
|
@@ -1312,6 +1324,8 @@ var LinearProgress = React11__namespace.forwardRef(
|
|
|
1312
1324
|
const stopOffset = (trackHeight - stopSize) / 2;
|
|
1313
1325
|
const activeColor = color || "var(--md-sys-color-indicator-active)";
|
|
1314
1326
|
const bgTrackColor = trackColor || "var(--md-sys-color-indicator-track)";
|
|
1327
|
+
const useWavyTrack = isWavy || !isDeterminate;
|
|
1328
|
+
const trackAmp = isWavy ? effectiveAmplitude : 0;
|
|
1315
1329
|
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1316
1330
|
"div",
|
|
1317
1331
|
__spreadProps(__spreadValues({
|
|
@@ -1328,12 +1342,12 @@ var LinearProgress = React11__namespace.forwardRef(
|
|
|
1328
1342
|
style: { height: svgHeight }
|
|
1329
1343
|
}, restProps), {
|
|
1330
1344
|
children: [
|
|
1331
|
-
|
|
1345
|
+
useWavyTrack ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1332
1346
|
WavyLinearTrack,
|
|
1333
1347
|
{
|
|
1334
1348
|
trackHeight,
|
|
1335
1349
|
svgHeight,
|
|
1336
|
-
amplitude:
|
|
1350
|
+
amplitude: trackAmp,
|
|
1337
1351
|
wavelength,
|
|
1338
1352
|
indeterminateWavelength,
|
|
1339
1353
|
activeColor,
|