@dreamcommerce/aurora 2.12.1-33 → 2.12.1-35

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 (41) hide show
  1. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-footer.js +36 -0
  2. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-footer.js.map +1 -0
  3. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-header.js +41 -0
  4. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-header.js.map +1 -0
  5. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-hex.js +43 -0
  6. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-hex.js.map +1 -0
  7. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-rgba.js +24 -0
  8. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-rgba.js.map +1 -0
  9. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs.js +41 -0
  10. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs.js.map +1 -0
  11. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-swatches.js +48 -0
  12. package/build/cjs/packages/aurora/src/components/color_picker_new/components/color-picker-swatches.js.map +1 -0
  13. package/build/cjs/packages/aurora/src/components/color_picker_new/constants.js +5 -1
  14. package/build/cjs/packages/aurora/src/components/color_picker_new/constants.js.map +1 -1
  15. package/build/cjs/packages/aurora/src/components/color_picker_new/css_classes.js +21 -1
  16. package/build/cjs/packages/aurora/src/components/color_picker_new/css_classes.js.map +1 -1
  17. package/build/cjs/packages/aurora/src/components/color_picker_new/index.js +9 -1
  18. package/build/cjs/packages/aurora/src/components/color_picker_new/index.js.map +1 -1
  19. package/build/cjs/packages/aurora/src/components/color_picker_new/utilities.js +5 -0
  20. package/build/cjs/packages/aurora/src/components/color_picker_new/utilities.js.map +1 -1
  21. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-footer.js +26 -25
  22. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-footer.js.map +1 -1
  23. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-header.js +31 -30
  24. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-header.js.map +1 -1
  25. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-hex.js +33 -31
  26. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-hex.js.map +1 -1
  27. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-rgba.js +13 -11
  28. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs-rgba.js.map +1 -1
  29. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs.js +31 -28
  30. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-inputs/color-picker-inputs.js.map +1 -1
  31. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-swatches.js +38 -36
  32. package/build/esm/packages/aurora/src/components/color_picker_new/components/color-picker-swatches.js.map +1 -1
  33. package/build/esm/packages/aurora/src/components/color_picker_new/constants.js +4 -2
  34. package/build/esm/packages/aurora/src/components/color_picker_new/constants.js.map +1 -1
  35. package/build/esm/packages/aurora/src/components/color_picker_new/css_classes.js +12 -2
  36. package/build/esm/packages/aurora/src/components/color_picker_new/css_classes.js.map +1 -1
  37. package/build/esm/packages/aurora/src/components/color_picker_new/index.js +9 -1
  38. package/build/esm/packages/aurora/src/components/color_picker_new/index.js.map +1 -1
  39. package/build/esm/packages/aurora/src/components/color_picker_new/utilities.js +5 -1
  40. package/build/esm/packages/aurora/src/components/color_picker_new/utilities.js.map +1 -1
  41. package/package.json +1 -1
@@ -0,0 +1,36 @@
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 css_classes = require('../css_classes.js');
10
+ var context = require('../context.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
@@ -0,0 +1 @@
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;"}
@@ -0,0 +1,41 @@
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 = require('../../dropdown/context/index.js');
8
+ var css_classes = require('../css_classes.js');
9
+ var context = require('../context.js');
10
+ var main_module = require('../../../css/color_picker_new/main.module.less.js');
11
+ var icon_close = require('../../../assets/icon_close.js');
12
+
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
+
15
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
+
17
+ const ColorPickerHeader = () => {
18
+ const { handleCancel } = React.useContext(context.ColorPickerNewContext);
19
+ const [t] = useTranslation.useTranslation();
20
+ const { closeDropdown, isOpen } = React.useContext(index.DropdownContext);
21
+ const handleCancelButton = () => {
22
+ closePicker();
23
+ };
24
+ const closePicker = () => {
25
+ closeDropdown === null || closeDropdown === void 0 ? void 0 : closeDropdown();
26
+ handleCancel === null || handleCancel === void 0 ? void 0 : handleCancel();
27
+ };
28
+ React.useEffect(() => {
29
+ if (!isOpen)
30
+ return;
31
+ document.addEventListener('visibilitychange', closePicker);
32
+ return () => document.removeEventListener('visibilitychange', closePicker);
33
+ }, [isOpen]);
34
+ return (React__default['default'].createElement("div", { className: `${main_module['default'][css_classes.cssColorPickerHeader]}` },
35
+ t('Select color'),
36
+ React__default['default'].createElement("button", { onClick: handleCancelButton, className: `${main_module['default'][css_classes.cssColorPickerCloseIcon]}` },
37
+ React__default['default'].createElement(icon_close['default'], { size: "m" }))));
38
+ };
39
+
40
+ exports.ColorPickerHeader = ColorPickerHeader;
41
+ //# sourceMappingURL=color-picker-header.js.map
@@ -0,0 +1 @@
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;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,43 @@
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
@@ -0,0 +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;"}
@@ -0,0 +1,24 @@
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
@@ -0,0 +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;"}
@@ -0,0 +1,41 @@
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
@@ -0,0 +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;"}
@@ -0,0 +1,48 @@
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 css_classes = require('../css_classes.js');
8
+ var context = require('../context.js');
9
+ var utilities = require('../utilities.js');
10
+ var main_module = require('../../../css/color_picker_new/main.module.less.js');
11
+ var colorPickerSwatch = require('./color-picker-swatch.js');
12
+
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
+
15
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
+
17
+ const ColorPickerSwatches = () => {
18
+ const { hslArr, handlePickSwatch } = React.useContext(context.ColorPickerNewContext);
19
+ const [t] = useTranslation.useTranslation();
20
+ const [h, s] = hslArr;
21
+ const shades = [
22
+ { h, s, l: 95 },
23
+ { h, s, l: 90 },
24
+ { h, s, l: 80 },
25
+ { h, s, l: 70 },
26
+ { h, s, l: 60 },
27
+ { h, s, l: 50 },
28
+ { h, s, l: 40 },
29
+ { h, s, l: 30 },
30
+ { h, s, l: 20 },
31
+ { h, s, l: 10 },
32
+ { h, s, l: 5 }
33
+ ];
34
+ return (React__default['default'].createElement("div", { className: main_module['default'][css_classes.cssColorPickerSwatches] },
35
+ React__default['default'].createElement("div", { className: main_module['default'][css_classes.cssColorPickerSwatchesHeader] },
36
+ React__default['default'].createElement("p", null, t('Shades of color'))),
37
+ React__default['default'].createElement("div", { className: main_module['default'][css_classes.cssColorPickerSwatchesContent] }, shades.map((shade, index) => {
38
+ const colorTiny = utilities.getTinyColorInstance(shade);
39
+ const colorHex = utilities.getHexValue(colorTiny);
40
+ const handleOnClick = () => {
41
+ handlePickSwatch === null || handlePickSwatch === void 0 ? void 0 : handlePickSwatch(colorHex);
42
+ };
43
+ return React__default['default'].createElement(colorPickerSwatch.ColorPickerSwatch, { size: "small", onClick: handleOnClick, key: `${shade}-${index}`, color: colorHex });
44
+ }))));
45
+ };
46
+
47
+ exports.ColorPickerSwatches = ColorPickerSwatches;
48
+ //# sourceMappingURL=color-picker-swatches.js.map
@@ -0,0 +1 @@
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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -4,9 +4,13 @@ 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;
7
+ const COLOR_PICKER_HEIGHT = 200;
8
+ const COLOR_PICKER_TYPE_HEX = 'hex';
9
+ const COLOR_PICKER_TYPE_RGB = 'rgb';
8
10
 
9
11
  exports.COLOR_PICKER_HEIGHT = COLOR_PICKER_HEIGHT;
10
12
  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;
11
15
  exports.COLOR_PICKER_WIDTH = COLOR_PICKER_WIDTH;
12
16
  //# 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;"}
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;"}
@@ -5,20 +5,40 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const cssColorPicker = 'color-picker';
6
6
  const cssColorPickerContainer = 'color-picker__container';
7
7
  const cssColorPickerRbgcp = 'color-picker__rbgcp';
8
+ const cssColorPickerHeader = 'color-picker__header';
9
+ const cssColorPickerCloseIcon = 'color-picker__close-icon';
10
+ const cssColorPickerSwatches = 'color-picker__swatches';
11
+ const cssColorPickerSwatchesHeader = 'color-picker__swatches-header';
12
+ const cssColorPickerSwatchesContent = 'color-picker__swatches-content';
8
13
  const cssColorPickerSwatch = 'color-picker__swatch';
9
14
  const cssColorPickerSwatchSmall = 'color-picker__swatch_small';
10
15
  const cssColorPickerSwatchBig = 'color-picker__swatch_big';
11
16
  const cssColorPickerSwatchFill = 'color-picker__swatch-fill';
12
17
  const cssColorPickerInputColorSwatchContainer = 'color-picker__input-color-swatch-container';
13
- const cssColorPickerInputContainer = 'color-picker__input-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';
14
24
 
15
25
  exports.cssColorPicker = cssColorPicker;
26
+ exports.cssColorPickerCloseIcon = cssColorPickerCloseIcon;
16
27
  exports.cssColorPickerContainer = cssColorPickerContainer;
28
+ exports.cssColorPickerFooter = cssColorPickerFooter;
29
+ exports.cssColorPickerHeader = cssColorPickerHeader;
17
30
  exports.cssColorPickerInputColorSwatchContainer = cssColorPickerInputColorSwatchContainer;
18
31
  exports.cssColorPickerInputContainer = cssColorPickerInputContainer;
32
+ exports.cssColorPickerInputs = cssColorPickerInputs;
33
+ exports.cssColorPickerInputsType = cssColorPickerInputsType;
34
+ exports.cssColorPickerInputsValue = cssColorPickerInputsValue;
35
+ exports.cssColorPickerInputsValueContainer = cssColorPickerInputsValueContainer;
19
36
  exports.cssColorPickerRbgcp = cssColorPickerRbgcp;
20
37
  exports.cssColorPickerSwatch = cssColorPickerSwatch;
21
38
  exports.cssColorPickerSwatchBig = cssColorPickerSwatchBig;
22
39
  exports.cssColorPickerSwatchFill = cssColorPickerSwatchFill;
23
40
  exports.cssColorPickerSwatchSmall = cssColorPickerSwatchSmall;
41
+ exports.cssColorPickerSwatches = cssColorPickerSwatches;
42
+ exports.cssColorPickerSwatchesContent = cssColorPickerSwatchesContent;
43
+ exports.cssColorPickerSwatchesHeader = cssColorPickerSwatchesHeader;
24
44
  //# 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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -9,7 +9,11 @@ var css_classes = require('./css_classes.js');
9
9
  var index$1 = require('../../../../../external/react-best-gradient-color-picker/dist/esm/components/index.js');
10
10
  var context = require('./context.js');
11
11
  var main_module = require('../../css/color_picker_new/main.module.less.js');
12
+ var colorPickerFooter = require('./components/color-picker-footer.js');
13
+ var colorPickerHeader = require('./components/color-picker-header.js');
14
+ var colorPickerInputs = require('./components/color-picker-inputs/color-picker-inputs.js');
12
15
  var colorPickerSwatch = require('./components/color-picker-swatch.js');
16
+ var colorPickerSwatches = require('./components/color-picker-swatches.js');
13
17
  var index = require('../dropdown/index.js');
14
18
  var use_color_picker = require('./hooks/use_color_picker.js');
15
19
 
@@ -28,8 +32,12 @@ const ColorPickerNewPure = ({ id, name }) => {
28
32
  React__default['default'].createElement(colorPickerSwatch.ColorPickerSwatch, { color: color })),
29
33
  React__default['default'].createElement(input['default'], { type: "text", id: id, name: name, value: `# ${color === null || color === void 0 ? void 0 : color.toUpperCase()}`, readOnly: true }))),
30
34
  React__default['default'].createElement(index['default'].Content, null,
35
+ React__default['default'].createElement(colorPickerHeader.ColorPickerHeader, null),
31
36
  React__default['default'].createElement("div", { className: `${main_module['default'][css_classes.cssColorPickerContainer]}` },
32
- 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(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]}` }),
38
+ React__default['default'].createElement(colorPickerInputs.ColorPickerInputs, null),
39
+ React__default['default'].createElement(colorPickerSwatches.ColorPickerSwatches, null)),
40
+ React__default['default'].createElement(colorPickerFooter.ColorPickerFooter, null)))));
33
41
  };
34
42
  const ColorPickerNewWithContext = ({ id, name, initialColor, onChange, onCancel, onSave }) => {
35
43
  const colorPickerNewContext = use_color_picker['default']({
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uFAA2F;AACjH;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,sBAAsB,uFAA2F;AACjH;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;"}
@@ -17,6 +17,10 @@ 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
+ };
20
24
  const getAllColorTypes = (color) => {
21
25
  const tinyColor = getTinyColorInstance(color);
22
26
  const rgba = getRgbaValue(tinyColor);
@@ -39,4 +43,5 @@ exports.getHexValue = getHexValue;
39
43
  exports.getHexValueString = getHexValueString;
40
44
  exports.getRgbaValue = getRgbaValue;
41
45
  exports.getTinyColorInstance = getTinyColorInstance;
46
+ exports.isHexChar = isHexChar;
42
47
  //# 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;"}
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,27 +1,28 @@
1
1
  import React, { useContext } from 'react';
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 { color, 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(color));
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'))));
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 { cssColorPickerFooter } from '../css_classes.js';
6
+ import { ColorPickerNewContext } from '../context.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'))));
26
25
  };
27
- //# sourceMappingURL=color-picker-footer.js.map
26
+
27
+ export { ColorPickerFooter };
28
+ //# sourceMappingURL=color-picker-footer.js.map
@@ -1 +1 @@
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,OAA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AO,EAAC,OAAO,EAAE,gBAAgB,IACzC,CAAC,CAAC,MAAM,CAAC,CACL,CACP,CACT,CAAC;AACN,CAAC,CAAC"}
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,32 +1,33 @@
1
1
  import React, { useContext, useEffect } from 'react';
2
- import { cssColorPickerCloseIcon, cssColorPickerHeader } from '../css_classes';
3
- import { ColorPickerNewContext } from '../context';
4
- import { DropdownContext } from '@auroraComponents/dropdown/context';
5
- import '../types';
6
- import '@auroraComponents/dropdown/context/types';
7
- import IconClose from '@auroraAssets/icon_close';
8
- import styles from '@auroraCss/color_picker_new/main.module.less';
9
- import { useTranslation } from 'react-i18next';
10
- export const ColorPickerHeader = () => {
11
- const { handleCancel } = useContext(ColorPickerNewContext);
12
- const [t] = useTranslation();
13
- const { closeDropdown, isOpen } = useContext(DropdownContext);
14
- const handleCancelButton = () => {
15
- closePicker();
16
- };
17
- const closePicker = () => {
18
- closeDropdown === null || closeDropdown === void 0 ? void 0 : closeDropdown();
19
- handleCancel === null || handleCancel === void 0 ? void 0 : handleCancel();
20
- };
21
- useEffect(() => {
22
- if (!isOpen)
23
- return;
24
- document.addEventListener('visibilitychange', closePicker);
25
- return () => document.removeEventListener('visibilitychange', closePicker);
26
- }, [isOpen]);
27
- return (React.createElement("div", { className: `${styles[cssColorPickerHeader]}` },
28
- t('Select color'),
29
- React.createElement("button", { onClick: handleCancelButton, className: `${styles[cssColorPickerCloseIcon]}` },
30
- React.createElement(IconClose, { size: "m" }))));
2
+ import { useTranslation } from '../../../../../../external/react-i18next/dist/es/useTranslation.js';
3
+ import { DropdownContext } from '../../dropdown/context/index.js';
4
+ import { cssColorPickerHeader, cssColorPickerCloseIcon } from '../css_classes.js';
5
+ import { ColorPickerNewContext } from '../context.js';
6
+ import styles from '../../../css/color_picker_new/main.module.less.js';
7
+ import IconClose from '../../../assets/icon_close.js';
8
+
9
+ const ColorPickerHeader = () => {
10
+ const { handleCancel } = useContext(ColorPickerNewContext);
11
+ const [t] = useTranslation();
12
+ const { closeDropdown, isOpen } = useContext(DropdownContext);
13
+ const handleCancelButton = () => {
14
+ closePicker();
15
+ };
16
+ const closePicker = () => {
17
+ closeDropdown === null || closeDropdown === void 0 ? void 0 : closeDropdown();
18
+ handleCancel === null || handleCancel === void 0 ? void 0 : handleCancel();
19
+ };
20
+ useEffect(() => {
21
+ if (!isOpen)
22
+ return;
23
+ document.addEventListener('visibilitychange', closePicker);
24
+ return () => document.removeEventListener('visibilitychange', closePicker);
25
+ }, [isOpen]);
26
+ return (React.createElement("div", { className: `${styles[cssColorPickerHeader]}` },
27
+ t('Select color'),
28
+ React.createElement("button", { onClick: handleCancelButton, className: `${styles[cssColorPickerCloseIcon]}` },
29
+ React.createElement(IconClose, { size: "m" }))));
31
30
  };
32
- //# sourceMappingURL=color-picker-header.js.map
31
+
32
+ export { ColorPickerHeader };
33
+ //# sourceMappingURL=color-picker-header.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"color-picker-header.js","sourceRoot":"","sources":["../../../../../../../../src/components/color_picker_new/components/color-picker-header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE/E,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,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,MAAM,MAAM,8CAA8C,CAAC;AAClE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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,33 +1,35 @@
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';
1
+ import React, { useContext, useState, useEffect } from 'react';
5
2
  import { InputUtils } from '@dreamcommerce/utilities';
6
- import { isHexChar } from '@auroraComponents/color_picker_new/utilities';
7
- export 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 })));
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 })));
32
32
  };
33
- //# sourceMappingURL=color-picker-inputs-hex.js.map
33
+
34
+ export { ColorPickerInputsHex };
35
+ //# sourceMappingURL=color-picker-inputs-hex.js.map
@@ -1 +1 @@
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,QAAQ,EAAE,GAAG,EAAE,mBAAmB,EAAE,UAAU,EAAE,GAAG,UAAU,CAA8B,qBAAqB,CAAC,CAAC;IAE1H,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,CAAC,OAAO,EAAE,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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,14 +1,16 @@
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';
5
2
  import { InputUtils } from '@dreamcommerce/utilities';
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 })));
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 })));
13
13
  };
14
- //# sourceMappingURL=color-picker-inputs-rgba.js.map
14
+
15
+ export { ColorPickerInputsRgba };
16
+ //# sourceMappingURL=color-picker-inputs-rgba.js.map
@@ -1 +1 @@
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
+ {"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,30 +1,33 @@
1
- import { COLOR_PICKER_TYPE_HEX, COLOR_PICKER_TYPE_RGB } from '../../constants';
2
1
  import React, { useState } from 'react';
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()))));
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()))));
29
30
  };
30
- //# sourceMappingURL=color-picker-inputs.js.map
31
+
32
+ export { ColorPickerInputs };
33
+ //# sourceMappingURL=color-picker-inputs.js.map
@@ -1 +1 @@
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
+ {"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,38 +1,40 @@
1
1
  import React, { useContext } from 'react';
2
- import { cssColorPickerSwatches, cssColorPickerSwatchesContent, cssColorPickerSwatchesHeader } from '../css_classes';
3
- import { getHexValue, getTinyColorInstance } from '../utilities';
4
- import { ColorPickerNewContext } from '../context';
5
- import { ColorPickerSwatch } from './color-picker-swatch';
6
- import '../types';
7
- import styles from '@auroraCss/color_picker_new/main.module.less';
8
- import { useTranslation } from 'react-i18next';
9
- export const ColorPickerSwatches = () => {
10
- const { hslArr, handlePickSwatch } = useContext(ColorPickerNewContext);
11
- const [t] = useTranslation();
12
- const [h, s] = hslArr;
13
- const shades = [
14
- { h, s, l: 95 },
15
- { h, s, l: 90 },
16
- { h, s, l: 80 },
17
- { h, s, l: 70 },
18
- { h, s, l: 60 },
19
- { h, s, l: 50 },
20
- { h, s, l: 40 },
21
- { h, s, l: 30 },
22
- { h, s, l: 20 },
23
- { h, s, l: 10 },
24
- { h, s, l: 5 }
25
- ];
26
- return (React.createElement("div", { className: styles[cssColorPickerSwatches] },
27
- React.createElement("div", { className: styles[cssColorPickerSwatchesHeader] },
28
- React.createElement("p", null, t('Shades of color'))),
29
- React.createElement("div", { className: styles[cssColorPickerSwatchesContent] }, shades.map((shade, index) => {
30
- const colorTiny = getTinyColorInstance(shade);
31
- const colorHex = getHexValue(colorTiny);
32
- const handleOnClick = () => {
33
- handlePickSwatch === null || handlePickSwatch === void 0 ? void 0 : handlePickSwatch(colorHex);
34
- };
35
- return React.createElement(ColorPickerSwatch, { size: "small", onClick: handleOnClick, key: `${shade}-${index}`, color: colorHex });
36
- }))));
2
+ import { useTranslation } from '../../../../../../external/react-i18next/dist/es/useTranslation.js';
3
+ import { cssColorPickerSwatches, cssColorPickerSwatchesHeader, cssColorPickerSwatchesContent } from '../css_classes.js';
4
+ import { ColorPickerNewContext } from '../context.js';
5
+ import { getTinyColorInstance, getHexValue } from '../utilities.js';
6
+ import styles from '../../../css/color_picker_new/main.module.less.js';
7
+ import { ColorPickerSwatch } from './color-picker-swatch.js';
8
+
9
+ const ColorPickerSwatches = () => {
10
+ const { hslArr, handlePickSwatch } = useContext(ColorPickerNewContext);
11
+ const [t] = useTranslation();
12
+ const [h, s] = hslArr;
13
+ const shades = [
14
+ { h, s, l: 95 },
15
+ { h, s, l: 90 },
16
+ { h, s, l: 80 },
17
+ { h, s, l: 70 },
18
+ { h, s, l: 60 },
19
+ { h, s, l: 50 },
20
+ { h, s, l: 40 },
21
+ { h, s, l: 30 },
22
+ { h, s, l: 20 },
23
+ { h, s, l: 10 },
24
+ { h, s, l: 5 }
25
+ ];
26
+ return (React.createElement("div", { className: styles[cssColorPickerSwatches] },
27
+ React.createElement("div", { className: styles[cssColorPickerSwatchesHeader] },
28
+ React.createElement("p", null, t('Shades of color'))),
29
+ React.createElement("div", { className: styles[cssColorPickerSwatchesContent] }, shades.map((shade, index) => {
30
+ const colorTiny = getTinyColorInstance(shade);
31
+ const colorHex = getHexValue(colorTiny);
32
+ const handleOnClick = () => {
33
+ handlePickSwatch === null || handlePickSwatch === void 0 ? void 0 : handlePickSwatch(colorHex);
34
+ };
35
+ return React.createElement(ColorPickerSwatch, { size: "small", onClick: handleOnClick, key: `${shade}-${index}`, color: colorHex });
36
+ }))));
37
37
  };
38
- //# sourceMappingURL=color-picker-swatches.js.map
38
+
39
+ export { ColorPickerSwatches };
40
+ //# sourceMappingURL=color-picker-swatches.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"color-picker-swatches.js","sourceRoot":"","sources":["../../../../../../../../src/components/color_picker_new/components/color-picker-swatches.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AACrH,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAA4C,UAAU,CAAC;AACvD,OAAO,MAAM,MAAM,8CAA8C,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACpC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAA8B,qBAAqB,CAAC,CAAC;IACpG,MAAM,CAAC,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;IAE7B,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC;IACtB,MAAM,MAAM,GAAG;QACX,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE;QACf,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE;Q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jH,CAAC,CAAC,CACA,CACJ,CACT,CAAC;AACN,CAAC,CAAC"}
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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,6 +1,8 @@
1
1
  const COLOR_PICKER_INITIAL_STATE = '#000000';
2
2
  const COLOR_PICKER_WIDTH = 220;
3
- const COLOR_PICKER_HEIGHT = 200;
3
+ const COLOR_PICKER_HEIGHT = 200;
4
+ const COLOR_PICKER_TYPE_HEX = 'hex';
5
+ const COLOR_PICKER_TYPE_RGB = 'rgb';
4
6
 
5
- export { COLOR_PICKER_HEIGHT, COLOR_PICKER_INITIAL_STATE, COLOR_PICKER_WIDTH };
7
+ export { COLOR_PICKER_HEIGHT, COLOR_PICKER_INITIAL_STATE, COLOR_PICKER_TYPE_HEX, COLOR_PICKER_TYPE_RGB, COLOR_PICKER_WIDTH };
6
8
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,12 +1,22 @@
1
1
  const cssColorPicker = 'color-picker';
2
2
  const cssColorPickerContainer = 'color-picker__container';
3
3
  const cssColorPickerRbgcp = 'color-picker__rbgcp';
4
+ const cssColorPickerHeader = 'color-picker__header';
5
+ const cssColorPickerCloseIcon = 'color-picker__close-icon';
6
+ const cssColorPickerSwatches = 'color-picker__swatches';
7
+ const cssColorPickerSwatchesHeader = 'color-picker__swatches-header';
8
+ const cssColorPickerSwatchesContent = 'color-picker__swatches-content';
4
9
  const cssColorPickerSwatch = 'color-picker__swatch';
5
10
  const cssColorPickerSwatchSmall = 'color-picker__swatch_small';
6
11
  const cssColorPickerSwatchBig = 'color-picker__swatch_big';
7
12
  const cssColorPickerSwatchFill = 'color-picker__swatch-fill';
8
13
  const cssColorPickerInputColorSwatchContainer = 'color-picker__input-color-swatch-container';
9
- const cssColorPickerInputContainer = 'color-picker__input-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';
10
20
 
11
- export { cssColorPicker, cssColorPickerContainer, cssColorPickerInputColorSwatchContainer, cssColorPickerInputContainer, cssColorPickerRbgcp, cssColorPickerSwatch, cssColorPickerSwatchBig, cssColorPickerSwatchFill, cssColorPickerSwatchSmall };
21
+ export { cssColorPicker, cssColorPickerCloseIcon, cssColorPickerContainer, cssColorPickerFooter, cssColorPickerHeader, cssColorPickerInputColorSwatchContainer, cssColorPickerInputContainer, cssColorPickerInputs, cssColorPickerInputsType, cssColorPickerInputsValue, cssColorPickerInputsValueContainer, cssColorPickerRbgcp, cssColorPickerSwatch, cssColorPickerSwatchBig, cssColorPickerSwatchFill, cssColorPickerSwatchSmall, cssColorPickerSwatches, cssColorPickerSwatchesContent, cssColorPickerSwatchesHeader };
12
22
  //# 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;"}
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;"}
@@ -5,7 +5,11 @@ import { cssColorPicker, cssColorPickerInputContainer, cssColorPickerInputColorS
5
5
  import { ColorPicker } from '../../../../../external/react-best-gradient-color-picker/dist/esm/components/index.js';
6
6
  import { ColorPickerNewContext } from './context.js';
7
7
  import styles from '../../css/color_picker_new/main.module.less.js';
8
+ import { ColorPickerFooter } from './components/color-picker-footer.js';
9
+ import { ColorPickerHeader } from './components/color-picker-header.js';
10
+ import { ColorPickerInputs } from './components/color-picker-inputs/color-picker-inputs.js';
8
11
  import { ColorPickerSwatch } from './components/color-picker-swatch.js';
12
+ import { ColorPickerSwatches } from './components/color-picker-swatches.js';
9
13
  import Dropdown from '../dropdown/index.js';
10
14
  import useColorPicker from './hooks/use_color_picker.js';
11
15
 
@@ -20,8 +24,12 @@ const ColorPickerNewPure = ({ id, name }) => {
20
24
  React.createElement(ColorPickerSwatch, { color: color })),
21
25
  React.createElement(Input, { type: "text", id: id, name: name, value: `# ${color === null || color === void 0 ? void 0 : color.toUpperCase()}`, readOnly: true }))),
22
26
  React.createElement(Dropdown.Content, null,
27
+ React.createElement(ColorPickerHeader, null),
23
28
  React.createElement("div", { className: `${styles[cssColorPickerContainer]}` },
24
- 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(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]}` }),
30
+ React.createElement(ColorPickerInputs, null),
31
+ React.createElement(ColorPickerSwatches, null)),
32
+ React.createElement(ColorPickerFooter, null)))));
25
33
  };
26
34
  const ColorPickerNewWithContext = ({ id, name, initialColor, onChange, onCancel, onSave }) => {
27
35
  const colorPickerNewContext = useColorPicker({
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,4BAA4B,uFAA2F;AACvH;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,4BAA4B,uFAA2F;AACvH;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;"}
@@ -13,6 +13,10 @@ 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
+ };
16
20
  const getAllColorTypes = (color) => {
17
21
  const tinyColor = getTinyColorInstance(color);
18
22
  const rgba = getRgbaValue(tinyColor);
@@ -30,5 +34,5 @@ const getAllColorTypes = (color) => {
30
34
  };
31
35
  };
32
36
 
33
- export { getAllColorTypes, getHexValue, getHexValueString, getRgbaValue, getTinyColorInstance };
37
+ export { getAllColorTypes, getHexValue, getHexValueString, getRgbaValue, getTinyColorInstance, isHexChar };
34
38
  //# 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;"}
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;"}
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-33",
5
+ "version": "2.12.1-35",
6
6
  "description": "aurora",
7
7
  "author": "k0ssak",
8
8
  "license": "MIT",