@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.
@@ -26,6 +26,7 @@ import { parseNumber, getCountryCallingCode, isValidNumber } from 'libphonenumbe
26
26
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
27
27
  import Svg, { Circle as Circle$1 } from 'react-native-svg';
28
28
  import { useFloating, autoUpdate, offset, autoPlacement, shift, arrow } from '@floating-ui/react-dom';
29
+ import { defineMessages, FormattedMessage } from 'react-intl';
29
30
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
30
31
  import { LinearGradient } from 'expo-linear-gradient';
31
32
  import { makeDecorator } from '@storybook/addons';
@@ -12076,6 +12077,108 @@ Picker.Option = PickerOption;
12076
12077
  */
12077
12078
  Picker.UnsafeInternalItem = PickerItem;
12078
12079
 
12080
+ var styles = {"displayUnderline":"TypographyLinkWebWrapper-module_displayUnderline__KxwMp","displayUnderlineWhenHovered":"TypographyLinkWebWrapper-module_displayUnderlineWhenHovered__5V5Cl"};
12081
+
12082
+ function TypographyLinkWebWrapper(_ref) {
12083
+ var children = _ref.children,
12084
+ hasNoUnderline = _ref.hasNoUnderline;
12085
+ var className = hasNoUnderline ? "".concat(styles.displayUnderline, " ").concat(styles.displayUnderlineWhenHovered) : styles.displayUnderline;
12086
+ return /*#__PURE__*/jsx("span", {
12087
+ className: className,
12088
+ children: children
12089
+ });
12090
+ }
12091
+
12092
+ var _excluded$8 = ["children", "disabled", "noUnderline", "href", "hrefAttrs", "onPress"];
12093
+ var TypographyLink = /*#__PURE__*/forwardRef(function (_ref, ref) {
12094
+ var children = _ref.children,
12095
+ disabled = _ref.disabled,
12096
+ noUnderline = _ref.noUnderline,
12097
+ href = _ref.href,
12098
+ hrefAttrs = _ref.hrefAttrs,
12099
+ onPress = _ref.onPress,
12100
+ otherProps = _objectWithoutProperties(_ref, _excluded$8);
12101
+ return /*#__PURE__*/jsx(TypographyLinkWebWrapper, {
12102
+ hasNoUnderline: noUnderline,
12103
+ children: /*#__PURE__*/jsx(Typography, _objectSpread(_objectSpread({
12104
+ ref: ref,
12105
+ underline: !noUnderline,
12106
+ color: disabled ? 'black-disabled' : undefined,
12107
+ href: href,
12108
+ hrefAttrs: hrefAttrs,
12109
+ accessibilityRole: "link",
12110
+ dataSet: {
12111
+ // remove data-kitt-universal when we delete kitt web. See :global(a) in Link styles.module.css
12112
+ 'kitt-universal': 'true'
12113
+ },
12114
+ _web: {
12115
+ // @ts-expect-error: This is only used on web where 'not-allowed' and 'pointer' are valid cursor values
12116
+ cursor: disabled ? 'not-allowed' : 'pointer',
12117
+ transitionProperty: 'color',
12118
+ transitionDuration: '0.2s',
12119
+ transitionTimingFunction: 'ease-in-out'
12120
+ }
12121
+ // TODO[native-base@>=3.4.19] this currently does not work. Retest when updating native-base.
12122
+ // _active={{
12123
+ // underline: !!noUnderline,
12124
+ // }}
12125
+ // _hover={{
12126
+ // underline: !!noUnderline,
12127
+ // }}
12128
+ ,
12129
+ onPress: disabled ? undefined : onPress
12130
+ }, otherProps), {}, {
12131
+ children: children
12132
+ }))
12133
+ });
12134
+ });
12135
+
12136
+ var messages = defineMessages({
12137
+ seeMore: {
12138
+ id: "shared.components.ReadMore.seeMore"
12139
+ },
12140
+ seeLess: {
12141
+ id: "shared.components.ReadMore.seeLess"
12142
+ }
12143
+ });
12144
+ function ReadMore(_ref) {
12145
+ var lines = _ref.lines,
12146
+ children = _ref.children,
12147
+ _ref$textColor = _ref.textColor,
12148
+ textColor = _ref$textColor === void 0 ? 'bumper.content.base.hi' : _ref$textColor,
12149
+ _ref$noUnderline = _ref.noUnderline,
12150
+ noUnderline = _ref$noUnderline === void 0 ? false : _ref$noUnderline;
12151
+ var _useState = useState(false),
12152
+ _useState2 = _slicedToArray(_useState, 2),
12153
+ isExpanded = _useState2[0],
12154
+ setIsExpanded = _useState2[1];
12155
+ var nbOfLines = isExpanded ? undefined : lines;
12156
+ var messageProps = isExpanded ? messages.seeLess : messages.seeMore;
12157
+ return /*#__PURE__*/jsxs(Fragment, {
12158
+ children: [/*#__PURE__*/jsx(View, {
12159
+ flexShrink: 1,
12160
+ children: /*#__PURE__*/jsx(Typography.Text, {
12161
+ textAlign: "left",
12162
+ numberOfLines: nbOfLines,
12163
+ ellipsizeMode: "tail",
12164
+ children: children
12165
+ })
12166
+ }), lines ? /*#__PURE__*/jsx(View, {
12167
+ children: /*#__PURE__*/jsx(TypographyLink, {
12168
+ noUnderline: noUnderline,
12169
+ color: textColor,
12170
+ variant: "bold",
12171
+ onPress: function () {
12172
+ setIsExpanded(function (prev) {
12173
+ return !prev;
12174
+ });
12175
+ },
12176
+ children: /*#__PURE__*/jsx(FormattedMessage, _objectSpread({}, messageProps))
12177
+ })
12178
+ }) : null]
12179
+ });
12180
+ }
12181
+
12079
12182
  var SvgStripesinline = function SvgStripesinline(props) {
12080
12183
  return /*#__PURE__*/jsx("svg", _objectSpread(_objectSpread({
12081
12184
  viewBox: "0 0 453 71",
@@ -12176,7 +12279,7 @@ function SkeletonContent(_ref) {
12176
12279
  });
12177
12280
  }
12178
12281
 
12179
- var _excluded$8 = ["isLoading", "style"],
12282
+ var _excluded$7 = ["isLoading", "style"],
12180
12283
  _excluded2$1 = ["size"],
12181
12284
  _excluded3$1 = ["size"],
12182
12285
  _excluded4$1 = ["size"];
@@ -12184,7 +12287,7 @@ function Skeleton(_ref) {
12184
12287
  var _ref$isLoading = _ref.isLoading,
12185
12288
  isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
12186
12289
  style = _ref.style,
12187
- props = _objectWithoutProperties(_ref, _excluded$8);
12290
+ props = _objectWithoutProperties(_ref, _excluded$7);
12188
12291
  var _useState = useState(0),
12189
12292
  _useState2 = _slicedToArray(_useState, 2),
12190
12293
  width = _useState2[0],
@@ -12367,7 +12470,7 @@ function getShouldDisplay2x() {
12367
12470
  return window.devicePixelRatio ? window.devicePixelRatio > 1 : false;
12368
12471
  }
12369
12472
 
12370
- var _excluded$7 = ["width", "height", "alt", "apiToken", "mapId", "marker", "center", "onLoaded", "onError"];
12473
+ var _excluded$6 = ["width", "height", "alt", "apiToken", "mapId", "marker", "center", "onLoaded", "onError"];
12371
12474
  var mapBoxMaxPictureWidth = 1280;
12372
12475
 
12373
12476
  // Mapbox requestable width for image is between 1 - 1280px
@@ -12385,7 +12488,7 @@ function StaticMap(_ref) {
12385
12488
  center = _ref.center,
12386
12489
  onLoaded = _ref.onLoaded,
12387
12490
  onError = _ref.onError,
12388
- props = _objectWithoutProperties(_ref, _excluded$7);
12491
+ props = _objectWithoutProperties(_ref, _excluded$6);
12389
12492
  var _useState = useState(getPictureWidth(width)),
12390
12493
  _useState2 = _slicedToArray(_useState, 2),
12391
12494
  currentWidth = _useState2[0],
@@ -12568,12 +12671,12 @@ function Sticker(_ref) {
12568
12671
  });
12569
12672
  }
12570
12673
 
12571
- var _excluded$6 = ["direction", "wrap"];
12674
+ var _excluded$5 = ["direction", "wrap"];
12572
12675
  function Flex(_ref) {
12573
12676
  var direction = _ref.direction,
12574
12677
  _ref$wrap = _ref.wrap,
12575
12678
  wrap = _ref$wrap === void 0 ? 'wrap' : _ref$wrap,
12576
- props = _objectWithoutProperties(_ref, _excluded$6);
12679
+ props = _objectWithoutProperties(_ref, _excluded$5);
12577
12680
  return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({}, props), {}, {
12578
12681
  flexDirection: direction,
12579
12682
  flexWrap: wrap
@@ -12711,7 +12814,7 @@ function Story(_ref) {
12711
12814
  });
12712
12815
  }
12713
12816
 
12714
- var _excluded$5 = ["title", "children", "internalIsDemoSection"],
12817
+ var _excluded$4 = ["title", "children", "internalIsDemoSection"],
12715
12818
  _excluded2 = ["title", "children"],
12716
12819
  _excluded3 = ["title", "children"],
12717
12820
  _excluded4 = ["children"];
@@ -12719,7 +12822,7 @@ function StorySection(_ref) {
12719
12822
  var title = _ref.title,
12720
12823
  children = _ref.children,
12721
12824
  internalIsDemoSection = _ref.internalIsDemoSection,
12722
- props = _objectWithoutProperties(_ref, _excluded$5);
12825
+ props = _objectWithoutProperties(_ref, _excluded$4);
12723
12826
  if (title === 'Demo' && !internalIsDemoSection) throw new Error('Use StorySection.Demo instead');
12724
12827
  return /*#__PURE__*/jsxs(View, _objectSpread(_objectSpread({
12725
12828
  marginBottom: "kitt.8"
@@ -13078,7 +13181,7 @@ function Tag(_ref) {
13078
13181
  });
13079
13182
  }
13080
13183
 
13081
- var _excluded$4 = ["value", "disabled", "stretch", "placeholder", "isHoveredInternal", "isFocusedInternal", "isPressedInternal", "onChange", "onBlur", "title", "validateButtonLabel", "isDefaultVisible", "modalTestID", "pickerTestID"];
13184
+ var _excluded$3 = ["value", "disabled", "stretch", "placeholder", "isHoveredInternal", "isFocusedInternal", "isPressedInternal", "onChange", "onBlur", "title", "validateButtonLabel", "isDefaultVisible", "modalTestID", "pickerTestID"];
13082
13185
  function getCurrentInternalForcedState(_ref) {
13083
13186
  var isDisabled = _ref.isDisabled,
13084
13187
  isHoveredInternal = _ref.isHoveredInternal,
@@ -13130,7 +13233,7 @@ var TimePicker = /*#__PURE__*/forwardRef(function (_ref2, ref) {
13130
13233
  _ref2.isDefaultVisible;
13131
13234
  _ref2.modalTestID;
13132
13235
  _ref2.pickerTestID;
13133
- var props = _objectWithoutProperties(_ref2, _excluded$4);
13236
+ var props = _objectWithoutProperties(_ref2, _excluded$3);
13134
13237
  var _useState = useState(value ? getInitialInputValueFromDateValue(value) : ''),
13135
13238
  _useState2 = _slicedToArray(_useState, 2),
13136
13239
  inputValue = _useState2[0],
@@ -13704,62 +13807,6 @@ function TypographyEmoji(_ref3) {
13704
13807
  });
13705
13808
  }
13706
13809
 
13707
- var styles = {"displayUnderline":"TypographyLinkWebWrapper-module_displayUnderline__KxwMp","displayUnderlineWhenHovered":"TypographyLinkWebWrapper-module_displayUnderlineWhenHovered__5V5Cl"};
13708
-
13709
- function TypographyLinkWebWrapper(_ref) {
13710
- var children = _ref.children,
13711
- hasNoUnderline = _ref.hasNoUnderline;
13712
- var className = hasNoUnderline ? "".concat(styles.displayUnderline, " ").concat(styles.displayUnderlineWhenHovered) : styles.displayUnderline;
13713
- return /*#__PURE__*/jsx("span", {
13714
- className: className,
13715
- children: children
13716
- });
13717
- }
13718
-
13719
- var _excluded$3 = ["children", "disabled", "noUnderline", "href", "hrefAttrs", "onPress"];
13720
- var TypographyLink = /*#__PURE__*/forwardRef(function (_ref, ref) {
13721
- var children = _ref.children,
13722
- disabled = _ref.disabled,
13723
- noUnderline = _ref.noUnderline,
13724
- href = _ref.href,
13725
- hrefAttrs = _ref.hrefAttrs,
13726
- onPress = _ref.onPress,
13727
- otherProps = _objectWithoutProperties(_ref, _excluded$3);
13728
- return /*#__PURE__*/jsx(TypographyLinkWebWrapper, {
13729
- hasNoUnderline: noUnderline,
13730
- children: /*#__PURE__*/jsx(Typography, _objectSpread(_objectSpread({
13731
- ref: ref,
13732
- underline: !noUnderline,
13733
- color: disabled ? 'black-disabled' : undefined,
13734
- href: href,
13735
- hrefAttrs: hrefAttrs,
13736
- accessibilityRole: "link",
13737
- dataSet: {
13738
- // remove data-kitt-universal when we delete kitt web. See :global(a) in Link styles.module.css
13739
- 'kitt-universal': 'true'
13740
- },
13741
- _web: {
13742
- // @ts-expect-error: This is only used on web where 'not-allowed' and 'pointer' are valid cursor values
13743
- cursor: disabled ? 'not-allowed' : 'pointer',
13744
- transitionProperty: 'color',
13745
- transitionDuration: '0.2s',
13746
- transitionTimingFunction: 'ease-in-out'
13747
- }
13748
- // TODO[native-base@>=3.4.19] this currently does not work. Retest when updating native-base.
13749
- // _active={{
13750
- // underline: !!noUnderline,
13751
- // }}
13752
- // _hover={{
13753
- // underline: !!noUnderline,
13754
- // }}
13755
- ,
13756
- onPress: disabled ? undefined : onPress
13757
- }, otherProps), {}, {
13758
- children: children
13759
- }))
13760
- });
13761
- });
13762
-
13763
13810
  var ChromaticReducedMotionDecorator = makeDecorator({
13764
13811
  name: 'ChromaticReducedMotionDecorator',
13765
13812
  parameterName: 'chromaticReducedMotion',
@@ -14125,5 +14172,5 @@ function VerticalSteps(_ref) {
14125
14172
  VerticalSteps.Step = Step;
14126
14173
  VerticalSteps.BorderlessStep = BorderlessStep;
14127
14174
 
14128
- 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, 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 };
14175
+ 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, 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 };
14129
14176
  //# sourceMappingURL=index.es.web.js.map