@synerise/ds-color-picker 1.2.7 → 1.2.8
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 +11 -0
- package/dist/ColorPicker.js +15 -5
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.2.8](https://github.com/Synerise/synerise-design/compare/@synerise/ds-color-picker@1.2.7...@synerise/ds-color-picker@1.2.8) (2025-06-24)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **color-picker:** prevent triggering onchange handler ([bc663d0](https://github.com/Synerise/synerise-design/commit/bc663d03c15cbbbc78641329ed66b0c46491b0fb))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [1.2.7](https://github.com/Synerise/synerise-design/compare/@synerise/ds-color-picker@1.2.6...@synerise/ds-color-picker@1.2.7) (2025-06-12)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @synerise/ds-color-picker
|
package/dist/ColorPicker.js
CHANGED
|
@@ -59,21 +59,31 @@ var ColorPicker = function ColorPicker(_ref) {
|
|
|
59
59
|
var _useState7 = useState(tooltip == null ? void 0 : tooltip.copy),
|
|
60
60
|
tooltipText = _useState7[0],
|
|
61
61
|
setTooltipText = _useState7[1];
|
|
62
|
-
var
|
|
62
|
+
var setLocalValues = useCallback(function (colorValue) {
|
|
63
63
|
setColorTextInput(colorValue);
|
|
64
64
|
if (isValidTextColor(colorValue)) {
|
|
65
65
|
var standardizedColor = standardizeColor(colorValue);
|
|
66
66
|
setColorHexInput(standardizedColor);
|
|
67
67
|
setLastValidHexColor(standardizedColor);
|
|
68
|
-
onChange && onChange(standardizedColor);
|
|
69
68
|
} else if (isValidHexColor(colorValue)) {
|
|
70
69
|
var fullHexColor = convert3DigitHexTo6Digit(colorValue);
|
|
71
70
|
setColorHexInput(fullHexColor);
|
|
72
71
|
setLastValidHexColor(fullHexColor);
|
|
72
|
+
}
|
|
73
|
+
setPressed(-1);
|
|
74
|
+
}, []);
|
|
75
|
+
var onChangeTextColor = useCallback(function (colorValue) {
|
|
76
|
+
setColorTextInput(colorValue);
|
|
77
|
+
setLocalValues(colorValue);
|
|
78
|
+
if (isValidTextColor(colorValue)) {
|
|
79
|
+
var standardizedColor = standardizeColor(colorValue);
|
|
80
|
+
onChange && onChange(standardizedColor);
|
|
81
|
+
} else if (isValidHexColor(colorValue)) {
|
|
82
|
+
var fullHexColor = convert3DigitHexTo6Digit(colorValue);
|
|
73
83
|
onChange && onChange(fullHexColor);
|
|
74
84
|
}
|
|
75
85
|
setPressed(-1);
|
|
76
|
-
}, [onChange]);
|
|
86
|
+
}, [onChange, setLocalValues]);
|
|
77
87
|
var onChangeHexColor = useCallback(function (colorValue) {
|
|
78
88
|
setColorHexInput(colorValue);
|
|
79
89
|
if (isValidHexColor(colorValue)) {
|
|
@@ -100,9 +110,9 @@ var ColorPicker = function ColorPicker(_ref) {
|
|
|
100
110
|
}, [lastValidHexColor, tooltip]);
|
|
101
111
|
useEffect(function () {
|
|
102
112
|
if (value && (isValidHexColor(value) || isValidTextColor(value))) {
|
|
103
|
-
|
|
113
|
+
setLocalValues(value);
|
|
104
114
|
} else {
|
|
105
|
-
|
|
115
|
+
setLocalValues(DEFAULT_COLOR);
|
|
106
116
|
}
|
|
107
117
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
108
118
|
}, []);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-color-picker",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"description": "Color-Picker Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-button": "^1.
|
|
38
|
-
"@synerise/ds-divider": "^1.0.
|
|
39
|
-
"@synerise/ds-dropdown": "^1.0.
|
|
40
|
-
"@synerise/ds-icon": "^1.5.
|
|
41
|
-
"@synerise/ds-input": "^1.
|
|
42
|
-
"@synerise/ds-tags": "^1.1.
|
|
43
|
-
"@synerise/ds-tooltip": "^1.1.
|
|
44
|
-
"@synerise/ds-utils": "^1.
|
|
37
|
+
"@synerise/ds-button": "^1.4.0",
|
|
38
|
+
"@synerise/ds-divider": "^1.0.11",
|
|
39
|
+
"@synerise/ds-dropdown": "^1.0.13",
|
|
40
|
+
"@synerise/ds-icon": "^1.5.3",
|
|
41
|
+
"@synerise/ds-input": "^1.3.0",
|
|
42
|
+
"@synerise/ds-tags": "^1.1.13",
|
|
43
|
+
"@synerise/ds-tooltip": "^1.1.10",
|
|
44
|
+
"@synerise/ds-utils": "^1.3.0",
|
|
45
45
|
"copy-to-clipboard": "^3.3.1",
|
|
46
46
|
"react-colorful": "^5.2.0"
|
|
47
47
|
},
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"react": ">=16.9.0 <= 18.3.1",
|
|
52
52
|
"styled-components": "^5.3.3"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "f2713cd35cfe22f63a159f05144585834897a132"
|
|
55
55
|
}
|