UNPKG

1.25 kBTypeScriptView Raw
1import { ComponentType, ReactElement, ReactNode } from 'react';
2import { CSSObject } from '@emotion/serialize';
3import { colors, spacing } from '../theme';
4import { CommonProps, GroupTypeBase, OptionTypeBase } from '../types';
5import { ContainerProps } from './containers';
6
7interface State {
8 /** Whether this is disabled */
9 isDisabled: boolean;
10}
11interface ValueProps<OptionType extends OptionTypeBase> {
12 /** The children to be rendered. */
13 children: ReactNode;
14 /* The data of the selected option rendered in the Single Value componentn */
15 data: OptionType;
16 /** Props passed to the wrapping element for the group. */
17 innerProps: any;
18}
19export type SingleValueProps<
20 OptionType extends OptionTypeBase,
21 GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
22> = CommonProps<OptionType, false, GroupType> & ValueProps<OptionType> & State;
23
24export function css(props: SingleValueProps<any>): CSSObject;
25
26declare function SingleValue<
27 OptionType extends OptionTypeBase,
28 GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
29 // tslint:disable-next-line:no-unnecessary-generics
30>(props: SingleValueProps<OptionType, GroupType>): ReactElement;
31
32export default SingleValue;