react-material-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 +39 -0
- package/LICENSE +21 -0
- package/README.md +286 -0
- package/dist/index.cjs +7014 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2068 -0
- package/dist/index.d.ts +2068 -0
- package/dist/index.js +6941 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/theme.css +187 -0
- package/docs/components/Amount.md +48 -0
- package/docs/components/Avatar.md +69 -0
- package/docs/components/AvatarStack.md +50 -0
- package/docs/components/Badge.md +50 -0
- package/docs/components/Blob.md +44 -0
- package/docs/components/Button.md +79 -0
- package/docs/components/ButtonGroup.md +46 -0
- package/docs/components/ButtonGroupConnected.md +62 -0
- package/docs/components/Card.md +52 -0
- package/docs/components/Checkbox.md +45 -0
- package/docs/components/Chips.md +77 -0
- package/docs/components/DatePicker.md +112 -0
- package/docs/components/Dialog.md +83 -0
- package/docs/components/Divider.md +48 -0
- package/docs/components/Dropdown.md +79 -0
- package/docs/components/FAB.md +63 -0
- package/docs/components/FABMenu.md +76 -0
- package/docs/components/Gallery.md +35 -0
- package/docs/components/Icon.md +36 -0
- package/docs/components/IconButton.md +69 -0
- package/docs/components/Img.md +52 -0
- package/docs/components/Layers.md +43 -0
- package/docs/components/Link.md +43 -0
- package/docs/components/List.md +87 -0
- package/docs/components/Loading.md +67 -0
- package/docs/components/LoadingIndicator.md +64 -0
- package/docs/components/MaterialSymbol.md +48 -0
- package/docs/components/MediaFrame.md +46 -0
- package/docs/components/Menu.md +149 -0
- package/docs/components/NavigationBar.md +78 -0
- package/docs/components/NavigationRail.md +105 -0
- package/docs/components/OverflowMenu.md +65 -0
- package/docs/components/Perspective.md +45 -0
- package/docs/components/Progress.md +83 -0
- package/docs/components/Radio.md +39 -0
- package/docs/components/Search.md +100 -0
- package/docs/components/Select.md +76 -0
- package/docs/components/Sheets.md +62 -0
- package/docs/components/Slider.md +89 -0
- package/docs/components/Snackbar.md +73 -0
- package/docs/components/SplitButton.md +75 -0
- package/docs/components/Stories.md +71 -0
- package/docs/components/Switch.md +40 -0
- package/docs/components/Table.md +67 -0
- package/docs/components/Tabs.md +67 -0
- package/docs/components/TextElement.md +37 -0
- package/docs/components/TextField.md +70 -0
- package/docs/components/TimePicker.md +83 -0
- package/docs/components/ToggleTheme.md +71 -0
- package/docs/components/Toolbar.md +102 -0
- package/docs/components/Tooltip.md +63 -0
- package/docs/components/TopAppBar.md +84 -0
- package/docs/components/Video.md +35 -0
- package/llms.txt +90 -0
- package/package.json +101 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2068 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, CSSProperties, MouseEventHandler, ComponentProps, MouseEvent } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Structural type of a statically imported image (matches the object shape
|
|
6
|
+
* produced by bundlers such as Next.js without depending on them).
|
|
7
|
+
*/
|
|
8
|
+
interface StaticImageData {
|
|
9
|
+
src: string;
|
|
10
|
+
height: number;
|
|
11
|
+
width: number;
|
|
12
|
+
blurDataURL?: string;
|
|
13
|
+
blurWidth?: number;
|
|
14
|
+
blurHeight?: number;
|
|
15
|
+
}
|
|
16
|
+
/** Accepted source for image-like components. */
|
|
17
|
+
type ImageSrc = string | StaticImageData;
|
|
18
|
+
|
|
19
|
+
type ObjectFit = "fill" | "contain" | "cover" | "none" | "scale-down";
|
|
20
|
+
/** Context handed to a `render` prop so custom media (e.g. a framework
|
|
21
|
+
* image component) can reuse the resolved src and layout classes. */
|
|
22
|
+
interface MediaRenderContext {
|
|
23
|
+
alt: string;
|
|
24
|
+
className: string;
|
|
25
|
+
src?: string;
|
|
26
|
+
style: CSSProperties;
|
|
27
|
+
}
|
|
28
|
+
/** Shared injection props for image-like components.
|
|
29
|
+
* Priority: render > image > children > native <img>. */
|
|
30
|
+
interface MediaInjectionProps {
|
|
31
|
+
/** Fallback media node (lowest injection priority). */
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
/** Pre-built media node, e.g. `<Image .../>` from a framework. */
|
|
34
|
+
image?: ReactNode;
|
|
35
|
+
/** Full-control render prop; receives the resolved src and classes. */
|
|
36
|
+
render?: (media: MediaRenderContext) => ReactNode;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface AvatarProps extends MediaInjectionProps {
|
|
40
|
+
alt?: string;
|
|
41
|
+
/** Show a large badge (top-right). */
|
|
42
|
+
badge?: boolean;
|
|
43
|
+
/** Class override for the badge (e.g. a different container color). */
|
|
44
|
+
badgeColor?: string;
|
|
45
|
+
badgeIcon?: ReactNode;
|
|
46
|
+
badgeText?: string;
|
|
47
|
+
className?: string;
|
|
48
|
+
/** Show a small dot badge (top-right). */
|
|
49
|
+
dotBadge?: boolean;
|
|
50
|
+
height?: number;
|
|
51
|
+
/** Initials (or any short text) shown when there is no image. */
|
|
52
|
+
name?: string;
|
|
53
|
+
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
54
|
+
/** Fallback node when there is no image nor name. */
|
|
55
|
+
placeholder?: ReactNode;
|
|
56
|
+
radius?: number;
|
|
57
|
+
/** Animated decorative ring (token-based gradient). */
|
|
58
|
+
ring?: boolean;
|
|
59
|
+
size?: number;
|
|
60
|
+
/** Show a count badge overlapping the avatar. */
|
|
61
|
+
smallBadge?: boolean;
|
|
62
|
+
src?: ImageSrc;
|
|
63
|
+
style?: CSSProperties;
|
|
64
|
+
width?: number;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Avatar with optional badges and decorative ring. Media is injectable
|
|
68
|
+
* (render > image > children) with a native <img> fallback; initials or a
|
|
69
|
+
* placeholder icon show when there is no image.
|
|
70
|
+
*/
|
|
71
|
+
declare function Avatar({ alt, badge, badgeColor, badgeIcon, badgeText, children, className, dotBadge, height, image, name, onClick, placeholder, radius, render, ring, size, smallBadge, src, style, width, }: AvatarProps): react.JSX.Element;
|
|
72
|
+
|
|
73
|
+
interface AvatarStackItem {
|
|
74
|
+
alt?: string;
|
|
75
|
+
height?: number;
|
|
76
|
+
id: string;
|
|
77
|
+
initials?: string;
|
|
78
|
+
src?: ImageSrc;
|
|
79
|
+
width?: number;
|
|
80
|
+
}
|
|
81
|
+
interface AvatarStackProps {
|
|
82
|
+
avatars: AvatarStackItem[];
|
|
83
|
+
className?: string;
|
|
84
|
+
size?: number;
|
|
85
|
+
}
|
|
86
|
+
/** Overlapping avatar row with a surface ring and hover raise. */
|
|
87
|
+
declare function AvatarStack({ avatars, className, size }: AvatarStackProps): react.JSX.Element;
|
|
88
|
+
|
|
89
|
+
interface BadgeProps extends ComponentProps<"div"> {
|
|
90
|
+
icon?: ReactNode;
|
|
91
|
+
iconLeft?: ReactNode;
|
|
92
|
+
iconRight?: ReactNode;
|
|
93
|
+
/** Content fallback when no children are passed. */
|
|
94
|
+
text?: ReactNode;
|
|
95
|
+
}
|
|
96
|
+
/** M3 large badge: shape full, error container, label-small, min 16px. */
|
|
97
|
+
declare function Badge({ children, className, icon, iconLeft, iconRight, text, ...props }: BadgeProps): react.JSX.Element;
|
|
98
|
+
|
|
99
|
+
type DotBadgeProps = ComponentProps<"div">;
|
|
100
|
+
/** M3 small badge: 6px dot, error container. */
|
|
101
|
+
declare function DotBadge({ className, ...props }: DotBadgeProps): react.JSX.Element;
|
|
102
|
+
|
|
103
|
+
interface OnIconBadgeProps extends ComponentProps<"div"> {
|
|
104
|
+
/** Count fallback when no children are passed. */
|
|
105
|
+
count?: ReactNode;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Count badge anchored to the top-right corner of an icon. Place it inside
|
|
109
|
+
* a relatively-positioned wrapper around the icon.
|
|
110
|
+
*/
|
|
111
|
+
declare function OnIconBadge({ children, className, count, ...props }: OnIconBadgeProps): react.JSX.Element;
|
|
112
|
+
|
|
113
|
+
interface BlobProps {
|
|
114
|
+
children?: ReactNode;
|
|
115
|
+
className?: string;
|
|
116
|
+
/** Background class (token-based), e.g. "bg-tertiary/10". */
|
|
117
|
+
color?: string;
|
|
118
|
+
/** Phase offset into the morph loop, in ms (stagger multiple blobs). */
|
|
119
|
+
delay?: number;
|
|
120
|
+
height?: number;
|
|
121
|
+
/** Position classes; defaults to centered. */
|
|
122
|
+
position?: string;
|
|
123
|
+
width?: number;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Decorative blurred blob with organic border-radius morphing. Position it
|
|
127
|
+
* inside a relatively-positioned container.
|
|
128
|
+
*/
|
|
129
|
+
declare function Blob({ children, className, color, delay, height, position, width, }: BlobProps): react.JSX.Element;
|
|
130
|
+
|
|
131
|
+
type ButtonVariant = "filled" | "tonal" | "outlined" | "elevated" | "text";
|
|
132
|
+
/** M3 Expressive button sizes: 32 / 40 / 56 / 96 / 136. */
|
|
133
|
+
type ButtonSize = "xs" | "s" | "m" | "l" | "xl";
|
|
134
|
+
/** M3 Expressive button shapes: round (full) or square (per-size). */
|
|
135
|
+
type ButtonShape = "round" | "square";
|
|
136
|
+
interface ButtonProps extends ComponentProps<"button"> {
|
|
137
|
+
iconLeft?: ReactNode;
|
|
138
|
+
iconRight?: ReactNode;
|
|
139
|
+
/** M3 Expressive toggle: selected/unselected colors per variant (the
|
|
140
|
+
* text variant has no toggle) and the shape follows the selection
|
|
141
|
+
* (unselected round, selected square) when `size` is set. Emits
|
|
142
|
+
* aria-pressed, so connected button groups pick it up. */
|
|
143
|
+
selected?: boolean;
|
|
144
|
+
/** M3 Expressive shape: round (default) or square. Pressing morphs
|
|
145
|
+
* to the opposite shape. */
|
|
146
|
+
shape?: ButtonShape;
|
|
147
|
+
/** M3 Expressive size (xs 32 / s 40 / m 56 / l 96 / xl 136) with
|
|
148
|
+
* per-size label scale, icon, symmetric padding and square radius.
|
|
149
|
+
* Default `s` (the spec's small, the default button size). */
|
|
150
|
+
size?: ButtonSize;
|
|
151
|
+
/** Label fallback when no children are passed. */
|
|
152
|
+
text?: string;
|
|
153
|
+
variant?: ButtonVariant;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* M3 Expressive button. Five sizes (xs 32 / s 40 / m 56 / l 96 / xl 136,
|
|
157
|
+
* default `s`) with per-size label scale, icon, symmetric padding and
|
|
158
|
+
* square radius; shape (round/square + pressed morph) and toggle
|
|
159
|
+
* (selected) variants.
|
|
160
|
+
*/
|
|
161
|
+
declare function Button({ children, className, iconLeft, iconRight, selected, shape, size, text, type, variant, ...props }: ButtonProps): react.JSX.Element;
|
|
162
|
+
|
|
163
|
+
interface ButtonGroupProps {
|
|
164
|
+
/** Buttons or icon buttons (pass them the same `size`). */
|
|
165
|
+
children?: ReactNode;
|
|
166
|
+
className?: string;
|
|
167
|
+
/** Accessible label for the group. */
|
|
168
|
+
label?: string;
|
|
169
|
+
/** M3 Expressive size — sets the spacing and press-morph metrics to
|
|
170
|
+
* match the buttons inside. */
|
|
171
|
+
size?: ButtonSize;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* M3 Expressive standard button group: an invisible container that spaces
|
|
175
|
+
* its buttons (18/12/8/8/8 per size) and adds interaction between them —
|
|
176
|
+
* pressing a button widens it while the buttons directly next to it
|
|
177
|
+
* compress, on the shared 200ms emphasized morph. Buttons keep their own
|
|
178
|
+
* colors, states and toggle behavior; avoid text and standard icon
|
|
179
|
+
* buttons (no container treatment, per spec).
|
|
180
|
+
*/
|
|
181
|
+
declare function ButtonGroup({ children, className, label, size, }: ButtonGroupProps): react.JSX.Element;
|
|
182
|
+
|
|
183
|
+
interface ButtonGroupConnectedProps {
|
|
184
|
+
/** Buttons or icon buttons with the same `size`; toggle buttons
|
|
185
|
+
* (`selected`) drive the selection shape via aria-pressed. */
|
|
186
|
+
children?: ReactNode;
|
|
187
|
+
className?: string;
|
|
188
|
+
/** Accessible label for the group. */
|
|
189
|
+
label?: string;
|
|
190
|
+
/** Outer corners: full (round) or the per-size square value. */
|
|
191
|
+
shape?: "round" | "square";
|
|
192
|
+
/** M3 Expressive size matching the buttons inside. */
|
|
193
|
+
size?: ButtonSize;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* M3 Expressive connected button group: buttons joined by 2dp gaps where
|
|
197
|
+
* the group controls the corners — outer edges keep the group shape
|
|
198
|
+
* (full or square per size) and inner corners stay small (8/8/8/16/20),
|
|
199
|
+
* sharpening while pressed (4/4/4/12/16) and rounding to full when a
|
|
200
|
+
* toggle button is selected. Unlike the standard group there is no
|
|
201
|
+
* interaction between neighbors. Successor of the segmented buttons.
|
|
202
|
+
*/
|
|
203
|
+
declare function ButtonGroupConnected({ children, className, label, shape, size, }: ButtonGroupConnectedProps): react.JSX.Element;
|
|
204
|
+
|
|
205
|
+
/** M3E color styles: primary/secondary/tertiary = the *-container sets
|
|
206
|
+
* (primary-container is the spec default). */
|
|
207
|
+
type ExtendedFABVariant = "primary" | "secondary" | "tertiary";
|
|
208
|
+
/** M3 Expressive extended FAB sizes: small 56 / medium 80 / large 96. */
|
|
209
|
+
type ExtendedFABSize = "small" | "medium" | "large";
|
|
210
|
+
interface ExtendedFABProps extends ComponentProps<"button"> {
|
|
211
|
+
/** Leading icon (24/28/36px box per size). */
|
|
212
|
+
icon?: ReactNode;
|
|
213
|
+
/** M3 Expressive size (small 56 / medium 80 / large 96). */
|
|
214
|
+
size?: ExtendedFABSize;
|
|
215
|
+
/** Label fallback when no children are passed. */
|
|
216
|
+
text?: string;
|
|
217
|
+
variant?: ExtendedFABVariant;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* M3 Expressive extended FAB. Small (default): height 56, shape large,
|
|
221
|
+
* title-medium label, icon 24, symmetric 16dp padding, gap 8. Medium 80
|
|
222
|
+
* (large-increased, title-large, icon 28, padding 26, gap 12) and large
|
|
223
|
+
* 96 (extra-large, headline-small, icon 36, padding 28, gap 16).
|
|
224
|
+
* Elevation 3→4. (The surface color style is no longer recommended in M3
|
|
225
|
+
* Expressive; the default is primary = primary-container.)
|
|
226
|
+
*/
|
|
227
|
+
declare function ExtendedFAB({ children, className, icon, size, text, type, variant, ...props }: ExtendedFABProps): react.JSX.Element;
|
|
228
|
+
|
|
229
|
+
type FABSize = "fab" | "fabMedium" | "fabLarge";
|
|
230
|
+
/** M3E color styles: primary/secondary/tertiary = the *-container sets
|
|
231
|
+
* (primary-container is the spec default). */
|
|
232
|
+
type FABVariant = "primary" | "secondary" | "tertiary";
|
|
233
|
+
interface FABProps extends ComponentProps<"button"> {
|
|
234
|
+
/** Icon node. 24px box (28 for fabMedium, 36 for fabLarge). */
|
|
235
|
+
icon?: ReactNode;
|
|
236
|
+
/** Container: 56 (fab) / 80 (fabMedium, default — "most recommended"
|
|
237
|
+
* per the spec) / 96 (fabLarge). */
|
|
238
|
+
size?: FABSize;
|
|
239
|
+
variant?: FABVariant;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* M3 Expressive floating action button. Sizes 56/80/96 (default medium 80,
|
|
243
|
+
* "most recommended"; the small 40 FAB and the surface color style are no
|
|
244
|
+
* longer recommended in M3 Expressive) with shapes large/large-increased/
|
|
245
|
+
* extra-large, elevation level 3 (level 4 on hover). Icon-only — pass an
|
|
246
|
+
* accessible name (aria-label).
|
|
247
|
+
*/
|
|
248
|
+
declare function FAB({ children, className, icon, size, type, variant, ...props }: FABProps): react.JSX.Element;
|
|
249
|
+
|
|
250
|
+
/** FAB menu color sets (md.comp.fab-menu tokens). */
|
|
251
|
+
type FABMenuVariant = "primary" | "secondary" | "tertiary";
|
|
252
|
+
interface FABMenuItemProps {
|
|
253
|
+
className?: string;
|
|
254
|
+
/** Leading icon (24px box, spec menu-item.icon). */
|
|
255
|
+
icon?: ReactNode;
|
|
256
|
+
label?: ReactNode;
|
|
257
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
258
|
+
}
|
|
259
|
+
/** M3 Expressive FAB menu item: a medium-button pill (h 56, title-medium,
|
|
260
|
+
* icon 24) colored by the parent FABMenu set. */
|
|
261
|
+
declare function FABMenuItem({ className, icon, label, onClick }: FABMenuItemProps): react.JSX.Element;
|
|
262
|
+
interface FABMenuLabels {
|
|
263
|
+
/** aria-label for the trigger while open. Default "Close menu". */
|
|
264
|
+
close?: string;
|
|
265
|
+
/** aria-label for the trigger while closed. Default "Open menu". */
|
|
266
|
+
open?: string;
|
|
267
|
+
}
|
|
268
|
+
interface FABMenuProps {
|
|
269
|
+
/** Menu items (FABMenu.Item list), revealed above the FAB. */
|
|
270
|
+
children?: ReactNode;
|
|
271
|
+
className?: string;
|
|
272
|
+
/** FAB icon while closed (24px box). */
|
|
273
|
+
icon?: ReactNode;
|
|
274
|
+
/** Customizable accessible names for the trigger. */
|
|
275
|
+
labels?: FABMenuLabels;
|
|
276
|
+
variant?: FABMenuVariant;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* M3 Expressive FAB menu: a 56dp FAB that morphs into a fully-round close
|
|
280
|
+
* button (icon crossfades/rotates into an X, container saturates to the
|
|
281
|
+
* set color) and reveals up to six menu-item pills above it, right-aligned
|
|
282
|
+
* and staggered bottom-up (8dp to the FAB, 4dp between items). Items are
|
|
283
|
+
* medium-button pills on the set's container color. Position the wrapper
|
|
284
|
+
* yourself (e.g. fixed bottom-right with 16dp margins per spec).
|
|
285
|
+
*/
|
|
286
|
+
declare function FABMenu({ children, className, icon, labels, variant, }: FABMenuProps): react.JSX.Element;
|
|
287
|
+
declare namespace FABMenu {
|
|
288
|
+
var Item: typeof FABMenuItem;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
type IconButtonVariant = "filled" | "tonal" | "outlined" | "standard";
|
|
292
|
+
/** M3 Expressive icon button sizes: 32 / 40 / 56 / 96 / 136. */
|
|
293
|
+
type IconButtonSize = "xs" | "s" | "m" | "l" | "xl";
|
|
294
|
+
/** M3 Expressive icon button shapes. */
|
|
295
|
+
type IconButtonShape = "round" | "square";
|
|
296
|
+
/** M3 Expressive icon button width: narrow / default / wide. */
|
|
297
|
+
type IconButtonWidth = "narrow" | "default" | "wide";
|
|
298
|
+
interface IconButtonProps extends ComponentProps<"button"> {
|
|
299
|
+
/** Icon node (24px box by default). Children work as a fallback
|
|
300
|
+
* slot. */
|
|
301
|
+
icon?: ReactNode;
|
|
302
|
+
/** M3 Expressive toggle: selected/unselected colors per variant; the
|
|
303
|
+
* shape also flips (unselected round, selected square). */
|
|
304
|
+
selected?: boolean;
|
|
305
|
+
/** M3 Expressive shape: round (default) or square. Pressing morphs
|
|
306
|
+
* to the opposite shape. */
|
|
307
|
+
shape?: IconButtonShape;
|
|
308
|
+
/** M3 Expressive size (xs 32 / s 40 / m 56 / l 96 / xl 136). Default
|
|
309
|
+
* s — the classic 40x40 icon button. */
|
|
310
|
+
size?: IconButtonSize;
|
|
311
|
+
variant?: IconButtonVariant;
|
|
312
|
+
/** M3 Expressive width: narrow / default / wide. */
|
|
313
|
+
width?: IconButtonWidth;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* M3 icon button: 40x40 visual container (48x48 touch target), icon 24,
|
|
317
|
+
* with the M3 Expressive size/shape/width and toggle (selected) variants.
|
|
318
|
+
* Icon-only — remember to pass an accessible name (aria-label).
|
|
319
|
+
*/
|
|
320
|
+
declare function IconButton({ children, className, icon, selected, shape, size, type, variant, width, ...props }: IconButtonProps): react.JSX.Element;
|
|
321
|
+
|
|
322
|
+
interface MenuItemProps {
|
|
323
|
+
/** Trailing error badge; pass a string for the count/label. */
|
|
324
|
+
badge?: boolean | string;
|
|
325
|
+
children?: ReactNode;
|
|
326
|
+
className?: string;
|
|
327
|
+
disabled?: boolean;
|
|
328
|
+
/** Keep the menu open after activation (e.g. a multi-select toggle). */
|
|
329
|
+
keepOpen?: boolean;
|
|
330
|
+
label?: ReactNode;
|
|
331
|
+
leftElement?: ReactNode;
|
|
332
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
333
|
+
/** Trailing meta — shortcut text (label-large) or a 20px icon. */
|
|
334
|
+
rightElement?: ReactNode;
|
|
335
|
+
/** Selected: tertiary-container fill + corner-medium morph (M3E). */
|
|
336
|
+
selected?: boolean;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* M3E vertical-menu item: 48 tall, inset state layer (44, corner
|
|
340
|
+
* extra-small) with label-large, 20dp leading/trailing icons, 12dp
|
|
341
|
+
* padding. First/last items round their outer corner toward the menu;
|
|
342
|
+
* selected morphs the state layer to corner-medium with a tertiary fill.
|
|
343
|
+
*/
|
|
344
|
+
declare function MenuItem({ badge, children, className, disabled, keepOpen, label, leftElement, onClick, rightElement, selected, }: MenuItemProps): react.JSX.Element;
|
|
345
|
+
|
|
346
|
+
/** Split buttons have no text variant (M3 Expressive spec). */
|
|
347
|
+
type SplitButtonVariant = "elevated" | "filled" | "tonal" | "outlined";
|
|
348
|
+
interface SplitButtonLabels {
|
|
349
|
+
/** aria-label for the trailing menu button. Default "More options". */
|
|
350
|
+
menu?: string;
|
|
351
|
+
}
|
|
352
|
+
interface SplitButtonProps {
|
|
353
|
+
children?: ReactNode;
|
|
354
|
+
className?: string;
|
|
355
|
+
disabled?: boolean;
|
|
356
|
+
/** Leading button icon (sized like the Button icon per size). */
|
|
357
|
+
iconLeft?: ReactNode;
|
|
358
|
+
/** Customizable accessible names. */
|
|
359
|
+
labels?: SplitButtonLabels;
|
|
360
|
+
/** Menu content (SplitButton.Item list), opened by the trailing
|
|
361
|
+
* button and anchored to its bottom right. */
|
|
362
|
+
menu?: ReactNode;
|
|
363
|
+
/** Class for the menu container. */
|
|
364
|
+
menuClassName?: string;
|
|
365
|
+
/** Leading button action. */
|
|
366
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
367
|
+
/** M3 Expressive size (xs 32 / s 40 / m 56 / l 96 / xl 136). */
|
|
368
|
+
size?: ButtonSize;
|
|
369
|
+
/** Label fallback when no children are passed. */
|
|
370
|
+
text?: string;
|
|
371
|
+
variant?: SplitButtonVariant;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* M3 Expressive split button: a leading action button and a trailing menu
|
|
375
|
+
* button separated by a 2dp gap, with full outer corners and inner
|
|
376
|
+
* corners that morph on hover/focus/press (4/4/4/8/12 → 8/12/12/20/20 per
|
|
377
|
+
* size). While the menu is open the trailing button rounds to full,
|
|
378
|
+
* centers its caret (rotated 180°) and keeps a pressed state layer; the
|
|
379
|
+
* container colors never change on selection. Colors, state layers,
|
|
380
|
+
* elevation and disabled states are the standard button ones.
|
|
381
|
+
*/
|
|
382
|
+
declare function SplitButton({ children, className, disabled, iconLeft, labels, menu, menuClassName, onClick, size, text, variant, }: SplitButtonProps): react.JSX.Element;
|
|
383
|
+
declare namespace SplitButton {
|
|
384
|
+
var Item: typeof MenuItem;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
type CardBodyProps = ComponentProps<"div">;
|
|
388
|
+
declare function CardBody({ children, className, ...props }: CardBodyProps): react.JSX.Element;
|
|
389
|
+
|
|
390
|
+
type CardFooterProps = ComponentProps<"div">;
|
|
391
|
+
declare function CardFooter({ children, className, ...props }: CardFooterProps): react.JSX.Element;
|
|
392
|
+
|
|
393
|
+
type CardHeaderProps = ComponentProps<"div">;
|
|
394
|
+
declare function CardHeader({ children, className, ...props }: CardHeaderProps): react.JSX.Element;
|
|
395
|
+
|
|
396
|
+
type CardVariant = "elevated" | "filled" | "outlined";
|
|
397
|
+
interface CardProps extends ComponentProps<"div"> {
|
|
398
|
+
variant?: CardVariant;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* M3 card (shape medium). Variants per spec: elevated = surface-container-low
|
|
402
|
+
* + level 1, filled = surface-container-highest, outlined = surface +
|
|
403
|
+
* outline-variant border. Compose content with Card.Header / Card.Body /
|
|
404
|
+
* Card.Footer.
|
|
405
|
+
*/
|
|
406
|
+
declare function Card({ children, className, variant, ...props }: CardProps): react.JSX.Element;
|
|
407
|
+
declare namespace Card {
|
|
408
|
+
var Header: typeof CardHeader;
|
|
409
|
+
var Body: typeof CardBody;
|
|
410
|
+
var Footer: typeof CardFooter;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
type ChipsVariant = "assist" | "filter" | "input" | "suggestion";
|
|
414
|
+
interface ChipsLabels {
|
|
415
|
+
/** aria-label for the trailing remove affordance. Default "Remove". */
|
|
416
|
+
remove?: string;
|
|
417
|
+
}
|
|
418
|
+
interface ChipsProps extends ComponentProps<"button"> {
|
|
419
|
+
/** Input chips: renders the leading element as a 24dp avatar with the
|
|
420
|
+
* 4dp leading padding from the spec measurements (other variants
|
|
421
|
+
* ignore it, like the spec). */
|
|
422
|
+
avatar?: boolean;
|
|
423
|
+
/** Elevated chip: surface-container-low at level 1 instead of the
|
|
424
|
+
* outline (assist/filter/suggestion; input chips are always flat). */
|
|
425
|
+
elevated?: boolean;
|
|
426
|
+
/** Customizable accessible names. */
|
|
427
|
+
labels?: ChipsLabels;
|
|
428
|
+
/** Leading element (icon/avatar, 18px box). */
|
|
429
|
+
leftElement?: ReactNode;
|
|
430
|
+
/** Removable input chips: renders a trailing remove affordance. */
|
|
431
|
+
onRemove?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
432
|
+
/** Trailing element (18px box). */
|
|
433
|
+
rightElement?: ReactNode;
|
|
434
|
+
/** Selected state (filter/input). */
|
|
435
|
+
selected?: boolean;
|
|
436
|
+
/** Label fallback when no children are passed. */
|
|
437
|
+
text?: string;
|
|
438
|
+
variant?: ChipsVariant;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* M3 chip (height 32, shape small, label-large). Padding 16, reduced to 8
|
|
442
|
+
* on the icon/remove side. Selected filter/input chips use
|
|
443
|
+
* secondary-container; assist/suggestion leading icons tint primary.
|
|
444
|
+
* Elevated chips swap the outline for surface-container-low at level 1
|
|
445
|
+
* (2 on hover, 1 pressed, none disabled).
|
|
446
|
+
*/
|
|
447
|
+
declare function Chips({ avatar, children, className, disabled, elevated, labels, leftElement, onRemove, rightElement, selected, text, type, variant, ...props }: ChipsProps): react.JSX.Element;
|
|
448
|
+
|
|
449
|
+
interface TextContainerProps {
|
|
450
|
+
children?: ReactNode;
|
|
451
|
+
className?: string;
|
|
452
|
+
/** Content fallback when no children are passed. */
|
|
453
|
+
data?: ReactNode;
|
|
454
|
+
/** Width class (default w-[300px]) to keep long text readable. */
|
|
455
|
+
width?: string;
|
|
456
|
+
}
|
|
457
|
+
/** Fixed-width wrapper for long text inside table cells. */
|
|
458
|
+
declare function TextContainer({ children, className, data, width }: TextContainerProps): react.JSX.Element;
|
|
459
|
+
|
|
460
|
+
type TableBodyProps = ComponentProps<"tbody">;
|
|
461
|
+
declare function TableBody({ children, className, ...props }: TableBodyProps): react.JSX.Element;
|
|
462
|
+
|
|
463
|
+
interface TableCellProps extends ComponentProps<"td"> {
|
|
464
|
+
/** Content fallback when no children are passed. */
|
|
465
|
+
data?: ReactNode;
|
|
466
|
+
}
|
|
467
|
+
declare function TableCell({ children, className, data, ...props }: TableCellProps): react.JSX.Element;
|
|
468
|
+
|
|
469
|
+
type TableHeadProps = ComponentProps<"thead">;
|
|
470
|
+
declare function TableHead({ children, className, ...props }: TableHeadProps): react.JSX.Element;
|
|
471
|
+
|
|
472
|
+
interface TableHeaderCellProps extends ComponentProps<"th"> {
|
|
473
|
+
/** Content fallback when no children are passed. */
|
|
474
|
+
data?: ReactNode;
|
|
475
|
+
}
|
|
476
|
+
declare function TableHeaderCell({ children, className, data, ...props }: TableHeaderCellProps): react.JSX.Element;
|
|
477
|
+
|
|
478
|
+
type TableRowProps = ComponentProps<"tr">;
|
|
479
|
+
declare function TableRow({ children, className, ...props }: TableRowProps): react.JSX.Element;
|
|
480
|
+
|
|
481
|
+
interface TableProps extends ComponentProps<"table"> {
|
|
482
|
+
/** Class for the scrollable wrapper. */
|
|
483
|
+
wrapperClassName?: string;
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Data table (horizontal-scroll wrapper included). Compose with
|
|
487
|
+
* Table.Head / Table.Body / Table.Row / Table.Cell / Table.HeaderCell /
|
|
488
|
+
* Table.TextContainer. Data always comes from the consumer.
|
|
489
|
+
*/
|
|
490
|
+
declare function Table({ children, className, wrapperClassName, ...props }: TableProps): react.JSX.Element;
|
|
491
|
+
declare namespace Table {
|
|
492
|
+
var Body: typeof TableBody;
|
|
493
|
+
var Cell: typeof TableCell;
|
|
494
|
+
var Head: typeof TableHead;
|
|
495
|
+
var HeaderCell: typeof TableHeaderCell;
|
|
496
|
+
var Row: typeof TableRow;
|
|
497
|
+
var TextContainer: typeof TextContainer;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
interface CalendarLabels {
|
|
501
|
+
/** aria-label for the next-month button. Default "Next month". */
|
|
502
|
+
nextMonth?: string;
|
|
503
|
+
/** aria-label for the previous-month button. Default "Previous month". */
|
|
504
|
+
previousMonth?: string;
|
|
505
|
+
/** aria-label for the year-grid toggle. Default "Select year". */
|
|
506
|
+
selectYear?: string;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
interface DatePickerLabels extends CalendarLabels {
|
|
510
|
+
/** Cancel action. Default "Cancel". */
|
|
511
|
+
cancel?: ReactNode;
|
|
512
|
+
/** Confirm/commit action. Default "OK". */
|
|
513
|
+
confirm?: ReactNode;
|
|
514
|
+
/** Field label in keyboard-input mode. Default "Date". */
|
|
515
|
+
inputLabel?: string;
|
|
516
|
+
/** Field placeholder in keyboard-input mode. Default "mm/dd/yyyy". */
|
|
517
|
+
inputPlaceholder?: string;
|
|
518
|
+
/** Supporting line above the headline. Default "Select date". */
|
|
519
|
+
supporting?: ReactNode;
|
|
520
|
+
/** Toggle aria-label while in input mode. Default "Switch to calendar". */
|
|
521
|
+
switchToCalendar?: string;
|
|
522
|
+
/** Toggle aria-label while in calendar mode. Default "Switch to keyboard input". */
|
|
523
|
+
switchToInput?: string;
|
|
524
|
+
}
|
|
525
|
+
interface DatePickerProps {
|
|
526
|
+
/** Start in keyboard-input mode. */
|
|
527
|
+
input?: boolean;
|
|
528
|
+
isVisible: boolean;
|
|
529
|
+
/** Customizable text and accessible names. */
|
|
530
|
+
labels?: DatePickerLabels;
|
|
531
|
+
locale?: string;
|
|
532
|
+
max?: Date | null;
|
|
533
|
+
min?: Date | null;
|
|
534
|
+
onClose: () => void;
|
|
535
|
+
/** Commit (OK button). */
|
|
536
|
+
onConfirm?: (date: Date | null) => void;
|
|
537
|
+
value?: Date | null;
|
|
538
|
+
/** 0 = Sunday … 6 = Saturday. */
|
|
539
|
+
weekStartsOn?: number;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* M3 modal date picker: a 360×568 dialog (surface-container-high, level 3,
|
|
543
|
+
* extra-large 28) with a 120dp headline header, a calendar/year grid and a
|
|
544
|
+
* keyboard-input toggle. Selection is drafted and committed on OK.
|
|
545
|
+
* `DatePicker.Docked` is the field-anchored dropdown variant.
|
|
546
|
+
*/
|
|
547
|
+
declare function DatePicker(props: DatePickerProps): react.JSX.Element;
|
|
548
|
+
declare namespace DatePicker {
|
|
549
|
+
var Docked: typeof DatePickerDocked;
|
|
550
|
+
}
|
|
551
|
+
interface DatePickerDockedLabels extends CalendarLabels {
|
|
552
|
+
/** Field label. Default "Date". */
|
|
553
|
+
field?: string;
|
|
554
|
+
/** Calendar-open button aria-label. Default "Open calendar". */
|
|
555
|
+
openCalendar?: string;
|
|
556
|
+
}
|
|
557
|
+
interface DatePickerDockedProps {
|
|
558
|
+
className?: string;
|
|
559
|
+
labels?: DatePickerDockedLabels;
|
|
560
|
+
locale?: string;
|
|
561
|
+
max?: Date | null;
|
|
562
|
+
min?: Date | null;
|
|
563
|
+
onChange?: (date: Date | null) => void;
|
|
564
|
+
value?: Date | null;
|
|
565
|
+
weekStartsOn?: number;
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* M3 docked date picker: an outlined field with a calendar icon that opens
|
|
569
|
+
* a dropdown calendar anchored below it. Selection commits immediately.
|
|
570
|
+
*/
|
|
571
|
+
declare function DatePickerDocked({ className, labels, locale, max, min, onChange, value, weekStartsOn, }: DatePickerDockedProps): react.JSX.Element;
|
|
572
|
+
|
|
573
|
+
type DateRange = [Date | null, Date | null];
|
|
574
|
+
interface DateRangePickerLabels extends CalendarLabels {
|
|
575
|
+
/** Cancel action. Default "Cancel". */
|
|
576
|
+
cancel?: ReactNode;
|
|
577
|
+
/** Confirm/commit action. Default "OK". */
|
|
578
|
+
confirm?: ReactNode;
|
|
579
|
+
/** Placeholder for an unset end date. Default "End". */
|
|
580
|
+
end?: string;
|
|
581
|
+
/** Placeholder for an unset start date. Default "Start". */
|
|
582
|
+
start?: string;
|
|
583
|
+
/** Supporting line above the headline. Default "Select range". */
|
|
584
|
+
supporting?: ReactNode;
|
|
585
|
+
}
|
|
586
|
+
interface DateRangePickerProps {
|
|
587
|
+
isVisible: boolean;
|
|
588
|
+
labels?: DateRangePickerLabels;
|
|
589
|
+
locale?: string;
|
|
590
|
+
max?: Date | null;
|
|
591
|
+
min?: Date | null;
|
|
592
|
+
onClose: () => void;
|
|
593
|
+
/** Commit (OK button). */
|
|
594
|
+
onConfirm?: (range: DateRange) => void;
|
|
595
|
+
value?: DateRange;
|
|
596
|
+
weekStartsOn?: number;
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* M3 modal date range picker: drafts a start/end pair (first tap sets the
|
|
600
|
+
* start, the next sets the end) with the days between highlighted in
|
|
601
|
+
* secondary-container, committed on OK. (The Android full-screen scrolling-
|
|
602
|
+
* months layout is simplified to the standard navigable calendar.)
|
|
603
|
+
*/
|
|
604
|
+
declare function DateRangePicker(props: DateRangePickerProps): react.JSX.Element;
|
|
605
|
+
|
|
606
|
+
type DialogBodyProps = ComponentProps<"div">;
|
|
607
|
+
declare function DialogBody({ children, className, ...props }: DialogBodyProps): react.JSX.Element;
|
|
608
|
+
|
|
609
|
+
type DialogFooterProps = ComponentProps<"div">;
|
|
610
|
+
declare function DialogFooter({ children, className, ...props }: DialogFooterProps): react.JSX.Element;
|
|
611
|
+
|
|
612
|
+
interface DialogHeaderProps {
|
|
613
|
+
className?: string;
|
|
614
|
+
/** Headline (headline-small). */
|
|
615
|
+
headline?: ReactNode;
|
|
616
|
+
/** Hero icon (24px, centered, secondary color). */
|
|
617
|
+
icon?: ReactNode;
|
|
618
|
+
/** Supporting text (body-medium). */
|
|
619
|
+
text?: ReactNode;
|
|
620
|
+
}
|
|
621
|
+
declare function DialogHeader({ className, headline, icon, text }: DialogHeaderProps): react.JSX.Element;
|
|
622
|
+
|
|
623
|
+
interface DialogProps {
|
|
624
|
+
children?: ReactNode;
|
|
625
|
+
className?: string;
|
|
626
|
+
/** Close on scrim click / Escape. Default true. */
|
|
627
|
+
dismissable?: boolean;
|
|
628
|
+
isVisible: boolean;
|
|
629
|
+
/** Accessible name used when no Dialog.Header headline is rendered. */
|
|
630
|
+
label?: string;
|
|
631
|
+
onClose: () => void;
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* M3 modal dialog: shape extra-large (28), 280–560dp wide, container
|
|
635
|
+
* surface-container-high, 32% scrim. Mounts/unmounts with enter/exit
|
|
636
|
+
* animations; compose content with Dialog.Header / Dialog.Body /
|
|
637
|
+
* Dialog.Footer.
|
|
638
|
+
*/
|
|
639
|
+
declare function Dialog({ children, className, dismissable, isVisible, label, onClose, }: DialogProps): react.JSX.Element | null;
|
|
640
|
+
declare namespace Dialog {
|
|
641
|
+
var Header: typeof DialogHeader;
|
|
642
|
+
var Body: typeof DialogBody;
|
|
643
|
+
var Footer: typeof DialogFooter;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
interface DividerProps extends ComponentProps<"hr"> {
|
|
647
|
+
/**
|
|
648
|
+
* Inset the rule 16dp (M3 inset dividers, m3.material.io specs).
|
|
649
|
+
* `"start"` indents the leading edge only — the list divider, left
|
|
650
|
+
* 16 / right 0; `"middle"` both edges (middle-inset, 16/16); `"end"`
|
|
651
|
+
* the trailing edge only. Omit for a full-width rule.
|
|
652
|
+
*/
|
|
653
|
+
inset?: "start" | "middle" | "end";
|
|
654
|
+
}
|
|
655
|
+
/** M3 divider: 1px rule in outline-variant (never `outline`). */
|
|
656
|
+
declare function Divider({ className, inset, ...props }: DividerProps): react.JSX.Element;
|
|
657
|
+
|
|
658
|
+
interface DropdownProps {
|
|
659
|
+
/** Detach the menu from the trigger with a 4dp gap. */
|
|
660
|
+
apart?: boolean;
|
|
661
|
+
/** Trigger content. */
|
|
662
|
+
children: ReactNode;
|
|
663
|
+
className?: string;
|
|
664
|
+
/** Menu content (Dropdown.Item / Menu.Item list). */
|
|
665
|
+
menu?: ReactNode;
|
|
666
|
+
/** Class for the menu container. */
|
|
667
|
+
menuClassName?: string;
|
|
668
|
+
/** Vibrant (tertiary-based) color scheme instead of standard. */
|
|
669
|
+
vibrant?: boolean;
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
* Trigger + anchor for the shared M3E vertical {@link Menu}: toggles the
|
|
673
|
+
* menu below the trigger and closes on outside click, item activation or
|
|
674
|
+
* Escape (ephemeral UI state). Compose the menu with Dropdown.Item
|
|
675
|
+
* (an alias of Menu.Item) — or Menu.Label / Menu.Divider for groups.
|
|
676
|
+
*/
|
|
677
|
+
declare function Dropdown({ apart, children, className, menu, menuClassName, vibrant, }: DropdownProps): react.JSX.Element;
|
|
678
|
+
declare namespace Dropdown {
|
|
679
|
+
var Item: typeof MenuItem;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
type ImageRowProps = ComponentProps<"div">;
|
|
683
|
+
/** Horizontal row inside a Gallery (8dp gap). */
|
|
684
|
+
declare function ImageRow({ children, className, ...props }: ImageRowProps): react.JSX.Element;
|
|
685
|
+
|
|
686
|
+
type GalleryProps = ComponentProps<"div">;
|
|
687
|
+
/**
|
|
688
|
+
* Stacked media gallery (8dp gaps). Compose rows with Gallery.Row and any
|
|
689
|
+
* media (e.g. Img) inside.
|
|
690
|
+
*/
|
|
691
|
+
declare function Gallery({ children, className, ...props }: GalleryProps): react.JSX.Element;
|
|
692
|
+
declare namespace Gallery {
|
|
693
|
+
var Row: typeof ImageRow;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
interface LinkBoxProps extends ComponentProps<"a"> {
|
|
697
|
+
/** Explicit current-page state (heavier underline + aria-current);
|
|
698
|
+
* otherwise derived from href + currentPath. */
|
|
699
|
+
active?: boolean;
|
|
700
|
+
/** Current pathname from the consumer's router. */
|
|
701
|
+
currentPath?: string;
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Text link that reads as a link: primary color, underlined at rest. Native
|
|
705
|
+
* <a>; client-side routing via onClick or a wrapper. The underline is always
|
|
706
|
+
* present (not color-only) so an inline link is distinguishable from body
|
|
707
|
+
* text without relying on color — WCAG 1.4.1 (M3 publishes no link spec; the
|
|
708
|
+
* primary-vs-text contrast is only 2.64:1 light / 1.31:1 dark). The current
|
|
709
|
+
* page (active) gets a heavier underline, no color change.
|
|
710
|
+
*/
|
|
711
|
+
declare function LinkBox({ active, children, className, currentPath, href, ...props }: LinkBoxProps): react.JSX.Element;
|
|
712
|
+
|
|
713
|
+
type LinkContainerProps = ComponentProps<"a">;
|
|
714
|
+
/**
|
|
715
|
+
* Block-level link wrapping arbitrary content (cards, media...). Adds no
|
|
716
|
+
* text styling of its own. Native <a>; client-side routing via onClick or
|
|
717
|
+
* a wrapper.
|
|
718
|
+
*/
|
|
719
|
+
declare function LinkContainer({ children, className, ...props }: LinkContainerProps): react.JSX.Element;
|
|
720
|
+
|
|
721
|
+
interface ListItemProps {
|
|
722
|
+
/** Supporting text (body-medium). Switches the item to 72dp. */
|
|
723
|
+
body?: ReactNode;
|
|
724
|
+
/** Custom content replacing the text block. */
|
|
725
|
+
children?: ReactNode;
|
|
726
|
+
className?: string;
|
|
727
|
+
disabled?: boolean;
|
|
728
|
+
/** Primary text (body-large). */
|
|
729
|
+
headline?: ReactNode;
|
|
730
|
+
/** Renders the item as a native <a>. */
|
|
731
|
+
href?: string;
|
|
732
|
+
/** Overline (label-small). */
|
|
733
|
+
label?: ReactNode;
|
|
734
|
+
leftElement?: ReactNode;
|
|
735
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
736
|
+
rightElement?: ReactNode;
|
|
737
|
+
/** Selected: secondary-container fill + on-secondary-container content
|
|
738
|
+
* (visual; the consumer owns selection semantics). */
|
|
739
|
+
selected?: boolean;
|
|
740
|
+
target?: string;
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* M3 list item: 56dp one-line, 72dp with supporting text. Interactive
|
|
744
|
+
* (href/onClick) items get a state layer; navigation uses a native <a> —
|
|
745
|
+
* client-side routing via onClick or a wrapper.
|
|
746
|
+
*/
|
|
747
|
+
declare function ListItem({ body, children, className, disabled, headline, href, label, leftElement, onClick, rightElement, selected, target, }: ListItemProps): react.JSX.Element;
|
|
748
|
+
|
|
749
|
+
interface ListProps extends ComponentProps<"ul"> {
|
|
750
|
+
/** M3 list style. `expressive` (default, recommended for new designs):
|
|
751
|
+
* filled (surface-container) rounded tiles separated by a 2dp gap, with a
|
|
752
|
+
* container shape that morphs on interaction (4 → 12 → 16dp) and 20dp
|
|
753
|
+
* icons. `plain`: the transparent, rectangular list — still available in
|
|
754
|
+
* M3 Expressive. */
|
|
755
|
+
variant?: "expressive" | "plain";
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* M3 Expressive list container. The `expressive` variant (default) renders
|
|
759
|
+
* filled, gapped tiles; `plain` is the transparent, rectangular list that the
|
|
760
|
+
* spec keeps available. Transparent container (inherits the surface it sits
|
|
761
|
+
* on, e.g. inside a sheet), 8dp vertical padding. Compose with List.Item.
|
|
762
|
+
*/
|
|
763
|
+
declare function List({ children, className, variant, ...props }: ListProps): react.JSX.Element;
|
|
764
|
+
declare namespace List {
|
|
765
|
+
var Item: typeof ListItem;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
interface NavBarItemProps {
|
|
769
|
+
/** Accessible name for icon-only items (when no `label` is shown). */
|
|
770
|
+
"aria-label"?: string;
|
|
771
|
+
/** Accessible name via an element id (alternative to aria-label). */
|
|
772
|
+
"aria-labelledby"?: string;
|
|
773
|
+
/** Explicit active state; otherwise derived from href + currentPath. */
|
|
774
|
+
active?: boolean;
|
|
775
|
+
/** Icon for the active state (spec: the filled variant). */
|
|
776
|
+
activeIcon?: ReactNode;
|
|
777
|
+
badge?: boolean;
|
|
778
|
+
badgeColor?: string;
|
|
779
|
+
badgeText?: string;
|
|
780
|
+
className?: string;
|
|
781
|
+
/** Current pathname from the consumer's router. */
|
|
782
|
+
currentPath?: string;
|
|
783
|
+
dotBadge?: boolean;
|
|
784
|
+
href?: string;
|
|
785
|
+
icon?: ReactNode;
|
|
786
|
+
label?: ReactNode;
|
|
787
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
788
|
+
target?: string;
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* M3E navigation bar destination. Vertical (default): 32x56 indicator
|
|
792
|
+
* pill over the 24 icon, `label-medium` below; horizontal (bar with
|
|
793
|
+
* `horizontal`): a 40dp pill holding icon + label. The indicator springs
|
|
794
|
+
* its width/alpha from the center on selection and hosts the press
|
|
795
|
+
* ripple. Native <a> when href is given.
|
|
796
|
+
*/
|
|
797
|
+
declare function NavBarItem({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, active, activeIcon, badge, badgeColor, badgeText, className, currentPath, dotBadge, href, icon, label, onClick, target, }: NavBarItemProps): react.JSX.Element;
|
|
798
|
+
|
|
799
|
+
interface NavigationBarProps extends ComponentProps<"nav"> {
|
|
800
|
+
/** Horizontal navigation items (icon beside label inside a 40dp
|
|
801
|
+
* pill) — the spec configuration for medium windows. Items become
|
|
802
|
+
* fixed-width and centered. */
|
|
803
|
+
horizontal?: boolean;
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* M3E flexible navigation bar: height 64, surface-container, 3–5
|
|
807
|
+
* destinations. Vertical items split the width equally; `horizontal`
|
|
808
|
+
* switches to fixed-width centered items for medium windows. Compose with
|
|
809
|
+
* NavigationBar.Item.
|
|
810
|
+
*/
|
|
811
|
+
declare function NavigationBar({ children, className, horizontal, ...props }: NavigationBarProps): react.JSX.Element;
|
|
812
|
+
declare namespace NavigationBar {
|
|
813
|
+
var Item: typeof NavBarItem;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
interface NavRailItemProps {
|
|
817
|
+
/** Explicit active state; otherwise derived from href + currentPath. */
|
|
818
|
+
active?: boolean;
|
|
819
|
+
/** Icon for the active state (spec: the filled variant). */
|
|
820
|
+
activeIcon?: ReactNode;
|
|
821
|
+
badge?: boolean;
|
|
822
|
+
badgeColor?: string;
|
|
823
|
+
badgeText?: string;
|
|
824
|
+
className?: string;
|
|
825
|
+
/** Current pathname from the consumer's router. */
|
|
826
|
+
currentPath?: string;
|
|
827
|
+
dotBadge?: boolean;
|
|
828
|
+
href?: string;
|
|
829
|
+
icon?: ReactNode;
|
|
830
|
+
label?: ReactNode;
|
|
831
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
832
|
+
target?: string;
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* M3E navigation rail destination: a single always-row pill whose width
|
|
836
|
+
* is driven live by the rail's animating width (collapsed 56x32 with the
|
|
837
|
+
* `label-medium` below; expanded a full-width 56dp `label-large` row).
|
|
838
|
+
* The below-label collapses while the side-label reveals inside the
|
|
839
|
+
* growing pill, so the morph is continuous like Compose's. The indicator
|
|
840
|
+
* springs width/alpha from the center on selection and hosts the press
|
|
841
|
+
* ripple. Native <a> when href is given.
|
|
842
|
+
*/
|
|
843
|
+
declare function NavRailItem({ active, activeIcon, badge, badgeColor, badgeText, className, currentPath, dotBadge, href, icon, label, onClick, target, }: NavRailItemProps): react.JSX.Element;
|
|
844
|
+
|
|
845
|
+
interface NavigationRailLabels {
|
|
846
|
+
/** aria-label for the menu button while collapsed (click expands).
|
|
847
|
+
* Default "Expand". */
|
|
848
|
+
expand?: string;
|
|
849
|
+
/** aria-label for the menu button while expanded (click collapses).
|
|
850
|
+
* Default "Collapse". */
|
|
851
|
+
collapse?: string;
|
|
852
|
+
/** Accessible name for the FAB. Falls back to a string `fabLabel`; set
|
|
853
|
+
* this to name an icon-only FAB (the label is visually hidden while the
|
|
854
|
+
* rail is collapsed). */
|
|
855
|
+
fab?: string;
|
|
856
|
+
}
|
|
857
|
+
interface NavigationRailProps {
|
|
858
|
+
/** Bottom-aligned slot. */
|
|
859
|
+
bottom?: ReactNode;
|
|
860
|
+
/** Destinations (NavigationRail.Item list). */
|
|
861
|
+
children?: ReactNode;
|
|
862
|
+
className?: string;
|
|
863
|
+
/** Expanded rail (220dp): items morph to full-width rows and the FAB
|
|
864
|
+
* extends. Drive it from the menu button (rendered when `onMenuClick`
|
|
865
|
+
* is set). */
|
|
866
|
+
expanded?: boolean;
|
|
867
|
+
/** FAB icon (24px box). Renders the rail FAB, which morphs into an
|
|
868
|
+
* extended FAB while the rail expands. */
|
|
869
|
+
fabIcon?: ReactNode;
|
|
870
|
+
/** Extended-FAB label revealed when expanded. */
|
|
871
|
+
fabLabel?: ReactNode;
|
|
872
|
+
/** Customizable accessible names (the menu button's aria-label). */
|
|
873
|
+
labels?: NavigationRailLabels;
|
|
874
|
+
/** Icon for the menu button while collapsed. Defaults to the M3 `menu`
|
|
875
|
+
* glyph drawn by the library. */
|
|
876
|
+
menuIcon?: ReactNode;
|
|
877
|
+
/** Icon for the menu button while expanded. Defaults to the M3
|
|
878
|
+
* `menu_open` glyph drawn by the library. */
|
|
879
|
+
menuOpenIcon?: ReactNode;
|
|
880
|
+
/** Toggle handler for the menu button. Providing it renders the menu
|
|
881
|
+
* button above the FAB; the library draws the default M3 menu icon,
|
|
882
|
+
* swapping `menu` → `menu_open` with `expanded` (override either glyph
|
|
883
|
+
* with `menuIcon`/`menuOpenIcon`). Wire it to flip `expanded`. */
|
|
884
|
+
onMenuClick?: MouseEventHandler<HTMLButtonElement>;
|
|
885
|
+
/** The expanded state overlays the content as a full-window modal
|
|
886
|
+
* drawer (fixed full height matching the 32% scrim, surface-container,
|
|
887
|
+
* level 2, large end corners) instead of pushing it. The collapsed
|
|
888
|
+
* footprint stays in the layout; the overlay surface eases back to the
|
|
889
|
+
* resting rail as it collapses on close. */
|
|
890
|
+
modal?: boolean;
|
|
891
|
+
/** 80dp collapsed width instead of the default 96dp. */
|
|
892
|
+
narrow?: boolean;
|
|
893
|
+
onFabClick?: MouseEventHandler<HTMLButtonElement>;
|
|
894
|
+
/** Modal dismiss (scrim click / Escape). */
|
|
895
|
+
onClose?: () => void;
|
|
896
|
+
}
|
|
897
|
+
/**
|
|
898
|
+
* M3E navigation rail: collapsed 96dp (80 with `narrow`) on `surface`
|
|
899
|
+
* with 44dp top spacing; `expanded` morphs it to a 220dp rail with
|
|
900
|
+
* full-width row items (the spec's replacement for the navigation
|
|
901
|
+
* drawer), springing the width (default-spatial; fast-spatial when
|
|
902
|
+
* `modal`) while item faces crossfade. Compose with NavigationRail.Item.
|
|
903
|
+
*/
|
|
904
|
+
declare function NavigationRail({ bottom, children, className, expanded, fabIcon, fabLabel, labels, menuIcon, menuOpenIcon, modal, narrow, onFabClick, onClose, onMenuClick, }: NavigationRailProps): react.JSX.Element;
|
|
905
|
+
declare namespace NavigationRail {
|
|
906
|
+
var Item: typeof NavRailItem;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
interface MenuDividerProps {
|
|
910
|
+
className?: string;
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* M3E vertical-menu divider: a 1px outline-variant rule inset 12dp,
|
|
914
|
+
* separating groups within a single menu surface (the "with divider"
|
|
915
|
+
* grouping). For separate group surfaces with a gap, use Menu.Group instead.
|
|
916
|
+
*/
|
|
917
|
+
declare function MenuDivider({ className }: MenuDividerProps): react.JSX.Element;
|
|
918
|
+
|
|
919
|
+
interface MenuGroupProps {
|
|
920
|
+
children?: ReactNode;
|
|
921
|
+
className?: string;
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* M3E vertical-menu group: a self-contained menu surface (corner-large,
|
|
925
|
+
* surface-container-low / tertiary-container at elevation 3) holding a
|
|
926
|
+
* cluster of items. Stack several inside a Menu and they render as separate
|
|
927
|
+
* rounded surfaces with a 2dp gap — the "with gap" grouping, the spec's
|
|
928
|
+
* alternative to a Menu.Divider (m3.material.io/components/menus anatomy
|
|
929
|
+
* lists both "Gap (optional)" and "Divider (optional)"). First/last items
|
|
930
|
+
* round their outer corner against this surface, exactly as in an ungrouped
|
|
931
|
+
* menu (the inset state layer is concentric with the corner-large at 4dp).
|
|
932
|
+
*/
|
|
933
|
+
declare function MenuGroup({ children, className }: MenuGroupProps): react.JSX.Element;
|
|
934
|
+
|
|
935
|
+
interface MenuLabelProps {
|
|
936
|
+
children?: ReactNode;
|
|
937
|
+
className?: string;
|
|
938
|
+
/** Optional 20px leading icon. */
|
|
939
|
+
leftElement?: ReactNode;
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* M3E vertical-menu section label: 32 tall, label-large in
|
|
943
|
+
* on-surface-variant (standard) / on-tertiary-container (vibrant), 16dp
|
|
944
|
+
* inline padding with a 6dp top pad — names the group that follows.
|
|
945
|
+
*/
|
|
946
|
+
declare function MenuLabel({ children, className, leftElement }: MenuLabelProps): react.JSX.Element;
|
|
947
|
+
|
|
948
|
+
interface MenuSubProps {
|
|
949
|
+
/** Submenu content (Menu.Item / Menu.Divider / nested Menu.Sub). */
|
|
950
|
+
children?: ReactNode;
|
|
951
|
+
className?: string;
|
|
952
|
+
disabled?: boolean;
|
|
953
|
+
label?: ReactNode;
|
|
954
|
+
leftElement?: ReactNode;
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Submenu: a trigger item (trailing chevron) that opens a nested {@link
|
|
958
|
+
* Menu} to its side. The submenu renders in a portal so it escapes the
|
|
959
|
+
* parent surface's clip; it opens on hover (intent) or Right/Enter, closes
|
|
960
|
+
* on Left/Escape (focus returns to the trigger) and a leaf activation
|
|
961
|
+
* dismisses the whole chain (inherited closeAll). The trigger keeps the
|
|
962
|
+
* on-surface state layer while open (the M3E active state).
|
|
963
|
+
*/
|
|
964
|
+
declare function MenuSub({ children, className, disabled, label, leftElement, }: MenuSubProps): react.JSX.Element;
|
|
965
|
+
|
|
966
|
+
interface MenuProps {
|
|
967
|
+
/** Move focus to the first item on open (default true; submenus opened
|
|
968
|
+
* by hover pass false so the pointer keeps control). */
|
|
969
|
+
autoFocus?: boolean;
|
|
970
|
+
children?: ReactNode;
|
|
971
|
+
className?: string;
|
|
972
|
+
/** True while the close animation plays (from useDismissable). */
|
|
973
|
+
exiting?: boolean;
|
|
974
|
+
/** Id for the role="menu" element so a trigger can aria-controls it. */
|
|
975
|
+
id?: string;
|
|
976
|
+
/** Dismiss this menu level — items use it, Escape/Tab/ArrowLeft too. */
|
|
977
|
+
onClose?: () => void;
|
|
978
|
+
/** Set by Menu.Sub: this is a submenu, so it inherits the chain's
|
|
979
|
+
* closeAll and ArrowLeft returns to the trigger. */
|
|
980
|
+
submenu?: boolean;
|
|
981
|
+
/** Reveal upward instead of downward (anchored above the trigger). */
|
|
982
|
+
up?: boolean;
|
|
983
|
+
/** Vibrant (tertiary-based) scheme; inherited by submenus. */
|
|
984
|
+
vibrant?: boolean;
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* M3 Expressive vertical menu surface and behaviour (anchorless — the host
|
|
988
|
+
* positions it): corner-large container, surface-container-low / tertiary
|
|
989
|
+
* (vibrant) at elevation 3, inset state-layer items, and WAI-ARIA menu
|
|
990
|
+
* keyboard (Arrow/Home/End/typeahead/Escape, Left/Right for submenus).
|
|
991
|
+
* Compose with Menu.Item, Menu.Sub, Menu.Label and Menu.Divider.
|
|
992
|
+
*/
|
|
993
|
+
declare function Menu({ autoFocus, children, className, exiting, id, onClose, submenu, up, vibrant, }: MenuProps): react.JSX.Element;
|
|
994
|
+
declare namespace Menu {
|
|
995
|
+
var Item: typeof MenuItem;
|
|
996
|
+
var Sub: typeof MenuSub;
|
|
997
|
+
var Group: typeof MenuGroup;
|
|
998
|
+
var Label: typeof MenuLabel;
|
|
999
|
+
var Divider: typeof MenuDivider;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
interface OverflowMenuProps {
|
|
1003
|
+
bottomLeft?: boolean;
|
|
1004
|
+
bottomRight?: boolean;
|
|
1005
|
+
/** Trigger content (usually an IconButton). */
|
|
1006
|
+
children?: ReactNode;
|
|
1007
|
+
className?: string;
|
|
1008
|
+
/** Menu content (OverflowMenu.Item / Menu.Item list). */
|
|
1009
|
+
menu?: ReactNode;
|
|
1010
|
+
/** Class for the menu container. */
|
|
1011
|
+
menuClassName?: string;
|
|
1012
|
+
topLeft?: boolean;
|
|
1013
|
+
topRight?: boolean;
|
|
1014
|
+
/** Vibrant (tertiary-based) color scheme instead of standard. */
|
|
1015
|
+
vibrant?: boolean;
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* Contextual menu anchored to a corner of its trigger, over the shared M3E
|
|
1019
|
+
* vertical {@link Menu}. Position via topLeft/topRight/bottomLeft/
|
|
1020
|
+
* bottomRight (default bottomRight); compose with OverflowMenu.Item
|
|
1021
|
+
* (an alias of Menu.Item), Menu.Label and Menu.Divider.
|
|
1022
|
+
*/
|
|
1023
|
+
declare function OverflowMenu({ bottomLeft, bottomRight, children, className, menu, menuClassName, topLeft, topRight, vibrant, }: OverflowMenuProps): react.JSX.Element;
|
|
1024
|
+
declare namespace OverflowMenu {
|
|
1025
|
+
var Item: typeof MenuItem;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
interface PerspectiveCardProps {
|
|
1029
|
+
children?: ReactNode;
|
|
1030
|
+
className?: string;
|
|
1031
|
+
/** Rotation strength per pixel of cursor distance. */
|
|
1032
|
+
intensity?: number;
|
|
1033
|
+
/** CSS perspective in px. */
|
|
1034
|
+
perspective?: number;
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* Tilts its content in 3D while hovered, resetting on leave. Pointer-only —
|
|
1038
|
+
* static on touch devices.
|
|
1039
|
+
*/
|
|
1040
|
+
declare function PerspectiveCard({ children, className, intensity, perspective, }: PerspectiveCardProps): react.JSX.Element;
|
|
1041
|
+
|
|
1042
|
+
interface PerspectiveImageProps {
|
|
1043
|
+
children?: ReactNode;
|
|
1044
|
+
className?: string;
|
|
1045
|
+
/** Rotation strength per pixel of cursor distance. */
|
|
1046
|
+
intensity?: number;
|
|
1047
|
+
/** CSS perspective in px. */
|
|
1048
|
+
perspective?: number;
|
|
1049
|
+
}
|
|
1050
|
+
/**
|
|
1051
|
+
* Tilts its content in 3D following the cursor anywhere on the page
|
|
1052
|
+
* (parallax showcase effect). Pointer-only — static on touch devices.
|
|
1053
|
+
*/
|
|
1054
|
+
declare function PerspectiveImage({ children, className, intensity, perspective, }: PerspectiveImageProps): react.JSX.Element;
|
|
1055
|
+
|
|
1056
|
+
interface CircleLabels {
|
|
1057
|
+
/** Accessible name (aria-label). Default "Progress". */
|
|
1058
|
+
label?: string;
|
|
1059
|
+
}
|
|
1060
|
+
interface CircleProps {
|
|
1061
|
+
/** Center content (e.g. the percentage). */
|
|
1062
|
+
children?: ReactNode;
|
|
1063
|
+
className?: string;
|
|
1064
|
+
/** Spinning arc instead of a fixed value. */
|
|
1065
|
+
indeterminate?: boolean;
|
|
1066
|
+
/** Customizable accessible name. */
|
|
1067
|
+
labels?: CircleLabels;
|
|
1068
|
+
/** Diameter in px (M3 Expressive baselines: flat 40, wavy 48). */
|
|
1069
|
+
size?: number;
|
|
1070
|
+
/** Stroke width in px (M3 active indicator: 4). */
|
|
1071
|
+
strokeWidth?: number;
|
|
1072
|
+
/** 0–100. */
|
|
1073
|
+
value?: number;
|
|
1074
|
+
/** M3 Expressive: the active indicator ripples around the ring — both the
|
|
1075
|
+
* determinate arc and the indeterminate spinner. */
|
|
1076
|
+
wavy?: boolean;
|
|
1077
|
+
}
|
|
1078
|
+
/**
|
|
1079
|
+
* M3 Expressive circular progress indicator: primary arc over a
|
|
1080
|
+
* secondary-container track with a 4px gap (determinate, stroke moves in
|
|
1081
|
+
* 500ms) or an indeterminate spinner: an SVG arc with round caps that grows
|
|
1082
|
+
* ~10°↔270° as it spins (the flat spinner reuses `_Spinner`, 40dp baseline).
|
|
1083
|
+
* `wavy` ripples the active indicator (amplitude 1.6, wavelength 15, baseline
|
|
1084
|
+
* 48) with the wave traveling one wavelength per second — for the determinate
|
|
1085
|
+
* arc and for the indeterminate spinner, which keeps the same spin +
|
|
1086
|
+
* grow/shrink dash on the rippled ring.
|
|
1087
|
+
*/
|
|
1088
|
+
declare function Circle({ children, className, indeterminate, labels, size: sizeProp, strokeWidth, value, wavy, }: CircleProps): react.JSX.Element;
|
|
1089
|
+
|
|
1090
|
+
interface LoadingIndicatorLabels {
|
|
1091
|
+
/** Accessible name (aria-label). Default "Loading". */
|
|
1092
|
+
label?: string;
|
|
1093
|
+
}
|
|
1094
|
+
interface LoadingIndicatorProps {
|
|
1095
|
+
className?: string;
|
|
1096
|
+
/** Contained: paints the 48dp fully-round container
|
|
1097
|
+
* (primary-container) under an on-primary-container indicator. */
|
|
1098
|
+
contained?: boolean;
|
|
1099
|
+
/** Customizable accessible name. */
|
|
1100
|
+
labels?: LoadingIndicatorLabels;
|
|
1101
|
+
}
|
|
1102
|
+
/**
|
|
1103
|
+
* M3 Expressive loading indicator: the exact 38dp MaterialShapes morph
|
|
1104
|
+
* (SoftBurst → Cookie9 → Pentagon → Pill → Sunny → Cookie4 → Oval) on 650ms
|
|
1105
|
+
* spring ticks (through the target at speed, 14% overshoot at the brake,
|
|
1106
|
+
* settle, dwell) with a +90° rotation kick per morph on top of the 4666ms
|
|
1107
|
+
* global rotation, inside a 48dp container. Default paints only the primary
|
|
1108
|
+
* shape; `contained` adds the primary-container circle. Indeterminate by
|
|
1109
|
+
* design — for determinate progress use Progress/Circle.
|
|
1110
|
+
*/
|
|
1111
|
+
declare function LoadingIndicator({ className, contained, labels, }: LoadingIndicatorProps): react.JSX.Element;
|
|
1112
|
+
|
|
1113
|
+
interface ProgressLabels {
|
|
1114
|
+
/** Accessible name (aria-label). Default "Progress". */
|
|
1115
|
+
label?: string;
|
|
1116
|
+
}
|
|
1117
|
+
interface ProgressProps {
|
|
1118
|
+
className?: string;
|
|
1119
|
+
/** Looping animation instead of a fixed value. */
|
|
1120
|
+
indeterminate?: boolean;
|
|
1121
|
+
/** Customizable accessible name. */
|
|
1122
|
+
labels?: ProgressLabels;
|
|
1123
|
+
/** Track/indicator thickness in px (spec: default 4, configurable —
|
|
1124
|
+
* the thick sample is 8). The stop indicator stays 4. */
|
|
1125
|
+
thickness?: number;
|
|
1126
|
+
/** 0–100. */
|
|
1127
|
+
value?: number;
|
|
1128
|
+
/** M3 Expressive: the active indicator ripples as a sine wave. */
|
|
1129
|
+
wavy?: boolean;
|
|
1130
|
+
}
|
|
1131
|
+
/**
|
|
1132
|
+
* M3 Expressive linear progress indicator: primary active indicator over
|
|
1133
|
+
* a secondary-container track with a 4px gap and a stop indicator.
|
|
1134
|
+
* Determinate transitions follow @material/web (250ms); the flat
|
|
1135
|
+
* indeterminate runs the @material/web 2s two-bar choreography. The `wavy`
|
|
1136
|
+
* indeterminate runs that same two-bar choreography — two primary segments
|
|
1137
|
+
* sweep across the track (their head/tail clip-path is derived from the flat
|
|
1138
|
+
* variant's translate/scale timing) — but each segment shows the same
|
|
1139
|
+
* traveling sine as the determinate active indicator (wavelength 40,
|
|
1140
|
+
* amplitude 3, one wavelength per second).
|
|
1141
|
+
*/
|
|
1142
|
+
declare function Progress({ className, indeterminate, labels, thickness, value, wavy, }: ProgressProps): react.JSX.Element;
|
|
1143
|
+
|
|
1144
|
+
interface SearchItemProps {
|
|
1145
|
+
children?: ReactNode;
|
|
1146
|
+
className?: string;
|
|
1147
|
+
label?: ReactNode;
|
|
1148
|
+
leftElement?: ReactNode;
|
|
1149
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
1150
|
+
rightElement?: ReactNode;
|
|
1151
|
+
}
|
|
1152
|
+
/** M3 search suggestion row: height 56, body-large, state layer. */
|
|
1153
|
+
declare function SearchItem({ children, className, label, leftElement, onClick, rightElement, }: SearchItemProps): react.JSX.Element;
|
|
1154
|
+
|
|
1155
|
+
interface SearchInputLabels {
|
|
1156
|
+
/** Input placeholder. Default "Search". */
|
|
1157
|
+
placeholder?: string;
|
|
1158
|
+
}
|
|
1159
|
+
interface SearchInputProps extends Omit<ComponentProps<"input">, "placeholder" | "size"> {
|
|
1160
|
+
/** Class for the wrapper. */
|
|
1161
|
+
className?: string;
|
|
1162
|
+
inputClassName?: string;
|
|
1163
|
+
/** Customizable text (input placeholder). */
|
|
1164
|
+
labels?: SearchInputLabels;
|
|
1165
|
+
/** Leading slot (56px box), e.g. a search icon or back button. */
|
|
1166
|
+
leftElement?: ReactNode;
|
|
1167
|
+
/** Trailing slot (56px box), e.g. an avatar or mic icon. */
|
|
1168
|
+
rightElement?: ReactNode;
|
|
1169
|
+
}
|
|
1170
|
+
/**
|
|
1171
|
+
* M3 search bar input row: height 56, body-large text, visible placeholder
|
|
1172
|
+
* (search bars do not float labels). Transparent background — the `Search`
|
|
1173
|
+
* wrapper provides the container color and shape. Leading icon = on-surface
|
|
1174
|
+
* (the search icon is the primary affordance per the search-bar token set);
|
|
1175
|
+
* trailing icon/avatar = on-surface-variant.
|
|
1176
|
+
*/
|
|
1177
|
+
declare function SearchInput({ className, inputClassName, labels, leftElement, rightElement, ...inputProps }: SearchInputProps): react.JSX.Element;
|
|
1178
|
+
|
|
1179
|
+
interface SearchProps {
|
|
1180
|
+
/** The search bar content (usually a SearchInput). */
|
|
1181
|
+
children: ReactNode;
|
|
1182
|
+
className?: string;
|
|
1183
|
+
/**
|
|
1184
|
+
* M3 baseline ("divided") style: the bar joins the results panel with a
|
|
1185
|
+
* divider instead of staying a separate, gapped card. The M3 Expressive
|
|
1186
|
+
* spec marks this "not recommended — use contained" (the default).
|
|
1187
|
+
*/
|
|
1188
|
+
divided?: boolean;
|
|
1189
|
+
/** Suggestions shown while open (Search.Item list). */
|
|
1190
|
+
result?: ReactNode;
|
|
1191
|
+
/** Class for the results container. */
|
|
1192
|
+
resultClassName?: string;
|
|
1193
|
+
}
|
|
1194
|
+
/**
|
|
1195
|
+
* M3 search bar + docked search view. Default = the M3 Expressive **contained**
|
|
1196
|
+
* style: a persistent full-pill bar on surface-container-high that opens a
|
|
1197
|
+
* separate results card below (corner-medium, 2dp gap, no divider). The legacy
|
|
1198
|
+
* **divided** style (`divided`) joins the bar and results with a divider and
|
|
1199
|
+
* squares off the bar's bottom corners — kept for baseline parity. Closes on
|
|
1200
|
+
* outside click or Escape.
|
|
1201
|
+
*/
|
|
1202
|
+
declare function Search({ children, className, divided, result, resultClassName, }: SearchProps): react.JSX.Element;
|
|
1203
|
+
declare namespace Search {
|
|
1204
|
+
var Item: typeof SearchItem;
|
|
1205
|
+
var Input: typeof SearchInput;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
interface SelectOption {
|
|
1209
|
+
disabled?: boolean;
|
|
1210
|
+
/** Display content; defaults to the value. */
|
|
1211
|
+
label?: ReactNode;
|
|
1212
|
+
value: string;
|
|
1213
|
+
}
|
|
1214
|
+
interface SelectBaseProps {
|
|
1215
|
+
/** Class for the wrapper. */
|
|
1216
|
+
className?: string;
|
|
1217
|
+
defaultValue?: string;
|
|
1218
|
+
disabled?: boolean;
|
|
1219
|
+
error?: boolean;
|
|
1220
|
+
errorText?: ReactNode;
|
|
1221
|
+
id?: string;
|
|
1222
|
+
/** Floating label. */
|
|
1223
|
+
label?: string;
|
|
1224
|
+
/** Leading icon (24px box; the field pads 48 on that side). */
|
|
1225
|
+
leftElement?: ReactNode;
|
|
1226
|
+
/** Posts the value in native forms via a hidden input. */
|
|
1227
|
+
name?: string;
|
|
1228
|
+
/** Fires with the next selected value. */
|
|
1229
|
+
onChange?: (value: string) => void;
|
|
1230
|
+
options: SelectOption[];
|
|
1231
|
+
supportingText?: ReactNode;
|
|
1232
|
+
value?: string;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
type SelectFilledProps = SelectBaseProps;
|
|
1236
|
+
/**
|
|
1237
|
+
* M3 filled select: the filled text field anatomy (height 56, shape small
|
|
1238
|
+
* on the top corners, surface-container-highest, floating label, active
|
|
1239
|
+
* indicator) opening an options menu with the @material/web animation.
|
|
1240
|
+
* Controllable via `value` + `onChange`; keyboard navigation and 200ms
|
|
1241
|
+
* typeahead included.
|
|
1242
|
+
*/
|
|
1243
|
+
declare function SelectFilled({ className, defaultValue, disabled, error, errorText, id, label, leftElement, name, onChange, options, supportingText, value: valueProp, }: SelectFilledProps): react.JSX.Element;
|
|
1244
|
+
|
|
1245
|
+
type SelectOutlinedProps = SelectBaseProps;
|
|
1246
|
+
/**
|
|
1247
|
+
* M3 outlined select: the outlined text field anatomy (height 56, shape
|
|
1248
|
+
* small, fieldset/legend label notch) opening an options menu with the
|
|
1249
|
+
* @material/web animation. Controllable via `value` + `onChange`;
|
|
1250
|
+
* keyboard navigation and 200ms typeahead included.
|
|
1251
|
+
*/
|
|
1252
|
+
declare function SelectOutlined({ className, defaultValue, disabled, error, errorText, id, label, leftElement, name, onChange, options, supportingText, value: valueProp, }: SelectOutlinedProps): react.JSX.Element;
|
|
1253
|
+
|
|
1254
|
+
interface BottomSheetProps {
|
|
1255
|
+
children?: ReactNode;
|
|
1256
|
+
className?: string;
|
|
1257
|
+
/** Show the M3 drag handle (32x4). Default true. */
|
|
1258
|
+
dragHandle?: boolean;
|
|
1259
|
+
isVisible?: boolean;
|
|
1260
|
+
/** Accessible name for the sheet (it is a modal dialog). */
|
|
1261
|
+
label?: string;
|
|
1262
|
+
onClose?: () => void;
|
|
1263
|
+
}
|
|
1264
|
+
/**
|
|
1265
|
+
* M3 modal bottom sheet: extra-large top corners, surface-container-low,
|
|
1266
|
+
* 32% scrim, slides up and animates out before unmounting.
|
|
1267
|
+
*/
|
|
1268
|
+
declare function BottomSheet({ children, className, dragHandle, isVisible, label, onClose, }: BottomSheetProps): react.JSX.Element | null;
|
|
1269
|
+
|
|
1270
|
+
interface SideSheetLabels {
|
|
1271
|
+
/** aria-label for the default close button. Default "Close". */
|
|
1272
|
+
close?: string;
|
|
1273
|
+
/** Accessible name for the sheet when no `title` is rendered.
|
|
1274
|
+
* Default "Side sheet". */
|
|
1275
|
+
label?: string;
|
|
1276
|
+
}
|
|
1277
|
+
interface SideSheetProps {
|
|
1278
|
+
children?: ReactNode;
|
|
1279
|
+
className?: string;
|
|
1280
|
+
/** true renders the default close icon button; pass a node for a
|
|
1281
|
+
* custom one. */
|
|
1282
|
+
closeButton?: boolean | ReactNode;
|
|
1283
|
+
isVisible?: boolean;
|
|
1284
|
+
/** Customizable accessible names. */
|
|
1285
|
+
labels?: SideSheetLabels;
|
|
1286
|
+
onClose?: () => void;
|
|
1287
|
+
/** Header title (title-large). */
|
|
1288
|
+
title?: ReactNode;
|
|
1289
|
+
}
|
|
1290
|
+
/**
|
|
1291
|
+
* M3 modal side sheet: docked right, width up to 400, large start corners,
|
|
1292
|
+
* surface-container-low, 32% scrim, slides in from the right and animates
|
|
1293
|
+
* out before unmounting.
|
|
1294
|
+
*/
|
|
1295
|
+
declare function SideSheet({ children, className, closeButton, isVisible, labels, onClose, title, }: SideSheetProps): react.JSX.Element | null;
|
|
1296
|
+
|
|
1297
|
+
type SliderSize = "xs" | "s" | "m" | "l" | "xl";
|
|
1298
|
+
|
|
1299
|
+
interface SliderLabels {
|
|
1300
|
+
/** Accessible name (aria-label) for the range input. Default "Slider". */
|
|
1301
|
+
label?: string;
|
|
1302
|
+
}
|
|
1303
|
+
interface SliderProps {
|
|
1304
|
+
className?: string;
|
|
1305
|
+
defaultValue?: number;
|
|
1306
|
+
disabled?: boolean;
|
|
1307
|
+
/** Inset leading icon for the thick M3E sizes (`m`/`l`/`xl`); two-toned
|
|
1308
|
+
* to follow the track (on-primary over active, on-secondary-container
|
|
1309
|
+
* over inactive). */
|
|
1310
|
+
icon?: ReactNode;
|
|
1311
|
+
/** Customizable accessible name. */
|
|
1312
|
+
labels?: SliderLabels;
|
|
1313
|
+
max?: number;
|
|
1314
|
+
min?: number;
|
|
1315
|
+
/** Fires with the next numeric value. */
|
|
1316
|
+
onChange?: (value: number) => void;
|
|
1317
|
+
/** Show the value indicator on hover/drag. Default true. */
|
|
1318
|
+
showLabel?: boolean;
|
|
1319
|
+
/** M3E track size: `xs` (default), `s`, `m`, `l`, `xl`. */
|
|
1320
|
+
size?: SliderSize;
|
|
1321
|
+
step?: number;
|
|
1322
|
+
/** Suffix rendered inside the value indicator. */
|
|
1323
|
+
tooltipChildren?: ReactNode;
|
|
1324
|
+
value?: number;
|
|
1325
|
+
}
|
|
1326
|
+
/**
|
|
1327
|
+
* M3 Expressive continuous slider: inset track with a 6px gap around the 4dp
|
|
1328
|
+
* handle, an on-secondary-container stop indicator on the inactive track and
|
|
1329
|
+
* a 44×48 inverse-surface value indicator on hover/drag. `size` selects the
|
|
1330
|
+
* track scale (xs–xl); the thick sizes (m/l/xl) host an optional inset
|
|
1331
|
+
* `icon`. Controllable via `value` + `onChange`.
|
|
1332
|
+
*/
|
|
1333
|
+
declare function Slider({ className, defaultValue, disabled, icon, labels, max, min, onChange, showLabel, size, step, tooltipChildren, value: valueProp, }: SliderProps): react.JSX.Element;
|
|
1334
|
+
|
|
1335
|
+
interface SliderDualValue {
|
|
1336
|
+
max: number;
|
|
1337
|
+
min: number;
|
|
1338
|
+
}
|
|
1339
|
+
interface SliderDualLabels {
|
|
1340
|
+
/** Base accessible name; each handle appends its suffix. Default "Range slider". */
|
|
1341
|
+
label?: string;
|
|
1342
|
+
/** Suffix for the upper handle's aria-label. Default "maximum". */
|
|
1343
|
+
maximum?: string;
|
|
1344
|
+
/** Suffix for the lower handle's aria-label. Default "minimum". */
|
|
1345
|
+
minimum?: string;
|
|
1346
|
+
}
|
|
1347
|
+
interface SliderDualProps {
|
|
1348
|
+
className?: string;
|
|
1349
|
+
defaultValue?: SliderDualValue;
|
|
1350
|
+
disabled?: boolean;
|
|
1351
|
+
/** Customizable accessible names. */
|
|
1352
|
+
labels?: SliderDualLabels;
|
|
1353
|
+
max?: number;
|
|
1354
|
+
min?: number;
|
|
1355
|
+
/** Fires with the next {min, max} pair. */
|
|
1356
|
+
onChange?: (value: SliderDualValue) => void;
|
|
1357
|
+
/** Show value indicators on hover/drag. Default true. */
|
|
1358
|
+
showLabel?: boolean;
|
|
1359
|
+
/** M3E track size: `xs` (default), `s`, `m`, `l`, `xl`. (The inset icon
|
|
1360
|
+
* is single-slider only.) */
|
|
1361
|
+
size?: SliderSize;
|
|
1362
|
+
step?: number;
|
|
1363
|
+
/** Suffix rendered inside the value indicators. */
|
|
1364
|
+
tooltipChildren?: ReactNode;
|
|
1365
|
+
value?: SliderDualValue;
|
|
1366
|
+
}
|
|
1367
|
+
/**
|
|
1368
|
+
* M3 Expressive range slider: 16px inset track, two 4x44 handles with 6px
|
|
1369
|
+
* gaps, stop indicators at both ends and inverse-surface value indicators.
|
|
1370
|
+
* Controllable via `value` ({min, max}) + `onChange`.
|
|
1371
|
+
*/
|
|
1372
|
+
declare function SliderDual({ className, defaultValue, disabled, labels, max, min, onChange, showLabel, size, step, tooltipChildren, value: valueProp, }: SliderDualProps): react.JSX.Element;
|
|
1373
|
+
|
|
1374
|
+
interface SnackbarLabels {
|
|
1375
|
+
/** aria-label for the dismiss (close) button. Default "Dismiss". */
|
|
1376
|
+
dismiss?: string;
|
|
1377
|
+
}
|
|
1378
|
+
interface SnackbarProps {
|
|
1379
|
+
/** Optional action button label (rendered as an M3 text button). */
|
|
1380
|
+
actionLabel?: string;
|
|
1381
|
+
/** Auto-close after N ms (calls onClose). Pauses on hover/focus. */
|
|
1382
|
+
autoHideDuration?: number;
|
|
1383
|
+
/** Extra trailing content (e.g. custom buttons). */
|
|
1384
|
+
button?: ReactNode;
|
|
1385
|
+
className?: string;
|
|
1386
|
+
/** Custom close icon (defaults to an X). */
|
|
1387
|
+
closeIcon?: ReactNode;
|
|
1388
|
+
isVisible: boolean;
|
|
1389
|
+
/** Customizable accessible names. */
|
|
1390
|
+
labels?: SnackbarLabels;
|
|
1391
|
+
onAction?: () => void;
|
|
1392
|
+
onClose?: () => void;
|
|
1393
|
+
/** Show the close icon button. */
|
|
1394
|
+
showClose?: boolean;
|
|
1395
|
+
text?: ReactNode;
|
|
1396
|
+
}
|
|
1397
|
+
/**
|
|
1398
|
+
* M3 snackbar: shape extra-small, inverse-surface, min height 48, width
|
|
1399
|
+
* 344–600, body-medium. Action and close render as real M3 buttons
|
|
1400
|
+
* recolored to inverse roles. `autoHideDuration` closes it automatically
|
|
1401
|
+
* and pauses while hovered or focused (M3 a11y guidance).
|
|
1402
|
+
*/
|
|
1403
|
+
declare function Snackbar({ actionLabel, autoHideDuration, button, className, closeIcon, isVisible, labels, onAction, onClose, showClose, text, }: SnackbarProps): react.JSX.Element;
|
|
1404
|
+
|
|
1405
|
+
interface SnackbarWrapperProps {
|
|
1406
|
+
children: ReactNode;
|
|
1407
|
+
className?: string;
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* Fixed bottom-centered stacking area for snackbars, portaled to
|
|
1411
|
+
* `document.body`. The portal is what makes snackbars reliable: a plain
|
|
1412
|
+
* `position: fixed` element stays trapped in the stacking context of any
|
|
1413
|
+
* positioned, z-indexed ancestor, so app content could paint over it no
|
|
1414
|
+
* matter how high its `z-index` is. Rendering into `body` lets it always sit
|
|
1415
|
+
* above the page. SSR-safe: renders nothing until mounted on the client.
|
|
1416
|
+
*/
|
|
1417
|
+
declare function SnackbarWrapper({ children, className }: SnackbarWrapperProps): react.ReactPortal | null;
|
|
1418
|
+
|
|
1419
|
+
interface BusinessItemProps extends MediaInjectionProps {
|
|
1420
|
+
alt?: string;
|
|
1421
|
+
className?: string;
|
|
1422
|
+
height?: number;
|
|
1423
|
+
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
1424
|
+
radius?: number;
|
|
1425
|
+
/** Static primary ring. */
|
|
1426
|
+
ring?: boolean;
|
|
1427
|
+
src?: ImageSrc;
|
|
1428
|
+
/** Label below (label-large, start-aligned). */
|
|
1429
|
+
text?: string;
|
|
1430
|
+
width?: number;
|
|
1431
|
+
}
|
|
1432
|
+
/**
|
|
1433
|
+
* Story item for brand/business content: rounded media with an optional
|
|
1434
|
+
* primary ring and a start-aligned label. Media is injectable.
|
|
1435
|
+
*/
|
|
1436
|
+
declare function BusinessItem({ alt, children, className, height, image, onClick, radius, render, ring, src, text, width, }: BusinessItemProps): react.JSX.Element;
|
|
1437
|
+
|
|
1438
|
+
interface UserItemProps extends MediaInjectionProps {
|
|
1439
|
+
alt?: string;
|
|
1440
|
+
badge?: boolean;
|
|
1441
|
+
badgeColor?: string;
|
|
1442
|
+
badgeIcon?: ReactNode;
|
|
1443
|
+
badgeText?: string;
|
|
1444
|
+
className?: string;
|
|
1445
|
+
/** Bottom-centered badge (e.g. "LIVE"). */
|
|
1446
|
+
live?: boolean;
|
|
1447
|
+
liveColor?: string;
|
|
1448
|
+
liveIcon?: ReactNode;
|
|
1449
|
+
liveText?: string;
|
|
1450
|
+
name?: string;
|
|
1451
|
+
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
1452
|
+
radius?: number;
|
|
1453
|
+
/** Animated decorative ring (token-based gradient). */
|
|
1454
|
+
ring?: boolean;
|
|
1455
|
+
size?: number;
|
|
1456
|
+
src?: ImageSrc;
|
|
1457
|
+
}
|
|
1458
|
+
/**
|
|
1459
|
+
* Circular story item with optional ring, badges and name below. Media is
|
|
1460
|
+
* injectable (render > image > children) with a native <img> fallback.
|
|
1461
|
+
*/
|
|
1462
|
+
declare function UserItem({ alt, badge, badgeColor, badgeIcon, badgeText, children, className, image, live, liveColor, liveIcon, liveText, name, onClick, radius, render, ring, size, src, }: UserItemProps): react.JSX.Element;
|
|
1463
|
+
|
|
1464
|
+
interface StoriesProps {
|
|
1465
|
+
children: ReactNode;
|
|
1466
|
+
className?: string;
|
|
1467
|
+
}
|
|
1468
|
+
/**
|
|
1469
|
+
* Horizontal scrollable story strip. Compose with Stories.User /
|
|
1470
|
+
* Stories.Business.
|
|
1471
|
+
*/
|
|
1472
|
+
declare function Stories({ children, className }: StoriesProps): react.JSX.Element;
|
|
1473
|
+
declare namespace Stories {
|
|
1474
|
+
var Business: typeof BusinessItem;
|
|
1475
|
+
var User: typeof UserItem;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
interface TabItem {
|
|
1479
|
+
/** Panel content rendered below when the tab is selected. */
|
|
1480
|
+
content?: ReactNode;
|
|
1481
|
+
disabled?: boolean;
|
|
1482
|
+
header?: ReactNode;
|
|
1483
|
+
icon?: ReactNode;
|
|
1484
|
+
id: string;
|
|
1485
|
+
}
|
|
1486
|
+
interface TabsPrimaryProps {
|
|
1487
|
+
className?: string;
|
|
1488
|
+
defaultSelected?: string;
|
|
1489
|
+
onChange?: (id: string) => void;
|
|
1490
|
+
/** Class for the selected tab's panel. */
|
|
1491
|
+
panelClassName?: string;
|
|
1492
|
+
selected?: string;
|
|
1493
|
+
tabs: TabItem[];
|
|
1494
|
+
}
|
|
1495
|
+
/**
|
|
1496
|
+
* M3 primary tabs: container 48 (64 with icon), title-small labels, 3px
|
|
1497
|
+
* content-width indicator with full top corners. Controllable via
|
|
1498
|
+
* `selected` + `onChange`.
|
|
1499
|
+
*/
|
|
1500
|
+
declare function TabsPrimary({ className, defaultSelected, onChange, panelClassName, selected: selectedProp, tabs, }: TabsPrimaryProps): react.JSX.Element;
|
|
1501
|
+
|
|
1502
|
+
interface TabsSecondaryProps {
|
|
1503
|
+
className?: string;
|
|
1504
|
+
defaultSelected?: string;
|
|
1505
|
+
onChange?: (id: string) => void;
|
|
1506
|
+
/** Class for the selected tab's panel. */
|
|
1507
|
+
panelClassName?: string;
|
|
1508
|
+
selected?: string;
|
|
1509
|
+
tabs: TabItem[];
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* M3 secondary tabs: container 48, title-small labels, 2px full-width
|
|
1513
|
+
* indicator. Controllable via `selected` + `onChange`.
|
|
1514
|
+
*/
|
|
1515
|
+
declare function TabsSecondary({ className, defaultSelected, onChange, panelClassName, selected: selectedProp, tabs, }: TabsSecondaryProps): react.JSX.Element;
|
|
1516
|
+
|
|
1517
|
+
interface InputFilledProps extends Omit<ComponentProps<"input">, "size"> {
|
|
1518
|
+
/** Class for the wrapper. */
|
|
1519
|
+
className?: string;
|
|
1520
|
+
error?: boolean;
|
|
1521
|
+
errorText?: ReactNode;
|
|
1522
|
+
inputClassName?: string;
|
|
1523
|
+
/** Floating label. */
|
|
1524
|
+
label?: string;
|
|
1525
|
+
/** Leading icon (24px box; input pads 48 on that side). */
|
|
1526
|
+
leftElement?: ReactNode;
|
|
1527
|
+
/** Trailing icon. */
|
|
1528
|
+
rightElement?: ReactNode;
|
|
1529
|
+
supportingText?: ReactNode;
|
|
1530
|
+
}
|
|
1531
|
+
/**
|
|
1532
|
+
* M3 filled text field: height 56, shape small on the top corners,
|
|
1533
|
+
* surface-container-highest container with an active indicator line. The
|
|
1534
|
+
* floating label is driven by focus/value state.
|
|
1535
|
+
*/
|
|
1536
|
+
declare function InputFilled({ "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, className, defaultValue, disabled, error, errorText, id, inputClassName, label, leftElement, onBlur, onChange, onFocus, placeholder, rightElement, supportingText, value, ...inputProps }: InputFilledProps): react.JSX.Element;
|
|
1537
|
+
|
|
1538
|
+
interface InputOutlinedProps extends Omit<ComponentProps<"input">, "size"> {
|
|
1539
|
+
/** Class for the wrapper. */
|
|
1540
|
+
className?: string;
|
|
1541
|
+
error?: boolean;
|
|
1542
|
+
errorText?: ReactNode;
|
|
1543
|
+
inputClassName?: string;
|
|
1544
|
+
/** Floating label. */
|
|
1545
|
+
label?: string;
|
|
1546
|
+
/** Leading icon (24px box; input pads 48 on that side). */
|
|
1547
|
+
leftElement?: ReactNode;
|
|
1548
|
+
/** Trailing icon. */
|
|
1549
|
+
rightElement?: ReactNode;
|
|
1550
|
+
supportingText?: ReactNode;
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* M3 outlined text field: height 56, shape small, body-large input. The
|
|
1554
|
+
* floating label is driven by focus/value state and notches the outline
|
|
1555
|
+
* via fieldset/legend (works on any background).
|
|
1556
|
+
*/
|
|
1557
|
+
declare function InputOutlined({ "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, className, defaultValue, disabled, error, errorText, id, inputClassName, label, leftElement, onBlur, onChange, onFocus, placeholder, rightElement, supportingText, value, ...inputProps }: InputOutlinedProps): react.JSX.Element;
|
|
1558
|
+
|
|
1559
|
+
interface TextFieldFilledProps extends ComponentProps<"textarea"> {
|
|
1560
|
+
/** Class for the wrapper. */
|
|
1561
|
+
className?: string;
|
|
1562
|
+
error?: boolean;
|
|
1563
|
+
errorText?: ReactNode;
|
|
1564
|
+
inputClassName?: string;
|
|
1565
|
+
/** Floating label. */
|
|
1566
|
+
label?: string;
|
|
1567
|
+
/** Leading icon (24px box). */
|
|
1568
|
+
leftElement?: ReactNode;
|
|
1569
|
+
/** Trailing icon. */
|
|
1570
|
+
rightElement?: ReactNode;
|
|
1571
|
+
supportingText?: ReactNode;
|
|
1572
|
+
}
|
|
1573
|
+
/**
|
|
1574
|
+
* M3 filled text field, multi-line (textarea). Same anatomy as
|
|
1575
|
+
* InputFilled with a top-aligned resting label.
|
|
1576
|
+
*/
|
|
1577
|
+
declare function TextFieldFilled({ "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, className, defaultValue, disabled, error, errorText, id, inputClassName, label, leftElement, onBlur, onChange, onFocus, placeholder, rightElement, rows, supportingText, value, ...textareaProps }: TextFieldFilledProps): react.JSX.Element;
|
|
1578
|
+
|
|
1579
|
+
interface TextFieldOutlinedProps extends ComponentProps<"textarea"> {
|
|
1580
|
+
/** Class for the wrapper. */
|
|
1581
|
+
className?: string;
|
|
1582
|
+
error?: boolean;
|
|
1583
|
+
errorText?: ReactNode;
|
|
1584
|
+
inputClassName?: string;
|
|
1585
|
+
/** Floating label. */
|
|
1586
|
+
label?: string;
|
|
1587
|
+
/** Leading icon (24px box). */
|
|
1588
|
+
leftElement?: ReactNode;
|
|
1589
|
+
/** Trailing icon. */
|
|
1590
|
+
rightElement?: ReactNode;
|
|
1591
|
+
supportingText?: ReactNode;
|
|
1592
|
+
}
|
|
1593
|
+
/**
|
|
1594
|
+
* M3 outlined text field, multi-line (textarea). Same anatomy as
|
|
1595
|
+
* InputOutlined with a top-aligned resting label.
|
|
1596
|
+
*/
|
|
1597
|
+
declare function TextFieldOutlined({ "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, className, defaultValue, disabled, error, errorText, id, inputClassName, label, leftElement, onBlur, onChange, onFocus, placeholder, rightElement, rows, supportingText, value, ...textareaProps }: TextFieldOutlinedProps): react.JSX.Element;
|
|
1598
|
+
|
|
1599
|
+
interface TimeValue {
|
|
1600
|
+
/** 0–23. */
|
|
1601
|
+
hours: number;
|
|
1602
|
+
/** 0–59. */
|
|
1603
|
+
minutes: number;
|
|
1604
|
+
}
|
|
1605
|
+
interface TimePickerLabels {
|
|
1606
|
+
/** AM period label. Default "AM". */
|
|
1607
|
+
am?: string;
|
|
1608
|
+
/** Cancel action. Default "Cancel". */
|
|
1609
|
+
cancel?: ReactNode;
|
|
1610
|
+
/** Confirm/commit action. Default "OK". */
|
|
1611
|
+
confirm?: ReactNode;
|
|
1612
|
+
/** Hour input aria-label. Default "Hour". */
|
|
1613
|
+
hour?: string;
|
|
1614
|
+
/** Minute input aria-label. Default "Minute". */
|
|
1615
|
+
minute?: string;
|
|
1616
|
+
/** PM period label. Default "PM". */
|
|
1617
|
+
pm?: string;
|
|
1618
|
+
/** Supporting line above the time. Default "Select time". */
|
|
1619
|
+
supporting?: ReactNode;
|
|
1620
|
+
/** Toggle aria-label while in input mode. Default "Switch to dial". */
|
|
1621
|
+
switchToDial?: string;
|
|
1622
|
+
/** Toggle aria-label while in dial mode. Default "Switch to keyboard input". */
|
|
1623
|
+
switchToInput?: string;
|
|
1624
|
+
}
|
|
1625
|
+
interface TimePickerProps {
|
|
1626
|
+
/** Start in keyboard-input mode. */
|
|
1627
|
+
input?: boolean;
|
|
1628
|
+
isVisible: boolean;
|
|
1629
|
+
/** Customizable text and accessible names. */
|
|
1630
|
+
labels?: TimePickerLabels;
|
|
1631
|
+
onClose: () => void;
|
|
1632
|
+
onConfirm?: (value: TimeValue) => void;
|
|
1633
|
+
value?: TimeValue;
|
|
1634
|
+
}
|
|
1635
|
+
/**
|
|
1636
|
+
* M3 modal time picker: a clock dial (256dp) with a draggable selector, the
|
|
1637
|
+
* big HH:MM time selector, an AM/PM period selector, and a keyboard-input
|
|
1638
|
+
* toggle. Container surface-container-high, level 3, extra-large (28).
|
|
1639
|
+
*/
|
|
1640
|
+
declare function TimePicker(props: TimePickerProps): react.JSX.Element;
|
|
1641
|
+
|
|
1642
|
+
interface ToggleThemeLabels {
|
|
1643
|
+
/** Suffix after the theme name when `label` is shown. Default "theme". */
|
|
1644
|
+
name?: string;
|
|
1645
|
+
/** aria-label while light (clicking switches to dark). Default "Switch to dark theme". */
|
|
1646
|
+
toDark?: string;
|
|
1647
|
+
/** aria-label while dark (clicking switches to light). Default "Switch to light theme". */
|
|
1648
|
+
toLight?: string;
|
|
1649
|
+
}
|
|
1650
|
+
interface ToggleThemeProps {
|
|
1651
|
+
className?: string;
|
|
1652
|
+
/** Icon shown while dark (click switches to light). */
|
|
1653
|
+
darkIcon?: ReactNode;
|
|
1654
|
+
/** Show the current theme name next to the button. */
|
|
1655
|
+
label?: boolean;
|
|
1656
|
+
/** Customizable text and accessible names. */
|
|
1657
|
+
labels?: ToggleThemeLabels;
|
|
1658
|
+
/** Icon shown while light (click switches to dark). */
|
|
1659
|
+
lightIcon?: ReactNode;
|
|
1660
|
+
variant?: IconButtonVariant;
|
|
1661
|
+
}
|
|
1662
|
+
/**
|
|
1663
|
+
* Light/dark toggle backed by useMaterialTheme (persists to localStorage,
|
|
1664
|
+
* toggles data-theme + the dark class on <html>).
|
|
1665
|
+
*/
|
|
1666
|
+
declare function ToggleTheme({ className, darkIcon, label, labels, lightIcon, variant, }: ToggleThemeProps): react.JSX.Element;
|
|
1667
|
+
|
|
1668
|
+
/** Themes shipped with the library. Custom themes work by overriding the
|
|
1669
|
+
* --md-sys-* tokens in CSS; this type covers the built-in ones. */
|
|
1670
|
+
type MaterialTheme = "light" | "dark";
|
|
1671
|
+
|
|
1672
|
+
interface ToggleThemeMenuItem {
|
|
1673
|
+
id: MaterialTheme;
|
|
1674
|
+
label: string;
|
|
1675
|
+
}
|
|
1676
|
+
interface ToggleThemeMenuLabels {
|
|
1677
|
+
/** Suffix after the theme name when `label` is shown. Default "theme". */
|
|
1678
|
+
name?: string;
|
|
1679
|
+
/** aria-label for the menu trigger. Default "Choose theme". */
|
|
1680
|
+
trigger?: string;
|
|
1681
|
+
}
|
|
1682
|
+
interface ToggleThemeMenuProps {
|
|
1683
|
+
className?: string;
|
|
1684
|
+
/** Trigger icon (defaults to a palette glyph). */
|
|
1685
|
+
icon?: ReactNode;
|
|
1686
|
+
/** Show the current theme name next to the trigger. */
|
|
1687
|
+
label?: boolean;
|
|
1688
|
+
/** Customizable text and accessible names for the trigger. The theme
|
|
1689
|
+
* names themselves are translated through `themes`. */
|
|
1690
|
+
labels?: ToggleThemeMenuLabels;
|
|
1691
|
+
/** Selectable themes (defaults to the built-in light/dark; pass your
|
|
1692
|
+
* own list when shipping custom token sets, also to translate the
|
|
1693
|
+
* theme names). */
|
|
1694
|
+
themes?: ToggleThemeMenuItem[];
|
|
1695
|
+
variant?: IconButtonVariant;
|
|
1696
|
+
}
|
|
1697
|
+
/**
|
|
1698
|
+
* Theme picker menu backed by useMaterialTheme. Lists the built-in themes
|
|
1699
|
+
* (or a custom set) and marks the active one.
|
|
1700
|
+
*/
|
|
1701
|
+
declare function ToggleThemeMenu({ className, icon, label, labels, themes, variant, }: ToggleThemeMenuProps): react.JSX.Element;
|
|
1702
|
+
|
|
1703
|
+
interface DockedToolbarProps extends ComponentProps<"div"> {
|
|
1704
|
+
/** Vibrant color scheme (primary-container) instead of the standard
|
|
1705
|
+
* surface-container. */
|
|
1706
|
+
vibrant?: boolean;
|
|
1707
|
+
}
|
|
1708
|
+
/**
|
|
1709
|
+
* M3 Expressive docked toolbar: a full-width 64dp bar (surface-container,
|
|
1710
|
+
* 16dp edge paddings, 32dp default gap, square corners) pinned to the
|
|
1711
|
+
* bottom of the window. Successor of the baseline bottom app bar; FABs
|
|
1712
|
+
* placed inside sit flat (no own elevation). Ghost icon buttons follow
|
|
1713
|
+
* the toolbar selection colors via `aria-pressed`.
|
|
1714
|
+
*/
|
|
1715
|
+
declare function DockedToolbar({ children, className, vibrant, ...props }: DockedToolbarProps): react.JSX.Element;
|
|
1716
|
+
|
|
1717
|
+
/** Side of the toolbar the FAB sits on (end = trailing/bottom). */
|
|
1718
|
+
type FloatingToolbarFabPosition = "start" | "end";
|
|
1719
|
+
interface FloatingToolbarProps extends ComponentProps<"div"> {
|
|
1720
|
+
/** Collapse choreography (fast-spatial spring): with `fab` the whole
|
|
1721
|
+
* pill clips away toward the FAB, which grows 56 → 80 (medium);
|
|
1722
|
+
* without it only `leading`/`trailing` collapse. Drive it from your
|
|
1723
|
+
* scroll handler. Default true. */
|
|
1724
|
+
expanded?: boolean;
|
|
1725
|
+
/** Adjacent FAB slot (a `<FAB>`), 8dp from the pill. The toolbar
|
|
1726
|
+
* controls its size and elevation (level 2, hover 3). */
|
|
1727
|
+
fab?: ReactNode;
|
|
1728
|
+
/** FAB side: end (default) or start. */
|
|
1729
|
+
fabPosition?: FloatingToolbarFabPosition;
|
|
1730
|
+
/** Remove the default level-3 elevation (spec guideline for visually
|
|
1731
|
+
* distinct backgrounds). */
|
|
1732
|
+
flat?: boolean;
|
|
1733
|
+
/** Leading actions that collapse away when `expanded` is false. */
|
|
1734
|
+
leading?: ReactNode;
|
|
1735
|
+
/** Trailing actions that collapse away when `expanded` is false. */
|
|
1736
|
+
trailing?: ReactNode;
|
|
1737
|
+
/** Vertical orientation (64dp wide, 24dp min screen margin). */
|
|
1738
|
+
vertical?: boolean;
|
|
1739
|
+
/** Vibrant color scheme (primary-container) instead of the standard
|
|
1740
|
+
* surface-container. */
|
|
1741
|
+
vibrant?: boolean;
|
|
1742
|
+
}
|
|
1743
|
+
/**
|
|
1744
|
+
* M3 Expressive floating toolbar: a 64dp pill (8dp paddings, 4dp gap,
|
|
1745
|
+
* shape full, level 3) floating above the content with a 16dp (24dp
|
|
1746
|
+
* vertical) screen margin — position the wrapper yourself. Standard
|
|
1747
|
+
* (surface-container) or vibrant (primary-container) schemes; ghost icon
|
|
1748
|
+
* buttons follow the toolbar selection colors via `aria-pressed`. The
|
|
1749
|
+
* expand/collapse motion ports the Compose fast-spatial spring
|
|
1750
|
+
* (damping 0.6 / stiffness 800).
|
|
1751
|
+
*/
|
|
1752
|
+
declare function FloatingToolbar({ children, className, expanded, fab, fabPosition, flat, leading, trailing, vertical, vibrant, ...props }: FloatingToolbarProps): react.JSX.Element;
|
|
1753
|
+
|
|
1754
|
+
interface TooltipProps {
|
|
1755
|
+
/** Action slot for rich tooltips (e.g. a text Button). */
|
|
1756
|
+
action?: ReactNode;
|
|
1757
|
+
bottomLeft?: boolean;
|
|
1758
|
+
bottomRight?: boolean;
|
|
1759
|
+
/** Trigger content. */
|
|
1760
|
+
children?: ReactNode;
|
|
1761
|
+
className?: string;
|
|
1762
|
+
/** Supporting text. */
|
|
1763
|
+
text?: ReactNode;
|
|
1764
|
+
/** Subhead for rich tooltips (title-small). */
|
|
1765
|
+
title?: ReactNode;
|
|
1766
|
+
topLeft?: boolean;
|
|
1767
|
+
topRight?: boolean;
|
|
1768
|
+
/** plain = label on inverse-surface; rich = card-like container. */
|
|
1769
|
+
variant?: "plain" | "rich";
|
|
1770
|
+
}
|
|
1771
|
+
/**
|
|
1772
|
+
* M3 tooltip shown on hover/focus. Plain: shape extra-small on
|
|
1773
|
+
* inverse-surface. Rich: shape medium on surface-container with optional
|
|
1774
|
+
* subhead and action. Position with the corner flags (default
|
|
1775
|
+
* bottomLeft).
|
|
1776
|
+
*/
|
|
1777
|
+
declare function Tooltip({ action, bottomLeft, bottomRight, children, className, text, title, topLeft, topRight, variant, }: TooltipProps): react.JSX.Element;
|
|
1778
|
+
|
|
1779
|
+
interface AppBarRowProps {
|
|
1780
|
+
children?: ReactNode;
|
|
1781
|
+
className?: string;
|
|
1782
|
+
leftElement?: ReactNode;
|
|
1783
|
+
rightElement?: ReactNode;
|
|
1784
|
+
/** Optional supporting line under the title (label-medium, M3E). */
|
|
1785
|
+
subtitle?: ReactNode;
|
|
1786
|
+
/** Title fallback when no children are passed. */
|
|
1787
|
+
title?: ReactNode;
|
|
1788
|
+
}
|
|
1789
|
+
/** M3 small top app bar: height 64, bar padding 4, title-large start-aligned
|
|
1790
|
+
* (+ optional label-medium subtitle, M3E). */
|
|
1791
|
+
declare function SmallAppBar({ children, className, leftElement, rightElement, subtitle, title, }: AppBarRowProps): react.JSX.Element;
|
|
1792
|
+
|
|
1793
|
+
/** M3 center-aligned top app bar: the small app bar with centered title text
|
|
1794
|
+
* (M3E merged center-aligned into small as a configuration). Height 64,
|
|
1795
|
+
* title-large centered (+ optional label-medium subtitle). */
|
|
1796
|
+
declare function CenterAppBar({ children, className, leftElement, rightElement, subtitle, title, }: AppBarRowProps): react.JSX.Element;
|
|
1797
|
+
|
|
1798
|
+
interface CollapsingAppBarProps {
|
|
1799
|
+
children?: ReactNode;
|
|
1800
|
+
className?: string;
|
|
1801
|
+
leftElement?: ReactNode;
|
|
1802
|
+
rightElement?: ReactNode;
|
|
1803
|
+
/** Supporting line under the title (label-large). */
|
|
1804
|
+
subtitle?: ReactNode;
|
|
1805
|
+
/** Title fallback when no children are passed. */
|
|
1806
|
+
title?: ReactNode;
|
|
1807
|
+
}
|
|
1808
|
+
/** M3E medium top app bar (flexible): headline-medium title at the bottom,
|
|
1809
|
+
* height 112 (136 with a subtitle). The M3 baseline medium app bar is no
|
|
1810
|
+
* longer recommended; this is the flexible default. */
|
|
1811
|
+
declare function MediumAppBar({ children, className, leftElement, rightElement, subtitle, title, }: CollapsingAppBarProps): react.JSX.Element;
|
|
1812
|
+
|
|
1813
|
+
/** M3E large top app bar (flexible): display-small title at the bottom,
|
|
1814
|
+
* height 120 (152 with a subtitle). The M3 baseline large app bar is no
|
|
1815
|
+
* longer recommended; this is the flexible default. */
|
|
1816
|
+
declare function LargeAppBar({ children, className, leftElement, rightElement, subtitle, title, }: CollapsingAppBarProps): react.JSX.Element;
|
|
1817
|
+
|
|
1818
|
+
type TopAppBarProps = ComponentProps<"header">;
|
|
1819
|
+
/**
|
|
1820
|
+
* M3 top app bar container (surface at rest; swap to surface-container on
|
|
1821
|
+
* scroll via className). Compose with TopAppBar.Small / .Center / .Medium /
|
|
1822
|
+
* .Large.
|
|
1823
|
+
*/
|
|
1824
|
+
declare function TopAppBar({ children, className, ...props }: TopAppBarProps): react.JSX.Element;
|
|
1825
|
+
declare namespace TopAppBar {
|
|
1826
|
+
var Small: typeof SmallAppBar;
|
|
1827
|
+
var Medium: typeof MediumAppBar;
|
|
1828
|
+
var Large: typeof LargeAppBar;
|
|
1829
|
+
var Center: typeof CenterAppBar;
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
type VideoProps = ComponentProps<"video">;
|
|
1833
|
+
/**
|
|
1834
|
+
* Native looping video for ambient/media content: muted, autoplay and
|
|
1835
|
+
* inline by default (override via props), object-fit cover. Autoplay is
|
|
1836
|
+
* decorative motion lasting >5s, so it is paused under
|
|
1837
|
+
* `prefers-reduced-motion: reduce` (WCAG 2.2.2 Pause, Stop, Hide); pass
|
|
1838
|
+
* `controls` for an explicit play affordance.
|
|
1839
|
+
*/
|
|
1840
|
+
declare function Video({ autoPlay, className, loop, muted, playsInline, ref, ...props }: VideoProps): react.JSX.Element;
|
|
1841
|
+
|
|
1842
|
+
interface AmountLabels {
|
|
1843
|
+
/** aria-label for the decrement button. Default "Decrease". */
|
|
1844
|
+
decrease?: string;
|
|
1845
|
+
/** aria-label for the increment button. Default "Increase". */
|
|
1846
|
+
increase?: string;
|
|
1847
|
+
/** aria-label for the group. Default "Amount". */
|
|
1848
|
+
label?: string;
|
|
1849
|
+
}
|
|
1850
|
+
interface AmountProps {
|
|
1851
|
+
className?: string;
|
|
1852
|
+
defaultValue?: number;
|
|
1853
|
+
disabled?: boolean;
|
|
1854
|
+
/** Customizable accessible names. */
|
|
1855
|
+
labels?: AmountLabels;
|
|
1856
|
+
max?: number;
|
|
1857
|
+
min?: number;
|
|
1858
|
+
minusIcon?: ReactNode;
|
|
1859
|
+
/** Fires with the next numeric value. */
|
|
1860
|
+
onChange?: (value: number) => void;
|
|
1861
|
+
plusIcon?: ReactNode;
|
|
1862
|
+
step?: number;
|
|
1863
|
+
value?: number;
|
|
1864
|
+
}
|
|
1865
|
+
/**
|
|
1866
|
+
* Quantity stepper. Controllable: pass `value` + `onChange`, or let it
|
|
1867
|
+
* manage internal state seeded by `defaultValue` (uncontrolled fallback).
|
|
1868
|
+
*/
|
|
1869
|
+
declare function Amount({ className, defaultValue, disabled, labels, max, min, minusIcon, onChange, plusIcon, step, value: valueProp, }: AmountProps): react.JSX.Element;
|
|
1870
|
+
|
|
1871
|
+
interface CheckboxProps extends Omit<ComponentProps<"input">, "type" | "size" | "children"> {
|
|
1872
|
+
/** Class for the wrapping <label>. */
|
|
1873
|
+
className?: string;
|
|
1874
|
+
/** Class for the visual box. */
|
|
1875
|
+
inputClassName?: string;
|
|
1876
|
+
label?: ReactNode;
|
|
1877
|
+
}
|
|
1878
|
+
/**
|
|
1879
|
+
* M3 checkbox: custom-rendered 18x18 box (2px shape, 2px outline) with a
|
|
1880
|
+
* 40px circular state layer. Controlled via `checked` + `onChange` or
|
|
1881
|
+
* uncontrolled via `defaultChecked` — the native input is the source of
|
|
1882
|
+
* truth, so group semantics behave exactly like the platform's.
|
|
1883
|
+
*/
|
|
1884
|
+
declare function Checkbox({ className, disabled, inputClassName, label, onChange, ...inputProps }: CheckboxProps): react.JSX.Element;
|
|
1885
|
+
|
|
1886
|
+
interface IconProps {
|
|
1887
|
+
className?: string;
|
|
1888
|
+
/** Standalone icon slot. */
|
|
1889
|
+
icon?: ReactNode;
|
|
1890
|
+
/** Leading icon slot. */
|
|
1891
|
+
iconLeft?: ReactNode;
|
|
1892
|
+
/** Trailing icon slot. */
|
|
1893
|
+
iconRight?: ReactNode;
|
|
1894
|
+
/** Box size in px (M3 default 24). */
|
|
1895
|
+
size?: number;
|
|
1896
|
+
}
|
|
1897
|
+
/**
|
|
1898
|
+
* Icon slot helper. Wraps each provided icon in a fixed square box
|
|
1899
|
+
* (default 24px) so arbitrary icon nodes align with adjacent text.
|
|
1900
|
+
*/
|
|
1901
|
+
declare function Icon({ className, icon, iconLeft, iconRight, size }: IconProps): react.JSX.Element;
|
|
1902
|
+
|
|
1903
|
+
interface ImgProps extends MediaInjectionProps {
|
|
1904
|
+
alt?: string;
|
|
1905
|
+
/** Aspect ratio of the frame (e.g. 16/9). */
|
|
1906
|
+
aspect?: number | string;
|
|
1907
|
+
className?: string;
|
|
1908
|
+
height?: number | string;
|
|
1909
|
+
objectFit?: ObjectFit;
|
|
1910
|
+
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
1911
|
+
/** Shown when there is no media or it fails to load. */
|
|
1912
|
+
placeholder?: ReactNode;
|
|
1913
|
+
/** Corner radius in px or any CSS value. */
|
|
1914
|
+
radius?: number | string;
|
|
1915
|
+
/** Shorthand for equal width/height. */
|
|
1916
|
+
size?: number | string;
|
|
1917
|
+
/** Plain URL or StaticImageData. Ignored when media is injected. */
|
|
1918
|
+
src?: ImageSrc | null;
|
|
1919
|
+
style?: CSSProperties;
|
|
1920
|
+
width?: number | string;
|
|
1921
|
+
}
|
|
1922
|
+
/**
|
|
1923
|
+
* MediaFrame + image. Uses a native <img> by default; the consumer can
|
|
1924
|
+
* inject its framework's image via `render` > `image` > `children`. Falls
|
|
1925
|
+
* back to the placeholder when there is no source or it errors.
|
|
1926
|
+
*/
|
|
1927
|
+
declare function Img({ alt, aspect, children, className, height, image, objectFit, onClick, placeholder, radius, render, size, src, style, width, }: ImgProps): react.JSX.Element;
|
|
1928
|
+
|
|
1929
|
+
interface LoadingLabels {
|
|
1930
|
+
/** Accessible label (status text). Default "Loading". */
|
|
1931
|
+
label?: string;
|
|
1932
|
+
}
|
|
1933
|
+
interface LoadingProps {
|
|
1934
|
+
className?: string;
|
|
1935
|
+
/** Customizable accessible name. */
|
|
1936
|
+
labels?: LoadingLabels;
|
|
1937
|
+
/** Diameter in px (M3 default 40 — `CircularProgressIndicatorTokens.Size`;
|
|
1938
|
+
* 48 is only the wavy baseline). */
|
|
1939
|
+
size?: number;
|
|
1940
|
+
/** Stroke width in px (M3 active indicator: 4). */
|
|
1941
|
+
strokeWidth?: number;
|
|
1942
|
+
}
|
|
1943
|
+
/**
|
|
1944
|
+
* Icon-sized circular indeterminate spinner — an SVG arc with round caps
|
|
1945
|
+
* that grows ~10°↔270° while it spins (shares `_Spinner` with `Circle`).
|
|
1946
|
+
* This IS `<Circle indeterminate />`,
|
|
1947
|
+
* kept as a convenience that inherits `currentColor` (defaults to primary) and
|
|
1948
|
+
* announces via `role="status"` so it can drop inline in buttons/text. It is
|
|
1949
|
+
* NOT the shape-morphing M3 `LoadingIndicator`.
|
|
1950
|
+
*/
|
|
1951
|
+
declare function Loading({ className, labels, size, strokeWidth, }: LoadingProps): react.JSX.Element;
|
|
1952
|
+
|
|
1953
|
+
interface MaterialSymbolProps extends Omit<ComponentProps<"span">, "children"> {
|
|
1954
|
+
/** FILL axis (false = outlined glyph, true = filled). */
|
|
1955
|
+
fill?: boolean;
|
|
1956
|
+
/** GRAD axis (-25..200). */
|
|
1957
|
+
grade?: number;
|
|
1958
|
+
/** Ligature name, e.g. "favorite". */
|
|
1959
|
+
name: string;
|
|
1960
|
+
/** opsz axis (20..48). Defaults to `size`. */
|
|
1961
|
+
opticalSize?: number;
|
|
1962
|
+
/** Font size in px. */
|
|
1963
|
+
size?: number;
|
|
1964
|
+
/** Symbol style — must match the font the consumer loaded. */
|
|
1965
|
+
variant?: "rounded" | "outlined" | "sharp";
|
|
1966
|
+
/** wght axis (100..700). */
|
|
1967
|
+
weight?: number;
|
|
1968
|
+
}
|
|
1969
|
+
/**
|
|
1970
|
+
* Zero-dependency Material Symbols glyph. Renders a ligature span; it only
|
|
1971
|
+
* displays if the consumer loaded the corresponding Material Symbols
|
|
1972
|
+
* variable font (e.g. from Google Fonts). The library bundles no font.
|
|
1973
|
+
*/
|
|
1974
|
+
declare function MaterialSymbol({ className, fill, grade, name, opticalSize, size, style, variant, weight, ...rest }: MaterialSymbolProps): react.JSX.Element;
|
|
1975
|
+
|
|
1976
|
+
interface MediaFrameProps {
|
|
1977
|
+
/** Aspect ratio of the frame (e.g. 16/9 or "4 / 3"). */
|
|
1978
|
+
aspect?: number | string;
|
|
1979
|
+
/** Content of the frame (usually media). */
|
|
1980
|
+
children?: ReactNode;
|
|
1981
|
+
className?: string;
|
|
1982
|
+
height?: number | string;
|
|
1983
|
+
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
1984
|
+
/** Clip the content to the frame shape. Default true. */
|
|
1985
|
+
overflow?: boolean;
|
|
1986
|
+
/** Shown behind/instead of the content (icon, initials...). */
|
|
1987
|
+
placeholder?: ReactNode;
|
|
1988
|
+
/** Corner radius in px, or any CSS value (e.g. "var(--md-sys-shape-corner-large)"). */
|
|
1989
|
+
radius?: number | string;
|
|
1990
|
+
/** Shorthand for equal width/height. */
|
|
1991
|
+
size?: number | string;
|
|
1992
|
+
style?: CSSProperties;
|
|
1993
|
+
width?: number | string;
|
|
1994
|
+
}
|
|
1995
|
+
/**
|
|
1996
|
+
* Presentational frame for media: size/aspect/radius/overflow plus an
|
|
1997
|
+
* optional placeholder. Renders no image of its own — pair it with `Img`
|
|
1998
|
+
* or inject any media as children.
|
|
1999
|
+
*/
|
|
2000
|
+
declare function MediaFrame({ aspect, children, className, height, onClick, overflow, placeholder, radius, size, style, width, }: MediaFrameProps): react.JSX.Element;
|
|
2001
|
+
|
|
2002
|
+
interface RadioProps extends Omit<ComponentProps<"input">, "type" | "size" | "children"> {
|
|
2003
|
+
/** Class for the wrapping <label>. */
|
|
2004
|
+
className?: string;
|
|
2005
|
+
label?: ReactNode;
|
|
2006
|
+
}
|
|
2007
|
+
/**
|
|
2008
|
+
* M3 radio button: custom-rendered 20px ring + 10px dot with a 40px
|
|
2009
|
+
* circular state layer. The native input is the source of truth, so
|
|
2010
|
+
* uncontrolled groups (shared `name`) keep native semantics; pass
|
|
2011
|
+
* `checked` + `onChange` for controlled usage.
|
|
2012
|
+
*/
|
|
2013
|
+
declare function Radio({ className, disabled, label, ...inputProps }: RadioProps): react.JSX.Element;
|
|
2014
|
+
|
|
2015
|
+
interface SwitchProps extends Omit<ComponentProps<"input">, "type" | "size" | "children" | "checked" | "defaultChecked"> {
|
|
2016
|
+
checked?: boolean;
|
|
2017
|
+
/** Class for the wrapping <label>. */
|
|
2018
|
+
className?: string;
|
|
2019
|
+
defaultChecked?: boolean;
|
|
2020
|
+
/** Icon shown inside the handle when selected (M3 "with icon": the
|
|
2021
|
+
* handle grows to 24 and the icon renders at 16). */
|
|
2022
|
+
icon?: ReactNode;
|
|
2023
|
+
label?: ReactNode;
|
|
2024
|
+
/** Optional icon for the unselected handle. */
|
|
2025
|
+
uncheckedIcon?: ReactNode;
|
|
2026
|
+
}
|
|
2027
|
+
/**
|
|
2028
|
+
* M3 switch: 52x32 track (2px outline), handle 16↔24 (28 pressed), 40px
|
|
2029
|
+
* state layer. Controllable: `checked` + `onChange`, or uncontrolled via
|
|
2030
|
+
* `defaultChecked` (internal state through useControlled).
|
|
2031
|
+
*/
|
|
2032
|
+
declare function Switch({ checked: checkedProp, className, defaultChecked, disabled, icon, label, onChange, uncheckedIcon, ...inputProps }: SwitchProps): react.JSX.Element;
|
|
2033
|
+
|
|
2034
|
+
interface TextElementProps {
|
|
2035
|
+
/** Supporting text (body-medium, on-surface-variant). */
|
|
2036
|
+
body?: ReactNode;
|
|
2037
|
+
bodyStyle?: string;
|
|
2038
|
+
className?: string;
|
|
2039
|
+
/** Overline label (label-medium, on-surface-variant). */
|
|
2040
|
+
label?: ReactNode;
|
|
2041
|
+
labelStyle?: string;
|
|
2042
|
+
/** Main text (title-medium, on-surface). */
|
|
2043
|
+
title?: ReactNode;
|
|
2044
|
+
titleStyle?: string;
|
|
2045
|
+
}
|
|
2046
|
+
/** Label / title / body text stack using the M3 type scale. */
|
|
2047
|
+
declare function TextElement({ body, bodyStyle, className, label, labelStyle, title, titleStyle, }: TextElementProps): react.JSX.Element;
|
|
2048
|
+
|
|
2049
|
+
interface ContainerProps {
|
|
2050
|
+
children?: ReactNode;
|
|
2051
|
+
className?: string;
|
|
2052
|
+
/** Padding class override (default p-6). */
|
|
2053
|
+
padding?: string;
|
|
2054
|
+
}
|
|
2055
|
+
/**
|
|
2056
|
+
* Dotted showcase panel (token-based dot grid) for presenting components
|
|
2057
|
+
* over a neutral, theme-aware background.
|
|
2058
|
+
*/
|
|
2059
|
+
declare function Container({ children, className, padding }: ContainerProps): react.JSX.Element;
|
|
2060
|
+
|
|
2061
|
+
interface SectionProps {
|
|
2062
|
+
children: ReactNode;
|
|
2063
|
+
className?: string;
|
|
2064
|
+
}
|
|
2065
|
+
/** Responsive content section: column on small screens, row on large. */
|
|
2066
|
+
declare function Section({ children, className }: SectionProps): react.JSX.Element;
|
|
2067
|
+
|
|
2068
|
+
export { Amount, type AmountLabels, type AmountProps, type AppBarRowProps, Avatar, type AvatarProps, AvatarStack, type AvatarStackItem, type AvatarStackProps, Badge, type BadgeProps, Blob, type BlobProps, BottomSheet, type BottomSheetProps, type BusinessItemProps, Button, ButtonGroup, ButtonGroupConnected, type ButtonGroupConnectedProps, type ButtonGroupProps, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Card, type CardBodyProps, type CardFooterProps, type CardHeaderProps, type CardProps, type CardVariant, Checkbox, type CheckboxProps, Chips, type ChipsLabels, type ChipsProps, type ChipsVariant, Circle, type CircleLabels, type CircleProps, type CollapsingAppBarProps, Container, type ContainerProps, DatePicker, type DatePickerDockedLabels, type DatePickerDockedProps, type DatePickerLabels, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerLabels, type DateRangePickerProps, Dialog, type DialogBodyProps, type DialogFooterProps, type DialogHeaderProps, type DialogProps, Divider, type DividerProps, DockedToolbar, type DockedToolbarProps, DotBadge, type DotBadgeProps, Dropdown, type MenuItemProps as DropdownItemProps, type DropdownProps, ExtendedFAB, type ExtendedFABProps, type ExtendedFABVariant, FAB, FABMenu, type FABMenuItemProps, type FABMenuLabels, type FABMenuProps, type FABMenuVariant, type FABProps, type FABSize, type FABVariant, FloatingToolbar, type FloatingToolbarFabPosition, type FloatingToolbarProps, Gallery, type GalleryProps, Icon, IconButton, type IconButtonProps, type IconButtonShape, type IconButtonSize, type IconButtonVariant, type IconButtonWidth, type IconProps, type ImageRowProps, Img, type ImgProps, InputFilled, type InputFilledProps, InputOutlined, type InputOutlinedProps, LinkBox, type LinkBoxProps, LinkContainer, type LinkContainerProps, List, type ListItemProps, type ListProps, Loading, LoadingIndicator, type LoadingIndicatorLabels, type LoadingIndicatorProps, type LoadingLabels, type LoadingProps, MaterialSymbol, type MaterialSymbolProps, MediaFrame, type MediaFrameProps, Menu, type MenuDividerProps, type MenuGroupProps, type MenuItemProps, type MenuLabelProps, type MenuProps, type MenuSubProps, type NavBarItemProps, type NavRailItemProps, NavigationBar, type NavigationBarProps, NavigationRail, type NavigationRailLabels, type NavigationRailProps, OnIconBadge, type OnIconBadgeProps, OverflowMenu, type MenuItemProps as OverflowMenuItemProps, type OverflowMenuProps, PerspectiveCard, type PerspectiveCardProps, PerspectiveImage, type PerspectiveImageProps, Progress, type ProgressLabels, type ProgressProps, Radio, type RadioProps, Search, SearchInput, type SearchInputLabels, type SearchInputProps, type SearchItemProps, type SearchProps, Section, type SectionProps, SelectFilled, type SelectFilledProps, type SelectOption, SelectOutlined, type SelectOutlinedProps, SideSheet, type SideSheetLabels, type SideSheetProps, Slider, SliderDual, type SliderDualLabels, type SliderDualProps, type SliderDualValue, type SliderLabels, type SliderProps, Snackbar, type SnackbarLabels, type SnackbarProps, SnackbarWrapper, type SnackbarWrapperProps, SplitButton, type SplitButtonLabels, type SplitButtonProps, type SplitButtonVariant, Stories, type StoriesProps, Switch, type SwitchProps, type TabItem, Table, type TableBodyProps, type TableCellProps, type TableHeadProps, type TableHeaderCellProps, type TableProps, type TableRowProps, TabsPrimary, type TabsPrimaryProps, TabsSecondary, type TabsSecondaryProps, type TextContainerProps, TextElement, type TextElementProps, TextFieldFilled, type TextFieldFilledProps, TextFieldOutlined, type TextFieldOutlinedProps, TimePicker, type TimePickerLabels, type TimePickerProps, type TimeValue, ToggleTheme, type ToggleThemeLabels, ToggleThemeMenu, type ToggleThemeMenuItem, type ToggleThemeMenuLabels, type ToggleThemeMenuProps, type ToggleThemeProps, Tooltip, type TooltipProps, TopAppBar, type TopAppBarProps, type UserItemProps, Video, type VideoProps };
|