@bug-on/m3-expressive 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/buttons.d.mts +26 -5
- package/dist/buttons.d.ts +26 -5
- package/dist/buttons.js +581 -345
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +573 -345
- package/dist/buttons.mjs.map +1 -1
- package/dist/core.js +52 -13
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +52 -13
- package/dist/core.mjs.map +1 -1
- package/dist/feedback.js +52 -13
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs +52 -13
- package/dist/feedback.mjs.map +1 -1
- package/dist/forms.js +4 -1
- package/dist/forms.js.map +1 -1
- package/dist/forms.mjs +4 -1
- package/dist/forms.mjs.map +1 -1
- package/dist/{icon-button-sSt6PPLg.d.mts → icon-button-CSsDmuQC.d.mts} +13 -0
- package/dist/{icon-button-sSt6PPLg.d.ts → icon-button-CSsDmuQC.d.ts} +13 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1268 -1005
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1127 -865
- package/dist/index.mjs.map +1 -1
- package/dist/layout.js +15 -7
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +15 -7
- package/dist/layout.mjs.map +1 -1
- package/dist/navigation.d.mts +1 -1
- package/dist/navigation.d.ts +1 -1
- package/dist/navigation.js +66 -16
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +66 -16
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.js +52 -13
- package/dist/overlays.js.map +1 -1
- package/dist/overlays.mjs +52 -13
- package/dist/overlays.mjs.map +1 -1
- package/dist/pickers.js +177 -111
- package/dist/pickers.js.map +1 -1
- package/dist/pickers.mjs +177 -111
- package/dist/pickers.mjs.map +1 -1
- package/dist/{split-button-trailing-uncheckable-BcPD_7uK.d.ts → split-button-trailing-uncheckable-C-qQlyZx.d.ts} +74 -19
- package/dist/{split-button-trailing-uncheckable-DtFJkTFr.d.mts → split-button-trailing-uncheckable-DHJqNeq_.d.mts} +74 -19
- package/package.json +3 -3
package/dist/layout.mjs
CHANGED
|
@@ -106,7 +106,10 @@ function useRippleState(options = {}) {
|
|
|
106
106
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
107
107
|
const x = e.clientX - rect.left;
|
|
108
108
|
const y = e.clientY - rect.top;
|
|
109
|
-
const rippleSize = Math.
|
|
109
|
+
const rippleSize = Math.max(
|
|
110
|
+
Math.hypot(rect.width, rect.height) * 2.5,
|
|
111
|
+
320
|
|
112
|
+
);
|
|
110
113
|
setRipples((prev) => [
|
|
111
114
|
...prev,
|
|
112
115
|
{ id: Date.now(), x, y, size: rippleSize }
|
|
@@ -1488,6 +1491,7 @@ var ButtonComponent = React18.forwardRef(
|
|
|
1488
1491
|
shape = "round",
|
|
1489
1492
|
selected,
|
|
1490
1493
|
icon,
|
|
1494
|
+
selectedIcon,
|
|
1491
1495
|
iconPosition = "leading",
|
|
1492
1496
|
loading = false,
|
|
1493
1497
|
loadingVariant = "loading-indicator",
|
|
@@ -1509,6 +1513,7 @@ var ButtonComponent = React18.forwardRef(
|
|
|
1509
1513
|
"shape",
|
|
1510
1514
|
"selected",
|
|
1511
1515
|
"icon",
|
|
1516
|
+
"selectedIcon",
|
|
1512
1517
|
"iconPosition",
|
|
1513
1518
|
"loading",
|
|
1514
1519
|
"loadingVariant",
|
|
@@ -1608,10 +1613,11 @@ var ButtonComponent = React18.forwardRef(
|
|
|
1608
1613
|
layout: BUTTON_SHAPE_MORPH_SPRING,
|
|
1609
1614
|
default: SPRING_TRANSITION
|
|
1610
1615
|
};
|
|
1616
|
+
const activeIcon = isSelected && selectedIcon ? selectedIcon : icon;
|
|
1611
1617
|
const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1612
1618
|
needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
|
|
1613
1619
|
/* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
1614
|
-
/* @__PURE__ */ jsx(AnimatePresence, { initial: false, mode: "
|
|
1620
|
+
/* @__PURE__ */ jsx(AnimatePresence, { initial: false, mode: "wait", children: (loading || activeIcon && iconPosition === "leading") && /* @__PURE__ */ jsx(
|
|
1615
1621
|
AnimatedIconSlot,
|
|
1616
1622
|
{
|
|
1617
1623
|
iconSize: sizeTokens.iconSize,
|
|
@@ -1633,8 +1639,9 @@ var ButtonComponent = React18.forwardRef(
|
|
|
1633
1639
|
trackColor: "transparent",
|
|
1634
1640
|
"aria-label": "Loading"
|
|
1635
1641
|
}
|
|
1636
|
-
) :
|
|
1637
|
-
}
|
|
1642
|
+
) : activeIcon
|
|
1643
|
+
},
|
|
1644
|
+
isSelected && selectedIcon ? "selected-icon" : "icon"
|
|
1638
1645
|
) }),
|
|
1639
1646
|
labelText && /* @__PURE__ */ jsx(
|
|
1640
1647
|
m.span,
|
|
@@ -1645,14 +1652,15 @@ var ButtonComponent = React18.forwardRef(
|
|
|
1645
1652
|
children: labelText
|
|
1646
1653
|
}
|
|
1647
1654
|
),
|
|
1648
|
-
/* @__PURE__ */ jsx(AnimatePresence, { initial: false, mode: "
|
|
1655
|
+
/* @__PURE__ */ jsx(AnimatePresence, { initial: false, mode: "wait", children: !loading && activeIcon && iconPosition === "trailing" && /* @__PURE__ */ jsx(
|
|
1649
1656
|
AnimatedIconSlot,
|
|
1650
1657
|
{
|
|
1651
1658
|
iconSize: sizeTokens.iconSize,
|
|
1652
1659
|
ariaHidden: true,
|
|
1653
1660
|
transition: sharedTransition,
|
|
1654
|
-
children:
|
|
1655
|
-
}
|
|
1661
|
+
children: activeIcon
|
|
1662
|
+
},
|
|
1663
|
+
isSelected && selectedIcon ? "selected-icon" : "icon"
|
|
1656
1664
|
) })
|
|
1657
1665
|
] });
|
|
1658
1666
|
const handleAsChildPointerDown = React18.useCallback(
|