dawn-ui-react 1.0.0-alpha.33 → 1.0.0-alpha.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ColorPickerProps, ColorPickerContextType } from './color-picker.types';
|
|
3
|
-
export declare const ColorPicker: ({ variant,
|
|
3
|
+
export declare const ColorPicker: ({ variant, color: controlledValue, defaultColor, palette: controlledPalette, defaultPalette, onPaletteChange, paletteLimit, defaultValueType, onValueChange, className, children, ref, ...props }: ColorPickerProps) => React.JSX.Element;
|
|
4
4
|
export declare const useColorPicker: () => ColorPickerContextType;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { default as chroma } from 'chroma-js';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
|
-
import { Button } from '../button';
|
|
4
3
|
import { ColorChannelSlider } from '../color-channel-slider';
|
|
5
4
|
import { InputGroup } from '../input-group';
|
|
6
5
|
import { SelectTrigger } from '../select';
|
|
@@ -65,10 +64,13 @@ export type ColorPickerAction = {
|
|
|
65
64
|
color: chroma.Color;
|
|
66
65
|
};
|
|
67
66
|
export type ColorPickerProps = React.ComponentProps<'div'> & VariantProps<typeof colorPickerVariants> & {
|
|
68
|
-
|
|
67
|
+
color?: string;
|
|
69
68
|
defaultColor?: string;
|
|
69
|
+
palette?: string[];
|
|
70
70
|
defaultPalette?: string[];
|
|
71
|
+
onPaletteChange?: (palette: string[]) => void;
|
|
71
72
|
paletteLimit?: number;
|
|
73
|
+
defaultValueType?: ValueTypeValue;
|
|
72
74
|
onValueChange?: (color: chroma.Color) => void;
|
|
73
75
|
};
|
|
74
76
|
export declare const colorPickerVariants: (props?: ({
|
|
@@ -84,6 +86,7 @@ export type ValueType = {
|
|
|
84
86
|
getValue: (color: chroma.Color) => any;
|
|
85
87
|
parseValue: (value: string) => chroma.Color | undefined;
|
|
86
88
|
};
|
|
89
|
+
export type ValueTypeValue = 'rgb' | 'css' | 'hex' | 'hsl' | 'hsv';
|
|
87
90
|
export type ColorPickerInputProps = React.ComponentProps<typeof InputGroup> & {
|
|
88
91
|
showPopover?: boolean;
|
|
89
92
|
showTransparencyField?: boolean;
|
|
@@ -96,14 +99,15 @@ export type ColorPickerValueTypeProps = React.ComponentProps<typeof SelectTrigge
|
|
|
96
99
|
export type ColorPickerRowProps = React.ComponentProps<'div'>;
|
|
97
100
|
export type ColorPickerGroupProps = React.ComponentProps<'div'>;
|
|
98
101
|
export type ColorPickerLabelProps = React.ComponentProps<'span'>;
|
|
102
|
+
export type ColorPickerPaletteListChild = React.ReactNode | ((props: {
|
|
103
|
+
color: chroma.Color;
|
|
104
|
+
index: number;
|
|
105
|
+
}) => React.ReactNode);
|
|
99
106
|
export type ColorPickerPaletteListProps = Omit<React.ComponentProps<'ul'>, 'children'> & {
|
|
100
|
-
children?:
|
|
101
|
-
color: chroma.Color;
|
|
102
|
-
index: number;
|
|
103
|
-
}) => React.ReactNode;
|
|
107
|
+
children?: ColorPickerPaletteListChild | ColorPickerPaletteListChild[];
|
|
104
108
|
};
|
|
105
109
|
export type ColorPickerPaletteSwatchProps = Omit<React.ComponentProps<'button'>, 'color'> & VariantProps<typeof colorPickerSwatchVariants> & {
|
|
106
110
|
color: chroma.Color;
|
|
107
111
|
};
|
|
108
|
-
export type ColorPickerPaletteAddProps = React.ComponentProps<
|
|
112
|
+
export type ColorPickerPaletteAddProps = React.ComponentProps<'button'>;
|
|
109
113
|
export type ColorPickerPaletteLimitProps = React.ComponentProps<'span'>;
|