-
Notifications
You must be signed in to change notification settings - Fork 30.1k
/
styles.d.ts
75 lines (69 loc) · 2.05 KB
/
styles.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
import {
containerCSS,
indicatorsContainerCSS,
valueContainerCSS,
} from './components/containers';
import { css as controlCSS } from './components/Control';
import { groupCSS, groupHeadingCSS } from './components/Group';
import {
clearIndicatorCSS,
dropdownIndicatorCSS,
loadingIndicatorCSS,
indicatorSeparatorCSS,
} from './components/indicators';
import { inputCSS } from './components/Input';
import { placeholderCSS } from './components/Placeholder';
import { optionCSS } from './components/Option';
import {
menuCSS,
menuListCSS,
menuPortalCSS,
noOptionsMessageCSS,
loadingMessageCSS,
} from './components/Menu';
import { css as singleValueCSS } from './components/SingleValue';
import {
multiValueCSS,
multiValueLabelCSS,
multiValueRemoveCSS,
} from './components/MultiValue';
import { CSSProperties } from 'react';
export interface Props { [key: string]: any; }
/**
* @param base -- the component's default style
* @param state -- the component's current state e.g. `isFocused`
* @returns
*/
export type styleFn = (base: CSSProperties, state: any) => CSSProperties;
export interface Styles {
clearIndicator?: styleFn;
container?: styleFn;
control?: styleFn;
dropdownIndicator?: styleFn;
group?: styleFn;
groupHeading?: styleFn;
indicatorsContainer?: styleFn;
indicatorSeparator?: styleFn;
input?: styleFn;
loadingIndicator?: styleFn;
// TODO loadingMessageCSS?: styleFn;
loadingMessage?: styleFn;
menu?: styleFn;
menuList?: styleFn;
menuPortal?: styleFn;
multiValue?: styleFn;
multiValueLabel?: styleFn;
multiValueRemove?: styleFn;
// TODO noOptionsMessageCSS?: styleFn;
noOptionsMessage?: styleFn;
option?: styleFn;
placeholder?: styleFn;
singleValue?: styleFn;
valueContainer?: styleFn;
}
export type StylesConfig = Partial<Styles>;
export type GetStyles = (a: string, b: Props) => CSSProperties;
export const defaultStyles: Styles;
// Merge Utility
// Allows consumers to extend a base Select with additional styles
export function mergeStyles(source: StylesConfig, target: StylesConfig): StylesConfig;