2023-05-12 14:43:48 +08:00
|
|
|
import type { ReactNode } from 'react';
|
|
|
|
import type { ColorPickerProps } from './ColorPicker';
|
|
|
|
import type { Color } from './color';
|
|
|
|
|
|
|
|
export enum ColorFormat {
|
|
|
|
hex = 'hex',
|
|
|
|
rgb = 'rgb',
|
|
|
|
hsb = 'hsb',
|
|
|
|
}
|
|
|
|
|
2023-05-13 23:05:26 +08:00
|
|
|
export interface PresetsItem {
|
|
|
|
label: ReactNode;
|
|
|
|
colors: (string | Color)[];
|
|
|
|
}
|
2023-05-12 14:43:48 +08:00
|
|
|
|
|
|
|
export interface ColorPickerBaseProps {
|
|
|
|
color?: Color;
|
|
|
|
prefixCls: string;
|
|
|
|
format?: keyof typeof ColorFormat;
|
|
|
|
allowClear?: boolean;
|
2023-05-17 09:58:41 +08:00
|
|
|
colorCleared?: boolean;
|
2023-05-12 14:43:48 +08:00
|
|
|
disabled?: boolean;
|
|
|
|
presets?: PresetsItem[];
|
|
|
|
onFormatChange?: ColorPickerProps['onFormatChange'];
|
|
|
|
}
|