@dreamcommerce/aurora 2.1.15-9 → 2.1.16
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.
- package/build/cjs/packages/aurora/src/components/color_picker/components/label.js +1 -1
- package/build/cjs/packages/aurora/src/components/color_picker/index.js +1 -1
- package/build/esm/packages/aurora/src/components/color_picker/components/label.d.ts +1 -1
- package/build/esm/packages/aurora/src/components/color_picker/components/label.js +1 -1
- package/build/esm/packages/aurora/src/components/color_picker/index.js +1 -1
- package/build/esm/packages/aurora/src/components/color_picker/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -24,7 +24,7 @@ const ColorPickerLabel = ({ name, isRequired, id }) => {
|
|
|
24
24
|
const { isOpen } = React.useContext(index.DropdownContext);
|
|
25
25
|
const classes = useStyles({ color });
|
|
26
26
|
React.useEffect(() => {
|
|
27
|
-
if (isOpen) {
|
|
27
|
+
if (isOpen && color.hex) {
|
|
28
28
|
setInitialColor(color);
|
|
29
29
|
}
|
|
30
30
|
// eslint-disable-next-line
|
|
@@ -48,7 +48,7 @@ const PureColorPicker = ({ hideChooseCancelButtons }) => {
|
|
|
48
48
|
const hueSliderRef = React.useRef(null);
|
|
49
49
|
const classes = useStyles({ color, saturationLightnessPointer, hueSliderPointer, screenName });
|
|
50
50
|
React.useEffect(() => {
|
|
51
|
-
const initialColor = utilities.getColorFromHex(color.hex);
|
|
51
|
+
const initialColor = utilities.getColorFromHex(color.hex || '#ffffff');
|
|
52
52
|
setNewColorPickerPositions(initialColor);
|
|
53
53
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
54
54
|
}, []);
|
|
@@ -16,7 +16,7 @@ const ColorPickerLabel = ({ name, isRequired, id }) => {
|
|
|
16
16
|
const { isOpen } = useContext(DropdownContext);
|
|
17
17
|
const classes = useStyles({ color });
|
|
18
18
|
useEffect(() => {
|
|
19
|
-
if (isOpen) {
|
|
19
|
+
if (isOpen && color.hex) {
|
|
20
20
|
setInitialColor(color);
|
|
21
21
|
}
|
|
22
22
|
// eslint-disable-next-line
|
|
@@ -40,7 +40,7 @@ const PureColorPicker = ({ hideChooseCancelButtons }) => {
|
|
|
40
40
|
const hueSliderRef = useRef(null);
|
|
41
41
|
const classes = useStyles({ color, saturationLightnessPointer, hueSliderPointer, screenName });
|
|
42
42
|
useEffect(() => {
|
|
43
|
-
const initialColor = getColorFromHex(color.hex);
|
|
43
|
+
const initialColor = getColorFromHex(color.hex || '#ffffff');
|
|
44
44
|
setNewColorPickerPositions(initialColor);
|
|
45
45
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
46
|
}, []);
|
|
@@ -25,7 +25,7 @@ export interface IColorPickerProps extends IPureColorPickerProps {
|
|
|
25
25
|
name?: string;
|
|
26
26
|
}
|
|
27
27
|
export interface IColorPickerContextProps {
|
|
28
|
-
color: IColor
|
|
28
|
+
color: Omit<IColor, 'hex'> & Pick<Partial<IColor>, 'hex'>;
|
|
29
29
|
screenName: string;
|
|
30
30
|
initialColor: IColor;
|
|
31
31
|
setInitialColor: Dispatch<SetStateAction<IColor | undefined>>;
|