@bug-on/m3-expressive 1.2.2 → 1.2.4

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.
@@ -5,6 +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 { M as MD3ShapeName } from './md3-expressive-shapes-CPcfl_Hf.js';
8
9
  import { B as BaseIconButtonProps } from './icon-button-CSsDmuQC.js';
9
10
 
10
11
  /**
@@ -1609,6 +1610,18 @@ declare const VerticalMenuContent: React$1.ForwardRefExoticComponent<VerticalMen
1609
1610
  */
1610
1611
  declare const VerticalMenu: React$1.ForwardRefExoticComponent<VerticalMenuProps & React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
1611
1612
 
1613
+ type NavigationItemShape = "pill" | MD3ShapeName;
1614
+ /**
1615
+ * Returns inline style for a navigation item shape.
1616
+ * If shape is 'pill' or 'circle', returns undefined (handled via rounded-full CSS).
1617
+ * For custom MD3 shapes (e.g. 'sunny', 'flower', 'star'), returns { clipPath: "path(...)" }.
1618
+ */
1619
+ declare function getNavigationShapeStyle(shape: NavigationItemShape | undefined, width?: number, height?: number): React.CSSProperties | undefined;
1620
+ /**
1621
+ * Checks if a shape is a 1:1 ratio shape (circle or custom MD3 shape).
1622
+ */
1623
+ declare function isSquareShape(shape: NavigationItemShape | undefined): boolean;
1624
+
1612
1625
  /**
1613
1626
  * Layout styling for navigation bar items.
1614
1627
  * - vertical: Icon above label (default for mobile)
@@ -1622,21 +1635,41 @@ type NavigationBarItemLayout = "vertical" | "horizontal";
1622
1635
  * - xr: Floating orbiter variant for spatial interfaces (detached from bottom).
1623
1636
  */
1624
1637
  type NavigationBarVariant = "flexible" | "baseline" | "xr";
1638
+ type NavigationBarLabelVisibility = "labeled" | "auto" | "unlabeled";
1625
1639
  interface NavigationBarItemProps {
1626
1640
  selected: boolean;
1627
1641
  icon: React$1.ReactNode;
1628
- label: React$1.ReactNode;
1642
+ label?: React$1.ReactNode;
1629
1643
  onClick?: () => void;
1630
1644
  disabled?: boolean;
1631
1645
  badge?: React$1.ReactNode;
1646
+ /** Shape of the item active indicator / icon container (pill, circle, sunny, flower, etc.) */
1647
+ shape?: NavigationItemShape;
1648
+ /** Override size (width & height) of the shape container in px. Default: 56 for square shapes, 32h×56w for pill */
1649
+ shapeSize?: number;
1650
+ /** Hide the label below the icon. Overrides container-level labelVisibility. */
1651
+ hideLabel?: boolean;
1632
1652
  "aria-label"?: string;
1633
1653
  className?: string;
1654
+ asChild?: boolean;
1655
+ children?: React$1.ReactNode;
1634
1656
  }
1635
1657
  interface NavigationBarProps {
1636
1658
  /** Visual variant of the Navigation Bar */
1637
1659
  variant?: NavigationBarVariant;
1638
1660
  /** Forces a specific item layout (horizontal/vertical) */
1639
1661
  itemLayout?: NavigationBarItemLayout;
1662
+ /** Default shape of navigation items (pill, circle, sunny, flower, etc.) */
1663
+ shape?: NavigationItemShape;
1664
+ /**
1665
+ * Label visibility for all items.
1666
+ * - "labeled" (default): always show label
1667
+ * - "auto": show label only for the selected item
1668
+ * - "unlabeled": never show label (icon-only mode)
1669
+ */
1670
+ labelVisibility?: NavigationBarLabelVisibility;
1671
+ /** Default size (width & height) for square shape containers in px. Default: 56 */
1672
+ shapeSize?: number;
1640
1673
  /** Whether the bar should hide when scrolling down */
1641
1674
  hideOnScroll?: boolean;
1642
1675
  /** Whether the bar should have an elevation shadow */
@@ -1662,6 +1695,7 @@ declare const NavigationBar: React$1.NamedExoticComponent<NavigationBarProps & R
1662
1695
 
1663
1696
  type NavigationRailVariant = "collapsed" | "expanded" | "modal" | "xr";
1664
1697
  type NavigationRailLabelVisibility = "labeled" | "auto" | "unlabeled";
1698
+ type NavigationRailActiveIndicatorWidth = "hug" | "fill";
1665
1699
  interface NavigationRailItemProps {
1666
1700
  selected: boolean;
1667
1701
  icon: React$1.ReactNode;
@@ -1669,12 +1703,34 @@ interface NavigationRailItemProps {
1669
1703
  onClick?: () => void;
1670
1704
  disabled?: boolean;
1671
1705
  badge?: React$1.ReactNode;
1706
+ /** Shape of the item active indicator / icon container (pill, circle, sunny, flower, etc.) */
1707
+ shape?: NavigationItemShape;
1708
+ /** Override size (width & height) of the shape container in px. Default: 56 for square shapes, 32h×56w for pill */
1709
+ shapeSize?: number;
1710
+ /**
1711
+ * Width behavior of the active indicator when expanded with pill shape.
1712
+ * - "hug" (default): hugs the icon + label contents (MD3 Expressive style)
1713
+ * - "fill": fills the full width of the container (baseline navigation drawer style)
1714
+ */
1715
+ activeIndicatorWidth?: NavigationRailActiveIndicatorWidth;
1672
1716
  "aria-label"?: string;
1673
1717
  className?: string;
1718
+ asChild?: boolean;
1719
+ children?: React$1.ReactNode;
1674
1720
  }
1675
1721
  interface NavigationRailProps {
1676
1722
  variant?: NavigationRailVariant;
1677
1723
  labelVisibility?: NavigationRailLabelVisibility;
1724
+ /** Default shape of navigation rail items (pill, circle, sunny, flower, etc.) */
1725
+ shape?: NavigationItemShape;
1726
+ /** Default size (width & height) for square shape containers in px. Default: 56 */
1727
+ shapeSize?: number;
1728
+ /**
1729
+ * Default width behavior of the active indicator when expanded with pill shape.
1730
+ * - "hug" (default): hugs the icon + label contents (MD3 Expressive style)
1731
+ * - "fill": fills the full width of the container (baseline navigation drawer style)
1732
+ */
1733
+ activeIndicatorWidth?: NavigationRailActiveIndicatorWidth;
1678
1734
  header?: React$1.ReactNode;
1679
1735
  fab?: React$1.ReactNode;
1680
1736
  fabPlacement?: "contained" | "spatialized";
@@ -2758,6 +2814,8 @@ type ToolbarIconButtonVariant = "standard" | "tonal" | "filled";
2758
2814
  * - Support for `asChild` slot delegation.
2759
2815
  * - Always `rounded-full` shape (required for floating toolbars per MD3 spec).
2760
2816
  * - Always 48dp height to meet MD3 accessibility touch-target requirements.
2817
+ * - Material Design 3 Expressive spring motion physics (`TOOLBAR_SPRING_TRANSITION`)
2818
+ * synchronized with `ButtonDistribute` for responsive press scale and width expansion.
2761
2819
  *
2762
2820
  * @example
2763
2821
  * ```tsx
@@ -2805,18 +2863,17 @@ interface ToolbarToggleButtonProps extends Omit<HTMLMotionProps<"button">, "chil
2805
2863
  */
2806
2864
  children?: React$1.ReactNode;
2807
2865
  /**
2808
- * Scale compression factor when pressed/clicked.
2809
- * MD3 Expressive default: 0.95.
2810
- * @default 0.95
2866
+ * Enable symmetric spring expand on press.
2867
+ * The button expands equally to the left and right — matching ButtonDistribute behavior.
2868
+ * @default true
2811
2869
  */
2812
- pressScale?: number;
2870
+ pressExpand?: boolean;
2813
2871
  /**
2814
- * Horizontal spring bounce offset (in px) when pressed/clicked.
2815
- * Oscillates left and right then contracts back to center.
2816
- * Set to 0 to disable horizontal bounce.
2817
- * @default 6
2872
+ * Fraction of the button width added symmetrically on press.
2873
+ * e.g. 0.06 scaleX goes from 1.0 to 1.06 (3% each side).
2874
+ * @default 0.06
2818
2875
  */
2819
- pressBounceOffset?: number;
2876
+ pressExpandRatio?: number;
2820
2877
  /**
2821
2878
  * Enable MD3 state layer ripple effect on click.
2822
2879
  * @default true
@@ -2832,8 +2889,10 @@ interface ToolbarToggleButtonProps extends Omit<HTMLMotionProps<"button">, "chil
2832
2889
  * An MD3 pill-shaped toggle button with optional leading icon and text label.
2833
2890
  *
2834
2891
  * Meets MD3 Expressive touch-target requirements (48dp height minimum, ~95dp width).
2835
- * Features Material Design 3 Expressive spring press animation (`FAST_SPATIAL_SPRING`),
2836
- * horizontal spring bounce oscillation (left-right bounce), and configurable ripple state layer.
2892
+ * Features Material Design 3 Expressive spring press animation:
2893
+ * - Symmetric horizontal expand (scaleX) with `FAST_SPATIAL_SPRING` (has bounce)
2894
+ * - Border-radius morphing via `BUTTON_RADIUS_SPRING` (fast.effects, no overshoot)
2895
+ * - Configurable ripple state layer
2837
2896
  *
2838
2897
  * @example
2839
2898
  * ```tsx
@@ -2888,4 +2947,4 @@ declare const ToolbarToggleButtonTokens: {
2888
2947
  readonly Gap: 8;
2889
2948
  };
2890
2949
 
2891
- export { APP_BAR_BOTTOM_SPRING, APP_BAR_COLORS, APP_BAR_COLOR_TRANSITION, APP_BAR_ENTER_ALWAYS_SPRING, APP_BAR_TITLE_FADE, type AppBarColors, AppBarColumn, type AppBarColumnProps, type AppBarItem, type AppBarItemType, type AppBarMenuState, AppBarOverflowIndicator, type AppBarOverflowIndicatorProps, AppBarRow, type AppBarRowProps, type AppBarScrollBehavior, AppBarTokens, type BaseAppBarProps, BottomAppBar, type BottomAppBarProps, BottomDockedToolbar, type BottomDockedToolbarProps, CHECK_ICON_VARIANTS, ContextMenu, ContextMenuContent, type ContextMenuContentProps, type ContextMenuProps, ContextMenuTrigger, type ContextMenuTriggerProps, DIVIDER_COLOR, DIVIDER_PADDING, DockedToolbar, type DockedToolbarProps, FAST_EFFECTS_TRANSITION, FAST_SPATIAL_SPRING, type FlexibleAppBarProps, type FloatingToolbarColors, type FloatingToolbarProps, type FloatingToolbarScrollBehavior, type FloatingToolbarWithFabProps, GROUP_SHAPES, HorizontalFloatingToolbar, HorizontalFloatingToolbarWithFab, ITEM_SHAPE_CLASSES, LargeFlexibleAppBar, MENU_CHECK_ICON_SIZE, MENU_CONTAINER_VARIANTS, MENU_GROUP_GAP, MENU_ICON_SIZE, MENU_ITEM_MIN_HEIGHT, MENU_MAX_WIDTH, MENU_MIN_WIDTH, MediumFlexibleAppBar, Menu, type MenuColorVariant, MenuContent, type MenuContentProps, MenuDivider, type MenuDividerProps, MenuGroup, type MenuGroupPosition, type MenuGroupProps, MenuItem, type MenuItemPosition, type MenuItemProps, type MenuPrimitive, type MenuProps, MenuProvider, MenuTrigger, type MenuTriggerProps, type MenuVariant, NavigationBar, NavigationBarComponent, NavigationBarItem, type NavigationBarItemLayout, type NavigationBarItemProps, type NavigationBarProps, type NavigationBarVariant, NavigationRail, NavigationRailItem, type NavigationRailItemProps, type NavigationRailLabelVisibility, type NavigationRailProps, type NavigationRailVariant, SEARCH_BAR_EXIT_SPRING, SEARCH_BAR_EXPAND_SPRING, SEARCH_COLORS, SEARCH_DOCKED_REVEAL_SPRING, SEARCH_FULLSCREEN_SPRING, SEARCH_TYPOGRAPHY, SEARCH_VIEW_SPRING, STANDARD_COLORS, SUBMENU_CONTAINER_VARIANTS, Search, SearchAppBar, type SearchAppBarProps, SearchBar, type SearchBarVariant, type SearchProps, type SearchStyleType, SearchTokens, type SearchVariant, SearchView, SearchViewContainer, SearchViewDocked, SearchViewFullScreen, type SearchViewProps, SmallAppBar, type SmallAppBarProps, SubMenu, type SubMenuProps, Tab, type TabProps, Tabs, TabsColors, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTokens, type TabsVariant, type TitleAlignment, ToolbarDivider, type ToolbarDividerProps, ToolbarDividerTokens, ToolbarIconButton, type ToolbarIconButtonProps, type ToolbarIconButtonSize, ToolbarIconButtonTokens, type ToolbarIconButtonVariant, ToolbarToggleButton, type ToolbarToggleButtonProps, ToolbarToggleButtonTokens, type ToolbarVariant, type UseAppBarScrollReturn, type UseFloatingToolbarScrollBehaviorOptions, VIBRANT_COLORS, VerticalFloatingToolbar, VerticalFloatingToolbarWithFab, VerticalMenu, VerticalMenuContent, type VerticalMenuContentProps, VerticalMenuDivider, type VerticalMenuDividerProps, VerticalMenuGroup, type VerticalMenuGroupProps, type VerticalMenuProps, type VerticalMenuSeparatorStyle, appBarTypography, getToolbarColors, standardFloatingToolbarColors, surfaceContainerHighFloatingToolbarColors, surfaceContainerHighestFloatingToolbarColors, tertiaryContainerFloatingToolbarColors, useAppBarScroll, useFloatingToolbarScrollBehavior, useMenuContext, useSearch, useSearchKeyboard, vibrantFloatingToolbarColors, xrFloatingToolbarColors };
2950
+ export { APP_BAR_BOTTOM_SPRING, APP_BAR_COLORS, APP_BAR_COLOR_TRANSITION, APP_BAR_ENTER_ALWAYS_SPRING, APP_BAR_TITLE_FADE, type AppBarColors, AppBarColumn, type AppBarColumnProps, type AppBarItem, type AppBarItemType, type AppBarMenuState, AppBarOverflowIndicator, type AppBarOverflowIndicatorProps, AppBarRow, type AppBarRowProps, type AppBarScrollBehavior, AppBarTokens, type BaseAppBarProps, BottomAppBar, type BottomAppBarProps, BottomDockedToolbar, type BottomDockedToolbarProps, CHECK_ICON_VARIANTS, ContextMenu, ContextMenuContent, type ContextMenuContentProps, type ContextMenuProps, ContextMenuTrigger, type ContextMenuTriggerProps, DIVIDER_COLOR, DIVIDER_PADDING, DockedToolbar, type DockedToolbarProps, FAST_EFFECTS_TRANSITION, FAST_SPATIAL_SPRING, type FlexibleAppBarProps, type FloatingToolbarColors, type FloatingToolbarProps, type FloatingToolbarScrollBehavior, type FloatingToolbarWithFabProps, GROUP_SHAPES, HorizontalFloatingToolbar, HorizontalFloatingToolbarWithFab, ITEM_SHAPE_CLASSES, LargeFlexibleAppBar, MENU_CHECK_ICON_SIZE, MENU_CONTAINER_VARIANTS, MENU_GROUP_GAP, MENU_ICON_SIZE, MENU_ITEM_MIN_HEIGHT, MENU_MAX_WIDTH, MENU_MIN_WIDTH, MediumFlexibleAppBar, Menu, type MenuColorVariant, MenuContent, type MenuContentProps, MenuDivider, type MenuDividerProps, MenuGroup, type MenuGroupPosition, type MenuGroupProps, MenuItem, type MenuItemPosition, type MenuItemProps, type MenuPrimitive, type MenuProps, MenuProvider, MenuTrigger, type MenuTriggerProps, type MenuVariant, NavigationBar, NavigationBarComponent, NavigationBarItem, type NavigationBarItemLayout, type NavigationBarItemProps, type NavigationBarLabelVisibility, type NavigationBarProps, type NavigationBarVariant, type NavigationItemShape, NavigationRail, type NavigationRailActiveIndicatorWidth, NavigationRailItem, type NavigationRailItemProps, type NavigationRailLabelVisibility, type NavigationRailProps, type NavigationRailVariant, SEARCH_BAR_EXIT_SPRING, SEARCH_BAR_EXPAND_SPRING, SEARCH_COLORS, SEARCH_DOCKED_REVEAL_SPRING, SEARCH_FULLSCREEN_SPRING, SEARCH_TYPOGRAPHY, SEARCH_VIEW_SPRING, STANDARD_COLORS, SUBMENU_CONTAINER_VARIANTS, Search, SearchAppBar, type SearchAppBarProps, SearchBar, type SearchBarVariant, type SearchProps, type SearchStyleType, SearchTokens, type SearchVariant, SearchView, SearchViewContainer, SearchViewDocked, SearchViewFullScreen, type SearchViewProps, SmallAppBar, type SmallAppBarProps, SubMenu, type SubMenuProps, Tab, type TabProps, Tabs, TabsColors, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTokens, type TabsVariant, type TitleAlignment, ToolbarDivider, type ToolbarDividerProps, ToolbarDividerTokens, ToolbarIconButton, type ToolbarIconButtonProps, type ToolbarIconButtonSize, ToolbarIconButtonTokens, type ToolbarIconButtonVariant, ToolbarToggleButton, type ToolbarToggleButtonProps, ToolbarToggleButtonTokens, type ToolbarVariant, type UseAppBarScrollReturn, type UseFloatingToolbarScrollBehaviorOptions, VIBRANT_COLORS, VerticalFloatingToolbar, VerticalFloatingToolbarWithFab, VerticalMenu, VerticalMenuContent, type VerticalMenuContentProps, VerticalMenuDivider, type VerticalMenuDividerProps, VerticalMenuGroup, type VerticalMenuGroupProps, type VerticalMenuProps, type VerticalMenuSeparatorStyle, appBarTypography, getNavigationShapeStyle, getToolbarColors, isSquareShape, standardFloatingToolbarColors, surfaceContainerHighFloatingToolbarColors, surfaceContainerHighestFloatingToolbarColors, tertiaryContainerFloatingToolbarColors, useAppBarScroll, useFloatingToolbarScrollBehavior, useMenuContext, useSearch, useSearchKeyboard, vibrantFloatingToolbarColors, xrFloatingToolbarColors };