chore: sync @rc-component/color-picker@1.1.0 (#42445)

* fix: sync @rc-component/color-picker@1.1.0

* Update package.json

Co-authored-by: afc163 <afc163@gmail.com>

---------

Co-authored-by: lijianan <574980606@qq.com>
Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
红果汁 2023-05-18 13:34:06 +08:00 committed by GitHub
parent d90c1c62c0
commit 2722850c0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 16 deletions

View File

@ -1,8 +1,4 @@
import type {
ColorPickerPanelProps as RcColorPickerPanelProps,
TriggerPlacement,
TriggerType,
} from '@rc-component/color-picker';
import type { ColorPickerProps as RcColorPickerProps } from '@rc-component/color-picker';
import classNames from 'classnames';
import useMergedState from 'rc-util/lib/hooks/useMergedState';
import type { CSSProperties } from 'react';
@ -17,15 +13,18 @@ import ColorPickerPanel from './ColorPickerPanel';
import type { Color } from './color';
import ColorTrigger from './components/ColorTrigger';
import useColorState from './hooks/useColorState';
import type { ColorFormat, ColorPickerBaseProps, PresetsItem } from './interface';
import type {
ColorFormat,
ColorPickerBaseProps,
PresetsItem,
TriggerPlacement,
TriggerType,
} from './interface';
import useStyle from './style/index';
import { customizePrefixCls, generateColor } from './util';
export interface ColorPickerProps
extends Omit<
RcColorPickerPanelProps,
'onChange' | 'arrow' | 'value' | 'defaultValue' | 'children' | 'panelRender'
> {
extends Omit<RcColorPickerProps, 'onChange' | 'value' | 'defaultValue' | 'panelRender'> {
value?: Color | string;
defaultValue?: Color | string;
children?: React.ReactNode;
@ -37,9 +36,6 @@ export interface ColorPickerProps
allowClear?: boolean;
presets?: PresetsItem[];
arrow?: boolean | { pointAtCenter: boolean };
prefixCls?: string;
className?: string;
style?: CSSProperties;
styles?: { popup?: CSSProperties };
rootClassName?: string;
onOpenChange?: (open: boolean) => void;

View File

@ -1,4 +1,4 @@
import { ColorPickerPanel as RcColorPickerPanel } from '@rc-component/color-picker';
import RcColorPicker from '@rc-component/color-picker';
import type { FC } from 'react';
import React from 'react';
import Divider from '../divider';
@ -41,7 +41,7 @@ const ColorPickerPanel: FC<ColorPickerPanelProps> = (props) => {
</div>
);
return (
<RcColorPickerPanel
<RcColorPicker
prefixCls={prefixCls}
value={color?.toHsb()}
onChange={onChange}

View File

@ -12,7 +12,15 @@ export interface PresetsItem {
label: ReactNode;
colors: (string | Color)[];
}
export type TriggerType = 'click' | 'hover';
export type TriggerPlacement =
| 'top'
| 'topLeft'
| 'topRight'
| 'bottom'
| 'bottomLeft'
| 'bottomRight';
export interface ColorPickerBaseProps {
color?: Color;
prefixCls: string;

View File

@ -113,7 +113,7 @@
"@ant-design/react-slick": "~1.0.0",
"@babel/runtime": "^7.18.3",
"@ctrl/tinycolor": "^3.6.0",
"@rc-component/color-picker": "~1.0.0",
"@rc-component/color-picker": "~1.1.0",
"@rc-component/mutate-observer": "^1.0.0",
"@rc-component/tour": "~1.8.0",
"@rc-component/trigger": "^1.13.0",