forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Slider.d.ts
127 lines (115 loc) · 4.44 KB
/
Slider.d.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import * as React from 'react';
import {
ExtendSliderUnstyledTypeMap,
ExtendSliderUnstyled,
SliderUnstyledTypeMap,
SliderValueLabelProps,
} from '@mui/base/SliderUnstyled';
import { SxProps } from '@mui/system';
import { OverridableStringUnion } from '@mui/types';
import { Theme } from '../styles';
import { OverrideProps } from '../OverridableComponent';
export interface SliderPropsColorOverrides {}
export interface SliderPropsSizeOverrides {}
export type SliderTypeMap<
D extends React.ElementType = 'span',
P = {},
> = ExtendSliderUnstyledTypeMap<{
props: P & {
/**
* The color of the component.
* It supports both default and custom theme colors, which can be added as shown in the
* [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
* @default 'primary'
*/
color?: OverridableStringUnion<'primary' | 'secondary', SliderPropsColorOverrides>;
/**
* The components used for each slot inside.
*
* This prop is an alias for the `slots` prop.
* It's recommended to use the `slots` prop instead.
*
* @default {}
*/
components?: {
Root?: React.ElementType;
Track?: React.ElementType;
Rail?: React.ElementType;
Thumb?: React.ElementType;
Mark?: React.ElementType;
MarkLabel?: React.ElementType;
ValueLabel?: React.ElementType;
Input?: React.ElementType;
};
/**
* The extra props for the slot components.
* You can override the existing props or add new ones.
*
* This prop is an alias for the `slotProps` prop.
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
*
* @default {}
*/
componentsProps?: SliderUnstyledTypeMap['props']['slotProps'];
/**
* Override or extend the styles applied to the component.
*/
classes?: SliderUnstyledTypeMap['props']['classes'] & {
/** Class name applied to the root element if `color="primary"`. */
colorPrimary?: string;
/** Class name applied to the root element if `color="secondary"`. */
colorSecondary?: string;
/** Class name applied to the root element if `size="small"`. */
sizeSmall?: string;
/** Class name applied to the thumb element if `color="primary"`. */
thumbColorPrimary?: string;
/** Class name applied to the thumb element if `color="secondary"`. */
thumbColorSecondary?: string;
/** Class name applied to the thumb element if `size="small"`. */
thumbSizeSmall?: string;
};
/**
* The size of the slider.
* @default 'medium'
*/
size?: OverridableStringUnion<'small' | 'medium', SliderPropsSizeOverrides>;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
};
defaultComponent: D;
}>;
export { SliderValueLabelProps };
type SliderRootProps = NonNullable<SliderTypeMap['props']['componentsProps']>['root'];
type SliderMarkProps = NonNullable<SliderTypeMap['props']['componentsProps']>['mark'];
type SliderMarkLabelProps = NonNullable<SliderTypeMap['props']['componentsProps']>['markLabel'];
type SliderRailProps = NonNullable<SliderTypeMap['props']['componentsProps']>['rail'];
type SliderTrackProps = NonNullable<SliderTypeMap['props']['componentsProps']>['track'];
type SliderThumbProps = NonNullable<SliderTypeMap['props']['componentsProps']>['thumb'];
export declare const SliderRoot: React.FC<SliderRootProps>;
export declare const SliderMark: React.FC<SliderMarkProps>;
export declare const SliderMarkLabel: React.FC<SliderMarkLabelProps>;
export declare const SliderRail: React.FC<SliderRailProps>;
export declare const SliderTrack: React.FC<SliderTrackProps>;
export declare const SliderThumb: React.FC<SliderThumbProps>;
export declare const SliderValueLabel: React.FC<SliderValueLabelProps>;
/**
*
* Demos:
*
* - [Slider](https://mui.com/material-ui/react-slider/)
*
* API:
*
* - [Slider API](https://mui.com/material-ui/api/slider/)
*/
declare const Slider: ExtendSliderUnstyled<SliderTypeMap>;
export type SliderClassKey = keyof NonNullable<SliderTypeMap['props']['classes']>;
export type SliderProps<
D extends React.ElementType = SliderTypeMap['defaultComponent'],
P = {},
> = OverrideProps<SliderTypeMap<D, P>, D>;
export type SliderClasses = Record<SliderClassKey, string>;
export declare const sliderClasses: SliderClasses;
export default Slider;