@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.
@@ -10,6 +10,7 @@ import Animated, { useSharedValue, useAnimatedStyle, interpolateColor, withSprin
10
10
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
11
11
  import { Platform, Animated as Animated$1, Easing, StyleSheet, Modal, ScrollView as ScrollView$2, View as View$2, Linking, Pressable as Pressable$2, Text as Text$1, useWindowDimensions, PixelRatio } from 'react-native';
12
12
  export { useWindowDimensions as useWindowSize } from 'react-native';
13
+ import _typeof from '@babel/runtime/helpers/typeof';
13
14
  import _regeneratorRuntime from '@babel/runtime/helpers/regeneratorRuntime';
14
15
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
15
16
  import { ArcIcon, UserIcon, ArrowUpIcon, ArrowDownIcon, CheckboxMark, MapPinIcon, EyeOffIcon, EyeIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon, XIcon, RotateCCWIcon, TooltipArrowIcon } from '@ornikar/kitt-icons';
@@ -18,7 +19,6 @@ import { BottomSheetScrollView, BottomSheetView, useBottomSheetDynamicSnapPoints
18
19
  import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
19
20
  import { parse } from 'twemoji-parser';
20
21
  import * as WebBrowser from 'expo-web-browser';
21
- import _typeof from '@babel/runtime/helpers/typeof';
22
22
  import Downshift from 'downshift';
23
23
  import DateTimePicker, { DateTimePickerAndroid } from '@react-native-community/datetimepicker';
24
24
  import { FormattedMessage } from 'react-intl';
@@ -1820,8 +1820,17 @@ function isColorTypographyColor(colorName) {
1820
1820
  }
1821
1821
  function getTypographyColorValue(colorName) {
1822
1822
  if (!colorName) return undefined;
1823
- if (isColorTypographyColor(colorName)) {
1824
- return getNBThemeColorFromColorProps(colorName);
1823
+ if (typeof colorName === 'string') {
1824
+ if (isColorTypographyColor(colorName)) {
1825
+ return getNBThemeColorFromColorProps(colorName);
1826
+ }
1827
+ } else if (_typeof(colorName) === 'object') {
1828
+ return Object.fromEntries(Object.entries(colorName).map(function (_ref) {
1829
+ var _ref2 = _slicedToArray(_ref, 2),
1830
+ breakpointName = _ref2[0],
1831
+ value = _ref2[1];
1832
+ return [breakpointName, getTypographyColorValue(value)];
1833
+ }));
1825
1834
  }
1826
1835
  return colorName;
1827
1836
  }
@@ -1898,9 +1907,10 @@ function Typography(_ref) {
1898
1907
  base: baseOrDefaultToBody
1899
1908
  }));
1900
1909
  var currentColor = !color && !hasTypographyAncestor ? defaultColor : color;
1910
+ var currentColorValue = getTypographyColorValue(currentColor);
1901
1911
  var colorStyles = sx({
1902
- color: getTypographyColorValue(currentColor),
1903
- textDecorationColor: getTypographyColorValue(currentColor)
1912
+ color: currentColorValue,
1913
+ textDecorationColor: currentColorValue
1904
1914
  });
1905
1915
  if (process.env.NODE_ENV !== 'production') {
1906
1916
  Object.entries(type).forEach(function (_ref2) {