UNPKG

11.4 kBTypeScriptView Raw
1import { CSSObject, CSSInterpolation, Interpolation } from '@mui/system';
2import { PopperClassKey } from '../Popper';
3import { ComponentsPropsList } from './props';
4import { AccordionActionsClassKey } from '../AccordionActions';
5import { AccordionClassKey } from '../Accordion';
6import { AccordionDetailsClassKey } from '../AccordionDetails';
7import { AccordionSummaryClassKey } from '../AccordionSummary';
8import { AlertClassKey } from '../Alert';
9import { AlertTitleClassKey } from '../AlertTitle';
10import { AppBarClassKey } from '../AppBar';
11import { AutocompleteClassKey } from '../Autocomplete';
12import { AvatarClassKey } from '../Avatar';
13import { AvatarGroupClassKey } from '../AvatarGroup';
14import { BackdropClassKey } from '../Backdrop';
15import { BadgeClassKey } from '../Badge';
16import { BottomNavigationActionClassKey } from '../BottomNavigationAction';
17import { BottomNavigationClassKey } from '../BottomNavigation';
18import { BreadcrumbsClassKey } from '../Breadcrumbs';
19import { ButtonBaseClassKey } from '../ButtonBase';
20import { ButtonClassKey } from '../Button';
21import { ButtonGroupClassKey } from '../ButtonGroup';
22import { CardActionAreaClassKey } from '../CardActionArea';
23import { CardActionsClassKey } from '../CardActions';
24import { CardClassKey } from '../Card';
25import { CardContentClassKey } from '../CardContent';
26import { CardHeaderClassKey } from '../CardHeader';
27import { CardMediaClassKey } from '../CardMedia';
28import { CheckboxClassKey } from '../Checkbox';
29import { ChipClassKey } from '../Chip';
30import { CircularProgressClassKey } from '../CircularProgress';
31import { CollapseClassKey } from '../Collapse';
32import { ContainerClassKey } from '../Container';
33import { DialogActionsClassKey } from '../DialogActions';
34import { DialogClassKey } from '../Dialog';
35import { DialogContentClassKey } from '../DialogContent';
36import { DialogContentTextClassKey } from '../DialogContentText';
37import { DialogTitleClassKey } from '../DialogTitle';
38import { DividerClassKey } from '../Divider';
39import { DrawerClassKey } from '../Drawer';
40import { FabClassKey } from '../Fab';
41import { FilledInputClassKey } from '../FilledInput';
42import { FormControlClassKey } from '../FormControl';
43import { FormControlLabelClassKey } from '../FormControlLabel';
44import { FormGroupClassKey } from '../FormGroup';
45import { FormHelperTextClassKey } from '../FormHelperText';
46import { FormLabelClassKey } from '../FormLabel';
47import { GridClassKey } from '../Grid';
48import { Grid2Slot } from '../Grid2';
49import { IconButtonClassKey } from '../IconButton';
50import { IconClassKey } from '../Icon';
51import { ImageListClassKey } from '../ImageList';
52import { ImageListItemBarClassKey } from '../ImageListItemBar';
53import { ImageListItemClassKey } from '../ImageListItem';
54import { InputAdornmentClassKey } from '../InputAdornment';
55import { InputBaseClassKey } from '../InputBase';
56import { InputClassKey } from '../Input';
57import { InputLabelClassKey } from '../InputLabel';
58import { LinearProgressClassKey } from '../LinearProgress';
59import { LinkClassKey } from '../Link';
60import { ListClassKey } from '../List';
61import { ListItemAvatarClassKey } from '../ListItemAvatar';
62import { ListItemClassKey } from '../ListItem';
63import { ListItemButtonClassKey } from '../ListItemButton';
64import { ListItemIconClassKey } from '../ListItemIcon';
65import { ListItemSecondaryActionClassKey } from '../ListItemSecondaryAction';
66import { ListItemTextClassKey } from '../ListItemText';
67import { ListSubheaderClassKey } from '../ListSubheader';
68import { MenuClassKey } from '../Menu';
69import { MenuItemClassKey } from '../MenuItem';
70import { MenuListClassKey } from '../MenuList';
71import { MobileStepperClassKey } from '../MobileStepper';
72import { ModalClassKey } from '../Modal';
73import { NativeSelectClassKey } from '../NativeSelect';
74import { OutlinedInputClassKey } from '../OutlinedInput';
75import { PaginationClassKey } from '../Pagination';
76import { PaginationItemClassKey } from '../PaginationItem';
77import { PaperClassKey } from '../Paper';
78import { PopoverClassKey } from '../Popover';
79import { RadioClassKey } from '../Radio';
80import { RadioGroupClassKey } from '../RadioGroup';
81import { RatingClassKey } from '../Rating';
82import { ScopedCssBaselineClassKey } from '../ScopedCssBaseline';
83import { SelectClassKey } from '../Select';
84import { SkeletonClassKey } from '../Skeleton';
85import { SliderClassKey } from '../Slider';
86import { SnackbarClassKey } from '../Snackbar';
87import { SnackbarContentClassKey } from '../SnackbarContent';
88import { SpeedDialClassKey } from '../SpeedDial';
89import { SpeedDialActionClassKey } from '../SpeedDialAction';
90import { SpeedDialIconClassKey } from '../SpeedDialIcon';
91import { StackClassKey } from '../Stack';
92import { StepButtonClasskey } from '../StepButton';
93import { StepClasskey } from '../Step';
94import { StepConnectorClasskey } from '../StepConnector';
95import { StepContentClasskey } from '../StepContent';
96import { StepIconClasskey } from '../StepIcon';
97import { StepLabelClasskey } from '../StepLabel';
98import { StepperClasskey } from '../Stepper';
99import { SvgIconClassKey } from '../SvgIcon';
100import { SwitchClassKey } from '../Switch';
101import { TabClassKey } from '../Tab';
102import { TableBodyClassKey } from '../TableBody';
103import { TableCellClassKey } from '../TableCell';
104import { TableClassKey } from '../Table';
105import { TableContainerClassKey } from '../TableContainer';
106import { TableFooterClassKey } from '../TableFooter';
107import { TableHeadClassKey } from '../TableHead';
108import { TablePaginationClassKey } from '../TablePagination';
109import { TableRowClassKey } from '../TableRow';
110import { TableSortLabelClassKey } from '../TableSortLabel';
111import { TabsClassKey } from '../Tabs';
112import { TextFieldClassKey } from '../TextField';
113import { ToggleButtonClassKey } from '../ToggleButton';
114import { ToggleButtonGroupClassKey } from '../ToggleButtonGroup';
115import { ToolbarClassKey } from '../Toolbar';
116import { TooltipClassKey } from '../Tooltip';
117import { TouchRippleClassKey } from '../ButtonBase/TouchRipple';
118import { TypographyClassKey } from '../Typography';
119
120export type OverridesStyleRules<
121 ClassKey extends string = string,
122 ComponentName = keyof ComponentsPropsList,
123 Theme = unknown,
124> = Record<
125 ClassKey,
126 Interpolation<
127 // Record<string, unknown> is for other props that the slot receive internally
128 // Documenting all ownerStates could be a huge work, let's wait until we have a real needs from developers.
129 (ComponentName extends keyof ComponentsPropsList
130 ? ComponentsPropsList[ComponentName] &
131 Record<string, unknown> & {
132 ownerState: ComponentsPropsList[ComponentName] & Record<string, unknown>;
133 }
134 : {}) & {
135 theme: Theme;
136 } & Record<string, unknown>
137 >
138>;
139
140export type ComponentsOverrides<Theme = unknown> = {
141 [Name in keyof ComponentNameToClassKey]?: Partial<
142 OverridesStyleRules<ComponentNameToClassKey[Name], Name, Theme>
143 >;
144} & {
145 MuiCssBaseline?: CSSObject | string | ((theme: Theme) => CSSInterpolation);
146};
147
148export interface ComponentNameToClassKey {
149 MuiAlert: AlertClassKey;
150 MuiAlertTitle: AlertTitleClassKey;
151 MuiAppBar: AppBarClassKey;
152 MuiAutocomplete: AutocompleteClassKey;
153 MuiAvatar: AvatarClassKey;
154 MuiAvatarGroup: AvatarGroupClassKey;
155 MuiBackdrop: BackdropClassKey;
156 MuiBadge: BadgeClassKey;
157 MuiBottomNavigation: BottomNavigationClassKey;
158 MuiBottomNavigationAction: BottomNavigationActionClassKey;
159 MuiBreadcrumbs: BreadcrumbsClassKey;
160 MuiButton: ButtonClassKey;
161 MuiButtonBase: ButtonBaseClassKey;
162 MuiButtonGroup: ButtonGroupClassKey;
163 MuiCard: CardClassKey;
164 MuiCardActionArea: CardActionAreaClassKey;
165 MuiCardActions: CardActionsClassKey;
166 MuiCardContent: CardContentClassKey;
167 MuiCardHeader: CardHeaderClassKey;
168 MuiCardMedia: CardMediaClassKey;
169 MuiCheckbox: CheckboxClassKey;
170 MuiChip: ChipClassKey;
171 MuiCircularProgress: CircularProgressClassKey;
172 MuiCollapse: CollapseClassKey;
173 MuiContainer: ContainerClassKey;
174 MuiDialog: DialogClassKey;
175 MuiDialogActions: DialogActionsClassKey;
176 MuiDialogContent: DialogContentClassKey;
177 MuiDialogContentText: DialogContentTextClassKey;
178 MuiDialogTitle: DialogTitleClassKey;
179 MuiDivider: DividerClassKey;
180 MuiDrawer: DrawerClassKey;
181 MuiAccordion: AccordionClassKey;
182 MuiAccordionActions: AccordionActionsClassKey;
183 MuiAccordionDetails: AccordionDetailsClassKey;
184 MuiAccordionSummary: AccordionSummaryClassKey;
185 MuiFab: FabClassKey;
186 MuiFilledInput: FilledInputClassKey;
187 MuiFormControl: FormControlClassKey;
188 MuiFormControlLabel: FormControlLabelClassKey;
189 MuiFormGroup: FormGroupClassKey;
190 MuiFormHelperText: FormHelperTextClassKey;
191 MuiFormLabel: FormLabelClassKey;
192 MuiGrid: GridClassKey;
193 MuiGrid2: Grid2Slot;
194 MuiIcon: IconClassKey;
195 MuiIconButton: IconButtonClassKey;
196 MuiImageList: ImageListClassKey;
197 MuiImageListItem: ImageListItemClassKey;
198 MuiImageListItemBar: ImageListItemBarClassKey;
199 MuiInput: InputClassKey;
200 MuiInputAdornment: InputAdornmentClassKey;
201 MuiInputBase: InputBaseClassKey;
202 MuiInputLabel: InputLabelClassKey;
203 MuiLinearProgress: LinearProgressClassKey;
204 MuiLink: LinkClassKey;
205 MuiList: ListClassKey;
206 MuiListItem: ListItemClassKey;
207 MuiListItemButton: ListItemButtonClassKey;
208 MuiListItemAvatar: ListItemAvatarClassKey;
209 MuiListItemIcon: ListItemIconClassKey;
210 MuiListItemSecondaryAction: ListItemSecondaryActionClassKey;
211 MuiListItemText: ListItemTextClassKey;
212 MuiListSubheader: ListSubheaderClassKey;
213 MuiMenu: MenuClassKey;
214 MuiMenuItem: MenuItemClassKey;
215 MuiMenuList: MenuListClassKey;
216 MuiMobileStepper: MobileStepperClassKey;
217 MuiModal: ModalClassKey;
218 MuiNativeSelect: NativeSelectClassKey;
219 MuiOutlinedInput: OutlinedInputClassKey;
220 MuiPagination: PaginationClassKey;
221 MuiPaginationItem: PaginationItemClassKey;
222 MuiPaper: PaperClassKey;
223 MuiPopover: PopoverClassKey;
224 MuiPopper: PopperClassKey;
225 MuiRadio: RadioClassKey;
226 MuiRadioGroup: RadioGroupClassKey;
227 MuiRating: RatingClassKey;
228 MuiScopedCssBaseline: ScopedCssBaselineClassKey;
229 MuiSelect: SelectClassKey;
230 MuiSkeleton: SkeletonClassKey;
231 MuiSlider: SliderClassKey;
232 MuiSnackbar: SnackbarClassKey;
233 MuiSnackbarContent: SnackbarContentClassKey;
234 MuiSpeedDial: SpeedDialClassKey;
235 MuiSpeedDialAction: SpeedDialActionClassKey;
236 MuiSpeedDialIcon: SpeedDialIconClassKey;
237 MuiStack: StackClassKey;
238 MuiStep: StepClasskey;
239 MuiStepButton: StepButtonClasskey;
240 MuiStepConnector: StepConnectorClasskey;
241 MuiStepContent: StepContentClasskey;
242 MuiStepIcon: StepIconClasskey;
243 MuiStepLabel: StepLabelClasskey;
244 MuiStepper: StepperClasskey;
245 MuiSvgIcon: SvgIconClassKey;
246 MuiSwitch: SwitchClassKey;
247 MuiTab: TabClassKey;
248 MuiTable: TableClassKey;
249 MuiTableBody: TableBodyClassKey;
250 MuiTableCell: TableCellClassKey;
251 MuiTableContainer: TableContainerClassKey;
252 MuiTableFooter: TableFooterClassKey;
253 MuiTableHead: TableHeadClassKey;
254 MuiTablePagination: TablePaginationClassKey;
255 MuiTableRow: TableRowClassKey;
256 MuiTableSortLabel: TableSortLabelClassKey;
257 MuiTabs: TabsClassKey;
258 MuiTextField: TextFieldClassKey;
259 MuiToggleButton: ToggleButtonClassKey;
260 MuiToggleButtonGroup: ToggleButtonGroupClassKey;
261 MuiToolbar: ToolbarClassKey;
262 MuiTooltip: TooltipClassKey;
263 MuiTouchRipple: TouchRippleClassKey;
264 MuiTypography: TypographyClassKey;
265}
266
\No newline at end of file