@yahoo/uds-mobile 2.24.2 → 2.24.3

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.
@@ -154,7 +154,13 @@ function parseShadowValue(value) {
154
154
  */
155
155
  function resolveShadowColor(colorConfig, opacity, spectrum, palette) {
156
156
  const opacityValue = parseInt(opacity, 10) / 100;
157
- if (colorConfig.type === "always") return `rgba(${colorConfig.value === "white" ? "255, 255, 255" : "0, 0, 0"}, ${opacityValue})`;
157
+ if (colorConfig.type === "always") {
158
+ const rgb = newAlwaysPalette[colorConfig.value.startsWith("always/") ? colorConfig.value : `always/${colorConfig.value}`]?.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);
159
+ if (rgb) {
160
+ const [, red, green, blue] = rgb;
161
+ return `rgba(${parseInt(red, 16)}, ${parseInt(green, 16)}, ${parseInt(blue, 16)}, ${opacityValue})`;
162
+ }
163
+ }
158
164
  if (colorConfig.type === "palette") {
159
165
  const colorDef = palette[colorConfig.value];
160
166
  if (colorDef) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yahoo/uds-mobile",
3
- "version": "2.24.2",
3
+ "version": "2.24.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "uds-mobile": "./cli/uds-mobile.js"