@bug-on/m3-expressive 1.2.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 +6 -0
- package/dist/buttons.d.mts +2 -2
- package/dist/buttons.d.ts +2 -2
- package/dist/buttons.js +678 -605
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +677 -604
- package/dist/buttons.mjs.map +1 -1
- package/dist/core.js +86 -61
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +86 -61
- 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.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +973 -496
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +967 -497
- 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 +65 -8
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +65 -8
- package/dist/layout.mjs.map +1 -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-BkPbiBo3.d.ts → split-button-trailing-uncheckable-BcPD_7uK.d.ts} +44 -6
- package/dist/{split-button-trailing-uncheckable-D_PLPb-u.d.mts → split-button-trailing-uncheckable-DtFJkTFr.d.mts} +44 -6
- 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 +1 -1
package/dist/core.js
CHANGED
|
@@ -7,6 +7,7 @@ var materialColorUtilities = require('@material/material-color-utilities');
|
|
|
7
7
|
var clsx = require('clsx');
|
|
8
8
|
var tailwindMerge = require('tailwind-merge');
|
|
9
9
|
var react = require('motion/react');
|
|
10
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
10
11
|
|
|
11
12
|
function _interopNamespace(e) {
|
|
12
13
|
if (e && e.__esModule) return e;
|
|
@@ -1501,6 +1502,7 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
1501
1502
|
loading = false,
|
|
1502
1503
|
loadingVariant = "loading-indicator",
|
|
1503
1504
|
iconSize,
|
|
1505
|
+
asChild = false,
|
|
1504
1506
|
children,
|
|
1505
1507
|
onClick,
|
|
1506
1508
|
onKeyDown,
|
|
@@ -1516,6 +1518,7 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
1516
1518
|
"loading",
|
|
1517
1519
|
"loadingVariant",
|
|
1518
1520
|
"iconSize",
|
|
1521
|
+
"asChild",
|
|
1519
1522
|
"children",
|
|
1520
1523
|
"onClick",
|
|
1521
1524
|
"onKeyDown",
|
|
@@ -1577,7 +1580,87 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
1577
1580
|
},
|
|
1578
1581
|
[loading, onClick, onKeyDown]
|
|
1579
1582
|
);
|
|
1580
|
-
|
|
1583
|
+
const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1584
|
+
needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
|
|
1585
|
+
/* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
1586
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1587
|
+
react.m.span,
|
|
1588
|
+
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
1589
|
+
transition: SPRING_TRANSITION,
|
|
1590
|
+
className: cn(
|
|
1591
|
+
"flex items-center justify-center shrink-0",
|
|
1592
|
+
iconSize != null ? void 0 : iconClass
|
|
1593
|
+
),
|
|
1594
|
+
style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
|
|
1595
|
+
children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1596
|
+
LoadingIndicator,
|
|
1597
|
+
{
|
|
1598
|
+
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
1599
|
+
color: "currentColor",
|
|
1600
|
+
"aria-label": "Loading"
|
|
1601
|
+
}
|
|
1602
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1603
|
+
ProgressIndicator,
|
|
1604
|
+
{
|
|
1605
|
+
variant: "circular",
|
|
1606
|
+
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
1607
|
+
color: "currentColor",
|
|
1608
|
+
trackColor: "transparent",
|
|
1609
|
+
"aria-label": "Loading"
|
|
1610
|
+
}
|
|
1611
|
+
)
|
|
1612
|
+
}),
|
|
1613
|
+
"loading"
|
|
1614
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1615
|
+
react.m.span,
|
|
1616
|
+
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
1617
|
+
transition: SPRING_TRANSITION,
|
|
1618
|
+
"aria-hidden": "true",
|
|
1619
|
+
className: cn(
|
|
1620
|
+
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
|
|
1621
|
+
iconSize != null ? void 0 : iconClass
|
|
1622
|
+
),
|
|
1623
|
+
style: {
|
|
1624
|
+
fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
|
|
1625
|
+
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
1626
|
+
height: isCustomSize ? `${iconSize}px` : void 0
|
|
1627
|
+
},
|
|
1628
|
+
children: asChild ? React11__namespace.Children.only(children).props.children : children
|
|
1629
|
+
}),
|
|
1630
|
+
"content"
|
|
1631
|
+
) })
|
|
1632
|
+
] });
|
|
1633
|
+
const containerClassName = cn(
|
|
1634
|
+
baseIconButtonClasses,
|
|
1635
|
+
resolvedColorClass,
|
|
1636
|
+
outlineWidthClass,
|
|
1637
|
+
disabledBgClass,
|
|
1638
|
+
"overflow-hidden",
|
|
1639
|
+
SIZE_STYLES[size],
|
|
1640
|
+
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
1641
|
+
className
|
|
1642
|
+
);
|
|
1643
|
+
if (asChild) {
|
|
1644
|
+
const child = React11__namespace.Children.only(children);
|
|
1645
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1646
|
+
reactSlot.Slot,
|
|
1647
|
+
__spreadProps(__spreadValues({
|
|
1648
|
+
ref,
|
|
1649
|
+
"aria-pressed": isToggle ? isSelected : void 0,
|
|
1650
|
+
"aria-label": ariaLabel,
|
|
1651
|
+
"aria-busy": loading || void 0,
|
|
1652
|
+
"aria-disabled": loading || restProps.disabled,
|
|
1653
|
+
onClick: handleClick,
|
|
1654
|
+
onPointerDown,
|
|
1655
|
+
onKeyDown: handleKeyDown,
|
|
1656
|
+
style: __spreadProps(__spreadValues({}, style), { borderRadius: `${animateRadius}px` }),
|
|
1657
|
+
className: containerClassName
|
|
1658
|
+
}, restProps), {
|
|
1659
|
+
children: React11__namespace.cloneElement(child, { children: innerContent })
|
|
1660
|
+
})
|
|
1661
|
+
) });
|
|
1662
|
+
}
|
|
1663
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1581
1664
|
react.m.button,
|
|
1582
1665
|
__spreadProps(__spreadValues({
|
|
1583
1666
|
ref,
|
|
@@ -1593,67 +1676,9 @@ var IconButtonComponent = React11__namespace.forwardRef(
|
|
|
1593
1676
|
animate: { borderRadius: animateRadius },
|
|
1594
1677
|
whileTap: { borderRadius: pressedRadius },
|
|
1595
1678
|
transition: { borderRadius: SPRING_TRANSITION_FAST },
|
|
1596
|
-
className:
|
|
1597
|
-
baseIconButtonClasses,
|
|
1598
|
-
resolvedColorClass,
|
|
1599
|
-
outlineWidthClass,
|
|
1600
|
-
disabledBgClass,
|
|
1601
|
-
"overflow-hidden",
|
|
1602
|
-
SIZE_STYLES[size],
|
|
1603
|
-
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
1604
|
-
className
|
|
1605
|
-
)
|
|
1679
|
+
className: containerClassName
|
|
1606
1680
|
}, restProps), {
|
|
1607
|
-
children:
|
|
1608
|
-
needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
|
|
1609
|
-
/* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
|
|
1610
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1611
|
-
react.m.span,
|
|
1612
|
-
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
1613
|
-
transition: SPRING_TRANSITION,
|
|
1614
|
-
className: cn(
|
|
1615
|
-
"flex items-center justify-center shrink-0",
|
|
1616
|
-
iconSize != null ? void 0 : iconClass
|
|
1617
|
-
),
|
|
1618
|
-
style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
|
|
1619
|
-
children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1620
|
-
LoadingIndicator,
|
|
1621
|
-
{
|
|
1622
|
-
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
1623
|
-
color: "currentColor",
|
|
1624
|
-
"aria-label": "Loading"
|
|
1625
|
-
}
|
|
1626
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1627
|
-
ProgressIndicator,
|
|
1628
|
-
{
|
|
1629
|
-
variant: "circular",
|
|
1630
|
-
size: typeof iconPx === "number" ? iconPx : defaultIconPx,
|
|
1631
|
-
color: "currentColor",
|
|
1632
|
-
trackColor: "transparent",
|
|
1633
|
-
"aria-label": "Loading"
|
|
1634
|
-
}
|
|
1635
|
-
)
|
|
1636
|
-
}),
|
|
1637
|
-
"loading"
|
|
1638
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1639
|
-
react.m.span,
|
|
1640
|
-
__spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
|
|
1641
|
-
transition: SPRING_TRANSITION,
|
|
1642
|
-
"aria-hidden": "true",
|
|
1643
|
-
className: cn(
|
|
1644
|
-
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
|
|
1645
|
-
iconSize != null ? void 0 : iconClass
|
|
1646
|
-
),
|
|
1647
|
-
style: {
|
|
1648
|
-
fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
|
|
1649
|
-
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
1650
|
-
height: isCustomSize ? `${iconSize}px` : void 0
|
|
1651
|
-
},
|
|
1652
|
-
children
|
|
1653
|
-
}),
|
|
1654
|
-
"content"
|
|
1655
|
-
) })
|
|
1656
|
-
]
|
|
1681
|
+
children: innerContent
|
|
1657
1682
|
})
|
|
1658
1683
|
) });
|
|
1659
1684
|
}
|