@bug-on/m3-expressive 1.1.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.
Files changed (61) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/buttons.d.mts +3 -3
  3. package/dist/buttons.d.ts +3 -3
  4. package/dist/buttons.js +708 -606
  5. package/dist/buttons.js.map +1 -1
  6. package/dist/buttons.mjs +707 -605
  7. package/dist/buttons.mjs.map +1 -1
  8. package/dist/core-Bc5Wj_pc.d.ts +497 -0
  9. package/dist/core-D4048_K5.d.mts +497 -0
  10. package/dist/core.d.mts +6 -422
  11. package/dist/core.d.ts +6 -422
  12. package/dist/core.js +223 -129
  13. package/dist/core.js.map +1 -1
  14. package/dist/core.mjs +224 -130
  15. package/dist/core.mjs.map +1 -1
  16. package/dist/feedback.js +85 -61
  17. package/dist/feedback.js.map +1 -1
  18. package/dist/feedback.mjs +85 -61
  19. package/dist/feedback.mjs.map +1 -1
  20. package/dist/forms.d.mts +2 -2
  21. package/dist/forms.d.ts +2 -2
  22. package/dist/forms.js +70 -8
  23. package/dist/forms.js.map +1 -1
  24. package/dist/forms.mjs +70 -8
  25. package/dist/forms.mjs.map +1 -1
  26. package/dist/{icon-button-D-gs0gfj.d.mts → icon-button-sSt6PPLg.d.mts} +6 -0
  27. package/dist/{icon-button-D-gs0gfj.d.ts → icon-button-sSt6PPLg.d.ts} +6 -0
  28. package/dist/index.css +6 -1
  29. package/dist/index.d.mts +68 -6
  30. package/dist/index.d.ts +68 -6
  31. package/dist/index.js +1177 -580
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +1172 -583
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/layout.d.mts +18 -1
  36. package/dist/layout.d.ts +18 -1
  37. package/dist/layout.js +94 -8
  38. package/dist/layout.js.map +1 -1
  39. package/dist/layout.mjs +94 -8
  40. package/dist/layout.mjs.map +1 -1
  41. package/dist/{md3-DFhj-NZj.d.mts → md3-Dty-Qcad.d.mts} +7 -1
  42. package/dist/{md3-DFhj-NZj.d.ts → md3-Dty-Qcad.d.ts} +7 -1
  43. package/dist/navigation.d.mts +134 -9
  44. package/dist/navigation.d.ts +134 -9
  45. package/dist/navigation.js +403 -93
  46. package/dist/navigation.js.map +1 -1
  47. package/dist/navigation.mjs +397 -94
  48. package/dist/navigation.mjs.map +1 -1
  49. package/dist/overlays.js +214 -189
  50. package/dist/overlays.js.map +1 -1
  51. package/dist/overlays.mjs +176 -151
  52. package/dist/overlays.mjs.map +1 -1
  53. package/dist/pickers.js +222 -197
  54. package/dist/pickers.js.map +1 -1
  55. package/dist/pickers.mjs +189 -164
  56. package/dist/pickers.mjs.map +1 -1
  57. package/dist/{split-button-trailing-uncheckable-BRPuTqi1.d.mts → split-button-trailing-uncheckable-BcPD_7uK.d.ts} +73 -7
  58. package/dist/{split-button-trailing-uncheckable-CjOFCoyW.d.ts → split-button-trailing-uncheckable-DtFJkTFr.d.mts} +73 -7
  59. package/dist/{text-field-eAIpz9z1.d.mts → text-field-T4Rg-9Bw.d.mts} +7 -0
  60. package/dist/{text-field-eAIpz9z1.d.ts → text-field-T4Rg-9Bw.d.ts} +7 -0
  61. package/package.json +4 -4
package/dist/feedback.mjs CHANGED
@@ -1280,6 +1280,7 @@ var IconButtonComponent = React12.forwardRef(
1280
1280
  loading = false,
1281
1281
  loadingVariant = "loading-indicator",
1282
1282
  iconSize,
1283
+ asChild = false,
1283
1284
  children,
1284
1285
  onClick,
1285
1286
  onKeyDown,
@@ -1295,6 +1296,7 @@ var IconButtonComponent = React12.forwardRef(
1295
1296
  "loading",
1296
1297
  "loadingVariant",
1297
1298
  "iconSize",
1299
+ "asChild",
1298
1300
  "children",
1299
1301
  "onClick",
1300
1302
  "onKeyDown",
@@ -1356,7 +1358,87 @@ var IconButtonComponent = React12.forwardRef(
1356
1358
  },
1357
1359
  [loading, onClick, onKeyDown]
1358
1360
  );
1359
- return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
1361
+ const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
1362
+ needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
1363
+ /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
1364
+ /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsx(
1365
+ m.span,
1366
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
1367
+ transition: SPRING_TRANSITION,
1368
+ className: cn(
1369
+ "flex items-center justify-center shrink-0",
1370
+ iconSize != null ? void 0 : iconClass
1371
+ ),
1372
+ style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
1373
+ children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsx(
1374
+ LoadingIndicator,
1375
+ {
1376
+ size: typeof iconPx === "number" ? iconPx : defaultIconPx,
1377
+ color: "currentColor",
1378
+ "aria-label": "Loading"
1379
+ }
1380
+ ) : /* @__PURE__ */ jsx(
1381
+ ProgressIndicator,
1382
+ {
1383
+ variant: "circular",
1384
+ size: typeof iconPx === "number" ? iconPx : defaultIconPx,
1385
+ color: "currentColor",
1386
+ trackColor: "transparent",
1387
+ "aria-label": "Loading"
1388
+ }
1389
+ )
1390
+ }),
1391
+ "loading"
1392
+ ) : /* @__PURE__ */ jsx(
1393
+ m.span,
1394
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
1395
+ transition: SPRING_TRANSITION,
1396
+ "aria-hidden": "true",
1397
+ className: cn(
1398
+ "flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
1399
+ iconSize != null ? void 0 : iconClass
1400
+ ),
1401
+ style: {
1402
+ fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
1403
+ width: isCustomSize ? `${iconSize}px` : void 0,
1404
+ height: isCustomSize ? `${iconSize}px` : void 0
1405
+ },
1406
+ children: asChild ? React12.Children.only(children).props.children : children
1407
+ }),
1408
+ "content"
1409
+ ) })
1410
+ ] });
1411
+ const containerClassName = cn(
1412
+ baseIconButtonClasses,
1413
+ resolvedColorClass,
1414
+ outlineWidthClass,
1415
+ disabledBgClass,
1416
+ "overflow-hidden",
1417
+ SIZE_STYLES[size],
1418
+ loading && "pointer-events-none opacity-75 cursor-not-allowed",
1419
+ className
1420
+ );
1421
+ if (asChild) {
1422
+ const child = React12.Children.only(children);
1423
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
1424
+ Slot,
1425
+ __spreadProps(__spreadValues({
1426
+ ref,
1427
+ "aria-pressed": isToggle ? isSelected : void 0,
1428
+ "aria-label": ariaLabel,
1429
+ "aria-busy": loading || void 0,
1430
+ "aria-disabled": loading || restProps.disabled,
1431
+ onClick: handleClick,
1432
+ onPointerDown,
1433
+ onKeyDown: handleKeyDown,
1434
+ style: __spreadProps(__spreadValues({}, style), { borderRadius: `${animateRadius}px` }),
1435
+ className: containerClassName
1436
+ }, restProps), {
1437
+ children: React12.cloneElement(child, { children: innerContent })
1438
+ })
1439
+ ) });
1440
+ }
1441
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
1360
1442
  m.button,
1361
1443
  __spreadProps(__spreadValues({
1362
1444
  ref,
@@ -1372,67 +1454,9 @@ var IconButtonComponent = React12.forwardRef(
1372
1454
  animate: { borderRadius: animateRadius },
1373
1455
  whileTap: { borderRadius: pressedRadius },
1374
1456
  transition: { borderRadius: SPRING_TRANSITION_FAST },
1375
- className: cn(
1376
- baseIconButtonClasses,
1377
- resolvedColorClass,
1378
- outlineWidthClass,
1379
- disabledBgClass,
1380
- "overflow-hidden",
1381
- SIZE_STYLES[size],
1382
- loading && "pointer-events-none opacity-75 cursor-not-allowed",
1383
- className
1384
- )
1457
+ className: containerClassName
1385
1458
  }, restProps), {
1386
- children: [
1387
- needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
1388
- /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
1389
- /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsx(
1390
- m.span,
1391
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
1392
- transition: SPRING_TRANSITION,
1393
- className: cn(
1394
- "flex items-center justify-center shrink-0",
1395
- iconSize != null ? void 0 : iconClass
1396
- ),
1397
- style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
1398
- children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsx(
1399
- LoadingIndicator,
1400
- {
1401
- size: typeof iconPx === "number" ? iconPx : defaultIconPx,
1402
- color: "currentColor",
1403
- "aria-label": "Loading"
1404
- }
1405
- ) : /* @__PURE__ */ jsx(
1406
- ProgressIndicator,
1407
- {
1408
- variant: "circular",
1409
- size: typeof iconPx === "number" ? iconPx : defaultIconPx,
1410
- color: "currentColor",
1411
- trackColor: "transparent",
1412
- "aria-label": "Loading"
1413
- }
1414
- )
1415
- }),
1416
- "loading"
1417
- ) : /* @__PURE__ */ jsx(
1418
- m.span,
1419
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
1420
- transition: SPRING_TRANSITION,
1421
- "aria-hidden": "true",
1422
- className: cn(
1423
- "flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
1424
- iconSize != null ? void 0 : iconClass
1425
- ),
1426
- style: {
1427
- fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
1428
- width: isCustomSize ? `${iconSize}px` : void 0,
1429
- height: isCustomSize ? `${iconSize}px` : void 0
1430
- },
1431
- children
1432
- }),
1433
- "content"
1434
- ) })
1435
- ]
1459
+ children: innerContent
1436
1460
  })
1437
1461
  ) });
1438
1462
  }