@ornikar/kitt-universal 31.4.0 → 32.0.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/definitions/CardModal/CardModalAnimation/OpacityAnimation.d.ts +8 -0
  3. package/dist/definitions/CardModal/CardModalAnimation/OpacityAnimation.d.ts.map +1 -0
  4. package/dist/definitions/CardModal/CardModalAnimation/{NativeRotationAnimation.d.ts → RotationAnimation.d.ts} +3 -3
  5. package/dist/definitions/CardModal/CardModalAnimation/RotationAnimation.d.ts.map +1 -0
  6. package/dist/definitions/DialogModal/DialogModalAnimation/NativeOpacityAnimation.d.ts.map +1 -1
  7. package/dist/definitions/DialogModal/DialogModalAnimation/NativeRotationAnimation.d.ts.map +1 -1
  8. package/dist/definitions/forms/InputAddress/InputAddress.d.ts +12 -8
  9. package/dist/definitions/forms/InputAddress/InputAddress.d.ts.map +1 -1
  10. package/dist/definitions/forms/InputAddress/InputAddressLegacy.d.ts +15 -0
  11. package/dist/definitions/forms/InputAddress/InputAddressLegacy.d.ts.map +1 -0
  12. package/dist/definitions/forms/InputAddress/InputAddressOption.d.ts +5 -4
  13. package/dist/definitions/forms/InputAddress/InputAddressOption.d.ts.map +1 -1
  14. package/dist/definitions/forms/InputAddress/InputAddressOptionLegacy.d.ts +7 -0
  15. package/dist/definitions/forms/InputAddress/InputAddressOptionLegacy.d.ts.map +1 -0
  16. package/dist/definitions/index.d.ts +4 -1
  17. package/dist/definitions/index.d.ts.map +1 -1
  18. package/dist/index-metro.es.android.js +161 -78
  19. package/dist/index-metro.es.android.js.map +1 -1
  20. package/dist/index-metro.es.ios.js +161 -78
  21. package/dist/index-metro.es.ios.js.map +1 -1
  22. package/dist/index-node-22.17.cjs.js +96 -13
  23. package/dist/index-node-22.17.cjs.js.map +1 -1
  24. package/dist/index-node-22.17.cjs.web.css +0 -8
  25. package/dist/index-node-22.17.cjs.web.js +261 -104
  26. package/dist/index-node-22.17.cjs.web.js.map +1 -1
  27. package/dist/index-node-22.17.es.mjs +96 -14
  28. package/dist/index-node-22.17.es.mjs.map +1 -1
  29. package/dist/index-node-22.17.es.web.css +0 -8
  30. package/dist/index-node-22.17.es.web.mjs +261 -105
  31. package/dist/index-node-22.17.es.web.mjs.map +1 -1
  32. package/dist/index.es.js +162 -78
  33. package/dist/index.es.js.map +1 -1
  34. package/dist/index.es.web.js +283 -126
  35. package/dist/index.es.web.js.map +1 -1
  36. package/dist/styles.css +0 -8
  37. package/dist/tsbuildinfo +1 -1
  38. package/package.json +1 -1
  39. package/dist/definitions/CardModal/CardModalAnimation/NativeOpacityAnimation.d.ts +0 -8
  40. package/dist/definitions/CardModal/CardModalAnimation/NativeOpacityAnimation.d.ts.map +0 -1
  41. package/dist/definitions/CardModal/CardModalAnimation/NativeRotationAnimation.d.ts.map +0 -1
  42. package/dist/definitions/DialogModal/DialogModalAnimation/DialogModalAnimation.web.d.ts +0 -4
  43. package/dist/definitions/DialogModal/DialogModalAnimation/DialogModalAnimation.web.d.ts.map +0 -1
@@ -4360,7 +4360,7 @@ const CardModalRotationContainer = /*#__PURE__*/forwardRef((props, ref) => {
4360
4360
  });
4361
4361
  });
4362
4362
 
4363
- function NativeOpacityAnimation$2({
4363
+ function OpacityAnimation({
4364
4364
  visible,
4365
4365
  children,
4366
4366
  onExited
@@ -4402,7 +4402,7 @@ function NativeOpacityAnimation$2({
4402
4402
  });
4403
4403
  }
4404
4404
 
4405
- function NativeRotationAnimation$1({
4405
+ function RotationAnimation({
4406
4406
  visible,
4407
4407
  children,
4408
4408
  onEntered,
@@ -4499,14 +4499,14 @@ function CardModalAnimation({
4499
4499
  flexGrow: 1,
4500
4500
  justifyContent: "center",
4501
4501
  alignItems: "center",
4502
- children: [/*#__PURE__*/jsx(NativeOpacityAnimation$2, {
4502
+ children: [/*#__PURE__*/jsx(OpacityAnimation, {
4503
4503
  visible: isContentVisible,
4504
4504
  onExited: handleAnimationExited,
4505
4505
  children: /*#__PURE__*/jsx(Overlay, {
4506
4506
  onPress: onClose
4507
4507
  })
4508
4508
  }), /*#__PURE__*/jsx(CardModalRotationContainer, {
4509
- children: /*#__PURE__*/jsx(NativeRotationAnimation$1, {
4509
+ children: /*#__PURE__*/jsx(RotationAnimation, {
4510
4510
  visible: isContentVisible,
4511
4511
  onExited: handleAnimationExited,
4512
4512
  onEntered: onEntered,
@@ -5079,10 +5079,12 @@ function NativeOpacityAnimation$1({
5079
5079
  }) {
5080
5080
  const theme = useTheme();
5081
5081
  const hasRunAnimationRef = useRef(false);
5082
- function handleAnimationFinished() {
5082
+ useEffect(() => {
5083
5083
  if (visible) {
5084
5084
  hasRunAnimationRef.current = true;
5085
5085
  }
5086
+ }, [visible]);
5087
+ function handleAnimationFinished() {
5086
5088
  if (!visible && hasRunAnimationRef.current) {
5087
5089
  onExited();
5088
5090
  }
@@ -5107,7 +5109,7 @@ function NativeOpacityAnimation$1({
5107
5109
  runOnJS(handleAnimationFinished)();
5108
5110
  })
5109
5111
  };
5110
- });
5112
+ }, [theme, visible, handleAnimationFinished]);
5111
5113
  return /*#__PURE__*/jsx(Animated.View, {
5112
5114
  style: [StyleSheet.absoluteFillObject, opacityStyle],
5113
5115
  children: children
@@ -5123,10 +5125,14 @@ function NativeRotationAnimation({
5123
5125
  const theme = useTheme();
5124
5126
  const hasRunAnimationRef = useRef(false);
5125
5127
  const rotation = useSharedValue(0.8);
5128
+ useEffect(() => {
5129
+ if (visible) {
5130
+ hasRunAnimationRef.current = true;
5131
+ }
5132
+ }, [visible]);
5126
5133
  function handleAnimationFinished() {
5127
5134
  if (visible) {
5128
5135
  if (onEntered) onEntered();
5129
- hasRunAnimationRef.current = true;
5130
5136
  }
5131
5137
  if (!visible && hasRunAnimationRef.current) onExited();
5132
5138
  }
@@ -5162,7 +5168,7 @@ function NativeRotationAnimation({
5162
5168
  rotateZ: `${rotation.value}deg`
5163
5169
  }]
5164
5170
  };
5165
- });
5171
+ }, [theme, visible, rotation, handleAnimationFinished]);
5166
5172
  return /*#__PURE__*/jsx(Animated.View, {
5167
5173
  style: [animatedStyle],
5168
5174
  children: children
@@ -6968,6 +6974,82 @@ function FilePicker({
6968
6974
  });
6969
6975
  }
6970
6976
 
6977
+ function InputAddressOption({
6978
+ item,
6979
+ mainText,
6980
+ secondaryText
6981
+ }) {
6982
+ const sharedTransform = {
6983
+ style: {
6984
+ transform: 'translateY(4px)'
6985
+ }
6986
+ };
6987
+ return /*#__PURE__*/jsx(Autocomplete.Option, {
6988
+ item: item,
6989
+ testID: "kitt.InputAddressOption.item",
6990
+ children: /*#__PURE__*/jsxs(HStack, {
6991
+ space: "kitt.2",
6992
+ children: [/*#__PURE__*/jsx(View, {
6993
+ _web: sharedTransform,
6994
+ _ios: sharedTransform,
6995
+ _android: sharedTransform,
6996
+ children: /*#__PURE__*/jsx(TypographyIcon, {
6997
+ icon: /*#__PURE__*/jsx(MapPinRegularIcon, {}),
6998
+ color: "black"
6999
+ })
7000
+ }), /*#__PURE__*/jsx(View, {
7001
+ flexShrink: 1,
7002
+ children: /*#__PURE__*/jsxs(Typography.Text, {
7003
+ children: [/*#__PURE__*/jsx(Typography.Text, {
7004
+ variant: "bold",
7005
+ children: mainText
7006
+ }), secondaryText ? /*#__PURE__*/jsxs(Typography.Text, {
7007
+ color: "black-light",
7008
+ variant: "bold",
7009
+ children: [' ', secondaryText]
7010
+ }) : null]
7011
+ })
7012
+ })]
7013
+ })
7014
+ });
7015
+ }
7016
+
7017
+ function InputAddress({
7018
+ errorElement,
7019
+ initialValue,
7020
+ emptyResultsElement,
7021
+ onChange,
7022
+ items,
7023
+ isLoading,
7024
+ hasError,
7025
+ onInputChange,
7026
+ onSelectItem,
7027
+ convertInitialValue,
7028
+ renderItem,
7029
+ ...props
7030
+ }) {
7031
+ const formattedInitialValue = initialValue ? convertInitialValue(initialValue) : undefined;
7032
+ return /*#__PURE__*/jsx(Autocomplete, {
7033
+ ...props,
7034
+ initialValue: formattedInitialValue,
7035
+ right: isLoading ? /*#__PURE__*/jsx(Icon, {
7036
+ icon: /*#__PURE__*/jsx(LoaderIcon, {}),
7037
+ color: "kitt.black"
7038
+ }) : undefined,
7039
+ errorElement: hasError ? errorElement : null,
7040
+ emptyResultsElement: items.length === 0 ? emptyResultsElement : null,
7041
+ onInputChange: value => onInputChange(value),
7042
+ onChange: item => onSelectItem(item, onChange),
7043
+ children: items.map(item => {
7044
+ const itemElement = renderItem(item);
7045
+ return /*#__PURE__*/cloneElement(itemElement, {
7046
+ item
7047
+ });
7048
+ })
7049
+ });
7050
+ }
7051
+ InputAddress.Option = InputAddressOption;
7052
+
6971
7053
  const GoogleMapsApiKeyContext = /*#__PURE__*/createContext(undefined);
6972
7054
  function GoogleMapsApiKeyProvider({
6973
7055
  children,
@@ -7311,7 +7393,7 @@ function useGoogleMapsAutocomplete() {
7311
7393
  return context;
7312
7394
  }
7313
7395
 
7314
- function InputAddressOption({
7396
+ function InputAddressOptionLegacy({
7315
7397
  item
7316
7398
  }) {
7317
7399
  const sharedTransform = {
@@ -7321,7 +7403,7 @@ function InputAddressOption({
7321
7403
  };
7322
7404
  return /*#__PURE__*/jsx(Autocomplete.Option, {
7323
7405
  item: item,
7324
- testID: "kitt.InputAddressOption.item",
7406
+ testID: "kitt.InputAddressOptionLegacy.item",
7325
7407
  children: /*#__PURE__*/jsxs(HStack, {
7326
7408
  space: "kitt.2",
7327
7409
  children: [/*#__PURE__*/jsx(View, {
@@ -7382,7 +7464,7 @@ function formatInitialValueToAutocompletePrediction(address, placeId) {
7382
7464
  };
7383
7465
  }
7384
7466
 
7385
- function InputAddress({
7467
+ function InputAddressLegacy({
7386
7468
  initialValue,
7387
7469
  itemToString = defaultItemToString,
7388
7470
  errorElement,
@@ -7415,12 +7497,12 @@ function InputAddress({
7415
7497
  onChange: v => {
7416
7498
  onSelectItem(v, onChange);
7417
7499
  },
7418
- children: state.items.map(item => /*#__PURE__*/jsx(InputAddressOption, {
7500
+ children: state.items.map(item => /*#__PURE__*/jsx(InputAddressOptionLegacy, {
7419
7501
  item: item
7420
7502
  }, item.place_id))
7421
7503
  });
7422
7504
  }
7423
- InputAddress.Option = InputAddressOption;
7505
+ InputAddressLegacy.Option = InputAddressOptionLegacy;
7424
7506
 
7425
7507
  const InputEmail = /*#__PURE__*/forwardRef((props, ref) => {
7426
7508
  return /*#__PURE__*/jsx(InputText, {
@@ -14394,5 +14476,5 @@ function VerticalSteps({
14394
14476
  VerticalSteps.Step = Step;
14395
14477
  VerticalSteps.BorderlessStep = BorderlessStep;
14396
14478
 
14397
- 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, 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 };
14479
+ 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 };
14398
14480
  //# sourceMappingURL=index-node-22.17.es.mjs.map