forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
formControlUnstyledClasses.ts
30 lines (25 loc) · 1.07 KB
/
formControlUnstyledClasses.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import generateUtilityClass from '../generateUtilityClass';
import generateUtilityClasses from '../generateUtilityClasses';
export interface FormControlUnstyledClasses {
/** Class applied to the root element. */
root: string;
/** Class applied to the root element if `disabled={true}`. */
disabled: string;
/** Class applied to the root element if `error={true}`. */
error: string;
/** Class applied to the root element if the inner input has value. */
filled: string;
/** Class applied to the root element if the inner input is focused. */
focused: string;
/** Class applied to the root element if `required={true}`. */
required: string;
}
export type FormControlUnstyledClassKey = keyof FormControlUnstyledClasses;
export function getFormControlUnstyledUtilityClass(slot: string): string {
return generateUtilityClass('MuiFormControl', slot);
}
const formControlUnstyledClasses: FormControlUnstyledClasses = generateUtilityClasses(
'MuiFormControl',
['root', 'disabled', 'error', 'filled', 'focused', 'required'],
);
export default formControlUnstyledClasses;