@coras-io/embed 0.8.2 → 0.8.3

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 (52) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/components/basket/basket.styles.js +2 -2
  3. package/dist/components/seated-selector/seated-selector.component.js +2 -3
  4. package/dist/components/seats-io/seats-io.component.js +0 -5
  5. package/dist/containers/navbar/navbar.component.js +3 -5
  6. package/dist/locales/ar-SA.d.ts +1 -0
  7. package/dist/locales/ar-SA.js +2 -1
  8. package/dist/locales/da-DK.d.ts +1 -0
  9. package/dist/locales/da-DK.js +1 -0
  10. package/dist/locales/de-DE.d.ts +1 -0
  11. package/dist/locales/de-DE.js +1 -0
  12. package/dist/locales/en-IE.d.ts +1 -0
  13. package/dist/locales/en-IE.js +1 -0
  14. package/dist/locales/en-US.d.ts +1 -0
  15. package/dist/locales/en-US.js +1 -0
  16. package/dist/locales/es-ES.d.ts +1 -0
  17. package/dist/locales/es-ES.js +1 -0
  18. package/dist/locales/fr-FR.d.ts +1 -0
  19. package/dist/locales/fr-FR.js +1 -0
  20. package/dist/locales/fr-MA.d.ts +1 -0
  21. package/dist/locales/fr-MA.js +1 -0
  22. package/dist/locales/is-IS.d.ts +1 -0
  23. package/dist/locales/is-IS.js +1 -0
  24. package/dist/locales/it-IT.d.ts +1 -0
  25. package/dist/locales/it-IT.js +1 -0
  26. package/dist/locales/ms-MY.d.ts +1 -0
  27. package/dist/locales/ms-MY.js +1 -0
  28. package/dist/locales/nb-NO.d.ts +1 -0
  29. package/dist/locales/nb-NO.js +1 -0
  30. package/dist/locales/pl-PL.d.ts +1 -0
  31. package/dist/locales/pl-PL.js +1 -0
  32. package/dist/locales/pt-PT.d.ts +1 -0
  33. package/dist/locales/pt-PT.js +1 -0
  34. package/dist/locales/sv-SE.d.ts +1 -0
  35. package/dist/locales/sv-SE.js +1 -0
  36. package/dist/locales/th-TH.d.ts +1 -0
  37. package/dist/locales/th-TH.js +1 -0
  38. package/dist/locales/tr-TR.d.ts +1 -0
  39. package/dist/locales/tr-TR.js +1 -0
  40. package/dist/locales/zh-CN.d.ts +1 -0
  41. package/dist/locales/zh-CN.js +1 -0
  42. package/dist/locales/zh-HK.d.ts +1 -0
  43. package/dist/locales/zh-HK.js +1 -0
  44. package/dist/mixins/location-search/location-search.js +58 -21
  45. package/dist/mixins/location-search/location-search.styles.js +11 -7
  46. package/dist/mixins/search-mixin/search-mixin.js +2 -2
  47. package/dist/views/landing-page/landing-page.component.d.ts +3 -0
  48. package/dist/views/landing-page/landing-page.component.js +56 -10
  49. package/dist/views/payment-page/partials/stripe/stripe.types.d.ts +1 -0
  50. package/dist/views/payment-page/partials/stripe/stripe.utils.js +5 -0
  51. package/dist/views/search-page/search-page.component.js +1 -0
  52. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @coras-io/embed
2
2
 
3
+ ## 0.8.3
4
+
5
+ ### Patch Changes
6
+
7
+ - e280124: Use the preferred Arabic wording for the search events placeholder
8
+ - fc4408c: Give the basket dropdown a stronger drop shadow so it stands out from the page
9
+ - 9c4eb79: Show only the categories available in the selected city or country in the landing page filters
10
+ - 9499d58: Show the search icon on the location field at the standard icon size
11
+ - b6cfe00: Show each search result card's category tag from the attraction's main category, instead of labelling every result as Activity
12
+ - 90a5e06: Search locations and events from the first letter, show recently viewed locations in the location search, and use a search icon on the location field
13
+ - b09b5a4: Stop the seat map holding seats in seats.io on selection, so seats reserved through the embed are held and marked as sold in seats.io correctly
14
+ - 40a61c0: Keep the card number, expiry and CVC fields on the field colours when the browser autofills them, instead of showing its yellow autofill background
15
+
3
16
  ## 0.8.2
4
17
 
5
18
  ### Patch Changes
@@ -12,7 +12,7 @@ export default css `
12
12
  );
13
13
  --basket-items-background-color: var(--coras-color-menu);
14
14
  --basket-items-border-color: var(--coras-color-menu-border);
15
- --basket-items-shadow: var(--coras-shadow-md);
15
+ --basket-items-shadow: var(--coras-shadow-strong);
16
16
  --basket-items-border-radius: var(--coras-radius-sm);
17
17
 
18
18
  --basket-accent-color: var(
@@ -60,7 +60,7 @@ export default css `
60
60
  width: 25.875rem;
61
61
  background-color: var(--basket-items-background-color);
62
62
  border-radius: var(--basket-items-border-radius);
63
- box-shadow: 0px 4px 4px 0px color-mix(in srgb, black, transparent 90%);
63
+ box-shadow: var(--basket-items-shadow);
64
64
  border: 1px solid var(--basket-items-border-color);
65
65
  box-sizing: border-box;
66
66
  display: flex;
@@ -108,9 +108,8 @@ let CorasSeatedSelector = class CorasSeatedSelector extends LitElement {
108
108
  };
109
109
  this.handleObjectSelected = (event) => {
110
110
  const { label } = event.detail;
111
- // Ignore any seat the current availability data doesn't know about (e.g. one
112
- // a stale seats.io session restored after it was already booked), otherwise
113
- // it enters the selection priced at 0 and the reservation fails.
111
+ // Ignore any seat the current availability data doesn't know about,
112
+ // otherwise it enters the selection priced at 0 and the reservation fails.
114
113
  if (this.chartData && !(label in this.chartData.availableSeats)) {
115
114
  return;
116
115
  }
@@ -114,11 +114,6 @@ export class CorasSeatsIO extends LitElement {
114
114
  ? { maxSelectedObjects: this.maxSelectedObjects }
115
115
  : {}),
116
116
  selectionValidators: [{ type: "noOrphanSeats" }],
117
- // Start a fresh hold session on every mount. "continue" restores the
118
- // previous browser session, so reopening the map after a reservation
119
- // re-selected seats that are no longer available - selecting them at
120
- // price 0 and breaking "Add to basket".
121
- session: "start",
122
117
  };
123
118
  return config;
124
119
  }
@@ -178,8 +178,7 @@ let CorasNavBar = class CorasNavBar extends SearchMixin(LitElement) {
178
178
  this.isSearchDropdownOpen = true;
179
179
  const recentlySelectedSearches = getRecentlySelectedSearches();
180
180
  if (recentlySelectedSearches.length === 0) {
181
- if ((this.searchValue && this.searchValue.length >= 3) ||
182
- !this.searchTask.value) {
181
+ if (this.searchValue || !this.searchTask.value) {
183
182
  void this.searchTask.run();
184
183
  }
185
184
  }
@@ -227,8 +226,7 @@ let CorasNavBar = class CorasNavBar extends SearchMixin(LitElement) {
227
226
  this.isSearchDropdownOpen = true;
228
227
  const recentlySelectedSearches = getRecentlySelectedSearches();
229
228
  if (recentlySelectedSearches.length === 0) {
230
- if ((this.searchValue && this.searchValue.length >= 3) ||
231
- !this.searchTask.value) {
229
+ if (this.searchValue || !this.searchTask.value) {
232
230
  void this.searchTask.run();
233
231
  }
234
232
  }
@@ -454,7 +452,7 @@ let CorasNavBar = class CorasNavBar extends SearchMixin(LitElement) {
454
452
  `;
455
453
  }
456
454
  renderSearchItems() {
457
- if (!this.searchValue || this.searchValue.length < 3) {
455
+ if (!this.searchValue) {
458
456
  return this.renderRecentlySearchedItems();
459
457
  }
460
458
  return this.searchTask.render({
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -255,7 +255,7 @@ export const templates = {
255
255
  'sf61433571f3a443b': `جارٍ تأكيد الدفع...`,
256
256
  'sf89196d28dfa8629': `عذرا، طلبك لم ينجح`,
257
257
  'sfa28319e707cf5d5': `تفاصيل الطلب`,
258
- 'sfd25dcb1e3a468be': `البحث عن الأحداث`,
258
+ 'sfd25dcb1e3a468be': `البحث عن الفعاليات`,
259
259
  'sffdadf0a576fd802': `ارتفاع`,
260
260
  's8ffdc67bd6500a2f': `Near me`,
261
261
  'sb4f1dffbb6be6302': `Clear`,
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -258,6 +258,7 @@ export declare const templates: {
258
258
  s7d628682e66e0d3a: string;
259
259
  s6d8c02aee480af7a: string;
260
260
  sc50d09edf9325339: string;
261
+ s9cce1c089a4d104c: string;
261
262
  s52ac41b0b9dd0a9f: string;
262
263
  sf3ff78cc329d3528: string;
263
264
  s0fbf6dc6a1966408: string;
@@ -264,6 +264,7 @@ export const templates = {
264
264
  's7d628682e66e0d3a': `Search icon`,
265
265
  's6d8c02aee480af7a': `Menu`,
266
266
  'sc50d09edf9325339': `Dialog`,
267
+ 's9cce1c089a4d104c': `Suggested`,
267
268
  's52ac41b0b9dd0a9f': `We could not use your location. Search for a place instead.`,
268
269
  'sf3ff78cc329d3528': `Previous`,
269
270
  's0fbf6dc6a1966408': `Next`,
@@ -19,6 +19,8 @@ import "../../components/input-field/input-field.js";
19
19
  import { apiGet } from "../../core/api/queries.js";
20
20
  import { APIError } from "../../core/api/api-error.js";
21
21
  import { getApiLanguageCode } from "../../core/utils/locale.js";
22
+ import { getRecentlySelectedSearches } from "../../containers/navbar/navbar.utils.js";
23
+ const RECENT_LOCATIONS_LIMIT = 5;
22
24
  export const LocationSearchMixin = (superClass) => {
23
25
  class LocationSearchMixinElement extends superClass {
24
26
  constructor() {
@@ -53,7 +55,7 @@ export const LocationSearchMixin = (superClass) => {
53
55
  results: [],
54
56
  };
55
57
  }
56
- if (!isDropdownOpen && (!query || query.length < 3)) {
58
+ if (!isDropdownOpen && !query) {
57
59
  return null;
58
60
  }
59
61
  const language_code = getApiLanguageCode(locale);
@@ -87,11 +89,7 @@ export const LocationSearchMixin = (superClass) => {
87
89
  this.isLocationsDropdownOpen,
88
90
  ],
89
91
  });
90
- this.throttledLocationSearch = debounce({ delay: 500 }, (event) => {
91
- if (event.detail.value.length > 1) {
92
- this.handleLocationSearch(event);
93
- }
94
- });
92
+ this.throttledLocationSearch = debounce({ delay: 200 }, (event) => this.handleLocationSearch(event));
95
93
  this.handleLocationSearch = (event) => {
96
94
  this.locationSearchTerm = event.detail.value;
97
95
  this.geolocationLatitude = undefined;
@@ -122,6 +120,16 @@ export const LocationSearchMixin = (superClass) => {
122
120
  });
123
121
  this.isLocationsDropdownOpen = false;
124
122
  };
123
+ this.handleRecentLocationSelected = (item) => {
124
+ this.selectedLocation = null;
125
+ this.locationSearchTerm = "";
126
+ this.locationNamePlaceholder = item.name;
127
+ this.dispatchPageUpdate({
128
+ city: item.type === "city" ? item.value : "",
129
+ country: item.type === "country" ? item.value : "",
130
+ });
131
+ this.isLocationsDropdownOpen = false;
132
+ };
125
133
  this.handleKeyDown = (event) => {
126
134
  if (event.key === "Enter") {
127
135
  event.preventDefault();
@@ -129,7 +137,7 @@ export const LocationSearchMixin = (superClass) => {
129
137
  const searchResults = this.locationSearchTask.value?.results;
130
138
  if (searchResults &&
131
139
  searchResults.length === 1 &&
132
- this.locationSearchTerm.length >= 3) {
140
+ this.locationSearchTerm) {
133
141
  const selectedResult = searchResults[0];
134
142
  if (selectedResult) {
135
143
  this.handleLocationSelected(selectedResult);
@@ -161,23 +169,53 @@ export const LocationSearchMixin = (superClass) => {
161
169
  this.locationNamePlaceholder = this.selectedLocation.name ?? "";
162
170
  }
163
171
  }
172
+ renderRecentLocations(recentLocations) {
173
+ return html `
174
+ <p class="results-heading">${msg("Recently viewed")}</p>
175
+ ${recentLocations.map((item) => html `
176
+ <coras-select-option
177
+ @click=${() => this.handleRecentLocationSelected(item)}
178
+ >
179
+ <coras-icon
180
+ assets-url="${this.assetsURL}"
181
+ icon=${item.type === "country" ? "flag" : "pin-drop"}
182
+ ></coras-icon>
183
+ <span>${item.name}</span>
184
+ </coras-select-option>
185
+ `)}
186
+ `;
187
+ }
188
+ renderLocationOptions(locations) {
189
+ return locations.map((item) => renderLocationResultOption({
190
+ item,
191
+ onSelect: this.handleLocationSelected,
192
+ localizedName: item.name ?? "",
193
+ assetsURL: this.assetsURL,
194
+ }));
195
+ }
164
196
  renderLocationSearchResults() {
165
197
  return this.locationSearchTask.render({
166
198
  complete: (response) => {
167
199
  if (!response) {
168
200
  return html ``;
169
201
  }
170
- const locations = (response.results?.length ?? 0) > 0
171
- ? response.results
172
- : (response.popular ?? []);
173
- return html `${(locations ?? []).map((item) => {
174
- return renderLocationResultOption({
175
- item,
176
- onSelect: this.handleLocationSelected,
177
- localizedName: item.name ?? "",
178
- assetsURL: this.assetsURL,
179
- });
180
- })}`;
202
+ if ((response.results?.length ?? 0) > 0) {
203
+ return this.renderLocationOptions(response.results);
204
+ }
205
+ const recentLocations = getRecentlySelectedSearches()
206
+ .filter((item) => item.type === "city" || item.type === "country")
207
+ .slice(0, RECENT_LOCATIONS_LIMIT);
208
+ if (recentLocations.length > 0) {
209
+ return this.renderRecentLocations(recentLocations);
210
+ }
211
+ const popular = response.popular ?? [];
212
+ if (popular.length === 0) {
213
+ return html ``;
214
+ }
215
+ return html `
216
+ <p class="results-heading">${msg("Suggested")}</p>
217
+ ${this.renderLocationOptions(popular)}
218
+ `;
181
219
  },
182
220
  });
183
221
  }
@@ -285,9 +323,8 @@ export const LocationSearchMixin = (superClass) => {
285
323
  <coras-icon
286
324
  slot="suffix"
287
325
  assets-url="${this.assetsURL}"
288
- class=${classMap({ open: this.isLocationsDropdownOpen })}
289
- icon="keyboard-arrow-down"
290
- size="large"
326
+ icon="search"
327
+ size="base"
291
328
  ></coras-icon>
292
329
  </coras-field>
293
330
  <coras-locations-results
@@ -37,13 +37,6 @@ export default css `
37
37
 
38
38
  coras-icon {
39
39
  fill: var(--coras-color-primary);
40
- transform: rotate(0deg);
41
- transition: transform 0.3s;
42
-
43
- &.open {
44
- transform: rotate(180deg);
45
- transition: transform 0.3s;
46
- }
47
40
  }
48
41
 
49
42
  &::part(clear-icon) {
@@ -72,6 +65,17 @@ export default css `
72
65
  }
73
66
  }
74
67
 
68
+ .results-heading {
69
+ margin: 0;
70
+ padding: 1rem 0.5rem 0.5rem;
71
+ padding-inline-start: calc(0.5rem + 10px);
72
+ font-size: var(--coras-font-size-sm);
73
+ font-weight: var(--coras-font-weight-semibold);
74
+ line-height: 20px;
75
+ letter-spacing: 0.4px;
76
+ color: var(--coras-color-text);
77
+ }
78
+
75
79
  @container locations-container (max-width: 520px) {
76
80
  .locations {
77
81
  flex-direction: column;
@@ -39,9 +39,9 @@ export const SearchMixin = (superClass) => {
39
39
  },
40
40
  args: () => [this.getSearchTerm(), this.locale],
41
41
  });
42
- this.throttledSearch = debounce({ delay: 500 }, (event) => {
42
+ this.throttledSearch = debounce({ delay: 200 }, (event) => {
43
43
  const searchTerm = event.detail.value;
44
- if (searchTerm && searchTerm.length >= 3) {
44
+ if (searchTerm) {
45
45
  void this.searchTask.run();
46
46
  }
47
47
  });
@@ -108,6 +108,8 @@ export declare class CorasLandingPage extends CorasLandingPage_base {
108
108
  private updateSelectedPriceOptions;
109
109
  private renderPriceFilter;
110
110
  private filtersTask;
111
+ private locationCategoriesTask;
112
+ private keepCategoriesAvailableAtLocation;
111
113
  private transformFiltersToCategories;
112
114
  private renderCategoriesTree;
113
115
  private renderFiltersButtons;
@@ -120,6 +122,7 @@ export declare class CorasLandingPage extends CorasLandingPage_base {
120
122
  private renderPoints;
121
123
  private renderAttractionCards;
122
124
  private get resolvedCountry();
125
+ private get resolvedCountryCode();
123
126
  private renderLocationImage;
124
127
  private renderBreadcrumbs;
125
128
  private renderAttractionsSkeleton;
@@ -102,6 +102,28 @@ let CorasLandingPage = class CorasLandingPage extends ErrorModalMixin(PointsMixi
102
102
  },
103
103
  args: () => [this.locale, this.currency],
104
104
  });
105
+ this.locationCategoriesTask = new Task(this, {
106
+ task: async ([locale, city, countryCode]) => {
107
+ if (!city && !countryCode)
108
+ return null;
109
+ const { data } = await apiGet({
110
+ client: this.client,
111
+ distributorID: this.distributorID,
112
+ endpoint: "/{api_version}/categories",
113
+ locale,
114
+ query: {
115
+ city_slug: city || undefined,
116
+ country_code: countryCode || undefined,
117
+ },
118
+ });
119
+ return data ?? null;
120
+ },
121
+ args: () => [
122
+ this.locale,
123
+ this.city,
124
+ this.city ? "" : this.resolvedCountryCode,
125
+ ],
126
+ });
105
127
  this.attractionsSearchTask = new Task(this, {
106
128
  task: async ([locale, country, city, startDate, endDate, sorting, duration, price, categories, currency,]) => {
107
129
  const { data } = await apiGet({
@@ -684,6 +706,21 @@ let CorasLandingPage = class CorasLandingPage extends ErrorModalMixin(PointsMixi
684
706
  })}
685
707
  </coras-checkbox-group>`;
686
708
  }
709
+ keepCategoriesAvailableAtLocation(categories, locationCategories) {
710
+ const availableSubcategories = new Map(locationCategories.map((category) => [
711
+ category.slug,
712
+ new Set(category.subcategories?.map((sub) => sub.slug)),
713
+ ]));
714
+ return categories.flatMap((category) => {
715
+ const available = availableSubcategories.get(category.slug);
716
+ if (!available)
717
+ return [];
718
+ const subcategories = (category.subcategories ?? []).filter((sub) => available.has(sub.slug));
719
+ if (category.subcategories?.length && !subcategories.length)
720
+ return [];
721
+ return [{ ...category, subcategories }];
722
+ });
723
+ }
687
724
  transformFiltersToCategories(filters) {
688
725
  const categoryFilters = filters.filter((filter) => filter.type === "category");
689
726
  return categoryFilters.map((categoryFilter, index) => ({
@@ -709,16 +746,20 @@ let CorasLandingPage = class CorasLandingPage extends ErrorModalMixin(PointsMixi
709
746
  if (!filters)
710
747
  return nothing;
711
748
  const transformedCategories = this.transformFiltersToCategories(filters);
712
- return html `
713
- <coras-categories-tree
714
- .categories=${transformedCategories}
715
- .selectedCategories=${this._selectedCategories}
716
- @selection-changed=${(event) => {
717
- this._selectedCategories = event.detail;
718
- event.stopPropagation();
719
- }}
720
- ></coras-categories-tree>
721
- `;
749
+ return this.locationCategoriesTask.render({
750
+ error: () => nothing,
751
+ pending: () => this.renderFiltersSkeleton(),
752
+ complete: (locationCategories) => html `<coras-categories-tree
753
+ .categories=${locationCategories
754
+ ? this.keepCategoriesAvailableAtLocation(transformedCategories, locationCategories)
755
+ : transformedCategories}
756
+ .selectedCategories=${this._selectedCategories}
757
+ @selection-changed=${(event) => {
758
+ this._selectedCategories = event.detail;
759
+ event.stopPropagation();
760
+ }}
761
+ ></coras-categories-tree>`,
762
+ });
722
763
  },
723
764
  });
724
765
  }
@@ -848,6 +889,11 @@ let CorasLandingPage = class CorasLandingPage extends ErrorModalMixin(PointsMixi
848
889
  ?.flatMap((continent) => continent.countries ?? [])
849
890
  .find((country) => country?.cities?.some((city) => city?.slug === this.city))?.slug ?? "");
850
891
  }
892
+ get resolvedCountryCode() {
893
+ return (this.locationsData
894
+ ?.flatMap((continent) => continent.countries ?? [])
895
+ .find((country) => country?.slug === this.resolvedCountry)?.code ?? "");
896
+ }
851
897
  renderLocationImage() {
852
898
  if (this.city && !this.resolvedCountry) {
853
899
  return nothing;
@@ -61,6 +61,7 @@ export interface ThemeColors {
61
61
  textColor: string;
62
62
  placeholderColor: string;
63
63
  errorColor: string;
64
+ backgroundColor: string;
64
65
  }
65
66
  /** Custom event types emitted by the Stripe component. */
66
67
  export interface CorasStripeEventMap {
@@ -88,6 +88,7 @@ export function extractThemeColors(host) {
88
88
  DEFAULT_COLORS.PLACEHOLDER,
89
89
  errorColor: resolve(read(CSS_VARS.FIELD_INPUT_ERROR_COLOR), "color") ||
90
90
  DEFAULT_COLORS.ERROR,
91
+ backgroundColor: resolve(read(CSS_VARS.SURFACE), "color") || DEFAULT_COLORS.BACKGROUND,
91
92
  }));
92
93
  }
93
94
  /** True when a resolved CSS colour (rgb()/rgba()/#hex) reads as dark. */
@@ -143,6 +144,10 @@ export function createStripeElementStyle(colors) {
143
144
  "::placeholder": {
144
145
  color: colors.placeholderColor,
145
146
  },
147
+ ":-webkit-autofill": {
148
+ color: colors.textColor,
149
+ backgroundColor: colors.backgroundColor,
150
+ },
146
151
  iconColor: colors.textColor,
147
152
  },
148
153
  invalid: {
@@ -283,6 +283,7 @@ let CorasSearchPage = class CorasSearchPage extends ErrorModalMixin(LocationSear
283
283
  ?label=${false}
284
284
  name=${result.attraction_name}
285
285
  rating=${result.rating || 0}
286
+ category=${result.main_category.slug}
286
287
  price=${convertToLocaleCurrency({
287
288
  value: result.min_price[this.currency] || 0,
288
289
  locale: this.locale,
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "engines": {
21
21
  "node": ">=22"
22
22
  },
23
- "version": "0.8.2",
23
+ "version": "0.8.3",
24
24
  "private": false,
25
25
  "homepage": "https://docs.coras.io",
26
26
  "bugs": {