@bug-on/m3-expressive 1.0.0
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.
- package/CHANGELOG.md +110 -0
- package/README.md +110 -0
- package/dist/assets/fonts/GoogleSansFlex-VariableFont.woff2 +0 -0
- package/dist/assets/fonts/MaterialSymbolsOutlined-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
- package/dist/assets/fonts/MaterialSymbolsRounded-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
- package/dist/assets/fonts/MaterialSymbolsSharp-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
- package/dist/assets/loading-indicator.svg +19 -0
- package/dist/assets/material-symbols-cdn.css +65 -0
- package/dist/assets/material-symbols-self-hosted.css +94 -0
- package/dist/buttons.d.mts +180 -0
- package/dist/buttons.d.ts +180 -0
- package/dist/buttons.js +4282 -0
- package/dist/buttons.js.map +1 -0
- package/dist/buttons.mjs +4227 -0
- package/dist/buttons.mjs.map +1 -0
- package/dist/core.d.mts +422 -0
- package/dist/core.d.ts +422 -0
- package/dist/core.js +2581 -0
- package/dist/core.js.map +1 -0
- package/dist/core.mjs +2547 -0
- package/dist/core.mjs.map +1 -0
- package/dist/feedback.d.mts +600 -0
- package/dist/feedback.d.ts +600 -0
- package/dist/feedback.js +2357 -0
- package/dist/feedback.js.map +1 -0
- package/dist/feedback.mjs +2321 -0
- package/dist/feedback.mjs.map +1 -0
- package/dist/forms.d.mts +40 -0
- package/dist/forms.d.ts +40 -0
- package/dist/forms.js +4263 -0
- package/dist/forms.js.map +1 -0
- package/dist/forms.mjs +4228 -0
- package/dist/forms.mjs.map +1 -0
- package/dist/icon-button-D-gs0gfj.d.mts +136 -0
- package/dist/icon-button-D-gs0gfj.d.ts +136 -0
- package/dist/index.css +309 -0
- package/dist/index.css.d.ts +2 -0
- package/dist/index.d.mts +24 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +23972 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +23668 -0
- package/dist/index.mjs.map +1 -0
- package/dist/layout.d.mts +610 -0
- package/dist/layout.d.ts +610 -0
- package/dist/layout.js +5091 -0
- package/dist/layout.js.map +1 -0
- package/dist/layout.mjs +5042 -0
- package/dist/layout.mjs.map +1 -0
- package/dist/material-symbols-cdn.css +65 -0
- package/dist/material-symbols-cdn.css.d.ts +2 -0
- package/dist/material-symbols-self-hosted.css +94 -0
- package/dist/material-symbols-self-hosted.css.d.ts +2 -0
- package/dist/md3-DFhj-NZj.d.mts +17 -0
- package/dist/md3-DFhj-NZj.d.ts +17 -0
- package/dist/navigation.d.mts +2766 -0
- package/dist/navigation.d.ts +2766 -0
- package/dist/navigation.js +6684 -0
- package/dist/navigation.js.map +1 -0
- package/dist/navigation.mjs +6573 -0
- package/dist/navigation.mjs.map +1 -0
- package/dist/overlays.d.mts +161 -0
- package/dist/overlays.d.ts +161 -0
- package/dist/overlays.js +3298 -0
- package/dist/overlays.js.map +1 -0
- package/dist/overlays.mjs +3244 -0
- package/dist/overlays.mjs.map +1 -0
- package/dist/pickers.d.mts +1074 -0
- package/dist/pickers.d.ts +1074 -0
- package/dist/pickers.js +4240 -0
- package/dist/pickers.js.map +1 -0
- package/dist/pickers.mjs +4200 -0
- package/dist/pickers.mjs.map +1 -0
- package/dist/plugin.d.mts +1 -0
- package/dist/plugin.d.ts +1 -0
- package/dist/plugin.js +13 -0
- package/dist/plugin.js.map +1 -0
- package/dist/plugin.mjs +3 -0
- package/dist/plugin.mjs.map +1 -0
- package/dist/scroll-area-CVS6HyLl.d.mts +33 -0
- package/dist/scroll-area-CVS6HyLl.d.ts +33 -0
- package/dist/shapes.d.mts +1119 -0
- package/dist/shapes.d.ts +1119 -0
- package/dist/shapes.js +2941 -0
- package/dist/shapes.js.map +1 -0
- package/dist/shapes.mjs +2889 -0
- package/dist/shapes.mjs.map +1 -0
- package/dist/side-sheet-modal-BY6VCC8p.d.mts +553 -0
- package/dist/side-sheet-modal-CglP6KYA.d.ts +553 -0
- package/dist/split-button-trailing-uncheckable-C5CLCIKP.d.ts +731 -0
- package/dist/split-button-trailing-uncheckable-MXj_kyNt.d.mts +731 -0
- package/dist/text-field-eAIpz9z1.d.mts +1038 -0
- package/dist/text-field-eAIpz9z1.d.ts +1038 -0
- package/dist/typography-339RV6v7.d.mts +486 -0
- package/dist/typography-339RV6v7.d.ts +486 -0
- package/dist/typography.css +22 -0
- package/dist/typography.css.d.ts +2 -0
- package/package.json +207 -0
|
@@ -0,0 +1,2766 @@
|
|
|
1
|
+
import * as motion from 'motion';
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
|
+
import { RefObject } from 'react';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
+
import * as RxContextMenu from '@radix-ui/react-context-menu';
|
|
6
|
+
import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
|
|
7
|
+
import { Transition, Variants } from 'motion/react';
|
|
8
|
+
import { B as BaseIconButtonProps } from './icon-button-D-gs0gfj.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @file app-bar.tokens.ts
|
|
12
|
+
* MD3 Expressive App Bar — Design tokens ported from:
|
|
13
|
+
* - AppBarTokens.kt (shared tokens)
|
|
14
|
+
* - AppBarSmallTokens.kt
|
|
15
|
+
* - AppBarMediumFlexibleTokens.kt
|
|
16
|
+
* - AppBarLargeFlexibleTokens.kt
|
|
17
|
+
* - BottomAppBarTokens.kt
|
|
18
|
+
* - DockedToolbarTokens.kt
|
|
19
|
+
* - FabSecondaryContainerTokens.kt
|
|
20
|
+
*
|
|
21
|
+
* All dimensional values are in px (dp equivalents for web at 1dp = 1px).
|
|
22
|
+
* Colors reference CSS custom properties — do NOT hardcode hex.
|
|
23
|
+
* @see docs/m3/app-bars/
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Height and spacing tokens for all App Bar variants.
|
|
27
|
+
* Maps directly from MD3 Kotlin token files.
|
|
28
|
+
*/
|
|
29
|
+
declare const AppBarTokens: {
|
|
30
|
+
readonly heights: {
|
|
31
|
+
/** SmallAppBar height. AppBarSmallTokens.ContainerHeight = 64dp */
|
|
32
|
+
readonly small: 64;
|
|
33
|
+
/** Collapsed height for flexible variants. = SmallAppBar height. */
|
|
34
|
+
readonly flexibleCollapsed: 64;
|
|
35
|
+
/** MediumFlexibleAppBar expanded height (without subtitle). AppBarMediumFlexibleTokens */
|
|
36
|
+
readonly mediumFlexExpanded: 112;
|
|
37
|
+
/** MediumFlexibleAppBar expanded height (with subtitle). */
|
|
38
|
+
readonly mediumFlexWithSubtitleExpanded: 136;
|
|
39
|
+
/** LargeFlexibleAppBar expanded height (without subtitle). AppBarLargeFlexibleTokens */
|
|
40
|
+
readonly largeFlexExpanded: 120;
|
|
41
|
+
/** LargeFlexibleAppBar expanded height (with subtitle). */
|
|
42
|
+
readonly largeFlexWithSubtitleExpanded: 152;
|
|
43
|
+
/** BottomAppBar height. BottomAppBarTokens.ContainerHeight = 80dp */
|
|
44
|
+
readonly bottom: 80;
|
|
45
|
+
/** DockedToolbar height. DockedToolbarTokens.ContainerHeight = 64dp */
|
|
46
|
+
readonly dockedToolbar: 64;
|
|
47
|
+
};
|
|
48
|
+
/** AppBarTokens.IconSize = 24dp */
|
|
49
|
+
readonly iconSize: 24;
|
|
50
|
+
/** AppBarTokens.AvatarSize = 32dp */
|
|
51
|
+
readonly avatarSize: 32;
|
|
52
|
+
/** AppBarTokens.LeadingSpace = 4dp */
|
|
53
|
+
readonly leadingSpace: 4;
|
|
54
|
+
/** AppBarTokens.TrailingSpace = 4dp */
|
|
55
|
+
readonly trailingSpace: 4;
|
|
56
|
+
/** AppBarTokens.IconButtonSpace = 0dp (no gap between icon buttons) */
|
|
57
|
+
readonly iconButtonSpace: 0;
|
|
58
|
+
readonly dockedToolbar: {
|
|
59
|
+
/** DockedToolbarTokens.ContainerLeadingSpace = 16dp */
|
|
60
|
+
readonly leadingSpace: 16;
|
|
61
|
+
/** DockedToolbarTokens.ContainerTrailingSpace = 16dp */
|
|
62
|
+
readonly trailingSpace: 16;
|
|
63
|
+
/** DockedToolbarTokens.ContainerMinSpacing = 4dp */
|
|
64
|
+
readonly minSpacing: 4;
|
|
65
|
+
/** DockedToolbarTokens.ContainerMaxSpacing = 32dp */
|
|
66
|
+
readonly maxSpacing: 32;
|
|
67
|
+
};
|
|
68
|
+
/** Minimum 48px touch target for icon buttons per MD3 accessibility spec. */
|
|
69
|
+
readonly iconButtonTouchTarget: 48;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* MD3 type scale values mapped to Tailwind CSS class strings.
|
|
73
|
+
* Used across App Bar variants for consistent typography.
|
|
74
|
+
*
|
|
75
|
+
* Values derived from MD3 Material Type Scale specification.
|
|
76
|
+
*/
|
|
77
|
+
declare const appBarTypography: {
|
|
78
|
+
/**
|
|
79
|
+
* SmallAppBar title (collapsed state for flexible variants).
|
|
80
|
+
* AppBarSmallTokens.TitleFont = TitleLarge
|
|
81
|
+
* Spec: 22sp / 28sp line-height / medium weight
|
|
82
|
+
*/
|
|
83
|
+
readonly titleLarge: "text-[22px] leading-[28px] font-medium tracking-[0px]";
|
|
84
|
+
/**
|
|
85
|
+
* SmallAppBar subtitle.
|
|
86
|
+
* AppBarSmallTokens.SubtitleFont = LabelMedium
|
|
87
|
+
* Spec: 12sp / 16sp line-height / medium weight / 0.5px tracking
|
|
88
|
+
*/
|
|
89
|
+
readonly labelMedium: "text-[12px] leading-[16px] font-medium tracking-[0.5px]";
|
|
90
|
+
/**
|
|
91
|
+
* MediumFlexibleAppBar expanded title.
|
|
92
|
+
* AppBarMediumFlexibleTokens.TitleFont = HeadlineMedium
|
|
93
|
+
* Spec: 28sp / 36sp line-height / normal weight
|
|
94
|
+
*/
|
|
95
|
+
readonly headlineMedium: "text-[28px] leading-[36px] font-normal tracking-[0px]";
|
|
96
|
+
/**
|
|
97
|
+
* MediumFlexibleAppBar subtitle.
|
|
98
|
+
* AppBarMediumFlexibleTokens.SubtitleFont = LabelLarge
|
|
99
|
+
* Spec: 14sp / 20sp line-height / medium weight / 0.1px tracking
|
|
100
|
+
*/
|
|
101
|
+
readonly labelLarge: "text-[14px] leading-[20px] font-medium tracking-[0.1px]";
|
|
102
|
+
/**
|
|
103
|
+
* LargeFlexibleAppBar expanded title.
|
|
104
|
+
* AppBarLargeFlexibleTokens.TitleFont = DisplaySmall
|
|
105
|
+
* Spec: 36sp / 44sp line-height / normal weight / -0.25px tracking
|
|
106
|
+
*/
|
|
107
|
+
readonly displaySmall: "text-[36px] leading-[44px] font-normal tracking-[-0.25px]";
|
|
108
|
+
/**
|
|
109
|
+
* LargeFlexibleAppBar subtitle.
|
|
110
|
+
* AppBarLargeFlexibleTokens.SubtitleFont = TitleMedium
|
|
111
|
+
* Spec: 16sp / 24sp line-height / medium weight / 0.15px tracking
|
|
112
|
+
*/
|
|
113
|
+
readonly titleMedium: "text-[16px] leading-6 font-medium tracking-[0.15px]";
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* CSS custom property references for App Bar colors.
|
|
117
|
+
* Maps to --md-sys-color-* tokens in the MD3 theme system.
|
|
118
|
+
*
|
|
119
|
+
* IMPORTANT: Never hardcode hex/rgba values here — these references
|
|
120
|
+
* automatically adapt to light/dark theme via the MD3ThemeProvider.
|
|
121
|
+
*
|
|
122
|
+
* AppBarTokens.kt spec:
|
|
123
|
+
* - ContainerColor → md-sys-color-surface
|
|
124
|
+
* - OnScrollContainerColor → md-sys-color-surface-container
|
|
125
|
+
*/
|
|
126
|
+
declare const APP_BAR_COLORS: {
|
|
127
|
+
/** Default background. AppBarTokens.ContainerColor → surface */
|
|
128
|
+
readonly container: "var(--md-sys-color-surface)";
|
|
129
|
+
/** Background when content is scrolled. AppBarTokens.OnScrollContainerColor → surface-container */
|
|
130
|
+
readonly scrolledContainer: "var(--md-sys-color-surface-container)";
|
|
131
|
+
/** Title color. AppBarTokens.TitleColor → on-surface */
|
|
132
|
+
readonly title: "var(--md-sys-color-on-surface)";
|
|
133
|
+
/** Subtitle color. AppBarTokens.SubtitleColor → on-surface-variant */
|
|
134
|
+
readonly subtitle: "var(--md-sys-color-on-surface-variant)";
|
|
135
|
+
/** Navigation icon color. AppBarTokens.LeadingIconColor → on-surface */
|
|
136
|
+
readonly navigationIcon: "var(--md-sys-color-on-surface)";
|
|
137
|
+
/** Action icon color. AppBarTokens.TrailingIconColor → on-surface-variant */
|
|
138
|
+
readonly actionIcon: "var(--md-sys-color-on-surface-variant)";
|
|
139
|
+
/** Search bar pill background. → surface-container-high */
|
|
140
|
+
readonly searchBarBg: "var(--md-sys-color-surface-container-high)";
|
|
141
|
+
/** Search bar text/icon color. */
|
|
142
|
+
readonly searchBarContent: "var(--md-sys-color-on-surface-variant)";
|
|
143
|
+
/** BottomAppBarTokens.ContainerColor → surface-container */
|
|
144
|
+
readonly bottomContainer: "var(--md-sys-color-surface-container)";
|
|
145
|
+
/** FabSecondaryContainerTokens.ContainerColor → secondary-container */
|
|
146
|
+
readonly fabContainer: "var(--md-sys-color-secondary-container)";
|
|
147
|
+
/** FabSecondaryContainerTokens.IconColor → on-secondary-container */
|
|
148
|
+
readonly fabIcon: "var(--md-sys-color-on-secondary-container)";
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Color transition when App Bar background changes on scroll.
|
|
152
|
+
* MD3 Standard easing: cubic-bezier(0.2, 0, 0, 1), 200ms.
|
|
153
|
+
*/
|
|
154
|
+
declare const APP_BAR_COLOR_TRANSITION: {
|
|
155
|
+
readonly duration: 0.2;
|
|
156
|
+
readonly ease: [number, number, number, number];
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Spring animation for enterAlways behavior (hide/show on scroll direction).
|
|
160
|
+
* Equivalent to MD3 FastSpatial motion scheme.
|
|
161
|
+
*/
|
|
162
|
+
declare const APP_BAR_ENTER_ALWAYS_SPRING: motion.Transition;
|
|
163
|
+
declare const APP_BAR_BOTTOM_SPRING: motion.Transition;
|
|
164
|
+
declare const SEARCH_VIEW_SPRING: motion.Transition;
|
|
165
|
+
/**
|
|
166
|
+
* Title crossfade transition for flexible App Bars.
|
|
167
|
+
* Short duration keeps the collapse feeling snappy.
|
|
168
|
+
*/
|
|
169
|
+
declare const APP_BAR_TITLE_FADE: {
|
|
170
|
+
readonly duration: 0.15;
|
|
171
|
+
readonly ease: "easeInOut";
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @file app-bar.types.ts
|
|
176
|
+
* MD3 Expressive App Bar — TypeScript prop definitions.
|
|
177
|
+
* Spec: https://m3.material.io/components/app-bars/overview
|
|
178
|
+
* Reference: docs/m3/app-bars/AppBar.kt (MD3 Expressive, May 2025)
|
|
179
|
+
*
|
|
180
|
+
* Note: Component name is "App Bar" (not "Top App Bar") per MD3 Expressive May 2025 rename.
|
|
181
|
+
*/
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Controls how the App Bar responds to scroll events.
|
|
185
|
+
*
|
|
186
|
+
* - `pinned`: Always visible. Changes background color when scrolled.
|
|
187
|
+
* - `enterAlways`: Hides when scrolling down, reveals when scrolling up.
|
|
188
|
+
* - `exitUntilCollapsed`: Collapses from expandedHeight → collapsedHeight as user scrolls.
|
|
189
|
+
*/
|
|
190
|
+
type AppBarScrollBehavior = "pinned" | "enterAlways" | "exitUntilCollapsed";
|
|
191
|
+
/** Horizontal alignment of the title (and subtitle) text. */
|
|
192
|
+
type TitleAlignment = "start" | "center";
|
|
193
|
+
/**
|
|
194
|
+
* Optional color overrides for the App Bar.
|
|
195
|
+
* All values should be CSS color strings (var(--md-sys-color-*) or hex).
|
|
196
|
+
*
|
|
197
|
+
* By default, App Bars use MD3 system color tokens automatically.
|
|
198
|
+
*/
|
|
199
|
+
interface AppBarColors {
|
|
200
|
+
/** Background when not scrolled. Default: `var(--md-sys-color-surface)` */
|
|
201
|
+
containerColor?: string;
|
|
202
|
+
/** Background when content has scrolled past top. Default: `var(--md-sys-color-surface-container)` */
|
|
203
|
+
scrolledContainerColor?: string;
|
|
204
|
+
/** Title text color. Default: `var(--md-sys-color-on-surface)` */
|
|
205
|
+
titleColor?: string;
|
|
206
|
+
/** Subtitle text color. Default: `var(--md-sys-color-on-surface-variant)` */
|
|
207
|
+
subtitleColor?: string;
|
|
208
|
+
/** Navigation icon color. Default: `var(--md-sys-color-on-surface)` */
|
|
209
|
+
navigationIconColor?: string;
|
|
210
|
+
/** Action icon color. Default: `var(--md-sys-color-on-surface-variant)` */
|
|
211
|
+
actionIconColor?: string;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Shared props for all top App Bar variants.
|
|
215
|
+
*/
|
|
216
|
+
interface BaseAppBarProps {
|
|
217
|
+
/**
|
|
218
|
+
* Navigation icon slot (typically IconButton with back arrow or hamburger).
|
|
219
|
+
* Should have `aria-label` for accessibility.
|
|
220
|
+
*/
|
|
221
|
+
navigationIcon?: React$1.ReactNode;
|
|
222
|
+
/**
|
|
223
|
+
* Action icon slots rendered at the trailing end.
|
|
224
|
+
* Typically `<IconButton>` components. Use `<AppBarRow>` for overflow support.
|
|
225
|
+
*/
|
|
226
|
+
actions?: React$1.ReactNode;
|
|
227
|
+
/** Optional color overrides. Defaults use MD3 system color tokens. */
|
|
228
|
+
colors?: AppBarColors;
|
|
229
|
+
/**
|
|
230
|
+
* Scroll behavior that controls how the App Bar reacts to scroll events.
|
|
231
|
+
* @default "pinned"
|
|
232
|
+
*/
|
|
233
|
+
scrollBehavior?: AppBarScrollBehavior;
|
|
234
|
+
/**
|
|
235
|
+
* Ref to the scrollable element to observe.
|
|
236
|
+
* If not provided, listens to `window` scroll events.
|
|
237
|
+
*/
|
|
238
|
+
scrollElement?: React$1.RefObject<HTMLElement | null>;
|
|
239
|
+
/** Additional CSS class applied to the root header element. */
|
|
240
|
+
className?: string;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Props for `<SmallAppBar>`.
|
|
244
|
+
*
|
|
245
|
+
* Single-row layout with navigation icon, title, and action buttons.
|
|
246
|
+
* Height: 64px. Title font: TitleLarge (22sp).
|
|
247
|
+
*/
|
|
248
|
+
interface SmallAppBarProps extends BaseAppBarProps {
|
|
249
|
+
/** The main title content. */
|
|
250
|
+
title: React$1.ReactNode;
|
|
251
|
+
/**
|
|
252
|
+
* Optional subtitle displayed below the title.
|
|
253
|
+
* Font: LabelMedium (12sp).
|
|
254
|
+
*/
|
|
255
|
+
subtitle?: React$1.ReactNode;
|
|
256
|
+
/**
|
|
257
|
+
* Horizontal alignment of the title and subtitle.
|
|
258
|
+
* When `center`: title is centered, nav icon and actions balance both sides.
|
|
259
|
+
* @default "start"
|
|
260
|
+
*/
|
|
261
|
+
titleAlignment?: TitleAlignment;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Props for `<MediumFlexibleAppBar>` and `<LargeFlexibleAppBar>`.
|
|
265
|
+
*
|
|
266
|
+
* Two-row layout in expanded state (nav row + title row).
|
|
267
|
+
* Collapses to single row when scrolled.
|
|
268
|
+
* Only supports `exitUntilCollapsed` scroll behavior.
|
|
269
|
+
*/
|
|
270
|
+
interface FlexibleAppBarProps extends BaseAppBarProps {
|
|
271
|
+
/** The main title content (rendered in both expanded and collapsed states). */
|
|
272
|
+
title: React$1.ReactNode;
|
|
273
|
+
/**
|
|
274
|
+
* Optional subtitle displayed in the expanded title row.
|
|
275
|
+
* Affects expanded height (adds extra rows).
|
|
276
|
+
*/
|
|
277
|
+
subtitle?: React$1.ReactNode;
|
|
278
|
+
/**
|
|
279
|
+
* Horizontal alignment of the title and subtitle.
|
|
280
|
+
* @default "start"
|
|
281
|
+
*/
|
|
282
|
+
titleAlignment?: TitleAlignment;
|
|
283
|
+
/**
|
|
284
|
+
* Collapsed height in px. The App Bar settles to this height after full scroll.
|
|
285
|
+
* @default 64
|
|
286
|
+
*/
|
|
287
|
+
collapsedHeight?: number;
|
|
288
|
+
/**
|
|
289
|
+
* Expanded (initial) height in px.
|
|
290
|
+
* Defaults depend on variant and subtitle presence.
|
|
291
|
+
*/
|
|
292
|
+
expandedHeight?: number;
|
|
293
|
+
/**
|
|
294
|
+
* Additional content rendered in the expanded title area.
|
|
295
|
+
* Supports images, circular avatars (32dp), Filled Buttons, or custom elements.
|
|
296
|
+
* Hidden when collapsed.
|
|
297
|
+
*/
|
|
298
|
+
headerContent?: React$1.ReactNode;
|
|
299
|
+
}
|
|
300
|
+
/** Visual variant of the search bar. */
|
|
301
|
+
type SearchBarVariant = "filled" | "outlined";
|
|
302
|
+
/**
|
|
303
|
+
* Props for `<SearchAppBar>`.
|
|
304
|
+
*
|
|
305
|
+
* Replaces the title with a pill-shaped search input bar.
|
|
306
|
+
* New variant in MD3 Expressive (May 2025).
|
|
307
|
+
*
|
|
308
|
+
* @example
|
|
309
|
+
* ```tsx
|
|
310
|
+
* <SearchAppBar
|
|
311
|
+
* searchPlaceholder="Search..."
|
|
312
|
+
* onSearchFocus={() => setSearchViewOpen(true)}
|
|
313
|
+
* trailingSearchActions={<IconButton aria-label="Voice search">...</IconButton>}
|
|
314
|
+
* externalActions={<Avatar />}
|
|
315
|
+
* />
|
|
316
|
+
* ```
|
|
317
|
+
*/
|
|
318
|
+
interface SearchAppBarProps extends BaseAppBarProps {
|
|
319
|
+
/** Placeholder text in the search bar. @default "Search" */
|
|
320
|
+
searchPlaceholder?: string;
|
|
321
|
+
/** Controlled search value. */
|
|
322
|
+
searchValue?: string;
|
|
323
|
+
/** Called when search input changes (inside the SearchView). */
|
|
324
|
+
onSearchChange?: (value: string) => void;
|
|
325
|
+
/**
|
|
326
|
+
* Called when the search bar is focused/clicked.
|
|
327
|
+
* Consumers should open a `<SearchView>` in response.
|
|
328
|
+
*/
|
|
329
|
+
onSearchFocus?: () => void;
|
|
330
|
+
/** Called when the search view is closed/blurred. */
|
|
331
|
+
onSearchBlur?: () => void;
|
|
332
|
+
/**
|
|
333
|
+
* Icon rendered at the leading edge of the search bar (inside the pill).
|
|
334
|
+
* Defaults to a search icon.
|
|
335
|
+
*/
|
|
336
|
+
leadingSearchIcon?: React$1.ReactNode;
|
|
337
|
+
/**
|
|
338
|
+
* Action icons rendered at the trailing edge of the search bar (inside the pill).
|
|
339
|
+
* Common examples: mic, camera, QR code.
|
|
340
|
+
*/
|
|
341
|
+
trailingSearchActions?: React$1.ReactNode;
|
|
342
|
+
/**
|
|
343
|
+
* Action icons rendered outside the search bar (at the trailing edge of the bar).
|
|
344
|
+
* Common example: profile avatar button.
|
|
345
|
+
*/
|
|
346
|
+
externalActions?: React$1.ReactNode;
|
|
347
|
+
/**
|
|
348
|
+
* Horizontal alignment of the search bar.
|
|
349
|
+
* @default "start"
|
|
350
|
+
*/
|
|
351
|
+
titleAlignment?: TitleAlignment;
|
|
352
|
+
/**
|
|
353
|
+
* Visual style of the search bar.
|
|
354
|
+
* @default "filled"
|
|
355
|
+
*/
|
|
356
|
+
searchBarVariant?: SearchBarVariant;
|
|
357
|
+
/**
|
|
358
|
+
* Unique identifier for the search bar — used as the Framer Motion `layoutId`
|
|
359
|
+
* to enable shared element transitions with `<SearchView>`.
|
|
360
|
+
* Must be unique if multiple SearchAppBars are on the page.
|
|
361
|
+
* @default "search-bar"
|
|
362
|
+
*/
|
|
363
|
+
searchBarId?: string;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Props for `<BottomAppBar>`.
|
|
367
|
+
*
|
|
368
|
+
* Fixed to the bottom of the screen. Contains navigation actions and optional FAB.
|
|
369
|
+
* Height: 80px. Background: `surface-container`. Elevation: Level2.
|
|
370
|
+
*/
|
|
371
|
+
interface BottomAppBarProps {
|
|
372
|
+
/**
|
|
373
|
+
* Action icon buttons rendered at the leading end.
|
|
374
|
+
* Typically 3-4 `<IconButton>` components.
|
|
375
|
+
*/
|
|
376
|
+
actions?: React$1.ReactNode;
|
|
377
|
+
/**
|
|
378
|
+
* Floating Action Button rendered at the trailing end.
|
|
379
|
+
* Consumer provides a `<FAB>` or `<FABPosition>` component.
|
|
380
|
+
*/
|
|
381
|
+
floatingActionButton?: React$1.ReactNode;
|
|
382
|
+
/**
|
|
383
|
+
* Scroll behavior.
|
|
384
|
+
* - `visible`: Always visible.
|
|
385
|
+
* - `hidden`: Slides down when scrolling down, appears when scrolling up.
|
|
386
|
+
* @default "visible"
|
|
387
|
+
*/
|
|
388
|
+
scrollBehavior?: "visible" | "hidden";
|
|
389
|
+
/**
|
|
390
|
+
* Ref to the scrollable element to observe.
|
|
391
|
+
* If not provided, listens to `window` scroll events.
|
|
392
|
+
*/
|
|
393
|
+
scrollElement?: React$1.RefObject<HTMLElement | null>;
|
|
394
|
+
/** Additional CSS class applied to the root nav element. */
|
|
395
|
+
className?: string;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Props for `<DockedToolbar>`.
|
|
399
|
+
*
|
|
400
|
+
* Secondary navigation bar. Not an App Bar — typically appears below the main App Bar.
|
|
401
|
+
* Height: 64px. Background: `surface-container`.
|
|
402
|
+
* Contains chips, segmented buttons, or filter actions.
|
|
403
|
+
*/
|
|
404
|
+
interface DockedToolbarProps {
|
|
405
|
+
/** Toolbar content (chips, segmented buttons, filter actions, etc.) */
|
|
406
|
+
children: React$1.ReactNode;
|
|
407
|
+
/**
|
|
408
|
+
* Accessible label for the toolbar (required for accessibility).
|
|
409
|
+
* e.g., "Filter options" or "Content navigation"
|
|
410
|
+
*/
|
|
411
|
+
"aria-label": string;
|
|
412
|
+
/** Additional CSS class applied to the root element. */
|
|
413
|
+
className?: string;
|
|
414
|
+
}
|
|
415
|
+
/** Type of item in an App Bar Row/Column. */
|
|
416
|
+
type AppBarItemType = "clickable" | "toggleable" | "custom";
|
|
417
|
+
/**
|
|
418
|
+
* State passed to custom overflow menu content renderers.
|
|
419
|
+
*/
|
|
420
|
+
interface AppBarMenuState {
|
|
421
|
+
isOpen: boolean;
|
|
422
|
+
open: () => void;
|
|
423
|
+
close: () => void;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Defines a single action item for use in `<AppBarRow>` or `<AppBarColumn>`.
|
|
427
|
+
* Translated from `AppBarItem` sealed interface in Kotlin DSL.
|
|
428
|
+
*/
|
|
429
|
+
interface AppBarItem {
|
|
430
|
+
/** Type determines which props are required. */
|
|
431
|
+
type: AppBarItemType;
|
|
432
|
+
/** Icon displayed in the App Bar (always shown). */
|
|
433
|
+
icon: React$1.ReactNode;
|
|
434
|
+
/** Accessible label for the icon button. Also shown in overflow menu. */
|
|
435
|
+
label: string;
|
|
436
|
+
/** Whether the item is interactive. @default true */
|
|
437
|
+
enabled?: boolean;
|
|
438
|
+
/** Called when the item is pressed (required for `type: "clickable"`). */
|
|
439
|
+
onClick?: () => void;
|
|
440
|
+
/** Current checked state (for `type: "toggleable"`). */
|
|
441
|
+
checked?: boolean;
|
|
442
|
+
/** Called when checked state changes (for `type: "toggleable"`). */
|
|
443
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
444
|
+
/** Custom content rendered in the App Bar (for `type: "custom"`). */
|
|
445
|
+
appBarContent?: React$1.ReactNode;
|
|
446
|
+
/** Custom content rendered in the overflow dropdown menu. */
|
|
447
|
+
menuContent?: (state: AppBarMenuState) => React$1.ReactNode;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Props for `<AppBarRow>`.
|
|
451
|
+
*
|
|
452
|
+
* Displays App Bar items in a horizontal row.
|
|
453
|
+
* Items that overflow the available width collapse into a dropdown menu.
|
|
454
|
+
*/
|
|
455
|
+
interface AppBarRowProps {
|
|
456
|
+
/** App Bar action items to display. */
|
|
457
|
+
items: AppBarItem[];
|
|
458
|
+
/**
|
|
459
|
+
* Maximum number of items to display before collapsing to overflow.
|
|
460
|
+
* If not set, uses available container width to determine count.
|
|
461
|
+
*/
|
|
462
|
+
maxItemCount?: number;
|
|
463
|
+
/** Additional CSS class applied to the row container. */
|
|
464
|
+
className?: string;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Props for `<AppBarColumn>`.
|
|
468
|
+
*
|
|
469
|
+
* Displays App Bar items in a vertical column.
|
|
470
|
+
* Items that overflow collapse into a dropdown menu.
|
|
471
|
+
*/
|
|
472
|
+
interface AppBarColumnProps {
|
|
473
|
+
/** App Bar action items to display. */
|
|
474
|
+
items: AppBarItem[];
|
|
475
|
+
/**
|
|
476
|
+
* Maximum number of items to display before collapsing to overflow.
|
|
477
|
+
*/
|
|
478
|
+
maxItemCount?: number;
|
|
479
|
+
/** Additional CSS class applied to the column container. */
|
|
480
|
+
className?: string;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Props for `<AppBarOverflowIndicator>`.
|
|
484
|
+
*
|
|
485
|
+
* Renders a "More" (MoreVert) icon button that opens a dropdown menu
|
|
486
|
+
* containing overflow App Bar items.
|
|
487
|
+
*/
|
|
488
|
+
interface AppBarOverflowIndicatorProps {
|
|
489
|
+
/** Items that did not fit in the row/column and should appear in the dropdown. */
|
|
490
|
+
items: AppBarItem[];
|
|
491
|
+
/** Additional CSS class applied to the trigger button. */
|
|
492
|
+
className?: string;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Props for `<SearchView>`.
|
|
496
|
+
*
|
|
497
|
+
* Full-screen overlay shown when the search bar is activated.
|
|
498
|
+
* Designed to share a Framer Motion `layoutId` with the `<SearchAppBar>`
|
|
499
|
+
* search bar for smooth shared element transitions.
|
|
500
|
+
*
|
|
501
|
+
* Integration with SearchAppBar:
|
|
502
|
+
* ```tsx
|
|
503
|
+
* const [isOpen, setIsOpen] = useState(false);
|
|
504
|
+
*
|
|
505
|
+
* <SearchAppBar
|
|
506
|
+
* searchBarId="main-search"
|
|
507
|
+
* onSearchFocus={() => setIsOpen(true)}
|
|
508
|
+
* />
|
|
509
|
+
* <AnimatePresence>
|
|
510
|
+
* {isOpen && (
|
|
511
|
+
* <SearchView
|
|
512
|
+
* searchBarId="main-search"
|
|
513
|
+
* onClose={() => setIsOpen(false)}
|
|
514
|
+
* />
|
|
515
|
+
* )}
|
|
516
|
+
* </AnimatePresence>
|
|
517
|
+
* ```
|
|
518
|
+
*/
|
|
519
|
+
interface SearchViewProps {
|
|
520
|
+
/**
|
|
521
|
+
* Must match the `searchBarId` of the triggering `<SearchAppBar>`.
|
|
522
|
+
* Used as the Framer Motion `layoutId` for shared element transition.
|
|
523
|
+
* @default "search-bar"
|
|
524
|
+
*/
|
|
525
|
+
searchBarId?: string;
|
|
526
|
+
/** Current search value. */
|
|
527
|
+
value?: string;
|
|
528
|
+
/** Called when search value changes. */
|
|
529
|
+
onChange?: (value: string) => void;
|
|
530
|
+
/** Called when the view is closed (Escape key or back navigation). */
|
|
531
|
+
onClose: () => void;
|
|
532
|
+
/** Placeholder text in the search input. @default "Search" */
|
|
533
|
+
placeholder?: string;
|
|
534
|
+
/**
|
|
535
|
+
* Content rendered below the search input (suggestions, history, results).
|
|
536
|
+
*/
|
|
537
|
+
children?: React$1.ReactNode;
|
|
538
|
+
/** Navigation icon (back arrow) rendered at the leading edge. */
|
|
539
|
+
leadingIcon?: React$1.ReactNode;
|
|
540
|
+
/** Trailing action in the search input (e.g., clear button). */
|
|
541
|
+
trailingAction?: React$1.ReactNode;
|
|
542
|
+
/** Additional CSS class applied to the overlay container. */
|
|
543
|
+
className?: string;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Return type for `useAppBarScroll`.
|
|
547
|
+
* @internal
|
|
548
|
+
*/
|
|
549
|
+
interface UseAppBarScrollReturn {
|
|
550
|
+
/**
|
|
551
|
+
* True when the scroll position is greater than 0.
|
|
552
|
+
* Used by `pinned` behavior to change background color.
|
|
553
|
+
*/
|
|
554
|
+
isScrolled: boolean;
|
|
555
|
+
/**
|
|
556
|
+
* Fraction from 0 (fully expanded) to 1 (fully collapsed).
|
|
557
|
+
* Used by `exitUntilCollapsed` to drive collapse animations.
|
|
558
|
+
*/
|
|
559
|
+
collapsedFraction: number;
|
|
560
|
+
/**
|
|
561
|
+
* True when the App Bar should be visually hidden.
|
|
562
|
+
* Only relevant for `enterAlways` behavior.
|
|
563
|
+
*/
|
|
564
|
+
isHidden: boolean;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* MD3 Expressive App Bar Column.
|
|
569
|
+
*
|
|
570
|
+
* Renders action items in a vertical column. Commonly used in
|
|
571
|
+
* side navigation or rail-style App Bars.
|
|
572
|
+
*
|
|
573
|
+
* @example
|
|
574
|
+
* ```tsx
|
|
575
|
+
* <AppBarColumn
|
|
576
|
+
* maxItemCount={3}
|
|
577
|
+
* items={[
|
|
578
|
+
* { type: 'clickable', icon: <Icon>edit</Icon>, label: 'Edit', onClick: handleEdit },
|
|
579
|
+
* { type: 'clickable', icon: <Icon>delete</Icon>, label: 'Delete', onClick: handleDelete },
|
|
580
|
+
* ]}
|
|
581
|
+
* />
|
|
582
|
+
* ```
|
|
583
|
+
*/
|
|
584
|
+
declare function AppBarColumn({ items, maxItemCount, className, }: AppBarColumnProps): react_jsx_runtime.JSX.Element;
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* MD3 App Bar Overflow Indicator.
|
|
588
|
+
*
|
|
589
|
+
* Renders a "more_vert" button that opens a dropdown menu
|
|
590
|
+
* with overflow action items.
|
|
591
|
+
*/
|
|
592
|
+
declare function AppBarOverflowIndicator({ items, className, }: AppBarOverflowIndicatorProps): react_jsx_runtime.JSX.Element | null;
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* MD3 Expressive App Bar Row.
|
|
596
|
+
*
|
|
597
|
+
* Renders action items in a row. Compatible with the `actions` prop of any App Bar.
|
|
598
|
+
*
|
|
599
|
+
* @example
|
|
600
|
+
* ```tsx
|
|
601
|
+
* <SmallAppBar
|
|
602
|
+
* title="Messages"
|
|
603
|
+
* actions={
|
|
604
|
+
* <AppBarRow
|
|
605
|
+
* maxItemCount={2}
|
|
606
|
+
* items={[
|
|
607
|
+
* { type: 'clickable', icon: <Icon>search</Icon>, label: 'Search', onClick: handleSearch },
|
|
608
|
+
* { type: 'clickable', icon: <Icon>bookmark</Icon>, label: 'Bookmarks', onClick: handleBookmark },
|
|
609
|
+
* { type: 'clickable', icon: <Icon>settings</Icon>, label: 'Settings', onClick: handleSettings },
|
|
610
|
+
* ]}
|
|
611
|
+
* />
|
|
612
|
+
* }
|
|
613
|
+
* />
|
|
614
|
+
* ```
|
|
615
|
+
*/
|
|
616
|
+
declare function AppBarRow({ items, maxItemCount, className }: AppBarRowProps): react_jsx_runtime.JSX.Element;
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* MD3 Expressive Bottom App Bar.
|
|
620
|
+
*
|
|
621
|
+
* @example
|
|
622
|
+
* ```tsx
|
|
623
|
+
* // With FAB
|
|
624
|
+
* <BottomAppBar
|
|
625
|
+
* actions={
|
|
626
|
+
* <>
|
|
627
|
+
* <IconButton aria-label="Check"><Icon>check_box</Icon></IconButton>
|
|
628
|
+
* <IconButton aria-label="Brush"><Icon>brush</Icon></IconButton>
|
|
629
|
+
* </>
|
|
630
|
+
* }
|
|
631
|
+
* floatingActionButton={<FAB aria-label="Compose">...</FAB>}
|
|
632
|
+
* />
|
|
633
|
+
*
|
|
634
|
+
* // Auto-hide on scroll
|
|
635
|
+
* <BottomAppBar scrollBehavior="hidden" actions={...} />
|
|
636
|
+
* ```
|
|
637
|
+
*/
|
|
638
|
+
declare function BottomAppBar({ actions, floatingActionButton, scrollBehavior, scrollElement, className, }: BottomAppBarProps): react_jsx_runtime.JSX.Element;
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* MD3 Expressive Docked Toolbar.
|
|
642
|
+
*
|
|
643
|
+
* @example
|
|
644
|
+
* ```tsx
|
|
645
|
+
* <DockedToolbar aria-label="Filter options">
|
|
646
|
+
* <Chip label="All" selected onClick={() => setFilter('all')} />
|
|
647
|
+
* <Chip label="Unread" onClick={() => setFilter('unread')} />
|
|
648
|
+
* <Chip label="Starred" onClick={() => setFilter('starred')} />
|
|
649
|
+
* </DockedToolbar>
|
|
650
|
+
* ```
|
|
651
|
+
*/
|
|
652
|
+
declare function DockedToolbar({ children, "aria-label": ariaLabel, className, }: DockedToolbarProps): react_jsx_runtime.JSX.Element;
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* @file use-app-bar-scroll.ts
|
|
656
|
+
* MD3 Expressive App Bar — Scroll behavior hook.
|
|
657
|
+
*
|
|
658
|
+
* Tracks scroll state for App Bar behaviors:
|
|
659
|
+
* - `pinned`: background color change only
|
|
660
|
+
* - `enterAlways`: hide/show based on scroll direction
|
|
661
|
+
* - `exitUntilCollapsed`: drives collapse fraction (0 = expanded, 1 = collapsed)
|
|
662
|
+
*/
|
|
663
|
+
|
|
664
|
+
interface UseAppBarScrollOptions {
|
|
665
|
+
/** Ref to the scrollable container. Defaults to `window`. */
|
|
666
|
+
scrollElement?: React$1.RefObject<HTMLElement | null>;
|
|
667
|
+
/** Scroll behavior mode. @default "pinned" */
|
|
668
|
+
behavior?: AppBarScrollBehavior;
|
|
669
|
+
/** Collapsed height in px — used for `exitUntilCollapsed`. @default 64 */
|
|
670
|
+
collapsedHeight?: number;
|
|
671
|
+
/** Expanded height in px — used for `exitUntilCollapsed`. @default 112 */
|
|
672
|
+
expandedHeight?: number;
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* Tracks scroll position and derives App Bar state for all three behaviors.
|
|
676
|
+
*
|
|
677
|
+
* @example
|
|
678
|
+
* ```tsx
|
|
679
|
+
* // pinned (color change only)
|
|
680
|
+
* const { isScrolled } = useAppBarScroll({ behavior: 'pinned' });
|
|
681
|
+
*
|
|
682
|
+
* // enterAlways (hide/show)
|
|
683
|
+
* const { isHidden } = useAppBarScroll({ behavior: 'enterAlways' });
|
|
684
|
+
*
|
|
685
|
+
* // exitUntilCollapsed (collapse animation)
|
|
686
|
+
* const { collapsedFraction } = useAppBarScroll({
|
|
687
|
+
* behavior: 'exitUntilCollapsed',
|
|
688
|
+
* collapsedHeight: 64,
|
|
689
|
+
* expandedHeight: 112,
|
|
690
|
+
* });
|
|
691
|
+
* ```
|
|
692
|
+
*/
|
|
693
|
+
declare function useAppBarScroll({ scrollElement, behavior, collapsedHeight, expandedHeight, }?: UseAppBarScrollOptions): UseAppBarScrollReturn;
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* MD3 Expressive Large Flexible App Bar.
|
|
697
|
+
*
|
|
698
|
+
* @example
|
|
699
|
+
* ```tsx
|
|
700
|
+
* <LargeFlexibleAppBar
|
|
701
|
+
* title="Discover"
|
|
702
|
+
* subtitle="Trending today"
|
|
703
|
+
* navigationIcon={<IconButton aria-label="Open menu"><Icon>menu</Icon></IconButton>}
|
|
704
|
+
* headerContent={<img src="/banner.jpg" alt="" className="rounded-xl h-20 w-full object-cover" />}
|
|
705
|
+
* />
|
|
706
|
+
* ```
|
|
707
|
+
*/
|
|
708
|
+
declare function LargeFlexibleAppBar({ title, subtitle, titleAlignment, navigationIcon, actions, colors, scrollElement, headerContent, collapsedHeight, expandedHeight, className, }: FlexibleAppBarProps): react_jsx_runtime.JSX.Element;
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* MD3 Expressive Medium Flexible App Bar.
|
|
712
|
+
*
|
|
713
|
+
* @example
|
|
714
|
+
* ```tsx
|
|
715
|
+
* <MediumFlexibleAppBar
|
|
716
|
+
* title="Settings"
|
|
717
|
+
* subtitle="Manage your preferences"
|
|
718
|
+
* navigationIcon={<IconButton aria-label="Go back"><Icon>arrow_back</Icon></IconButton>}
|
|
719
|
+
* actions={<IconButton aria-label="More options"><Icon>more_vert</Icon></IconButton>}
|
|
720
|
+
* />
|
|
721
|
+
* ```
|
|
722
|
+
*/
|
|
723
|
+
declare function MediumFlexibleAppBar({ title, subtitle, titleAlignment, navigationIcon, actions, colors, scrollElement, headerContent, collapsedHeight, expandedHeight, className, }: FlexibleAppBarProps): react_jsx_runtime.JSX.Element;
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* MD3 Expressive Search App Bar.
|
|
727
|
+
*
|
|
728
|
+
* When the search bar is clicked, callers should open a `<SearchView>` overlay.
|
|
729
|
+
* Uses Framer Motion `layoutId` (via `searchBarId`) for a smooth shared-element
|
|
730
|
+
* transition between this bar and the search view.
|
|
731
|
+
*
|
|
732
|
+
* @example
|
|
733
|
+
* ```tsx
|
|
734
|
+
* const [searchOpen, setSearchOpen] = useState(false);
|
|
735
|
+
*
|
|
736
|
+
* <SearchAppBar
|
|
737
|
+
* searchBarId="main-search"
|
|
738
|
+
* searchPlaceholder="Search messages..."
|
|
739
|
+
* onSearchFocus={() => setSearchOpen(true)}
|
|
740
|
+
* trailingSearchActions={
|
|
741
|
+
* <IconButton aria-label="Voice search"><Icon>mic</Icon></IconButton>
|
|
742
|
+
* }
|
|
743
|
+
* externalActions={<Avatar src={user.avatar} />}
|
|
744
|
+
* />
|
|
745
|
+
*
|
|
746
|
+
* <AnimatePresence>
|
|
747
|
+
* {searchOpen && (
|
|
748
|
+
* <SearchView
|
|
749
|
+
* searchBarId="main-search"
|
|
750
|
+
* onClose={() => setSearchOpen(false)}
|
|
751
|
+
* />
|
|
752
|
+
* )}
|
|
753
|
+
* </AnimatePresence>
|
|
754
|
+
* ```
|
|
755
|
+
*/
|
|
756
|
+
declare function SearchAppBar({ searchPlaceholder, searchValue, onSearchFocus, leadingSearchIcon, trailingSearchActions, externalActions, navigationIcon, colors, scrollBehavior, scrollElement, searchBarId, className, }: SearchAppBarProps): react_jsx_runtime.JSX.Element;
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* MD3 Expressive Search View.
|
|
760
|
+
*
|
|
761
|
+
* Renders a full-screen search overlay with a shared element transition
|
|
762
|
+
* from the triggering `<SearchAppBar>` search bar.
|
|
763
|
+
*
|
|
764
|
+
* Mount/unmount this component via `<AnimatePresence>` in the consumer.
|
|
765
|
+
*/
|
|
766
|
+
declare function SearchView({ searchBarId, value, onChange, onClose, placeholder, children, leadingIcon, trailingAction, className, }: SearchViewProps): react_jsx_runtime.JSX.Element;
|
|
767
|
+
/**
|
|
768
|
+
* Convenience wrapper that handles the AnimatePresence + open state.
|
|
769
|
+
*
|
|
770
|
+
* @example
|
|
771
|
+
* ```tsx
|
|
772
|
+
* <SearchBar
|
|
773
|
+
* isOpen={searchOpen}
|
|
774
|
+
* onClose={() => setSearchOpen(false)}
|
|
775
|
+
* searchBarId="main-search"
|
|
776
|
+
* >
|
|
777
|
+
* <SearchResultsList results={results} />
|
|
778
|
+
* </SearchBar>
|
|
779
|
+
* ```
|
|
780
|
+
*/
|
|
781
|
+
declare function SearchViewContainer({ isOpen, ...props }: SearchViewProps & {
|
|
782
|
+
isOpen: boolean;
|
|
783
|
+
}): react_jsx_runtime.JSX.Element;
|
|
784
|
+
|
|
785
|
+
/**
|
|
786
|
+
* MD3 Expressive Small App Bar.
|
|
787
|
+
*
|
|
788
|
+
* @example
|
|
789
|
+
* ```tsx
|
|
790
|
+
* // Left-aligned (default)
|
|
791
|
+
* <SmallAppBar
|
|
792
|
+
* title="Inbox"
|
|
793
|
+
* navigationIcon={<IconButton aria-label="Go back"><Icon>arrow_back</Icon></IconButton>}
|
|
794
|
+
* actions={<IconButton aria-label="Search"><Icon>search</Icon></IconButton>}
|
|
795
|
+
* scrollBehavior="pinned"
|
|
796
|
+
* />
|
|
797
|
+
*
|
|
798
|
+
* // Center-aligned with subtitle
|
|
799
|
+
* <SmallAppBar
|
|
800
|
+
* title="Profile"
|
|
801
|
+
* subtitle="@username"
|
|
802
|
+
* titleAlignment="center"
|
|
803
|
+
* scrollBehavior="enterAlways"
|
|
804
|
+
* />
|
|
805
|
+
* ```
|
|
806
|
+
*/
|
|
807
|
+
declare function SmallAppBar({ title, subtitle, titleAlignment, navigationIcon, actions, colors, scrollBehavior, scrollElement, className, }: SmallAppBarProps): react_jsx_runtime.JSX.Element;
|
|
808
|
+
|
|
809
|
+
/** Color variant of the menu — standard (surface-based) or vibrant (tertiary-based). */
|
|
810
|
+
type MenuColorVariant = "standard" | "vibrant";
|
|
811
|
+
/** Visual variant of the menu. */
|
|
812
|
+
type MenuVariant = "baseline" | "expressive";
|
|
813
|
+
/**
|
|
814
|
+
* Which Radix primitive family drives this menu:
|
|
815
|
+
* - `dropdown` → @radix-ui/react-dropdown-menu (button, text field, icon trigger)
|
|
816
|
+
* - `context` → @radix-ui/react-context-menu (right-click / long-press trigger)
|
|
817
|
+
* - `static` → plain HTML via Slot (VerticalMenu — always-visible)
|
|
818
|
+
*/
|
|
819
|
+
type MenuPrimitive = "dropdown" | "context" | "static";
|
|
820
|
+
/**
|
|
821
|
+
* Position of a MenuItem within its group or menu.
|
|
822
|
+
* Controls the shape morphing (border-radius) applied to each item.
|
|
823
|
+
*
|
|
824
|
+
* - `leading` → first item: top corners rounded more (CornerMedium top, CornerExtraSmall bottom)
|
|
825
|
+
* - `middle` → middle items: CornerExtraSmall all corners
|
|
826
|
+
* - `trailing` → last item: bottom corners rounded more (CornerExtraSmall top, CornerMedium bottom)
|
|
827
|
+
* - `standalone` → only item in group: CornerExtraSmall (same as middle, but semantically distinct)
|
|
828
|
+
*/
|
|
829
|
+
type MenuItemPosition = "standalone" | "leading" | "middle" | "trailing";
|
|
830
|
+
/**
|
|
831
|
+
* Position of a MenuGroup within the popup container.
|
|
832
|
+
* Controls the container's border-radius shape morphing.
|
|
833
|
+
*/
|
|
834
|
+
type MenuGroupPosition = "standalone" | "leading" | "middle" | "trailing";
|
|
835
|
+
interface MenuProps {
|
|
836
|
+
/** Menu items and groups */
|
|
837
|
+
children: React$1.ReactNode;
|
|
838
|
+
/**
|
|
839
|
+
* Color variant of the menu.
|
|
840
|
+
* Only applies when `variant="expressive"`. Baseline menus always use baseline colors.
|
|
841
|
+
* - `standard`: surface-container-low background
|
|
842
|
+
* - `vibrant`: tertiary-container background (use sparingly, high emphasis)
|
|
843
|
+
*/
|
|
844
|
+
colorVariant?: MenuColorVariant;
|
|
845
|
+
/**
|
|
846
|
+
* Visual variant of the menu.
|
|
847
|
+
* - `baseline`: original M3 specs (4dp corners, no shape morphing)
|
|
848
|
+
* - `expressive`: M3 Expressive specs (shape morphing, rounded groups)
|
|
849
|
+
* @default "baseline"
|
|
850
|
+
*/
|
|
851
|
+
variant?: MenuVariant;
|
|
852
|
+
/**
|
|
853
|
+
* @deprecated Use `variant` instead. Will be removed in next major version.
|
|
854
|
+
*/
|
|
855
|
+
menuVariant?: MenuVariant;
|
|
856
|
+
/**
|
|
857
|
+
* Controlled open state. When provided, the menu acts as a controlled component.
|
|
858
|
+
* Pair with `onOpenChange` to manage state externally.
|
|
859
|
+
*/
|
|
860
|
+
open?: boolean;
|
|
861
|
+
/**
|
|
862
|
+
* Called when the menu's open state changes (both controlled and uncontrolled).
|
|
863
|
+
* Required when using `open` for controlled mode.
|
|
864
|
+
*/
|
|
865
|
+
onOpenChange?: (open: boolean) => void;
|
|
866
|
+
/** Additional className for the root element */
|
|
867
|
+
className?: string;
|
|
868
|
+
}
|
|
869
|
+
interface MenuTriggerProps {
|
|
870
|
+
children: React$1.ReactNode;
|
|
871
|
+
/** If true, merges props with the child element instead of wrapping */
|
|
872
|
+
asChild?: boolean;
|
|
873
|
+
className?: string;
|
|
874
|
+
}
|
|
875
|
+
interface MenuContentProps {
|
|
876
|
+
children: React$1.ReactNode;
|
|
877
|
+
/** Gap between menu and anchor in pixels. Default: 6 */
|
|
878
|
+
sideOffset?: number;
|
|
879
|
+
/** Preferred side of the anchor to render the menu. */
|
|
880
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
881
|
+
/** Preferred alignment relative to the anchor. */
|
|
882
|
+
align?: "start" | "center" | "end";
|
|
883
|
+
/**
|
|
884
|
+
* When true, disables overflow-hidden on the container so nested SubMenus
|
|
885
|
+
* can escape the bounds. Required when using SubMenu.
|
|
886
|
+
*/
|
|
887
|
+
hasOverflow?: boolean;
|
|
888
|
+
/** Override colorVariant from MenuContext (only for expressive variant) */
|
|
889
|
+
colorVariant?: MenuColorVariant;
|
|
890
|
+
/**
|
|
891
|
+
* Separation style between groups (only applies when variant="expressive").
|
|
892
|
+
* - `gap` → 2dp visual gap, transparent container
|
|
893
|
+
* - `divider` → solid container, no gap
|
|
894
|
+
* Default: "gap"
|
|
895
|
+
*/
|
|
896
|
+
separatorStyle?: VerticalMenuSeparatorStyle;
|
|
897
|
+
className?: string;
|
|
898
|
+
}
|
|
899
|
+
interface MenuItemProps {
|
|
900
|
+
/** Primary label text of the item */
|
|
901
|
+
children: React$1.ReactNode;
|
|
902
|
+
/** Callback when the item is clicked */
|
|
903
|
+
onClick?: React$1.MouseEventHandler<HTMLDivElement>;
|
|
904
|
+
/**
|
|
905
|
+
* Optional leading icon (20dp).
|
|
906
|
+
* For unselected state in selectable items; replaced by check icon when selected.
|
|
907
|
+
*/
|
|
908
|
+
leadingIcon?: React$1.ReactNode;
|
|
909
|
+
/** Optional trailing icon (20dp) or chevron for submenus */
|
|
910
|
+
trailingIcon?: React$1.ReactNode;
|
|
911
|
+
/** Supporting text below the primary label (body-medium) */
|
|
912
|
+
supportingText?: React$1.ReactNode;
|
|
913
|
+
/** Trailing keyboard shortcut text e.g. "Ctrl+C", "⌘C" */
|
|
914
|
+
trailingText?: string;
|
|
915
|
+
/**
|
|
916
|
+
* Whether this item is selected/checked.
|
|
917
|
+
* When true: shows check icon (leading slot) and applies selected container color.
|
|
918
|
+
* Overrides itemPosition shape with `rounded-m3-md`.
|
|
919
|
+
*/
|
|
920
|
+
selected?: boolean;
|
|
921
|
+
/** Whether this item is disabled */
|
|
922
|
+
disabled?: boolean;
|
|
923
|
+
/**
|
|
924
|
+
* Controls shape morphing based on position within its group.
|
|
925
|
+
* Automatically injected by MenuGroup via React.cloneElement when grouping is used.
|
|
926
|
+
*/
|
|
927
|
+
itemPosition?: MenuItemPosition;
|
|
928
|
+
/** Override colorVariant from MenuContext */
|
|
929
|
+
colorVariant?: MenuColorVariant;
|
|
930
|
+
/** If true, keeps the menu open after clicking (e.g. for multi-select items) */
|
|
931
|
+
keepOpen?: boolean;
|
|
932
|
+
className?: string;
|
|
933
|
+
/** Optional value for radio items. Required when role='menuitemradio'. */
|
|
934
|
+
value?: string;
|
|
935
|
+
/** Internal flag used by SubMenu to render this item as a SubTrigger primitive. */
|
|
936
|
+
isSubTrigger?: boolean;
|
|
937
|
+
/** ARIA role override. Defaults to 'menuitem', 'menuitemcheckbox', or 'menuitemradio' based on selected prop. */
|
|
938
|
+
role?: string;
|
|
939
|
+
}
|
|
940
|
+
interface MenuGroupProps {
|
|
941
|
+
/** MenuItem children — itemPosition is auto-injected */
|
|
942
|
+
children: React$1.ReactNode;
|
|
943
|
+
/**
|
|
944
|
+
* Optional label displayed at the top of the group.
|
|
945
|
+
* Uses labelLarge typography with 12dp horizontal padding.
|
|
946
|
+
*/
|
|
947
|
+
label?: string;
|
|
948
|
+
/**
|
|
949
|
+
* Zero-based index of this group in the parent menu.
|
|
950
|
+
* Used to determine shape (leading/middle/trailing/standalone).
|
|
951
|
+
* Auto-provided when using MenuContent's grouping utilities.
|
|
952
|
+
*/
|
|
953
|
+
index?: number;
|
|
954
|
+
/**
|
|
955
|
+
* Total number of groups in the parent menu.
|
|
956
|
+
* Used together with index to determine shape.
|
|
957
|
+
*/
|
|
958
|
+
count?: number;
|
|
959
|
+
/** Override colorVariant from MenuContext */
|
|
960
|
+
colorVariant?: MenuColorVariant;
|
|
961
|
+
/** Internal flag: true if rendered inside a gap-variant vertical menu (to adjust padding) */
|
|
962
|
+
isGapVariant?: boolean;
|
|
963
|
+
/** Optionally injected when nested inside another MenuGroup */
|
|
964
|
+
itemPosition?: MenuItemPosition;
|
|
965
|
+
className?: string;
|
|
966
|
+
}
|
|
967
|
+
interface MenuDividerProps {
|
|
968
|
+
className?: string;
|
|
969
|
+
}
|
|
970
|
+
interface SubMenuProps {
|
|
971
|
+
/** The SubMenu children (another MenuContent) */
|
|
972
|
+
children: React$1.ReactNode;
|
|
973
|
+
/** The trigger element (typically a MenuItem with trailing chevron) */
|
|
974
|
+
trigger: React$1.ReactNode;
|
|
975
|
+
/** Preferred side to open the submenu. Default: 'right' */
|
|
976
|
+
side?: "left" | "right";
|
|
977
|
+
/** Override colorVariant from MenuContext */
|
|
978
|
+
colorVariant?: MenuColorVariant;
|
|
979
|
+
/** Delay in ms before submenu opens on hover. Default: 200 */
|
|
980
|
+
hoverOpenDelay?: number;
|
|
981
|
+
/** Delay in ms before submenu closes on pointer-leave. Default: 300 */
|
|
982
|
+
hoverCloseDelay?: number;
|
|
983
|
+
}
|
|
984
|
+
/**
|
|
985
|
+
* How groups within a VerticalMenuContent are separated.
|
|
986
|
+
* - `gap` → 2dp gap between groups (SegmentedMenuTokens.SegmentedGap)
|
|
987
|
+
* - `divider` → outline-variant horizontal rule between groups (MenuDefaults.HorizontalDividerPadding)
|
|
988
|
+
*/
|
|
989
|
+
type VerticalMenuSeparatorStyle = "gap" | "divider";
|
|
990
|
+
/**
|
|
991
|
+
* Root of an always-visible vertical menu (no trigger, no popup).
|
|
992
|
+
* Provides `MenuContext` with `colorVariant` to all descendants.
|
|
993
|
+
*/
|
|
994
|
+
interface VerticalMenuProps {
|
|
995
|
+
children: React$1.ReactNode;
|
|
996
|
+
/**
|
|
997
|
+
* Color variant of the menu.
|
|
998
|
+
* - `standard`: surface-container-low background (default)
|
|
999
|
+
* - `vibrant`: tertiary-container background
|
|
1000
|
+
*/
|
|
1001
|
+
colorVariant?: MenuColorVariant;
|
|
1002
|
+
className?: string;
|
|
1003
|
+
}
|
|
1004
|
+
/**
|
|
1005
|
+
* Container that renders VerticalMenuGroup children in a vertical list.
|
|
1006
|
+
* Handles separator injection (gap or divider) and auto-injects `index`/`count` into groups.
|
|
1007
|
+
*/
|
|
1008
|
+
interface VerticalMenuContentProps {
|
|
1009
|
+
children: React$1.ReactNode;
|
|
1010
|
+
/**
|
|
1011
|
+
* Separation style between groups.
|
|
1012
|
+
* - `gap` → 2dp visual gap (default, matches MD3 Expressive spec image 1 left)
|
|
1013
|
+
* - `divider` → horizontal `outline-variant` rule (matches MD3 Expressive spec image 1 right)
|
|
1014
|
+
*/
|
|
1015
|
+
separatorStyle?: VerticalMenuSeparatorStyle;
|
|
1016
|
+
/** Override colorVariant from VerticalMenu root */
|
|
1017
|
+
colorVariant?: MenuColorVariant;
|
|
1018
|
+
className?: string;
|
|
1019
|
+
}
|
|
1020
|
+
/** A group within a VerticalMenu. Alias of MenuGroupProps. */
|
|
1021
|
+
interface VerticalMenuGroupProps extends MenuGroupProps {
|
|
1022
|
+
}
|
|
1023
|
+
/** A plain horizontal divider for use between groups in a VerticalMenuContent with `separatorStyle="divider"`. */
|
|
1024
|
+
interface VerticalMenuDividerProps {
|
|
1025
|
+
className?: string;
|
|
1026
|
+
/** Optionally injected by VerticalMenuContent */
|
|
1027
|
+
index?: number;
|
|
1028
|
+
/** Optionally injected by VerticalMenuContent */
|
|
1029
|
+
count?: number;
|
|
1030
|
+
/** Optionally injected by VerticalMenuContent */
|
|
1031
|
+
isGapVariant?: boolean;
|
|
1032
|
+
}
|
|
1033
|
+
/**
|
|
1034
|
+
* Root of a context menu (right-click / long-press triggered popup).
|
|
1035
|
+
*
|
|
1036
|
+
* Wraps @radix-ui/react-context-menu Root and provides MenuContext with
|
|
1037
|
+
* `menuPrimitive="context"` so MenuItem automatically uses ContextMenu primitives.
|
|
1038
|
+
*/
|
|
1039
|
+
interface ContextMenuProps {
|
|
1040
|
+
children: React$1.ReactNode;
|
|
1041
|
+
/**
|
|
1042
|
+
* Visual variant of the context menu.
|
|
1043
|
+
* - `baseline`: original M3 specs (4dp corners, no shape morphing)
|
|
1044
|
+
* - `expressive`: M3 Expressive specs (shape morphing, rounded groups)
|
|
1045
|
+
* @default "baseline"
|
|
1046
|
+
*/
|
|
1047
|
+
variant?: MenuVariant;
|
|
1048
|
+
/** Color variant. Only applies when `variant="expressive"`. */
|
|
1049
|
+
colorVariant?: MenuColorVariant;
|
|
1050
|
+
/** Additional className */
|
|
1051
|
+
className?: string;
|
|
1052
|
+
}
|
|
1053
|
+
interface ContextMenuTriggerProps {
|
|
1054
|
+
children: React$1.ReactNode;
|
|
1055
|
+
/** If true, merges props with the child element instead of wrapping */
|
|
1056
|
+
asChild?: boolean;
|
|
1057
|
+
className?: string;
|
|
1058
|
+
}
|
|
1059
|
+
interface ContextMenuContentProps {
|
|
1060
|
+
children: React$1.ReactNode;
|
|
1061
|
+
/** Override colorVariant from ContextMenuContext */
|
|
1062
|
+
colorVariant?: MenuColorVariant;
|
|
1063
|
+
/**
|
|
1064
|
+
* When true, disables overflow-hidden so nested SubMenus can escape bounds.
|
|
1065
|
+
* Required when using SubMenu inside ContextMenu.
|
|
1066
|
+
*/
|
|
1067
|
+
hasOverflow?: boolean;
|
|
1068
|
+
/**
|
|
1069
|
+
* Separation style between groups (only applies when variant="expressive").
|
|
1070
|
+
* - `gap` → 2dp visual gap, transparent container
|
|
1071
|
+
* - `divider` → solid container, no gap
|
|
1072
|
+
* Default: "gap"
|
|
1073
|
+
*/
|
|
1074
|
+
separatorStyle?: VerticalMenuSeparatorStyle;
|
|
1075
|
+
className?: string;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
/**
|
|
1079
|
+
* Root of a context menu (right-click / long-press triggered popup).
|
|
1080
|
+
*
|
|
1081
|
+
* Wraps `@radix-ui/react-context-menu` Root and provides `MenuContext` with
|
|
1082
|
+
* `menuPrimitive="context"` so nested `MenuItem` components automatically use
|
|
1083
|
+
* ContextMenu Radix primitives for correct accessibility and keyboard navigation.
|
|
1084
|
+
*
|
|
1085
|
+
* @example
|
|
1086
|
+
* // Baseline context menu
|
|
1087
|
+
* <ContextMenu variant="baseline">
|
|
1088
|
+
* <ContextMenuTrigger asChild>
|
|
1089
|
+
* <div>Right-click me</div>
|
|
1090
|
+
* </ContextMenuTrigger>
|
|
1091
|
+
* <ContextMenuContent>
|
|
1092
|
+
* <MenuItem>Copy</MenuItem>
|
|
1093
|
+
* <MenuItem>Paste</MenuItem>
|
|
1094
|
+
* </ContextMenuContent>
|
|
1095
|
+
* </ContextMenu>
|
|
1096
|
+
*
|
|
1097
|
+
* @example
|
|
1098
|
+
* // Expressive context menu with groups
|
|
1099
|
+
* <ContextMenu variant="expressive">
|
|
1100
|
+
* <ContextMenuTrigger asChild><canvas /></ContextMenuTrigger>
|
|
1101
|
+
* <ContextMenuContent>
|
|
1102
|
+
* <MenuGroup>
|
|
1103
|
+
* <MenuItem>Cut</MenuItem>
|
|
1104
|
+
* <MenuItem>Copy</MenuItem>
|
|
1105
|
+
* </MenuGroup>
|
|
1106
|
+
* <MenuGroup>
|
|
1107
|
+
* <MenuItem>Paste</MenuItem>
|
|
1108
|
+
* </MenuGroup>
|
|
1109
|
+
* </ContextMenuContent>
|
|
1110
|
+
* </ContextMenu>
|
|
1111
|
+
*/
|
|
1112
|
+
declare function ContextMenu({ children, variant, colorVariant, }: ContextMenuProps): react_jsx_runtime.JSX.Element;
|
|
1113
|
+
declare namespace ContextMenu {
|
|
1114
|
+
var displayName: string;
|
|
1115
|
+
}
|
|
1116
|
+
/**
|
|
1117
|
+
* The trigger area for a ContextMenu. Right-click (or long-press on touch)
|
|
1118
|
+
* within this area opens the context menu.
|
|
1119
|
+
*
|
|
1120
|
+
* Use `asChild` to apply trigger behavior to your own element without an
|
|
1121
|
+
* extra wrapper `<span>`.
|
|
1122
|
+
*/
|
|
1123
|
+
declare const ContextMenuTrigger: React$1.ForwardRefExoticComponent<ContextMenuTriggerProps & Omit<RxContextMenu.ContextMenuTriggerProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
1124
|
+
/**
|
|
1125
|
+
* The popup container for the context menu's contents.
|
|
1126
|
+
*
|
|
1127
|
+
* Renders into a portal via Radix. Uses Framer Motion `AnimatePresence` for
|
|
1128
|
+
* smooth enter/exit animations. Transform-origin is automatically set by
|
|
1129
|
+
* Radix via `--radix-context-menu-content-transform-origin`.
|
|
1130
|
+
*
|
|
1131
|
+
* Visual styling follows `variant` from `ContextMenuContext`:
|
|
1132
|
+
* - `baseline` → CornerExtraSmall (4px), standard M3 styling
|
|
1133
|
+
* - `expressive` → rounded-2xl, shape-morphing groups, elevation-2
|
|
1134
|
+
*
|
|
1135
|
+
* @param hasOverflow - Set true when using SubMenu to prevent clipping
|
|
1136
|
+
*/
|
|
1137
|
+
declare const ContextMenuContent: React$1.ForwardRefExoticComponent<ContextMenuContentProps & Omit<Omit<RxContextMenu.ContextMenuContentProps & React$1.RefAttributes<HTMLDivElement>, "ref">, "asChild"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1138
|
+
|
|
1139
|
+
/**
|
|
1140
|
+
* MD3 Expressive Menu root component.
|
|
1141
|
+
*
|
|
1142
|
+
* Wraps Radix `DropdownMenu.Root` and provides `MenuContext` with `colorVariant`
|
|
1143
|
+
* and `open` state to all descendant MenuItem and MenuGroup components.
|
|
1144
|
+
*
|
|
1145
|
+
* @example
|
|
1146
|
+
* <Menu colorVariant="standard">
|
|
1147
|
+
* <MenuTrigger asChild>
|
|
1148
|
+
* <IconButton name="more_vert" />
|
|
1149
|
+
* </MenuTrigger>
|
|
1150
|
+
* <MenuContent>
|
|
1151
|
+
* <MenuGroup index={0} count={2}>
|
|
1152
|
+
* <MenuItem>Cut</MenuItem>
|
|
1153
|
+
* <MenuItem>Copy</MenuItem>
|
|
1154
|
+
* </MenuGroup>
|
|
1155
|
+
* <MenuGroup index={1} count={2}>
|
|
1156
|
+
* <MenuItem>Paste</MenuItem>
|
|
1157
|
+
* </MenuGroup>
|
|
1158
|
+
* </MenuContent>
|
|
1159
|
+
* </Menu>
|
|
1160
|
+
*/
|
|
1161
|
+
declare function Menu({ children, variant, menuVariant, colorVariant, open: controlledOpen, onOpenChange: controlledOnOpenChange, defaultOpen, ...props }: MenuProps & Omit<React$1.ComponentPropsWithoutRef<typeof DropdownMenu.Root>, "children">): react_jsx_runtime.JSX.Element;
|
|
1162
|
+
declare namespace Menu {
|
|
1163
|
+
var displayName: string;
|
|
1164
|
+
}
|
|
1165
|
+
/**
|
|
1166
|
+
* The trigger element that opens/closes the Menu.
|
|
1167
|
+
*
|
|
1168
|
+
* Use `asChild` to merge trigger behavior with your own element (e.g. a Button or IconButton).
|
|
1169
|
+
*/
|
|
1170
|
+
declare const MenuTrigger: React$1.ForwardRefExoticComponent<MenuTriggerProps & Omit<DropdownMenu.DropdownMenuTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1171
|
+
/**
|
|
1172
|
+
* The popup container for the menu's contents.
|
|
1173
|
+
*
|
|
1174
|
+
* Renders into a portal. Uses Radix `forceMount` + Framer Motion `AnimatePresence`
|
|
1175
|
+
* so the exit animation (scale + opacity via FastEffects) plays before the portal
|
|
1176
|
+
* unmounts. The `open` state is read from `MenuContext`.
|
|
1177
|
+
*
|
|
1178
|
+
* Transform-origin is automatically set via the Radix CSS variable
|
|
1179
|
+
* `--radix-dropdown-menu-content-transform-origin`.
|
|
1180
|
+
*
|
|
1181
|
+
* @param hasOverflow - Set true when using SubMenu to prevent clipping
|
|
1182
|
+
*/
|
|
1183
|
+
declare const MenuContent: React$1.ForwardRefExoticComponent<MenuContentProps & Omit<Omit<DropdownMenu.DropdownMenuContentProps & React$1.RefAttributes<HTMLDivElement>, "ref">, "asChild"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1184
|
+
|
|
1185
|
+
/**
|
|
1186
|
+
* @file ui/shared/motion-tokens.ts
|
|
1187
|
+
*
|
|
1188
|
+
* Framer Motion spring presets derived from the official MD3 Expressive
|
|
1189
|
+
* motion physics system (May 2025).
|
|
1190
|
+
*
|
|
1191
|
+
* Usage hierarchy:
|
|
1192
|
+
* 1. Import a named preset (e.g. `FAST_SPATIAL_SPRING`) for convenience.
|
|
1193
|
+
* 2. Call `getMotionSpring(speed, type)` when you need to pick dynamically.
|
|
1194
|
+
* 3. Call `getMotionTransitionCSS(speed, type, scheme?)` for pure-CSS contexts.
|
|
1195
|
+
*
|
|
1196
|
+
* @see https://m3.material.io/styles/motion/overview/how-it-works
|
|
1197
|
+
* @see https://m3.material.io/styles/motion/overview/specs
|
|
1198
|
+
*/
|
|
1199
|
+
|
|
1200
|
+
/**
|
|
1201
|
+
* MD3 Expressive — Fast Spatial Spring
|
|
1202
|
+
* `md.sys.motion.spring.fast.spatial` (dampingRatio: 0.6, stiffness: 800)
|
|
1203
|
+
*
|
|
1204
|
+
* Use for: small components (buttons, switches, chips).
|
|
1205
|
+
* Has notable bounce/overshoot — feels snappy and expressive.
|
|
1206
|
+
*/
|
|
1207
|
+
declare const FAST_SPATIAL_SPRING: Transition;
|
|
1208
|
+
|
|
1209
|
+
/** FastEffects CSS-fallback transition — used for opacity/exit animations */
|
|
1210
|
+
declare const FAST_EFFECTS_TRANSITION: {
|
|
1211
|
+
readonly duration: 0.15;
|
|
1212
|
+
readonly ease: [number, number, number, number];
|
|
1213
|
+
};
|
|
1214
|
+
/**
|
|
1215
|
+
* Enter/exit animation for the menu popup container.
|
|
1216
|
+
* Scale from 0.8→1.0 with FastSpatial spring.
|
|
1217
|
+
* Transform-origin is driven by the Radix CSS variable
|
|
1218
|
+
* `--radix-dropdown-menu-content-transform-origin`.
|
|
1219
|
+
*/
|
|
1220
|
+
declare const MENU_CONTAINER_VARIANTS: Variants;
|
|
1221
|
+
/** Size of the check icon in px (20dp per SegmentedMenuTokens.ItemLeadingIconSize) */
|
|
1222
|
+
declare const MENU_CHECK_ICON_SIZE = 20;
|
|
1223
|
+
/**
|
|
1224
|
+
* Expand/collapse animation for the check icon that appears when a MenuItem is
|
|
1225
|
+
* selected. Uses horizontal expansion (width + marginInlineEnd) with FastSpatial.
|
|
1226
|
+
*
|
|
1227
|
+
* ONLY used for the animated check ↔ selectedIcon swap in selectable items.
|
|
1228
|
+
* Regular (static) leading icons should NOT use these variants.
|
|
1229
|
+
*/
|
|
1230
|
+
declare const CHECK_ICON_VARIANTS: Variants;
|
|
1231
|
+
/** SubMenu popup uses the same FastSpatial/FastEffects pattern as root menu */
|
|
1232
|
+
declare const SUBMENU_CONTAINER_VARIANTS: Variants;
|
|
1233
|
+
|
|
1234
|
+
interface MenuContextValue {
|
|
1235
|
+
/** Visual variant: baseline (M3 standard) or expressive (shape-morphing) */
|
|
1236
|
+
variant: MenuVariant;
|
|
1237
|
+
/** Color variant inherited by all children unless overridden */
|
|
1238
|
+
colorVariant: MenuColorVariant;
|
|
1239
|
+
/**
|
|
1240
|
+
* Which Radix primitive family drives this menu:
|
|
1241
|
+
* - "dropdown" → @radix-ui/react-dropdown-menu (button/field trigger)
|
|
1242
|
+
* - "context" → @radix-ui/react-context-menu (right-click trigger)
|
|
1243
|
+
* - "static" → plain HTML via Slot (VerticalMenu, always-visible)
|
|
1244
|
+
*/
|
|
1245
|
+
menuPrimitive: MenuPrimitive;
|
|
1246
|
+
/**
|
|
1247
|
+
* Whether the menu popup is currently open.
|
|
1248
|
+
* Used by MenuContent to drive AnimatePresence for exit animations.
|
|
1249
|
+
*/
|
|
1250
|
+
open: boolean;
|
|
1251
|
+
/** Setter forwarded from Menu root — kept in sync with Radix Root open state */
|
|
1252
|
+
onOpenChange: (open: boolean) => void;
|
|
1253
|
+
}
|
|
1254
|
+
interface MenuProviderProps {
|
|
1255
|
+
variant?: MenuVariant;
|
|
1256
|
+
colorVariant?: MenuColorVariant;
|
|
1257
|
+
menuPrimitive?: MenuPrimitive;
|
|
1258
|
+
open: boolean;
|
|
1259
|
+
onOpenChange: (open: boolean) => void;
|
|
1260
|
+
children: React$1.ReactNode;
|
|
1261
|
+
}
|
|
1262
|
+
declare function MenuProvider({ variant, colorVariant, menuPrimitive, open, onOpenChange, children, }: MenuProviderProps): react_jsx_runtime.JSX.Element;
|
|
1263
|
+
/**
|
|
1264
|
+
* Returns the nearest MenuContext value.
|
|
1265
|
+
* Safe to use outside a MenuProvider (returns default: baseline, dropdown, closed).
|
|
1266
|
+
*
|
|
1267
|
+
* Includes backward-compat shims:
|
|
1268
|
+
* - `menuVariant` → alias for `variant` (deprecated, will be removed)
|
|
1269
|
+
* - `isStatic` → `menuPrimitive === "static"`
|
|
1270
|
+
*/
|
|
1271
|
+
declare function useMenuContext(): MenuContextValue & {
|
|
1272
|
+
isStatic: boolean;
|
|
1273
|
+
menuVariant: MenuVariant;
|
|
1274
|
+
};
|
|
1275
|
+
|
|
1276
|
+
/**
|
|
1277
|
+
* A horizontal divider for use between MenuItems or MenuGroups.
|
|
1278
|
+
*
|
|
1279
|
+
* Uses traditional line-based separation (as opposed to the gap-based
|
|
1280
|
+
* separation in MenuGroup, which is the Expressive default).
|
|
1281
|
+
*
|
|
1282
|
+
* Spec: horizontal=12dp padding, vertical=2dp padding, `outline-variant` color.
|
|
1283
|
+
*
|
|
1284
|
+
* @example
|
|
1285
|
+
* <MenuContent>
|
|
1286
|
+
* <MenuItem>Cut</MenuItem>
|
|
1287
|
+
* <MenuDivider />
|
|
1288
|
+
* <MenuItem>Paste</MenuItem>
|
|
1289
|
+
* </MenuContent>
|
|
1290
|
+
*/
|
|
1291
|
+
declare const MenuDivider: React$1.ForwardRefExoticComponent<MenuDividerProps & React$1.RefAttributes<HTMLHRElement>>;
|
|
1292
|
+
|
|
1293
|
+
/**
|
|
1294
|
+
* A container that groups MenuItem elements with gap-based visual separation —
|
|
1295
|
+
* the defining feature of MD3 Expressive menus.
|
|
1296
|
+
*
|
|
1297
|
+
* Shape morphing: on hover, the container's border-radius transitions from the
|
|
1298
|
+
* "inactive" small shape to the "active" large shape via a FastSpatial spring.
|
|
1299
|
+
* The shape depends on the group's position (leading/middle/trailing/standalone).
|
|
1300
|
+
*
|
|
1301
|
+
* MenuItem children automatically receive `itemPosition` props based on their
|
|
1302
|
+
* index within the group.
|
|
1303
|
+
*
|
|
1304
|
+
* @example
|
|
1305
|
+
* <MenuContent>
|
|
1306
|
+
* <MenuGroup>
|
|
1307
|
+
* <MenuItem>Cut</MenuItem>
|
|
1308
|
+
* <MenuItem>Copy</MenuItem>
|
|
1309
|
+
* <MenuItem>Paste</MenuItem>
|
|
1310
|
+
* </MenuGroup>
|
|
1311
|
+
* <MenuGroup>
|
|
1312
|
+
* <MenuItem>Select All</MenuItem>
|
|
1313
|
+
* </MenuGroup>
|
|
1314
|
+
* </MenuContent>
|
|
1315
|
+
*/
|
|
1316
|
+
declare const MenuGroup: React$1.ForwardRefExoticComponent<MenuGroupProps & {
|
|
1317
|
+
[key: `data-${string}`]: string | undefined;
|
|
1318
|
+
id?: string;
|
|
1319
|
+
"aria-label"?: string;
|
|
1320
|
+
"aria-labelledby"?: string;
|
|
1321
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
1322
|
+
|
|
1323
|
+
/**
|
|
1324
|
+
* An interactive item within a Menu or MenuGroup.
|
|
1325
|
+
*
|
|
1326
|
+
* ### Shape morphing
|
|
1327
|
+
* `itemPosition` (auto-set by MenuGroup) controls border-radius. When `selected=true`,
|
|
1328
|
+
* shape overrides to `CornerMedium (12px)` with a CSS transition.
|
|
1329
|
+
*
|
|
1330
|
+
* ### Leading icon animation
|
|
1331
|
+
* - **Selectable items** (`selected` prop defined): `AnimatePresence` swaps between
|
|
1332
|
+
* a check icon and the user `leadingIcon` using FastSpatial expand + FastEffects fade.
|
|
1333
|
+
* - **Static items** (`selected` prop undefined): `leadingIcon` renders at fixed width
|
|
1334
|
+
* with no enter/exit animation (matches Android's static rendering).
|
|
1335
|
+
*
|
|
1336
|
+
* ### Selected state
|
|
1337
|
+
* Container color transitions with `transition-colors duration-150` (maps to
|
|
1338
|
+
* Android's `animateColorAsState` with `FastEffects` spec).
|
|
1339
|
+
*/
|
|
1340
|
+
declare const MenuItem: React$1.ForwardRefExoticComponent<MenuItemProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1341
|
+
|
|
1342
|
+
/** Min height for selectable items: 44dp (SegmentedMenuTokens.Item) */
|
|
1343
|
+
declare const MENU_ITEM_MIN_HEIGHT = "min-h-11";
|
|
1344
|
+
/** Min width of menu container: 112dp (DropdownMenuItemDefaultMinWidth) */
|
|
1345
|
+
declare const MENU_MIN_WIDTH = "min-w-28";
|
|
1346
|
+
/** Max width of menu container: 280dp (DropdownMenuItemDefaultMaxWidth) */
|
|
1347
|
+
declare const MENU_MAX_WIDTH = "max-w-70";
|
|
1348
|
+
/** Gap between MenuGroup segments: 2dp (SegmentedMenuTokens.SegmentedGap) */
|
|
1349
|
+
declare const MENU_GROUP_GAP = "gap-0.5";
|
|
1350
|
+
/** Leading icon size: 20dp (SegmentedMenuTokens.ItemLeadingIconSize) */
|
|
1351
|
+
declare const MENU_ICON_SIZE = 20;
|
|
1352
|
+
/**
|
|
1353
|
+
* Shape values for MenuGroup container (borderRadius CSS shorthand string).
|
|
1354
|
+
* Format: "topLeft topRight bottomRight bottomLeft"
|
|
1355
|
+
*
|
|
1356
|
+
* Source: MenuDefaults.kt groupShape() + SegmentedMenuTokens/ShapeTokens
|
|
1357
|
+
* - ContainerShape (standalone) = CornerLarge (16px) all corners
|
|
1358
|
+
* - InactiveContainerShape = CornerSmall (8px) all corners
|
|
1359
|
+
* - Leading group: topStart=CornerLarge, topEnd=CornerLarge, bottomStart=CornerSmall, bottomEnd=CornerSmall
|
|
1360
|
+
* - Middle group: GroupShape = CornerSmall (8px)
|
|
1361
|
+
* - Trailing group: topStart=CornerSmall, topEnd=CornerSmall, bottomStart=CornerLarge, bottomEnd=CornerLarge
|
|
1362
|
+
*/
|
|
1363
|
+
declare const GROUP_SHAPES: {
|
|
1364
|
+
/** Active standalone group shape: CornerLarge all corners (16px) */
|
|
1365
|
+
readonly standaloneActive: "16px";
|
|
1366
|
+
/**
|
|
1367
|
+
* Active leading group shape: top=CornerLarge(16px), bottom=CornerSmall(8px)
|
|
1368
|
+
* Source: SegmentedMenuTokens — LeadingContainerShape:
|
|
1369
|
+
* topStart=CornerLarge, topEnd=CornerLarge, bottomStart=CornerSmall, bottomEnd=CornerSmall
|
|
1370
|
+
*/
|
|
1371
|
+
readonly leadingActive: "16px 16px 8px 8px";
|
|
1372
|
+
/** Active middle group shape: CornerExtraSmall all corners (4px) */
|
|
1373
|
+
readonly middleActive: "4px";
|
|
1374
|
+
/**
|
|
1375
|
+
* Active trailing group shape: top=CornerSmall(8px), bottom=CornerLarge(16px)
|
|
1376
|
+
* Source: SegmentedMenuTokens — TrailingContainerShape:
|
|
1377
|
+
* topStart=CornerSmall, topEnd=CornerSmall, bottomStart=CornerLarge, bottomEnd=CornerLarge
|
|
1378
|
+
*/
|
|
1379
|
+
readonly trailingActive: "8px 8px 16px 16px";
|
|
1380
|
+
/** Inactive (default, pre-hover) shape for all groups: CornerExtraSmall (4px) */
|
|
1381
|
+
readonly inactive: "4px";
|
|
1382
|
+
};
|
|
1383
|
+
/**
|
|
1384
|
+
* Shape values for MenuItem (borderRadius CSS shorthand string).
|
|
1385
|
+
* Used as Tailwind classes via arbitrary values for static rendering.
|
|
1386
|
+
* Animated shape (selected ↔ unselected) is handled via `transition-[border-radius]`.
|
|
1387
|
+
*
|
|
1388
|
+
* Source: MenuDefaults.kt itemShape() + SegmentedMenuTokens/ShapeTokens
|
|
1389
|
+
* - leading item: topStart/topEnd=CornerMedium(12px), bottomStart/bottomEnd=CornerExtraSmall(4px)
|
|
1390
|
+
* - middle item: CornerExtraSmall all (ItemShape = 4px)
|
|
1391
|
+
* - trailing item: topStart/topEnd=CornerExtraSmall(4px), bottomStart/bottomEnd=CornerMedium(12px)
|
|
1392
|
+
* - standalone item: same as middle (ItemShape = 4px)
|
|
1393
|
+
* - selected (all positions): CornerMedium all (ItemSelectedShape = 12px)
|
|
1394
|
+
*/
|
|
1395
|
+
declare const ITEM_SHAPE_CLASSES: {
|
|
1396
|
+
readonly leading: "rounded-t-[12px] rounded-b-[4px]";
|
|
1397
|
+
readonly middle: "rounded-[4px]";
|
|
1398
|
+
readonly trailing: "rounded-t-[4px] rounded-b-[12px]";
|
|
1399
|
+
readonly standalone: "rounded-[4px]";
|
|
1400
|
+
readonly selected: "rounded-[12px]";
|
|
1401
|
+
};
|
|
1402
|
+
/**
|
|
1403
|
+
* Standard color variant tokens (SurfaceContainerLow-based).
|
|
1404
|
+
* Source: StandardMenuTokens.kt
|
|
1405
|
+
*
|
|
1406
|
+
* Container: SurfaceContainerLow
|
|
1407
|
+
* Text: OnSurface
|
|
1408
|
+
* Icons: OnSurfaceVariant
|
|
1409
|
+
* Selected container: TertiaryContainer
|
|
1410
|
+
* Selected text/icons: OnTertiaryContainer
|
|
1411
|
+
*/
|
|
1412
|
+
declare const STANDARD_COLORS: {
|
|
1413
|
+
/** Group/popup container background (StandardMenuTokens.ContainerColor) */
|
|
1414
|
+
readonly containerBg: "bg-m3-surface-container-low";
|
|
1415
|
+
/** Label text color (StandardMenuTokens.ItemLabelTextColor) */
|
|
1416
|
+
readonly labelText: "text-m3-on-surface";
|
|
1417
|
+
/** Leading/trailing icon color (StandardMenuTokens.ItemLeadingIconColor) */
|
|
1418
|
+
readonly iconColor: "text-m3-on-surface-variant";
|
|
1419
|
+
/** Supporting text below label (StandardMenuTokens.ItemSupportingTextColor) */
|
|
1420
|
+
readonly supportingTextColor: "text-m3-on-surface-variant";
|
|
1421
|
+
/** Trailing supporting text (StandardMenuTokens.ItemTrailingSupportingTextColor) */
|
|
1422
|
+
readonly trailingSupportingTextColor: "text-m3-on-surface-variant";
|
|
1423
|
+
/** Trailing icon color (StandardMenuTokens.ItemTrailingIconColor) */
|
|
1424
|
+
readonly trailingIconColor: "text-m3-on-surface-variant";
|
|
1425
|
+
/** Hover state layer (OnSurface @ 8% opacity) */
|
|
1426
|
+
readonly hoverLayer: "hover:bg-m3-on-surface/8";
|
|
1427
|
+
/** Focus state layer (OnSurface @ 12% opacity) */
|
|
1428
|
+
readonly focusLayer: "focus:bg-m3-on-surface/12";
|
|
1429
|
+
/** Selected item background (StandardMenuTokens.ItemSelectedContainerColor) */
|
|
1430
|
+
readonly selectedBg: "bg-m3-tertiary-container";
|
|
1431
|
+
/** Selected item text (StandardMenuTokens.ItemSelectedLabelTextColor) */
|
|
1432
|
+
readonly selectedText: "text-m3-on-tertiary-container";
|
|
1433
|
+
/** Selected item icon (StandardMenuTokens.ItemSelectedLeadingIconColor) */
|
|
1434
|
+
readonly selectedIcon: "text-m3-on-tertiary-container";
|
|
1435
|
+
/** Disabled opacity: 38% (StandardMenuTokens.ItemDisabledLabelTextOpacity) */
|
|
1436
|
+
readonly disabledOpacity: "data-disabled:opacity-[0.38]";
|
|
1437
|
+
};
|
|
1438
|
+
/**
|
|
1439
|
+
* Vibrant color variant tokens (TertiaryContainer-based).
|
|
1440
|
+
* Source: VibrantMenuTokens.kt
|
|
1441
|
+
*
|
|
1442
|
+
* Container: TertiaryContainer
|
|
1443
|
+
* Text: OnTertiaryContainer
|
|
1444
|
+
* Icons: OnTertiaryContainer
|
|
1445
|
+
* Selected container: Tertiary
|
|
1446
|
+
* Selected text/icons: OnTertiary
|
|
1447
|
+
*/
|
|
1448
|
+
declare const VIBRANT_COLORS: {
|
|
1449
|
+
/** Group/popup container background (VibrantMenuTokens.ContainerColor) */
|
|
1450
|
+
readonly containerBg: "bg-m3-tertiary-container";
|
|
1451
|
+
/** Label text color (VibrantMenuTokens.ItemLabelTextColor) */
|
|
1452
|
+
readonly labelText: "text-m3-on-tertiary-container";
|
|
1453
|
+
/** Leading/trailing icon color (VibrantMenuTokens.ItemLeadingIconColor) */
|
|
1454
|
+
readonly iconColor: "text-m3-on-tertiary-container";
|
|
1455
|
+
/** Supporting text below label (VibrantMenuTokens.ItemSupportingTextColor) */
|
|
1456
|
+
readonly supportingTextColor: "text-m3-on-tertiary-container";
|
|
1457
|
+
/** Trailing supporting text (VibrantMenuTokens.ItemTrailingSupportingTextColor) */
|
|
1458
|
+
readonly trailingSupportingTextColor: "text-m3-on-tertiary-container";
|
|
1459
|
+
/** Trailing icon color (VibrantMenuTokens.ItemTrailingIconColor) */
|
|
1460
|
+
readonly trailingIconColor: "text-m3-on-tertiary-container";
|
|
1461
|
+
/** Hover state layer (OnTertiaryContainer @ 8% opacity) */
|
|
1462
|
+
readonly hoverLayer: "hover:bg-m3-on-tertiary-container/8";
|
|
1463
|
+
/** Focus state layer (OnTertiaryContainer @ 12% opacity) */
|
|
1464
|
+
readonly focusLayer: "focus:bg-m3-on-tertiary-container/12";
|
|
1465
|
+
/** Selected item background (VibrantMenuTokens.ItemSelectedContainerColor = Tertiary) */
|
|
1466
|
+
readonly selectedBg: "bg-m3-tertiary";
|
|
1467
|
+
/** Selected item text (VibrantMenuTokens.ItemSelectedLabelTextColor = OnTertiary) */
|
|
1468
|
+
readonly selectedText: "text-m3-on-tertiary";
|
|
1469
|
+
/** Selected item icon (VibrantMenuTokens.ItemSelectedLeadingIconColor = OnTertiary) */
|
|
1470
|
+
readonly selectedIcon: "text-m3-on-tertiary";
|
|
1471
|
+
/** Disabled opacity: 38% (VibrantMenuTokens.ItemDisabledLabelTextOpacity) */
|
|
1472
|
+
readonly disabledOpacity: "data-disabled:opacity-[0.38]";
|
|
1473
|
+
};
|
|
1474
|
+
/**
|
|
1475
|
+
* HorizontalDivider padding: horizontal=12dp, vertical=2dp.
|
|
1476
|
+
* Source: MenuDefaults.HorizontalDividerPadding
|
|
1477
|
+
*/
|
|
1478
|
+
declare const DIVIDER_PADDING = "mx-3 my-0.5";
|
|
1479
|
+
declare const DIVIDER_COLOR = "bg-m3-outline-variant";
|
|
1480
|
+
|
|
1481
|
+
/**
|
|
1482
|
+
* A nested SubMenu that opens from a trigger MenuItem.
|
|
1483
|
+
*
|
|
1484
|
+
* Keyboard: ArrowRight opens, ArrowLeft/Escape closes (handled by Radix).
|
|
1485
|
+
* The parent MenuContent should set `hasOverflow={true}` when SubMenus are used.
|
|
1486
|
+
*
|
|
1487
|
+
* ### Hover delays
|
|
1488
|
+
* `hoverOpenDelay` (default: 200ms) — time before the submenu opens on hover.
|
|
1489
|
+
* `hoverCloseDelay` (default: 300ms) — time before the submenu closes after pointer-leave.
|
|
1490
|
+
* These delays allow the user to safely move diagonally from trigger to submenu content
|
|
1491
|
+
* without accidental close (safe polygon behavior from Radix still applies).
|
|
1492
|
+
*
|
|
1493
|
+
* @example
|
|
1494
|
+
* <MenuContent hasOverflow>
|
|
1495
|
+
* <SubMenu
|
|
1496
|
+
* trigger={
|
|
1497
|
+
* <MenuItem trailingIcon={<Icon name="chevron_right" size={20} />}>
|
|
1498
|
+
* Share
|
|
1499
|
+
* </MenuItem>
|
|
1500
|
+
* }
|
|
1501
|
+
* >
|
|
1502
|
+
* <MenuItem>Via Email</MenuItem>
|
|
1503
|
+
* <MenuItem>Via Link</MenuItem>
|
|
1504
|
+
* </SubMenu>
|
|
1505
|
+
* </MenuContent>
|
|
1506
|
+
*/
|
|
1507
|
+
declare function SubMenu({ children, trigger, side, colorVariant: propColorVariant, hoverOpenDelay, hoverCloseDelay, }: SubMenuProps): react_jsx_runtime.JSX.Element;
|
|
1508
|
+
declare namespace SubMenu {
|
|
1509
|
+
var displayName: string;
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
/**
|
|
1513
|
+
* A plain horizontal divider for use between groups in a VerticalMenuContent
|
|
1514
|
+
* with `separatorStyle="divider"`.
|
|
1515
|
+
*
|
|
1516
|
+
* Uses the same visual spec as MenuDivider (outline-variant color, 12dp
|
|
1517
|
+
* horizontal padding, 2dp vertical padding) but is a plain `<hr>` — no Radix
|
|
1518
|
+
* dependency, safe inside static (non-popup) contexts.
|
|
1519
|
+
*
|
|
1520
|
+
* @example
|
|
1521
|
+
* <VerticalMenuContent separatorStyle="divider">
|
|
1522
|
+
* <VerticalMenuGroup>...</VerticalMenuGroup>
|
|
1523
|
+
* <VerticalMenuDivider />
|
|
1524
|
+
* <VerticalMenuGroup>...</VerticalMenuGroup>
|
|
1525
|
+
* </VerticalMenuContent>
|
|
1526
|
+
*/
|
|
1527
|
+
declare const VerticalMenuDivider: React$1.ForwardRefExoticComponent<VerticalMenuDividerProps & React$1.HTMLAttributes<HTMLHRElement> & React$1.RefAttributes<HTMLHRElement>>;
|
|
1528
|
+
/**
|
|
1529
|
+
* A group within a VerticalMenu.
|
|
1530
|
+
*
|
|
1531
|
+
* Functionally identical to `MenuGroup` — shape morphing on hover, auto-injected
|
|
1532
|
+
* `itemPosition` into MenuItem children, `colorVariant` from context.
|
|
1533
|
+
*
|
|
1534
|
+
* This component is a named re-export of `MenuGroup` so consumers of Vertical
|
|
1535
|
+
* Menu have a semantically clear API without any code duplication.
|
|
1536
|
+
*/
|
|
1537
|
+
declare const VerticalMenuGroup: React$1.ForwardRefExoticComponent<MenuGroupProps & {
|
|
1538
|
+
[key: `data-${string}`]: string | undefined;
|
|
1539
|
+
id?: string;
|
|
1540
|
+
"aria-label"?: string;
|
|
1541
|
+
"aria-labelledby"?: string;
|
|
1542
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
1543
|
+
/**
|
|
1544
|
+
* Renders a vertical list of VerticalMenuGroup children.
|
|
1545
|
+
*
|
|
1546
|
+
* Handles two separation styles:
|
|
1547
|
+
* - `gap` → 2dp (`gap-0.5`) visual gap between groups (default)
|
|
1548
|
+
* - `divider` → auto-inserts a `VerticalMenuDivider` between each pair of groups
|
|
1549
|
+
*
|
|
1550
|
+
* Auto-injects `index` and `count` props into VerticalMenuGroup children so
|
|
1551
|
+
* that position-based shape morphing (leading/middle/trailing) works correctly.
|
|
1552
|
+
*
|
|
1553
|
+
* @example
|
|
1554
|
+
* // Gap variant (default)
|
|
1555
|
+
* <VerticalMenuContent separatorStyle="gap">
|
|
1556
|
+
* <VerticalMenuGroup>...</VerticalMenuGroup>
|
|
1557
|
+
* <VerticalMenuGroup>...</VerticalMenuGroup>
|
|
1558
|
+
* </VerticalMenuContent>
|
|
1559
|
+
*
|
|
1560
|
+
* @example
|
|
1561
|
+
* // Divider variant
|
|
1562
|
+
* <VerticalMenuContent separatorStyle="divider">
|
|
1563
|
+
* <VerticalMenuGroup>...</VerticalMenuGroup>
|
|
1564
|
+
* <VerticalMenuGroup>...</VerticalMenuGroup>
|
|
1565
|
+
* </VerticalMenuContent>
|
|
1566
|
+
*/
|
|
1567
|
+
declare const VerticalMenuContent: React$1.ForwardRefExoticComponent<VerticalMenuContentProps & React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1568
|
+
/**
|
|
1569
|
+
* Root of an always-visible vertical menu.
|
|
1570
|
+
*
|
|
1571
|
+
* Wraps children in `MenuProvider` (always `open={true}`) so MenuItem and
|
|
1572
|
+
* MenuGroup components receive the correct `colorVariant` from context.
|
|
1573
|
+
*
|
|
1574
|
+
* Unlike the popup `Menu` component, there is no Radix DropdownMenu, no portal,
|
|
1575
|
+
* and no enter/exit animation — the list is statically rendered at all times.
|
|
1576
|
+
*
|
|
1577
|
+
* ### Shape morphing
|
|
1578
|
+
* For the **gap variant**, the outer container has NO `overflow-hidden` — this is
|
|
1579
|
+
* intentional! Each `VerticalMenuGroup` manages its own shape via Framer Motion's
|
|
1580
|
+
* `animate.borderRadius`. `overflow-hidden` on the parent would clip these
|
|
1581
|
+
* morphing corners. The 2dp transparent gap lets page background show through.
|
|
1582
|
+
*
|
|
1583
|
+
* For the **divider variant**, the outer container applies `overflow-hidden` +
|
|
1584
|
+
* `rounded-2xl` + background — groups sit flush inside without morphing.
|
|
1585
|
+
*
|
|
1586
|
+
* @example
|
|
1587
|
+
* // Vertical Menu with Gap (floating segments)
|
|
1588
|
+
* <VerticalMenu colorVariant="standard">
|
|
1589
|
+
* <VerticalMenuContent separatorStyle="gap">
|
|
1590
|
+
* <VerticalMenuGroup>
|
|
1591
|
+
* <MenuItem leadingIcon={<Icon name="visibility" size={20} />}>Item 1</MenuItem>
|
|
1592
|
+
* <MenuItem leadingIcon={<Icon name="content_copy" size={20} />} trailingText="⌘C">Item 2</MenuItem>
|
|
1593
|
+
* <MenuItem selected leadingIcon={<Icon name="edit" size={20} />}>Item 3</MenuItem>
|
|
1594
|
+
* </VerticalMenuGroup>
|
|
1595
|
+
* <VerticalMenuGroup>
|
|
1596
|
+
* <MenuItem trailingIcon={<Icon name="chevron_right" size={20} />}>Item 4</MenuItem>
|
|
1597
|
+
* </VerticalMenuGroup>
|
|
1598
|
+
* </VerticalMenuContent>
|
|
1599
|
+
* </VerticalMenu>
|
|
1600
|
+
*
|
|
1601
|
+
* @example
|
|
1602
|
+
* // Vertical Menu with Divider
|
|
1603
|
+
* <VerticalMenu colorVariant="standard">
|
|
1604
|
+
* <VerticalMenuContent separatorStyle="divider">
|
|
1605
|
+
* <VerticalMenuGroup>...</VerticalMenuGroup>
|
|
1606
|
+
* <VerticalMenuGroup>...</VerticalMenuGroup>
|
|
1607
|
+
* </VerticalMenuContent>
|
|
1608
|
+
* </VerticalMenu>
|
|
1609
|
+
*/
|
|
1610
|
+
declare const VerticalMenu: React$1.ForwardRefExoticComponent<VerticalMenuProps & React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1611
|
+
|
|
1612
|
+
/**
|
|
1613
|
+
* Layout styling for navigation bar items.
|
|
1614
|
+
* - vertical: Icon above label (default for mobile)
|
|
1615
|
+
* - horizontal: Icon beside label (forced)
|
|
1616
|
+
*/
|
|
1617
|
+
type NavigationBarItemLayout = "vertical" | "horizontal";
|
|
1618
|
+
/**
|
|
1619
|
+
* Visual variant of the Navigation Bar.
|
|
1620
|
+
* - flexible: Default MD3 behavior (h-16), becomes horizontal on desktop.
|
|
1621
|
+
* - baseline: Taller MD3 behavior (h-20), always vertical.
|
|
1622
|
+
* - xr: Floating orbiter variant for spatial interfaces (detached from bottom).
|
|
1623
|
+
*/
|
|
1624
|
+
type NavigationBarVariant = "flexible" | "baseline" | "xr";
|
|
1625
|
+
interface NavigationBarItemProps {
|
|
1626
|
+
selected: boolean;
|
|
1627
|
+
icon: React$1.ReactNode;
|
|
1628
|
+
label: React$1.ReactNode;
|
|
1629
|
+
onClick?: () => void;
|
|
1630
|
+
disabled?: boolean;
|
|
1631
|
+
badge?: React$1.ReactNode;
|
|
1632
|
+
"aria-label"?: string;
|
|
1633
|
+
className?: string;
|
|
1634
|
+
}
|
|
1635
|
+
interface NavigationBarProps {
|
|
1636
|
+
/** Visual variant of the Navigation Bar */
|
|
1637
|
+
variant?: NavigationBarVariant;
|
|
1638
|
+
/** Forces a specific item layout (horizontal/vertical) */
|
|
1639
|
+
itemLayout?: NavigationBarItemLayout;
|
|
1640
|
+
/** Whether the bar should hide when scrolling down */
|
|
1641
|
+
hideOnScroll?: boolean;
|
|
1642
|
+
/** Whether the bar should have an elevation shadow */
|
|
1643
|
+
elevated?: boolean;
|
|
1644
|
+
/** Whether the bar is fixed to the viewport (default) or absolute */
|
|
1645
|
+
fixed?: boolean;
|
|
1646
|
+
/** Container ref to track scrolling for hideOnScroll */
|
|
1647
|
+
scrollContainerRef?: React$1.RefObject<HTMLElement | null>;
|
|
1648
|
+
/** Transition for the active indicator pill */
|
|
1649
|
+
activeIndicatorTransition?: Transition;
|
|
1650
|
+
/** Navigation items */
|
|
1651
|
+
children: React$1.ReactNode;
|
|
1652
|
+
/** Optional additional classes */
|
|
1653
|
+
className?: string;
|
|
1654
|
+
/** Optional inline styles */
|
|
1655
|
+
style?: React$1.CSSProperties;
|
|
1656
|
+
}
|
|
1657
|
+
declare const NavigationBarItem: React$1.NamedExoticComponent<NavigationBarItemProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1658
|
+
declare const NavigationBarComponent: React$1.ForwardRefExoticComponent<NavigationBarProps & React$1.RefAttributes<HTMLElement>>;
|
|
1659
|
+
declare const NavigationBar: React$1.NamedExoticComponent<NavigationBarProps & React$1.RefAttributes<HTMLElement>>;
|
|
1660
|
+
|
|
1661
|
+
type NavigationRailVariant = "collapsed" | "expanded" | "modal" | "xr";
|
|
1662
|
+
type NavigationRailLabelVisibility = "labeled" | "auto" | "unlabeled";
|
|
1663
|
+
interface NavigationRailItemProps {
|
|
1664
|
+
selected: boolean;
|
|
1665
|
+
icon: React$1.ReactNode;
|
|
1666
|
+
label?: React$1.ReactNode;
|
|
1667
|
+
onClick?: () => void;
|
|
1668
|
+
disabled?: boolean;
|
|
1669
|
+
badge?: React$1.ReactNode;
|
|
1670
|
+
"aria-label"?: string;
|
|
1671
|
+
className?: string;
|
|
1672
|
+
}
|
|
1673
|
+
interface NavigationRailProps {
|
|
1674
|
+
variant?: NavigationRailVariant;
|
|
1675
|
+
labelVisibility?: NavigationRailLabelVisibility;
|
|
1676
|
+
header?: React$1.ReactNode;
|
|
1677
|
+
fab?: React$1.ReactNode;
|
|
1678
|
+
fabPlacement?: "contained" | "spatialized";
|
|
1679
|
+
footer?: React$1.ReactNode;
|
|
1680
|
+
narrow?: boolean;
|
|
1681
|
+
open?: boolean;
|
|
1682
|
+
onClose?: () => void;
|
|
1683
|
+
activeIndicatorTransition?: Transition;
|
|
1684
|
+
children: React$1.ReactNode;
|
|
1685
|
+
className?: string;
|
|
1686
|
+
style?: React$1.CSSProperties;
|
|
1687
|
+
}
|
|
1688
|
+
declare const NavigationRailItem: React$1.NamedExoticComponent<NavigationRailItemProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1689
|
+
declare const NavigationRail: React$1.NamedExoticComponent<NavigationRailProps & React$1.RefAttributes<HTMLElement>>;
|
|
1690
|
+
|
|
1691
|
+
/**
|
|
1692
|
+
* @file search.types.ts
|
|
1693
|
+
* MD3 Expressive Search — TypeScript prop definitions.
|
|
1694
|
+
* Spec: https://m3.material.io/components/search/overview
|
|
1695
|
+
* Reference: docs/m3/search/SearchBar.kt (MD3 Expressive)
|
|
1696
|
+
*/
|
|
1697
|
+
|
|
1698
|
+
/**
|
|
1699
|
+
* Display variant for the expanded SearchView.
|
|
1700
|
+
*
|
|
1701
|
+
* - `docked`: Popup dropdown below the SearchBar. For medium/large screens.
|
|
1702
|
+
* - `fullscreen`: Full-screen dialog overlay. For compact/mobile screens.
|
|
1703
|
+
*/
|
|
1704
|
+
type SearchVariant = "docked" | "fullscreen";
|
|
1705
|
+
/**
|
|
1706
|
+
* Visual style type for the SearchView.
|
|
1707
|
+
*
|
|
1708
|
+
* - `contained`: No divider between the input area and results.
|
|
1709
|
+
* The container background is preserved continuously (recommended).
|
|
1710
|
+
* - `divided`: A HorizontalDivider separates the input area from results.
|
|
1711
|
+
*/
|
|
1712
|
+
type SearchStyleType = "contained" | "divided";
|
|
1713
|
+
/**
|
|
1714
|
+
* Internal props shared between SearchBar and SearchView sub-components.
|
|
1715
|
+
* Not part of the public API.
|
|
1716
|
+
* @internal
|
|
1717
|
+
*/
|
|
1718
|
+
interface SearchInternalProps {
|
|
1719
|
+
/** Unique ID generated by useId(), used as Framer Motion layoutId. */
|
|
1720
|
+
searchId: string;
|
|
1721
|
+
/** Unique ID for the results listbox, used for aria-controls. */
|
|
1722
|
+
listboxId: string;
|
|
1723
|
+
}
|
|
1724
|
+
/**
|
|
1725
|
+
* Props for the `<Search>` component (orchestrator).
|
|
1726
|
+
*
|
|
1727
|
+
* @example
|
|
1728
|
+
* ```tsx
|
|
1729
|
+
* const [query, setQuery] = useState("");
|
|
1730
|
+
* const [active, setActive] = useState(false);
|
|
1731
|
+
*
|
|
1732
|
+
* <Search
|
|
1733
|
+
* query={query}
|
|
1734
|
+
* onQueryChange={setQuery}
|
|
1735
|
+
* onSearch={(q) => console.log("search:", q)}
|
|
1736
|
+
* active={active}
|
|
1737
|
+
* onActiveChange={setActive}
|
|
1738
|
+
* variant="docked"
|
|
1739
|
+
* styleType="contained"
|
|
1740
|
+
* >
|
|
1741
|
+
* <SearchResultsList />
|
|
1742
|
+
* </Search>
|
|
1743
|
+
* ```
|
|
1744
|
+
*/
|
|
1745
|
+
interface SearchProps {
|
|
1746
|
+
/** Current search query value (controlled). */
|
|
1747
|
+
query: string;
|
|
1748
|
+
/** Called when user types in the search input. */
|
|
1749
|
+
onQueryChange: (query: string) => void;
|
|
1750
|
+
/** Called when user submits search (Enter key or suggestion click). */
|
|
1751
|
+
onSearch: (query: string) => void;
|
|
1752
|
+
/** Whether the SearchView is expanded/open (controlled). */
|
|
1753
|
+
active: boolean;
|
|
1754
|
+
/** Called when the Search open/close state should change. */
|
|
1755
|
+
onActiveChange: (active: boolean) => void;
|
|
1756
|
+
/**
|
|
1757
|
+
* Display variant for the expanded state.
|
|
1758
|
+
* @default "docked"
|
|
1759
|
+
*/
|
|
1760
|
+
variant?: SearchVariant;
|
|
1761
|
+
/**
|
|
1762
|
+
* Visual style for the SearchView container.
|
|
1763
|
+
* @default "contained"
|
|
1764
|
+
*/
|
|
1765
|
+
styleType?: SearchStyleType;
|
|
1766
|
+
/**
|
|
1767
|
+
* Whether to add a 2dp gap between the input header and the results list.
|
|
1768
|
+
* Only applies when `variant="docked"`.
|
|
1769
|
+
* @default false
|
|
1770
|
+
*/
|
|
1771
|
+
hasGap?: boolean;
|
|
1772
|
+
/**
|
|
1773
|
+
* Icon rendered at the leading edge of the search input.
|
|
1774
|
+
* Defaults to a built-in search icon.
|
|
1775
|
+
*/
|
|
1776
|
+
leadingIcon?: React$1.ReactNode;
|
|
1777
|
+
/**
|
|
1778
|
+
* Icon or action rendered at the trailing edge of the search input.
|
|
1779
|
+
* Common examples: mic, camera, QR code.
|
|
1780
|
+
*/
|
|
1781
|
+
trailingIcon?: React$1.ReactNode;
|
|
1782
|
+
/** Placeholder text shown when the input is empty. @default "Search" */
|
|
1783
|
+
placeholder?: string;
|
|
1784
|
+
/**
|
|
1785
|
+
* Align the placeholder text to left, center, or right.
|
|
1786
|
+
* Typed text will always remain left-aligned.
|
|
1787
|
+
* @default "left"
|
|
1788
|
+
*/
|
|
1789
|
+
textAlign?: "left" | "center" | "right";
|
|
1790
|
+
/**
|
|
1791
|
+
* Search results or suggestions rendered inside the SearchView.
|
|
1792
|
+
* Use `role="option"` on each item for accessibility.
|
|
1793
|
+
*/
|
|
1794
|
+
children?: React$1.ReactNode;
|
|
1795
|
+
/**
|
|
1796
|
+
* Override the auto-generated input element ID.
|
|
1797
|
+
* Auto-generated via React.useId() if not provided.
|
|
1798
|
+
*/
|
|
1799
|
+
id?: string;
|
|
1800
|
+
/**
|
|
1801
|
+
* Accessible label for the search landmark.
|
|
1802
|
+
* @default "Search"
|
|
1803
|
+
*/
|
|
1804
|
+
"aria-label"?: string;
|
|
1805
|
+
/** Additional CSS classes for the SearchBar root element. */
|
|
1806
|
+
className?: string;
|
|
1807
|
+
/** Additional CSS classes for the SearchView container. */
|
|
1808
|
+
viewClassName?: string;
|
|
1809
|
+
}
|
|
1810
|
+
/**
|
|
1811
|
+
* Return type for `useSearchKeyboard`.
|
|
1812
|
+
* @internal
|
|
1813
|
+
*/
|
|
1814
|
+
interface UseSearchKeyboardReturn {
|
|
1815
|
+
/** Currently highlighted suggestion index. -1 = none. */
|
|
1816
|
+
activeIndex: number;
|
|
1817
|
+
/** KeyDown handler — attach to the search input. */
|
|
1818
|
+
handleKeyDown: (e: React$1.KeyboardEvent) => void;
|
|
1819
|
+
/** Reset activeIndex (e.g., when query changes). */
|
|
1820
|
+
resetActiveIndex: () => void;
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
/**
|
|
1824
|
+
* @file use-search-keyboard.ts
|
|
1825
|
+
* Keyboard navigation hook for the MD3 Search component.
|
|
1826
|
+
*
|
|
1827
|
+
* Handles:
|
|
1828
|
+
* - ArrowDown / ArrowUp → navigate through suggestions (role="option")
|
|
1829
|
+
* - Enter → submit search or select active suggestion
|
|
1830
|
+
* - Escape → close the SearchView
|
|
1831
|
+
*/
|
|
1832
|
+
|
|
1833
|
+
interface UseSearchKeyboardOptions {
|
|
1834
|
+
/** Whether the SearchView is currently open. */
|
|
1835
|
+
active: boolean;
|
|
1836
|
+
/** Callback to close the SearchView. */
|
|
1837
|
+
onActiveChange: (active: boolean) => void;
|
|
1838
|
+
/** Callback for search submission. */
|
|
1839
|
+
onSearch: (query: string) => void;
|
|
1840
|
+
/** Current search query. */
|
|
1841
|
+
query: string;
|
|
1842
|
+
/** Total number of suggestion items in the listbox. */
|
|
1843
|
+
itemCount: number;
|
|
1844
|
+
/** Called when user selects a specific suggestion by index. */
|
|
1845
|
+
onSelectSuggestion?: (index: number) => void;
|
|
1846
|
+
}
|
|
1847
|
+
/**
|
|
1848
|
+
* Manages keyboard navigation for the Search component.
|
|
1849
|
+
*
|
|
1850
|
+
* Complies with WAI-ARIA Combobox pattern:
|
|
1851
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/combobox/
|
|
1852
|
+
*/
|
|
1853
|
+
declare function useSearchKeyboard({ active, onActiveChange, onSearch, query, itemCount, onSelectSuggestion, }: UseSearchKeyboardOptions): UseSearchKeyboardReturn;
|
|
1854
|
+
|
|
1855
|
+
/**
|
|
1856
|
+
* MD3 Expressive Search Context
|
|
1857
|
+
* Shared state for the Search orchestrator and its children.
|
|
1858
|
+
*/
|
|
1859
|
+
interface SearchContextValue {
|
|
1860
|
+
/** Unique ID for the results listbox, used for aria-controls. */
|
|
1861
|
+
listboxId: string;
|
|
1862
|
+
/** Currently highlighted suggestion index. -1 = none. */
|
|
1863
|
+
activeIndex: number;
|
|
1864
|
+
}
|
|
1865
|
+
/**
|
|
1866
|
+
* Hook to access Search state from children (e.g., search items).
|
|
1867
|
+
*/
|
|
1868
|
+
declare function useSearch(): SearchContextValue;
|
|
1869
|
+
|
|
1870
|
+
/**
|
|
1871
|
+
* MD3 Expressive Search — Orchestrator component.
|
|
1872
|
+
*
|
|
1873
|
+
* Renders a SearchBar (collapsed pill) and the appropriate SearchView
|
|
1874
|
+
* (docked popup or fullscreen overlay) based on `variant`.
|
|
1875
|
+
*
|
|
1876
|
+
* The component is fully controlled:
|
|
1877
|
+
* - `active` / `onActiveChange` manage open/close state.
|
|
1878
|
+
* - `query` / `onQueryChange` manage input value.
|
|
1879
|
+
*
|
|
1880
|
+
* Shared `searchId` (React.useId) links SearchBar and SearchView via
|
|
1881
|
+
* Framer Motion `layoutId` for seamless animated transitions.
|
|
1882
|
+
*/
|
|
1883
|
+
declare function SearchComponent({ query, onQueryChange, onSearch, active, onActiveChange, variant, styleType, hasGap, leadingIcon, trailingIcon, placeholder, textAlign, children, id, "aria-label": ariaLabel, className, viewClassName, }: SearchProps): react_jsx_runtime.JSX.Element;
|
|
1884
|
+
/** MD3 Expressive Search component with `Search.useSearch` context accessor. */
|
|
1885
|
+
declare const Search: typeof SearchComponent & {
|
|
1886
|
+
useSearch: typeof useSearch;
|
|
1887
|
+
};
|
|
1888
|
+
|
|
1889
|
+
/**
|
|
1890
|
+
* Height and shape tokens for Search variants.
|
|
1891
|
+
* Maps directly from MD3 Kotlin token files.
|
|
1892
|
+
*/
|
|
1893
|
+
declare const SearchTokens: {
|
|
1894
|
+
readonly heights: {
|
|
1895
|
+
/** SearchBarTokens.ContainerHeight = 56dp */
|
|
1896
|
+
readonly bar: 56;
|
|
1897
|
+
/** SearchViewTokens.DockedHeaderContainerHeight = 56dp */
|
|
1898
|
+
readonly dockedHeader: 56;
|
|
1899
|
+
/** SearchViewTokens.FullScreenHeaderContainerHeight = 72dp */
|
|
1900
|
+
readonly fullScreenHeader: 72;
|
|
1901
|
+
};
|
|
1902
|
+
/** SearchBarTokens.AvatarSize = 30dp */
|
|
1903
|
+
readonly avatarSize: 30;
|
|
1904
|
+
/** Standard icon size for leading/trailing icons. */
|
|
1905
|
+
readonly iconSize: 20;
|
|
1906
|
+
/** Touch target for interactive icons per MD3 a11y spec. */
|
|
1907
|
+
readonly iconTouchTarget: 48;
|
|
1908
|
+
/** Gap between SearchBar and results list when hasGap=true. */
|
|
1909
|
+
readonly dropdownGap: 2;
|
|
1910
|
+
};
|
|
1911
|
+
/**
|
|
1912
|
+
* CSS custom property references for Search colors.
|
|
1913
|
+
* Maps to --md-sys-color-* tokens in the MD3 theme system.
|
|
1914
|
+
*
|
|
1915
|
+
* SearchBarTokens.kt:
|
|
1916
|
+
* - ContainerColor → SurfaceContainerHigh
|
|
1917
|
+
* - LeadingIconColor → OnSurface
|
|
1918
|
+
* - TrailingIconColor → OnSurfaceVariant
|
|
1919
|
+
* - InputTextColor → OnSurface
|
|
1920
|
+
* - SupportingTextColor → OnSurfaceVariant (placeholder)
|
|
1921
|
+
*
|
|
1922
|
+
* SearchViewTokens.kt:
|
|
1923
|
+
* - ContainerColor → SurfaceContainerHigh
|
|
1924
|
+
* - DividerColor → Outline
|
|
1925
|
+
*/
|
|
1926
|
+
declare const SEARCH_COLORS: {
|
|
1927
|
+
/** SearchBarTokens.ContainerColor → surface-container-high */
|
|
1928
|
+
readonly container: "var(--md-sys-color-surface-container-high)";
|
|
1929
|
+
/** SearchBarTokens.LeadingIconColor → on-surface */
|
|
1930
|
+
readonly leadingIcon: "var(--md-sys-color-on-surface)";
|
|
1931
|
+
/** SearchBarTokens.TrailingIconColor → on-surface-variant */
|
|
1932
|
+
readonly trailingIcon: "var(--md-sys-color-on-surface-variant)";
|
|
1933
|
+
/** SearchBarTokens.InputTextColor → on-surface */
|
|
1934
|
+
readonly inputText: "var(--md-sys-color-on-surface)";
|
|
1935
|
+
/** SearchBarTokens.SupportingTextColor → on-surface-variant (placeholder) */
|
|
1936
|
+
readonly supportingText: "var(--md-sys-color-on-surface-variant)";
|
|
1937
|
+
/** SearchViewTokens.DividerColor → outline */
|
|
1938
|
+
readonly divider: "var(--md-sys-color-outline)";
|
|
1939
|
+
/** Focus indicator → secondary */
|
|
1940
|
+
readonly focusIndicator: "var(--md-sys-color-secondary)";
|
|
1941
|
+
};
|
|
1942
|
+
/**
|
|
1943
|
+
* SearchBarTokens.InputTextFont = BodyLarge (16sp / 24sp line-height).
|
|
1944
|
+
* SearchBarTokens.SupportingTextFont = BodyLarge.
|
|
1945
|
+
*/
|
|
1946
|
+
declare const SEARCH_TYPOGRAPHY: {
|
|
1947
|
+
/** BodyLarge — used for input text and placeholder. */
|
|
1948
|
+
readonly bodyLarge: "text-[16px] leading-6 font-normal tracking-[0.5px]";
|
|
1949
|
+
};
|
|
1950
|
+
declare const SEARCH_BAR_EXPAND_SPRING: motion.Transition;
|
|
1951
|
+
declare const SEARCH_DOCKED_REVEAL_SPRING: motion.Transition;
|
|
1952
|
+
declare const SEARCH_FULLSCREEN_SPRING: motion.Transition;
|
|
1953
|
+
declare const SEARCH_BAR_EXIT_SPRING: motion.Transition;
|
|
1954
|
+
|
|
1955
|
+
type SearchBarProps = Pick<SearchProps, "query" | "onQueryChange" | "onSearch" | "active" | "onActiveChange" | "leadingIcon" | "trailingIcon" | "placeholder" | "textAlign" | "className" | "aria-label"> & SearchInternalProps & {
|
|
1956
|
+
/** KeyDown handler from useSearchKeyboard. */
|
|
1957
|
+
onKeyDown: (e: React$1.KeyboardEvent) => void;
|
|
1958
|
+
/** Currently highlighted suggestion index (-1 = none). */
|
|
1959
|
+
activeIndex: number;
|
|
1960
|
+
};
|
|
1961
|
+
/**
|
|
1962
|
+
* SearchBar — collapsed state of the MD3 Search component.
|
|
1963
|
+
*
|
|
1964
|
+
* Uses Framer Motion `layout` + shared `layoutId` to morph into
|
|
1965
|
+
* SearchView when active. Wrapped in AnimatePresence with mode="popLayout"
|
|
1966
|
+
* so it exits (fades/scales out) before SearchView claims the layoutId.
|
|
1967
|
+
*/
|
|
1968
|
+
declare function SearchBar({ query, onQueryChange, onSearch, active, onActiveChange, leadingIcon, trailingIcon, placeholder, textAlign, className, "aria-label": ariaLabel, searchId, listboxId, onKeyDown, activeIndex, }: SearchBarProps): react_jsx_runtime.JSX.Element;
|
|
1969
|
+
|
|
1970
|
+
type SearchViewDockedProps = Pick<SearchProps, "query" | "onQueryChange" | "onSearch" | "active" | "onActiveChange" | "leadingIcon" | "trailingIcon" | "placeholder" | "textAlign" | "styleType" | "hasGap" | "children" | "viewClassName" | "aria-label"> & SearchInternalProps & {
|
|
1971
|
+
onKeyDown: (e: React$1.KeyboardEvent) => void;
|
|
1972
|
+
activeIndex: number;
|
|
1973
|
+
};
|
|
1974
|
+
declare function SearchViewDocked({ query, onQueryChange, onSearch, active, onActiveChange, leadingIcon, trailingIcon, placeholder, textAlign, styleType, hasGap, children, viewClassName, "aria-label": ariaLabel, searchId, listboxId, onKeyDown, activeIndex, }: SearchViewDockedProps): react_jsx_runtime.JSX.Element;
|
|
1975
|
+
|
|
1976
|
+
/**
|
|
1977
|
+
* @file search-view-fullscreen.tsx
|
|
1978
|
+
* MD3 Expressive SearchView — FullScreen variant.
|
|
1979
|
+
*
|
|
1980
|
+
* Renders a full-screen overlay via React Portal.
|
|
1981
|
+
* Using Portal avoids z-index stacking context issues and ensures
|
|
1982
|
+
* the overlay always covers the entire viewport correctly.
|
|
1983
|
+
*
|
|
1984
|
+
* Animation (Option B — MD3 morphing):
|
|
1985
|
+
* - Shares `layoutId` with SearchBar. After SearchBar exits via its own
|
|
1986
|
+
* AnimatePresence (mode="popLayout"), this view claims the layoutId and
|
|
1987
|
+
* Framer Motion morphs the pill shape → full-screen rect (CornerFull → CornerNone).
|
|
1988
|
+
* - mode="popLayout" on this AnimatePresence enables SearchBar to re-enter
|
|
1989
|
+
* after this view exits.
|
|
1990
|
+
* - Focus: double-rAF pattern syncs focus with layout animation frame.
|
|
1991
|
+
*
|
|
1992
|
+
* Header height: 72dp per SearchViewTokens.FullScreenHeaderContainerHeight.
|
|
1993
|
+
* ESC key closes the view (handled by useSearchKeyboard).
|
|
1994
|
+
*/
|
|
1995
|
+
|
|
1996
|
+
type SearchViewFullScreenProps = Pick<SearchProps, "query" | "onQueryChange" | "onSearch" | "active" | "onActiveChange" | "leadingIcon" | "trailingIcon" | "placeholder" | "textAlign" | "styleType" | "children" | "viewClassName" | "aria-label"> & SearchInternalProps & {
|
|
1997
|
+
onKeyDown: (e: React$1.KeyboardEvent) => void;
|
|
1998
|
+
activeIndex: number;
|
|
1999
|
+
};
|
|
2000
|
+
/**
|
|
2001
|
+
* SearchView FullScreen — full-screen overlay via React Portal.
|
|
2002
|
+
*
|
|
2003
|
+
* The `layoutId` shared with SearchBar enables Framer Motion to animate
|
|
2004
|
+
* the shape morphing from the pill (rounded-full) to a full-screen rect.
|
|
2005
|
+
*
|
|
2006
|
+
* Contained style: no divider, background preserved.
|
|
2007
|
+
* Divided style: HorizontalDivider between header and results.
|
|
2008
|
+
*/
|
|
2009
|
+
declare function SearchViewFullScreen({ query, onQueryChange, onSearch, active, onActiveChange, leadingIcon, trailingIcon, placeholder, textAlign, styleType, children, viewClassName, "aria-label": ariaLabel, searchId, listboxId, onKeyDown, activeIndex, }: SearchViewFullScreenProps): React$1.ReactPortal | null;
|
|
2010
|
+
|
|
2011
|
+
/**
|
|
2012
|
+
* @file tabs.types.ts
|
|
2013
|
+
* MD3 Expressive Tabs — TypeScript prop definitions.
|
|
2014
|
+
* Spec: https://m3.material.io/components/tabs/overview
|
|
2015
|
+
*/
|
|
2016
|
+
|
|
2017
|
+
/** Visual variant: primary (content-width indicator) or secondary (full-width indicator + divider). */
|
|
2018
|
+
type TabsVariant = "primary" | "secondary";
|
|
2019
|
+
/**
|
|
2020
|
+
* Props for the `<Tabs>` root component.
|
|
2021
|
+
*
|
|
2022
|
+
* Supports both controlled (`value` + `onValueChange`) and
|
|
2023
|
+
* uncontrolled (`defaultValue`) usage patterns.
|
|
2024
|
+
*
|
|
2025
|
+
* @example
|
|
2026
|
+
* ```tsx
|
|
2027
|
+
* // Controlled
|
|
2028
|
+
* <Tabs value={tab} onValueChange={setTab}>...</Tabs>
|
|
2029
|
+
*
|
|
2030
|
+
* // Uncontrolled
|
|
2031
|
+
* <Tabs defaultValue="flights">...</Tabs>
|
|
2032
|
+
*
|
|
2033
|
+
* // Auto-activate (focus = select)
|
|
2034
|
+
* <Tabs defaultValue="flights" autoActivate>...</Tabs>
|
|
2035
|
+
* ```
|
|
2036
|
+
*/
|
|
2037
|
+
interface TabsProps {
|
|
2038
|
+
/** Controlled selected value. Use with `onValueChange`. */
|
|
2039
|
+
value?: string;
|
|
2040
|
+
/** Initial value for uncontrolled usage. */
|
|
2041
|
+
defaultValue?: string;
|
|
2042
|
+
/** Called when the selected tab changes. */
|
|
2043
|
+
onValueChange?: (value: string) => void;
|
|
2044
|
+
/**
|
|
2045
|
+
* When true, ArrowKey navigation also selects the focused tab immediately.
|
|
2046
|
+
* Mirrors Google's `auto-activate` attribute on `<md-tabs>`.
|
|
2047
|
+
* @default false
|
|
2048
|
+
*/
|
|
2049
|
+
autoActivate?: boolean;
|
|
2050
|
+
/** Tab compound components as children. */
|
|
2051
|
+
children: React$1.ReactNode;
|
|
2052
|
+
/** Additional CSS class names for the root wrapper. */
|
|
2053
|
+
className?: string;
|
|
2054
|
+
}
|
|
2055
|
+
/**
|
|
2056
|
+
* Props for the `<TabsList>` container component.
|
|
2057
|
+
*
|
|
2058
|
+
* @example
|
|
2059
|
+
* ```tsx
|
|
2060
|
+
* <TabsList variant="primary" scrollable={false}>
|
|
2061
|
+
* <Tab value="tab1">Tab 1</Tab>
|
|
2062
|
+
* </TabsList>
|
|
2063
|
+
* ```
|
|
2064
|
+
*/
|
|
2065
|
+
interface TabsListProps {
|
|
2066
|
+
/** Visual style variant. @required */
|
|
2067
|
+
variant: TabsVariant;
|
|
2068
|
+
/**
|
|
2069
|
+
* When true, tabs scroll horizontally with 52px edge padding (MD3 spec).
|
|
2070
|
+
* When false, tabs divide the available width equally (flex-1).
|
|
2071
|
+
* @default false
|
|
2072
|
+
*/
|
|
2073
|
+
scrollable?: boolean;
|
|
2074
|
+
/**
|
|
2075
|
+
* Background color override for the tab bar.
|
|
2076
|
+
* @default "var(--md-sys-color-surface)"
|
|
2077
|
+
*/
|
|
2078
|
+
backgroundColor?: string;
|
|
2079
|
+
/** Tab components as children. */
|
|
2080
|
+
children: React$1.ReactNode;
|
|
2081
|
+
/** Additional CSS class names. */
|
|
2082
|
+
className?: string;
|
|
2083
|
+
/** Forwarded aria-label for the tablist. */
|
|
2084
|
+
"aria-label"?: string;
|
|
2085
|
+
}
|
|
2086
|
+
/**
|
|
2087
|
+
* Props for an individual `<Tab>` component.
|
|
2088
|
+
*
|
|
2089
|
+
* @example
|
|
2090
|
+
* ```tsx
|
|
2091
|
+
* <Tab value="flights" icon={<Icon name="flight" />}>Flights</Tab>
|
|
2092
|
+
* <Tab value="trips" disabled>Trips</Tab>
|
|
2093
|
+
* <Tab value="hotels" icon={<Icon name="hotel" />} inlineIcon>Hotels</Tab>
|
|
2094
|
+
* ```
|
|
2095
|
+
*/
|
|
2096
|
+
interface TabProps {
|
|
2097
|
+
/** Unique value identifying this tab. Must match a `<TabsContent value>`. */
|
|
2098
|
+
value: string;
|
|
2099
|
+
/**
|
|
2100
|
+
* Optional icon rendered with the label text.
|
|
2101
|
+
* - Default (stacked): icon above label, height increases to 64dp.
|
|
2102
|
+
* - With `inlineIcon`: icon beside label (same row), height stays 48dp.
|
|
2103
|
+
*/
|
|
2104
|
+
icon?: React$1.ReactNode;
|
|
2105
|
+
/**
|
|
2106
|
+
* When true, icon is placed inline (same row) with the label text.
|
|
2107
|
+
* Container height stays at 48dp (does NOT increase to 64dp).
|
|
2108
|
+
* Mirrors the `inline-icon` attribute on `<md-primary-tab>`.
|
|
2109
|
+
* @default false
|
|
2110
|
+
*/
|
|
2111
|
+
inlineIcon?: boolean;
|
|
2112
|
+
/**
|
|
2113
|
+
* When true, disables interaction.
|
|
2114
|
+
* Disabled tabs are skipped entirely in keyboard navigation (ArrowKey).
|
|
2115
|
+
*/
|
|
2116
|
+
disabled?: boolean;
|
|
2117
|
+
/** Additional CSS class names. */
|
|
2118
|
+
className?: string;
|
|
2119
|
+
/**
|
|
2120
|
+
* Optional badge element overlaid on the tab content.
|
|
2121
|
+
* Handled via `BadgedBox`:
|
|
2122
|
+
* - Stacked icon: Overlaps icon's top-trailing corner.
|
|
2123
|
+
* - Inline/Text-only: Placed next to the text.
|
|
2124
|
+
*/
|
|
2125
|
+
badge?: React$1.ReactNode;
|
|
2126
|
+
/** Label text rendered inside the tab. */
|
|
2127
|
+
children: React$1.ReactNode;
|
|
2128
|
+
}
|
|
2129
|
+
/**
|
|
2130
|
+
* Props for the `<TabsContent>` panel component.
|
|
2131
|
+
*
|
|
2132
|
+
* @example
|
|
2133
|
+
* ```tsx
|
|
2134
|
+
* <TabsContent value="flights">Flight content here</TabsContent>
|
|
2135
|
+
* ```
|
|
2136
|
+
*/
|
|
2137
|
+
interface TabsContentProps {
|
|
2138
|
+
/** Must match the `value` of a sibling `<Tab>`. */
|
|
2139
|
+
value: string;
|
|
2140
|
+
/** Additional CSS class names. */
|
|
2141
|
+
className?: string;
|
|
2142
|
+
/** Panel content. */
|
|
2143
|
+
children: React$1.ReactNode;
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
/**
|
|
2147
|
+
* @file tab.tsx
|
|
2148
|
+
* MD3 Expressive Tab — Individual tab button with Framer Motion indicator.
|
|
2149
|
+
*
|
|
2150
|
+
* Design decisions:
|
|
2151
|
+
* 1. PRIMARY indicator nested inside content wrapper → width = content width (not full button).
|
|
2152
|
+
* 2. SECONDARY indicator outside content wrapper → `inset-x-0` = full button width.
|
|
2153
|
+
* 3. ROVING TABINDEX (WAI-ARIA): only focused tab has tabIndex=0; ArrowKey moves focus, Enter/Space selects.
|
|
2154
|
+
* 4. DISABLED tabs are skipped in ArrowKey navigation.
|
|
2155
|
+
* 5. RTL: ArrowLeft/Right directions are swapped when `direction: rtl` is detected.
|
|
2156
|
+
* 6. INLINE ICON: icon beside label, height stays 48dp (stacked = 64dp).
|
|
2157
|
+
* 7. AUTO-ACTIVATE: when parent `<Tabs autoActivate>`, ArrowKey also selects.
|
|
2158
|
+
*
|
|
2159
|
+
* @see https://m3.material.io/components/tabs/overview
|
|
2160
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/tabs/
|
|
2161
|
+
*/
|
|
2162
|
+
|
|
2163
|
+
/**
|
|
2164
|
+
* MD3 Expressive Tab component — individual tab button.
|
|
2165
|
+
*
|
|
2166
|
+
* Must be a direct child of `<TabsList>`. Implements WAI-ARIA Tabs pattern
|
|
2167
|
+
* with roving tabindex keyboard navigation.
|
|
2168
|
+
*
|
|
2169
|
+
* - **Primary variant**: indicator width = content (text + icon) width.
|
|
2170
|
+
* - **Secondary variant**: indicator width = full button hit area.
|
|
2171
|
+
* - **Disabled**: Skipped entirely in ArrowKey navigation (cannot be focused).
|
|
2172
|
+
* - **inlineIcon**: Icon beside (not above) label; height stays 48dp.
|
|
2173
|
+
* - Framer Motion `layoutId` animates indicator with spring physics.
|
|
2174
|
+
* - ArrowLeft/Right respect RTL direction automatically.
|
|
2175
|
+
*
|
|
2176
|
+
* @example
|
|
2177
|
+
* ```tsx
|
|
2178
|
+
* <Tab value="flights" icon={<Icon name="flight" />}>Flights</Tab>
|
|
2179
|
+
* <Tab value="trips">Trips</Tab>
|
|
2180
|
+
* <Tab value="explore" disabled>Explore</Tab>
|
|
2181
|
+
* <Tab value="hotels" icon={<Icon name="hotel" />} inlineIcon>Hotels</Tab>
|
|
2182
|
+
* ```
|
|
2183
|
+
*
|
|
2184
|
+
* @see https://m3.material.io/components/tabs/overview
|
|
2185
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/tabs/
|
|
2186
|
+
*/
|
|
2187
|
+
declare const Tab: React$1.NamedExoticComponent<TabProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
2188
|
+
|
|
2189
|
+
/**
|
|
2190
|
+
* @file tabs.tsx
|
|
2191
|
+
* MD3 Expressive Tabs — Root context provider and state manager.
|
|
2192
|
+
* Implements compound component pattern (similar to Radix UI).
|
|
2193
|
+
* Spec: https://m3.material.io/components/tabs/overview
|
|
2194
|
+
*/
|
|
2195
|
+
|
|
2196
|
+
/**
|
|
2197
|
+
* MD3 Expressive Tabs root component.
|
|
2198
|
+
*
|
|
2199
|
+
* Manages tab selection state and provides context to all
|
|
2200
|
+
* compound sub-components. Supports both controlled and
|
|
2201
|
+
* uncontrolled usage.
|
|
2202
|
+
*
|
|
2203
|
+
* @example
|
|
2204
|
+
* ```tsx
|
|
2205
|
+
* // Uncontrolled
|
|
2206
|
+
* <Tabs defaultValue="flights">
|
|
2207
|
+
* <TabsList variant="primary">
|
|
2208
|
+
* <Tab value="flights">Flights</Tab>
|
|
2209
|
+
* <Tab value="trips">Trips</Tab>
|
|
2210
|
+
* </TabsList>
|
|
2211
|
+
* <TabsContent value="flights">Flight content</TabsContent>
|
|
2212
|
+
* <TabsContent value="trips">Trip content</TabsContent>
|
|
2213
|
+
* </Tabs>
|
|
2214
|
+
*
|
|
2215
|
+
* // Controlled
|
|
2216
|
+
* const [tab, setTab] = useState("flights");
|
|
2217
|
+
* <Tabs value={tab} onValueChange={setTab}>...</Tabs>
|
|
2218
|
+
*
|
|
2219
|
+
* // Auto-activate mode (focus = select)
|
|
2220
|
+
* <Tabs defaultValue="flights" autoActivate>...</Tabs>
|
|
2221
|
+
* ```
|
|
2222
|
+
*
|
|
2223
|
+
* @see https://m3.material.io/components/tabs/overview
|
|
2224
|
+
*/
|
|
2225
|
+
declare const Tabs: React$1.NamedExoticComponent<TabsProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
2226
|
+
|
|
2227
|
+
/**
|
|
2228
|
+
* @file tabs.tokens.ts
|
|
2229
|
+
* MD3 Expressive Tabs — Design tokens ported from:
|
|
2230
|
+
* - PrimaryNavigationTabTokens.kt (v0_162)
|
|
2231
|
+
* - SecondaryNavigationTabTokens.kt (v0_162)
|
|
2232
|
+
*
|
|
2233
|
+
* All dimensional values are in px (dp equivalent for web).
|
|
2234
|
+
* @see docs/m3/tabs/PrimaryNavigationTabTokens.kt
|
|
2235
|
+
* @see docs/m3/tabs/SecondaryNavigationTabTokens.kt
|
|
2236
|
+
*/
|
|
2237
|
+
/**
|
|
2238
|
+
* Dimensional design tokens for the MD3 Tabs component.
|
|
2239
|
+
*
|
|
2240
|
+
* Maps directly from the `.kt` token files to CSS/JS values.
|
|
2241
|
+
* Use as the single source of truth for sizing.
|
|
2242
|
+
*/
|
|
2243
|
+
declare const TabsTokens: {
|
|
2244
|
+
/** ContainerHeight = 48dp (text-only tab) */
|
|
2245
|
+
readonly containerHeight: 48;
|
|
2246
|
+
/** IconAndLabelTextContainerHeight = 64dp (tab with icon + label stacked) */
|
|
2247
|
+
readonly containerHeightWithIcon: 64;
|
|
2248
|
+
/** ActiveIndicatorHeight (Primary) = 3dp */
|
|
2249
|
+
readonly primaryIndicatorHeight: 3;
|
|
2250
|
+
/** ActiveIndicatorHeight (Secondary) = 2dp */
|
|
2251
|
+
readonly secondaryIndicatorHeight: 2;
|
|
2252
|
+
/**
|
|
2253
|
+
* ActiveIndicatorShape = 3dp top-left and top-right (per MD3 token, not a full pill).
|
|
2254
|
+
* Google reference: `var(--_active-indicator-shape)` resolves to `3px 3px 0 0` effectively.
|
|
2255
|
+
*/
|
|
2256
|
+
readonly indicatorBorderRadius: "3px 3px 0 0";
|
|
2257
|
+
/** IconSize = 24dp */
|
|
2258
|
+
readonly iconSize: 24;
|
|
2259
|
+
/**
|
|
2260
|
+
* Edge start/end padding for scrollable mode = 52px.
|
|
2261
|
+
* Per MD3 spec: tabs have padding on both leading and trailing edges.
|
|
2262
|
+
*/
|
|
2263
|
+
readonly scrollableEdgePadding: 52;
|
|
2264
|
+
/** Minimum tab width in scrollable mode = 90px. */
|
|
2265
|
+
readonly scrollableMinTabWidth: 90;
|
|
2266
|
+
/** DividerHeight = 1dp */
|
|
2267
|
+
readonly dividerHeight: 1;
|
|
2268
|
+
/**
|
|
2269
|
+
* Focus ring border-radius = 8px.
|
|
2270
|
+
* Google reference: `focus-ring.theme({ shape: 8px })` in _tab.scss.
|
|
2271
|
+
*/
|
|
2272
|
+
readonly focusRingBorderRadius: 8;
|
|
2273
|
+
};
|
|
2274
|
+
/**
|
|
2275
|
+
* CSS custom property references for Tabs colors.
|
|
2276
|
+
* Maps to `--md-sys-color-*` tokens in the MD3 theme system.
|
|
2277
|
+
*
|
|
2278
|
+
* DO NOT hardcode hex values — use these references for automatic
|
|
2279
|
+
* light/dark theme adaptation.
|
|
2280
|
+
*/
|
|
2281
|
+
declare const TabsColors: {
|
|
2282
|
+
/** Primary: ActiveLabelTextColor / ActiveIconColor = Primary */
|
|
2283
|
+
readonly primaryActiveText: "var(--md-sys-color-primary)";
|
|
2284
|
+
/** Primary: InactiveLabelTextColor / InactiveIconColor = OnSurfaceVariant */
|
|
2285
|
+
readonly primaryInactiveText: "var(--md-sys-color-on-surface-variant)";
|
|
2286
|
+
/** Primary: ActiveIndicatorColor = Primary */
|
|
2287
|
+
readonly primaryIndicator: "var(--md-sys-color-primary)";
|
|
2288
|
+
/** Secondary: ActiveLabelTextColor / ActiveIconColor = OnSurface */
|
|
2289
|
+
readonly secondaryActiveText: "var(--md-sys-color-on-surface)";
|
|
2290
|
+
/** Secondary: InactiveLabelTextColor / InactiveIconColor = OnSurfaceVariant */
|
|
2291
|
+
readonly secondaryInactiveText: "var(--md-sys-color-on-surface-variant)";
|
|
2292
|
+
/** Secondary: Indicator color = Primary (same as primary variant) */
|
|
2293
|
+
readonly secondaryIndicator: "var(--md-sys-color-primary)";
|
|
2294
|
+
/** Secondary: DividerColor = SurfaceVariant */
|
|
2295
|
+
readonly divider: "var(--md-sys-color-surface-variant)";
|
|
2296
|
+
/** ContainerColor = Surface */
|
|
2297
|
+
readonly container: "var(--md-sys-color-surface)";
|
|
2298
|
+
/** Focus ring indicator = Secondary */
|
|
2299
|
+
readonly focusIndicator: "var(--md-sys-color-secondary)";
|
|
2300
|
+
/** Hover state layer (primary active) */
|
|
2301
|
+
readonly primaryActiveHover: "var(--md-sys-color-primary)";
|
|
2302
|
+
/** Hover state layer (inactive, both variants) */
|
|
2303
|
+
readonly inactiveHover: "var(--md-sys-color-on-surface)";
|
|
2304
|
+
};
|
|
2305
|
+
|
|
2306
|
+
/**
|
|
2307
|
+
* @file tabs-content.tsx
|
|
2308
|
+
* MD3 Expressive TabsContent — Animated panel component.
|
|
2309
|
+
*
|
|
2310
|
+
* Implements WAI-ARIA tabpanel role with:
|
|
2311
|
+
* - AnimatePresence for fade transition on tab switch
|
|
2312
|
+
* - Proper aria-labelledby pointing to the associated <Tab>
|
|
2313
|
+
* - tabIndex=0 so keyboard users can Tab from the tablist into the panel
|
|
2314
|
+
* - Hidden panels are removed from the DOM (not just visually hidden)
|
|
2315
|
+
* to prevent screen readers from reading inactive content
|
|
2316
|
+
*/
|
|
2317
|
+
|
|
2318
|
+
/**
|
|
2319
|
+
* MD3 Expressive TabsContent panel component.
|
|
2320
|
+
*
|
|
2321
|
+
* Each panel corresponds to a `<Tab>` with the same `value`.
|
|
2322
|
+
* Only the active panel is rendered in the DOM — inactive panels
|
|
2323
|
+
* are fully unmounted (not `display: none`) to prevent screen readers
|
|
2324
|
+
* from reading hidden content.
|
|
2325
|
+
*
|
|
2326
|
+
* Fade animation is applied on both enter and exit via Framer Motion
|
|
2327
|
+
* `AnimatePresence`. We use `mode="popLayout"` to prevent height layout shifting
|
|
2328
|
+
* during tab transitions. Animation is automatically disabled when the user
|
|
2329
|
+
* has enabled `prefers-reduced-motion`.
|
|
2330
|
+
*
|
|
2331
|
+
* @example
|
|
2332
|
+
* ```tsx
|
|
2333
|
+
* <TabsContent value="flights">
|
|
2334
|
+
* <p>Available flights...</p>
|
|
2335
|
+
* </TabsContent>
|
|
2336
|
+
* ```
|
|
2337
|
+
*
|
|
2338
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/tabs/
|
|
2339
|
+
*/
|
|
2340
|
+
declare const TabsContent: React$1.NamedExoticComponent<TabsContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
2341
|
+
|
|
2342
|
+
/**
|
|
2343
|
+
* @file tabs-list.tsx
|
|
2344
|
+
* MD3 Expressive TabsList — Container component for tab buttons.
|
|
2345
|
+
*
|
|
2346
|
+
* Responsibilities:
|
|
2347
|
+
* - Applies variant (primary/secondary) layout and styling
|
|
2348
|
+
* - Manages horizontal scroll for scrollable mode (52px edge padding per MD3)
|
|
2349
|
+
* - Renders the bottom divider for secondary variant
|
|
2350
|
+
* - Scopes Framer Motion LayoutGroup so indicators animate correctly
|
|
2351
|
+
* when multiple <Tabs> instances are on the same page
|
|
2352
|
+
* - Restores focus to activeTab when keyboard focus leaves the tablist
|
|
2353
|
+
* (matches Google's `focusout` handler on <md-tabs>)
|
|
2354
|
+
*/
|
|
2355
|
+
|
|
2356
|
+
/**
|
|
2357
|
+
* MD3 Expressive TabsList container component.
|
|
2358
|
+
*
|
|
2359
|
+
* Renders a horizontal row of `<Tab>` components with MD3-compliant
|
|
2360
|
+
* layout (fixed or scrollable) and variant styling (primary or secondary).
|
|
2361
|
+
*
|
|
2362
|
+
* - **Primary**: Tabs divide available width equally, indicator width = content width.
|
|
2363
|
+
* - **Secondary**: Tabs divide equally + full-width indicator + bottom divider line.
|
|
2364
|
+
* - **Scrollable**: Tabs have min-width (90px), scroll horizontally with 52px edge padding.
|
|
2365
|
+
* - **Focusout**: When focus leaves the tablist, roving focus resets to the active tab.
|
|
2366
|
+
*
|
|
2367
|
+
* @example
|
|
2368
|
+
* ```tsx
|
|
2369
|
+
* <TabsList variant="primary" scrollable={false}>
|
|
2370
|
+
* <Tab value="tab1">Tab 1</Tab>
|
|
2371
|
+
* <Tab value="tab2">Tab 2</Tab>
|
|
2372
|
+
* </TabsList>
|
|
2373
|
+
*
|
|
2374
|
+
* <TabsList variant="secondary" scrollable={true} aria-label="Content sections">
|
|
2375
|
+
* <Tab value="a">Alpha</Tab>
|
|
2376
|
+
* <Tab value="b">Beta</Tab>
|
|
2377
|
+
* </TabsList>
|
|
2378
|
+
* ```
|
|
2379
|
+
*/
|
|
2380
|
+
declare const TabsList: React$1.NamedExoticComponent<TabsListProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
2381
|
+
|
|
2382
|
+
/**
|
|
2383
|
+
* Color configuration types and standard values for the FloatingToolbar component.
|
|
2384
|
+
* Maps MD3 design tokens to CSS custom properties used in Tailwind CSS.
|
|
2385
|
+
*/
|
|
2386
|
+
interface FloatingToolbarColors {
|
|
2387
|
+
/** The background color of the toolbar container */
|
|
2388
|
+
toolbarContainerColor?: string;
|
|
2389
|
+
/** The color of the content (icons, text) inside the toolbar */
|
|
2390
|
+
toolbarContentColor?: string;
|
|
2391
|
+
/** The background color of the FAB container */
|
|
2392
|
+
fabContainerColor?: string;
|
|
2393
|
+
/** The color of the content inside the FAB */
|
|
2394
|
+
fabContentColor?: string;
|
|
2395
|
+
}
|
|
2396
|
+
/**
|
|
2397
|
+
* Standard color configuration for the floating toolbar.
|
|
2398
|
+
* Uses surface container for the toolbar and secondary container for the FAB.
|
|
2399
|
+
*/
|
|
2400
|
+
declare const standardFloatingToolbarColors: FloatingToolbarColors;
|
|
2401
|
+
/**
|
|
2402
|
+
* Vibrant color configuration for the floating toolbar.
|
|
2403
|
+
* Uses primary container for the toolbar and tertiary container for the FAB.
|
|
2404
|
+
*/
|
|
2405
|
+
declare const vibrantFloatingToolbarColors: FloatingToolbarColors;
|
|
2406
|
+
|
|
2407
|
+
interface BottomDockedToolbarProps {
|
|
2408
|
+
/** Color variant: standard or vibrant */
|
|
2409
|
+
variant?: "standard" | "vibrant";
|
|
2410
|
+
/** Custom colors override */
|
|
2411
|
+
colors?: FloatingToolbarColors;
|
|
2412
|
+
/** Whether to hide on scroll */
|
|
2413
|
+
hideOnScroll?: boolean;
|
|
2414
|
+
/** Scroll container ref for scroll behavior (if empty, uses window scroll) */
|
|
2415
|
+
scrollContainerRef?: React$1.RefObject<HTMLElement | null>;
|
|
2416
|
+
/** Start content (left-aligned) */
|
|
2417
|
+
startContent?: React$1.ReactNode;
|
|
2418
|
+
/** End content (right-aligned) */
|
|
2419
|
+
endContent?: React$1.ReactNode;
|
|
2420
|
+
/** Center content */
|
|
2421
|
+
children?: React$1.ReactNode;
|
|
2422
|
+
/**
|
|
2423
|
+
* Horizontal padding (px) applied to the toolbar container.
|
|
2424
|
+
* MD3 spec requires a minimum of 16dp on leading and trailing edges.
|
|
2425
|
+
* @default 16
|
|
2426
|
+
*/
|
|
2427
|
+
paddingX?: number;
|
|
2428
|
+
/**
|
|
2429
|
+
* Layout distribution of toolbar content.
|
|
2430
|
+
* - `"between"` – leading/center/trailing spread across full width (default, compact screens).
|
|
2431
|
+
* - `"center"` – all content centered; ideal for medium+ screen widths.
|
|
2432
|
+
* - `"end-weighted"` – key action is centered while others are pushed to the edges.
|
|
2433
|
+
* @default "between"
|
|
2434
|
+
*/
|
|
2435
|
+
justify?: "between" | "center" | "end-weighted";
|
|
2436
|
+
/**
|
|
2437
|
+
* Container shape.
|
|
2438
|
+
* - `"none"` – straight corners (MD3 default for mobile docked toolbars).
|
|
2439
|
+
* - `"large"` – large rounded corners (recommended for web / large screens).
|
|
2440
|
+
* - `"full"` – fully pill-shaped.
|
|
2441
|
+
*
|
|
2442
|
+
* MD3 guideline: *"On web and large screens, the docked toolbar can be rounded."*
|
|
2443
|
+
* @default "none"
|
|
2444
|
+
*/
|
|
2445
|
+
shape?: "none" | "large" | "full";
|
|
2446
|
+
className?: string;
|
|
2447
|
+
"aria-label"?: string;
|
|
2448
|
+
}
|
|
2449
|
+
/**
|
|
2450
|
+
* A full-width docked toolbar typically fixed at the bottom of the screen.
|
|
2451
|
+
* Replaces the deprecated Bottom App Bar in MD3 Expressive.
|
|
2452
|
+
*
|
|
2453
|
+
* @example
|
|
2454
|
+
* ```tsx
|
|
2455
|
+
* <BottomDockedToolbar hideOnScroll startContent={<IconButton aria-label="Menu"><Icon name="menu" /></IconButton>}>
|
|
2456
|
+
* <div className="flex gap-2">
|
|
2457
|
+
* <IconButton aria-label="Search"><Icon name="search" /></IconButton>
|
|
2458
|
+
* <IconButton aria-label="Edit"><Icon name="edit" /></IconButton>
|
|
2459
|
+
* </div>
|
|
2460
|
+
* </BottomDockedToolbar>
|
|
2461
|
+
* ```
|
|
2462
|
+
*/
|
|
2463
|
+
declare const BottomDockedToolbar: React$1.ForwardRefExoticComponent<BottomDockedToolbarProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
2464
|
+
|
|
2465
|
+
/**
|
|
2466
|
+
* Configuration options for the `useFloatingToolbarScrollBehavior` hook.
|
|
2467
|
+
*/
|
|
2468
|
+
interface UseFloatingToolbarScrollBehaviorOptions {
|
|
2469
|
+
/** Direction toolbar exits: 'top' | 'bottom' | 'start' | 'end'. Defaults to 'bottom'. */
|
|
2470
|
+
exitDirection?: "top" | "bottom" | "start" | "end";
|
|
2471
|
+
/** Scroll distance threshold to trigger collapse (in px). Defaults to 10. */
|
|
2472
|
+
collapseThreshold?: number;
|
|
2473
|
+
/** Scroll distance threshold to trigger expand (in px). Defaults to 10. */
|
|
2474
|
+
expandThreshold?: number;
|
|
2475
|
+
/** Optional ref to a scrollable container. If not provided, it listens to window scroll. */
|
|
2476
|
+
scrollContainerRef?: RefObject<HTMLElement | null>;
|
|
2477
|
+
}
|
|
2478
|
+
/**
|
|
2479
|
+
* The resulting behavior object returned by `useFloatingToolbarScrollBehavior`.
|
|
2480
|
+
*/
|
|
2481
|
+
interface FloatingToolbarScrollBehavior {
|
|
2482
|
+
/** Current offset. 0 is fully visible, -1 is fully hidden. */
|
|
2483
|
+
offset: number;
|
|
2484
|
+
/** Whether the toolbar is currently expanded. */
|
|
2485
|
+
isExpanded: boolean;
|
|
2486
|
+
/** Optional scroll handler to bind to a React scrollable container (legacy fallback). */
|
|
2487
|
+
onScroll?: (event: React.UIEvent<HTMLElement>) => void;
|
|
2488
|
+
/** Manually update the expanded state of the toolbar. */
|
|
2489
|
+
setExpanded: (expanded: boolean) => void;
|
|
2490
|
+
/** The configured exit direction. */
|
|
2491
|
+
exitDirection: "top" | "bottom" | "start" | "end";
|
|
2492
|
+
}
|
|
2493
|
+
/**
|
|
2494
|
+
* A hook that provides scroll behavior for floating toolbars, allowing them to
|
|
2495
|
+
* collapse (exit) when scrolling down and expand (enter) when scrolling up.
|
|
2496
|
+
* Leverages Framer Motion's useScroll internally for optimized performance.
|
|
2497
|
+
*
|
|
2498
|
+
* @param options Configuration options for scroll behavior.
|
|
2499
|
+
* @returns An object containing the current scroll state and handlers.
|
|
2500
|
+
*
|
|
2501
|
+
* @example
|
|
2502
|
+
* ```tsx
|
|
2503
|
+
* const scrollBehavior = useFloatingToolbarScrollBehavior({
|
|
2504
|
+
* exitDirection: 'bottom',
|
|
2505
|
+
* collapseThreshold: 20
|
|
2506
|
+
* });
|
|
2507
|
+
*
|
|
2508
|
+
* <HorizontalFloatingToolbar scrollBehavior={scrollBehavior}>
|
|
2509
|
+
* <IconButton icon="bold" />
|
|
2510
|
+
* </HorizontalFloatingToolbar>
|
|
2511
|
+
* ```
|
|
2512
|
+
*/
|
|
2513
|
+
declare function useFloatingToolbarScrollBehavior(options?: UseFloatingToolbarScrollBehaviorOptions): FloatingToolbarScrollBehavior;
|
|
2514
|
+
|
|
2515
|
+
interface FloatingToolbarProps {
|
|
2516
|
+
/** Whether the toolbar is expanded, showing startContent and endContent */
|
|
2517
|
+
expanded: boolean;
|
|
2518
|
+
/** Orientation of the toolbar */
|
|
2519
|
+
orientation?: "horizontal" | "vertical";
|
|
2520
|
+
/** Color configuration */
|
|
2521
|
+
colors?: FloatingToolbarColors;
|
|
2522
|
+
/** Shape variant: full = pill shape (default), large = large rounded */
|
|
2523
|
+
shape?: "full" | "large";
|
|
2524
|
+
/** Padding inside toolbar container */
|
|
2525
|
+
contentPadding?: React$1.CSSProperties | string;
|
|
2526
|
+
/** Scroll behavior hook result */
|
|
2527
|
+
scrollBehavior?: FloatingToolbarScrollBehavior;
|
|
2528
|
+
/** Start content (shown when expanded, usually on the left/top) */
|
|
2529
|
+
startContent?: React$1.ReactNode;
|
|
2530
|
+
/** End content (shown when expanded, usually on the right/bottom) */
|
|
2531
|
+
endContent?: React$1.ReactNode;
|
|
2532
|
+
/** Main toolbar content (always visible) */
|
|
2533
|
+
children: React$1.ReactNode;
|
|
2534
|
+
/** Whether to disable the internal scroll translation (useful when parent handles it) */
|
|
2535
|
+
disableScrollTranslation?: boolean;
|
|
2536
|
+
/** Whether to disable layout animation (useful when nested inside FloatingToolbarWithFab) */
|
|
2537
|
+
disableLayoutAnimation?: boolean;
|
|
2538
|
+
/**
|
|
2539
|
+
* Gap (px) between items in the center children slot.
|
|
2540
|
+
* Corresponds to MD3 `ContainerBetweenSpace` token (4dp default).
|
|
2541
|
+
* @default 4
|
|
2542
|
+
*/
|
|
2543
|
+
itemGap?: number;
|
|
2544
|
+
/** Alignment (justify-content) of the center children slot */
|
|
2545
|
+
childrenAlignment?: "start" | "center" | "end";
|
|
2546
|
+
/** Custom CSS class applied to each child item in the toolbar slots */
|
|
2547
|
+
itemClassName?: string;
|
|
2548
|
+
className?: string;
|
|
2549
|
+
style?: React$1.CSSProperties;
|
|
2550
|
+
"aria-label"?: string;
|
|
2551
|
+
}
|
|
2552
|
+
/**
|
|
2553
|
+
* A horizontal floating toolbar that displays navigation and key actions.
|
|
2554
|
+
* It can be positioned anywhere on the screen and floats over the rest of the content.
|
|
2555
|
+
*
|
|
2556
|
+
* @example
|
|
2557
|
+
* ```tsx
|
|
2558
|
+
* const [expanded, setExpanded] = useState(true);
|
|
2559
|
+
* const scrollBehavior = useFloatingToolbarScrollBehavior({ exitDirection: 'bottom' });
|
|
2560
|
+
*
|
|
2561
|
+
* <HorizontalFloatingToolbar
|
|
2562
|
+
* expanded={expanded}
|
|
2563
|
+
* scrollBehavior={scrollBehavior}
|
|
2564
|
+
* startContent={<IconButton icon="undo" />}
|
|
2565
|
+
* endContent={<IconButton icon="redo" />}
|
|
2566
|
+
* >
|
|
2567
|
+
* <IconButton icon="bold" />
|
|
2568
|
+
* <IconButton icon="italic" />
|
|
2569
|
+
* </HorizontalFloatingToolbar>
|
|
2570
|
+
* ```
|
|
2571
|
+
*
|
|
2572
|
+
* @see https://m3.material.io/components/toolbars/guidelines
|
|
2573
|
+
*/
|
|
2574
|
+
declare const HorizontalFloatingToolbar: React$1.ForwardRefExoticComponent<Omit<FloatingToolbarProps, "orientation"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
2575
|
+
/**
|
|
2576
|
+
* A vertical floating toolbar that displays navigation and key actions.
|
|
2577
|
+
* It floats over the rest of the content.
|
|
2578
|
+
*
|
|
2579
|
+
* @example
|
|
2580
|
+
* ```tsx
|
|
2581
|
+
* <VerticalFloatingToolbar expanded={true}>
|
|
2582
|
+
* <IconButton icon="bold" />
|
|
2583
|
+
* </VerticalFloatingToolbar>
|
|
2584
|
+
* ```
|
|
2585
|
+
*/
|
|
2586
|
+
declare const VerticalFloatingToolbar: React$1.ForwardRefExoticComponent<Omit<FloatingToolbarProps, "orientation"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
2587
|
+
|
|
2588
|
+
interface FloatingToolbarWithFabProps extends FloatingToolbarProps {
|
|
2589
|
+
/** FAB element (use FAB component or custom node) */
|
|
2590
|
+
floatingActionButton: React$1.ReactNode;
|
|
2591
|
+
/** FAB position for horizontal: 'start' | 'end'. For vertical: 'top' | 'bottom' */
|
|
2592
|
+
fabPosition?: "start" | "end" | "top" | "bottom";
|
|
2593
|
+
/** Animation duration override */
|
|
2594
|
+
animationDuration?: number;
|
|
2595
|
+
/** Start content (explicitly declared to resolve type issues) */
|
|
2596
|
+
startContent?: React$1.ReactNode;
|
|
2597
|
+
/** End content (explicitly declared to resolve type issues) */
|
|
2598
|
+
endContent?: React$1.ReactNode;
|
|
2599
|
+
/**
|
|
2600
|
+
* Size of the FAB container.
|
|
2601
|
+
* - `"default"` → 56×56px (`FabBaselineTokens.ContainerHeight`)
|
|
2602
|
+
* - `"medium"` → 80×80px (`FabBaselineTokens.MediumContainerHeight`)
|
|
2603
|
+
*
|
|
2604
|
+
* MD3: pair a medium FAB with the toolbar to give it greater visual prominence.
|
|
2605
|
+
* @default "default"
|
|
2606
|
+
*/
|
|
2607
|
+
fabSize?: "default" | "medium";
|
|
2608
|
+
}
|
|
2609
|
+
/**
|
|
2610
|
+
* A horizontal floating toolbar paired with a FAB.
|
|
2611
|
+
*/
|
|
2612
|
+
declare const HorizontalFloatingToolbarWithFab: React$1.ForwardRefExoticComponent<FloatingToolbarWithFabProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
2613
|
+
/**
|
|
2614
|
+
* A vertical floating toolbar paired with a FAB.
|
|
2615
|
+
*/
|
|
2616
|
+
declare const VerticalFloatingToolbarWithFab: React$1.ForwardRefExoticComponent<FloatingToolbarWithFabProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
2617
|
+
|
|
2618
|
+
/**
|
|
2619
|
+
* @file toolbar-divider.tsx
|
|
2620
|
+
*
|
|
2621
|
+
* A decorative divider for use inside MD3 Toolbar components.
|
|
2622
|
+
* Renders as a thin line that visually separates groups of toolbar actions.
|
|
2623
|
+
*
|
|
2624
|
+
* @see https://m3.material.io/components/toolbars/guidelines (Anatomy → Flexibility & slots)
|
|
2625
|
+
*/
|
|
2626
|
+
|
|
2627
|
+
interface ToolbarDividerProps {
|
|
2628
|
+
/**
|
|
2629
|
+
* The toolbar's orientation context.
|
|
2630
|
+
* - `"horizontal"` toolbar → renders a **vertical** divider line.
|
|
2631
|
+
* - `"vertical"` toolbar → renders a **horizontal** divider line.
|
|
2632
|
+
* @default "horizontal"
|
|
2633
|
+
*/
|
|
2634
|
+
orientation?: "horizontal" | "vertical";
|
|
2635
|
+
className?: string;
|
|
2636
|
+
}
|
|
2637
|
+
/**
|
|
2638
|
+
* A thin decorative separator for grouping actions inside a Toolbar.
|
|
2639
|
+
*
|
|
2640
|
+
* Inherits its color from the toolbar's `--toolbar-color` CSS variable via
|
|
2641
|
+
* `currentColor`, so it automatically adapts to both standard and vibrant
|
|
2642
|
+
* color configurations.
|
|
2643
|
+
*
|
|
2644
|
+
* @example
|
|
2645
|
+
* ```tsx
|
|
2646
|
+
* <HorizontalFloatingToolbar expanded={true}>
|
|
2647
|
+
* <IconButton aria-label="Bold"><BoldIcon /></IconButton>
|
|
2648
|
+
* <IconButton aria-label="Italic"><ItalicIcon /></IconButton>
|
|
2649
|
+
* <ToolbarDivider />
|
|
2650
|
+
* <IconButton aria-label="Align left"><AlignLeftIcon /></IconButton>
|
|
2651
|
+
* </HorizontalFloatingToolbar>
|
|
2652
|
+
* ```
|
|
2653
|
+
*/
|
|
2654
|
+
declare const ToolbarDivider: React$1.FC<ToolbarDividerProps>;
|
|
2655
|
+
|
|
2656
|
+
/**
|
|
2657
|
+
* @file toolbar-icon-button.tsx
|
|
2658
|
+
*
|
|
2659
|
+
* A thin wrapper around the MD3 `IconButton` component, pre-configured
|
|
2660
|
+
* for use inside Toolbar slots.
|
|
2661
|
+
*
|
|
2662
|
+
* Supports the three emphasis variants described in the MD3 Flexibility & slots
|
|
2663
|
+
* spec, plus narrow/wide sizing for asymmetric visual hierarchy.
|
|
2664
|
+
*
|
|
2665
|
+
* @see https://m3.material.io/components/toolbars/guidelines (Anatomy → Flexibility & slots)
|
|
2666
|
+
* @see https://m3.material.io/components/icon-buttons/overview
|
|
2667
|
+
*/
|
|
2668
|
+
|
|
2669
|
+
interface ToolbarIconButtonProps extends Omit<BaseIconButtonProps, "colorStyle" | "size" | "shape"> {
|
|
2670
|
+
/**
|
|
2671
|
+
* Visual emphasis variant.
|
|
2672
|
+
*
|
|
2673
|
+
* ⚠️ Avoid emphasising more than one action at a time.
|
|
2674
|
+
* @default "standard"
|
|
2675
|
+
*/
|
|
2676
|
+
emphasis?: ToolbarIconButtonVariant;
|
|
2677
|
+
/**
|
|
2678
|
+
* Button width sizing.
|
|
2679
|
+
*
|
|
2680
|
+
* Height is always `48px` to meet MD3 touch-target requirements.
|
|
2681
|
+
* @default "default"
|
|
2682
|
+
*/
|
|
2683
|
+
toolbarSize?: ToolbarIconButtonSize;
|
|
2684
|
+
/** Icon content — typically a single SVG icon component. */
|
|
2685
|
+
children: React$1.ReactNode;
|
|
2686
|
+
/**
|
|
2687
|
+
* Accessible label — **REQUIRED** because icon buttons have no visible text.
|
|
2688
|
+
*/
|
|
2689
|
+
"aria-label": string;
|
|
2690
|
+
}
|
|
2691
|
+
/**
|
|
2692
|
+
* Width sizing for a toolbar icon button.
|
|
2693
|
+
*
|
|
2694
|
+
* MD3 guideline: *"Use wide and narrow icon buttons"* to create visual hierarchy.
|
|
2695
|
+
* Touch-target height is always 48dp regardless of width.
|
|
2696
|
+
*
|
|
2697
|
+
* - `narrow` → 40px wide (secondary, de-emphasised)
|
|
2698
|
+
* - `default` → 48px wide (standard square touch target)
|
|
2699
|
+
* - `wide` → 64px wide (primary emphasis, draws eye)
|
|
2700
|
+
*/
|
|
2701
|
+
type ToolbarIconButtonSize = "narrow" | "default" | "wide";
|
|
2702
|
+
/**
|
|
2703
|
+
* Visual emphasis variant for a toolbar icon button.
|
|
2704
|
+
*
|
|
2705
|
+
* MD3 guideline: *"Use different icon button color styles, such as filled,
|
|
2706
|
+
* tonal, and standard."*
|
|
2707
|
+
*
|
|
2708
|
+
* ⚠️ **Avoid emphasising more than one action at a time.**
|
|
2709
|
+
* Use `"filled"` or `"tonal"` for the single highest-priority action and
|
|
2710
|
+
* keep all other buttons as `"standard"`.
|
|
2711
|
+
*/
|
|
2712
|
+
type ToolbarIconButtonVariant = "standard" | "tonal" | "filled";
|
|
2713
|
+
/**
|
|
2714
|
+
* An MD3 icon button optimised for use inside Toolbar slots.
|
|
2715
|
+
*
|
|
2716
|
+
* Wraps the project's `IconButton` and adds:
|
|
2717
|
+
* - Three emphasis styles (`standard`, `tonal`, `filled`) via `emphasis` prop.
|
|
2718
|
+
* - Three width sizes (`narrow`, `default`, `wide`) for visual hierarchy.
|
|
2719
|
+
* - Always `rounded-full` shape (required for floating toolbars per MD3 spec).
|
|
2720
|
+
* - Always 48dp height to meet MD3 accessibility touch-target requirements.
|
|
2721
|
+
*
|
|
2722
|
+
* @example
|
|
2723
|
+
* ```tsx
|
|
2724
|
+
* // Standard (default) — use for most actions
|
|
2725
|
+
* <ToolbarIconButton aria-label="Share">
|
|
2726
|
+
* <ShareIcon />
|
|
2727
|
+
* </ToolbarIconButton>
|
|
2728
|
+
*
|
|
2729
|
+
* // Filled + wide — use for the single highest-priority action
|
|
2730
|
+
* <ToolbarIconButton emphasis="filled" toolbarSize="wide" aria-label="Add">
|
|
2731
|
+
* <PlusIcon />
|
|
2732
|
+
* </ToolbarIconButton>
|
|
2733
|
+
* ```
|
|
2734
|
+
*
|
|
2735
|
+
* @see https://m3.material.io/components/toolbars/guidelines
|
|
2736
|
+
*/
|
|
2737
|
+
declare const ToolbarIconButton: React$1.ForwardRefExoticComponent<Omit<ToolbarIconButtonProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
2738
|
+
|
|
2739
|
+
/**
|
|
2740
|
+
* Design tokens for the ToolbarDivider component.
|
|
2741
|
+
* The divider is a decorative separator used to group toolbar actions.
|
|
2742
|
+
*/
|
|
2743
|
+
declare const ToolbarDividerTokens: {
|
|
2744
|
+
/** Divider line thickness in px */
|
|
2745
|
+
readonly Thickness: 1;
|
|
2746
|
+
/** Divider size as a fraction of the toolbar container dimension */
|
|
2747
|
+
readonly HeightRatio: 0.5;
|
|
2748
|
+
};
|
|
2749
|
+
/**
|
|
2750
|
+
* Design tokens for the ToolbarIconButton component.
|
|
2751
|
+
* Sizes follow MD3 Expressive touch-target minimums (48dp height always).
|
|
2752
|
+
* - narrow: de-emphasised secondary actions
|
|
2753
|
+
* - default: standard icon button
|
|
2754
|
+
* - wide: primary action emphasis inside the toolbar
|
|
2755
|
+
*/
|
|
2756
|
+
declare const ToolbarIconButtonTokens: {
|
|
2757
|
+
readonly NarrowWidth: 40;
|
|
2758
|
+
readonly DefaultWidth: 48;
|
|
2759
|
+
readonly WideWidth: 64;
|
|
2760
|
+
/** Minimum touch-target height per MD3 accessibility guidelines */
|
|
2761
|
+
readonly Height: 48;
|
|
2762
|
+
/** Icon size in dp — larger than standard 24dp to fill the 48dp button properly */
|
|
2763
|
+
readonly IconSize: 28;
|
|
2764
|
+
};
|
|
2765
|
+
|
|
2766
|
+
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, type UseAppBarScrollReturn, type UseFloatingToolbarScrollBehaviorOptions, VIBRANT_COLORS, VerticalFloatingToolbar, VerticalFloatingToolbarWithFab, VerticalMenu, VerticalMenuContent, type VerticalMenuContentProps, VerticalMenuDivider, type VerticalMenuDividerProps, VerticalMenuGroup, type VerticalMenuGroupProps, type VerticalMenuProps, type VerticalMenuSeparatorStyle, appBarTypography, standardFloatingToolbarColors, useAppBarScroll, useFloatingToolbarScrollBehavior, useMenuContext, useSearch, useSearchKeyboard, vibrantFloatingToolbarColors };
|