@spothero/ui 13.9.0 → 13.10.0-beta.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 (31) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/CHANGELOG.tmp +8 -2
  3. package/backlog/GooglePlacesSearchInput/GooglePlacesSearchInput.js +6 -2
  4. package/package.json +1 -1
  5. package/styles/GooglePlacesSearchInput/GooglePlacesSearchInput.jsx +27 -1
  6. package/v1/index-bundled-cjs/index.js +1 -1
  7. package/v1/index-bundled-cjs/index.js.map +1 -1
  8. package/v1/index-bundled-esm/index.js +1 -1
  9. package/v1/index-bundled-esm/index.js.map +1 -1
  10. package/v1/index-unbundled-cjs/index.js +35 -35
  11. package/v1/index-unbundled-esm/index.js +35 -35
  12. package/v2/index-bundled-cjs/{ImageCarousel-c8dddbb1.js → ImageCarousel-e8e079e8.js} +2 -2
  13. package/v2/index-bundled-cjs/{ImageCarousel-c8dddbb1.js.map → ImageCarousel-e8e079e8.js.map} +1 -1
  14. package/v2/index-bundled-cjs/{index-7c73c07d.js → index-e7e488ba.js} +4 -4
  15. package/v2/index-bundled-cjs/{index-7c73c07d.js.map → index-e7e488ba.js.map} +1 -1
  16. package/v2/index-bundled-cjs/index.js +1 -1
  17. package/v2/index-bundled-esm/{ImageCarousel-dc224d64.js → ImageCarousel-64780662.js} +2 -2
  18. package/v2/index-bundled-esm/{ImageCarousel-dc224d64.js.map → ImageCarousel-64780662.js.map} +1 -1
  19. package/v2/index-bundled-esm/{index-7ef77e69.js → index-0fa0fa5c.js} +4 -4
  20. package/v2/index-bundled-esm/{index-7ef77e69.js.map → index-0fa0fa5c.js.map} +1 -1
  21. package/v2/index-bundled-esm/index.js +1 -1
  22. package/v2/index-unbundled-cjs/{ImageCarousel-325df0c4.js → ImageCarousel-bc41393b.js} +4 -4
  23. package/v2/index-unbundled-cjs/{ImageCarousel-325df0c4.js.map → ImageCarousel-bc41393b.js.map} +1 -1
  24. package/v2/index-unbundled-cjs/{index-093f8806.js → index-beb87ca2.js} +148 -148
  25. package/v2/index-unbundled-cjs/{index-093f8806.js.map → index-beb87ca2.js.map} +1 -1
  26. package/v2/index-unbundled-cjs/index.js +1 -1
  27. package/v2/index-unbundled-esm/{ImageCarousel-653f3259.js → ImageCarousel-d3597a8c.js} +4 -4
  28. package/v2/index-unbundled-esm/{ImageCarousel-653f3259.js.map → ImageCarousel-d3597a8c.js.map} +1 -1
  29. package/v2/index-unbundled-esm/{index-1c95808d.js → index-0ea45e07.js} +148 -148
  30. package/v2/index-unbundled-esm/{index-1c95808d.js.map → index-0ea45e07.js.map} +1 -1
  31. package/v2/index-unbundled-esm/index.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ # 13.10.0-beta.0 - 02/22/2022
2
+ ## Miscellaneous Updates
3
+
4
+ ## New Features
5
+ * [[4193a26](https://github.com/spothero/fe-ui/commit/4193a26)] - Updated Autocomplete to accept biasing options (Nathan)
6
+
7
+ ## Miscellaneous Updates
8
+ * [[3a93a18](https://github.com/spothero/fe-ui/commit/3a93a18)] - 13.9.0-beta.0 (sh-devtools-bot)
9
+ * [[e6ab74b](https://github.com/spothero/fe-ui/commit/e6ab74b)] - `chore:` Updated location options (Nathan)
10
+ * [[19f8451](https://github.com/spothero/fe-ui/commit/19f8451)] - `chore:` Updated PropTypes for geolocation biasing (Nathan)
11
+
1
12
  # 13.9.0 - 02/17/2022
2
13
 
3
14
  ## New Features
package/CHANGELOG.tmp CHANGED
@@ -1,5 +1,11 @@
1
- # 13.9.0 - 02/17/2022
1
+ # 13.10.0-beta.0 - 02/22/2022
2
+ ## Miscellaneous Updates
2
3
 
3
4
  ## New Features
4
- * [[5229309](https://github.com/spothero/fe-ui/commit/5229309)] - Adds Popover component ([#270](https://github.com/spothero/fe-ui/pull/270)) (Tyler Williams)
5
+ * [[4193a26](https://github.com/spothero/fe-ui/commit/4193a26)] - Updated Autocomplete to accept biasing options (Nathan)
6
+
7
+ ## Miscellaneous Updates
8
+ * [[3a93a18](https://github.com/spothero/fe-ui/commit/3a93a18)] - 13.9.0-beta.0 (sh-devtools-bot)
9
+ * [[e6ab74b](https://github.com/spothero/fe-ui/commit/e6ab74b)] - `chore:` Updated location options (Nathan)
10
+ * [[19f8451](https://github.com/spothero/fe-ui/commit/19f8451)] - `chore:` Updated PropTypes for geolocation biasing (Nathan)
5
11
 
@@ -148,10 +148,11 @@ var GooglePlacesSearchInput = /*#__PURE__*/function (_Component) {
148
148
  var _this$props = _this.props,
149
149
  country = _this$props.country,
150
150
  types = _this$props.types,
151
- bounds = _this$props.bounds;
151
+ bounds = _this$props.bounds,
152
+ biasOptions = _this$props.biasOptions;
152
153
  var autocompleteSessionToken = _this.state.autocompleteSessionToken;
153
154
 
154
- var options = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
155
+ var options = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
155
156
  input: value
156
157
  }, bounds && {
157
158
  bounds: bounds
@@ -161,6 +162,9 @@ var GooglePlacesSearchInput = /*#__PURE__*/function (_Component) {
161
162
  }
162
163
  }), types && {
163
164
  types: types
165
+ }), (biasOptions === null || biasOptions === void 0 ? void 0 : biasOptions.location) && {
166
+ location: new _this._gmaps.LatLng(location.latitude, location.longitude),
167
+ radius: biasOptions === null || biasOptions === void 0 ? void 0 : biasOptions.radius
164
168
  }), {}, {
165
169
  sessionToken: autocompleteSessionToken
166
170
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spothero/ui",
3
- "version": "13.9.0",
3
+ "version": "13.10.0-beta.0",
4
4
  "description": "SpotHero's React component UI library.",
5
5
  "main": "v2/index-bundled-cjs/index.js",
6
6
  "module": "v2/index.js",
@@ -27,6 +27,25 @@ export default class GooglePlacesSearchInput extends Component {
27
27
  googleMaps: PropTypes.object,
28
28
  /** A custom element (typically a PoweredByGoogle component) to display at the bottom of the suggestion list. */
29
29
  poweredByGoogleFooter: PropTypes.element.isRequired,
30
+ /** An object containing the bias options */
31
+ biasOptions: PropTypes.shape({
32
+ /** The location (lat and long), to bias the search results around.
33
+ * * @see https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service#AutocompletionRequest.location
34
+ */
35
+ location: PropTypes.shape({
36
+ latitude: PropTypes.number,
37
+ longitude: PropTypes.number,
38
+ }),
39
+ /** The radius, in meters, to bias the search results within - required when providing a location for biasing */
40
+ radius: (props, propName) =>
41
+ props.biasOptions.location.latitude &&
42
+ props.biasOptions.location.longitude &&
43
+ (Boolean(props[propName]) === false ||
44
+ typeof props[propName] !== 'number') &&
45
+ new Error(
46
+ 'A radius value is required when biasing autocomplete suggestions'
47
+ ),
48
+ }),
30
49
  };
31
50
  static defaultProps = {
32
51
  placeholder: 'Search Address or Venue',
@@ -114,7 +133,7 @@ export default class GooglePlacesSearchInput extends Component {
114
133
  };
115
134
 
116
135
  _searchSuggestions = value => {
117
- const {country, types, bounds} = this.props;
136
+ const {country, types, bounds, biasOptions} = this.props;
118
137
  const {autocompleteSessionToken} = this.state;
119
138
 
120
139
  const options = {
@@ -126,6 +145,13 @@ export default class GooglePlacesSearchInput extends Component {
126
145
  },
127
146
  }),
128
147
  ...(types && {types}),
148
+ ...(biasOptions?.location && {
149
+ location: new this._gmaps.LatLng(
150
+ location.latitude,
151
+ location.longitude
152
+ ),
153
+ radius: biasOptions?.radius,
154
+ }),
129
155
  sessionToken: autocompleteSessionToken,
130
156
  };
131
157