1 | import { CSSObject } from '@emotion/serialize';
|
2 | import { ContainerProps, IndicatorContainerProps, ValueContainerProps } from './components/containers';
|
3 | import { ControlProps } from './components/Control';
|
4 | import { GroupProps, GroupHeadingProps } from './components/Group';
|
5 | import { IndicatorProps, LoadingIndicatorProps } from './components/indicators';
|
6 | import { MultiValueProps, MultiValueRemoveProps } from './components/MultiValue';
|
7 | import { InputProps } from './components/Input';
|
8 | import { MenuProps, MenuListComponentProps, MenuPortalProps, NoticeProps } from './components/Menu';
|
9 | import { OptionProps } from './components/Option';
|
10 | import { PlaceholderProps } from './components/Placeholder';
|
11 | import { SingleValueProps } from './components/SingleValue';
|
12 | import { GroupTypeBase, OptionTypeBase } from './types';
|
13 |
|
14 |
|
15 | export interface Props {
|
16 | [key: string]: any;
|
17 | }
|
18 |
|
19 |
|
20 | export type StylesConfigFunction<Props = any> = (base: CSSObject, props: Props) => CSSObject;
|
21 |
|
22 | export interface Styles<
|
23 | OptionType extends OptionTypeBase,
|
24 | IsMulti extends boolean,
|
25 | GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
|
26 | > {
|
27 | clearIndicator?(base: CSSObject, props: IndicatorProps<OptionType, IsMulti, GroupType>): CSSObject;
|
28 | container?(base: CSSObject, props: ContainerProps<OptionType, IsMulti, GroupType>): CSSObject;
|
29 | control?(base: CSSObject, props: ControlProps<OptionType, IsMulti, GroupType>): CSSObject;
|
30 | dropdownIndicator?(base: CSSObject, props: IndicatorProps<OptionType, IsMulti, GroupType>): CSSObject;
|
31 | group?(base: CSSObject, props: GroupProps<OptionType, IsMulti, GroupType>): CSSObject;
|
32 | groupHeading?(base: CSSObject, props: GroupHeadingProps<OptionType, IsMulti, GroupType>): CSSObject;
|
33 | indicatorsContainer?(base: CSSObject, props: IndicatorContainerProps<OptionType, IsMulti, GroupType>): CSSObject;
|
34 | indicatorSeparator?(base: CSSObject, props: IndicatorProps<OptionType, IsMulti, GroupType>): CSSObject;
|
35 | input?: (base: CSSObject, props: InputProps) => CSSObject;
|
36 | loadingIndicator?(base: CSSObject, props: LoadingIndicatorProps<OptionType, IsMulti, GroupType>): CSSObject;
|
37 | loadingMessage?(base: CSSObject, props: NoticeProps<OptionType, IsMulti, GroupType>): CSSObject;
|
38 | menu?(base: CSSObject, props: MenuProps<OptionType, IsMulti, GroupType>): CSSObject;
|
39 | menuList?(base: CSSObject, props: MenuListComponentProps<OptionType, IsMulti, GroupType>): CSSObject;
|
40 | menuPortal?(base: CSSObject, props: MenuPortalProps<OptionType, IsMulti, GroupType>): CSSObject;
|
41 | multiValue?(base: CSSObject, props: MultiValueProps<OptionType, GroupType>): CSSObject;
|
42 | multiValueLabel?(base: CSSObject, props: MultiValueProps<OptionType, GroupType>): CSSObject;
|
43 | multiValueRemove?(base: CSSObject, props: MultiValueRemoveProps<OptionType, GroupType>): CSSObject;
|
44 | noOptionsMessage?(base: CSSObject, props: NoticeProps<OptionType, IsMulti, GroupType>): CSSObject;
|
45 | option?(base: CSSObject, props: OptionProps<OptionType, IsMulti, GroupType>): CSSObject;
|
46 | placeholder?(base: CSSObject, props: PlaceholderProps<OptionType, IsMulti, GroupType>): CSSObject;
|
47 | singleValue?(base: CSSObject, props: SingleValueProps<OptionType, GroupType>): CSSObject;
|
48 | valueContainer?(base: CSSObject, props: ValueContainerProps<OptionType, IsMulti, GroupType>): CSSObject;
|
49 | }
|
50 |
|
51 | export type StylesConfig<
|
52 | OptionType extends OptionTypeBase,
|
53 | IsMulti extends boolean,
|
54 | GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
|
55 | > = Partial<Styles<OptionType, IsMulti, GroupType>>;
|
56 | export type GetStyles = (a: string, b: Props) => CSSObject;
|
57 |
|
58 | export const defaultStyles: Styles<any, false>;
|
59 |
|
60 |
|
61 |
|
62 |
|
63 | export function mergeStyles<
|
64 | OptionType extends OptionTypeBase,
|
65 | IsMulti extends boolean,
|
66 | GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
|
67 | >(
|
68 | source: StylesConfig<OptionType, IsMulti, GroupType>,
|
69 | target: StylesConfig<OptionType, IsMulti, GroupType>,
|
70 | ): StylesConfig<OptionType, IsMulti, GroupType>;
|