@ornikar/kitt-universal 16.4.2 → 16.5.0

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.
@@ -1852,8 +1852,12 @@ function isColorTypographyColor(colorName) {
1852
1852
  }
1853
1853
  function getTypographyColorValue(colorName) {
1854
1854
  if (!colorName) return undefined;
1855
- if (isColorTypographyColor(colorName)) {
1856
- return getNBThemeColorFromColorProps(colorName);
1855
+ if (typeof colorName === 'string') {
1856
+ if (isColorTypographyColor(colorName)) {
1857
+ return getNBThemeColorFromColorProps(colorName);
1858
+ }
1859
+ } else if (typeof colorName === 'object') {
1860
+ return Object.fromEntries(Object.entries(colorName).map(([breakpointName, value]) => [breakpointName, getTypographyColorValue(value)]));
1857
1861
  }
1858
1862
  return colorName;
1859
1863
  }
@@ -1928,9 +1932,10 @@ function Typography({
1928
1932
  base: baseOrDefaultToBody
1929
1933
  });
1930
1934
  const currentColor = !color && !hasTypographyAncestor ? defaultColor : color;
1935
+ const currentColorValue = getTypographyColorValue(currentColor);
1931
1936
  const colorStyles = sx({
1932
- color: getTypographyColorValue(currentColor),
1933
- textDecorationColor: getTypographyColorValue(currentColor)
1937
+ color: currentColorValue,
1938
+ textDecorationColor: currentColorValue
1934
1939
  });
1935
1940
  if (process.env.NODE_ENV !== 'production') {
1936
1941
  Object.entries(type).forEach(([key, value]) => {