ui: add more props to Select

This commit is contained in:
Yangshun Tay
2022-10-05 20:30:45 +08:00
parent 0a3fb2503d
commit 4fcf80ae2a
3 changed files with 115 additions and 21 deletions

View File

@ -7,7 +7,7 @@ import type {
} from 'react';
import React, { forwardRef, useId } from 'react';
type TextInputInputAttributes = Pick<
type Attributes = Pick<
InputHTMLAttributes<HTMLInputElement>,
| 'autoComplete'
| 'disabled'
@ -16,17 +16,14 @@ type TextInputInputAttributes = Pick<
| 'min'
| 'minLength'
| 'name'
| 'onBlur'
| 'onFocus'
| 'pattern'
| 'placeholder'
| 'required'
| 'type'
>;
type TextInputDOMAttributes = Pick<
InputHTMLAttributes<HTMLInputElement>,
'onBlur' | 'onFocus'
>;
type Props = Readonly<{
defaultValue?: string;
endIcon?: React.ComponentType<React.ComponentProps<'svg'>>;
@ -39,8 +36,7 @@ type Props = Readonly<{
startIcon?: React.ComponentType<React.ComponentProps<'svg'>>;
value?: string;
}> &
Readonly<TextInputDOMAttributes> &
Readonly<TextInputInputAttributes>;
Readonly<Attributes>;
type State = 'error' | 'normal';