@ornikar/kitt-universal 31.3.2-canary.1a5b65d2fbfa0e00bf6c237b7d017b61dce7e75b.0 → 31.3.2-canary.a176fae6a745e6f1b650fe56c3dca27af6b8816f.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
@@ -7110,15 +7110,13 @@ function FilePicker(_ref) {
7110
7110
 
7111
7111
  function InputAddressOption(_ref) {
7112
7112
  var item = _ref.item,
7113
- itemToMainText = _ref.itemToMainText,
7114
- itemToSecondaryText = _ref.itemToSecondaryText;
7113
+ mainText = _ref.mainText,
7114
+ secondaryText = _ref.secondaryText;
7115
7115
  var sharedTransform = {
7116
7116
  style: {
7117
7117
  transform: 'translateY(4px)'
7118
7118
  }
7119
7119
  };
7120
- var mainText = itemToMainText(item);
7121
- var secondaryText = itemToSecondaryText(item);
7122
7120
  return /*#__PURE__*/jsx(Autocomplete.Option, {
7123
7121
  item: item,
7124
7122
  testID: "kitt.InputAddressOption.item",
@@ -7149,44 +7147,7 @@ function InputAddressOption(_ref) {
7149
7147
  });
7150
7148
  }
7151
7149
 
7152
- function InputAddressOptionLegacy(_ref) {
7153
- var item = _ref.item;
7154
- var sharedTransform = {
7155
- style: {
7156
- transform: 'translateY(4px)'
7157
- }
7158
- };
7159
- return /*#__PURE__*/jsx(Autocomplete.Option, {
7160
- item: item,
7161
- testID: "kitt.InputAddressOptionLegacy.item",
7162
- children: /*#__PURE__*/jsxs(HStack, {
7163
- space: "kitt.2",
7164
- children: [/*#__PURE__*/jsx(View, {
7165
- _web: sharedTransform,
7166
- _ios: sharedTransform,
7167
- _android: sharedTransform,
7168
- children: /*#__PURE__*/jsx(TypographyIcon, {
7169
- icon: /*#__PURE__*/jsx(MapPinRegularIcon, {}),
7170
- color: "black"
7171
- })
7172
- }), /*#__PURE__*/jsx(View, {
7173
- flexShrink: 1,
7174
- children: /*#__PURE__*/jsxs(Typography.Text, {
7175
- children: [/*#__PURE__*/jsx(Typography.Text, {
7176
- variant: "bold",
7177
- children: item.structured_formatting.main_text
7178
- }), item.structured_formatting.secondary_text ? /*#__PURE__*/jsxs(Typography.Text, {
7179
- color: "black-light",
7180
- variant: "bold",
7181
- children: [' ', item.structured_formatting.secondary_text]
7182
- }) : null]
7183
- })
7184
- })]
7185
- })
7186
- });
7187
- }
7188
-
7189
- var _excluded$n = ["errorElement", "initialValue", "emptyResultsElement", "onChange", "items", "isLoading", "hasError", "onInputChange", "onSelectItem", "convertInitialValue", "itemToMainText", "itemToSecondaryText", "itemToKey"];
7150
+ var _excluded$n = ["errorElement", "initialValue", "emptyResultsElement", "onChange", "items", "isLoading", "hasError", "onInputChange", "onSelectItem", "convertInitialValue", "children"];
7190
7151
  function InputAddress(_ref) {
7191
7152
  var errorElement = _ref.errorElement,
7192
7153
  initialValue = _ref.initialValue,
@@ -7198,9 +7159,7 @@ function InputAddress(_ref) {
7198
7159
  _onInputChange = _ref.onInputChange,
7199
7160
  onSelectItem = _ref.onSelectItem,
7200
7161
  convertInitialValue = _ref.convertInitialValue,
7201
- itemToMainText = _ref.itemToMainText,
7202
- itemToSecondaryText = _ref.itemToSecondaryText,
7203
- itemToKey = _ref.itemToKey,
7162
+ children = _ref.children,
7204
7163
  props = _objectWithoutProperties(_ref, _excluded$n);
7205
7164
  var formattedInitialValue = initialValue ? convertInitialValue(initialValue) : undefined;
7206
7165
  return /*#__PURE__*/jsx(Autocomplete, _objectSpread(_objectSpread({}, props), {}, {
@@ -7218,15 +7177,15 @@ function InputAddress(_ref) {
7218
7177
  return onSelectItem(item, _onChange);
7219
7178
  },
7220
7179
  children: items.map(function (item) {
7221
- return /*#__PURE__*/jsx(InputAddressOption, {
7222
- item: item,
7223
- itemToMainText: itemToMainText,
7224
- itemToSecondaryText: itemToSecondaryText
7225
- }, itemToKey(item));
7180
+ var child = children(item);
7181
+ return /*#__PURE__*/cloneElement(child, {
7182
+ key: child.key,
7183
+ item: item
7184
+ });
7226
7185
  })
7227
7186
  }));
7228
7187
  }
7229
- InputAddress.Option = InputAddressOptionLegacy;
7188
+ InputAddress.Option = InputAddressOption;
7230
7189
 
7231
7190
  var GoogleMapsApiKeyContext = /*#__PURE__*/createContext(undefined);
7232
7191
  function GoogleMapsApiKeyProvider(_ref) {
@@ -7681,6 +7640,43 @@ function useGoogleMapsAutocomplete() {
7681
7640
  return context;
7682
7641
  }
7683
7642
 
7643
+ function InputAddressOptionLegacy(_ref) {
7644
+ var item = _ref.item;
7645
+ var sharedTransform = {
7646
+ style: {
7647
+ transform: 'translateY(4px)'
7648
+ }
7649
+ };
7650
+ return /*#__PURE__*/jsx(Autocomplete.Option, {
7651
+ item: item,
7652
+ testID: "kitt.InputAddressOptionLegacy.item",
7653
+ children: /*#__PURE__*/jsxs(HStack, {
7654
+ space: "kitt.2",
7655
+ children: [/*#__PURE__*/jsx(View, {
7656
+ _web: sharedTransform,
7657
+ _ios: sharedTransform,
7658
+ _android: sharedTransform,
7659
+ children: /*#__PURE__*/jsx(TypographyIcon, {
7660
+ icon: /*#__PURE__*/jsx(MapPinRegularIcon, {}),
7661
+ color: "black"
7662
+ })
7663
+ }), /*#__PURE__*/jsx(View, {
7664
+ flexShrink: 1,
7665
+ children: /*#__PURE__*/jsxs(Typography.Text, {
7666
+ children: [/*#__PURE__*/jsx(Typography.Text, {
7667
+ variant: "bold",
7668
+ children: item.structured_formatting.main_text
7669
+ }), item.structured_formatting.secondary_text ? /*#__PURE__*/jsxs(Typography.Text, {
7670
+ color: "black-light",
7671
+ variant: "bold",
7672
+ children: [' ', item.structured_formatting.secondary_text]
7673
+ }) : null]
7674
+ })
7675
+ })]
7676
+ })
7677
+ });
7678
+ }
7679
+
7684
7680
  function defaultItemToString(item) {
7685
7681
  if (!item) return '';
7686
7682
  return item.description;