@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/core.js
CHANGED
|
@@ -436,7 +436,10 @@ function useRippleState(options = {}) {
|
|
|
436
436
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
437
437
|
const x = e.clientX - rect.left;
|
|
438
438
|
const y = e.clientY - rect.top;
|
|
439
|
-
const rippleSize = Math.
|
|
439
|
+
const rippleSize = Math.max(
|
|
440
|
+
Math.hypot(rect.width, rect.height) * 2.5,
|
|
441
|
+
320
|
|
442
|
+
);
|
|
440
443
|
setRipples((prev) => [
|
|
441
444
|
...prev,
|
|
442
445
|
{ id: Date.now(), x, y, size: rippleSize }
|
|
@@ -1391,12 +1394,39 @@ function TouchTarget() {
|
|
|
1391
1394
|
}
|
|
1392
1395
|
);
|
|
1393
1396
|
}
|
|
1394
|
-
var
|
|
1395
|
-
xs: "h-8
|
|
1396
|
-
sm: "h-10
|
|
1397
|
-
md: "h-14
|
|
1398
|
-
lg: "h-24
|
|
1399
|
-
xl: "h-[8.5rem]
|
|
1397
|
+
var SIZE_HEIGHT_STYLES = {
|
|
1398
|
+
xs: "h-8",
|
|
1399
|
+
sm: "h-10",
|
|
1400
|
+
md: "h-14",
|
|
1401
|
+
lg: "h-24",
|
|
1402
|
+
xl: "h-[8.5rem]"
|
|
1403
|
+
};
|
|
1404
|
+
var WIDTH_SIZE_STYLES = {
|
|
1405
|
+
xs: {
|
|
1406
|
+
default: "w-8",
|
|
1407
|
+
narrow: "w-8",
|
|
1408
|
+
wide: "w-12"
|
|
1409
|
+
},
|
|
1410
|
+
sm: {
|
|
1411
|
+
default: "w-10",
|
|
1412
|
+
narrow: "w-12",
|
|
1413
|
+
wide: "w-[3.25rem]"
|
|
1414
|
+
},
|
|
1415
|
+
md: {
|
|
1416
|
+
default: "w-14",
|
|
1417
|
+
narrow: "w-12",
|
|
1418
|
+
wide: "w-[4.5rem]"
|
|
1419
|
+
},
|
|
1420
|
+
lg: {
|
|
1421
|
+
default: "w-24",
|
|
1422
|
+
narrow: "w-16",
|
|
1423
|
+
wide: "w-32"
|
|
1424
|
+
},
|
|
1425
|
+
xl: {
|
|
1426
|
+
default: "w-[8.5rem]",
|
|
1427
|
+
narrow: "w-[6.5rem]",
|
|
1428
|
+
wide: "w-[11.5rem]"
|
|
1429
|
+
}
|
|
1400
1430
|
};
|
|
1401
1431
|
var SIZE_ICON = {
|
|
1402
1432
|
xs: { cls: "size-5", px: 20 },
|
|
@@ -1497,8 +1527,10 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
1497
1527
|
variant = "default",
|
|
1498
1528
|
colorStyle = "standard",
|
|
1499
1529
|
size = "sm",
|
|
1530
|
+
widthVariant = "default",
|
|
1500
1531
|
shape = "round",
|
|
1501
1532
|
selected,
|
|
1533
|
+
selectedIcon,
|
|
1502
1534
|
loading = false,
|
|
1503
1535
|
loadingVariant = "loading-indicator",
|
|
1504
1536
|
iconSize,
|
|
@@ -1513,8 +1545,10 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
1513
1545
|
"variant",
|
|
1514
1546
|
"colorStyle",
|
|
1515
1547
|
"size",
|
|
1548
|
+
"widthVariant",
|
|
1516
1549
|
"shape",
|
|
1517
1550
|
"selected",
|
|
1551
|
+
"selectedIcon",
|
|
1518
1552
|
"loading",
|
|
1519
1553
|
"loadingVariant",
|
|
1520
1554
|
"iconSize",
|
|
@@ -1524,7 +1558,7 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
1524
1558
|
"onKeyDown",
|
|
1525
1559
|
"aria-label"
|
|
1526
1560
|
]);
|
|
1527
|
-
var _a2, _b2;
|
|
1561
|
+
var _a2, _b2, _c, _d, _e;
|
|
1528
1562
|
const isToggle = variant === "toggle";
|
|
1529
1563
|
const isSelected = isToggle && !!selected;
|
|
1530
1564
|
const resolvedColorClass = React11__namespace.useMemo(
|
|
@@ -1555,6 +1589,8 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
1555
1589
|
const defaultIconPx = sizeIcon.px;
|
|
1556
1590
|
const iconPx = iconSize != null ? iconSize : defaultIconPx;
|
|
1557
1591
|
const isCustomSize = iconSize != null && iconSize !== "inherit";
|
|
1592
|
+
const heightClass = (_c = SIZE_HEIGHT_STYLES[size]) != null ? _c : SIZE_HEIGHT_STYLES.sm;
|
|
1593
|
+
const widthClass = (_e = ((_d = WIDTH_SIZE_STYLES[size]) != null ? _d : WIDTH_SIZE_STYLES.sm)[widthVariant]) != null ? _e : WIDTH_SIZE_STYLES.sm.default;
|
|
1558
1594
|
const needsTouchTarget = size === "xs" || size === "sm";
|
|
1559
1595
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
1560
1596
|
disabled: loading
|
|
@@ -1617,7 +1653,7 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
1617
1653
|
transition: SPRING_TRANSITION,
|
|
1618
1654
|
"aria-hidden": "true",
|
|
1619
1655
|
className: cn(
|
|
1620
|
-
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]
|
|
1656
|
+
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]",
|
|
1621
1657
|
iconSize != null ? void 0 : iconClass
|
|
1622
1658
|
),
|
|
1623
1659
|
style: {
|
|
@@ -1625,9 +1661,9 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
1625
1661
|
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
1626
1662
|
height: isCustomSize ? `${iconSize}px` : void 0
|
|
1627
1663
|
},
|
|
1628
|
-
children: asChild ? React11__namespace.Children.only(children).props.children : children
|
|
1664
|
+
children: isSelected && selectedIcon ? selectedIcon : asChild ? React11__namespace.Children.only(children).props.children : children
|
|
1629
1665
|
}),
|
|
1630
|
-
"content"
|
|
1666
|
+
isSelected && selectedIcon ? "selected-content" : "content"
|
|
1631
1667
|
) })
|
|
1632
1668
|
] });
|
|
1633
1669
|
const containerClassName = cn(
|
|
@@ -1636,7 +1672,8 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
1636
1672
|
outlineWidthClass,
|
|
1637
1673
|
disabledBgClass,
|
|
1638
1674
|
"overflow-hidden",
|
|
1639
|
-
|
|
1675
|
+
heightClass,
|
|
1676
|
+
widthClass,
|
|
1640
1677
|
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
1641
1678
|
className
|
|
1642
1679
|
);
|
|
@@ -1653,7 +1690,9 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
1653
1690
|
onClick: handleClick,
|
|
1654
1691
|
onPointerDown,
|
|
1655
1692
|
onKeyDown: handleKeyDown,
|
|
1656
|
-
style: __spreadProps(__spreadValues({}, style), {
|
|
1693
|
+
style: __spreadProps(__spreadValues({}, style), {
|
|
1694
|
+
borderRadius: `${animateRadius}px`
|
|
1695
|
+
}),
|
|
1657
1696
|
className: containerClassName
|
|
1658
1697
|
}, restProps), {
|
|
1659
1698
|
children: React11__namespace.cloneElement(child, { children: innerContent })
|