@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/feedback.js
CHANGED
|
@@ -1159,7 +1159,10 @@ function useRippleState(options = {}) {
|
|
|
1159
1159
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
1160
1160
|
const x = e.clientX - rect.left;
|
|
1161
1161
|
const y = e.clientY - rect.top;
|
|
1162
|
-
const rippleSize = Math.
|
|
1162
|
+
const rippleSize = Math.max(
|
|
1163
|
+
Math.hypot(rect.width, rect.height) * 2.5,
|
|
1164
|
+
320
|
|
1165
|
+
);
|
|
1163
1166
|
setRipples((prev) => [
|
|
1164
1167
|
...prev,
|
|
1165
1168
|
{ id: Date.now(), x, y, size: rippleSize }
|
|
@@ -1190,12 +1193,39 @@ function TouchTarget() {
|
|
|
1190
1193
|
}
|
|
1191
1194
|
);
|
|
1192
1195
|
}
|
|
1193
|
-
var
|
|
1194
|
-
xs: "h-8
|
|
1195
|
-
sm: "h-10
|
|
1196
|
-
md: "h-14
|
|
1197
|
-
lg: "h-24
|
|
1198
|
-
xl: "h-[8.5rem]
|
|
1196
|
+
var SIZE_HEIGHT_STYLES = {
|
|
1197
|
+
xs: "h-8",
|
|
1198
|
+
sm: "h-10",
|
|
1199
|
+
md: "h-14",
|
|
1200
|
+
lg: "h-24",
|
|
1201
|
+
xl: "h-[8.5rem]"
|
|
1202
|
+
};
|
|
1203
|
+
var WIDTH_SIZE_STYLES = {
|
|
1204
|
+
xs: {
|
|
1205
|
+
default: "w-8",
|
|
1206
|
+
narrow: "w-8",
|
|
1207
|
+
wide: "w-12"
|
|
1208
|
+
},
|
|
1209
|
+
sm: {
|
|
1210
|
+
default: "w-10",
|
|
1211
|
+
narrow: "w-12",
|
|
1212
|
+
wide: "w-[3.25rem]"
|
|
1213
|
+
},
|
|
1214
|
+
md: {
|
|
1215
|
+
default: "w-14",
|
|
1216
|
+
narrow: "w-12",
|
|
1217
|
+
wide: "w-[4.5rem]"
|
|
1218
|
+
},
|
|
1219
|
+
lg: {
|
|
1220
|
+
default: "w-24",
|
|
1221
|
+
narrow: "w-16",
|
|
1222
|
+
wide: "w-32"
|
|
1223
|
+
},
|
|
1224
|
+
xl: {
|
|
1225
|
+
default: "w-[8.5rem]",
|
|
1226
|
+
narrow: "w-[6.5rem]",
|
|
1227
|
+
wide: "w-[11.5rem]"
|
|
1228
|
+
}
|
|
1199
1229
|
};
|
|
1200
1230
|
var SIZE_ICON = {
|
|
1201
1231
|
xs: { cls: "size-5", px: 20 },
|
|
@@ -1296,8 +1326,10 @@ var IconButtonComponent = React12__namespace.forwardRef(
|
|
|
1296
1326
|
variant = "default",
|
|
1297
1327
|
colorStyle = "standard",
|
|
1298
1328
|
size = "sm",
|
|
1329
|
+
widthVariant = "default",
|
|
1299
1330
|
shape = "round",
|
|
1300
1331
|
selected,
|
|
1332
|
+
selectedIcon,
|
|
1301
1333
|
loading = false,
|
|
1302
1334
|
loadingVariant = "loading-indicator",
|
|
1303
1335
|
iconSize,
|
|
@@ -1312,8 +1344,10 @@ var IconButtonComponent = React12__namespace.forwardRef(
|
|
|
1312
1344
|
"variant",
|
|
1313
1345
|
"colorStyle",
|
|
1314
1346
|
"size",
|
|
1347
|
+
"widthVariant",
|
|
1315
1348
|
"shape",
|
|
1316
1349
|
"selected",
|
|
1350
|
+
"selectedIcon",
|
|
1317
1351
|
"loading",
|
|
1318
1352
|
"loadingVariant",
|
|
1319
1353
|
"iconSize",
|
|
@@ -1323,7 +1357,7 @@ var IconButtonComponent = React12__namespace.forwardRef(
|
|
|
1323
1357
|
"onKeyDown",
|
|
1324
1358
|
"aria-label"
|
|
1325
1359
|
]);
|
|
1326
|
-
var _a2, _b2;
|
|
1360
|
+
var _a2, _b2, _c, _d, _e;
|
|
1327
1361
|
const isToggle = variant === "toggle";
|
|
1328
1362
|
const isSelected = isToggle && !!selected;
|
|
1329
1363
|
const resolvedColorClass = React12__namespace.useMemo(
|
|
@@ -1354,6 +1388,8 @@ var IconButtonComponent = React12__namespace.forwardRef(
|
|
|
1354
1388
|
const defaultIconPx = sizeIcon.px;
|
|
1355
1389
|
const iconPx = iconSize != null ? iconSize : defaultIconPx;
|
|
1356
1390
|
const isCustomSize = iconSize != null && iconSize !== "inherit";
|
|
1391
|
+
const heightClass = (_c = SIZE_HEIGHT_STYLES[size]) != null ? _c : SIZE_HEIGHT_STYLES.sm;
|
|
1392
|
+
const widthClass = (_e = ((_d = WIDTH_SIZE_STYLES[size]) != null ? _d : WIDTH_SIZE_STYLES.sm)[widthVariant]) != null ? _e : WIDTH_SIZE_STYLES.sm.default;
|
|
1357
1393
|
const needsTouchTarget = size === "xs" || size === "sm";
|
|
1358
1394
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
1359
1395
|
disabled: loading
|
|
@@ -1416,7 +1452,7 @@ var IconButtonComponent = React12__namespace.forwardRef(
|
|
|
1416
1452
|
transition: SPRING_TRANSITION,
|
|
1417
1453
|
"aria-hidden": "true",
|
|
1418
1454
|
className: cn(
|
|
1419
|
-
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]
|
|
1455
|
+
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]",
|
|
1420
1456
|
iconSize != null ? void 0 : iconClass
|
|
1421
1457
|
),
|
|
1422
1458
|
style: {
|
|
@@ -1424,9 +1460,9 @@ var IconButtonComponent = React12__namespace.forwardRef(
|
|
|
1424
1460
|
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
1425
1461
|
height: isCustomSize ? `${iconSize}px` : void 0
|
|
1426
1462
|
},
|
|
1427
|
-
children: asChild ? React12__namespace.Children.only(children).props.children : children
|
|
1463
|
+
children: isSelected && selectedIcon ? selectedIcon : asChild ? React12__namespace.Children.only(children).props.children : children
|
|
1428
1464
|
}),
|
|
1429
|
-
"content"
|
|
1465
|
+
isSelected && selectedIcon ? "selected-content" : "content"
|
|
1430
1466
|
) })
|
|
1431
1467
|
] });
|
|
1432
1468
|
const containerClassName = cn(
|
|
@@ -1435,7 +1471,8 @@ var IconButtonComponent = React12__namespace.forwardRef(
|
|
|
1435
1471
|
outlineWidthClass,
|
|
1436
1472
|
disabledBgClass,
|
|
1437
1473
|
"overflow-hidden",
|
|
1438
|
-
|
|
1474
|
+
heightClass,
|
|
1475
|
+
widthClass,
|
|
1439
1476
|
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
1440
1477
|
className
|
|
1441
1478
|
);
|
|
@@ -1452,7 +1489,9 @@ var IconButtonComponent = React12__namespace.forwardRef(
|
|
|
1452
1489
|
onClick: handleClick,
|
|
1453
1490
|
onPointerDown,
|
|
1454
1491
|
onKeyDown: handleKeyDown,
|
|
1455
|
-
style: __spreadProps(__spreadValues({}, style), {
|
|
1492
|
+
style: __spreadProps(__spreadValues({}, style), {
|
|
1493
|
+
borderRadius: `${animateRadius}px`
|
|
1494
|
+
}),
|
|
1456
1495
|
className: containerClassName
|
|
1457
1496
|
}, restProps), {
|
|
1458
1497
|
children: React12__namespace.cloneElement(child, { children: innerContent })
|