@ornikar/kitt-universal 32.7.0 → 32.8.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.
package/dist/index.es.js CHANGED
@@ -20,7 +20,7 @@ import { parse } from '@twemoji/parser';
20
20
  import * as WebBrowser from 'expo-web-browser';
21
21
  import Downshift from 'downshift';
22
22
  import DateTimePicker, { DateTimePickerAndroid } from '@react-native-community/datetimepicker';
23
- import { FormattedMessage } from 'react-intl';
23
+ import { FormattedMessage, defineMessages } from 'react-intl';
24
24
  import { getDocumentAsync } from 'expo-document-picker';
25
25
  import { launchImageLibraryAsync } from 'expo-image-picker';
26
26
  import { useDebouncedCallback } from 'use-debounce';
@@ -12745,6 +12745,103 @@ Picker.Option = PickerOption;
12745
12745
  */
12746
12746
  Picker.UnsafeInternalItem = PickerItem;
12747
12747
 
12748
+ var _excluded$8 = ["children"];
12749
+ function TypographyLinkWebWrapper(_ref) {
12750
+ var children = _ref.children;
12751
+ _objectWithoutProperties(_ref, _excluded$8);
12752
+ return children;
12753
+ }
12754
+
12755
+ var _excluded$7 = ["children", "disabled", "noUnderline", "href", "hrefAttrs", "onPress"];
12756
+ var TypographyLink = /*#__PURE__*/forwardRef(function (_ref, ref) {
12757
+ var children = _ref.children,
12758
+ disabled = _ref.disabled,
12759
+ noUnderline = _ref.noUnderline,
12760
+ href = _ref.href,
12761
+ hrefAttrs = _ref.hrefAttrs,
12762
+ onPress = _ref.onPress,
12763
+ otherProps = _objectWithoutProperties(_ref, _excluded$7);
12764
+ return /*#__PURE__*/jsx(TypographyLinkWebWrapper, {
12765
+ hasNoUnderline: noUnderline,
12766
+ children: /*#__PURE__*/jsx(Typography, _objectSpread(_objectSpread({
12767
+ ref: ref,
12768
+ underline: !noUnderline,
12769
+ color: disabled ? 'black-disabled' : undefined,
12770
+ href: href,
12771
+ hrefAttrs: hrefAttrs,
12772
+ accessibilityRole: "link",
12773
+ dataSet: {
12774
+ // remove data-kitt-universal when we delete kitt web. See :global(a) in Link styles.module.css
12775
+ 'kitt-universal': 'true'
12776
+ },
12777
+ _web: {
12778
+ // @ts-expect-error: This is only used on web where 'not-allowed' and 'pointer' are valid cursor values
12779
+ cursor: disabled ? 'not-allowed' : 'pointer',
12780
+ transitionProperty: 'color',
12781
+ transitionDuration: '0.2s',
12782
+ transitionTimingFunction: 'ease-in-out'
12783
+ }
12784
+ // TODO[native-base@>=3.4.19] this currently does not work. Retest when updating native-base.
12785
+ // _active={{
12786
+ // underline: !!noUnderline,
12787
+ // }}
12788
+ // _hover={{
12789
+ // underline: !!noUnderline,
12790
+ // }}
12791
+ ,
12792
+ onPress: disabled ? undefined : onPress
12793
+ }, otherProps), {}, {
12794
+ children: children
12795
+ }))
12796
+ });
12797
+ });
12798
+
12799
+ var messages = defineMessages({
12800
+ seeMore: {
12801
+ id: "shared.components.ReadMore.seeMore"
12802
+ },
12803
+ seeLess: {
12804
+ id: "shared.components.ReadMore.seeLess"
12805
+ }
12806
+ });
12807
+ function ReadMore(_ref) {
12808
+ var lines = _ref.lines,
12809
+ children = _ref.children,
12810
+ _ref$textColor = _ref.textColor,
12811
+ textColor = _ref$textColor === void 0 ? 'bumper.content.base.hi' : _ref$textColor,
12812
+ _ref$noUnderline = _ref.noUnderline,
12813
+ noUnderline = _ref$noUnderline === void 0 ? false : _ref$noUnderline;
12814
+ var _useState = useState(false),
12815
+ _useState2 = _slicedToArray(_useState, 2),
12816
+ isExpanded = _useState2[0],
12817
+ setIsExpanded = _useState2[1];
12818
+ var nbOfLines = isExpanded ? undefined : lines;
12819
+ var messageProps = isExpanded ? messages.seeLess : messages.seeMore;
12820
+ return /*#__PURE__*/jsxs(Fragment, {
12821
+ children: [/*#__PURE__*/jsx(View, {
12822
+ flexShrink: 1,
12823
+ children: /*#__PURE__*/jsx(Typography.Text, {
12824
+ textAlign: "left",
12825
+ numberOfLines: nbOfLines,
12826
+ ellipsizeMode: "tail",
12827
+ children: children
12828
+ })
12829
+ }), lines ? /*#__PURE__*/jsx(View, {
12830
+ children: /*#__PURE__*/jsx(TypographyLink, {
12831
+ noUnderline: noUnderline,
12832
+ color: textColor,
12833
+ variant: "bold",
12834
+ onPress: function () {
12835
+ setIsExpanded(function (prev) {
12836
+ return !prev;
12837
+ });
12838
+ },
12839
+ children: /*#__PURE__*/jsx(FormattedMessage, _objectSpread({}, messageProps))
12840
+ })
12841
+ }) : null]
12842
+ });
12843
+ }
12844
+
12748
12845
  var SvgStripesinline = function SvgStripesinline(props) {
12749
12846
  return /*#__PURE__*/jsx("svg", _objectSpread(_objectSpread({
12750
12847
  viewBox: "0 0 453 71",
@@ -12845,7 +12942,7 @@ function SkeletonContent(_ref) {
12845
12942
  });
12846
12943
  }
12847
12944
 
12848
- var _excluded$8 = ["isLoading", "style"],
12945
+ var _excluded$6 = ["isLoading", "style"],
12849
12946
  _excluded2$1 = ["size"],
12850
12947
  _excluded3$1 = ["size"],
12851
12948
  _excluded4$1 = ["size"];
@@ -12853,7 +12950,7 @@ function Skeleton(_ref) {
12853
12950
  var _ref$isLoading = _ref.isLoading,
12854
12951
  isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
12855
12952
  style = _ref.style,
12856
- props = _objectWithoutProperties(_ref, _excluded$8);
12953
+ props = _objectWithoutProperties(_ref, _excluded$6);
12857
12954
  var _useState = useState(0),
12858
12955
  _useState2 = _slicedToArray(_useState, 2),
12859
12956
  width = _useState2[0],
@@ -13032,7 +13129,7 @@ function getShouldDisplay2x() {
13032
13129
  return currentDevicePixelRatio > 1;
13033
13130
  }
13034
13131
 
13035
- var _excluded$7 = ["width", "height", "alt", "apiToken", "mapId", "marker", "center", "onLoaded", "onError"];
13132
+ var _excluded$5 = ["width", "height", "alt", "apiToken", "mapId", "marker", "center", "onLoaded", "onError"];
13036
13133
  var mapBoxMaxPictureWidth = 1280;
13037
13134
 
13038
13135
  // Mapbox requestable width for image is between 1 - 1280px
@@ -13050,7 +13147,7 @@ function StaticMap(_ref) {
13050
13147
  center = _ref.center,
13051
13148
  onLoaded = _ref.onLoaded,
13052
13149
  onError = _ref.onError,
13053
- props = _objectWithoutProperties(_ref, _excluded$7);
13150
+ props = _objectWithoutProperties(_ref, _excluded$5);
13054
13151
  var _useState = useState(getPictureWidth(width)),
13055
13152
  _useState2 = _slicedToArray(_useState, 2),
13056
13153
  currentWidth = _useState2[0],
@@ -13233,12 +13330,12 @@ function Sticker(_ref) {
13233
13330
  });
13234
13331
  }
13235
13332
 
13236
- var _excluded$6 = ["direction", "wrap"];
13333
+ var _excluded$4 = ["direction", "wrap"];
13237
13334
  function Flex(_ref) {
13238
13335
  var direction = _ref.direction,
13239
13336
  _ref$wrap = _ref.wrap,
13240
13337
  wrap = _ref$wrap === void 0 ? 'wrap' : _ref$wrap,
13241
- props = _objectWithoutProperties(_ref, _excluded$6);
13338
+ props = _objectWithoutProperties(_ref, _excluded$4);
13242
13339
  return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({}, props), {}, {
13243
13340
  flexDirection: direction,
13244
13341
  flexWrap: wrap
@@ -13376,7 +13473,7 @@ function Story(_ref) {
13376
13473
  });
13377
13474
  }
13378
13475
 
13379
- var _excluded$5 = ["title", "children", "internalIsDemoSection"],
13476
+ var _excluded$3 = ["title", "children", "internalIsDemoSection"],
13380
13477
  _excluded2 = ["title", "children"],
13381
13478
  _excluded3 = ["title", "children"],
13382
13479
  _excluded4 = ["children"];
@@ -13384,7 +13481,7 @@ function StorySection(_ref) {
13384
13481
  var title = _ref.title,
13385
13482
  children = _ref.children,
13386
13483
  internalIsDemoSection = _ref.internalIsDemoSection,
13387
- props = _objectWithoutProperties(_ref, _excluded$5);
13484
+ props = _objectWithoutProperties(_ref, _excluded$3);
13388
13485
  if (title === 'Demo' && !internalIsDemoSection) throw new Error('Use StorySection.Demo instead');
13389
13486
  return /*#__PURE__*/jsxs(View, _objectSpread(_objectSpread({
13390
13487
  marginBottom: "kitt.8"
@@ -14433,57 +14530,6 @@ function TypographyEmoji(_ref3) {
14433
14530
  });
14434
14531
  }
14435
14532
 
14436
- var _excluded$4 = ["children"];
14437
- function TypographyLinkWebWrapper(_ref) {
14438
- var children = _ref.children;
14439
- _objectWithoutProperties(_ref, _excluded$4);
14440
- return children;
14441
- }
14442
-
14443
- var _excluded$3 = ["children", "disabled", "noUnderline", "href", "hrefAttrs", "onPress"];
14444
- var TypographyLink = /*#__PURE__*/forwardRef(function (_ref, ref) {
14445
- var children = _ref.children,
14446
- disabled = _ref.disabled,
14447
- noUnderline = _ref.noUnderline,
14448
- href = _ref.href,
14449
- hrefAttrs = _ref.hrefAttrs,
14450
- onPress = _ref.onPress,
14451
- otherProps = _objectWithoutProperties(_ref, _excluded$3);
14452
- return /*#__PURE__*/jsx(TypographyLinkWebWrapper, {
14453
- hasNoUnderline: noUnderline,
14454
- children: /*#__PURE__*/jsx(Typography, _objectSpread(_objectSpread({
14455
- ref: ref,
14456
- underline: !noUnderline,
14457
- color: disabled ? 'black-disabled' : undefined,
14458
- href: href,
14459
- hrefAttrs: hrefAttrs,
14460
- accessibilityRole: "link",
14461
- dataSet: {
14462
- // remove data-kitt-universal when we delete kitt web. See :global(a) in Link styles.module.css
14463
- 'kitt-universal': 'true'
14464
- },
14465
- _web: {
14466
- // @ts-expect-error: This is only used on web where 'not-allowed' and 'pointer' are valid cursor values
14467
- cursor: disabled ? 'not-allowed' : 'pointer',
14468
- transitionProperty: 'color',
14469
- transitionDuration: '0.2s',
14470
- transitionTimingFunction: 'ease-in-out'
14471
- }
14472
- // TODO[native-base@>=3.4.19] this currently does not work. Retest when updating native-base.
14473
- // _active={{
14474
- // underline: !!noUnderline,
14475
- // }}
14476
- // _hover={{
14477
- // underline: !!noUnderline,
14478
- // }}
14479
- ,
14480
- onPress: disabled ? undefined : onPress
14481
- }, otherProps), {}, {
14482
- children: children
14483
- }))
14484
- });
14485
- });
14486
-
14487
14533
  var ChromaticReducedMotionDecorator = makeDecorator({
14488
14534
  name: 'ChromaticReducedMotionDecorator',
14489
14535
  parameterName: 'chromaticReducedMotion',
@@ -14850,5 +14896,5 @@ function VerticalSteps(_ref) {
14850
14896
  VerticalSteps.Step = Step;
14851
14897
  VerticalSteps.BorderlessStep = BorderlessStep;
14852
14898
 
14853
- export { ActionCard, Actions, Autocomplete, Avatar, BottomSheet, Button, ButtonBadge, CardModal, Center, Checkbox, ChoicesElements, ChromaticReducedMotionDecorator, CloseIconButton, DatePicker, DialogModal, DocumentPicker, Emoji, ExternalAppLink, ExternalLink, FilePicker, FlatList, Flex, FullscreenModal, GoogleMapsApiKeyProvider, GoogleMapsAutocompleteProvider, GroupTags, HStack, Highlight, Icon, IconButton, Image, ImagePicker, InfoCard, InputAddress, InputAddressLegacy, InputEmail, InputFeedback, InputField, InputIban, InputIcon, InputNumber, InputPassword, InputPhone, InputPressable, InputTag, InputText, KittBreakpointNameEnum, KittBreakpoints, KittBreakpointsMax, KittMapConfigProvider, KittNativeBaseProvider, KittThemeDecorator, KittThemeProvider, Label, ListItem, LoaderIcon, MapMarker, MapMarkerVariantEnum, MatchWindowSize, Message, ModalBehaviour, FlatList as NativeOnlyFlatList, NavigationBottomSheet, NavigationModal, Notification, Overlay, PageLoader, Picker, Pressable, RadioWithRef as Radio, RadioButtonGroup, ScrollView, DeprecatedSection as Section, SectionList, SegmentedProgressBar, Skeleton, SpinningIcon, Stack, StaticMap, Sticker, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, SwitchBreakpoints, TabBar, Tag, TextArea, TimePicker, ToastComponent, Toggle, Tooltip, TopNavBar, Typography, TypographyEmoji, TypographyIcon, TypographyLink, VStack, VerticalSteps, View, createChoicesComponent, createResponsiveStyleFromProp, getStaticMapImageUrl, getValueForBreakpoint, hex2rgba, matchWindowSize, storyPadding, theme, useBottomSheet, useBreakpointValue, useCurrentBreakpointName, useGetStaticMapImageUrl, useKittMapConfig, useKittTheme, useMatchWindowSize, useOpenExternalLink, useStaticBottomSheet, useStoryBlockColor, useTheme };
14899
+ export { ActionCard, Actions, Autocomplete, Avatar, BottomSheet, Button, ButtonBadge, CardModal, Center, Checkbox, ChoicesElements, ChromaticReducedMotionDecorator, CloseIconButton, DatePicker, DialogModal, DocumentPicker, Emoji, ExternalAppLink, ExternalLink, FilePicker, FlatList, Flex, FullscreenModal, GoogleMapsApiKeyProvider, GoogleMapsAutocompleteProvider, GroupTags, HStack, Highlight, Icon, IconButton, Image, ImagePicker, InfoCard, InputAddress, InputAddressLegacy, InputEmail, InputFeedback, InputField, InputIban, InputIcon, InputNumber, InputPassword, InputPhone, InputPressable, InputTag, InputText, KittBreakpointNameEnum, KittBreakpoints, KittBreakpointsMax, KittMapConfigProvider, KittNativeBaseProvider, KittThemeDecorator, KittThemeProvider, Label, ListItem, LoaderIcon, MapMarker, MapMarkerVariantEnum, MatchWindowSize, Message, ModalBehaviour, FlatList as NativeOnlyFlatList, NavigationBottomSheet, NavigationModal, Notification, Overlay, PageLoader, Picker, Pressable, RadioWithRef as Radio, RadioButtonGroup, ReadMore, ScrollView, DeprecatedSection as Section, SectionList, SegmentedProgressBar, Skeleton, SpinningIcon, Stack, StaticMap, Sticker, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, SwitchBreakpoints, TabBar, Tag, TextArea, TimePicker, ToastComponent, Toggle, Tooltip, TopNavBar, Typography, TypographyEmoji, TypographyIcon, TypographyLink, VStack, VerticalSteps, View, createChoicesComponent, createResponsiveStyleFromProp, getStaticMapImageUrl, getValueForBreakpoint, hex2rgba, matchWindowSize, storyPadding, theme, useBottomSheet, useBreakpointValue, useCurrentBreakpointName, useGetStaticMapImageUrl, useKittMapConfig, useKittTheme, useMatchWindowSize, useOpenExternalLink, useStaticBottomSheet, useStoryBlockColor, useTheme };
14854
14900
  //# sourceMappingURL=index.es.js.map