react-material-expressive 1.0.0 → 1.1.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/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, CSSProperties, MouseEventHandler, ComponentProps, MouseEvent } from 'react';
2
+ import { ReactNode, CSSProperties, MouseEventHandler, ComponentProps, MouseEvent, ElementType } from 'react';
3
3
 
4
4
  /**
5
5
  * Structural type of a statically imported image (matches the object shape
@@ -446,6 +446,76 @@ interface ChipsProps extends ComponentProps<"button"> {
446
446
  */
447
447
  declare function Chips({ avatar, children, className, disabled, elevated, labels, leftElement, onRemove, rightElement, selected, text, type, variant, ...props }: ChipsProps): react.JSX.Element;
448
448
 
449
+ interface ComboboxOption {
450
+ disabled?: boolean;
451
+ /** Display text; becomes the input's text when selected. Defaults to value. */
452
+ label?: string;
453
+ value: string;
454
+ }
455
+ interface ComboboxLabels {
456
+ /** aria-label for the clear button. Default "Clear". */
457
+ clear?: string;
458
+ /** Status row shown when there are no options. Default "No results". */
459
+ empty?: string;
460
+ /** Status row shown while options load. Default "Loading…". */
461
+ loading?: string;
462
+ }
463
+ interface ComboboxBaseProps extends Omit<ComponentProps<"input">, "defaultValue" | "onChange" | "size" | "value"> {
464
+ /** Class for the wrapper. */
465
+ className?: string;
466
+ /** Show a trailing clear button when the input has text (default true). */
467
+ clearable?: boolean;
468
+ /** Uncontrolled initial selected value. */
469
+ defaultValue?: string;
470
+ disabled?: boolean;
471
+ error?: boolean;
472
+ errorText?: ReactNode;
473
+ id?: string;
474
+ inputClassName?: string;
475
+ /** Floating label. */
476
+ label?: string;
477
+ /** Accessible names for the chrome. */
478
+ labels?: ComboboxLabels;
479
+ /** Leading icon (24px box; the field pads 48 on that side). */
480
+ leftElement?: ReactNode;
481
+ /** Class for the portaled listbox surface. */
482
+ listboxClassName?: string;
483
+ /** Consumer signals an in-flight async fetch (shows a status row). */
484
+ loading?: boolean;
485
+ /** Posts the selected value in native forms via a hidden input. */
486
+ name?: string;
487
+ /** Fires with the selected option value, or "" when cleared. */
488
+ onChange?: (value: string) => void;
489
+ /** Fires when the consumer should re-query (debounce on your side). */
490
+ onInputChange?: (query: string) => void;
491
+ /** Already-filtered options. The library does NOT fetch or filter. */
492
+ options: ComboboxOption[];
493
+ supportingText?: ReactNode;
494
+ /** Controlled selected value. */
495
+ value?: string;
496
+ }
497
+
498
+ type ComboboxFilledProps = ComboboxBaseProps;
499
+ /**
500
+ * M3 filled combobox: the filled text field anatomy (height 56, shape small on
501
+ * the top corners, surface-container-highest, floating label, active
502
+ * indicator) over an ARIA combobox `<input>` with a portaled listbox. Options
503
+ * are consumer-controlled for async search — type to fire `onInputChange`,
504
+ * then feed the already-filtered `options` back in. Controllable via `value` +
505
+ * `onChange`.
506
+ */
507
+ declare function ComboboxFilled({ className, clearable, defaultValue, disabled, error, errorText, id, inputClassName, label, labels, leftElement, listboxClassName, loading, name, onChange, onInputChange, options, supportingText, value: valueProp, ...inputProps }: ComboboxFilledProps): react.JSX.Element;
508
+
509
+ type ComboboxOutlinedProps = ComboboxBaseProps;
510
+ /**
511
+ * M3 outlined combobox: the outlined text field anatomy (height 56, shape
512
+ * small, fieldset/legend label notch) over an ARIA combobox `<input>` with a
513
+ * portaled listbox. Options are consumer-controlled for async search — type
514
+ * to fire `onInputChange`, then feed the already-filtered `options` back in.
515
+ * Controllable via `value` + `onChange`.
516
+ */
517
+ declare function ComboboxOutlined({ className, clearable, defaultValue, disabled, error, errorText, id, inputClassName, label, labels, leftElement, listboxClassName, loading, name, onChange, onInputChange, options, supportingText, value: valueProp, ...inputProps }: ComboboxOutlinedProps): react.JSX.Element;
518
+
449
519
  interface TextContainerProps {
450
520
  children?: ReactNode;
451
521
  className?: string;
@@ -556,11 +626,14 @@ interface DatePickerDockedLabels extends CalendarLabels {
556
626
  }
557
627
  interface DatePickerDockedProps {
558
628
  className?: string;
629
+ error?: boolean;
630
+ errorText?: ReactNode;
559
631
  labels?: DatePickerDockedLabels;
560
632
  locale?: string;
561
633
  max?: Date | null;
562
634
  min?: Date | null;
563
635
  onChange?: (date: Date | null) => void;
636
+ supportingText?: ReactNode;
564
637
  value?: Date | null;
565
638
  weekStartsOn?: number;
566
639
  }
@@ -568,7 +641,7 @@ interface DatePickerDockedProps {
568
641
  * M3 docked date picker: an outlined field with a calendar icon that opens
569
642
  * a dropdown calendar anchored below it. Selection commits immediately.
570
643
  */
571
- declare function DatePickerDocked({ className, labels, locale, max, min, onChange, value, weekStartsOn, }: DatePickerDockedProps): react.JSX.Element;
644
+ declare function DatePickerDocked({ className, error, errorText, labels, locale, max, min, onChange, supportingText, value, weekStartsOn, }: DatePickerDockedProps): react.JSX.Element;
572
645
 
573
646
  type DateRange = [Date | null, Date | null];
574
647
  interface DateRangePickerLabels extends CalendarLabels {
@@ -1153,18 +1226,26 @@ interface SearchItemProps {
1153
1226
  declare function SearchItem({ children, className, label, leftElement, onClick, rightElement, }: SearchItemProps): react.JSX.Element;
1154
1227
 
1155
1228
  interface SearchInputLabels {
1229
+ /** Clear-button aria-label. Default "Clear". */
1230
+ clear?: string;
1156
1231
  /** Input placeholder. Default "Search". */
1157
1232
  placeholder?: string;
1158
1233
  }
1159
1234
  interface SearchInputProps extends Omit<ComponentProps<"input">, "placeholder" | "size"> {
1160
1235
  /** Class for the wrapper. */
1161
1236
  className?: string;
1237
+ /** Render a clear (×) button in the trailing slot when the input has a
1238
+ * value (unless `rightElement` is set). Default false. */
1239
+ clearable?: boolean;
1162
1240
  inputClassName?: string;
1163
- /** Customizable text (input placeholder). */
1241
+ /** Customizable text (placeholder, clear-button name). */
1164
1242
  labels?: SearchInputLabels;
1165
1243
  /** Leading slot (56px box), e.g. a search icon or back button. */
1166
1244
  leftElement?: ReactNode;
1167
- /** Trailing slot (56px box), e.g. an avatar or mic icon. */
1245
+ /** Called after the clear button empties the input. */
1246
+ onClear?: () => void;
1247
+ /** Trailing slot (56px box), e.g. an avatar or mic icon. Takes precedence
1248
+ * over the clear button. */
1168
1249
  rightElement?: ReactNode;
1169
1250
  }
1170
1251
  /**
@@ -1172,9 +1253,11 @@ interface SearchInputProps extends Omit<ComponentProps<"input">, "placeholder" |
1172
1253
  * (search bars do not float labels). Transparent background — the `Search`
1173
1254
  * wrapper provides the container color and shape. Leading icon = on-surface
1174
1255
  * (the search icon is the primary affordance per the search-bar token set);
1175
- * trailing icon/avatar = on-surface-variant.
1256
+ * trailing icon/avatar = on-surface-variant. With `clearable`, a trailing
1257
+ * clear button appears while there is a value (controllable or uncontrolled)
1258
+ * and the inconsistent native `type=search` clear is hidden.
1176
1259
  */
1177
- declare function SearchInput({ className, inputClassName, labels, leftElement, rightElement, ...inputProps }: SearchInputProps): react.JSX.Element;
1260
+ declare function SearchInput({ className, clearable, defaultValue, inputClassName, labels, leftElement, onChange, onClear, rightElement, value: valueProp, ...inputProps }: SearchInputProps): react.JSX.Element;
1178
1261
 
1179
1262
  interface SearchProps {
1180
1263
  /** The search bar content (usually a SearchInput). */
@@ -2032,19 +2115,37 @@ interface SwitchProps extends Omit<ComponentProps<"input">, "type" | "size" | "c
2032
2115
  declare function Switch({ checked: checkedProp, className, defaultChecked, disabled, icon, label, onChange, uncheckedIcon, ...inputProps }: SwitchProps): react.JSX.Element;
2033
2116
 
2034
2117
  interface TextElementProps {
2118
+ /** Wrapper element, used only when more than one slot is rendered. Default
2119
+ * "div". With a single slot there is no wrapper — the text element is
2120
+ * rendered directly (semantic HTML; see the docs). */
2121
+ as?: ElementType;
2035
2122
  /** Supporting text (body-medium, on-surface-variant). */
2036
2123
  body?: ReactNode;
2124
+ /** Element for the body slot. Default "p". */
2125
+ bodyAs?: ElementType;
2037
2126
  bodyStyle?: string;
2038
2127
  className?: string;
2039
2128
  /** Overline label (label-medium, on-surface-variant). */
2040
2129
  label?: ReactNode;
2130
+ /** Element for the label slot. Default "p". */
2131
+ labelAs?: ElementType;
2041
2132
  labelStyle?: string;
2042
2133
  /** Main text (title-medium, on-surface). */
2043
2134
  title?: ReactNode;
2135
+ /** Element for the title slot. Default "h2" — set per heading hierarchy
2136
+ * (M3 a11y: heading level follows content, not visual style). */
2137
+ titleAs?: ElementType;
2044
2138
  titleStyle?: string;
2045
2139
  }
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;
2140
+ /**
2141
+ * Label / title / body text stack on the M3 type scale. Each slot renders only
2142
+ * when provided and its element is polymorphic (`labelAs`/`titleAs`/`bodyAs`,
2143
+ * defaulting to p/h2/p). With a single slot the element is rendered **directly**
2144
+ * — no wrapper `<div>` — so e.g. a lone title is a bare `<h2>` (`className`
2145
+ * applies to it). With two or more slots they are stacked in the `as` wrapper
2146
+ * (default "div").
2147
+ */
2148
+ declare function TextElement({ as: Wrapper, body, bodyAs: Body, bodyStyle, className, label, labelAs: Label, labelStyle, title, titleAs: Title, titleStyle, }: TextElementProps): react.JSX.Element | null;
2048
2149
 
2049
2150
  interface ContainerProps {
2050
2151
  children?: ReactNode;
@@ -2065,4 +2166,4 @@ interface SectionProps {
2065
2166
  /** Responsive content section: column on small screens, row on large. */
2066
2167
  declare function Section({ children, className }: SectionProps): react.JSX.Element;
2067
2168
 
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 };
2169
+ 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, ComboboxFilled, type ComboboxFilledProps, type ComboboxLabels, type ComboboxOption, ComboboxOutlined, type ComboboxOutlinedProps, 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 };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, CSSProperties, MouseEventHandler, ComponentProps, MouseEvent } from 'react';
2
+ import { ReactNode, CSSProperties, MouseEventHandler, ComponentProps, MouseEvent, ElementType } from 'react';
3
3
 
4
4
  /**
5
5
  * Structural type of a statically imported image (matches the object shape
@@ -446,6 +446,76 @@ interface ChipsProps extends ComponentProps<"button"> {
446
446
  */
447
447
  declare function Chips({ avatar, children, className, disabled, elevated, labels, leftElement, onRemove, rightElement, selected, text, type, variant, ...props }: ChipsProps): react.JSX.Element;
448
448
 
449
+ interface ComboboxOption {
450
+ disabled?: boolean;
451
+ /** Display text; becomes the input's text when selected. Defaults to value. */
452
+ label?: string;
453
+ value: string;
454
+ }
455
+ interface ComboboxLabels {
456
+ /** aria-label for the clear button. Default "Clear". */
457
+ clear?: string;
458
+ /** Status row shown when there are no options. Default "No results". */
459
+ empty?: string;
460
+ /** Status row shown while options load. Default "Loading…". */
461
+ loading?: string;
462
+ }
463
+ interface ComboboxBaseProps extends Omit<ComponentProps<"input">, "defaultValue" | "onChange" | "size" | "value"> {
464
+ /** Class for the wrapper. */
465
+ className?: string;
466
+ /** Show a trailing clear button when the input has text (default true). */
467
+ clearable?: boolean;
468
+ /** Uncontrolled initial selected value. */
469
+ defaultValue?: string;
470
+ disabled?: boolean;
471
+ error?: boolean;
472
+ errorText?: ReactNode;
473
+ id?: string;
474
+ inputClassName?: string;
475
+ /** Floating label. */
476
+ label?: string;
477
+ /** Accessible names for the chrome. */
478
+ labels?: ComboboxLabels;
479
+ /** Leading icon (24px box; the field pads 48 on that side). */
480
+ leftElement?: ReactNode;
481
+ /** Class for the portaled listbox surface. */
482
+ listboxClassName?: string;
483
+ /** Consumer signals an in-flight async fetch (shows a status row). */
484
+ loading?: boolean;
485
+ /** Posts the selected value in native forms via a hidden input. */
486
+ name?: string;
487
+ /** Fires with the selected option value, or "" when cleared. */
488
+ onChange?: (value: string) => void;
489
+ /** Fires when the consumer should re-query (debounce on your side). */
490
+ onInputChange?: (query: string) => void;
491
+ /** Already-filtered options. The library does NOT fetch or filter. */
492
+ options: ComboboxOption[];
493
+ supportingText?: ReactNode;
494
+ /** Controlled selected value. */
495
+ value?: string;
496
+ }
497
+
498
+ type ComboboxFilledProps = ComboboxBaseProps;
499
+ /**
500
+ * M3 filled combobox: the filled text field anatomy (height 56, shape small on
501
+ * the top corners, surface-container-highest, floating label, active
502
+ * indicator) over an ARIA combobox `<input>` with a portaled listbox. Options
503
+ * are consumer-controlled for async search — type to fire `onInputChange`,
504
+ * then feed the already-filtered `options` back in. Controllable via `value` +
505
+ * `onChange`.
506
+ */
507
+ declare function ComboboxFilled({ className, clearable, defaultValue, disabled, error, errorText, id, inputClassName, label, labels, leftElement, listboxClassName, loading, name, onChange, onInputChange, options, supportingText, value: valueProp, ...inputProps }: ComboboxFilledProps): react.JSX.Element;
508
+
509
+ type ComboboxOutlinedProps = ComboboxBaseProps;
510
+ /**
511
+ * M3 outlined combobox: the outlined text field anatomy (height 56, shape
512
+ * small, fieldset/legend label notch) over an ARIA combobox `<input>` with a
513
+ * portaled listbox. Options are consumer-controlled for async search — type
514
+ * to fire `onInputChange`, then feed the already-filtered `options` back in.
515
+ * Controllable via `value` + `onChange`.
516
+ */
517
+ declare function ComboboxOutlined({ className, clearable, defaultValue, disabled, error, errorText, id, inputClassName, label, labels, leftElement, listboxClassName, loading, name, onChange, onInputChange, options, supportingText, value: valueProp, ...inputProps }: ComboboxOutlinedProps): react.JSX.Element;
518
+
449
519
  interface TextContainerProps {
450
520
  children?: ReactNode;
451
521
  className?: string;
@@ -556,11 +626,14 @@ interface DatePickerDockedLabels extends CalendarLabels {
556
626
  }
557
627
  interface DatePickerDockedProps {
558
628
  className?: string;
629
+ error?: boolean;
630
+ errorText?: ReactNode;
559
631
  labels?: DatePickerDockedLabels;
560
632
  locale?: string;
561
633
  max?: Date | null;
562
634
  min?: Date | null;
563
635
  onChange?: (date: Date | null) => void;
636
+ supportingText?: ReactNode;
564
637
  value?: Date | null;
565
638
  weekStartsOn?: number;
566
639
  }
@@ -568,7 +641,7 @@ interface DatePickerDockedProps {
568
641
  * M3 docked date picker: an outlined field with a calendar icon that opens
569
642
  * a dropdown calendar anchored below it. Selection commits immediately.
570
643
  */
571
- declare function DatePickerDocked({ className, labels, locale, max, min, onChange, value, weekStartsOn, }: DatePickerDockedProps): react.JSX.Element;
644
+ declare function DatePickerDocked({ className, error, errorText, labels, locale, max, min, onChange, supportingText, value, weekStartsOn, }: DatePickerDockedProps): react.JSX.Element;
572
645
 
573
646
  type DateRange = [Date | null, Date | null];
574
647
  interface DateRangePickerLabels extends CalendarLabels {
@@ -1153,18 +1226,26 @@ interface SearchItemProps {
1153
1226
  declare function SearchItem({ children, className, label, leftElement, onClick, rightElement, }: SearchItemProps): react.JSX.Element;
1154
1227
 
1155
1228
  interface SearchInputLabels {
1229
+ /** Clear-button aria-label. Default "Clear". */
1230
+ clear?: string;
1156
1231
  /** Input placeholder. Default "Search". */
1157
1232
  placeholder?: string;
1158
1233
  }
1159
1234
  interface SearchInputProps extends Omit<ComponentProps<"input">, "placeholder" | "size"> {
1160
1235
  /** Class for the wrapper. */
1161
1236
  className?: string;
1237
+ /** Render a clear (×) button in the trailing slot when the input has a
1238
+ * value (unless `rightElement` is set). Default false. */
1239
+ clearable?: boolean;
1162
1240
  inputClassName?: string;
1163
- /** Customizable text (input placeholder). */
1241
+ /** Customizable text (placeholder, clear-button name). */
1164
1242
  labels?: SearchInputLabels;
1165
1243
  /** Leading slot (56px box), e.g. a search icon or back button. */
1166
1244
  leftElement?: ReactNode;
1167
- /** Trailing slot (56px box), e.g. an avatar or mic icon. */
1245
+ /** Called after the clear button empties the input. */
1246
+ onClear?: () => void;
1247
+ /** Trailing slot (56px box), e.g. an avatar or mic icon. Takes precedence
1248
+ * over the clear button. */
1168
1249
  rightElement?: ReactNode;
1169
1250
  }
1170
1251
  /**
@@ -1172,9 +1253,11 @@ interface SearchInputProps extends Omit<ComponentProps<"input">, "placeholder" |
1172
1253
  * (search bars do not float labels). Transparent background — the `Search`
1173
1254
  * wrapper provides the container color and shape. Leading icon = on-surface
1174
1255
  * (the search icon is the primary affordance per the search-bar token set);
1175
- * trailing icon/avatar = on-surface-variant.
1256
+ * trailing icon/avatar = on-surface-variant. With `clearable`, a trailing
1257
+ * clear button appears while there is a value (controllable or uncontrolled)
1258
+ * and the inconsistent native `type=search` clear is hidden.
1176
1259
  */
1177
- declare function SearchInput({ className, inputClassName, labels, leftElement, rightElement, ...inputProps }: SearchInputProps): react.JSX.Element;
1260
+ declare function SearchInput({ className, clearable, defaultValue, inputClassName, labels, leftElement, onChange, onClear, rightElement, value: valueProp, ...inputProps }: SearchInputProps): react.JSX.Element;
1178
1261
 
1179
1262
  interface SearchProps {
1180
1263
  /** The search bar content (usually a SearchInput). */
@@ -2032,19 +2115,37 @@ interface SwitchProps extends Omit<ComponentProps<"input">, "type" | "size" | "c
2032
2115
  declare function Switch({ checked: checkedProp, className, defaultChecked, disabled, icon, label, onChange, uncheckedIcon, ...inputProps }: SwitchProps): react.JSX.Element;
2033
2116
 
2034
2117
  interface TextElementProps {
2118
+ /** Wrapper element, used only when more than one slot is rendered. Default
2119
+ * "div". With a single slot there is no wrapper — the text element is
2120
+ * rendered directly (semantic HTML; see the docs). */
2121
+ as?: ElementType;
2035
2122
  /** Supporting text (body-medium, on-surface-variant). */
2036
2123
  body?: ReactNode;
2124
+ /** Element for the body slot. Default "p". */
2125
+ bodyAs?: ElementType;
2037
2126
  bodyStyle?: string;
2038
2127
  className?: string;
2039
2128
  /** Overline label (label-medium, on-surface-variant). */
2040
2129
  label?: ReactNode;
2130
+ /** Element for the label slot. Default "p". */
2131
+ labelAs?: ElementType;
2041
2132
  labelStyle?: string;
2042
2133
  /** Main text (title-medium, on-surface). */
2043
2134
  title?: ReactNode;
2135
+ /** Element for the title slot. Default "h2" — set per heading hierarchy
2136
+ * (M3 a11y: heading level follows content, not visual style). */
2137
+ titleAs?: ElementType;
2044
2138
  titleStyle?: string;
2045
2139
  }
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;
2140
+ /**
2141
+ * Label / title / body text stack on the M3 type scale. Each slot renders only
2142
+ * when provided and its element is polymorphic (`labelAs`/`titleAs`/`bodyAs`,
2143
+ * defaulting to p/h2/p). With a single slot the element is rendered **directly**
2144
+ * — no wrapper `<div>` — so e.g. a lone title is a bare `<h2>` (`className`
2145
+ * applies to it). With two or more slots they are stacked in the `as` wrapper
2146
+ * (default "div").
2147
+ */
2148
+ declare function TextElement({ as: Wrapper, body, bodyAs: Body, bodyStyle, className, label, labelAs: Label, labelStyle, title, titleAs: Title, titleStyle, }: TextElementProps): react.JSX.Element | null;
2048
2149
 
2049
2150
  interface ContainerProps {
2050
2151
  children?: ReactNode;
@@ -2065,4 +2166,4 @@ interface SectionProps {
2065
2166
  /** Responsive content section: column on small screens, row on large. */
2066
2167
  declare function Section({ children, className }: SectionProps): react.JSX.Element;
2067
2168
 
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 };
2169
+ 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, ComboboxFilled, type ComboboxFilledProps, type ComboboxLabels, type ComboboxOption, ComboboxOutlined, type ComboboxOutlinedProps, 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 };