@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
@@ -4384,7 +4384,7 @@ const CardModalRotationContainer = /*#__PURE__*/React.forwardRef((props, ref) =>
4384
4384
  });
4385
4385
  });
4386
4386
 
4387
- function NativeOpacityAnimation$2({
4387
+ function OpacityAnimation({
4388
4388
  visible,
4389
4389
  children,
4390
4390
  onExited
@@ -4426,7 +4426,7 @@ function NativeOpacityAnimation$2({
4426
4426
  });
4427
4427
  }
4428
4428
 
4429
- function NativeRotationAnimation$1({
4429
+ function RotationAnimation({
4430
4430
  visible,
4431
4431
  children,
4432
4432
  onEntered,
@@ -4523,14 +4523,14 @@ function CardModalAnimation({
4523
4523
  flexGrow: 1,
4524
4524
  justifyContent: "center",
4525
4525
  alignItems: "center",
4526
- children: [/*#__PURE__*/jsxRuntime.jsx(NativeOpacityAnimation$2, {
4526
+ children: [/*#__PURE__*/jsxRuntime.jsx(OpacityAnimation, {
4527
4527
  visible: isContentVisible,
4528
4528
  onExited: handleAnimationExited,
4529
4529
  children: /*#__PURE__*/jsxRuntime.jsx(Overlay, {
4530
4530
  onPress: onClose
4531
4531
  })
4532
4532
  }), /*#__PURE__*/jsxRuntime.jsx(CardModalRotationContainer, {
4533
- children: /*#__PURE__*/jsxRuntime.jsx(NativeRotationAnimation$1, {
4533
+ children: /*#__PURE__*/jsxRuntime.jsx(RotationAnimation, {
4534
4534
  visible: isContentVisible,
4535
4535
  onExited: handleAnimationExited,
4536
4536
  onEntered: onEntered,
@@ -5103,10 +5103,12 @@ function NativeOpacityAnimation$1({
5103
5103
  }) {
5104
5104
  const theme = useTheme();
5105
5105
  const hasRunAnimationRef = React.useRef(false);
5106
- function handleAnimationFinished() {
5106
+ React.useEffect(() => {
5107
5107
  if (visible) {
5108
5108
  hasRunAnimationRef.current = true;
5109
5109
  }
5110
+ }, [visible]);
5111
+ function handleAnimationFinished() {
5110
5112
  if (!visible && hasRunAnimationRef.current) {
5111
5113
  onExited();
5112
5114
  }
@@ -5131,7 +5133,7 @@ function NativeOpacityAnimation$1({
5131
5133
  Animated.runOnJS(handleAnimationFinished)();
5132
5134
  })
5133
5135
  };
5134
- });
5136
+ }, [theme, visible, handleAnimationFinished]);
5135
5137
  return /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
5136
5138
  style: [reactNative.StyleSheet.absoluteFillObject, opacityStyle],
5137
5139
  children: children
@@ -5147,10 +5149,14 @@ function NativeRotationAnimation({
5147
5149
  const theme = useTheme();
5148
5150
  const hasRunAnimationRef = React.useRef(false);
5149
5151
  const rotation = Animated.useSharedValue(0.8);
5152
+ React.useEffect(() => {
5153
+ if (visible) {
5154
+ hasRunAnimationRef.current = true;
5155
+ }
5156
+ }, [visible]);
5150
5157
  function handleAnimationFinished() {
5151
5158
  if (visible) {
5152
5159
  if (onEntered) onEntered();
5153
- hasRunAnimationRef.current = true;
5154
5160
  }
5155
5161
  if (!visible && hasRunAnimationRef.current) onExited();
5156
5162
  }
@@ -5186,7 +5192,7 @@ function NativeRotationAnimation({
5186
5192
  rotateZ: `${rotation.value}deg`
5187
5193
  }]
5188
5194
  };
5189
- });
5195
+ }, [theme, visible, rotation, handleAnimationFinished]);
5190
5196
  return /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
5191
5197
  style: [animatedStyle],
5192
5198
  children: children
@@ -6992,6 +6998,82 @@ function FilePicker({
6992
6998
  });
6993
6999
  }
6994
7000
 
7001
+ function InputAddressOption({
7002
+ item,
7003
+ mainText,
7004
+ secondaryText
7005
+ }) {
7006
+ const sharedTransform = {
7007
+ style: {
7008
+ transform: 'translateY(4px)'
7009
+ }
7010
+ };
7011
+ return /*#__PURE__*/jsxRuntime.jsx(Autocomplete.Option, {
7012
+ item: item,
7013
+ testID: "kitt.InputAddressOption.item",
7014
+ children: /*#__PURE__*/jsxRuntime.jsxs(HStack, {
7015
+ space: "kitt.2",
7016
+ children: [/*#__PURE__*/jsxRuntime.jsx(View, {
7017
+ _web: sharedTransform,
7018
+ _ios: sharedTransform,
7019
+ _android: sharedTransform,
7020
+ children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
7021
+ icon: /*#__PURE__*/jsxRuntime.jsx(phosphor.MapPinRegularIcon, {}),
7022
+ color: "black"
7023
+ })
7024
+ }), /*#__PURE__*/jsxRuntime.jsx(View, {
7025
+ flexShrink: 1,
7026
+ children: /*#__PURE__*/jsxRuntime.jsxs(Typography.Text, {
7027
+ children: [/*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
7028
+ variant: "bold",
7029
+ children: mainText
7030
+ }), secondaryText ? /*#__PURE__*/jsxRuntime.jsxs(Typography.Text, {
7031
+ color: "black-light",
7032
+ variant: "bold",
7033
+ children: [' ', secondaryText]
7034
+ }) : null]
7035
+ })
7036
+ })]
7037
+ })
7038
+ });
7039
+ }
7040
+
7041
+ function InputAddress({
7042
+ errorElement,
7043
+ initialValue,
7044
+ emptyResultsElement,
7045
+ onChange,
7046
+ items,
7047
+ isLoading,
7048
+ hasError,
7049
+ onInputChange,
7050
+ onSelectItem,
7051
+ convertInitialValue,
7052
+ renderItem,
7053
+ ...props
7054
+ }) {
7055
+ const formattedInitialValue = initialValue ? convertInitialValue(initialValue) : undefined;
7056
+ return /*#__PURE__*/jsxRuntime.jsx(Autocomplete, {
7057
+ ...props,
7058
+ initialValue: formattedInitialValue,
7059
+ right: isLoading ? /*#__PURE__*/jsxRuntime.jsx(Icon, {
7060
+ icon: /*#__PURE__*/jsxRuntime.jsx(LoaderIcon, {}),
7061
+ color: "kitt.black"
7062
+ }) : undefined,
7063
+ errorElement: hasError ? errorElement : null,
7064
+ emptyResultsElement: items.length === 0 ? emptyResultsElement : null,
7065
+ onInputChange: value => onInputChange(value),
7066
+ onChange: item => onSelectItem(item, onChange),
7067
+ children: items.map(item => {
7068
+ const itemElement = renderItem(item);
7069
+ return /*#__PURE__*/React.cloneElement(itemElement, {
7070
+ item
7071
+ });
7072
+ })
7073
+ });
7074
+ }
7075
+ InputAddress.Option = InputAddressOption;
7076
+
6995
7077
  const GoogleMapsApiKeyContext = /*#__PURE__*/React.createContext(undefined);
6996
7078
  function GoogleMapsApiKeyProvider({
6997
7079
  children,
@@ -7335,7 +7417,7 @@ function useGoogleMapsAutocomplete() {
7335
7417
  return context;
7336
7418
  }
7337
7419
 
7338
- function InputAddressOption({
7420
+ function InputAddressOptionLegacy({
7339
7421
  item
7340
7422
  }) {
7341
7423
  const sharedTransform = {
@@ -7345,7 +7427,7 @@ function InputAddressOption({
7345
7427
  };
7346
7428
  return /*#__PURE__*/jsxRuntime.jsx(Autocomplete.Option, {
7347
7429
  item: item,
7348
- testID: "kitt.InputAddressOption.item",
7430
+ testID: "kitt.InputAddressOptionLegacy.item",
7349
7431
  children: /*#__PURE__*/jsxRuntime.jsxs(HStack, {
7350
7432
  space: "kitt.2",
7351
7433
  children: [/*#__PURE__*/jsxRuntime.jsx(View, {
@@ -7406,7 +7488,7 @@ function formatInitialValueToAutocompletePrediction(address, placeId) {
7406
7488
  };
7407
7489
  }
7408
7490
 
7409
- function InputAddress({
7491
+ function InputAddressLegacy({
7410
7492
  initialValue,
7411
7493
  itemToString = defaultItemToString,
7412
7494
  errorElement,
@@ -7439,12 +7521,12 @@ function InputAddress({
7439
7521
  onChange: v => {
7440
7522
  onSelectItem(v, onChange);
7441
7523
  },
7442
- children: state.items.map(item => /*#__PURE__*/jsxRuntime.jsx(InputAddressOption, {
7524
+ children: state.items.map(item => /*#__PURE__*/jsxRuntime.jsx(InputAddressOptionLegacy, {
7443
7525
  item: item
7444
7526
  }, item.place_id))
7445
7527
  });
7446
7528
  }
7447
- InputAddress.Option = InputAddressOption;
7529
+ InputAddressLegacy.Option = InputAddressOptionLegacy;
7448
7530
 
7449
7531
  const InputEmail = /*#__PURE__*/React.forwardRef((props, ref) => {
7450
7532
  return /*#__PURE__*/jsxRuntime.jsx(InputText, {
@@ -14458,6 +14540,7 @@ exports.Image = Image;
14458
14540
  exports.ImagePicker = ImagePicker;
14459
14541
  exports.InfoCard = InfoCard;
14460
14542
  exports.InputAddress = InputAddress;
14543
+ exports.InputAddressLegacy = InputAddressLegacy;
14461
14544
  exports.InputEmail = InputEmail;
14462
14545
  exports.InputFeedback = InputFeedback;
14463
14546
  exports.InputField = InputField;