@dreamcommerce/aurora 2.12.1-45 → 2.12.1-46

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.
Files changed (45) hide show
  1. package/build/cjs/packages/aurora/src/components/color_picker_new/components/pure-color-picker.js +4 -8
  2. package/build/cjs/packages/aurora/src/components/color_picker_new/components/pure-color-picker.js.map +1 -1
  3. package/build/cjs/packages/aurora/src/components/color_picker_new/constants.js +1 -5
  4. package/build/cjs/packages/aurora/src/components/color_picker_new/constants.js.map +1 -1
  5. package/build/cjs/packages/aurora/src/components/color_picker_new/context.js +2 -2
  6. package/build/cjs/packages/aurora/src/components/color_picker_new/css_classes.js +1 -11
  7. package/build/cjs/packages/aurora/src/components/color_picker_new/css_classes.js.map +1 -1
  8. package/build/cjs/packages/aurora/src/components/color_picker_new/hooks/use_color_picker.js +4 -8
  9. package/build/cjs/packages/aurora/src/components/color_picker_new/hooks/use_color_picker.js.map +1 -1
  10. package/build/cjs/packages/aurora/src/components/color_picker_new/index.js +5 -2
  11. package/build/cjs/packages/aurora/src/components/color_picker_new/index.js.map +1 -1
  12. package/build/cjs/packages/aurora/src/components/color_picker_new/utilities.js +0 -5
  13. package/build/cjs/packages/aurora/src/components/color_picker_new/utilities.js.map +1 -1
  14. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-footer.js +25 -26
  15. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-footer.js.map +1 -1
  16. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-hex.js +31 -33
  17. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-hex.js.map +1 -1
  18. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-rgba.js +11 -13
  19. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-rgba.js.map +1 -1
  20. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs.js +28 -31
  21. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs.js.map +1 -1
  22. package/build/esm/packages/aurora/src/components/color_picker_new/components/pure-color-picker.js +4 -8
  23. package/build/esm/packages/aurora/src/components/color_picker_new/components/pure-color-picker.js.map +1 -1
  24. package/build/esm/packages/aurora/src/components/color_picker_new/constants.js +2 -4
  25. package/build/esm/packages/aurora/src/components/color_picker_new/constants.js.map +1 -1
  26. package/build/esm/packages/aurora/src/components/color_picker_new/context.js +2 -2
  27. package/build/esm/packages/aurora/src/components/color_picker_new/css_classes.js +2 -7
  28. package/build/esm/packages/aurora/src/components/color_picker_new/css_classes.js.map +1 -1
  29. package/build/esm/packages/aurora/src/components/color_picker_new/hooks/use_color_picker.d.ts +4 -5
  30. package/build/esm/packages/aurora/src/components/color_picker_new/hooks/use_color_picker.js +4 -8
  31. package/build/esm/packages/aurora/src/components/color_picker_new/hooks/use_color_picker.js.map +1 -1
  32. package/build/esm/packages/aurora/src/components/color_picker_new/index.js +6 -3
  33. package/build/esm/packages/aurora/src/components/color_picker_new/index.js.map +1 -1
  34. package/build/esm/packages/aurora/src/components/color_picker_new/types.d.ts +2 -2
  35. package/build/esm/packages/aurora/src/components/color_picker_new/utilities.js +1 -5
  36. package/build/esm/packages/aurora/src/components/color_picker_new/utilities.js.map +1 -1
  37. package/package.json +1 -1
  38. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-footer.js +0 -36
  39. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-footer.js.map +0 -1
  40. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-hex.js +0 -43
  41. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-hex.js.map +0 -1
  42. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-rgba.js +0 -24
  43. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-rgba.js.map +0 -1
  44. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs.js +0 -41
  45. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs.js.map +0 -1
@@ -4,14 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var input = require('../../controls/components/input.js');
7
- var context = require('../context.js');
8
7
  var constants = require('../constants.js');
8
+ var context = require('../context.js');
9
9
  var css_classes = require('../css_classes.js');
10
10
  var index$1 = require('../../../../../../external/react-best-gradient-color-picker/dist/esm/components/index.js');
11
11
  var main_module = require('../../../css/color_picker_new/main.module.less.js');
12
- var colorPickerFooter = require('./color-picker-footer.js');
13
12
  var colorPickerHeader = require('./color-picker-header.js');
14
- var colorPickerInputs = require('./color-picker-inputs/color-picker-inputs.js');
15
13
  var colorPickerSwatch = require('./color-picker-swatch.js');
16
14
  var colorPickerSwatches = require('./color-picker-swatches.js');
17
15
  var index = require('../../dropdown/index.js');
@@ -20,8 +18,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
20
18
 
21
19
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
22
20
 
23
- const ColorPickerNewPure = ({ id, name }) => {
24
- const { color, setColor, hex, handleCancel } = React.useContext(context.ColorPickerNewContext);
21
+ const ColorPickerNewPure = ({ color, setColor, id, name }) => {
22
+ const { hex, handleCancel } = React.useContext(context.ColorPickerNewContext);
25
23
  // const [color, setColor] = useState('rgba(255,255,255,1)');
26
24
  return (React__default['default'].createElement("div", { className: `${main_module['default'][css_classes.cssColorPicker]}` },
27
25
  React__default['default'].createElement(index['default'], null,
@@ -34,9 +32,7 @@ const ColorPickerNewPure = ({ id, name }) => {
34
32
  React__default['default'].createElement(colorPickerHeader.ColorPickerHeader, null),
35
33
  React__default['default'].createElement("div", { className: `${main_module['default'][css_classes.cssColorPickerContainer]}` },
36
34
  React__default['default'].createElement(index$1.ColorPicker, { value: color, onChange: setColor, width: constants.COLOR_PICKER_WIDTH, height: constants.COLOR_PICKER_HEIGHT, hideColorTypeBtns: true, hideColorGuide: true, hideAdvancedSliders: true, hideInputType: true, hideInputs: true, hidePresets: true, className: `${main_module['default'][css_classes.cssColorPickerRbgcp]}` }),
37
- React__default['default'].createElement(colorPickerInputs.ColorPickerInputs, null),
38
- React__default['default'].createElement(colorPickerSwatches.ColorPickerSwatches, null)),
39
- React__default['default'].createElement(colorPickerFooter.ColorPickerFooter, null)))));
35
+ React__default['default'].createElement(colorPickerSwatches.ColorPickerSwatches, null))))));
40
36
  };
41
37
 
42
38
  exports.default = ColorPickerNewPure;
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,0FAA8F;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,0FAA8F;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -4,13 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const COLOR_PICKER_INITIAL_STATE = '#000000';
6
6
  const COLOR_PICKER_WIDTH = 220;
7
- const COLOR_PICKER_HEIGHT = 200;
8
- const COLOR_PICKER_TYPE_HEX = 'hex';
9
- const COLOR_PICKER_TYPE_RGB = 'rgb';
7
+ const COLOR_PICKER_HEIGHT = 200;
10
8
 
11
9
  exports.COLOR_PICKER_HEIGHT = COLOR_PICKER_HEIGHT;
12
10
  exports.COLOR_PICKER_INITIAL_STATE = COLOR_PICKER_INITIAL_STATE;
13
- exports.COLOR_PICKER_TYPE_HEX = COLOR_PICKER_TYPE_HEX;
14
- exports.COLOR_PICKER_TYPE_RGB = COLOR_PICKER_TYPE_RGB;
15
11
  exports.COLOR_PICKER_WIDTH = COLOR_PICKER_WIDTH;
16
12
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var React = require('react');
6
6
 
7
7
  const ColorPickerNewContext = React.createContext({
8
- color: '',
9
- setColor: () => { },
8
+ // color: '',
9
+ // setColor: () => {},
10
10
  hex: '',
11
11
  hslArr: [],
12
12
  handleOnChangeAlpha: () => { },
@@ -15,24 +15,14 @@ const cssColorPickerSwatchSmall = 'color-picker__swatch_small';
15
15
  const cssColorPickerSwatchBig = 'color-picker__swatch_big';
16
16
  const cssColorPickerSwatchFill = 'color-picker__swatch-fill';
17
17
  const cssColorPickerInputColorSwatchContainer = 'color-picker__input-color-swatch-container';
18
- const cssColorPickerInputContainer = 'color-picker__input-container';
19
- const cssColorPickerInputs = 'color-picker__inputs';
20
- const cssColorPickerInputsType = 'color-picker__inputs-type';
21
- const cssColorPickerInputsValue = 'color-picker__inputs-value';
22
- const cssColorPickerInputsValueContainer = 'color-picker__inputs-value-container';
23
- const cssColorPickerFooter = 'color-picker__footer';
18
+ const cssColorPickerInputContainer = 'color-picker__input-container';
24
19
 
25
20
  exports.cssColorPicker = cssColorPicker;
26
21
  exports.cssColorPickerCloseIcon = cssColorPickerCloseIcon;
27
22
  exports.cssColorPickerContainer = cssColorPickerContainer;
28
- exports.cssColorPickerFooter = cssColorPickerFooter;
29
23
  exports.cssColorPickerHeader = cssColorPickerHeader;
30
24
  exports.cssColorPickerInputColorSwatchContainer = cssColorPickerInputColorSwatchContainer;
31
25
  exports.cssColorPickerInputContainer = cssColorPickerInputContainer;
32
- exports.cssColorPickerInputs = cssColorPickerInputs;
33
- exports.cssColorPickerInputsType = cssColorPickerInputsType;
34
- exports.cssColorPickerInputsValue = cssColorPickerInputsValue;
35
- exports.cssColorPickerInputsValueContainer = cssColorPickerInputsValueContainer;
36
26
  exports.cssColorPickerRbgcp = cssColorPickerRbgcp;
37
27
  exports.cssColorPickerSwatch = cssColorPickerSwatch;
38
28
  exports.cssColorPickerSwatchBig = cssColorPickerSwatchBig;
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -3,12 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var constants = require('../constants.js');
7
6
  var useColorPicker$1 = require('../../../../../../external/react-best-gradient-color-picker/dist/esm/hooks/useColorPicker.js');
8
7
  var utilities = require('../utilities.js');
9
8
 
10
- const useColorPicker = ({ initialColor, onChange, onCancel, onSave }) => {
11
- const [color, setColor] = React.useState(initialColor ? initialColor : constants.COLOR_PICKER_INITIAL_STATE);
9
+ const useColorPicker = ({ color, setColor, onChange, onCancel, onSave }) => {
12
10
  const [choosenColor, setChoosenColor] = React.useState(color);
13
11
  const { hslArr, rgbaArr, setR, setG, setB, setA } = useColorPicker$1.useColorPicker(color, setColor);
14
12
  const tinyColor = utilities.getTinyColorInstance(color);
@@ -27,9 +25,9 @@ const useColorPicker = ({ initialColor, onChange, onCancel, onSave }) => {
27
25
  React.useEffect(() => {
28
26
  setAlphaValue(`${Math.round(rgbaArr[3] * 100)}`);
29
27
  }, [rgbaArr[3]]);
30
- // useEffect(() => {
31
- // onChange?.(getAllColorTypes(color));
32
- // }, [color]);
28
+ React.useEffect(() => {
29
+ onChange === null || onChange === void 0 ? void 0 : onChange(utilities.getAllColorTypes(color));
30
+ }, [color]);
33
31
  const handleCancel = () => {
34
32
  setColor(choosenColor);
35
33
  onCancel === null || onCancel === void 0 ? void 0 : onCancel();
@@ -42,8 +40,6 @@ const useColorPicker = ({ initialColor, onChange, onCancel, onSave }) => {
42
40
  setColor(color);
43
41
  };
44
42
  return {
45
- color,
46
- setColor,
47
43
  hex,
48
44
  hslArr,
49
45
  handleOnChangeAlpha,
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,8FAAkG;AACjI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,+BAA+B,8FAAkG;AACjI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
+ var constants = require('./constants.js');
6
7
  var context = require('./context.js');
7
8
  var pureColorPicker = require('./components/pure-color-picker.js');
8
9
  var use_color_picker = require('./hooks/use_color_picker.js');
@@ -12,14 +13,16 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
12
13
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
14
 
14
15
  const ColorPickerNewWithContext = ({ id, name, initialColor, onChange, onCancel, onSave }) => {
16
+ const [color, setColor] = React.useState(initialColor ? initialColor : constants.COLOR_PICKER_INITIAL_STATE);
15
17
  const contextValue = use_color_picker['default']({
16
- initialColor,
18
+ color,
19
+ setColor,
17
20
  onChange,
18
21
  onCancel,
19
22
  onSave
20
23
  });
21
24
  return (React__default['default'].createElement(context.ColorPickerNewContext.Provider, { value: contextValue },
22
- React__default['default'].createElement(pureColorPicker['default'], { id: id, name: name })));
25
+ React__default['default'].createElement(pureColorPicker['default'], { color: color, setColor: setColor, id: id, name: name })));
23
26
  };
24
27
 
25
28
  exports.default = ColorPickerNewWithContext;
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -17,10 +17,6 @@ const getHexValue = (colorSet) => {
17
17
  const getHexValueString = (colorSet) => {
18
18
  return `#${getHexValue(colorSet)}`;
19
19
  };
20
- const isHexChar = (value) => {
21
- const hexRegEx = /^$|[0-9a-fA-F]+$/;
22
- return hexRegEx.test(value);
23
- };
24
20
  const getAllColorTypes = (color) => {
25
21
  const tinyColor = getTinyColorInstance(color);
26
22
  const rgba = getRgbaValue(tinyColor);
@@ -43,5 +39,4 @@ exports.getHexValue = getHexValue;
43
39
  exports.getHexValueString = getHexValueString;
44
40
  exports.getRgbaValue = getRgbaValue;
45
41
  exports.getTinyColorInstance = getTinyColorInstance;
46
- exports.isHexChar = isHexChar;
47
42
  //# sourceMappingURL=utilities.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,28 +1,27 @@
1
1
  import React, { useContext } from 'react';
2
- import { useTranslation } from '../../../../../../external/react-i18next/dist/es/useTranslation.js';
3
- import Button from '../../button/index.js';
4
- import { DropdownContext } from '../../dropdown/context/index.js';
5
- import { ColorPickerNewContext } from '../context.js';
6
- import { cssColorPickerFooter } from '../css_classes.js';
7
- import { getAllColorTypes } from '../utilities.js';
8
- import styles from '../../../css/color_picker_new/main.module.less.js';
9
-
10
- const ColorPickerFooter = () => {
11
- const { closeDropdown } = useContext(DropdownContext);
12
- const { color, handleCancel, handleSave } = useContext(ColorPickerNewContext);
13
- const [t] = useTranslation();
14
- const handleCancelButton = () => {
15
- closeDropdown === null || closeDropdown === void 0 ? void 0 : closeDropdown();
16
- handleCancel === null || handleCancel === void 0 ? void 0 : handleCancel();
17
- };
18
- const handleSaveButton = () => {
19
- closeDropdown === null || closeDropdown === void 0 ? void 0 : closeDropdown();
20
- handleSave(getAllColorTypes(color));
21
- };
22
- return (React.createElement("div", { className: `${styles[cssColorPickerFooter]}` },
23
- React.createElement(Button, { size: "small", variant: "outline", onClick: handleCancelButton }, t('cancel')),
24
- React.createElement(Button, { size: "small", onClick: handleSaveButton }, t('save'))));
2
+ import Button from '@auroraComponents/button';
3
+ import { ColorPickerNewContext } from '../context';
4
+ import { DropdownContext } from '@auroraComponents/dropdown/context';
5
+ import '../types';
6
+ import '@auroraComponents/dropdown/context/types';
7
+ import { cssColorPickerFooter } from '../css_classes';
8
+ import { getAllColorTypes } from '../utilities';
9
+ import styles from '@auroraCss/color_picker_new/main.module.less';
10
+ import { useTranslation } from 'react-i18next';
11
+ export const ColorPickerFooter = () => {
12
+ const { closeDropdown } = useContext(DropdownContext);
13
+ const { handleCancel, handleSave } = useContext(ColorPickerNewContext);
14
+ const [t] = useTranslation();
15
+ const handleCancelButton = () => {
16
+ closeDropdown === null || closeDropdown === void 0 ? void 0 : closeDropdown();
17
+ handleCancel === null || handleCancel === void 0 ? void 0 : handleCancel();
18
+ };
19
+ const handleSaveButton = () => {
20
+ closeDropdown === null || closeDropdown === void 0 ? void 0 : closeDropdown();
21
+ handleSave(getAllColorTypes("#fff"));
22
+ };
23
+ return (React.createElement("div", { className: `${styles[cssColorPickerFooter]}` },
24
+ React.createElement(Button, { size: "small", variant: "outline", onClick: handleCancelButton }, t('cancel')),
25
+ React.createElement(Button, { size: "small", onClick: handleSaveButton }, t('save'))));
25
26
  };
26
-
27
- export { ColorPickerFooter };
28
- //# sourceMappingURL=color-picker-footer.js.map
27
+ //# sourceMappingURL=color-picker-footer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA,+BAA+B,oEAAwE;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":"color-picker-footer.js","sourceRoot":"","sources":["../../../../../../../../src/components/color_picker_new/components/color-picker-footer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAA4C,UAAU,CAAC;AACvD,OAAiC,0CAA0C,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,MAAM,MAAM,8CAA8C,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAClC,MAAM,EAAE,aAAa,EAAE,GAAqB,UAAU,CAAC,eAAe,CAAC,CAAC;IACxE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,UAAU,CAA8B,qBAAqB,CAAC,CAAC;IACpG,MAAM,CAAC,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;IAE7B,MAAM,kBAAkB,GAAG,GAAG,EAAE;QAC5B,aAAa,aAAb,aAAa,uBAAb,aAAa,EAAI,CAAC;QAClB,YAAY,aAAZ,YAAY,uBAAZ,YAAY,EAAI,CAAC;IACrB,CAAC,CAAC;IAEF,MAAM,gBAAgB,GAAG,GAAG,EAAE;QAC1B,aAAa,aAAb,aAAa,uBAAb,aAAa,EAAI,CAAC;QAClB,UAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;IACzC,CAAC,CAAC;IAEF,OAAO,CACH,6BAAK,SAAS,EAAE,GAAG,MAAM,CAAC,oBAAoB,CAAC,EAAE;QAC7C,oBAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,kBAAkB,IAC7D,CAAC,CAAC,QAAQ,CAAC,CACP;QAET,oBAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,gBAAgB,IACzC,CAAC,CAAC,MAAM,CAAC,CACL,CACP,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -1,35 +1,33 @@
1
- import React, { useContext, useState, useEffect } from 'react';
1
+ import React, { useContext, useEffect, useState } from 'react';
2
+ import { ColorPickerNewContext } from '@auroraComponents/color_picker_new/context';
3
+ import '@auroraComponents/color_picker_new/types';
4
+ import Input from '@auroraComponents/controls/components/input';
2
5
  import { InputUtils } from '@dreamcommerce/utilities';
3
- import Input from '../../../controls/components/input.js';
4
- import { ColorPickerNewContext } from '../../context.js';
5
- import { isHexChar } from '../../utilities.js';
6
-
7
- const ColorPickerInputsHex = () => {
8
- const { setColor, hex, handleOnChangeAlpha, alphaValue } = useContext(ColorPickerNewContext);
9
- const [value, setValue] = useState(hex);
10
- const [disable, setDisable] = useState(false);
11
- const handleOnChange = (event) => {
12
- const inputValue = event.target.value.replace('%', '');
13
- if (isHexChar(inputValue)) {
14
- setValue(inputValue);
15
- setColor(inputValue);
16
- }
17
- };
18
- const hexFocus = () => {
19
- setDisable(true);
20
- };
21
- const hexBlur = () => {
22
- setDisable(false);
23
- };
24
- useEffect(() => {
25
- if (!disable) {
26
- setValue(hex);
27
- }
28
- }, [hex, disable]);
29
- return (React.createElement(React.Fragment, null,
30
- React.createElement(Input, { padding: "small", type: "text", maxLength: 8, value: value.toUpperCase(), onChange: handleOnChange, onBlur: hexBlur, onFocus: hexFocus }),
31
- React.createElement(Input, { padding: "small", type: "text", value: alphaValue, onChange: handleOnChangeAlpha, onKeyPress: InputUtils.preventTypingLetters })));
6
+ import { isHexChar } from '@auroraComponents/color_picker_new/utilities';
7
+ export const ColorPickerInputsHex = () => {
8
+ const { hex, handleOnChangeAlpha, alphaValue } = useContext(ColorPickerNewContext);
9
+ const [value, setValue] = useState(hex);
10
+ const [disable, setDisable] = useState(false);
11
+ const handleOnChange = (event) => {
12
+ const inputValue = event.target.value.replace('%', '');
13
+ if (isHexChar(inputValue)) {
14
+ setValue(inputValue);
15
+ // setColor(inputValue);
16
+ }
17
+ };
18
+ const hexFocus = () => {
19
+ setDisable(true);
20
+ };
21
+ const hexBlur = () => {
22
+ setDisable(false);
23
+ };
24
+ useEffect(() => {
25
+ if (!disable) {
26
+ setValue(hex);
27
+ }
28
+ }, [hex, disable]);
29
+ return (React.createElement(React.Fragment, null,
30
+ React.createElement(Input, { padding: "small", type: "text", maxLength: 8, value: value.toUpperCase(), onChange: handleOnChange, onBlur: hexBlur, onFocus: hexFocus }),
31
+ React.createElement(Input, { padding: "small", type: "text", value: alphaValue, onChange: handleOnChangeAlpha, onKeyPress: InputUtils.preventTypingLetters })));
32
32
  };
33
-
34
- export { ColorPickerInputsHex };
35
- //# sourceMappingURL=color-picker-inputs-hex.js.map
33
+ //# sourceMappingURL=color-picker-inputs-hex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":"color-picker-inputs-hex.js","sourceRoot":"","sources":["../../../../../../../../../src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-hex.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAA4C,0CAA0C,CAAC;AACvF,OAAO,KAAK,MAAM,6CAA6C,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAEzE,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACrC,MAAM,EAAE,GAAG,EAAE,mBAAmB,EAAE,UAAU,EAAE,GAAG,UAAU,CAA8B,qBAAqB,CAAC,CAAC;IAEhH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,MAAM,cAAc,GAAG,CAAC,KAA0C,EAAE,EAAE;QAClE,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAEvD,IAAI,SAAS,CAAC,UAAU,CAAC,EAAE;YACvB,QAAQ,CAAC,UAAU,CAAC,CAAC;YACrB,wBAAwB;SAC3B;IACL,CAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,GAAG,EAAE;QAClB,UAAU,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,GAAG,EAAE;QACjB,UAAU,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,OAAO,EAAE;YACV,QAAQ,CAAC,GAAG,CAAC,CAAC;SACjB;IACL,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;IAEnB,OAAO,CACH;QACI,oBAAC,KAAK,IACF,OAAO,EAAC,OAAO,EACf,IAAI,EAAC,MAAM,EACX,SAAS,EAAE,CAAC,EACZ,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,EAC1B,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,QAAQ,GACnB;QACF,oBAAC,KAAK,IAAC,OAAO,EAAC,OAAO,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,mBAAmB,EAAE,UAAU,EAAE,UAAU,CAAC,oBAAoB,GAAI,CACrI,CACN,CAAC;AACN,CAAC,CAAC"}
@@ -1,16 +1,14 @@
1
1
  import React, { useContext } from 'react';
2
+ import { ColorPickerNewContext } from '@auroraComponents/color_picker_new/context';
3
+ import '@auroraComponents/color_picker_new/types';
4
+ import Input from '@auroraComponents/controls/components/input';
2
5
  import { InputUtils } from '@dreamcommerce/utilities';
3
- import Input from '../../../controls/components/input.js';
4
- import { ColorPickerNewContext } from '../../context.js';
5
-
6
- const ColorPickerInputsRgba = () => {
7
- const { setR, setG, setB, handleOnChangeAlpha, alphaValue, rgbaArr } = useContext(ColorPickerNewContext);
8
- return (React.createElement(React.Fragment, null,
9
- React.createElement(Input, { padding: "small", type: "text", value: rgbaArr[0], onChange: (e) => setR(Number(e.target.value)), onKeyPress: InputUtils.preventTypingLetters }),
10
- React.createElement(Input, { padding: "small", type: "text", value: rgbaArr[1], onChange: (e) => setG(Number(e.target.value)), onKeyPress: InputUtils.preventTypingLetters }),
11
- React.createElement(Input, { padding: "small", type: "text", value: rgbaArr[2], onChange: (e) => setB(Number(e.target.value)), onKeyPress: InputUtils.preventTypingLetters }),
12
- React.createElement(Input, { padding: "small", type: "text", value: alphaValue, onChange: handleOnChangeAlpha, onKeyPress: InputUtils.preventTypingLetters })));
6
+ export const ColorPickerInputsRgba = () => {
7
+ const { setR, setG, setB, handleOnChangeAlpha, alphaValue, rgbaArr } = useContext(ColorPickerNewContext);
8
+ return (React.createElement(React.Fragment, null,
9
+ React.createElement(Input, { padding: "small", type: "text", value: rgbaArr[0], onChange: (e) => setR(Number(e.target.value)), onKeyPress: InputUtils.preventTypingLetters }),
10
+ React.createElement(Input, { padding: "small", type: "text", value: rgbaArr[1], onChange: (e) => setG(Number(e.target.value)), onKeyPress: InputUtils.preventTypingLetters }),
11
+ React.createElement(Input, { padding: "small", type: "text", value: rgbaArr[2], onChange: (e) => setB(Number(e.target.value)), onKeyPress: InputUtils.preventTypingLetters }),
12
+ React.createElement(Input, { padding: "small", type: "text", value: alphaValue, onChange: handleOnChangeAlpha, onKeyPress: InputUtils.preventTypingLetters })));
13
13
  };
14
-
15
- export { ColorPickerInputsRgba };
16
- //# sourceMappingURL=color-picker-inputs-rgba.js.map
14
+ //# sourceMappingURL=color-picker-inputs-rgba.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":"color-picker-inputs-rgba.js","sourceRoot":"","sources":["../../../../../../../../../src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-rgba.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAA4C,0CAA0C,CAAC;AACvF,OAAO,KAAK,MAAM,6CAA6C,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACtC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,mBAAmB,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,UAAU,CAA8B,qBAAqB,CAAC,CAAC;IAEtI,OAAO,CACH;QACI,oBAAC,KAAK,IACF,OAAO,EAAC,OAAO,EACf,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,EACjB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAC7C,UAAU,EAAE,UAAU,CAAC,oBAAoB,GAC7C;QACF,oBAAC,KAAK,IACF,OAAO,EAAC,OAAO,EACf,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,EACjB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAC7C,UAAU,EAAE,UAAU,CAAC,oBAAoB,GAC7C;QACF,oBAAC,KAAK,IACF,OAAO,EAAC,OAAO,EACf,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,EACjB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAC7C,UAAU,EAAE,UAAU,CAAC,oBAAoB,GAC7C;QACF,oBAAC,KAAK,IAAC,OAAO,EAAC,OAAO,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,mBAAmB,EAAE,UAAU,EAAE,UAAU,CAAC,oBAAoB,GAAI,CACrI,CACN,CAAC;AACN,CAAC,CAAC"}
@@ -1,33 +1,30 @@
1
+ import { COLOR_PICKER_TYPE_HEX, COLOR_PICKER_TYPE_RGB } from '../../constants';
1
2
  import React, { useState } from 'react';
2
- import { COLOR_PICKER_TYPE_HEX, COLOR_PICKER_TYPE_RGB } from '../../constants.js';
3
- import { cssColorPickerInputs, cssColorPickerInputsType, cssColorPickerInputsValue, cssColorPickerInputsValueContainer } from '../../css_classes.js';
4
- import styles from '../../../../css/color_picker_new/main.module.less.js';
5
- import { ColorPickerInputsHex } from './color-picker-inputs-hex.js';
6
- import { ColorPickerInputsRgba } from './color-picker-inputs-rgba.js';
7
-
8
- const ColorPickerInputs = () => {
9
- const [type, setType] = useState(COLOR_PICKER_TYPE_HEX);
10
- const handleSelectType = (e) => {
11
- setType(e.target.value);
12
- };
13
- const inputs = () => {
14
- switch (type) {
15
- case COLOR_PICKER_TYPE_HEX:
16
- return React.createElement(ColorPickerInputsHex, null);
17
- case COLOR_PICKER_TYPE_RGB:
18
- return React.createElement(ColorPickerInputsRgba, null);
19
- default:
20
- return false;
21
- }
22
- };
23
- return (React.createElement("div", { className: `${styles[cssColorPickerInputs]}` },
24
- React.createElement("div", { className: `${styles[cssColorPickerInputsType]}` },
25
- React.createElement("select", { value: type, onChange: handleSelectType },
26
- React.createElement("option", { value: COLOR_PICKER_TYPE_HEX }, COLOR_PICKER_TYPE_HEX),
27
- React.createElement("option", { value: COLOR_PICKER_TYPE_RGB }, COLOR_PICKER_TYPE_RGB))),
28
- React.createElement("div", { className: `${styles[cssColorPickerInputsValue]}` },
29
- React.createElement("div", { className: `${styles[cssColorPickerInputsValueContainer]}` }, inputs()))));
3
+ import { cssColorPickerInputs, cssColorPickerInputsType, cssColorPickerInputsValue, cssColorPickerInputsValueContainer } from '../../css_classes';
4
+ import { ColorPickerInputsHex } from './color-picker-inputs-hex';
5
+ import { ColorPickerInputsRgba } from './color-picker-inputs-rgba';
6
+ import styles from '@auroraCss/color_picker_new/main.module.less';
7
+ export const ColorPickerInputs = () => {
8
+ const [type, setType] = useState(COLOR_PICKER_TYPE_HEX);
9
+ const handleSelectType = (e) => {
10
+ setType(e.target.value);
11
+ };
12
+ const inputs = () => {
13
+ switch (type) {
14
+ case COLOR_PICKER_TYPE_HEX:
15
+ return React.createElement(ColorPickerInputsHex, null);
16
+ case COLOR_PICKER_TYPE_RGB:
17
+ return React.createElement(ColorPickerInputsRgba, null);
18
+ default:
19
+ return false;
20
+ }
21
+ };
22
+ return (React.createElement("div", { className: `${styles[cssColorPickerInputs]}` },
23
+ React.createElement("div", { className: `${styles[cssColorPickerInputsType]}` },
24
+ React.createElement("select", { value: type, onChange: handleSelectType },
25
+ React.createElement("option", { value: COLOR_PICKER_TYPE_HEX }, COLOR_PICKER_TYPE_HEX),
26
+ React.createElement("option", { value: COLOR_PICKER_TYPE_RGB }, COLOR_PICKER_TYPE_RGB))),
27
+ React.createElement("div", { className: `${styles[cssColorPickerInputsValue]}` },
28
+ React.createElement("div", { className: `${styles[cssColorPickerInputsValueContainer]}` }, inputs()))));
30
29
  };
31
-
32
- export { ColorPickerInputs };
33
- //# sourceMappingURL=color-picker-inputs.js.map
30
+ //# sourceMappingURL=color-picker-inputs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":"color-picker-inputs.js","sourceRoot":"","sources":["../../../../../../../../../src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EACH,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,EACzB,kCAAkC,EACrC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,MAAM,MAAM,8CAA8C,CAAC;AAElE,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAClC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IAExD,MAAM,gBAAgB,GAAG,CAAC,CAAuC,EAAE,EAAE;QACjE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,CAAC;IAEF,MAAM,MAAM,GAAG,GAAG,EAAE;QAChB,QAAQ,IAAI,EAAE;YACV,KAAK,qBAAqB;gBACtB,OAAO,oBAAC,oBAAoB,OAAG,CAAC;YACpC,KAAK,qBAAqB;gBACtB,OAAO,oBAAC,qBAAqB,OAAG,CAAC;YACrC;gBACI,OAAO,KAAK,CAAC;SACpB;IACL,CAAC,CAAC;IAEF,OAAO,CACH,6BAAK,SAAS,EAAE,GAAG,MAAM,CAAC,oBAAoB,CAAC,EAAE;QAC7C,6BAAK,SAAS,EAAE,GAAG,MAAM,CAAC,wBAAwB,CAAC,EAAE;YACjD,gCAAQ,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,gBAAgB;gBAC3C,gCAAQ,KAAK,EAAE,qBAAqB,IAAG,qBAAqB,CAAU;gBACtE,gCAAQ,KAAK,EAAE,qBAAqB,IAAG,qBAAqB,CAAU,CACjE,CACP;QAEN,6BAAK,SAAS,EAAE,GAAG,MAAM,CAAC,yBAAyB,CAAC,EAAE;YAClD,6BAAK,SAAS,EAAE,GAAG,MAAM,CAAC,kCAAkC,CAAC,EAAE,IAAG,MAAM,EAAE,CAAO,CAC/E,CACJ,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -1,19 +1,17 @@
1
1
  import React, { useContext } from 'react';
2
2
  import Input from '../../controls/components/input.js';
3
- import { ColorPickerNewContext } from '../context.js';
4
3
  import { COLOR_PICKER_WIDTH, COLOR_PICKER_HEIGHT } from '../constants.js';
4
+ import { ColorPickerNewContext } from '../context.js';
5
5
  import { cssColorPicker, cssColorPickerInputContainer, cssColorPickerInputColorSwatchContainer, cssColorPickerContainer, cssColorPickerRbgcp } from '../css_classes.js';
6
6
  import { ColorPicker } from '../../../../../../external/react-best-gradient-color-picker/dist/esm/components/index.js';
7
7
  import styles from '../../../css/color_picker_new/main.module.less.js';
8
- import { ColorPickerFooter } from './color-picker-footer.js';
9
8
  import { ColorPickerHeader } from './color-picker-header.js';
10
- import { ColorPickerInputs } from './color-picker-inputs/color-picker-inputs.js';
11
9
  import { ColorPickerSwatch } from './color-picker-swatch.js';
12
10
  import { ColorPickerSwatches } from './color-picker-swatches.js';
13
11
  import Dropdown from '../../dropdown/index.js';
14
12
 
15
- const ColorPickerNewPure = ({ id, name }) => {
16
- const { color, setColor, hex, handleCancel } = useContext(ColorPickerNewContext);
13
+ const ColorPickerNewPure = ({ color, setColor, id, name }) => {
14
+ const { hex, handleCancel } = useContext(ColorPickerNewContext);
17
15
  // const [color, setColor] = useState('rgba(255,255,255,1)');
18
16
  return (React.createElement("div", { className: `${styles[cssColorPicker]}` },
19
17
  React.createElement(Dropdown, null,
@@ -26,9 +24,7 @@ const ColorPickerNewPure = ({ id, name }) => {
26
24
  React.createElement(ColorPickerHeader, null),
27
25
  React.createElement("div", { className: `${styles[cssColorPickerContainer]}` },
28
26
  React.createElement(ColorPicker, { value: color, onChange: setColor, width: COLOR_PICKER_WIDTH, height: COLOR_PICKER_HEIGHT, hideColorTypeBtns: true, hideColorGuide: true, hideAdvancedSliders: true, hideInputType: true, hideInputs: true, hidePresets: true, className: `${styles[cssColorPickerRbgcp]}` }),
29
- React.createElement(ColorPickerInputs, null),
30
- React.createElement(ColorPickerSwatches, null)),
31
- React.createElement(ColorPickerFooter, null)))));
27
+ React.createElement(ColorPickerSwatches, null))))));
32
28
  };
33
29
 
34
30
  export default ColorPickerNewPure;
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,4BAA4B,0FAA8F;AAC1H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,4BAA4B,0FAA8F;AAC1H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,8 +1,6 @@
1
1
  const COLOR_PICKER_INITIAL_STATE = '#000000';
2
2
  const COLOR_PICKER_WIDTH = 220;
3
- const COLOR_PICKER_HEIGHT = 200;
4
- const COLOR_PICKER_TYPE_HEX = 'hex';
5
- const COLOR_PICKER_TYPE_RGB = 'rgb';
3
+ const COLOR_PICKER_HEIGHT = 200;
6
4
 
7
- export { COLOR_PICKER_HEIGHT, COLOR_PICKER_INITIAL_STATE, COLOR_PICKER_TYPE_HEX, COLOR_PICKER_TYPE_RGB, COLOR_PICKER_WIDTH };
5
+ export { COLOR_PICKER_HEIGHT, COLOR_PICKER_INITIAL_STATE, COLOR_PICKER_WIDTH };
8
6
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;"}
@@ -1,8 +1,8 @@
1
1
  import { createContext } from 'react';
2
2
 
3
3
  const ColorPickerNewContext = createContext({
4
- color: '',
5
- setColor: () => { },
4
+ // color: '',
5
+ // setColor: () => {},
6
6
  hex: '',
7
7
  hslArr: [],
8
8
  handleOnChangeAlpha: () => { },
@@ -11,12 +11,7 @@ const cssColorPickerSwatchSmall = 'color-picker__swatch_small';
11
11
  const cssColorPickerSwatchBig = 'color-picker__swatch_big';
12
12
  const cssColorPickerSwatchFill = 'color-picker__swatch-fill';
13
13
  const cssColorPickerInputColorSwatchContainer = 'color-picker__input-color-swatch-container';
14
- const cssColorPickerInputContainer = 'color-picker__input-container';
15
- const cssColorPickerInputs = 'color-picker__inputs';
16
- const cssColorPickerInputsType = 'color-picker__inputs-type';
17
- const cssColorPickerInputsValue = 'color-picker__inputs-value';
18
- const cssColorPickerInputsValueContainer = 'color-picker__inputs-value-container';
19
- const cssColorPickerFooter = 'color-picker__footer';
14
+ const cssColorPickerInputContainer = 'color-picker__input-container';
20
15
 
21
- export { cssColorPicker, cssColorPickerCloseIcon, cssColorPickerContainer, cssColorPickerFooter, cssColorPickerHeader, cssColorPickerInputColorSwatchContainer, cssColorPickerInputContainer, cssColorPickerInputs, cssColorPickerInputsType, cssColorPickerInputsValue, cssColorPickerInputsValueContainer, cssColorPickerRbgcp, cssColorPickerSwatch, cssColorPickerSwatchBig, cssColorPickerSwatchFill, cssColorPickerSwatchSmall, cssColorPickerSwatches, cssColorPickerSwatchesContent, cssColorPickerSwatchesHeader };
16
+ export { cssColorPicker, cssColorPickerCloseIcon, cssColorPickerContainer, cssColorPickerHeader, cssColorPickerInputColorSwatchContainer, cssColorPickerInputContainer, cssColorPickerRbgcp, cssColorPickerSwatch, cssColorPickerSwatchBig, cssColorPickerSwatchFill, cssColorPickerSwatchSmall, cssColorPickerSwatches, cssColorPickerSwatchesContent, cssColorPickerSwatchesHeader };
22
17
  //# sourceMappingURL=css_classes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,14 +1,13 @@
1
- /// <reference types="react" />
2
1
  import { ColorPickerColorTypes, IColorPickerColor } from '../types';
2
+ import { Dispatch, SetStateAction } from 'react';
3
3
  export declare type ColorPickerHookProps = {
4
- initialColor?: ColorPickerColorTypes['hex'];
4
+ color: string;
5
+ setColor: Dispatch<SetStateAction<string>>;
5
6
  onChange?: (color: IColorPickerColor) => void;
6
7
  onCancel?: () => void;
7
8
  onSave?: (color: IColorPickerColor) => void;
8
9
  };
9
- declare const useColorPicker: ({ initialColor, onChange, onCancel, onSave }: ColorPickerHookProps) => {
10
- color: string;
11
- setColor: import("react").Dispatch<import("react").SetStateAction<string>>;
10
+ declare const useColorPicker: ({ color, setColor, onChange, onCancel, onSave }: ColorPickerHookProps) => {
12
11
  hex: string;
13
12
  hslArr: number[];
14
13
  handleOnChangeAlpha: (event: React.ChangeEvent<HTMLInputElement>) => void;
@@ -1,10 +1,8 @@
1
1
  import { useState, useEffect } from 'react';
2
- import { COLOR_PICKER_INITIAL_STATE } from '../constants.js';
3
2
  import { useColorPicker as useColorPicker$1 } from '../../../../../../external/react-best-gradient-color-picker/dist/esm/hooks/useColorPicker.js';
4
3
  import { getTinyColorInstance, getHexValue, getAllColorTypes } from '../utilities.js';
5
4
 
6
- const useColorPicker = ({ initialColor, onChange, onCancel, onSave }) => {
7
- const [color, setColor] = useState(initialColor ? initialColor : COLOR_PICKER_INITIAL_STATE);
5
+ const useColorPicker = ({ color, setColor, onChange, onCancel, onSave }) => {
8
6
  const [choosenColor, setChoosenColor] = useState(color);
9
7
  const { hslArr, rgbaArr, setR, setG, setB, setA } = useColorPicker$1(color, setColor);
10
8
  const tinyColor = getTinyColorInstance(color);
@@ -23,9 +21,9 @@ const useColorPicker = ({ initialColor, onChange, onCancel, onSave }) => {
23
21
  useEffect(() => {
24
22
  setAlphaValue(`${Math.round(rgbaArr[3] * 100)}`);
25
23
  }, [rgbaArr[3]]);
26
- // useEffect(() => {
27
- // onChange?.(getAllColorTypes(color));
28
- // }, [color]);
24
+ useEffect(() => {
25
+ onChange === null || onChange === void 0 ? void 0 : onChange(getAllColorTypes(color));
26
+ }, [color]);
29
27
  const handleCancel = () => {
30
28
  setColor(choosenColor);
31
29
  onCancel === null || onCancel === void 0 ? void 0 : onCancel();
@@ -38,8 +36,6 @@ const useColorPicker = ({ initialColor, onChange, onCancel, onSave }) => {
38
36
  setColor(color);
39
37
  };
40
38
  return {
41
- color,
42
- setColor,
43
39
  hex,
44
40
  hslArr,
45
41
  handleOnChangeAlpha,
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA,mDAAmD,8FAAkG;AACrJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA,mDAAmD,8FAAkG;AACrJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,17 +1,20 @@
1
- import React from 'react';
1
+ import React, { useState } from 'react';
2
+ import { COLOR_PICKER_INITIAL_STATE } from './constants.js';
2
3
  import { ColorPickerNewContext } from './context.js';
3
4
  import ColorPickerNewPure from './components/pure-color-picker.js';
4
5
  import useColorPicker from './hooks/use_color_picker.js';
5
6
 
6
7
  const ColorPickerNewWithContext = ({ id, name, initialColor, onChange, onCancel, onSave }) => {
8
+ const [color, setColor] = useState(initialColor ? initialColor : COLOR_PICKER_INITIAL_STATE);
7
9
  const contextValue = useColorPicker({
8
- initialColor,
10
+ color,
11
+ setColor,
9
12
  onChange,
10
13
  onCancel,
11
14
  onSave
12
15
  });
13
16
  return (React.createElement(ColorPickerNewContext.Provider, { value: contextValue },
14
- React.createElement(ColorPickerNewPure, { id: id, name: name })));
17
+ React.createElement(ColorPickerNewPure, { color: color, setColor: setColor, id: id, name: name })));
15
18
  };
16
19
 
17
20
  export default ColorPickerNewWithContext;
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,5 +1,7 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
2
  export interface IColorPickerNewPureProps {
3
+ color: string;
4
+ setColor: Dispatch<SetStateAction<string>>;
3
5
  id: string;
4
6
  name?: string;
5
7
  }
@@ -12,8 +14,6 @@ export interface IColorPickerNewProps {
12
14
  onSave?: (color: IColorPickerColor) => void;
13
15
  }
14
16
  export interface IColorPickerNewContextProps {
15
- color: string;
16
- setColor: Dispatch<SetStateAction<string>>;
17
17
  hex: string;
18
18
  hslArr: number[];
19
19
  handleOnChangeAlpha: (event: React.ChangeEvent<HTMLInputElement>) => void;
@@ -13,10 +13,6 @@ const getHexValue = (colorSet) => {
13
13
  const getHexValueString = (colorSet) => {
14
14
  return `#${getHexValue(colorSet)}`;
15
15
  };
16
- const isHexChar = (value) => {
17
- const hexRegEx = /^$|[0-9a-fA-F]+$/;
18
- return hexRegEx.test(value);
19
- };
20
16
  const getAllColorTypes = (color) => {
21
17
  const tinyColor = getTinyColorInstance(color);
22
18
  const rgba = getRgbaValue(tinyColor);
@@ -34,5 +30,5 @@ const getAllColorTypes = (color) => {
34
30
  };
35
31
  };
36
32
 
37
- export { getAllColorTypes, getHexValue, getHexValueString, getRgbaValue, getTinyColorInstance, isHexChar };
33
+ export { getAllColorTypes, getHexValue, getHexValueString, getRgbaValue, getTinyColorInstance };
38
34
  //# sourceMappingURL=utilities.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,sBAAsB,qDAAyD;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,sBAAsB,qDAAyD;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@dreamcommerce/aurora",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "2.12.1-45",
5
+ "version": "2.12.1-46",
6
6
  "description": "aurora",
7
7
  "author": "k0ssak",
8
8
  "license": "MIT",
@@ -1,36 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
- var useTranslation = require('../../../../../../external/react-i18next/dist/es/useTranslation.js');
7
- var index$1 = require('../../button/index.js');
8
- var index = require('../../dropdown/context/index.js');
9
- var context = require('../context.js');
10
- var css_classes = require('../css_classes.js');
11
- var utilities = require('../utilities.js');
12
- var main_module = require('../../../css/color_picker_new/main.module.less.js');
13
-
14
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
-
16
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
17
-
18
- const ColorPickerFooter = () => {
19
- const { closeDropdown } = React.useContext(index.DropdownContext);
20
- const { color, handleCancel, handleSave } = React.useContext(context.ColorPickerNewContext);
21
- const [t] = useTranslation.useTranslation();
22
- const handleCancelButton = () => {
23
- closeDropdown === null || closeDropdown === void 0 ? void 0 : closeDropdown();
24
- handleCancel === null || handleCancel === void 0 ? void 0 : handleCancel();
25
- };
26
- const handleSaveButton = () => {
27
- closeDropdown === null || closeDropdown === void 0 ? void 0 : closeDropdown();
28
- handleSave(utilities.getAllColorTypes(color));
29
- };
30
- return (React__default['default'].createElement("div", { className: `${main_module['default'][css_classes.cssColorPickerFooter]}` },
31
- React__default['default'].createElement(index$1['default'], { size: "small", variant: "outline", onClick: handleCancelButton }, t('cancel')),
32
- React__default['default'].createElement(index$1['default'], { size: "small", onClick: handleSaveButton }, t('save'))));
33
- };
34
-
35
- exports.ColorPickerFooter = ColorPickerFooter;
36
- //# sourceMappingURL=color-picker-footer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,6BAA6B,oEAAwE;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,43 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
- var utilities = require('@dreamcommerce/utilities');
7
- var input = require('../../../controls/components/input.js');
8
- var context = require('../../context.js');
9
- var utilities$1 = require('../../utilities.js');
10
-
11
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
-
13
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
-
15
- const ColorPickerInputsHex = () => {
16
- const { setColor, hex, handleOnChangeAlpha, alphaValue } = React.useContext(context.ColorPickerNewContext);
17
- const [value, setValue] = React.useState(hex);
18
- const [disable, setDisable] = React.useState(false);
19
- const handleOnChange = (event) => {
20
- const inputValue = event.target.value.replace('%', '');
21
- if (utilities$1.isHexChar(inputValue)) {
22
- setValue(inputValue);
23
- setColor(inputValue);
24
- }
25
- };
26
- const hexFocus = () => {
27
- setDisable(true);
28
- };
29
- const hexBlur = () => {
30
- setDisable(false);
31
- };
32
- React.useEffect(() => {
33
- if (!disable) {
34
- setValue(hex);
35
- }
36
- }, [hex, disable]);
37
- return (React__default['default'].createElement(React__default['default'].Fragment, null,
38
- React__default['default'].createElement(input['default'], { padding: "small", type: "text", maxLength: 8, value: value.toUpperCase(), onChange: handleOnChange, onBlur: hexBlur, onFocus: hexFocus }),
39
- React__default['default'].createElement(input['default'], { padding: "small", type: "text", value: alphaValue, onChange: handleOnChangeAlpha, onKeyPress: utilities.InputUtils.preventTypingLetters })));
40
- };
41
-
42
- exports.ColorPickerInputsHex = ColorPickerInputsHex;
43
- //# sourceMappingURL=color-picker-inputs-hex.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
- var utilities = require('@dreamcommerce/utilities');
7
- var input = require('../../../controls/components/input.js');
8
- var context = require('../../context.js');
9
-
10
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
-
12
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
-
14
- const ColorPickerInputsRgba = () => {
15
- const { setR, setG, setB, handleOnChangeAlpha, alphaValue, rgbaArr } = React.useContext(context.ColorPickerNewContext);
16
- return (React__default['default'].createElement(React__default['default'].Fragment, null,
17
- React__default['default'].createElement(input['default'], { padding: "small", type: "text", value: rgbaArr[0], onChange: (e) => setR(Number(e.target.value)), onKeyPress: utilities.InputUtils.preventTypingLetters }),
18
- React__default['default'].createElement(input['default'], { padding: "small", type: "text", value: rgbaArr[1], onChange: (e) => setG(Number(e.target.value)), onKeyPress: utilities.InputUtils.preventTypingLetters }),
19
- React__default['default'].createElement(input['default'], { padding: "small", type: "text", value: rgbaArr[2], onChange: (e) => setB(Number(e.target.value)), onKeyPress: utilities.InputUtils.preventTypingLetters }),
20
- React__default['default'].createElement(input['default'], { padding: "small", type: "text", value: alphaValue, onChange: handleOnChangeAlpha, onKeyPress: utilities.InputUtils.preventTypingLetters })));
21
- };
22
-
23
- exports.ColorPickerInputsRgba = ColorPickerInputsRgba;
24
- //# sourceMappingURL=color-picker-inputs-rgba.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,41 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
- var constants = require('../../constants.js');
7
- var css_classes = require('../../css_classes.js');
8
- var main_module = require('../../../../css/color_picker_new/main.module.less.js');
9
- var colorPickerInputsHex = require('./color-picker-inputs-hex.js');
10
- var colorPickerInputsRgba = require('./color-picker-inputs-rgba.js');
11
-
12
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
-
14
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
15
-
16
- const ColorPickerInputs = () => {
17
- const [type, setType] = React.useState(constants.COLOR_PICKER_TYPE_HEX);
18
- const handleSelectType = (e) => {
19
- setType(e.target.value);
20
- };
21
- const inputs = () => {
22
- switch (type) {
23
- case constants.COLOR_PICKER_TYPE_HEX:
24
- return React__default['default'].createElement(colorPickerInputsHex.ColorPickerInputsHex, null);
25
- case constants.COLOR_PICKER_TYPE_RGB:
26
- return React__default['default'].createElement(colorPickerInputsRgba.ColorPickerInputsRgba, null);
27
- default:
28
- return false;
29
- }
30
- };
31
- return (React__default['default'].createElement("div", { className: `${main_module['default'][css_classes.cssColorPickerInputs]}` },
32
- React__default['default'].createElement("div", { className: `${main_module['default'][css_classes.cssColorPickerInputsType]}` },
33
- React__default['default'].createElement("select", { value: type, onChange: handleSelectType },
34
- React__default['default'].createElement("option", { value: constants.COLOR_PICKER_TYPE_HEX }, constants.COLOR_PICKER_TYPE_HEX),
35
- React__default['default'].createElement("option", { value: constants.COLOR_PICKER_TYPE_RGB }, constants.COLOR_PICKER_TYPE_RGB))),
36
- React__default['default'].createElement("div", { className: `${main_module['default'][css_classes.cssColorPickerInputsValue]}` },
37
- React__default['default'].createElement("div", { className: `${main_module['default'][css_classes.cssColorPickerInputsValueContainer]}` }, inputs()))));
38
- };
39
-
40
- exports.ColorPickerInputs = ColorPickerInputs;
41
- //# sourceMappingURL=color-picker-inputs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}