@bug-on/m3-expressive 1.2.3 → 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,13 +1635,20 @@ 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;
1634
1654
  asChild?: boolean;
@@ -1639,6 +1659,17 @@ interface NavigationBarProps {
1639
1659
  variant?: NavigationBarVariant;
1640
1660
  /** Forces a specific item layout (horizontal/vertical) */
1641
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;
1642
1673
  /** Whether the bar should hide when scrolling down */
1643
1674
  hideOnScroll?: boolean;
1644
1675
  /** Whether the bar should have an elevation shadow */
@@ -1664,6 +1695,7 @@ declare const NavigationBar: React$1.NamedExoticComponent<NavigationBarProps & R
1664
1695
 
1665
1696
  type NavigationRailVariant = "collapsed" | "expanded" | "modal" | "xr";
1666
1697
  type NavigationRailLabelVisibility = "labeled" | "auto" | "unlabeled";
1698
+ type NavigationRailActiveIndicatorWidth = "hug" | "fill";
1667
1699
  interface NavigationRailItemProps {
1668
1700
  selected: boolean;
1669
1701
  icon: React$1.ReactNode;
@@ -1671,6 +1703,16 @@ interface NavigationRailItemProps {
1671
1703
  onClick?: () => void;
1672
1704
  disabled?: boolean;
1673
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;
1674
1716
  "aria-label"?: string;
1675
1717
  className?: string;
1676
1718
  asChild?: boolean;
@@ -1679,6 +1721,16 @@ interface NavigationRailItemProps {
1679
1721
  interface NavigationRailProps {
1680
1722
  variant?: NavigationRailVariant;
1681
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;
1682
1734
  header?: React$1.ReactNode;
1683
1735
  fab?: React$1.ReactNode;
1684
1736
  fabPlacement?: "contained" | "spatialized";
@@ -2811,18 +2863,17 @@ interface ToolbarToggleButtonProps extends Omit<HTMLMotionProps<"button">, "chil
2811
2863
  */
2812
2864
  children?: React$1.ReactNode;
2813
2865
  /**
2814
- * Scale compression factor when pressed/clicked.
2815
- * MD3 Expressive default: 0.95.
2816
- * @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
2817
2869
  */
2818
- pressScale?: number;
2870
+ pressExpand?: boolean;
2819
2871
  /**
2820
- * Horizontal spring bounce offset (in px) when pressed/clicked.
2821
- * Oscillates left and right then contracts back to center.
2822
- * Set to 0 to disable horizontal bounce.
2823
- * @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
2824
2875
  */
2825
- pressBounceOffset?: number;
2876
+ pressExpandRatio?: number;
2826
2877
  /**
2827
2878
  * Enable MD3 state layer ripple effect on click.
2828
2879
  * @default true
@@ -2838,8 +2889,10 @@ interface ToolbarToggleButtonProps extends Omit<HTMLMotionProps<"button">, "chil
2838
2889
  * An MD3 pill-shaped toggle button with optional leading icon and text label.
2839
2890
  *
2840
2891
  * Meets MD3 Expressive touch-target requirements (48dp height minimum, ~95dp width).
2841
- * Features Material Design 3 Expressive spring press animation (`FAST_SPATIAL_SPRING`),
2842
- * 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
2843
2896
  *
2844
2897
  * @example
2845
2898
  * ```tsx
@@ -2894,4 +2947,4 @@ declare const ToolbarToggleButtonTokens: {
2894
2947
  readonly Gap: 8;
2895
2948
  };
2896
2949
 
2897
- 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 };