@bug-on/md3-react 2.0.1 → 2.0.3

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 (40) hide show
  1. package/dist/hooks/index.d.ts +1 -0
  2. package/dist/hooks/useClickOutside.d.ts +8 -0
  3. package/dist/index.css +23 -0
  4. package/dist/index.d.ts +4 -0
  5. package/dist/index.js +11316 -9210
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +11262 -9187
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/ui/app-bar/app-bar-column.d.ts +28 -0
  10. package/dist/ui/app-bar/app-bar-item-button.d.ts +16 -0
  11. package/dist/ui/app-bar/app-bar-overflow-indicator.d.ts +18 -0
  12. package/dist/ui/app-bar/app-bar-row.d.ts +36 -0
  13. package/dist/ui/app-bar/app-bar.tokens.d.ts +184 -0
  14. package/dist/ui/app-bar/app-bar.types.d.ts +392 -0
  15. package/dist/ui/app-bar/bottom-app-bar.d.ts +31 -0
  16. package/dist/ui/app-bar/docked-toolbar.d.ts +25 -0
  17. package/dist/ui/app-bar/hooks/use-app-bar-scroll.d.ts +42 -0
  18. package/dist/ui/app-bar/hooks/use-flexible-app-bar.d.ts +37 -0
  19. package/dist/ui/app-bar/index.d.ts +39 -0
  20. package/dist/ui/app-bar/large-flexible-app-bar.d.ts +26 -0
  21. package/dist/ui/app-bar/medium-flexible-app-bar.d.ts +28 -0
  22. package/dist/ui/app-bar/search-app-bar.d.ts +43 -0
  23. package/dist/ui/app-bar/search-view.d.ts +54 -0
  24. package/dist/ui/app-bar/small-app-bar.d.ts +37 -0
  25. package/dist/ui/search/animated-placeholder.d.ts +54 -0
  26. package/dist/ui/search/hooks/use-search-keyboard.d.ts +32 -0
  27. package/dist/ui/search/hooks/use-search-view-focus.d.ts +6 -0
  28. package/dist/ui/search/index.d.ts +27 -0
  29. package/dist/ui/search/search-bar.d.ts +32 -0
  30. package/dist/ui/search/search-context.d.ts +24 -0
  31. package/dist/ui/search/search-view-docked.d.ts +25 -0
  32. package/dist/ui/search/search-view-fullscreen.d.ts +36 -0
  33. package/dist/ui/search/search.d.ts +50 -0
  34. package/dist/ui/search/search.tokens.d.ts +112 -0
  35. package/dist/ui/search/search.types.d.ts +131 -0
  36. package/dist/ui/search/trailing-action.d.ts +9 -0
  37. package/dist/ui/snackbar/snackbar.d.ts +1 -0
  38. package/dist/ui/theme-provider/index.d.ts +31 -1
  39. package/dist/ui/toc.d.ts +7 -1
  40. package/package.json +2 -1
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @file app-bar-column.tsx
3
+ * MD3 Expressive App Bar Column DSL.
4
+ *
5
+ * Displays App Bar action items in a vertical column.
6
+ * Overflow items collapse into a dropdown menu.
7
+ *
8
+ * @see docs/m3/app-bars/AppBarColumn.kt
9
+ */
10
+ import type { AppBarColumnProps } from "./app-bar.types";
11
+ /**
12
+ * MD3 Expressive App Bar Column.
13
+ *
14
+ * Renders action items in a vertical column. Commonly used in
15
+ * side navigation or rail-style App Bars.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * <AppBarColumn
20
+ * maxItemCount={3}
21
+ * items={[
22
+ * { type: 'clickable', icon: <Icon>edit</Icon>, label: 'Edit', onClick: handleEdit },
23
+ * { type: 'clickable', icon: <Icon>delete</Icon>, label: 'Delete', onClick: handleDelete },
24
+ * ]}
25
+ * />
26
+ * ```
27
+ */
28
+ export declare function AppBarColumn({ items, maxItemCount, className, }: AppBarColumnProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @file app-bar-item-button.tsx
3
+ * Shared icon button renderer for AppBarRow and AppBarColumn items.
4
+ *
5
+ * Extracted from duplicate RowItem/ColumnItem implementations.
6
+ */
7
+ import type { AppBarItem } from "./app-bar.types";
8
+ interface AppBarItemButtonProps {
9
+ item: AppBarItem;
10
+ }
11
+ /**
12
+ * Renders a single App Bar action item as an icon button.
13
+ * Handles clickable, toggleable, and custom item types.
14
+ */
15
+ export declare function AppBarItemButton({ item }: AppBarItemButtonProps): import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @file app-bar-overflow-indicator.tsx
3
+ * MD3 Expressive App Bar Overflow Indicator.
4
+ *
5
+ * Renders a "More" (more_vert) icon button that opens a Radix UI
6
+ * DropdownMenu containing overflow App Bar items.
7
+ *
8
+ * Used internally by <AppBarRow> and <AppBarColumn> when items exceed
9
+ * the visible count.
10
+ */
11
+ import type { AppBarOverflowIndicatorProps } from "./app-bar.types";
12
+ /**
13
+ * MD3 App Bar Overflow Indicator.
14
+ *
15
+ * Renders a "more_vert" button that opens a dropdown menu
16
+ * with overflow action items.
17
+ */
18
+ export declare function AppBarOverflowIndicator({ items, className, }: AppBarOverflowIndicatorProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @file app-bar-row.tsx
3
+ * MD3 Expressive App Bar Row DSL.
4
+ *
5
+ * Displays App Bar action items in a horizontal row.
6
+ * Items that exceed `maxItemCount` or available width collapse into a
7
+ * dropdown menu via <AppBarOverflowIndicator>.
8
+ *
9
+ * Translated from OverflowMeasurePolicy / AppBarRow.kt in Jetpack Compose M3.
10
+ *
11
+ * @see docs/m3/app-bars/AppBarRow.kt
12
+ */
13
+ import type { AppBarRowProps } from "./app-bar.types";
14
+ /**
15
+ * MD3 Expressive App Bar Row.
16
+ *
17
+ * Renders action items in a row. Compatible with the `actions` prop of any App Bar.
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * <SmallAppBar
22
+ * title="Messages"
23
+ * actions={
24
+ * <AppBarRow
25
+ * maxItemCount={2}
26
+ * items={[
27
+ * { type: 'clickable', icon: <Icon>search</Icon>, label: 'Search', onClick: handleSearch },
28
+ * { type: 'clickable', icon: <Icon>bookmark</Icon>, label: 'Bookmarks', onClick: handleBookmark },
29
+ * { type: 'clickable', icon: <Icon>settings</Icon>, label: 'Settings', onClick: handleSettings },
30
+ * ]}
31
+ * />
32
+ * }
33
+ * />
34
+ * ```
35
+ */
36
+ export declare function AppBarRow({ items, maxItemCount, className }: AppBarRowProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,184 @@
1
+ /**
2
+ * @file app-bar.tokens.ts
3
+ * MD3 Expressive App Bar — Design tokens ported from:
4
+ * - AppBarTokens.kt (shared tokens)
5
+ * - AppBarSmallTokens.kt
6
+ * - AppBarMediumFlexibleTokens.kt
7
+ * - AppBarLargeFlexibleTokens.kt
8
+ * - BottomAppBarTokens.kt
9
+ * - DockedToolbarTokens.kt
10
+ * - FabSecondaryContainerTokens.kt
11
+ *
12
+ * All dimensional values are in px (dp equivalents for web at 1dp = 1px).
13
+ * Colors reference CSS custom properties — do NOT hardcode hex.
14
+ * @see docs/m3/app-bars/
15
+ */
16
+ /**
17
+ * Height and spacing tokens for all App Bar variants.
18
+ * Maps directly from MD3 Kotlin token files.
19
+ */
20
+ export declare const AppBarTokens: {
21
+ readonly heights: {
22
+ /** SmallAppBar height. AppBarSmallTokens.ContainerHeight = 64dp */
23
+ readonly small: 64;
24
+ /** Collapsed height for flexible variants. = SmallAppBar height. */
25
+ readonly flexibleCollapsed: 64;
26
+ /** MediumFlexibleAppBar expanded height (without subtitle). AppBarMediumFlexibleTokens */
27
+ readonly mediumFlexExpanded: 112;
28
+ /** MediumFlexibleAppBar expanded height (with subtitle). */
29
+ readonly mediumFlexWithSubtitleExpanded: 136;
30
+ /** LargeFlexibleAppBar expanded height (without subtitle). AppBarLargeFlexibleTokens */
31
+ readonly largeFlexExpanded: 120;
32
+ /** LargeFlexibleAppBar expanded height (with subtitle). */
33
+ readonly largeFlexWithSubtitleExpanded: 152;
34
+ /** BottomAppBar height. BottomAppBarTokens.ContainerHeight = 80dp */
35
+ readonly bottom: 80;
36
+ /** DockedToolbar height. DockedToolbarTokens.ContainerHeight = 64dp */
37
+ readonly dockedToolbar: 64;
38
+ };
39
+ /** AppBarTokens.IconSize = 24dp */
40
+ readonly iconSize: 24;
41
+ /** AppBarTokens.AvatarSize = 32dp */
42
+ readonly avatarSize: 32;
43
+ /** AppBarTokens.LeadingSpace = 4dp */
44
+ readonly leadingSpace: 4;
45
+ /** AppBarTokens.TrailingSpace = 4dp */
46
+ readonly trailingSpace: 4;
47
+ /** AppBarTokens.IconButtonSpace = 0dp (no gap between icon buttons) */
48
+ readonly iconButtonSpace: 0;
49
+ readonly dockedToolbar: {
50
+ /** DockedToolbarTokens.ContainerLeadingSpace = 16dp */
51
+ readonly leadingSpace: 16;
52
+ /** DockedToolbarTokens.ContainerTrailingSpace = 16dp */
53
+ readonly trailingSpace: 16;
54
+ /** DockedToolbarTokens.ContainerMinSpacing = 4dp */
55
+ readonly minSpacing: 4;
56
+ /** DockedToolbarTokens.ContainerMaxSpacing = 32dp */
57
+ readonly maxSpacing: 32;
58
+ };
59
+ /** Minimum 48px touch target for icon buttons per MD3 accessibility spec. */
60
+ readonly iconButtonTouchTarget: 48;
61
+ };
62
+ /**
63
+ * MD3 type scale values mapped to Tailwind CSS class strings.
64
+ * Used across App Bar variants for consistent typography.
65
+ *
66
+ * Values derived from MD3 Material Type Scale specification.
67
+ */
68
+ export declare const appBarTypography: {
69
+ /**
70
+ * SmallAppBar title (collapsed state for flexible variants).
71
+ * AppBarSmallTokens.TitleFont = TitleLarge
72
+ * Spec: 22sp / 28sp line-height / medium weight
73
+ */
74
+ readonly titleLarge: "text-[22px] leading-[28px] font-medium tracking-[0px]";
75
+ /**
76
+ * SmallAppBar subtitle.
77
+ * AppBarSmallTokens.SubtitleFont = LabelMedium
78
+ * Spec: 12sp / 16sp line-height / medium weight / 0.5px tracking
79
+ */
80
+ readonly labelMedium: "text-[12px] leading-[16px] font-medium tracking-[0.5px]";
81
+ /**
82
+ * MediumFlexibleAppBar expanded title.
83
+ * AppBarMediumFlexibleTokens.TitleFont = HeadlineMedium
84
+ * Spec: 28sp / 36sp line-height / normal weight
85
+ */
86
+ readonly headlineMedium: "text-[28px] leading-[36px] font-normal tracking-[0px]";
87
+ /**
88
+ * MediumFlexibleAppBar subtitle.
89
+ * AppBarMediumFlexibleTokens.SubtitleFont = LabelLarge
90
+ * Spec: 14sp / 20sp line-height / medium weight / 0.1px tracking
91
+ */
92
+ readonly labelLarge: "text-[14px] leading-[20px] font-medium tracking-[0.1px]";
93
+ /**
94
+ * LargeFlexibleAppBar expanded title.
95
+ * AppBarLargeFlexibleTokens.TitleFont = DisplaySmall
96
+ * Spec: 36sp / 44sp line-height / normal weight / -0.25px tracking
97
+ */
98
+ readonly displaySmall: "text-[36px] leading-[44px] font-normal tracking-[-0.25px]";
99
+ /**
100
+ * LargeFlexibleAppBar subtitle.
101
+ * AppBarLargeFlexibleTokens.SubtitleFont = TitleMedium
102
+ * Spec: 16sp / 24sp line-height / medium weight / 0.15px tracking
103
+ */
104
+ readonly titleMedium: "text-[16px] leading-6 font-medium tracking-[0.15px]";
105
+ };
106
+ /**
107
+ * CSS custom property references for App Bar colors.
108
+ * Maps to --md-sys-color-* tokens in the MD3 theme system.
109
+ *
110
+ * IMPORTANT: Never hardcode hex/rgba values here — these references
111
+ * automatically adapt to light/dark theme via the MD3ThemeProvider.
112
+ *
113
+ * AppBarTokens.kt spec:
114
+ * - ContainerColor → md-sys-color-surface
115
+ * - OnScrollContainerColor → md-sys-color-surface-container
116
+ */
117
+ export declare const APP_BAR_COLORS: {
118
+ /** Default background. AppBarTokens.ContainerColor → surface */
119
+ readonly container: "var(--md-sys-color-surface)";
120
+ /** Background when content is scrolled. AppBarTokens.OnScrollContainerColor → surface-container */
121
+ readonly scrolledContainer: "var(--md-sys-color-surface-container)";
122
+ /** Title color. AppBarTokens.TitleColor → on-surface */
123
+ readonly title: "var(--md-sys-color-on-surface)";
124
+ /** Subtitle color. AppBarTokens.SubtitleColor → on-surface-variant */
125
+ readonly subtitle: "var(--md-sys-color-on-surface-variant)";
126
+ /** Navigation icon color. AppBarTokens.LeadingIconColor → on-surface */
127
+ readonly navigationIcon: "var(--md-sys-color-on-surface)";
128
+ /** Action icon color. AppBarTokens.TrailingIconColor → on-surface-variant */
129
+ readonly actionIcon: "var(--md-sys-color-on-surface-variant)";
130
+ /** Search bar pill background. → surface-container-high */
131
+ readonly searchBarBg: "var(--md-sys-color-surface-container-high)";
132
+ /** Search bar text/icon color. */
133
+ readonly searchBarContent: "var(--md-sys-color-on-surface-variant)";
134
+ /** BottomAppBarTokens.ContainerColor → surface-container */
135
+ readonly bottomContainer: "var(--md-sys-color-surface-container)";
136
+ /** FabSecondaryContainerTokens.ContainerColor → secondary-container */
137
+ readonly fabContainer: "var(--md-sys-color-secondary-container)";
138
+ /** FabSecondaryContainerTokens.IconColor → on-secondary-container */
139
+ readonly fabIcon: "var(--md-sys-color-on-secondary-container)";
140
+ };
141
+ /**
142
+ * Color transition when App Bar background changes on scroll.
143
+ * MD3 Standard easing: cubic-bezier(0.2, 0, 0, 1), 200ms.
144
+ */
145
+ export declare const APP_BAR_COLOR_TRANSITION: {
146
+ readonly duration: 0.2;
147
+ readonly ease: [number, number, number, number];
148
+ };
149
+ /**
150
+ * Spring animation for enterAlways behavior (hide/show on scroll direction).
151
+ * Equivalent to MD3 FastSpatial motion scheme.
152
+ */
153
+ export declare const APP_BAR_ENTER_ALWAYS_SPRING: {
154
+ readonly type: "spring";
155
+ readonly stiffness: 380;
156
+ readonly damping: 40;
157
+ readonly mass: 1;
158
+ };
159
+ /**
160
+ * Spring animation for Bottom App Bar hide/show.
161
+ * Slightly looser feel for bottom navigation.
162
+ */
163
+ export declare const APP_BAR_BOTTOM_SPRING: {
164
+ readonly type: "spring";
165
+ readonly stiffness: 300;
166
+ readonly damping: 30;
167
+ };
168
+ /**
169
+ * SearchView appearance/disappearance transition.
170
+ * Uses spring for natural feel of expanding overlay.
171
+ */
172
+ export declare const SEARCH_VIEW_SPRING: {
173
+ readonly type: "spring";
174
+ readonly stiffness: 400;
175
+ readonly damping: 35;
176
+ };
177
+ /**
178
+ * Title crossfade transition for flexible App Bars.
179
+ * Short duration keeps the collapse feeling snappy.
180
+ */
181
+ export declare const APP_BAR_TITLE_FADE: {
182
+ readonly duration: 0.15;
183
+ readonly ease: "easeInOut";
184
+ };
@@ -0,0 +1,392 @@
1
+ /**
2
+ * @file app-bar.types.ts
3
+ * MD3 Expressive App Bar — TypeScript prop definitions.
4
+ * Spec: https://m3.material.io/components/app-bars/overview
5
+ * Reference: docs/m3/app-bars/AppBar.kt (MD3 Expressive, May 2025)
6
+ *
7
+ * Note: Component name is "App Bar" (not "Top App Bar") per MD3 Expressive May 2025 rename.
8
+ */
9
+ import type * as React from "react";
10
+ /**
11
+ * Controls how the App Bar responds to scroll events.
12
+ *
13
+ * - `pinned`: Always visible. Changes background color when scrolled.
14
+ * - `enterAlways`: Hides when scrolling down, reveals when scrolling up.
15
+ * - `exitUntilCollapsed`: Collapses from expandedHeight → collapsedHeight as user scrolls.
16
+ */
17
+ export type AppBarScrollBehavior = "pinned" | "enterAlways" | "exitUntilCollapsed";
18
+ /** Horizontal alignment of the title (and subtitle) text. */
19
+ export type TitleAlignment = "start" | "center";
20
+ /**
21
+ * Optional color overrides for the App Bar.
22
+ * All values should be CSS color strings (var(--md-sys-color-*) or hex).
23
+ *
24
+ * By default, App Bars use MD3 system color tokens automatically.
25
+ */
26
+ export interface AppBarColors {
27
+ /** Background when not scrolled. Default: `var(--md-sys-color-surface)` */
28
+ containerColor?: string;
29
+ /** Background when content has scrolled past top. Default: `var(--md-sys-color-surface-container)` */
30
+ scrolledContainerColor?: string;
31
+ /** Title text color. Default: `var(--md-sys-color-on-surface)` */
32
+ titleColor?: string;
33
+ /** Subtitle text color. Default: `var(--md-sys-color-on-surface-variant)` */
34
+ subtitleColor?: string;
35
+ /** Navigation icon color. Default: `var(--md-sys-color-on-surface)` */
36
+ navigationIconColor?: string;
37
+ /** Action icon color. Default: `var(--md-sys-color-on-surface-variant)` */
38
+ actionIconColor?: string;
39
+ }
40
+ /**
41
+ * Shared props for all top App Bar variants.
42
+ */
43
+ export interface BaseAppBarProps {
44
+ /**
45
+ * Navigation icon slot (typically IconButton with back arrow or hamburger).
46
+ * Should have `aria-label` for accessibility.
47
+ */
48
+ navigationIcon?: React.ReactNode;
49
+ /**
50
+ * Action icon slots rendered at the trailing end.
51
+ * Typically `<IconButton>` components. Use `<AppBarRow>` for overflow support.
52
+ */
53
+ actions?: React.ReactNode;
54
+ /** Optional color overrides. Defaults use MD3 system color tokens. */
55
+ colors?: AppBarColors;
56
+ /**
57
+ * Scroll behavior that controls how the App Bar reacts to scroll events.
58
+ * @default "pinned"
59
+ */
60
+ scrollBehavior?: AppBarScrollBehavior;
61
+ /**
62
+ * Ref to the scrollable element to observe.
63
+ * If not provided, listens to `window` scroll events.
64
+ */
65
+ scrollElement?: React.RefObject<HTMLElement | null>;
66
+ /** Additional CSS class applied to the root header element. */
67
+ className?: string;
68
+ }
69
+ /**
70
+ * Props for `<SmallAppBar>`.
71
+ *
72
+ * Single-row layout with navigation icon, title, and action buttons.
73
+ * Height: 64px. Title font: TitleLarge (22sp).
74
+ */
75
+ export interface SmallAppBarProps extends BaseAppBarProps {
76
+ /** The main title content. */
77
+ title: React.ReactNode;
78
+ /**
79
+ * Optional subtitle displayed below the title.
80
+ * Font: LabelMedium (12sp).
81
+ */
82
+ subtitle?: React.ReactNode;
83
+ /**
84
+ * Horizontal alignment of the title and subtitle.
85
+ * When `center`: title is centered, nav icon and actions balance both sides.
86
+ * @default "start"
87
+ */
88
+ titleAlignment?: TitleAlignment;
89
+ }
90
+ /**
91
+ * Props for `<MediumFlexibleAppBar>` and `<LargeFlexibleAppBar>`.
92
+ *
93
+ * Two-row layout in expanded state (nav row + title row).
94
+ * Collapses to single row when scrolled.
95
+ * Only supports `exitUntilCollapsed` scroll behavior.
96
+ */
97
+ export interface FlexibleAppBarProps extends BaseAppBarProps {
98
+ /** The main title content (rendered in both expanded and collapsed states). */
99
+ title: React.ReactNode;
100
+ /**
101
+ * Optional subtitle displayed in the expanded title row.
102
+ * Affects expanded height (adds extra rows).
103
+ */
104
+ subtitle?: React.ReactNode;
105
+ /**
106
+ * Horizontal alignment of the title and subtitle.
107
+ * @default "start"
108
+ */
109
+ titleAlignment?: TitleAlignment;
110
+ /**
111
+ * Collapsed height in px. The App Bar settles to this height after full scroll.
112
+ * @default 64
113
+ */
114
+ collapsedHeight?: number;
115
+ /**
116
+ * Expanded (initial) height in px.
117
+ * Defaults depend on variant and subtitle presence.
118
+ */
119
+ expandedHeight?: number;
120
+ /**
121
+ * Additional content rendered in the expanded title area.
122
+ * Supports images, circular avatars (32dp), Filled Buttons, or custom elements.
123
+ * Hidden when collapsed.
124
+ */
125
+ headerContent?: React.ReactNode;
126
+ }
127
+ /** Visual variant of the search bar. */
128
+ export type SearchBarVariant = "filled" | "outlined";
129
+ /**
130
+ * Props for `<SearchAppBar>`.
131
+ *
132
+ * Replaces the title with a pill-shaped search input bar.
133
+ * New variant in MD3 Expressive (May 2025).
134
+ *
135
+ * @example
136
+ * ```tsx
137
+ * <SearchAppBar
138
+ * searchPlaceholder="Search..."
139
+ * onSearchFocus={() => setSearchViewOpen(true)}
140
+ * trailingSearchActions={<IconButton aria-label="Voice search">...</IconButton>}
141
+ * externalActions={<Avatar />}
142
+ * />
143
+ * ```
144
+ */
145
+ export interface SearchAppBarProps extends BaseAppBarProps {
146
+ /** Placeholder text in the search bar. @default "Search" */
147
+ searchPlaceholder?: string;
148
+ /** Controlled search value. */
149
+ searchValue?: string;
150
+ /** Called when search input changes (inside the SearchView). */
151
+ onSearchChange?: (value: string) => void;
152
+ /**
153
+ * Called when the search bar is focused/clicked.
154
+ * Consumers should open a `<SearchView>` in response.
155
+ */
156
+ onSearchFocus?: () => void;
157
+ /** Called when the search view is closed/blurred. */
158
+ onSearchBlur?: () => void;
159
+ /**
160
+ * Icon rendered at the leading edge of the search bar (inside the pill).
161
+ * Defaults to a search icon.
162
+ */
163
+ leadingSearchIcon?: React.ReactNode;
164
+ /**
165
+ * Action icons rendered at the trailing edge of the search bar (inside the pill).
166
+ * Common examples: mic, camera, QR code.
167
+ */
168
+ trailingSearchActions?: React.ReactNode;
169
+ /**
170
+ * Action icons rendered outside the search bar (at the trailing edge of the bar).
171
+ * Common example: profile avatar button.
172
+ */
173
+ externalActions?: React.ReactNode;
174
+ /**
175
+ * Horizontal alignment of the search bar.
176
+ * @default "start"
177
+ */
178
+ titleAlignment?: TitleAlignment;
179
+ /**
180
+ * Visual style of the search bar.
181
+ * @default "filled"
182
+ */
183
+ searchBarVariant?: SearchBarVariant;
184
+ /**
185
+ * Unique identifier for the search bar — used as the Framer Motion `layoutId`
186
+ * to enable shared element transitions with `<SearchView>`.
187
+ * Must be unique if multiple SearchAppBars are on the page.
188
+ * @default "search-bar"
189
+ */
190
+ searchBarId?: string;
191
+ }
192
+ /**
193
+ * Props for `<BottomAppBar>`.
194
+ *
195
+ * Fixed to the bottom of the screen. Contains navigation actions and optional FAB.
196
+ * Height: 80px. Background: `surface-container`. Elevation: Level2.
197
+ */
198
+ export interface BottomAppBarProps {
199
+ /**
200
+ * Action icon buttons rendered at the leading end.
201
+ * Typically 3-4 `<IconButton>` components.
202
+ */
203
+ actions?: React.ReactNode;
204
+ /**
205
+ * Floating Action Button rendered at the trailing end.
206
+ * Consumer provides a `<FAB>` or `<FABPosition>` component.
207
+ */
208
+ floatingActionButton?: React.ReactNode;
209
+ /**
210
+ * Scroll behavior.
211
+ * - `visible`: Always visible.
212
+ * - `hidden`: Slides down when scrolling down, appears when scrolling up.
213
+ * @default "visible"
214
+ */
215
+ scrollBehavior?: "visible" | "hidden";
216
+ /**
217
+ * Ref to the scrollable element to observe.
218
+ * If not provided, listens to `window` scroll events.
219
+ */
220
+ scrollElement?: React.RefObject<HTMLElement | null>;
221
+ /** Additional CSS class applied to the root nav element. */
222
+ className?: string;
223
+ }
224
+ /**
225
+ * Props for `<DockedToolbar>`.
226
+ *
227
+ * Secondary navigation bar. Not an App Bar — typically appears below the main App Bar.
228
+ * Height: 64px. Background: `surface-container`.
229
+ * Contains chips, segmented buttons, or filter actions.
230
+ */
231
+ export interface DockedToolbarProps {
232
+ /** Toolbar content (chips, segmented buttons, filter actions, etc.) */
233
+ children: React.ReactNode;
234
+ /**
235
+ * Accessible label for the toolbar (required for accessibility).
236
+ * e.g., "Filter options" or "Content navigation"
237
+ */
238
+ "aria-label": string;
239
+ /** Additional CSS class applied to the root element. */
240
+ className?: string;
241
+ }
242
+ /** Type of item in an App Bar Row/Column. */
243
+ export type AppBarItemType = "clickable" | "toggleable" | "custom";
244
+ /**
245
+ * State passed to custom overflow menu content renderers.
246
+ */
247
+ export interface AppBarMenuState {
248
+ isOpen: boolean;
249
+ open: () => void;
250
+ close: () => void;
251
+ }
252
+ /**
253
+ * Defines a single action item for use in `<AppBarRow>` or `<AppBarColumn>`.
254
+ * Translated from `AppBarItem` sealed interface in Kotlin DSL.
255
+ */
256
+ export interface AppBarItem {
257
+ /** Type determines which props are required. */
258
+ type: AppBarItemType;
259
+ /** Icon displayed in the App Bar (always shown). */
260
+ icon: React.ReactNode;
261
+ /** Accessible label for the icon button. Also shown in overflow menu. */
262
+ label: string;
263
+ /** Whether the item is interactive. @default true */
264
+ enabled?: boolean;
265
+ /** Called when the item is pressed (required for `type: "clickable"`). */
266
+ onClick?: () => void;
267
+ /** Current checked state (for `type: "toggleable"`). */
268
+ checked?: boolean;
269
+ /** Called when checked state changes (for `type: "toggleable"`). */
270
+ onCheckedChange?: (checked: boolean) => void;
271
+ /** Custom content rendered in the App Bar (for `type: "custom"`). */
272
+ appBarContent?: React.ReactNode;
273
+ /** Custom content rendered in the overflow dropdown menu. */
274
+ menuContent?: (state: AppBarMenuState) => React.ReactNode;
275
+ }
276
+ /**
277
+ * Props for `<AppBarRow>`.
278
+ *
279
+ * Displays App Bar items in a horizontal row.
280
+ * Items that overflow the available width collapse into a dropdown menu.
281
+ */
282
+ export interface AppBarRowProps {
283
+ /** App Bar action items to display. */
284
+ items: AppBarItem[];
285
+ /**
286
+ * Maximum number of items to display before collapsing to overflow.
287
+ * If not set, uses available container width to determine count.
288
+ */
289
+ maxItemCount?: number;
290
+ /** Additional CSS class applied to the row container. */
291
+ className?: string;
292
+ }
293
+ /**
294
+ * Props for `<AppBarColumn>`.
295
+ *
296
+ * Displays App Bar items in a vertical column.
297
+ * Items that overflow collapse into a dropdown menu.
298
+ */
299
+ export interface AppBarColumnProps {
300
+ /** App Bar action items to display. */
301
+ items: AppBarItem[];
302
+ /**
303
+ * Maximum number of items to display before collapsing to overflow.
304
+ */
305
+ maxItemCount?: number;
306
+ /** Additional CSS class applied to the column container. */
307
+ className?: string;
308
+ }
309
+ /**
310
+ * Props for `<AppBarOverflowIndicator>`.
311
+ *
312
+ * Renders a "More" (MoreVert) icon button that opens a dropdown menu
313
+ * containing overflow App Bar items.
314
+ */
315
+ export interface AppBarOverflowIndicatorProps {
316
+ /** Items that did not fit in the row/column and should appear in the dropdown. */
317
+ items: AppBarItem[];
318
+ /** Additional CSS class applied to the trigger button. */
319
+ className?: string;
320
+ }
321
+ /**
322
+ * Props for `<SearchView>`.
323
+ *
324
+ * Full-screen overlay shown when the search bar is activated.
325
+ * Designed to share a Framer Motion `layoutId` with the `<SearchAppBar>`
326
+ * search bar for smooth shared element transitions.
327
+ *
328
+ * Integration with SearchAppBar:
329
+ * ```tsx
330
+ * const [isOpen, setIsOpen] = useState(false);
331
+ *
332
+ * <SearchAppBar
333
+ * searchBarId="main-search"
334
+ * onSearchFocus={() => setIsOpen(true)}
335
+ * />
336
+ * <AnimatePresence>
337
+ * {isOpen && (
338
+ * <SearchView
339
+ * searchBarId="main-search"
340
+ * onClose={() => setIsOpen(false)}
341
+ * />
342
+ * )}
343
+ * </AnimatePresence>
344
+ * ```
345
+ */
346
+ export interface SearchViewProps {
347
+ /**
348
+ * Must match the `searchBarId` of the triggering `<SearchAppBar>`.
349
+ * Used as the Framer Motion `layoutId` for shared element transition.
350
+ * @default "search-bar"
351
+ */
352
+ searchBarId?: string;
353
+ /** Current search value. */
354
+ value?: string;
355
+ /** Called when search value changes. */
356
+ onChange?: (value: string) => void;
357
+ /** Called when the view is closed (Escape key or back navigation). */
358
+ onClose: () => void;
359
+ /** Placeholder text in the search input. @default "Search" */
360
+ placeholder?: string;
361
+ /**
362
+ * Content rendered below the search input (suggestions, history, results).
363
+ */
364
+ children?: React.ReactNode;
365
+ /** Navigation icon (back arrow) rendered at the leading edge. */
366
+ leadingIcon?: React.ReactNode;
367
+ /** Trailing action in the search input (e.g., clear button). */
368
+ trailingAction?: React.ReactNode;
369
+ /** Additional CSS class applied to the overlay container. */
370
+ className?: string;
371
+ }
372
+ /**
373
+ * Return type for `useAppBarScroll`.
374
+ * @internal
375
+ */
376
+ export interface UseAppBarScrollReturn {
377
+ /**
378
+ * True when the scroll position is greater than 0.
379
+ * Used by `pinned` behavior to change background color.
380
+ */
381
+ isScrolled: boolean;
382
+ /**
383
+ * Fraction from 0 (fully expanded) to 1 (fully collapsed).
384
+ * Used by `exitUntilCollapsed` to drive collapse animations.
385
+ */
386
+ collapsedFraction: number;
387
+ /**
388
+ * True when the App Bar should be visually hidden.
389
+ * Only relevant for `enterAlways` behavior.
390
+ */
391
+ isHidden: boolean;
392
+ }