1 | import * as React from 'react';
|
2 | import { SxProps } from '@mui/system';
|
3 | import { Theme } from '../styles';
|
4 | import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase';
|
5 | import { OverrideProps } from '../OverridableComponent';
|
6 | import { ListItemButtonClasses } from './listItemButtonClasses';
|
7 |
|
8 | /**
|
9 | * This interface is kept for backward compatibility. To extend `LitItemButton`
|
10 | * props through module augmentation, use `ListItemButtonOwnProps`.
|
11 | */
|
12 | export interface ListItemButtonBaseProps {
|
13 | /**
|
14 | * Defines the `align-items` style property.
|
15 | * @default 'center'
|
16 | */
|
17 | alignItems?: 'flex-start' | 'center';
|
18 | /**
|
19 | * If `true`, the list item is focused during the first mount.
|
20 | * Focus will also be triggered if the value changes from false to true.
|
21 | * @default false
|
22 | */
|
23 | autoFocus?: boolean;
|
24 | /**
|
25 | * The content of the component if a `ListItemSecondaryAction` is used it must
|
26 | * be the last child.
|
27 | */
|
28 | children?: React.ReactNode;
|
29 | /**
|
30 | * Override or extend the styles applied to the component.
|
31 | */
|
32 | classes?: Partial<ListItemButtonClasses>;
|
33 | /**
|
34 | * If `true`, compact vertical padding designed for keyboard and mouse input is used.
|
35 | * The prop defaults to the value inherited from the parent List component.
|
36 | * @default false
|
37 | */
|
38 | dense?: boolean;
|
39 | /**
|
40 | * If `true`, the component is disabled.
|
41 | * @default false
|
42 | */
|
43 | disabled?: boolean;
|
44 | /**
|
45 | * If `true`, the left and right padding is removed.
|
46 | * @default false
|
47 | */
|
48 | disableGutters?: boolean;
|
49 | /**
|
50 | * If `true`, a 1px light border is added to the bottom of the list item.
|
51 | * @default false
|
52 | */
|
53 | divider?: boolean;
|
54 | /**
|
55 | * Use to apply selected styling.
|
56 | * @default false
|
57 | */
|
58 | selected?: boolean;
|
59 | /**
|
60 | * The system prop that allows defining system overrides as well as additional CSS styles.
|
61 | */
|
62 | sx?: SxProps<Theme>;
|
63 | }
|
64 |
|
65 | export interface ListItemButtonOwnProps extends ListItemButtonBaseProps {}
|
66 |
|
67 | export type ListItemButtonTypeMap<
|
68 | AdditionalProps = {},
|
69 | RootComponent extends React.ElementType = 'div',
|
70 | > = ExtendButtonBaseTypeMap<{
|
71 | props: AdditionalProps & ListItemButtonOwnProps;
|
72 | defaultComponent: RootComponent;
|
73 | }>;
|
74 |
|
75 | /**
|
76 | *
|
77 | * Demos:
|
78 | *
|
79 | * - [Lists](https://mui.com/material-ui/react-list/)
|
80 | *
|
81 | * API:
|
82 | *
|
83 | * - [ListItemButton API](https://mui.com/material-ui/api/list-item-button/)
|
84 | * - inherits [ButtonBase API](https://mui.com/material-ui/api/button-base/)
|
85 | */
|
86 | declare const ListItemButton: ExtendButtonBase<ListItemButtonTypeMap>;
|
87 |
|
88 | export type ListItemButtonProps<
|
89 | RootComponent extends React.ElementType = ListItemButtonTypeMap['defaultComponent'],
|
90 | AdditionalProps = {},
|
91 | > = OverrideProps<ListItemButtonTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
|
92 | component?: React.ElementType;
|
93 | };
|
94 |
|
95 | export default ListItemButton;
|