UNPKG

1.66 kBTypeScriptView Raw
1import * as React from 'react';
2export interface RfddCommon {
3 style?: React.CSSProperties;
4 hoverStyle?: string;
5 optionStyle?: string;
6}
7export declare type Mode = 'dark' | 'light';
8export interface RfddProps extends RfddCommon {
9 className?: string;
10 value?: string;
11 children?: React.ReactElement<RfddOptionProps, 'RfddOption'>[];
12 onChange?: (value: string) => void;
13 mode?: Mode;
14 placeholder?: string;
15 icon?: any;
16 hiddenIcon?: boolean;
17 focusStyle?: React.CSSProperties;
18 selectStyle?: React.CSSProperties;
19 selectClassName?: string;
20 optionClassName?: string;
21 optionOnClick?: () => void;
22}
23export interface RfddOptionProps extends RfddCommon {
24 className?: string;
25 optionClassName?: string;
26 value?: string | number;
27 onChange?: (value: string) => void;
28 children: React.ReactNode;
29 index?: string | number;
30 optionOnClick?: () => void;
31 onClick?: () => void;
32 onSelectChange?: (selectStr: string) => void;
33}
34export interface RfddSelectProps extends RfddCommon {
35 selectClassName?: string;
36 isValue: boolean;
37 mode: Mode;
38 value: number | string;
39 icon?: any;
40 hiddenIcon?: boolean;
41 selectStyle?: React.CSSProperties;
42 focusStyle?: React.CSSProperties;
43}
44export interface RfddSelectStyleType {
45 mode: Mode;
46 isValue: boolean;
47}
48export interface RFDDIconStyleType {
49 isFocus: boolean;
50}
51export interface RfddStyleType {
52 mode: Mode;
53 isFocus: boolean;
54}
55export interface RfddOptionStyleType {
56 style?: React.CSSProperties;
57 hoverStyle?: string;
58 optionStyle?: string;
59}