@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.
Files changed (48) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/buttons.d.mts +26 -5
  3. package/dist/buttons.d.ts +26 -5
  4. package/dist/buttons.js +581 -345
  5. package/dist/buttons.js.map +1 -1
  6. package/dist/buttons.mjs +573 -345
  7. package/dist/buttons.mjs.map +1 -1
  8. package/dist/core.js +52 -13
  9. package/dist/core.js.map +1 -1
  10. package/dist/core.mjs +52 -13
  11. package/dist/core.mjs.map +1 -1
  12. package/dist/feedback.js +52 -13
  13. package/dist/feedback.js.map +1 -1
  14. package/dist/feedback.mjs +52 -13
  15. package/dist/feedback.mjs.map +1 -1
  16. package/dist/forms.js +4 -1
  17. package/dist/forms.js.map +1 -1
  18. package/dist/forms.mjs +4 -1
  19. package/dist/forms.mjs.map +1 -1
  20. package/dist/{icon-button-sSt6PPLg.d.mts → icon-button-CSsDmuQC.d.mts} +13 -0
  21. package/dist/{icon-button-sSt6PPLg.d.ts → icon-button-CSsDmuQC.d.ts} +13 -0
  22. package/dist/index.d.mts +2 -2
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.js +1268 -1005
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.mjs +1127 -865
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/layout.js +15 -7
  29. package/dist/layout.js.map +1 -1
  30. package/dist/layout.mjs +15 -7
  31. package/dist/layout.mjs.map +1 -1
  32. package/dist/navigation.d.mts +1 -1
  33. package/dist/navigation.d.ts +1 -1
  34. package/dist/navigation.js +66 -16
  35. package/dist/navigation.js.map +1 -1
  36. package/dist/navigation.mjs +66 -16
  37. package/dist/navigation.mjs.map +1 -1
  38. package/dist/overlays.js +52 -13
  39. package/dist/overlays.js.map +1 -1
  40. package/dist/overlays.mjs +52 -13
  41. package/dist/overlays.mjs.map +1 -1
  42. package/dist/pickers.js +177 -111
  43. package/dist/pickers.js.map +1 -1
  44. package/dist/pickers.mjs +177 -111
  45. package/dist/pickers.mjs.map +1 -1
  46. package/dist/{split-button-trailing-uncheckable-BcPD_7uK.d.ts → split-button-trailing-uncheckable-C-qQlyZx.d.ts} +74 -19
  47. package/dist/{split-button-trailing-uncheckable-DtFJkTFr.d.mts → split-button-trailing-uncheckable-DHJqNeq_.d.mts} +74 -19
  48. package/package.json +3 -3
@@ -5,7 +5,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as RxContextMenu from '@radix-ui/react-context-menu';
6
6
  import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
7
7
  import { Transition, Variants, HTMLMotionProps } from 'motion/react';
8
- import { B as BaseIconButtonProps } from './icon-button-sSt6PPLg.mjs';
8
+ import { B as BaseIconButtonProps } from './icon-button-CSsDmuQC.mjs';
9
9
 
10
10
  /**
11
11
  * @file app-bar.tokens.ts
@@ -5,7 +5,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as RxContextMenu from '@radix-ui/react-context-menu';
6
6
  import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
7
7
  import { Transition, Variants, HTMLMotionProps } from 'motion/react';
8
- import { B as BaseIconButtonProps } from './icon-button-sSt6PPLg.js';
8
+ import { B as BaseIconButtonProps } from './icon-button-CSsDmuQC.js';
9
9
 
10
10
  /**
11
11
  * @file app-bar.tokens.ts
@@ -2601,7 +2601,10 @@ function useRippleState(options = {}) {
2601
2601
  const rect = e.currentTarget.getBoundingClientRect();
2602
2602
  const x = e.clientX - rect.left;
2603
2603
  const y = e.clientY - rect.top;
2604
- const rippleSize = Math.hypot(rect.width, rect.height) * 2;
2604
+ const rippleSize = Math.max(
2605
+ Math.hypot(rect.width, rect.height) * 2.5,
2606
+ 320
2607
+ );
2605
2608
  setRipples((prev) => [
2606
2609
  ...prev,
2607
2610
  { id: Date.now(), x, y, size: rippleSize }
@@ -2684,7 +2687,11 @@ var NavigationBarItemComponent = React36__namespace.forwardRef(
2684
2687
  className,
2685
2688
  "aria-label": ariaLabelProp
2686
2689
  }, ref) => {
2687
- const { variant, itemLayout, itemClassName: contextItemClassName } = React36__namespace.useContext(NavigationBarContext);
2690
+ const {
2691
+ variant,
2692
+ itemLayout,
2693
+ itemClassName: contextItemClassName
2694
+ } = React36__namespace.useContext(NavigationBarContext);
2688
2695
  const isForcedHorizontal = itemLayout === "horizontal";
2689
2696
  const isResponsiveHorizontal = (variant === "flexible" || variant === "xr") && itemLayout === void 0;
2690
2697
  const { ripples, onPointerDown, removeRipple } = useRippleState({
@@ -2888,7 +2895,12 @@ var NavigationBarComponent = React36__namespace.forwardRef(
2888
2895
  return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
2889
2896
  NavigationBarContext.Provider,
2890
2897
  {
2891
- value: { variant, itemLayout, activeIndicatorTransition, itemClassName },
2898
+ value: {
2899
+ variant,
2900
+ itemLayout,
2901
+ activeIndicatorTransition,
2902
+ itemClassName
2903
+ },
2892
2904
  children: /* @__PURE__ */ jsxRuntime.jsx(
2893
2905
  react.m.nav,
2894
2906
  {
@@ -4652,12 +4664,39 @@ var ProgressIndicator = React36__namespace.forwardRef((props, ref) => {
4652
4664
  return /* @__PURE__ */ jsxRuntime.jsx(LinearProgress, __spreadValues({ ref }, props));
4653
4665
  });
4654
4666
  ProgressIndicator.displayName = "ProgressIndicator";
4655
- var SIZE_STYLES = {
4656
- xs: "h-8 w-8",
4657
- sm: "h-10 w-10",
4658
- md: "h-14 w-14",
4659
- lg: "h-24 w-24",
4660
- xl: "h-[8.5rem] w-[8.5rem]"
4667
+ var SIZE_HEIGHT_STYLES = {
4668
+ xs: "h-8",
4669
+ sm: "h-10",
4670
+ md: "h-14",
4671
+ lg: "h-24",
4672
+ xl: "h-[8.5rem]"
4673
+ };
4674
+ var WIDTH_SIZE_STYLES = {
4675
+ xs: {
4676
+ default: "w-8",
4677
+ narrow: "w-8",
4678
+ wide: "w-12"
4679
+ },
4680
+ sm: {
4681
+ default: "w-10",
4682
+ narrow: "w-12",
4683
+ wide: "w-[3.25rem]"
4684
+ },
4685
+ md: {
4686
+ default: "w-14",
4687
+ narrow: "w-12",
4688
+ wide: "w-[4.5rem]"
4689
+ },
4690
+ lg: {
4691
+ default: "w-24",
4692
+ narrow: "w-16",
4693
+ wide: "w-32"
4694
+ },
4695
+ xl: {
4696
+ default: "w-[8.5rem]",
4697
+ narrow: "w-[6.5rem]",
4698
+ wide: "w-[11.5rem]"
4699
+ }
4661
4700
  };
4662
4701
  var SIZE_ICON = {
4663
4702
  xs: { cls: "size-5", px: 20 },
@@ -4758,8 +4797,10 @@ var IconButtonComponent = React36__namespace.forwardRef(
4758
4797
  variant = "default",
4759
4798
  colorStyle = "standard",
4760
4799
  size = "sm",
4800
+ widthVariant = "default",
4761
4801
  shape = "round",
4762
4802
  selected,
4803
+ selectedIcon,
4763
4804
  loading = false,
4764
4805
  loadingVariant = "loading-indicator",
4765
4806
  iconSize,
@@ -4774,8 +4815,10 @@ var IconButtonComponent = React36__namespace.forwardRef(
4774
4815
  "variant",
4775
4816
  "colorStyle",
4776
4817
  "size",
4818
+ "widthVariant",
4777
4819
  "shape",
4778
4820
  "selected",
4821
+ "selectedIcon",
4779
4822
  "loading",
4780
4823
  "loadingVariant",
4781
4824
  "iconSize",
@@ -4785,7 +4828,7 @@ var IconButtonComponent = React36__namespace.forwardRef(
4785
4828
  "onKeyDown",
4786
4829
  "aria-label"
4787
4830
  ]);
4788
- var _a2, _b2;
4831
+ var _a2, _b2, _c, _d, _e;
4789
4832
  const isToggle = variant === "toggle";
4790
4833
  const isSelected = isToggle && !!selected;
4791
4834
  const resolvedColorClass = React36__namespace.useMemo(
@@ -4816,6 +4859,8 @@ var IconButtonComponent = React36__namespace.forwardRef(
4816
4859
  const defaultIconPx = sizeIcon.px;
4817
4860
  const iconPx = iconSize != null ? iconSize : defaultIconPx;
4818
4861
  const isCustomSize = iconSize != null && iconSize !== "inherit";
4862
+ const heightClass = (_c = SIZE_HEIGHT_STYLES[size]) != null ? _c : SIZE_HEIGHT_STYLES.sm;
4863
+ const widthClass = (_e = ((_d = WIDTH_SIZE_STYLES[size]) != null ? _d : WIDTH_SIZE_STYLES.sm)[widthVariant]) != null ? _e : WIDTH_SIZE_STYLES.sm.default;
4819
4864
  const needsTouchTarget = size === "xs" || size === "sm";
4820
4865
  const { ripples, onPointerDown, removeRipple } = useRippleState({
4821
4866
  disabled: loading
@@ -4878,7 +4923,7 @@ var IconButtonComponent = React36__namespace.forwardRef(
4878
4923
  transition: SPRING_TRANSITION,
4879
4924
  "aria-hidden": "true",
4880
4925
  className: cn(
4881
- "flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
4926
+ "flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]",
4882
4927
  iconSize != null ? void 0 : iconClass
4883
4928
  ),
4884
4929
  style: {
@@ -4886,9 +4931,9 @@ var IconButtonComponent = React36__namespace.forwardRef(
4886
4931
  width: isCustomSize ? `${iconSize}px` : void 0,
4887
4932
  height: isCustomSize ? `${iconSize}px` : void 0
4888
4933
  },
4889
- children: asChild ? React36__namespace.Children.only(children).props.children : children
4934
+ children: isSelected && selectedIcon ? selectedIcon : asChild ? React36__namespace.Children.only(children).props.children : children
4890
4935
  }),
4891
- "content"
4936
+ isSelected && selectedIcon ? "selected-content" : "content"
4892
4937
  ) })
4893
4938
  ] });
4894
4939
  const containerClassName = cn(
@@ -4897,7 +4942,8 @@ var IconButtonComponent = React36__namespace.forwardRef(
4897
4942
  outlineWidthClass,
4898
4943
  disabledBgClass,
4899
4944
  "overflow-hidden",
4900
- SIZE_STYLES[size],
4945
+ heightClass,
4946
+ widthClass,
4901
4947
  loading && "pointer-events-none opacity-75 cursor-not-allowed",
4902
4948
  className
4903
4949
  );
@@ -4914,7 +4960,9 @@ var IconButtonComponent = React36__namespace.forwardRef(
4914
4960
  onClick: handleClick,
4915
4961
  onPointerDown,
4916
4962
  onKeyDown: handleKeyDown,
4917
- style: __spreadProps(__spreadValues({}, style), { borderRadius: `${animateRadius}px` }),
4963
+ style: __spreadProps(__spreadValues({}, style), {
4964
+ borderRadius: `${animateRadius}px`
4965
+ }),
4918
4966
  className: containerClassName
4919
4967
  }, restProps), {
4920
4968
  children: React36__namespace.cloneElement(child, { children: innerContent })
@@ -6363,7 +6411,9 @@ var FloatingToolbarBase = React36__namespace.forwardRef(
6363
6411
  isHorizontal ? "flex-row h-full" : "flex-col w-full",
6364
6412
  isStringPadding ? contentPadding : isHorizontal ? "px-2" : "py-2"
6365
6413
  ),
6366
- style: __spreadValues({ gap: itemGap }, isStringPadding ? {} : contentPadding),
6414
+ style: __spreadValues({
6415
+ gap: itemGap
6416
+ }, isStringPadding ? {} : contentPadding),
6367
6417
  children: [
6368
6418
  /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: expanded && startContent && /* @__PURE__ */ jsxRuntime.jsx(
6369
6419
  react.m.div,