@bug-on/m3-expressive 1.3.6 → 1.3.7

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 (70) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/buttons.d.mts +3 -3
  3. package/dist/buttons.d.ts +3 -3
  4. package/dist/buttons.js +110 -91
  5. package/dist/buttons.js.map +1 -1
  6. package/dist/buttons.mjs +110 -91
  7. package/dist/buttons.mjs.map +1 -1
  8. package/dist/{core-Cckt8qEm.d.ts → core-DamhB5Yd.d.ts} +1 -1
  9. package/dist/{core-DDfG4pym.d.mts → core-Wsfqn9_N.d.mts} +1 -1
  10. package/dist/core.d.mts +2 -2
  11. package/dist/core.d.ts +2 -2
  12. package/dist/core.js +1 -1
  13. package/dist/core.js.map +1 -1
  14. package/dist/core.mjs +1 -1
  15. package/dist/core.mjs.map +1 -1
  16. package/dist/{fading-blur-mask--uZbBKLj.d.ts → fading-blur-mask-CX-bwjNU.d.mts} +6 -1
  17. package/dist/{fading-blur-mask--uZbBKLj.d.mts → fading-blur-mask-D57UMguz.d.ts} +6 -1
  18. package/dist/feedback.d.mts +17 -5
  19. package/dist/feedback.d.ts +17 -5
  20. package/dist/feedback.js +1 -1
  21. package/dist/feedback.js.map +1 -1
  22. package/dist/feedback.mjs +1 -1
  23. package/dist/feedback.mjs.map +1 -1
  24. package/dist/forms.d.mts +3 -3
  25. package/dist/forms.d.ts +3 -3
  26. package/dist/{icon-button-CxyJv7UV.d.mts → icon-button-BpX9_fwZ.d.mts} +1 -1
  27. package/dist/{icon-button-Di8VX6ou.d.ts → icon-button-DFXp9hze.d.ts} +1 -1
  28. package/dist/index.d.mts +9 -8
  29. package/dist/index.d.ts +9 -8
  30. package/dist/index.js +1098 -976
  31. package/dist/index.js.map +1 -1
  32. package/dist/index.mjs +924 -802
  33. package/dist/index.mjs.map +1 -1
  34. package/dist/layout.d.mts +92 -23
  35. package/dist/layout.d.ts +92 -23
  36. package/dist/layout.js +118 -13
  37. package/dist/layout.js.map +1 -1
  38. package/dist/layout.mjs +118 -15
  39. package/dist/layout.mjs.map +1 -1
  40. package/dist/md3-xBl4wgND.d.mts +44 -0
  41. package/dist/md3-xBl4wgND.d.ts +44 -0
  42. package/dist/navigation.d.mts +4 -4
  43. package/dist/navigation.d.ts +4 -4
  44. package/dist/navigation.js +1 -1
  45. package/dist/navigation.js.map +1 -1
  46. package/dist/navigation.mjs +1 -1
  47. package/dist/navigation.mjs.map +1 -1
  48. package/dist/overlays.d.mts +4 -4
  49. package/dist/overlays.d.ts +4 -4
  50. package/dist/overlays.js +1 -1
  51. package/dist/overlays.js.map +1 -1
  52. package/dist/overlays.mjs +1 -1
  53. package/dist/overlays.mjs.map +1 -1
  54. package/dist/pickers.js +1 -1
  55. package/dist/pickers.js.map +1 -1
  56. package/dist/pickers.mjs +1 -1
  57. package/dist/pickers.mjs.map +1 -1
  58. package/dist/shapes.d.mts +9 -2
  59. package/dist/shapes.d.ts +9 -2
  60. package/dist/{side-sheet-modal-Cw4vemKx.d.ts → side-sheet-modal-BfdgYjd3.d.ts} +1 -1
  61. package/dist/{side-sheet-modal-BycxrabB.d.mts → side-sheet-modal-kLfHINFZ.d.mts} +1 -1
  62. package/dist/{split-button-trailing-uncheckable-CGzk7KcG.d.ts → split-button-trailing-uncheckable-BpyIlOdn.d.ts} +7 -3
  63. package/dist/{split-button-trailing-uncheckable-gAz6OAIi.d.mts → split-button-trailing-uncheckable-CpT8iPpr.d.mts} +7 -3
  64. package/dist/{text-field-C0VQLp8Y.d.ts → text-field-Ct-LT_2T.d.ts} +1 -1
  65. package/dist/{text-field-B1fLh5Sh.d.mts → text-field-D5xiGn-q.d.mts} +1 -1
  66. package/llms-full.txt +18 -3
  67. package/llms.txt +4 -1
  68. package/package.json +1 -1
  69. package/dist/md3-BQhRygSi.d.mts +0 -31
  70. package/dist/md3-BQhRygSi.d.ts +0 -31
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @bug-on/m3-expressive
2
2
 
3
+ ## 1.3.7
4
+
5
+ ### Patch Changes
6
+
7
+ - ba83a90: Fix FAB outside-close and card morphing
8
+
3
9
  ## 1.3.6
4
10
 
5
11
  ### Patch Changes
@@ -1,7 +1,7 @@
1
- export { B as BUTTON_COLOR_TOKENS, a as BUTTON_SIZE_TOKENS, b as BaseButtonProps, c as Button, d as ButtonDistribute, e as ButtonDistributeProps, f as ButtonGroup, g as ButtonGroupOrientation, h as ButtonGroupProps, i as ButtonGroupVariant, j as ButtonProps, D as DistributeMode, E as ElevatedSplitButtonLeading, k as ElevatedSplitButtonTrailing, l as ElevatedSplitButtonTrailingUncheckable, m as ExtendedFAB, n as ExtendedFABProps, F as FAB, o as FABMenu, p as FABMenuItem, q as FABMenuItemData, r as FABMenuItemProps, s as FABMenuProps, t as FABPosition, u as FABPositionProps, v as FABProps, w as FilledSplitButtonLeading, x as FilledSplitButtonTrailing, y as FilledSplitButtonTrailingUncheckable, O as OutlinedSplitButtonLeading, z as OutlinedSplitButtonTrailing, A as OutlinedSplitButtonTrailingUncheckable, S as SplitButtonLayout, C as SplitButtonLayoutProps, G as SplitButtonLeading, H as SplitButtonLeadingProps, I as SplitButtonSize, V as SplitButtonSizeTokens, J as SplitButtonTrailing, K as SplitButtonTrailingProps, L as SplitButtonTrailingUncheckable, M as SplitButtonTrailingUncheckableProps, N as SplitButtonVariant, T as ToggleFAB, P as ToggleFABProps, Q as TonalSplitButtonLeading, R as TonalSplitButtonTrailing, U as TonalSplitButtonTrailingUncheckable } from './split-button-trailing-uncheckable-gAz6OAIi.mjs';
1
+ export { B as BUTTON_COLOR_TOKENS, a as BUTTON_SIZE_TOKENS, b as BaseButtonProps, c as Button, d as ButtonDistribute, e as ButtonDistributeProps, f as ButtonGroup, g as ButtonGroupOrientation, h as ButtonGroupProps, i as ButtonGroupVariant, j as ButtonProps, D as DistributeMode, E as ElevatedSplitButtonLeading, k as ElevatedSplitButtonTrailing, l as ElevatedSplitButtonTrailingUncheckable, m as ExtendedFAB, n as ExtendedFABProps, F as FAB, o as FABMenu, p as FABMenuItem, q as FABMenuItemData, r as FABMenuItemProps, s as FABMenuProps, t as FABPosition, u as FABPositionProps, v as FABProps, w as FilledSplitButtonLeading, x as FilledSplitButtonTrailing, y as FilledSplitButtonTrailingUncheckable, O as OutlinedSplitButtonLeading, z as OutlinedSplitButtonTrailing, A as OutlinedSplitButtonTrailingUncheckable, S as SplitButtonLayout, C as SplitButtonLayoutProps, G as SplitButtonLeading, H as SplitButtonLeadingProps, I as SplitButtonSize, V as SplitButtonSizeTokens, J as SplitButtonTrailing, K as SplitButtonTrailingProps, L as SplitButtonTrailingUncheckable, M as SplitButtonTrailingUncheckableProps, N as SplitButtonVariant, T as ToggleFAB, P as ToggleFABProps, Q as TonalSplitButtonLeading, R as TonalSplitButtonTrailing, U as TonalSplitButtonTrailingUncheckable } from './split-button-trailing-uncheckable-CpT8iPpr.mjs';
2
2
  import { Transition } from 'motion/react';
3
- import { b as MD3Size } from './md3-BQhRygSi.mjs';
4
- export { B as BaseIconButtonProps, I as IconButton, a as IconButtonProps } from './icon-button-CxyJv7UV.mjs';
3
+ import { d as MD3Size } from './md3-xBl4wgND.mjs';
4
+ export { B as BaseIconButtonProps, I as IconButton, a as IconButtonProps } from './icon-button-BpX9_fwZ.mjs';
5
5
  import * as class_variance_authority_types from 'class-variance-authority/types';
6
6
  import 'react';
7
7
  import 'react/jsx-runtime';
package/dist/buttons.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { B as BUTTON_COLOR_TOKENS, a as BUTTON_SIZE_TOKENS, b as BaseButtonProps, c as Button, d as ButtonDistribute, e as ButtonDistributeProps, f as ButtonGroup, g as ButtonGroupOrientation, h as ButtonGroupProps, i as ButtonGroupVariant, j as ButtonProps, D as DistributeMode, E as ElevatedSplitButtonLeading, k as ElevatedSplitButtonTrailing, l as ElevatedSplitButtonTrailingUncheckable, m as ExtendedFAB, n as ExtendedFABProps, F as FAB, o as FABMenu, p as FABMenuItem, q as FABMenuItemData, r as FABMenuItemProps, s as FABMenuProps, t as FABPosition, u as FABPositionProps, v as FABProps, w as FilledSplitButtonLeading, x as FilledSplitButtonTrailing, y as FilledSplitButtonTrailingUncheckable, O as OutlinedSplitButtonLeading, z as OutlinedSplitButtonTrailing, A as OutlinedSplitButtonTrailingUncheckable, S as SplitButtonLayout, C as SplitButtonLayoutProps, G as SplitButtonLeading, H as SplitButtonLeadingProps, I as SplitButtonSize, V as SplitButtonSizeTokens, J as SplitButtonTrailing, K as SplitButtonTrailingProps, L as SplitButtonTrailingUncheckable, M as SplitButtonTrailingUncheckableProps, N as SplitButtonVariant, T as ToggleFAB, P as ToggleFABProps, Q as TonalSplitButtonLeading, R as TonalSplitButtonTrailing, U as TonalSplitButtonTrailingUncheckable } from './split-button-trailing-uncheckable-CGzk7KcG.js';
1
+ export { B as BUTTON_COLOR_TOKENS, a as BUTTON_SIZE_TOKENS, b as BaseButtonProps, c as Button, d as ButtonDistribute, e as ButtonDistributeProps, f as ButtonGroup, g as ButtonGroupOrientation, h as ButtonGroupProps, i as ButtonGroupVariant, j as ButtonProps, D as DistributeMode, E as ElevatedSplitButtonLeading, k as ElevatedSplitButtonTrailing, l as ElevatedSplitButtonTrailingUncheckable, m as ExtendedFAB, n as ExtendedFABProps, F as FAB, o as FABMenu, p as FABMenuItem, q as FABMenuItemData, r as FABMenuItemProps, s as FABMenuProps, t as FABPosition, u as FABPositionProps, v as FABProps, w as FilledSplitButtonLeading, x as FilledSplitButtonTrailing, y as FilledSplitButtonTrailingUncheckable, O as OutlinedSplitButtonLeading, z as OutlinedSplitButtonTrailing, A as OutlinedSplitButtonTrailingUncheckable, S as SplitButtonLayout, C as SplitButtonLayoutProps, G as SplitButtonLeading, H as SplitButtonLeadingProps, I as SplitButtonSize, V as SplitButtonSizeTokens, J as SplitButtonTrailing, K as SplitButtonTrailingProps, L as SplitButtonTrailingUncheckable, M as SplitButtonTrailingUncheckableProps, N as SplitButtonVariant, T as ToggleFAB, P as ToggleFABProps, Q as TonalSplitButtonLeading, R as TonalSplitButtonTrailing, U as TonalSplitButtonTrailingUncheckable } from './split-button-trailing-uncheckable-BpyIlOdn.js';
2
2
  import { Transition } from 'motion/react';
3
- import { b as MD3Size } from './md3-BQhRygSi.js';
4
- export { B as BaseIconButtonProps, I as IconButton, a as IconButtonProps } from './icon-button-Di8VX6ou.js';
3
+ import { d as MD3Size } from './md3-xBl4wgND.js';
4
+ export { B as BaseIconButtonProps, I as IconButton, a as IconButtonProps } from './icon-button-DFXp9hze.js';
5
5
  import * as class_variance_authority_types from 'class-variance-authority/types';
6
6
  import 'react';
7
7
  import 'react/jsx-runtime';
package/dist/buttons.js CHANGED
@@ -3578,6 +3578,25 @@ function FABMenuItem({
3578
3578
  }
3579
3579
  );
3580
3580
  }
3581
+ function useClickOutside(ref, handler, enabled) {
3582
+ const stableHandler = React16__namespace.useRef(handler);
3583
+ React16__namespace.useEffect(() => {
3584
+ stableHandler.current = handler;
3585
+ });
3586
+ React16__namespace.useEffect(() => {
3587
+ if (!enabled) return;
3588
+ const listener = (event) => {
3589
+ if (!ref.current || ref.current.contains(event.target)) return;
3590
+ stableHandler.current();
3591
+ };
3592
+ document.addEventListener("mousedown", listener);
3593
+ document.addEventListener("touchstart", listener, { passive: true });
3594
+ return () => {
3595
+ document.removeEventListener("mousedown", listener);
3596
+ document.removeEventListener("touchstart", listener);
3597
+ };
3598
+ }, [ref, enabled]);
3599
+ }
3581
3600
  function FABMenu({
3582
3601
  expanded,
3583
3602
  onToggle,
@@ -3593,9 +3612,18 @@ function FABMenu({
3593
3612
  const fabId = React16__namespace.useId();
3594
3613
  const menuId = React16__namespace.useId();
3595
3614
  const toggleRef = React16__namespace.useRef(null);
3615
+ const containerRef = React16__namespace.useRef(null);
3596
3616
  const itemRefs = React16__namespace.useRef([]);
3597
3617
  const [focusedIndex, setFocusedIndex] = React16__namespace.useState(-1);
3598
3618
  const reversedItems = React16__namespace.useMemo(() => [...items].reverse(), [items]);
3619
+ const handleOutsideClick = React16__namespace.useCallback(() => {
3620
+ onToggle(false);
3621
+ }, [onToggle]);
3622
+ useClickOutside(
3623
+ containerRef,
3624
+ handleOutsideClick,
3625
+ expanded && closeOnBackdropClick
3626
+ );
3599
3627
  const focusItem = React16__namespace.useCallback((index) => {
3600
3628
  var _a;
3601
3629
  const clampedIndex = Math.max(
@@ -3653,97 +3681,88 @@ function FABMenu({
3653
3681
  },
3654
3682
  [expanded, focusedIndex, items.length, focusItem, onToggle]
3655
3683
  );
3656
- return /* @__PURE__ */ jsxRuntime.jsxs(react.LazyMotion, { features: react.domMax, strict: true, children: [
3657
- expanded && closeOnBackdropClick && /* @__PURE__ */ jsxRuntime.jsx(
3658
- "div",
3659
- {
3660
- "aria-hidden": "true",
3661
- className: "fixed inset-0 z-40",
3662
- onClick: () => onToggle(false)
3663
- }
3664
- ),
3665
- /* @__PURE__ */ jsxRuntime.jsxs(
3666
- "div",
3667
- {
3668
- role: "group",
3669
- "aria-label": ariaLabel != null ? ariaLabel : "Actions menu",
3670
- className: cn(
3671
- "fixed z-50 flex flex-col gap-2",
3672
- ALIGNMENT_CONTAINER_CLASSES[alignment],
3673
- "*:shrink-0",
3674
- className
3675
- ),
3676
- onKeyDown: handleMenuKeyDown,
3677
- children: [
3678
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: expanded && /* @__PURE__ */ jsxRuntime.jsx(
3679
- react.m.div,
3680
- {
3681
- id: menuId,
3682
- role: "menu",
3683
- "aria-labelledby": fabId,
3684
- "aria-orientation": "vertical",
3685
- variants: MENU_CONTAINER_VARIANTS,
3686
- initial: "closed",
3687
- animate: "open",
3688
- exit: "closed",
3689
- className: cn(
3690
- "flex flex-col-reverse gap-2",
3691
- ALIGNMENT_ITEMS_CLASSES[alignment]
3692
- ),
3693
- children: reversedItems.map((item, reversedIndex) => {
3694
- var _a;
3695
- const originalIndex = items.length - 1 - reversedIndex;
3696
- return /* @__PURE__ */ jsxRuntime.jsx(
3697
- react.m.div,
3698
- {
3699
- variants: MENU_ITEM_VARIANTS,
3700
- style: {
3701
- transformOrigin: (_a = ALIGNMENT_TRANSFORM_ORIGIN[alignment]) != null ? _a : "right"
3702
- },
3703
- ref: (el) => {
3704
- itemRefs.current[originalIndex] = el;
3705
- },
3706
- children: /* @__PURE__ */ jsxRuntime.jsx(
3707
- FABMenuItem,
3708
- {
3709
- icon: item.icon,
3710
- label: item.label,
3711
- onClick: () => {
3712
- if (!item.disabled) {
3713
- item.onClick();
3714
- onToggle(false);
3715
- }
3716
- },
3717
- disabled: item.disabled,
3718
- colorVariant,
3719
- className: item.className,
3720
- tabIndex: expanded ? 0 : -1
3721
- }
3722
- )
3684
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
3685
+ "div",
3686
+ {
3687
+ ref: containerRef,
3688
+ role: "group",
3689
+ "aria-label": ariaLabel != null ? ariaLabel : "Actions menu",
3690
+ className: cn(
3691
+ "fixed z-50 flex flex-col gap-2",
3692
+ ALIGNMENT_CONTAINER_CLASSES[alignment],
3693
+ "*:shrink-0",
3694
+ className
3695
+ ),
3696
+ onKeyDown: handleMenuKeyDown,
3697
+ children: [
3698
+ /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: expanded && /* @__PURE__ */ jsxRuntime.jsx(
3699
+ react.m.div,
3700
+ {
3701
+ id: menuId,
3702
+ role: "menu",
3703
+ "aria-labelledby": fabId,
3704
+ "aria-orientation": "vertical",
3705
+ variants: MENU_CONTAINER_VARIANTS,
3706
+ initial: "closed",
3707
+ animate: "open",
3708
+ exit: "closed",
3709
+ className: cn(
3710
+ "flex flex-col-reverse gap-2",
3711
+ ALIGNMENT_ITEMS_CLASSES[alignment]
3712
+ ),
3713
+ children: reversedItems.map((item, reversedIndex) => {
3714
+ var _a;
3715
+ const originalIndex = items.length - 1 - reversedIndex;
3716
+ return /* @__PURE__ */ jsxRuntime.jsx(
3717
+ react.m.div,
3718
+ {
3719
+ variants: MENU_ITEM_VARIANTS,
3720
+ style: {
3721
+ transformOrigin: (_a = ALIGNMENT_TRANSFORM_ORIGIN[alignment]) != null ? _a : "right"
3723
3722
  },
3724
- item.id
3725
- );
3726
- })
3727
- }
3728
- ) }),
3729
- /* @__PURE__ */ jsxRuntime.jsx(
3730
- ToggleFAB,
3731
- {
3732
- ref: toggleRef,
3733
- id: fabId,
3734
- expanded,
3735
- onToggle,
3736
- colorVariant,
3737
- size,
3738
- "aria-label": ariaLabel != null ? ariaLabel : expanded ? "Close actions menu" : "Open actions menu",
3739
- "aria-controls": menuId,
3740
- icon: defaultFabIcon
3741
- }
3742
- )
3743
- ]
3744
- }
3745
- )
3746
- ] });
3723
+ ref: (el) => {
3724
+ itemRefs.current[originalIndex] = el;
3725
+ },
3726
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3727
+ FABMenuItem,
3728
+ {
3729
+ icon: item.icon,
3730
+ label: item.label,
3731
+ onClick: () => {
3732
+ if (!item.disabled) {
3733
+ item.onClick();
3734
+ onToggle(false);
3735
+ }
3736
+ },
3737
+ disabled: item.disabled,
3738
+ colorVariant,
3739
+ className: item.className,
3740
+ tabIndex: expanded ? 0 : -1
3741
+ }
3742
+ )
3743
+ },
3744
+ item.id
3745
+ );
3746
+ })
3747
+ }
3748
+ ) }),
3749
+ /* @__PURE__ */ jsxRuntime.jsx(
3750
+ ToggleFAB,
3751
+ {
3752
+ ref: toggleRef,
3753
+ id: fabId,
3754
+ expanded,
3755
+ onToggle,
3756
+ colorVariant,
3757
+ size,
3758
+ "aria-label": ariaLabel != null ? ariaLabel : expanded ? "Close actions menu" : "Open actions menu",
3759
+ "aria-controls": menuId,
3760
+ icon: defaultFabIcon
3761
+ }
3762
+ )
3763
+ ]
3764
+ }
3765
+ ) });
3747
3766
  }
3748
3767
  var SIZE_HEIGHT_STYLES = {
3749
3768
  xs: "h-8",
@@ -3760,7 +3779,7 @@ var WIDTH_SIZE_STYLES = {
3760
3779
  },
3761
3780
  sm: {
3762
3781
  default: "w-10",
3763
- narrow: "w-12",
3782
+ narrow: "w-10",
3764
3783
  wide: "w-[3.25rem]"
3765
3784
  },
3766
3785
  md: {