UNPKG

1.22 kBTypeScriptView Raw
1/** @jsx jsx */
2import { ReactNode, Ref } from 'react';
3import { jsx } from '@emotion/react';
4import { CommonPropsAndClassName, CSSObjectWithLabel, GroupBase } from '../types';
5export interface ControlProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> extends CommonPropsAndClassName<Option, IsMulti, Group> {
6 /** Children to render. */
7 children: ReactNode;
8 innerRef: Ref<HTMLDivElement>;
9 /** The mouse down event and the innerRef to pass down to the controller element. */
10 innerProps: JSX.IntrinsicElements['div'];
11 /** Whether the select is disabled. */
12 isDisabled: boolean;
13 /** Whether the select is focused. */
14 isFocused: boolean;
15 /** Whether the select is expanded. */
16 menuIsOpen: boolean;
17}
18export declare const css: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ isDisabled, isFocused, theme: { colors, borderRadius, spacing }, }: ControlProps<Option, IsMulti, Group>, unstyled: boolean) => CSSObjectWithLabel;
19declare const Control: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: ControlProps<Option, IsMulti, Group>) => jsx.JSX.Element;
20export default Control;