@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/overlays.js
CHANGED
|
@@ -1050,7 +1050,10 @@ function useRippleState(options = {}) {
|
|
|
1050
1050
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
1051
1051
|
const x = e.clientX - rect.left;
|
|
1052
1052
|
const y = e.clientY - rect.top;
|
|
1053
|
-
const rippleSize = Math.
|
|
1053
|
+
const rippleSize = Math.max(
|
|
1054
|
+
Math.hypot(rect.width, rect.height) * 2.5,
|
|
1055
|
+
320
|
|
1056
|
+
);
|
|
1054
1057
|
setRipples((prev) => [
|
|
1055
1058
|
...prev,
|
|
1056
1059
|
{ id: Date.now(), x, y, size: rippleSize }
|
|
@@ -1168,12 +1171,39 @@ function TouchTarget() {
|
|
|
1168
1171
|
}
|
|
1169
1172
|
);
|
|
1170
1173
|
}
|
|
1171
|
-
var
|
|
1172
|
-
xs: "h-8
|
|
1173
|
-
sm: "h-10
|
|
1174
|
-
md: "h-14
|
|
1175
|
-
lg: "h-24
|
|
1176
|
-
xl: "h-[8.5rem]
|
|
1174
|
+
var SIZE_HEIGHT_STYLES = {
|
|
1175
|
+
xs: "h-8",
|
|
1176
|
+
sm: "h-10",
|
|
1177
|
+
md: "h-14",
|
|
1178
|
+
lg: "h-24",
|
|
1179
|
+
xl: "h-[8.5rem]"
|
|
1180
|
+
};
|
|
1181
|
+
var WIDTH_SIZE_STYLES = {
|
|
1182
|
+
xs: {
|
|
1183
|
+
default: "w-8",
|
|
1184
|
+
narrow: "w-8",
|
|
1185
|
+
wide: "w-12"
|
|
1186
|
+
},
|
|
1187
|
+
sm: {
|
|
1188
|
+
default: "w-10",
|
|
1189
|
+
narrow: "w-12",
|
|
1190
|
+
wide: "w-[3.25rem]"
|
|
1191
|
+
},
|
|
1192
|
+
md: {
|
|
1193
|
+
default: "w-14",
|
|
1194
|
+
narrow: "w-12",
|
|
1195
|
+
wide: "w-[4.5rem]"
|
|
1196
|
+
},
|
|
1197
|
+
lg: {
|
|
1198
|
+
default: "w-24",
|
|
1199
|
+
narrow: "w-16",
|
|
1200
|
+
wide: "w-32"
|
|
1201
|
+
},
|
|
1202
|
+
xl: {
|
|
1203
|
+
default: "w-[8.5rem]",
|
|
1204
|
+
narrow: "w-[6.5rem]",
|
|
1205
|
+
wide: "w-[11.5rem]"
|
|
1206
|
+
}
|
|
1177
1207
|
};
|
|
1178
1208
|
var SIZE_ICON = {
|
|
1179
1209
|
xs: { cls: "size-5", px: 20 },
|
|
@@ -1274,8 +1304,10 @@ var IconButtonComponent = React9__namespace.forwardRef(
|
|
|
1274
1304
|
variant = "default",
|
|
1275
1305
|
colorStyle = "standard",
|
|
1276
1306
|
size = "sm",
|
|
1307
|
+
widthVariant = "default",
|
|
1277
1308
|
shape = "round",
|
|
1278
1309
|
selected,
|
|
1310
|
+
selectedIcon,
|
|
1279
1311
|
loading = false,
|
|
1280
1312
|
loadingVariant = "loading-indicator",
|
|
1281
1313
|
iconSize,
|
|
@@ -1290,8 +1322,10 @@ var IconButtonComponent = React9__namespace.forwardRef(
|
|
|
1290
1322
|
"variant",
|
|
1291
1323
|
"colorStyle",
|
|
1292
1324
|
"size",
|
|
1325
|
+
"widthVariant",
|
|
1293
1326
|
"shape",
|
|
1294
1327
|
"selected",
|
|
1328
|
+
"selectedIcon",
|
|
1295
1329
|
"loading",
|
|
1296
1330
|
"loadingVariant",
|
|
1297
1331
|
"iconSize",
|
|
@@ -1301,7 +1335,7 @@ var IconButtonComponent = React9__namespace.forwardRef(
|
|
|
1301
1335
|
"onKeyDown",
|
|
1302
1336
|
"aria-label"
|
|
1303
1337
|
]);
|
|
1304
|
-
var _a2, _b2;
|
|
1338
|
+
var _a2, _b2, _c, _d, _e;
|
|
1305
1339
|
const isToggle = variant === "toggle";
|
|
1306
1340
|
const isSelected = isToggle && !!selected;
|
|
1307
1341
|
const resolvedColorClass = React9__namespace.useMemo(
|
|
@@ -1332,6 +1366,8 @@ var IconButtonComponent = React9__namespace.forwardRef(
|
|
|
1332
1366
|
const defaultIconPx = sizeIcon.px;
|
|
1333
1367
|
const iconPx = iconSize != null ? iconSize : defaultIconPx;
|
|
1334
1368
|
const isCustomSize = iconSize != null && iconSize !== "inherit";
|
|
1369
|
+
const heightClass = (_c = SIZE_HEIGHT_STYLES[size]) != null ? _c : SIZE_HEIGHT_STYLES.sm;
|
|
1370
|
+
const widthClass = (_e = ((_d = WIDTH_SIZE_STYLES[size]) != null ? _d : WIDTH_SIZE_STYLES.sm)[widthVariant]) != null ? _e : WIDTH_SIZE_STYLES.sm.default;
|
|
1335
1371
|
const needsTouchTarget = size === "xs" || size === "sm";
|
|
1336
1372
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
1337
1373
|
disabled: loading
|
|
@@ -1394,7 +1430,7 @@ var IconButtonComponent = React9__namespace.forwardRef(
|
|
|
1394
1430
|
transition: SPRING_TRANSITION,
|
|
1395
1431
|
"aria-hidden": "true",
|
|
1396
1432
|
className: cn(
|
|
1397
|
-
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]
|
|
1433
|
+
"flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]",
|
|
1398
1434
|
iconSize != null ? void 0 : iconClass
|
|
1399
1435
|
),
|
|
1400
1436
|
style: {
|
|
@@ -1402,9 +1438,9 @@ var IconButtonComponent = React9__namespace.forwardRef(
|
|
|
1402
1438
|
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
1403
1439
|
height: isCustomSize ? `${iconSize}px` : void 0
|
|
1404
1440
|
},
|
|
1405
|
-
children: asChild ? React9__namespace.Children.only(children).props.children : children
|
|
1441
|
+
children: isSelected && selectedIcon ? selectedIcon : asChild ? React9__namespace.Children.only(children).props.children : children
|
|
1406
1442
|
}),
|
|
1407
|
-
"content"
|
|
1443
|
+
isSelected && selectedIcon ? "selected-content" : "content"
|
|
1408
1444
|
) })
|
|
1409
1445
|
] });
|
|
1410
1446
|
const containerClassName = cn(
|
|
@@ -1413,7 +1449,8 @@ var IconButtonComponent = React9__namespace.forwardRef(
|
|
|
1413
1449
|
outlineWidthClass,
|
|
1414
1450
|
disabledBgClass,
|
|
1415
1451
|
"overflow-hidden",
|
|
1416
|
-
|
|
1452
|
+
heightClass,
|
|
1453
|
+
widthClass,
|
|
1417
1454
|
loading && "pointer-events-none opacity-75 cursor-not-allowed",
|
|
1418
1455
|
className
|
|
1419
1456
|
);
|
|
@@ -1430,7 +1467,9 @@ var IconButtonComponent = React9__namespace.forwardRef(
|
|
|
1430
1467
|
onClick: handleClick,
|
|
1431
1468
|
onPointerDown,
|
|
1432
1469
|
onKeyDown: handleKeyDown,
|
|
1433
|
-
style: __spreadProps(__spreadValues({}, style), {
|
|
1470
|
+
style: __spreadProps(__spreadValues({}, style), {
|
|
1471
|
+
borderRadius: `${animateRadius}px`
|
|
1472
|
+
}),
|
|
1434
1473
|
className: containerClassName
|
|
1435
1474
|
}, restProps), {
|
|
1436
1475
|
children: React9__namespace.cloneElement(child, { children: innerContent })
|