@zendeskgarden/react-theming 9.1.0 → 9.1.1
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/dist/esm/utils/getColor.js +21 -12
- package/dist/esm/utils/getColorV8.js +15 -9
- package/dist/index.cjs.js +36 -21
- package/package.json +2 -2
|
@@ -202,20 +202,29 @@ const toKey = _ref => {
|
|
|
202
202
|
transparency,
|
|
203
203
|
variable
|
|
204
204
|
} = _ref;
|
|
205
|
-
let themeColorsKey
|
|
206
|
-
if (
|
|
207
|
-
themeColorsKey =
|
|
208
|
-
|
|
205
|
+
let themeColorsKey;
|
|
206
|
+
if (theme.colors) {
|
|
207
|
+
themeColorsKey = CACHE.get(theme.colors);
|
|
208
|
+
if (themeColorsKey === undefined) {
|
|
209
|
+
themeColorsKey = ++KEYS.colors;
|
|
210
|
+
CACHE.set(theme.colors, themeColorsKey);
|
|
211
|
+
}
|
|
209
212
|
}
|
|
210
|
-
let themeOpacityKey
|
|
211
|
-
if (
|
|
212
|
-
themeOpacityKey =
|
|
213
|
-
|
|
213
|
+
let themeOpacityKey;
|
|
214
|
+
if (theme.opacity) {
|
|
215
|
+
themeOpacityKey = CACHE.get(theme.opacity);
|
|
216
|
+
if (themeOpacityKey === undefined) {
|
|
217
|
+
themeOpacityKey = ++KEYS.opacity;
|
|
218
|
+
CACHE.set(theme.opacity, themeOpacityKey);
|
|
219
|
+
}
|
|
214
220
|
}
|
|
215
|
-
let themePaletteKey
|
|
216
|
-
if (
|
|
217
|
-
themePaletteKey =
|
|
218
|
-
|
|
221
|
+
let themePaletteKey;
|
|
222
|
+
if (theme.palette) {
|
|
223
|
+
themePaletteKey = CACHE.get(theme.palette);
|
|
224
|
+
if (themePaletteKey === undefined) {
|
|
225
|
+
themePaletteKey = ++KEYS.palette;
|
|
226
|
+
CACHE.set(theme.palette, themePaletteKey);
|
|
227
|
+
}
|
|
219
228
|
}
|
|
220
229
|
let retVal = `{${themeColorsKey},${themePaletteKey},${themeOpacityKey}}`;
|
|
221
230
|
if (variable !== undefined) {
|
|
@@ -31,20 +31,26 @@ const toKey = _ref => {
|
|
|
31
31
|
theme,
|
|
32
32
|
transparency
|
|
33
33
|
} = _ref;
|
|
34
|
-
let retVal = `${hue}`;
|
|
34
|
+
let retVal = `${typeof hue === 'object' ? JSON.stringify(hue) : hue}`;
|
|
35
35
|
if (shade !== undefined) {
|
|
36
36
|
retVal += `,${shade}`;
|
|
37
37
|
}
|
|
38
38
|
if (theme !== undefined) {
|
|
39
|
-
let themeColorsKey
|
|
40
|
-
if (
|
|
41
|
-
themeColorsKey =
|
|
42
|
-
|
|
39
|
+
let themeColorsKey;
|
|
40
|
+
if (theme.colors) {
|
|
41
|
+
themeColorsKey = CACHE.get(theme.colors);
|
|
42
|
+
if (themeColorsKey === undefined) {
|
|
43
|
+
themeColorsKey = ++KEYS.colors;
|
|
44
|
+
CACHE.set(theme.colors, themeColorsKey);
|
|
45
|
+
}
|
|
43
46
|
}
|
|
44
|
-
let themePaletteKey
|
|
45
|
-
if (
|
|
46
|
-
themePaletteKey =
|
|
47
|
-
|
|
47
|
+
let themePaletteKey;
|
|
48
|
+
if (theme.palette) {
|
|
49
|
+
themePaletteKey = CACHE.get(theme.palette);
|
|
50
|
+
if (themePaletteKey === undefined) {
|
|
51
|
+
themePaletteKey = ++KEYS.palette;
|
|
52
|
+
CACHE.set(theme.palette, themePaletteKey);
|
|
53
|
+
}
|
|
48
54
|
}
|
|
49
55
|
retVal += `,{${themeColorsKey},${themePaletteKey}}`;
|
|
50
56
|
}
|
package/dist/index.cjs.js
CHANGED
|
@@ -743,20 +743,29 @@ const toKey$1 = _ref => {
|
|
|
743
743
|
transparency,
|
|
744
744
|
variable
|
|
745
745
|
} = _ref;
|
|
746
|
-
let themeColorsKey
|
|
747
|
-
if (
|
|
748
|
-
themeColorsKey =
|
|
749
|
-
|
|
746
|
+
let themeColorsKey;
|
|
747
|
+
if (theme.colors) {
|
|
748
|
+
themeColorsKey = CACHE$1.get(theme.colors);
|
|
749
|
+
if (themeColorsKey === undefined) {
|
|
750
|
+
themeColorsKey = ++KEYS$1.colors;
|
|
751
|
+
CACHE$1.set(theme.colors, themeColorsKey);
|
|
752
|
+
}
|
|
750
753
|
}
|
|
751
|
-
let themeOpacityKey
|
|
752
|
-
if (
|
|
753
|
-
themeOpacityKey =
|
|
754
|
-
|
|
754
|
+
let themeOpacityKey;
|
|
755
|
+
if (theme.opacity) {
|
|
756
|
+
themeOpacityKey = CACHE$1.get(theme.opacity);
|
|
757
|
+
if (themeOpacityKey === undefined) {
|
|
758
|
+
themeOpacityKey = ++KEYS$1.opacity;
|
|
759
|
+
CACHE$1.set(theme.opacity, themeOpacityKey);
|
|
760
|
+
}
|
|
755
761
|
}
|
|
756
|
-
let themePaletteKey
|
|
757
|
-
if (
|
|
758
|
-
themePaletteKey =
|
|
759
|
-
|
|
762
|
+
let themePaletteKey;
|
|
763
|
+
if (theme.palette) {
|
|
764
|
+
themePaletteKey = CACHE$1.get(theme.palette);
|
|
765
|
+
if (themePaletteKey === undefined) {
|
|
766
|
+
themePaletteKey = ++KEYS$1.palette;
|
|
767
|
+
CACHE$1.set(theme.palette, themePaletteKey);
|
|
768
|
+
}
|
|
760
769
|
}
|
|
761
770
|
let retVal = `{${themeColorsKey},${themePaletteKey},${themeOpacityKey}}`;
|
|
762
771
|
if (variable !== undefined) {
|
|
@@ -1039,20 +1048,26 @@ const toKey = _ref => {
|
|
|
1039
1048
|
theme,
|
|
1040
1049
|
transparency
|
|
1041
1050
|
} = _ref;
|
|
1042
|
-
let retVal = `${hue}`;
|
|
1051
|
+
let retVal = `${typeof hue === 'object' ? JSON.stringify(hue) : hue}`;
|
|
1043
1052
|
if (shade !== undefined) {
|
|
1044
1053
|
retVal += `,${shade}`;
|
|
1045
1054
|
}
|
|
1046
1055
|
if (theme !== undefined) {
|
|
1047
|
-
let themeColorsKey
|
|
1048
|
-
if (
|
|
1049
|
-
themeColorsKey =
|
|
1050
|
-
|
|
1056
|
+
let themeColorsKey;
|
|
1057
|
+
if (theme.colors) {
|
|
1058
|
+
themeColorsKey = CACHE.get(theme.colors);
|
|
1059
|
+
if (themeColorsKey === undefined) {
|
|
1060
|
+
themeColorsKey = ++KEYS.colors;
|
|
1061
|
+
CACHE.set(theme.colors, themeColorsKey);
|
|
1062
|
+
}
|
|
1051
1063
|
}
|
|
1052
|
-
let themePaletteKey
|
|
1053
|
-
if (
|
|
1054
|
-
themePaletteKey =
|
|
1055
|
-
|
|
1064
|
+
let themePaletteKey;
|
|
1065
|
+
if (theme.palette) {
|
|
1066
|
+
themePaletteKey = CACHE.get(theme.palette);
|
|
1067
|
+
if (themePaletteKey === undefined) {
|
|
1068
|
+
themePaletteKey = ++KEYS.palette;
|
|
1069
|
+
CACHE.set(theme.palette, themePaletteKey);
|
|
1070
|
+
}
|
|
1056
1071
|
}
|
|
1057
1072
|
retVal += `,{${themeColorsKey},${themePaletteKey}}`;
|
|
1058
1073
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-theming",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.1",
|
|
4
4
|
"description": "Theming utilities and components within the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"zendeskgarden:src": "src/index.ts",
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "21eaf7b57f27f1a846ed332f1b8e655d6bc0a13b"
|
|
51
51
|
}
|