1 |
|
2 | import { Simplify } from '@mui/types';
|
3 | import { PolymorphicProps, SlotComponentProps } from '../utils';
|
4 | import { UseSwitchInputSlotProps, UseSwitchParameters } from '../useSwitch';
|
5 | export interface SwitchRootSlotPropsOverrides {
|
6 | }
|
7 | export interface SwitchThumbSlotPropsOverrides {
|
8 | }
|
9 | export interface SwitchInputSlotPropsOverrides {
|
10 | }
|
11 | export interface SwitchTrackSlotPropsOverrides {
|
12 | }
|
13 | export interface SwitchOwnProps extends UseSwitchParameters {
|
14 | |
15 |
|
16 |
|
17 | className?: string;
|
18 | |
19 |
|
20 |
|
21 |
|
22 |
|
23 | slots?: SwitchSlots;
|
24 | |
25 |
|
26 |
|
27 |
|
28 | slotProps?: {
|
29 | root?: SlotComponentProps<'span', SwitchRootSlotPropsOverrides, SwitchOwnerState>;
|
30 | thumb?: SlotComponentProps<'span', SwitchThumbSlotPropsOverrides, SwitchOwnerState>;
|
31 | input?: SlotComponentProps<'input', SwitchInputSlotPropsOverrides, SwitchOwnerState>;
|
32 | track?: SlotComponentProps<'span', SwitchTrackSlotPropsOverrides, SwitchOwnerState>;
|
33 | };
|
34 | }
|
35 | export interface SwitchSlots {
|
36 | |
37 |
|
38 |
|
39 |
|
40 | root?: React.ElementType;
|
41 | |
42 |
|
43 |
|
44 |
|
45 | input?: React.ElementType;
|
46 | |
47 |
|
48 |
|
49 |
|
50 | thumb?: React.ElementType;
|
51 | |
52 |
|
53 |
|
54 |
|
55 | track?: React.ElementType | null;
|
56 | }
|
57 | export interface SwitchTypeMap<AdditionalProps = {}, RootComponentType extends React.ElementType = 'span'> {
|
58 | props: SwitchOwnProps & AdditionalProps;
|
59 | defaultComponent: RootComponentType;
|
60 | }
|
61 | export type SwitchProps<RootComponentType extends React.ElementType = SwitchTypeMap['defaultComponent']> = PolymorphicProps<SwitchTypeMap<{}, RootComponentType>, RootComponentType>;
|
62 | export type SwitchOwnerState = Simplify<SwitchOwnProps & {
|
63 | checked: boolean;
|
64 | disabled: boolean;
|
65 | focusVisible: boolean;
|
66 | readOnly: boolean;
|
67 | }>;
|
68 | export type SwitchRootSlotProps = {
|
69 | ownerState: SwitchOwnerState;
|
70 | className?: string;
|
71 | children?: React.ReactNode;
|
72 | };
|
73 | export type SwitchThumbSlotProps = {
|
74 | ownerState: SwitchOwnerState;
|
75 | className?: string;
|
76 | children?: React.ReactNode;
|
77 | };
|
78 | export type SwitchTrackSlotProps = {
|
79 | ownerState: SwitchOwnerState;
|
80 | className?: string;
|
81 | children?: React.ReactNode;
|
82 | };
|
83 | export type SwitchInputSlotProps = Simplify<UseSwitchInputSlotProps & {
|
84 | ownerState: SwitchOwnerState;
|
85 | className?: string;
|
86 | children?: React.ReactNode;
|
87 | }>;
|