@synerise/ds-color-picker 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/ColorPicker.d.ts +1 -1
- package/dist/ColorPicker.js +10 -19
- package/dist/ColorPicker.styles.d.ts +2 -2
- package/dist/ColorPicker.styles.js +4 -4
- package/package.json +10 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.3.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-color-picker@1.3.1...@synerise/ds-color-picker@1.3.2) (2025-11-28)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-color-picker
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.3.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-color-picker@1.3.0...@synerise/ds-color-picker@1.3.1) (2025-11-13)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @synerise/ds-color-picker
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [1.3.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-color-picker@1.2.34...@synerise/ds-color-picker@1.3.0) (2025-11-06)
|
|
7
23
|
|
|
8
24
|
|
package/dist/ColorPicker.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ColorPickerProps } from './ColorPicker.types';
|
|
3
|
-
declare const ColorPicker: ({ maxWidth, value, onChange, colors, onSaveColors, infix, getPopupContainer, placeholder, inputProps, maxSavedColors,
|
|
3
|
+
declare const ColorPicker: ({ maxWidth, value, onChange, colors, onSaveColors, infix, getPopupContainer, placeholder, inputProps, maxSavedColors, isShownSavedColors, size, errorText, description, disabled, error, readOnly, tooltip, }: ColorPickerProps) => React.JSX.Element;
|
|
4
4
|
export default ColorPicker;
|
package/dist/ColorPicker.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import copy from 'copy-to-clipboard';
|
|
3
2
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
3
|
import { HexColorPicker as ReactColorful } from 'react-colorful';
|
|
5
4
|
import Divider from '@synerise/ds-divider';
|
|
6
5
|
import Dropdown from '@synerise/ds-dropdown';
|
|
7
|
-
import Icon, {
|
|
6
|
+
import Icon, { FormulaPlusM } from '@synerise/ds-icon';
|
|
8
7
|
import Tags, { Tag, TagShape } from '@synerise/ds-tags';
|
|
9
8
|
import Tooltip from '@synerise/ds-tooltip';
|
|
10
9
|
import { getPopupContainer as defaultGetPopupContainer, useOnClickOutside } from '@synerise/ds-utils';
|
|
@@ -29,7 +28,6 @@ var ColorPicker = function ColorPicker(_ref) {
|
|
|
29
28
|
inputProps = _ref.inputProps,
|
|
30
29
|
_ref$maxSavedColors = _ref.maxSavedColors,
|
|
31
30
|
maxSavedColors = _ref$maxSavedColors === void 0 ? 9 : _ref$maxSavedColors,
|
|
32
|
-
tooltip = _ref.tooltip,
|
|
33
31
|
isShownSavedColors = _ref.isShownSavedColors,
|
|
34
32
|
_ref$size = _ref.size,
|
|
35
33
|
size = _ref$size === void 0 ? 'M' : _ref$size,
|
|
@@ -37,7 +35,8 @@ var ColorPicker = function ColorPicker(_ref) {
|
|
|
37
35
|
description = _ref.description,
|
|
38
36
|
disabled = _ref.disabled,
|
|
39
37
|
error = _ref.error,
|
|
40
|
-
readOnly = _ref.readOnly
|
|
38
|
+
readOnly = _ref.readOnly,
|
|
39
|
+
tooltip = _ref.tooltip;
|
|
41
40
|
var _useState = useState(value),
|
|
42
41
|
colorTextInput = _useState[0],
|
|
43
42
|
setColorTextInput = _useState[1];
|
|
@@ -56,9 +55,6 @@ var ColorPicker = function ColorPicker(_ref) {
|
|
|
56
55
|
var _useState6 = useState(colors),
|
|
57
56
|
savedColors = _useState6[0],
|
|
58
57
|
setSavedColors = _useState6[1];
|
|
59
|
-
var _useState7 = useState(tooltip == null ? void 0 : tooltip.copy),
|
|
60
|
-
tooltipText = _useState7[0],
|
|
61
|
-
setTooltipText = _useState7[1];
|
|
62
58
|
var setLocalValues = useCallback(function (colorValue) {
|
|
63
59
|
setColorTextInput(colorValue);
|
|
64
60
|
if (isValidTextColor(colorValue)) {
|
|
@@ -101,13 +97,6 @@ var ColorPicker = function ColorPicker(_ref) {
|
|
|
101
97
|
var onClickHandler = useCallback(function () {
|
|
102
98
|
setDropdownVisible(!dropdownVisible);
|
|
103
99
|
}, [dropdownVisible]);
|
|
104
|
-
var copyHandler = useCallback(function () {
|
|
105
|
-
lastValidHexColor && copy(lastValidHexColor);
|
|
106
|
-
setTooltipText(tooltip == null ? void 0 : tooltip.copied);
|
|
107
|
-
setTimeout(function () {
|
|
108
|
-
setTooltipText(tooltip == null ? void 0 : tooltip.copy);
|
|
109
|
-
}, 3000);
|
|
110
|
-
}, [lastValidHexColor, tooltip]);
|
|
111
100
|
useEffect(function () {
|
|
112
101
|
if (value && (isValidHexColor(value) || isValidTextColor(value))) {
|
|
113
102
|
setLocalValues(value);
|
|
@@ -194,11 +183,13 @@ var ColorPicker = function ColorPicker(_ref) {
|
|
|
194
183
|
},
|
|
195
184
|
onBlur: onBlurHandler,
|
|
196
185
|
placeholder: placeholder,
|
|
197
|
-
icon1:
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
186
|
+
icon1: /*#__PURE__*/React.createElement(S.StyledCopyIcon, {
|
|
187
|
+
copyValue: lastValidHexColor != null ? lastValidHexColor : '',
|
|
188
|
+
texts: {
|
|
189
|
+
copyTooltip: tooltip == null ? void 0 : tooltip.copy,
|
|
190
|
+
copiedTooltip: tooltip == null ? void 0 : tooltip.copied
|
|
191
|
+
}
|
|
192
|
+
})
|
|
202
193
|
}), isShownSavedColors && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Divider, null), swatchSection)));
|
|
203
194
|
var trigger = useMemo(function () {
|
|
204
195
|
var isClickable = !disabled && !readOnly;
|
|
@@ -54,7 +54,7 @@ export declare const AddColorButton: import("styled-components").StyledComponent
|
|
|
54
54
|
Star: (props: import("@synerise/ds-button").StarButtonProps) => React.ReactElement;
|
|
55
55
|
Checkbox: (props: import("@synerise/ds-button").CheckboxButtonProps) => React.ReactElement;
|
|
56
56
|
}, any, {}, never>;
|
|
57
|
-
export declare const
|
|
57
|
+
export declare const StyledCopyIcon: import("styled-components").StyledComponent<({ copyValue, texts, onMouseEnter, onMouseLeave, icon, placement, onCopy, ...rest }: import("@synerise/ds-copy-icon").CopyIconProps) => React.JSX.Element, any, {}, never>;
|
|
58
58
|
export declare const ColorPickerInput: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<{
|
|
59
59
|
error?: boolean;
|
|
60
60
|
className?: string;
|
|
@@ -162,7 +162,7 @@ declare const _default: {
|
|
|
162
162
|
SwatchSectionWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
163
163
|
PreffixWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
164
164
|
ValueWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
165
|
-
CopyIcon:
|
|
165
|
+
CopyIcon: ({ copyValue, texts, onMouseEnter, onMouseLeave, icon, placement, onCopy, ...rest }: import("@synerise/ds-copy-icon").CopyIconProps) => React.JSX.Element;
|
|
166
166
|
ColorPickerInput: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<{
|
|
167
167
|
error?: boolean;
|
|
168
168
|
className?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled, { createGlobalStyle } from 'styled-components';
|
|
2
2
|
import Button from '@synerise/ds-button';
|
|
3
|
-
import
|
|
3
|
+
import CopyIcon from '@synerise/ds-copy-icon';
|
|
4
4
|
import { Input } from '@synerise/ds-input';
|
|
5
5
|
import { Tag, TagsStyles } from '@synerise/ds-tags';
|
|
6
6
|
import { ColorPickerSize } from './ColorPicker.types';
|
|
@@ -43,14 +43,14 @@ export var AddColorButton = styled(Button).withConfig({
|
|
|
43
43
|
displayName: "ColorPickerstyles__AddColorButton",
|
|
44
44
|
componentId: "sc-1iu8b6j-4"
|
|
45
45
|
})(["&&&.ant-btn{width:16px;height:16px;margin-right:0;}"]);
|
|
46
|
-
export var
|
|
47
|
-
displayName: "
|
|
46
|
+
export var StyledCopyIcon = styled(CopyIcon).withConfig({
|
|
47
|
+
displayName: "ColorPickerstyles__StyledCopyIcon",
|
|
48
48
|
componentId: "sc-1iu8b6j-5"
|
|
49
49
|
})(["display:none;"]);
|
|
50
50
|
export var ColorPickerInput = styled(Input).withConfig({
|
|
51
51
|
displayName: "ColorPickerstyles__ColorPickerInput",
|
|
52
52
|
componentId: "sc-1iu8b6j-6"
|
|
53
|
-
})(["&:hover{", "{display:flex;}}"],
|
|
53
|
+
})(["&:hover{", "{display:flex;}}"], StyledCopyIcon);
|
|
54
54
|
export var ColorPickerSelect = styled(Input).withConfig({
|
|
55
55
|
displayName: "ColorPickerstyles__ColorPickerSelect",
|
|
56
56
|
componentId: "sc-1iu8b6j-7"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-color-picker",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Color-Picker Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -35,13 +35,14 @@
|
|
|
35
35
|
],
|
|
36
36
|
"types": "dist/index.d.ts",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@synerise/ds-button": "^1.5.
|
|
39
|
-
"@synerise/ds-
|
|
40
|
-
"@synerise/ds-
|
|
41
|
-
"@synerise/ds-
|
|
42
|
-
"@synerise/ds-
|
|
43
|
-
"@synerise/ds-
|
|
44
|
-
"@synerise/ds-
|
|
38
|
+
"@synerise/ds-button": "^1.5.1",
|
|
39
|
+
"@synerise/ds-copy-icon": "^1.0.1",
|
|
40
|
+
"@synerise/ds-divider": "^1.2.2",
|
|
41
|
+
"@synerise/ds-dropdown": "^1.1.2",
|
|
42
|
+
"@synerise/ds-icon": "^1.9.0",
|
|
43
|
+
"@synerise/ds-input": "^1.5.1",
|
|
44
|
+
"@synerise/ds-tags": "^1.5.2",
|
|
45
|
+
"@synerise/ds-tooltip": "^1.3.1",
|
|
45
46
|
"@synerise/ds-utils": "^1.5.0",
|
|
46
47
|
"copy-to-clipboard": "^3.3.1",
|
|
47
48
|
"react-colorful": "^5.2.0"
|
|
@@ -52,5 +53,5 @@
|
|
|
52
53
|
"react": ">=16.9.0 <= 18.3.1",
|
|
53
54
|
"styled-components": "^5.3.3"
|
|
54
55
|
},
|
|
55
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "d5bd7fbc9d840ac30e2b79b36c451b486e178445"
|
|
56
57
|
}
|