1 | import * as React from 'react';
|
2 | import { SxProps } from '@mui/system';
|
3 | import { OverridableStringUnion } from '@mui/types';
|
4 | import { Theme } from '../styles';
|
5 | import { OverridableComponent, OverrideProps, OverridableTypeMap } from '../OverridableComponent';
|
6 | import { FormLabelClasses } from './formLabelClasses';
|
7 |
|
8 | export interface FormLabelPropsColorOverrides {}
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export type FormLabelBaseProps = React.LabelHTMLAttributes<HTMLLabelElement>;
|
14 |
|
15 | export interface FormLabelOwnProps {
|
16 | |
17 |
|
18 |
|
19 | children?: React.LabelHTMLAttributes<HTMLLabelElement>['children'];
|
20 | |
21 |
|
22 |
|
23 | classes?: Partial<FormLabelClasses>;
|
24 | |
25 |
|
26 |
|
27 |
|
28 |
|
29 | color?: OverridableStringUnion<
|
30 | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
|
31 | FormLabelPropsColorOverrides
|
32 | >;
|
33 | |
34 |
|
35 |
|
36 | disabled?: boolean;
|
37 | |
38 |
|
39 |
|
40 | error?: boolean;
|
41 | |
42 |
|
43 |
|
44 | filled?: boolean;
|
45 | |
46 |
|
47 |
|
48 | focused?: boolean;
|
49 | |
50 |
|
51 |
|
52 | required?: boolean;
|
53 | |
54 |
|
55 |
|
56 | sx?: SxProps<Theme>;
|
57 | }
|
58 |
|
59 | export interface FormLabelTypeMap<
|
60 | AdditionalProps = {},
|
61 | RootComponent extends React.ElementType = 'label',
|
62 | > {
|
63 | props: AdditionalProps & FormLabelBaseProps & FormLabelOwnProps;
|
64 | defaultComponent: RootComponent;
|
65 | }
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 | declare const FormLabel: OverridableComponent<FormLabelTypeMap>;
|
80 |
|
81 | export interface ExtendFormLabelTypeMap<TypeMap extends OverridableTypeMap> {
|
82 | props: TypeMap['props'] & Pick<FormLabelOwnProps, 'filled' | 'color'>;
|
83 | defaultComponent: TypeMap['defaultComponent'];
|
84 | }
|
85 |
|
86 | export type FormLabelProps<
|
87 | RootComponent extends React.ElementType = FormLabelTypeMap['defaultComponent'],
|
88 | AdditionalProps = {},
|
89 | > = OverrideProps<FormLabelTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
|
90 | component?: React.ElementType;
|
91 | };
|
92 |
|
93 | export default FormLabel;
|