@zendeskgarden/react-theming 9.0.0-next.25 → 9.0.0-next.27
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.
|
@@ -41,11 +41,15 @@ const toHex = (hue, shade, offset, scheme) => {
|
|
|
41
41
|
return retVal;
|
|
42
42
|
};
|
|
43
43
|
const isValidColor = maybeColor => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
let retVal = ['currentcolor', 'inherit', 'transparent'].includes(maybeColor);
|
|
45
|
+
if (!retVal) {
|
|
46
|
+
try {
|
|
47
|
+
retVal = !!parseToRgba(maybeColor);
|
|
48
|
+
} catch {
|
|
49
|
+
retVal = false;
|
|
50
|
+
}
|
|
48
51
|
}
|
|
52
|
+
return retVal;
|
|
49
53
|
};
|
|
50
54
|
function findNearestIndex(target, arr) {
|
|
51
55
|
let startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
@@ -116,7 +120,7 @@ const toColor = (colors, palette, opacity, scheme, hue, shade, offset, transpare
|
|
|
116
120
|
}
|
|
117
121
|
if (typeof _hue === 'object') {
|
|
118
122
|
retVal = toHex(_hue, shade, offset, scheme);
|
|
119
|
-
} else if (
|
|
123
|
+
} else if (isValidColor(_hue)) {
|
|
120
124
|
if (shade === undefined) {
|
|
121
125
|
retVal = _hue;
|
|
122
126
|
} else {
|
|
@@ -23,7 +23,7 @@ const animationStyles = (position, options) => {
|
|
|
23
23
|
} else {
|
|
24
24
|
transformFunction = 'translateX';
|
|
25
25
|
}
|
|
26
|
-
const animationName = keyframes(["0%{transform:", "(", ");}"], transformFunction, translateValue);
|
|
26
|
+
const animationName = keyframes(["0%{transform:", "(", ");pointer-events:none;}100%{pointer-events:auto;}"], transformFunction, translateValue);
|
|
27
27
|
return css(["&", " ", "{animation:0.2s cubic-bezier(0.15,0.85,0.35,1.2) ", ";}"], options.animationModifier, options.childSelector || '> *', animationName);
|
|
28
28
|
};
|
|
29
29
|
const colorStyles = theme => {
|
package/dist/index.cjs.js
CHANGED
|
@@ -584,11 +584,15 @@ const toHex = (hue, shade, offset, scheme) => {
|
|
|
584
584
|
return retVal;
|
|
585
585
|
};
|
|
586
586
|
const isValidColor = maybeColor => {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
587
|
+
let retVal = ['currentcolor', 'inherit', 'transparent'].includes(maybeColor);
|
|
588
|
+
if (!retVal) {
|
|
589
|
+
try {
|
|
590
|
+
retVal = !!color2k.parseToRgba(maybeColor);
|
|
591
|
+
} catch {
|
|
592
|
+
retVal = false;
|
|
593
|
+
}
|
|
591
594
|
}
|
|
595
|
+
return retVal;
|
|
592
596
|
};
|
|
593
597
|
function findNearestIndex(target, arr) {
|
|
594
598
|
let startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
@@ -659,7 +663,7 @@ const toColor = (colors, palette, opacity, scheme, hue, shade, offset, transpare
|
|
|
659
663
|
}
|
|
660
664
|
if (typeof _hue === 'object') {
|
|
661
665
|
retVal = toHex(_hue, shade, offset, scheme);
|
|
662
|
-
} else if (
|
|
666
|
+
} else if (isValidColor(_hue)) {
|
|
663
667
|
if (shade === undefined) {
|
|
664
668
|
retVal = _hue;
|
|
665
669
|
} else {
|
|
@@ -1268,7 +1272,7 @@ const animationStyles = (position, options) => {
|
|
|
1268
1272
|
} else {
|
|
1269
1273
|
transformFunction = 'translateX';
|
|
1270
1274
|
}
|
|
1271
|
-
const animationName = styled.keyframes(["0%{transform:", "(", ");}"], transformFunction, translateValue);
|
|
1275
|
+
const animationName = styled.keyframes(["0%{transform:", "(", ");pointer-events:none;}100%{pointer-events:auto;}"], transformFunction, translateValue);
|
|
1272
1276
|
return styled.css(["&", " ", "{animation:0.2s cubic-bezier(0.15,0.85,0.35,1.2) ", ";}"], options.animationModifier, options.childSelector || '> *', animationName);
|
|
1273
1277
|
};
|
|
1274
1278
|
const colorStyles = theme => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-theming",
|
|
3
|
-
"version": "9.0.0-next.
|
|
3
|
+
"version": "9.0.0-next.27",
|
|
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": "1e33779f9a7a284af3eda1405fa624c00e739a6a"
|
|
51
51
|
}
|