@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.
@@ -1824,8 +1824,12 @@ function isColorTypographyColor(colorName) {
1824
1824
  }
1825
1825
  function getTypographyColorValue(colorName) {
1826
1826
  if (!colorName) return undefined;
1827
- if (isColorTypographyColor(colorName)) {
1828
- return getNBThemeColorFromColorProps(colorName);
1827
+ if (typeof colorName === 'string') {
1828
+ if (isColorTypographyColor(colorName)) {
1829
+ return getNBThemeColorFromColorProps(colorName);
1830
+ }
1831
+ } else if (typeof colorName === 'object') {
1832
+ return Object.fromEntries(Object.entries(colorName).map(([breakpointName, value]) => [breakpointName, getTypographyColorValue(value)]));
1829
1833
  }
1830
1834
  return colorName;
1831
1835
  }
@@ -1900,9 +1904,10 @@ function Typography({
1900
1904
  base: baseOrDefaultToBody
1901
1905
  });
1902
1906
  const currentColor = !color && !hasTypographyAncestor ? defaultColor : color;
1907
+ const currentColorValue = getTypographyColorValue(currentColor);
1903
1908
  const colorStyles = sx({
1904
- color: getTypographyColorValue(currentColor),
1905
- textDecorationColor: getTypographyColorValue(currentColor)
1909
+ color: currentColorValue,
1910
+ textDecorationColor: currentColorValue
1906
1911
  });
1907
1912
  if (process.env.NODE_ENV !== 'production') {
1908
1913
  Object.entries(type).forEach(([key, value]) => {