@bug-on/m3-expressive 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/buttons.d.mts +1 -1
- package/dist/buttons.d.ts +1 -1
- package/dist/buttons.js +185 -40
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +186 -41
- package/dist/buttons.mjs.map +1 -1
- package/dist/core.js +156 -25
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +157 -26
- package/dist/core.mjs.map +1 -1
- package/dist/feedback.d.mts +20 -0
- package/dist/feedback.d.ts +20 -0
- package/dist/feedback.js +156 -25
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs +157 -26
- package/dist/feedback.mjs.map +1 -1
- package/dist/forms.d.mts +3 -2
- package/dist/forms.d.ts +3 -2
- package/dist/forms.js +88 -100
- package/dist/forms.js.map +1 -1
- package/dist/forms.mjs +88 -100
- package/dist/forms.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +279 -146
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +280 -147
- package/dist/index.mjs.map +1 -1
- package/dist/layout.js +158 -27
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +159 -28
- package/dist/layout.mjs.map +1 -1
- package/dist/navigation.js +156 -25
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +157 -26
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.js +156 -25
- package/dist/overlays.js.map +1 -1
- package/dist/overlays.mjs +157 -26
- package/dist/overlays.mjs.map +1 -1
- package/dist/pickers.js +156 -25
- package/dist/pickers.js.map +1 -1
- package/dist/pickers.mjs +157 -26
- package/dist/pickers.mjs.map +1 -1
- package/dist/{split-button-trailing-uncheckable-26qlZvKT.d.mts → split-button-trailing-uncheckable-CIVEYgjY.d.mts} +2 -0
- package/dist/{split-button-trailing-uncheckable-CXUVrH64.d.ts → split-button-trailing-uncheckable-DTQJjzsB.d.ts} +2 -0
- package/dist/{text-field-DWC7qOvp.d.mts → text-field-CiOmDM_8.d.ts} +52 -51
- package/dist/{text-field-DWC7qOvp.d.ts → text-field-Ear3hCSq.d.mts} +52 -51
- package/package.json +3 -3
package/dist/forms.mjs
CHANGED
|
@@ -1212,26 +1212,26 @@ var SliderTokens = {
|
|
|
1212
1212
|
// ── Track sizes (height for horizontal, width for vertical) ────────────────
|
|
1213
1213
|
trackSizes: {
|
|
1214
1214
|
xs: 16,
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1215
|
+
sm: 24,
|
|
1216
|
+
md: 40,
|
|
1217
|
+
lg: 56,
|
|
1218
1218
|
xl: 96
|
|
1219
1219
|
},
|
|
1220
1220
|
// ── Track shapes (border radius) ──────────────────────────────────────────
|
|
1221
1221
|
trackShapes: {
|
|
1222
1222
|
xs: 8,
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1223
|
+
sm: 8,
|
|
1224
|
+
md: 12,
|
|
1225
|
+
lg: 16,
|
|
1226
1226
|
xl: 28
|
|
1227
1227
|
},
|
|
1228
1228
|
// ── Thumb (handle) ────────────────────────────────────────────────────────
|
|
1229
1229
|
/** Thumb height grows with track size */
|
|
1230
1230
|
thumbHeights: {
|
|
1231
1231
|
xs: 44,
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1232
|
+
sm: 44,
|
|
1233
|
+
md: 52,
|
|
1234
|
+
lg: 68,
|
|
1235
1235
|
xl: 108
|
|
1236
1236
|
},
|
|
1237
1237
|
/**
|
|
@@ -1276,9 +1276,9 @@ var SliderTokens = {
|
|
|
1276
1276
|
/** Standard icon size map for inset icons inside the track. */
|
|
1277
1277
|
insetIconSizes: {
|
|
1278
1278
|
xs: 0,
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1279
|
+
sm: 0,
|
|
1280
|
+
md: 24,
|
|
1281
|
+
lg: 24,
|
|
1282
1282
|
xl: 32
|
|
1283
1283
|
},
|
|
1284
1284
|
/**
|
|
@@ -1312,14 +1312,14 @@ var SliderColors = {
|
|
|
1312
1312
|
// ── Ticks ────────────────────────────────────────────────────────────────
|
|
1313
1313
|
/**
|
|
1314
1314
|
* Tick on the INACTIVE portion of the track.
|
|
1315
|
-
* Maps to
|
|
1315
|
+
* Maps to TickMarkInactiveContainerColor (in spec: primary color stands out).
|
|
1316
1316
|
*/
|
|
1317
1317
|
tickOnInactive: "var(--md-sys-color-primary)",
|
|
1318
1318
|
/**
|
|
1319
1319
|
* Tick on the ACTIVE portion of the track.
|
|
1320
|
-
* Maps to
|
|
1320
|
+
* Maps to TickMarkActiveContainerColor (in spec: on-primary contrasts with filled track).
|
|
1321
1321
|
*/
|
|
1322
|
-
tickOnActive: "var(--md-sys-color-
|
|
1322
|
+
tickOnActive: "var(--md-sys-color-on-primary)",
|
|
1323
1323
|
disabledTick: "var(--md-sys-color-on-surface)"
|
|
1324
1324
|
};
|
|
1325
1325
|
var SLIDER_THUMB_SPRING = {
|
|
@@ -1338,11 +1338,11 @@ var ValueIndicator = React4.memo(function ValueIndicator2({
|
|
|
1338
1338
|
orientation,
|
|
1339
1339
|
formatValue,
|
|
1340
1340
|
prefersReduced,
|
|
1341
|
-
|
|
1341
|
+
size
|
|
1342
1342
|
}) {
|
|
1343
1343
|
const label = formatValue ? formatValue(value) : String(Math.round(value));
|
|
1344
1344
|
const isHorizontal = orientation === "horizontal";
|
|
1345
|
-
const thumbHeight = SliderTokens.thumbHeights[
|
|
1345
|
+
const thumbHeight = SliderTokens.thumbHeights[size];
|
|
1346
1346
|
const offsetFromCenter = thumbHeight / 2 + 8;
|
|
1347
1347
|
return /* @__PURE__ */ jsx(AnimatePresence, { children: visible && /* @__PURE__ */ jsx(
|
|
1348
1348
|
m.div,
|
|
@@ -1393,7 +1393,7 @@ var SliderThumb = React4.memo(function SliderThumb2({
|
|
|
1393
1393
|
onValueChangeEnd,
|
|
1394
1394
|
formatValue,
|
|
1395
1395
|
thumbId,
|
|
1396
|
-
|
|
1396
|
+
size,
|
|
1397
1397
|
variant,
|
|
1398
1398
|
zIndex = 1,
|
|
1399
1399
|
"aria-label": ariaLabel,
|
|
@@ -1402,10 +1402,7 @@ var SliderThumb = React4.memo(function SliderThumb2({
|
|
|
1402
1402
|
var _a;
|
|
1403
1403
|
const isHorizontal = orientation === "horizontal";
|
|
1404
1404
|
const insetLimit = SliderTokens.thumbGap + SliderTokens.thumbWidthDefault / 2;
|
|
1405
|
-
const trackInset = Math.min(
|
|
1406
|
-
SliderTokens.trackSizes[trackSize] / 2,
|
|
1407
|
-
insetLimit
|
|
1408
|
-
);
|
|
1405
|
+
const trackInset = Math.min(SliderTokens.trackSizes[size] / 2, insetLimit);
|
|
1409
1406
|
const posTarget = isHorizontal ? "left" : "bottom";
|
|
1410
1407
|
const motionStyle = {
|
|
1411
1408
|
[posTarget]: `calc(${trackInset}px + ${percent} * (100% - ${trackInset * 2}px))`
|
|
@@ -1438,7 +1435,7 @@ var SliderThumb = React4.memo(function SliderThumb2({
|
|
|
1438
1435
|
const space = isHorizontal ? rect.width : rect.height;
|
|
1439
1436
|
const insetLimit2 = SliderTokens.thumbGap + SliderTokens.thumbWidthDefault / 2;
|
|
1440
1437
|
const trackInset2 = Math.min(
|
|
1441
|
-
SliderTokens.trackSizes[
|
|
1438
|
+
SliderTokens.trackSizes[size] / 2,
|
|
1442
1439
|
insetLimit2
|
|
1443
1440
|
);
|
|
1444
1441
|
const safeSpace = space - trackInset2 * 2;
|
|
@@ -1455,7 +1452,7 @@ var SliderThumb = React4.memo(function SliderThumb2({
|
|
|
1455
1452
|
const snapped = step > 0 ? Math.round((rawValue - min) / step) * step + min : rawValue;
|
|
1456
1453
|
return Math.max(min, Math.min(max, snapped));
|
|
1457
1454
|
},
|
|
1458
|
-
[isHorizontal, max, min, percent, step, trackRef,
|
|
1455
|
+
[isHorizontal, max, min, percent, step, trackRef, size]
|
|
1459
1456
|
);
|
|
1460
1457
|
const handlePointerDown = React4.useCallback(
|
|
1461
1458
|
(e) => {
|
|
@@ -1541,7 +1538,7 @@ var SliderThumb = React4.memo(function SliderThumb2({
|
|
|
1541
1538
|
orientation,
|
|
1542
1539
|
formatValue,
|
|
1543
1540
|
prefersReduced,
|
|
1544
|
-
|
|
1541
|
+
size
|
|
1545
1542
|
}
|
|
1546
1543
|
),
|
|
1547
1544
|
/* @__PURE__ */ jsx(
|
|
@@ -1574,11 +1571,11 @@ var SliderThumb = React4.memo(function SliderThumb2({
|
|
|
1574
1571
|
"focus-visible:outline-(--md-sys-color-secondary)"
|
|
1575
1572
|
),
|
|
1576
1573
|
style: __spreadProps(__spreadValues({}, isHorizontal ? {
|
|
1577
|
-
height: SliderTokens.thumbHeights[
|
|
1574
|
+
height: SliderTokens.thumbHeights[size],
|
|
1578
1575
|
width: SliderTokens.thumbWidthDefault,
|
|
1579
1576
|
willChange: "width"
|
|
1580
1577
|
} : {
|
|
1581
|
-
width: SliderTokens.thumbHeights[
|
|
1578
|
+
width: SliderTokens.thumbHeights[size],
|
|
1582
1579
|
height: SliderTokens.thumbWidthDefault,
|
|
1583
1580
|
willChange: "height"
|
|
1584
1581
|
}), {
|
|
@@ -1593,7 +1590,7 @@ var SliderThumb = React4.memo(function SliderThumb2({
|
|
|
1593
1590
|
var RangeTrack = React4.memo(function RangeTrack2({
|
|
1594
1591
|
startPercent,
|
|
1595
1592
|
endPercent,
|
|
1596
|
-
|
|
1593
|
+
size,
|
|
1597
1594
|
orientation,
|
|
1598
1595
|
variant,
|
|
1599
1596
|
disabled,
|
|
@@ -1605,22 +1602,22 @@ var RangeTrack = React4.memo(function RangeTrack2({
|
|
|
1605
1602
|
onTrackPointerDown
|
|
1606
1603
|
}) {
|
|
1607
1604
|
const isHorizontal = orientation === "horizontal";
|
|
1608
|
-
const
|
|
1609
|
-
const thumbHeight = SliderTokens.thumbHeights[
|
|
1605
|
+
const trackPixelSize = SliderTokens.trackSizes[size];
|
|
1606
|
+
const thumbHeight = SliderTokens.thumbHeights[size];
|
|
1610
1607
|
const { thumbGap, thumbWidthDefault, tickSize } = SliderTokens;
|
|
1611
1608
|
const thumbHalfWidth = thumbWidthDefault / 2;
|
|
1612
1609
|
const activeTrack = disabled ? SliderColors.disabledActiveTrack : `var(--md-sys-color-${variant})`;
|
|
1613
1610
|
const inactiveTrack = disabled ? SliderColors.disabledInactiveTrack : `var(--md-sys-color-${variant}-container)`;
|
|
1614
1611
|
const innerR = SliderTokens.trackInnerRadius;
|
|
1615
|
-
let outerR =
|
|
1612
|
+
let outerR = trackPixelSize / 2;
|
|
1616
1613
|
if (trackShape === "md3") {
|
|
1617
|
-
outerR = Math.min(SliderTokens.trackShapes[
|
|
1614
|
+
outerR = Math.min(SliderTokens.trackShapes[size], trackPixelSize / 2);
|
|
1618
1615
|
} else if (typeof trackShape === "number") {
|
|
1619
|
-
outerR = Math.min(trackShape,
|
|
1616
|
+
outerR = Math.min(trackShape, trackPixelSize / 2);
|
|
1620
1617
|
}
|
|
1621
1618
|
if (isHorizontal) {
|
|
1622
1619
|
const insetLimit2 = thumbGap + thumbWidthDefault / 2;
|
|
1623
|
-
const trackInset2 = Math.min(
|
|
1620
|
+
const trackInset2 = Math.min(trackPixelSize / 2, insetLimit2);
|
|
1624
1621
|
const cxStart = `calc(${trackInset2}px + ${startPercent} * (100% - ${trackInset2 * 2}px))`;
|
|
1625
1622
|
const cxEnd = `calc(${trackInset2}px + ${endPercent} * (100% - ${trackInset2 * 2}px))`;
|
|
1626
1623
|
const gapWithThumbStr2 = `${thumbGap + thumbHalfWidth}px`;
|
|
@@ -1651,7 +1648,7 @@ var RangeTrack = React4.memo(function RangeTrack2({
|
|
|
1651
1648
|
top: "50%",
|
|
1652
1649
|
transform: "translateY(-50%)",
|
|
1653
1650
|
width: leadingWidth,
|
|
1654
|
-
height:
|
|
1651
|
+
height: trackPixelSize,
|
|
1655
1652
|
backgroundColor: inactiveTrack,
|
|
1656
1653
|
opacity: disabled ? 0.38 : 1,
|
|
1657
1654
|
borderTopLeftRadius: outerR,
|
|
@@ -1671,7 +1668,7 @@ var RangeTrack = React4.memo(function RangeTrack2({
|
|
|
1671
1668
|
top: "50%",
|
|
1672
1669
|
transform: "translateY(-50%)",
|
|
1673
1670
|
width: activeWidth,
|
|
1674
|
-
height:
|
|
1671
|
+
height: trackPixelSize,
|
|
1675
1672
|
backgroundColor: activeTrack,
|
|
1676
1673
|
opacity: disabled ? 0.38 : 1,
|
|
1677
1674
|
borderTopLeftRadius: startPercent <= 0 ? outerR : innerR,
|
|
@@ -1691,7 +1688,7 @@ var RangeTrack = React4.memo(function RangeTrack2({
|
|
|
1691
1688
|
top: "50%",
|
|
1692
1689
|
transform: "translateY(-50%)",
|
|
1693
1690
|
width: trailingWidth,
|
|
1694
|
-
height:
|
|
1691
|
+
height: trackPixelSize,
|
|
1695
1692
|
backgroundColor: inactiveTrack,
|
|
1696
1693
|
opacity: disabled ? 0.38 : 1,
|
|
1697
1694
|
borderTopLeftRadius: innerR,
|
|
@@ -1713,7 +1710,7 @@ var RangeTrack = React4.memo(function RangeTrack2({
|
|
|
1713
1710
|
width: tickSize,
|
|
1714
1711
|
height: tickSize,
|
|
1715
1712
|
borderRadius: "50%",
|
|
1716
|
-
backgroundColor: disabled ? SliderColors.disabledTick : isActive ? `var(--md-sys-color-${variant}
|
|
1713
|
+
backgroundColor: disabled ? SliderColors.disabledTick : isActive ? `var(--md-sys-color-on-${variant})` : `var(--md-sys-color-${variant})`,
|
|
1717
1714
|
opacity: disabled ? 0.38 : 1,
|
|
1718
1715
|
left: `calc(${trackInset2}px + ${tickPct} * (100% - ${trackInset2 * 2}px) - ${tickSize / 2}px)`,
|
|
1719
1716
|
top: "50%",
|
|
@@ -1728,7 +1725,7 @@ var RangeTrack = React4.memo(function RangeTrack2({
|
|
|
1728
1725
|
);
|
|
1729
1726
|
}
|
|
1730
1727
|
const insetLimit = thumbGap + thumbWidthDefault / 2;
|
|
1731
|
-
const trackInset = Math.min(
|
|
1728
|
+
const trackInset = Math.min(trackPixelSize / 2, insetLimit);
|
|
1732
1729
|
const cyStart = `calc(${trackInset}px + ${startPercent} * (100% - ${trackInset * 2}px))`;
|
|
1733
1730
|
const cyEnd = `calc(${trackInset}px + ${endPercent} * (100% - ${trackInset * 2}px))`;
|
|
1734
1731
|
const gapWithThumbStr = `${thumbGap + thumbHalfWidth}px`;
|
|
@@ -1759,7 +1756,7 @@ var RangeTrack = React4.memo(function RangeTrack2({
|
|
|
1759
1756
|
left: "50%",
|
|
1760
1757
|
transform: "translateX(-50%)",
|
|
1761
1758
|
height: leadingHeight,
|
|
1762
|
-
width:
|
|
1759
|
+
width: trackPixelSize,
|
|
1763
1760
|
backgroundColor: inactiveTrack,
|
|
1764
1761
|
opacity: disabled ? 0.38 : 1,
|
|
1765
1762
|
borderBottomLeftRadius: outerR,
|
|
@@ -1779,7 +1776,7 @@ var RangeTrack = React4.memo(function RangeTrack2({
|
|
|
1779
1776
|
left: "50%",
|
|
1780
1777
|
transform: "translateX(-50%)",
|
|
1781
1778
|
height: activeHeight,
|
|
1782
|
-
width:
|
|
1779
|
+
width: trackPixelSize,
|
|
1783
1780
|
backgroundColor: activeTrack,
|
|
1784
1781
|
opacity: disabled ? 0.38 : 1,
|
|
1785
1782
|
borderBottomLeftRadius: startPercent <= 0 ? outerR : innerR,
|
|
@@ -1799,7 +1796,7 @@ var RangeTrack = React4.memo(function RangeTrack2({
|
|
|
1799
1796
|
left: "50%",
|
|
1800
1797
|
transform: "translateX(-50%)",
|
|
1801
1798
|
height: trailingHeight,
|
|
1802
|
-
width:
|
|
1799
|
+
width: trackPixelSize,
|
|
1803
1800
|
backgroundColor: inactiveTrack,
|
|
1804
1801
|
opacity: disabled ? 0.38 : 1,
|
|
1805
1802
|
borderTopLeftRadius: outerR,
|
|
@@ -1821,7 +1818,7 @@ var RangeTrack = React4.memo(function RangeTrack2({
|
|
|
1821
1818
|
width: tickSize,
|
|
1822
1819
|
height: tickSize,
|
|
1823
1820
|
borderRadius: "50%",
|
|
1824
|
-
backgroundColor: disabled ? SliderColors.disabledTick : isActive ? `var(--md-sys-color-${variant}
|
|
1821
|
+
backgroundColor: disabled ? SliderColors.disabledTick : isActive ? `var(--md-sys-color-on-${variant})` : `var(--md-sys-color-${variant})`,
|
|
1825
1822
|
opacity: disabled ? 0.38 : 1,
|
|
1826
1823
|
bottom: `calc(${trackInset}px + ${tickPct} * (100% - ${trackInset * 2}px) - ${tickSize / 2}px)`,
|
|
1827
1824
|
left: "50%",
|
|
@@ -1845,7 +1842,7 @@ var RangeSliderComponent = React4.forwardRef(
|
|
|
1845
1842
|
max = 100,
|
|
1846
1843
|
step = 0,
|
|
1847
1844
|
orientation = "horizontal",
|
|
1848
|
-
|
|
1845
|
+
size = "md",
|
|
1849
1846
|
trackShape = "md3",
|
|
1850
1847
|
variant = "primary",
|
|
1851
1848
|
disabled = false,
|
|
@@ -1917,7 +1914,7 @@ var RangeSliderComponent = React4.forwardRef(
|
|
|
1917
1914
|
let clickPercent;
|
|
1918
1915
|
const insetLimit = SliderTokens.thumbGap + SliderTokens.thumbWidthDefault / 2;
|
|
1919
1916
|
const trackInset = Math.min(
|
|
1920
|
-
SliderTokens.trackSizes[
|
|
1917
|
+
SliderTokens.trackSizes[size] / 2,
|
|
1921
1918
|
insetLimit
|
|
1922
1919
|
);
|
|
1923
1920
|
if (isHorizontal) {
|
|
@@ -1949,7 +1946,7 @@ var RangeSliderComponent = React4.forwardRef(
|
|
|
1949
1946
|
min,
|
|
1950
1947
|
snap,
|
|
1951
1948
|
startValue,
|
|
1952
|
-
|
|
1949
|
+
size
|
|
1953
1950
|
]
|
|
1954
1951
|
);
|
|
1955
1952
|
const id = React4.useId();
|
|
@@ -1970,7 +1967,7 @@ var RangeSliderComponent = React4.forwardRef(
|
|
|
1970
1967
|
{
|
|
1971
1968
|
startPercent,
|
|
1972
1969
|
endPercent,
|
|
1973
|
-
|
|
1970
|
+
size,
|
|
1974
1971
|
trackShape,
|
|
1975
1972
|
orientation,
|
|
1976
1973
|
variant,
|
|
@@ -1992,7 +1989,7 @@ var RangeSliderComponent = React4.forwardRef(
|
|
|
1992
1989
|
step,
|
|
1993
1990
|
disabled,
|
|
1994
1991
|
orientation,
|
|
1995
|
-
|
|
1992
|
+
size,
|
|
1996
1993
|
variant,
|
|
1997
1994
|
showValueIndicator,
|
|
1998
1995
|
trackRef,
|
|
@@ -2014,7 +2011,7 @@ var RangeSliderComponent = React4.forwardRef(
|
|
|
2014
2011
|
step,
|
|
2015
2012
|
disabled,
|
|
2016
2013
|
orientation,
|
|
2017
|
-
|
|
2014
|
+
size,
|
|
2018
2015
|
variant,
|
|
2019
2016
|
showValueIndicator,
|
|
2020
2017
|
trackRef,
|
|
@@ -2077,13 +2074,13 @@ var InsetIcon = React4.memo(function InsetIcon2({
|
|
|
2077
2074
|
position,
|
|
2078
2075
|
orientation,
|
|
2079
2076
|
trackSize,
|
|
2080
|
-
|
|
2077
|
+
sizeToken,
|
|
2081
2078
|
disabled,
|
|
2082
2079
|
variant,
|
|
2083
2080
|
prefersReduced
|
|
2084
2081
|
}) {
|
|
2085
2082
|
const iconSize = Math.min(
|
|
2086
|
-
SliderTokens.insetIconSizes[
|
|
2083
|
+
SliderTokens.insetIconSizes[sizeToken],
|
|
2087
2084
|
Math.max(4, trackSize - SliderTokens.insetIconPadding * 2)
|
|
2088
2085
|
);
|
|
2089
2086
|
const activeColor = `var(--md-sys-color-on-${variant})`;
|
|
@@ -2144,7 +2141,7 @@ function Ticks({
|
|
|
2144
2141
|
const thumbStart = percent - (thumbGap + thumbWidthDefault / 2) / 100;
|
|
2145
2142
|
const thumbEnd = percent + (thumbGap + thumbWidthDefault / 2) / 100;
|
|
2146
2143
|
if (tickPercent > thumbStart && tickPercent < thumbEnd) return null;
|
|
2147
|
-
const color = disabled ? SliderColors.disabledTick : isOnActive ? `var(--md-sys-color-${variant}
|
|
2144
|
+
const color = disabled ? SliderColors.disabledTick : isOnActive ? `var(--md-sys-color-on-${variant})` : `var(--md-sys-color-${variant})`;
|
|
2148
2145
|
const style = __spreadValues({
|
|
2149
2146
|
position: "absolute",
|
|
2150
2147
|
width: tickSize,
|
|
@@ -2167,7 +2164,7 @@ function Ticks({
|
|
|
2167
2164
|
}
|
|
2168
2165
|
var SliderTrack = React4.memo(function SliderTrack2({
|
|
2169
2166
|
percent,
|
|
2170
|
-
|
|
2167
|
+
size,
|
|
2171
2168
|
orientation,
|
|
2172
2169
|
variant,
|
|
2173
2170
|
isCentered,
|
|
@@ -2186,15 +2183,15 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2186
2183
|
}) {
|
|
2187
2184
|
var _a;
|
|
2188
2185
|
const isHorizontal = orientation === "horizontal";
|
|
2189
|
-
const
|
|
2190
|
-
const thumbHeight = SliderTokens.thumbHeights[
|
|
2186
|
+
const trackPixelSize = SliderTokens.trackSizes[size];
|
|
2187
|
+
const thumbHeight = SliderTokens.thumbHeights[size];
|
|
2191
2188
|
const { thumbGap, thumbWidthDefault, trackInnerRadius } = SliderTokens;
|
|
2192
2189
|
const innerR = trackInnerRadius;
|
|
2193
|
-
let outerR =
|
|
2190
|
+
let outerR = trackPixelSize / 2;
|
|
2194
2191
|
if (trackShape === "md3") {
|
|
2195
|
-
outerR = Math.min(SliderTokens.trackShapes[
|
|
2192
|
+
outerR = Math.min(SliderTokens.trackShapes[size], trackPixelSize / 2);
|
|
2196
2193
|
} else if (typeof trackShape === "number") {
|
|
2197
|
-
outerR = Math.min(trackShape,
|
|
2194
|
+
outerR = Math.min(trackShape, trackPixelSize / 2);
|
|
2198
2195
|
}
|
|
2199
2196
|
const thumbHalfWidth = thumbWidthDefault / 2;
|
|
2200
2197
|
const gapWithThumbStr = `${thumbGap + thumbHalfWidth}px`;
|
|
@@ -2212,8 +2209,8 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2212
2209
|
return () => ro.disconnect();
|
|
2213
2210
|
}, [hasAnyInsetIcon, isHorizontal, trackRef]);
|
|
2214
2211
|
const activeIconSize = Math.min(
|
|
2215
|
-
SliderTokens.insetIconSizes[
|
|
2216
|
-
Math.max(4,
|
|
2212
|
+
SliderTokens.insetIconSizes[size],
|
|
2213
|
+
Math.max(4, trackPixelSize - SliderTokens.insetIconPadding * 2)
|
|
2217
2214
|
);
|
|
2218
2215
|
const iconTotalWidth = activeIconSize + SliderTokens.insetIconPadding * 2 + thumbGap + thumbHalfWidth;
|
|
2219
2216
|
const iconThreshold = trackWidth > 0 ? iconTotalWidth / trackWidth : 0.15;
|
|
@@ -2248,7 +2245,7 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2248
2245
|
const activeColor = disabled ? SliderColors.disabledActiveTrack : `var(--md-sys-color-${variant})`;
|
|
2249
2246
|
const inactiveColor = disabled ? SliderColors.disabledInactiveTrack : `var(--md-sys-color-${variant}-container)`;
|
|
2250
2247
|
const insetLimit = SliderTokens.thumbGap + SliderTokens.thumbWidthDefault / 2;
|
|
2251
|
-
const trackInset = Math.min(
|
|
2248
|
+
const trackInset = Math.min(trackPixelSize / 2, insetLimit);
|
|
2252
2249
|
const gapTotal = thumbGap + thumbHalfWidth;
|
|
2253
2250
|
const thumbCenter = `calc(${trackInset}px + ${percent} * (100% - ${trackInset * 2}px))`;
|
|
2254
2251
|
const leadingActiveLeft = `${trackInset + SliderTokens.insetIconPadding}px`;
|
|
@@ -2273,7 +2270,7 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2273
2270
|
top: "50%",
|
|
2274
2271
|
transform: "translateY(-50%)",
|
|
2275
2272
|
width: leftSegmentWidth,
|
|
2276
|
-
height:
|
|
2273
|
+
height: trackPixelSize,
|
|
2277
2274
|
backgroundColor: activeColor,
|
|
2278
2275
|
opacity: disabled ? 0.38 : 1
|
|
2279
2276
|
}, getHorizontalRadius(true, innerR, outerR))
|
|
@@ -2292,7 +2289,7 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2292
2289
|
top: "50%",
|
|
2293
2290
|
transform: "translateY(-50%)",
|
|
2294
2291
|
width: rightSegmentWidth,
|
|
2295
|
-
height:
|
|
2292
|
+
height: trackPixelSize,
|
|
2296
2293
|
backgroundColor: inactiveColor,
|
|
2297
2294
|
opacity: disabled ? 0.38 : 1
|
|
2298
2295
|
}, getHorizontalRadius(false, innerR, outerR))
|
|
@@ -2315,7 +2312,7 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2315
2312
|
top: "50%",
|
|
2316
2313
|
transform: "translateY(-50%)",
|
|
2317
2314
|
width: leftBaseWidth,
|
|
2318
|
-
height:
|
|
2315
|
+
height: trackPixelSize,
|
|
2319
2316
|
backgroundColor: inactiveColor,
|
|
2320
2317
|
opacity: disabled ? 0.38 : 1
|
|
2321
2318
|
}, getHorizontalRadius(true, innerR, outerR))
|
|
@@ -2336,7 +2333,7 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2336
2333
|
top: "50%",
|
|
2337
2334
|
transform: "translateY(-50%)",
|
|
2338
2335
|
width: centerActiveWidth,
|
|
2339
|
-
height:
|
|
2336
|
+
height: trackPixelSize,
|
|
2340
2337
|
backgroundColor: activeColor,
|
|
2341
2338
|
opacity: disabled ? 0.38 : 1
|
|
2342
2339
|
}, allInnerRadius(innerR))
|
|
@@ -2357,7 +2354,7 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2357
2354
|
top: "50%",
|
|
2358
2355
|
transform: "translateY(-50%)",
|
|
2359
2356
|
width: rightBaseWidth,
|
|
2360
|
-
height:
|
|
2357
|
+
height: trackPixelSize,
|
|
2361
2358
|
backgroundColor: inactiveColor,
|
|
2362
2359
|
opacity: disabled ? 0.38 : 1
|
|
2363
2360
|
}, getHorizontalRadius(false, innerR, outerR))
|
|
@@ -2378,7 +2375,7 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2378
2375
|
top: "50%",
|
|
2379
2376
|
transform: "translateY(-50%)",
|
|
2380
2377
|
width: leftBaseWidth,
|
|
2381
|
-
height:
|
|
2378
|
+
height: trackPixelSize,
|
|
2382
2379
|
backgroundColor: inactiveColor,
|
|
2383
2380
|
opacity: disabled ? 0.38 : 1
|
|
2384
2381
|
}, getHorizontalRadius(true, innerR, outerR))
|
|
@@ -2399,7 +2396,7 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2399
2396
|
top: "50%",
|
|
2400
2397
|
transform: "translateY(-50%)",
|
|
2401
2398
|
width: centerActiveWidth,
|
|
2402
|
-
height:
|
|
2399
|
+
height: trackPixelSize,
|
|
2403
2400
|
backgroundColor: activeColor,
|
|
2404
2401
|
opacity: disabled ? 0.38 : 1
|
|
2405
2402
|
}, allInnerRadius(innerR))
|
|
@@ -2420,7 +2417,7 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2420
2417
|
top: "50%",
|
|
2421
2418
|
transform: "translateY(-50%)",
|
|
2422
2419
|
width: rightBaseWidth,
|
|
2423
|
-
height:
|
|
2420
|
+
height: trackPixelSize,
|
|
2424
2421
|
backgroundColor: inactiveColor,
|
|
2425
2422
|
opacity: disabled ? 0.38 : 1
|
|
2426
2423
|
}, getHorizontalRadius(false, innerR, outerR))
|
|
@@ -2464,8 +2461,8 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2464
2461
|
isOnActiveSegment: leadingOnActive,
|
|
2465
2462
|
position: leadingOnActive ? leadingActiveLeft : leadingInactiveLeft,
|
|
2466
2463
|
orientation,
|
|
2467
|
-
trackSize:
|
|
2468
|
-
|
|
2464
|
+
trackSize: trackPixelSize,
|
|
2465
|
+
sizeToken: size,
|
|
2469
2466
|
disabled,
|
|
2470
2467
|
variant,
|
|
2471
2468
|
prefersReduced
|
|
@@ -2479,8 +2476,8 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2479
2476
|
isOnActiveSegment: trailingOnActive,
|
|
2480
2477
|
position: trailingOnActive ? trailingActiveLeft : trailingInactiveLeft,
|
|
2481
2478
|
orientation,
|
|
2482
|
-
trackSize:
|
|
2483
|
-
|
|
2479
|
+
trackSize: trackPixelSize,
|
|
2480
|
+
sizeToken: size,
|
|
2484
2481
|
disabled,
|
|
2485
2482
|
variant,
|
|
2486
2483
|
prefersReduced
|
|
@@ -2508,7 +2505,7 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2508
2505
|
left: "50%",
|
|
2509
2506
|
transform: "translateX(-50%)",
|
|
2510
2507
|
height: bottomSegmentHeight,
|
|
2511
|
-
width:
|
|
2508
|
+
width: trackPixelSize,
|
|
2512
2509
|
backgroundColor: activeColor,
|
|
2513
2510
|
opacity: disabled ? 0.38 : 1
|
|
2514
2511
|
}, getVerticalRadius(true, innerR, outerR))
|
|
@@ -2527,7 +2524,7 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2527
2524
|
left: "50%",
|
|
2528
2525
|
transform: "translateX(-50%)",
|
|
2529
2526
|
height: topSegmentHeight,
|
|
2530
|
-
width:
|
|
2527
|
+
width: trackPixelSize,
|
|
2531
2528
|
backgroundColor: inactiveColor,
|
|
2532
2529
|
opacity: disabled ? 0.38 : 1
|
|
2533
2530
|
}, getVerticalRadius(false, innerR, outerR))
|
|
@@ -2550,7 +2547,7 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2550
2547
|
left: "50%",
|
|
2551
2548
|
transform: "translateX(-50%)",
|
|
2552
2549
|
height: bottomBaseHeight,
|
|
2553
|
-
width:
|
|
2550
|
+
width: trackPixelSize,
|
|
2554
2551
|
backgroundColor: inactiveColor,
|
|
2555
2552
|
opacity: disabled ? 0.38 : 1
|
|
2556
2553
|
}, getVerticalRadius(true, innerR, outerR))
|
|
@@ -2571,7 +2568,7 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2571
2568
|
left: "50%",
|
|
2572
2569
|
transform: "translateX(-50%)",
|
|
2573
2570
|
height: centerActiveHeight,
|
|
2574
|
-
width:
|
|
2571
|
+
width: trackPixelSize,
|
|
2575
2572
|
backgroundColor: activeColor,
|
|
2576
2573
|
opacity: disabled ? 0.38 : 1
|
|
2577
2574
|
}, allInnerRadius(innerR))
|
|
@@ -2592,7 +2589,7 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2592
2589
|
left: "50%",
|
|
2593
2590
|
transform: "translateX(-50%)",
|
|
2594
2591
|
height: topBaseHeight,
|
|
2595
|
-
width:
|
|
2592
|
+
width: trackPixelSize,
|
|
2596
2593
|
backgroundColor: inactiveColor,
|
|
2597
2594
|
opacity: disabled ? 0.38 : 1
|
|
2598
2595
|
}, getVerticalRadius(false, innerR, outerR))
|
|
@@ -2613,7 +2610,7 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2613
2610
|
left: "50%",
|
|
2614
2611
|
transform: "translateX(-50%)",
|
|
2615
2612
|
height: bottomBaseHeight,
|
|
2616
|
-
width:
|
|
2613
|
+
width: trackPixelSize,
|
|
2617
2614
|
backgroundColor: inactiveColor,
|
|
2618
2615
|
opacity: disabled ? 0.38 : 1
|
|
2619
2616
|
}, getVerticalRadius(true, innerR, outerR))
|
|
@@ -2634,7 +2631,7 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2634
2631
|
left: "50%",
|
|
2635
2632
|
transform: "translateX(-50%)",
|
|
2636
2633
|
height: centerActiveHeight,
|
|
2637
|
-
width:
|
|
2634
|
+
width: trackPixelSize,
|
|
2638
2635
|
backgroundColor: activeColor,
|
|
2639
2636
|
opacity: disabled ? 0.38 : 1
|
|
2640
2637
|
}, allInnerRadius(innerR))
|
|
@@ -2655,7 +2652,7 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2655
2652
|
left: "50%",
|
|
2656
2653
|
transform: "translateX(-50%)",
|
|
2657
2654
|
height: topBaseHeight,
|
|
2658
|
-
width:
|
|
2655
|
+
width: trackPixelSize,
|
|
2659
2656
|
backgroundColor: inactiveColor,
|
|
2660
2657
|
opacity: disabled ? 0.38 : 1
|
|
2661
2658
|
}, getVerticalRadius(false, innerR, outerR))
|
|
@@ -2699,8 +2696,8 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2699
2696
|
isOnActiveSegment: leadingOnActive,
|
|
2700
2697
|
position: leadingOnActive ? leadingActiveLeft : leadingInactiveLeft,
|
|
2701
2698
|
orientation,
|
|
2702
|
-
trackSize:
|
|
2703
|
-
|
|
2699
|
+
trackSize: trackPixelSize,
|
|
2700
|
+
sizeToken: size,
|
|
2704
2701
|
disabled,
|
|
2705
2702
|
variant,
|
|
2706
2703
|
prefersReduced
|
|
@@ -2714,8 +2711,8 @@ var SliderTrack = React4.memo(function SliderTrack2({
|
|
|
2714
2711
|
isOnActiveSegment: trailingOnActive,
|
|
2715
2712
|
position: trailingOnActive ? trailingActiveLeft : trailingInactiveLeft,
|
|
2716
2713
|
orientation,
|
|
2717
|
-
trackSize:
|
|
2718
|
-
|
|
2714
|
+
trackSize: trackPixelSize,
|
|
2715
|
+
sizeToken: size,
|
|
2719
2716
|
disabled,
|
|
2720
2717
|
variant,
|
|
2721
2718
|
prefersReduced
|
|
@@ -2736,7 +2733,7 @@ var SliderComponent = React4.forwardRef(
|
|
|
2736
2733
|
max = 100,
|
|
2737
2734
|
step = 0,
|
|
2738
2735
|
orientation = "horizontal",
|
|
2739
|
-
|
|
2736
|
+
size = "md",
|
|
2740
2737
|
trackShape = "md3",
|
|
2741
2738
|
variant = "primary",
|
|
2742
2739
|
isCentered = false,
|
|
@@ -2790,7 +2787,7 @@ var SliderComponent = React4.forwardRef(
|
|
|
2790
2787
|
let clickPercent;
|
|
2791
2788
|
const insetLimit = SliderTokens.thumbGap + SliderTokens.thumbWidthDefault / 2;
|
|
2792
2789
|
const trackInset = Math.min(
|
|
2793
|
-
SliderTokens.trackSizes[
|
|
2790
|
+
SliderTokens.trackSizes[size] / 2,
|
|
2794
2791
|
insetLimit
|
|
2795
2792
|
);
|
|
2796
2793
|
if (isHorizontal) {
|
|
@@ -2805,20 +2802,11 @@ var SliderComponent = React4.forwardRef(
|
|
|
2805
2802
|
const newValue = snap(coerce(rawValue));
|
|
2806
2803
|
handleValueChange(newValue);
|
|
2807
2804
|
},
|
|
2808
|
-
[
|
|
2809
|
-
coerce,
|
|
2810
|
-
disabled,
|
|
2811
|
-
handleValueChange,
|
|
2812
|
-
isHorizontal,
|
|
2813
|
-
max,
|
|
2814
|
-
min,
|
|
2815
|
-
snap,
|
|
2816
|
-
trackSize
|
|
2817
|
-
]
|
|
2805
|
+
[coerce, disabled, handleValueChange, isHorizontal, max, min, snap, size]
|
|
2818
2806
|
);
|
|
2819
2807
|
const id = React4.useId();
|
|
2820
2808
|
const thumbId = `slider-thumb-${id}`;
|
|
2821
|
-
const supportsInsetIcon = !isCentered && SliderTokens.trackSizes[
|
|
2809
|
+
const supportsInsetIcon = !isCentered && SliderTokens.trackSizes[size] >= 40;
|
|
2822
2810
|
const hasAnyInsetIcon = !!(insetIcon || insetIconTrailing);
|
|
2823
2811
|
if (hasAnyInsetIcon && !supportsInsetIcon) {
|
|
2824
2812
|
console.warn(
|
|
@@ -2841,7 +2829,7 @@ var SliderComponent = React4.forwardRef(
|
|
|
2841
2829
|
SliderTrack,
|
|
2842
2830
|
{
|
|
2843
2831
|
percent,
|
|
2844
|
-
|
|
2832
|
+
size,
|
|
2845
2833
|
trackShape,
|
|
2846
2834
|
orientation,
|
|
2847
2835
|
isCentered,
|
|
@@ -2869,7 +2857,7 @@ var SliderComponent = React4.forwardRef(
|
|
|
2869
2857
|
step,
|
|
2870
2858
|
disabled,
|
|
2871
2859
|
orientation,
|
|
2872
|
-
|
|
2860
|
+
size,
|
|
2873
2861
|
variant,
|
|
2874
2862
|
showValueIndicator,
|
|
2875
2863
|
trackRef,
|