dawn-ui-react 1.0.0-alpha.32 → 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,3 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { ColorPickerInputProps } from './color-picker.types';
3
- export declare const ColorPickerInput: ({ className, children, ref, ...props }: ColorPickerInputProps) => React.JSX.Element;
3
+ export declare const ColorPickerInput: ({ showPopover, showTransparencyField, className, children, ref, ...props }: ColorPickerInputProps) => React.JSX.Element;
@@ -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, value: controlledValue, defaultColor, defaultPalette, paletteLimit, onValueChange, className, children, ref, ...props }: ColorPickerProps) => React.JSX.Element;
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
- value?: string | chroma.Color;
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,7 +86,11 @@ export type ValueType = {
84
86
  getValue: (color: chroma.Color) => any;
85
87
  parseValue: (value: string) => chroma.Color | undefined;
86
88
  };
87
- export type ColorPickerInputProps = React.ComponentProps<typeof InputGroup>;
89
+ export type ValueTypeValue = 'rgb' | 'css' | 'hex' | 'hsl' | 'hsv';
90
+ export type ColorPickerInputProps = React.ComponentProps<typeof InputGroup> & {
91
+ showPopover?: boolean;
92
+ showTransparencyField?: boolean;
93
+ };
88
94
  export type ColorPickerAreaProps = React.ComponentProps<'div'>;
89
95
  export type ColorPickerHueSliderProps = Partial<React.ComponentProps<typeof ColorChannelSlider>>;
90
96
  export type ColorPickerLightnessSliderProps = Partial<React.ComponentProps<typeof ColorChannelSlider>>;
@@ -93,14 +99,15 @@ export type ColorPickerValueTypeProps = React.ComponentProps<typeof SelectTrigge
93
99
  export type ColorPickerRowProps = React.ComponentProps<'div'>;
94
100
  export type ColorPickerGroupProps = React.ComponentProps<'div'>;
95
101
  export type ColorPickerLabelProps = React.ComponentProps<'span'>;
102
+ export type ColorPickerPaletteListChild = React.ReactNode | ((props: {
103
+ color: chroma.Color;
104
+ index: number;
105
+ }) => React.ReactNode);
96
106
  export type ColorPickerPaletteListProps = Omit<React.ComponentProps<'ul'>, 'children'> & {
97
- children?: (props: {
98
- color: chroma.Color;
99
- index: number;
100
- }) => React.ReactNode;
107
+ children?: ColorPickerPaletteListChild | ColorPickerPaletteListChild[];
101
108
  };
102
109
  export type ColorPickerPaletteSwatchProps = Omit<React.ComponentProps<'button'>, 'color'> & VariantProps<typeof colorPickerSwatchVariants> & {
103
110
  color: chroma.Color;
104
111
  };
105
- export type ColorPickerPaletteAddProps = React.ComponentProps<typeof Button>;
112
+ export type ColorPickerPaletteAddProps = React.ComponentProps<'button'>;
106
113
  export type ColorPickerPaletteLimitProps = React.ComponentProps<'span'>;
@@ -10,4 +10,5 @@ export { ColorPickerPaletteSwatch } from './color-picker-palette-swatch';
10
10
  export { ColorPickerRow } from './color-picker-row';
11
11
  export { ColorPickerTransparencySlider } from './color-picker-transparency-slider';
12
12
  export { ColorPickerValueType } from './color-picker-value-type';
13
- export type { ColorPickerProps, ColorPickerPaletteAddProps, ColorPickerState, ColorPickerAction, ColorPickerAreaProps, ColorPickerContextType, ColorPickerGroupProps, ColorPickerHueSliderProps, ColorPickerInputProps, ColorPickerLabelProps, ColorPickerPaletteLimitProps, ColorPickerPaletteListProps, ColorPickerPaletteSwatchProps, ColorPickerRowProps, ColorPickerTransparencySliderProps, ColorPickerValueTypeProps, } from './color-picker.types';
13
+ export { ColorPickerLightnessSlider } from './color-picker-lightness-slider';
14
+ export type { ColorPickerProps, ColorPickerPaletteAddProps, ColorPickerState, ColorPickerAction, ColorPickerAreaProps, ColorPickerContextType, ColorPickerGroupProps, ColorPickerHueSliderProps, ColorPickerInputProps, ColorPickerLabelProps, ColorPickerPaletteLimitProps, ColorPickerPaletteListProps, ColorPickerPaletteSwatchProps, ColorPickerRowProps, ColorPickerTransparencySliderProps, ColorPickerValueTypeProps, ColorPickerLightnessSliderProps, } from './color-picker.types';
@@ -1,2 +1,2 @@
1
1
  import { InputGroupProps } from './input-group.types';
2
- export declare const InputGroup: ({ variant, className, children, ref, ...props }: InputGroupProps) => import("react").JSX.Element;
2
+ export declare const InputGroup: ({ variant, size, className, children, ref, ...props }: InputGroupProps) => import("react").JSX.Element;