@coras-io/embed 0.2.0 → 0.3.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 (235) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/README.md +8 -7
  3. package/dist/components/accordion/accordion-item/accordion-item.styles.js +1 -1
  4. package/dist/components/alert/alert.styles.js +14 -14
  5. package/dist/components/attraction-card/base/attraction-card.styles.js +7 -3
  6. package/dist/components/attraction-discovery/attraction-discovery.styles.js +1 -1
  7. package/dist/components/attraction-header/attraction-header.styles.js +1 -1
  8. package/dist/components/attraction-option/attraction-option.styles.js +4 -4
  9. package/dist/components/basket/basket.styles.js +27 -26
  10. package/dist/components/basket-empty/basket-empty.styles.js +1 -0
  11. package/dist/components/basket-item/basket-item.component.js +10 -4
  12. package/dist/components/basket-item/basket-item.styles.js +9 -3
  13. package/dist/components/basket-item-ticket/basket-item-ticket.styles.js +1 -3
  14. package/dist/components/basket-mobile/basket-mobile.styles.js +5 -5
  15. package/dist/components/better-carousel/better-carousel.styles.js +2 -0
  16. package/dist/components/bottom-drawer/bottom-drawer.styles.js +6 -4
  17. package/dist/components/button/button.component.d.ts +0 -1
  18. package/dist/components/button/button.component.js +1 -8
  19. package/dist/components/button/button.constants.d.ts +1 -1
  20. package/dist/components/button/button.constants.js +1 -1
  21. package/dist/components/button/button.styles.js +66 -39
  22. package/dist/components/calendar/base/calendar.styles.js +3 -5
  23. package/dist/components/calendar/multi/multi.styles.js +7 -0
  24. package/dist/components/category-tag/category-tag.styles.js +10 -7
  25. package/dist/components/checkbox/checkbox.styles.js +2 -2
  26. package/dist/components/chip/chip.styles.js +2 -2
  27. package/dist/components/collect-fida/collect-fida.component.js +5 -3
  28. package/dist/components/collect-fida/collect-fida.styles.js +9 -16
  29. package/dist/components/crypto-auth-modal/crypto-auth-modal.component.js +6 -4
  30. package/dist/components/crypto-auth-modal/crypto-auth-modal.styles.js +2 -2
  31. package/dist/components/dialog/dialog.styles.js +10 -17
  32. package/dist/components/drawer/drawer.component.js +6 -0
  33. package/dist/components/drawer/drawer.styles.js +17 -3
  34. package/dist/components/dropdown/dropdown.component.js +7 -0
  35. package/dist/components/dropdown/dropdown.styles.js +3 -6
  36. package/dist/components/expiration-timer/expiration-timer.styles.js +3 -3
  37. package/dist/components/explore-card/explore-card.styles.js +1 -1
  38. package/dist/components/filter-chip/filter-chip.styles.js +11 -9
  39. package/dist/components/filters-drawer/filters-drawer.component.js +1 -1
  40. package/dist/components/filters-drawer/filters-drawer.styles.js +6 -5
  41. package/dist/components/image/image.styles.js +3 -3
  42. package/dist/components/image-chip/image-chip.styles.js +1 -1
  43. package/dist/components/input-field/input-field.styles.js +22 -17
  44. package/dist/components/itinerary/itinerary-item/itinerary-item.styles.js +1 -1
  45. package/dist/components/joined-fields/joined-fields.styles.js +10 -6
  46. package/dist/components/loading-spinner/loading-spinner.styles.js +1 -1
  47. package/dist/components/location-image/location-image.component.d.ts +6 -0
  48. package/dist/components/location-image/location-image.component.js +15 -2
  49. package/dist/components/location-image/location-image.styles.js +1 -1
  50. package/dist/components/locations-results/locations-results.styles.js +4 -6
  51. package/dist/components/marketing-tag/marketing-tag.styles.js +1 -1
  52. package/dist/components/message-card/message-card.styles.js +6 -6
  53. package/dist/components/option-group/option-chip/option-chip.styles.js +4 -3
  54. package/dist/components/order-confirmation/order-confirmation-item/order-confirmation-item.styles.js +9 -0
  55. package/dist/components/order-confirmation/order-confirmation.component.js +4 -3
  56. package/dist/components/order-confirmation/order-confirmation.styles.js +1 -1
  57. package/dist/components/otp/otp.styles.js +6 -6
  58. package/dist/components/overlay/overlay.styles.js +5 -1
  59. package/dist/components/pay-in/pay-in.styles.js +2 -2
  60. package/dist/components/payment-fiat-method/payment-fiat-method.styles.js +20 -4
  61. package/dist/components/payment-option/payment-option.styles.js +10 -12
  62. package/dist/components/performance-time/performance-time.styles.js +2 -2
  63. package/dist/components/phone-country-code/phone-country-code.styles.js +1 -1
  64. package/dist/components/points/points.styles.js +1 -1
  65. package/dist/components/search-button/search-button.styles.js +15 -7
  66. package/dist/components/seated-selector/seated-selector.component.d.ts +2 -0
  67. package/dist/components/seated-selector/seated-selector.component.js +53 -10
  68. package/dist/components/seated-selector/seated-selector.styles.js +77 -14
  69. package/dist/components/seats-io/seats-io.component.d.ts +2 -0
  70. package/dist/components/seats-io/seats-io.component.js +25 -2
  71. package/dist/components/seats-io/seats-io.constants.d.ts +2 -1
  72. package/dist/components/seats-io/seats-io.constants.js +6 -1
  73. package/dist/components/seats-io/seats-io.transform.d.ts +8 -2
  74. package/dist/components/seats-io/seats-io.transform.js +12 -4
  75. package/dist/components/select-list/select-list.styles.js +1 -0
  76. package/dist/components/select-list/select-option/select-option.styles.js +3 -3
  77. package/dist/components/sort-dropdown/sort-dropdown.styles.js +1 -1
  78. package/dist/components/sort-list/sort-list.styles.js +1 -1
  79. package/dist/components/sport-options/sport-option/sport-option.styles.js +2 -2
  80. package/dist/components/star-rating/star-rating.component.d.ts +1 -0
  81. package/dist/components/star-rating/star-rating.component.js +19 -23
  82. package/dist/components/star-rating/star-rating.styles.js +32 -6
  83. package/dist/components/tab/tab.styles.js +1 -1
  84. package/dist/components/tabs/tabs.styles.js +1 -1
  85. package/dist/components/tag/tag.styles.js +7 -7
  86. package/dist/components/text-section/text-section.styles.js +2 -1
  87. package/dist/components/time-tag/time-tag.styles.js +1 -2
  88. package/dist/components/tooltip/tooltip.styles.js +3 -3
  89. package/dist/components/tour-ticket-type-selector/tour-ticket-type/tour-ticket-type.styles.js +2 -2
  90. package/dist/components/tour-ticket-type-selector/tour-ticket-type-selector.component.js +1 -1
  91. package/dist/components/tour-ticket-type-selector/tour-ticket-type-selector.styles.js +1 -10
  92. package/dist/components/transfer-modal/transfer-modal.component.js +3 -3
  93. package/dist/components/transfer-modal/transfer-modal.styles.js +6 -8
  94. package/dist/containers/basket/basket.component.d.ts +1 -1
  95. package/dist/containers/basket/basket.component.js +56 -25
  96. package/dist/containers/footer/footer.styles.js +4 -0
  97. package/dist/containers/navbar/navbar.component.d.ts +5 -1
  98. package/dist/containers/navbar/navbar.component.js +38 -9
  99. package/dist/containers/navbar/navbar.styles.js +38 -12
  100. package/dist/contexts/basket/basket.provider.d.ts +1 -0
  101. package/dist/contexts/basket/basket.provider.js +31 -4
  102. package/dist/contexts/properties.context.d.ts +4 -4
  103. package/dist/core/api/middlewares/booking-session/booking-session.constants.d.ts +1 -0
  104. package/dist/core/api/middlewares/booking-session/booking-session.constants.js +1 -0
  105. package/dist/core/api/middlewares/booking-session/booking-session.js +18 -27
  106. package/dist/core/api/middlewares/booking-session/booking-session.utils.d.ts +4 -4
  107. package/dist/core/api/middlewares/booking-session/booking-session.utils.js +13 -10
  108. package/dist/core/api/queries.js +3 -2
  109. package/dist/core/color-scheme.d.ts +14 -0
  110. package/dist/core/color-scheme.js +48 -0
  111. package/dist/core/currency/constants.d.ts +1 -1
  112. package/dist/core/currency/constants.js +4 -3
  113. package/dist/core/i18n/date.js +20 -9
  114. package/dist/core/i18n/locale-codes.d.ts +2 -2
  115. package/dist/core/i18n/locale-codes.js +4 -0
  116. package/dist/core/images/constants.d.ts +0 -5
  117. package/dist/core/images/constants.js +0 -5
  118. package/dist/core/images/helpers.d.ts +8 -0
  119. package/dist/core/images/helpers.js +14 -6
  120. package/dist/core/images/srcset.js +2 -2
  121. package/dist/core/storybook/demo.d.ts +4 -0
  122. package/dist/core/storybook/demo.js +17 -0
  123. package/dist/core/types/locales.d.ts +7 -0
  124. package/dist/core/utils/datetime.js +10 -4
  125. package/dist/core/utils/locale.d.ts +8 -1
  126. package/dist/core/utils/locale.js +10 -0
  127. package/dist/helpers/helpers.d.ts +1 -1
  128. package/dist/index.d.ts +2 -3
  129. package/dist/index.js +1 -2
  130. package/dist/locales/ar-SA.d.ts +279 -0
  131. package/dist/locales/ar-SA.js +288 -0
  132. package/dist/locales/da-DK.d.ts +100 -82
  133. package/dist/locales/da-DK.js +104 -89
  134. package/dist/locales/de-DE.d.ts +100 -82
  135. package/dist/locales/de-DE.js +104 -89
  136. package/dist/locales/en-IE.d.ts +250 -232
  137. package/dist/locales/en-IE.js +253 -238
  138. package/dist/locales/en-US.d.ts +100 -82
  139. package/dist/locales/en-US.js +105 -90
  140. package/dist/locales/es-ES.d.ts +100 -82
  141. package/dist/locales/es-ES.js +104 -89
  142. package/dist/locales/fr-FR.d.ts +100 -82
  143. package/dist/locales/fr-FR.js +104 -89
  144. package/dist/locales/fr-MA.d.ts +100 -82
  145. package/dist/locales/fr-MA.js +104 -89
  146. package/dist/locales/is-IS.d.ts +100 -82
  147. package/dist/locales/is-IS.js +104 -89
  148. package/dist/locales/it-IT.d.ts +100 -82
  149. package/dist/locales/it-IT.js +104 -89
  150. package/dist/locales/ms-MY.d.ts +100 -82
  151. package/dist/locales/ms-MY.js +104 -89
  152. package/dist/locales/nb-NO.d.ts +100 -82
  153. package/dist/locales/nb-NO.js +104 -89
  154. package/dist/locales/pl-PL.d.ts +100 -82
  155. package/dist/locales/pl-PL.js +104 -89
  156. package/dist/locales/pt-PT.d.ts +100 -82
  157. package/dist/locales/pt-PT.js +104 -89
  158. package/dist/locales/sv-SE.d.ts +100 -82
  159. package/dist/locales/sv-SE.js +104 -89
  160. package/dist/locales/th-TH.d.ts +100 -82
  161. package/dist/locales/th-TH.js +104 -89
  162. package/dist/locales/tr-TR.d.ts +100 -82
  163. package/dist/locales/tr-TR.js +104 -89
  164. package/dist/locales/zh-CN.d.ts +100 -82
  165. package/dist/locales/zh-CN.js +105 -90
  166. package/dist/locales/zh-HK.d.ts +279 -0
  167. package/dist/locales/zh-HK.js +288 -0
  168. package/dist/mixins/coinbase.mixin.js +1 -1
  169. package/dist/mixins/error-modal.styles.js +2 -2
  170. package/dist/mixins/location-search/location-search.js +3 -3
  171. package/dist/mixins/location-search/location-search.styles.js +6 -5
  172. package/dist/sdk/chrome.d.ts +9 -3
  173. package/dist/sdk/chrome.js +21 -9
  174. package/dist/sdk/element-adapter.js +11 -8
  175. package/dist/sdk/mount.d.ts +3 -3
  176. package/dist/sdk/mount.js +150 -42
  177. package/dist/sdk/navigation-intent.js +3 -0
  178. package/dist/sdk/page-registry.d.ts +14 -2
  179. package/dist/sdk/page-registry.js +33 -13
  180. package/dist/sdk/theme.d.ts +1 -15
  181. package/dist/sdk/theme.js +4 -39
  182. package/dist/sdk/types.d.ts +55 -24
  183. package/dist/sdk/url.d.ts +24 -3
  184. package/dist/sdk/url.js +66 -27
  185. package/dist/sdk/validation.d.ts +0 -7
  186. package/dist/sdk/validation.js +105 -47
  187. package/dist/styles/contrast-fixtures.d.ts +0 -5
  188. package/dist/styles/contrast-fixtures.js +79 -9
  189. package/dist/styles/contrast.js +4 -3
  190. package/dist/styles/defaults/component.js +17 -1
  191. package/dist/styles/primitives.d.ts +0 -10
  192. package/dist/styles/primitives.js +2 -12
  193. package/dist/styles/tokens.d.ts +1 -1
  194. package/dist/styles/tokens.generated.d.ts +1 -1
  195. package/dist/styles/tokens.generated.js +1 -1
  196. package/dist/styles/tokens.metadata.d.ts +1 -1
  197. package/dist/styles/tokens.metadata.js +360 -90
  198. package/dist/views/details-page/details-page.component.d.ts +5 -5
  199. package/dist/views/details-page/details-page.component.js +72 -79
  200. package/dist/views/details-page/details-page.styles.js +64 -9
  201. package/dist/views/help-page/help-page.component.d.ts +1 -0
  202. package/dist/views/help-page/help-page.component.js +11 -4
  203. package/dist/views/help-page/help-page.styles.js +21 -8
  204. package/dist/views/landing-page/landing-page.component.d.ts +4 -4
  205. package/dist/views/landing-page/landing-page.component.js +65 -65
  206. package/dist/views/landing-page/landing-page.styles.js +70 -3
  207. package/dist/views/payment-page/partials/activity-details/activity-details.styles.js +10 -33
  208. package/dist/views/payment-page/partials/billing-address/billing-address.styles.js +4 -9
  209. package/dist/views/payment-page/partials/confirmation/confirmation.styles.js +6 -6
  210. package/dist/views/payment-page/partials/hotel-pickup-list/hotel-pickup-list.styles.js +4 -4
  211. package/dist/views/payment-page/partials/payment-type-selector/payment-type-selector.styles.js +1 -0
  212. package/dist/views/payment-page/partials/stripe/stripe.component.d.ts +1 -1
  213. package/dist/views/payment-page/partials/stripe/stripe.component.js +11 -12
  214. package/dist/views/payment-page/partials/stripe/stripe.constants.d.ts +2 -15
  215. package/dist/views/payment-page/partials/stripe/stripe.constants.js +4 -17
  216. package/dist/views/payment-page/partials/stripe/stripe.styles.js +16 -23
  217. package/dist/views/payment-page/partials/stripe/stripe.utils.d.ts +25 -14
  218. package/dist/views/payment-page/partials/stripe/stripe.utils.js +111 -62
  219. package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.styles.js +1 -1
  220. package/dist/views/payment-page/payment-page.component.d.ts +1 -0
  221. package/dist/views/payment-page/payment-page.component.js +19 -9
  222. package/dist/views/payment-page/payment-page.styles.js +37 -32
  223. package/dist/views/payment-page/payment-page.utils.d.ts +7 -0
  224. package/dist/views/payment-page/payment-page.utils.js +29 -14
  225. package/dist/views/payment-page/payment-page.validators.js +9 -3
  226. package/dist/views/payment-page/services/payment-api.service.d.ts +1 -1
  227. package/dist/views/search-page/search-page.component.d.ts +1 -0
  228. package/dist/views/search-page/search-page.component.js +12 -6
  229. package/dist/views/search-page/search-page.styles.js +24 -2
  230. package/dist/views/suggestion-widget/suggestion-widget.styles.js +1 -1
  231. package/package.json +62 -75
  232. package/dist/custom-elements.json +0 -37397
  233. package/dist/sdk/meta.d.ts +0 -7
  234. package/dist/sdk/meta.js +0 -9
  235. package/dist/styles/tokens.css +0 -359
@@ -15,24 +15,40 @@ export default css `
15
15
  padding: 0.5rem;
16
16
  border: 1px solid var(--coras-color-neutral-400);
17
17
  border-radius: var(--coras-radius-xs);
18
- background-color: var(--coras-color-surface);
18
+ /* A selection chip, so it fills from the field colour rather than the card
19
+ colour, which is reserved for cards. */
20
+ background-color: var(--coras-color-field);
19
21
  transition: all 0.2s ease;
20
22
 
21
23
  &.checked {
22
- border-color: var(--coras-color-primary-500);
23
- background-color: var(--coras-color-primary-100);
24
+ border-color: var(--coras-color-primary);
25
+ background-color: var(--coras-color-primary-tint);
24
26
  box-shadow: var(--coras-shadow-md);
25
27
  }
26
28
  }
27
29
 
30
+ /* Height of the mark's visible plate, which is what the eye lines up on.
31
+ The official Apple and Google marks have different plate aspect ratios,
32
+ so they are matched on plate height rather than overall image size. */
28
33
  .icon {
34
+ --payment-mark-plate-height: 22px;
35
+
29
36
  display: flex;
30
37
  align-items: center;
31
38
  justify-content: center;
32
39
 
40
+ /* The Google mark and our matching card mark share a 1094x742 canvas
41
+ whose plate is 400 tall, hence the 742/400 correction. The .card class
42
+ is the base class on every chip, so it cannot select the card type. */
33
43
  img {
34
- height: 21px;
44
+ height: calc(var(--payment-mark-plate-height) * 742 / 400);
35
45
  object-fit: contain;
36
46
  }
37
47
  }
48
+
49
+ /* The Apple mark's plate fills its whole canvas, so image height is plate
50
+ height directly. */
51
+ .apple-pay .icon img {
52
+ height: var(--payment-mark-plate-height);
53
+ }
38
54
  `;
@@ -13,23 +13,22 @@ export default css `
13
13
  --payment-option-button-border-radius: 24px;
14
14
  --payment-option-padding: 1rem;
15
15
  --payment-option-border-width: 2px;
16
- --payment-option-border-color: var(--coras-color-primary-200);
17
- --payment-option-checked-border-color: var(--coras-palette-pink-500);
18
- --payment-option-background: var(--coras-color-surface);
16
+ --payment-option-border-color: var(--coras-color-card-border);
17
+ --payment-option-checked-border-color: var(--coras-color-secondary);
18
+ --payment-option-background: var(--coras-color-card);
19
19
  --payment-option-title-color: var(--coras-color-text);
20
20
  --payment-option-price-color: var(--coras-color-text);
21
21
  --payment-option-button-color: var(--coras-color-neutral-50);
22
- --payment-option-button-background: var(--coras-color-info-900);
22
+ --payment-option-button-background: var(--coras-color-info);
23
23
  --payment-option-radio-size: 1.25rem;
24
24
  --payment-option-radio-border-width: 2px;
25
25
  --payment-option-radio-border-color: var(--coras-color-neutral-400);
26
- --payment-option-radio-checked-border-color: var(--coras-palette-pink-500);
26
+ --payment-option-radio-checked-border-color: var(--coras-color-secondary);
27
27
  --payment-option-radio-checked-inner-size: 12px;
28
28
  --payment-option-icon-size: 1.25rem;
29
- --payment-option-icon-background: var(--coras-color-info-900);
30
- --payment-option-icon-color: var(--coras-color-info-500);
29
+ --payment-option-icon-background: var(--coras-color-info);
30
+ --payment-option-icon-color: var(--coras-color-info);
31
31
 
32
- /* Disabled tokens */
33
32
  --payment-option-disabled-border-color: var(--coras-color-neutral-300);
34
33
  --payment-option-disabled-title-color: var(--coras-color-neutral-500);
35
34
  --payment-option-disabled-price-color: var(--coras-color-neutral-600);
@@ -62,15 +61,15 @@ export default css `
62
61
  border-color: var(--payment-option-checked-border-color);
63
62
  background: linear-gradient(
64
63
  to bottom,
65
- color-mix(in srgb, var(--coras-palette-pink-500), white 96%),
66
- color-mix(in srgb, var(--coras-palette-pink-500), white 92%)
64
+ var(--coras-color-secondary-tint),
65
+ var(--coras-color-secondary-tint)
67
66
  );
68
67
  }
69
68
 
70
69
  &.disabled {
71
70
  pointer-events: none;
72
71
  border-color: var(--coras-color-neutral-300);
73
- background: var(--coras-color-surface);
72
+ background: var(--coras-color-card);
74
73
  }
75
74
  }
76
75
 
@@ -108,7 +107,6 @@ export default css `
108
107
  background-color: var(--payment-option-radio-checked-border-color);
109
108
  }
110
109
 
111
- /* Disabled look */
112
110
  .disabled .title,
113
111
  :host([disabled]) .title {
114
112
  color: var(--coras-color-neutral-500);
@@ -11,12 +11,12 @@ export default css `
11
11
  --performance-time-padding-block: 36px;
12
12
 
13
13
  --performance-time-font-size: var(--coras-font-size-base);
14
- --performance-time-background-color: var(--coras-color-surface);
14
+ --performance-time-background-color: var(--coras-color-field);
15
15
  --performance-time-color: var(--coras-color-text);
16
16
  --performance-time-border-color: var(--coras-color-neutral-600);
17
17
  --performance-time-border-radius: var(--coras-radius-md);
18
18
  --performance-time-font-weight: var(--coras-font-weight-normal);
19
- --performance-time-background-color-hover: var(--coras-color-surface-hover);
19
+ --performance-time-background-color-hover: var(--coras-color-field-hover);
20
20
  }
21
21
 
22
22
  button {
@@ -18,7 +18,7 @@ export default css `
18
18
  padding: 12px 16px;
19
19
 
20
20
  &:hover {
21
- background-color: var(--coras-color-surface-hover);
21
+ background-color: var(--coras-color-menu-hover);
22
22
  }
23
23
 
24
24
  > div {
@@ -4,7 +4,7 @@ export default css `
4
4
  ${component}
5
5
 
6
6
  :host {
7
- --points-background-color: var(--coras-color-success-50);
7
+ --points-background-color: var(--coras-color-success-background);
8
8
  --points-font-size: var(--coras-font-size-base);
9
9
  --points-font-weight: var(--coras-font-weight-semibold);
10
10
  --points-font-color: var(--coras-color-text);
@@ -6,15 +6,23 @@ export default css `
6
6
  :host {
7
7
  --search-button-font-size: var(--coras-font-size-base);
8
8
  --search-button-font-weight: var(--coras-font-weight-normal);
9
- --search-button-background-color: var(--coras-color-surface);
10
- --search-button-color: var(--coras-color-text-secondary);
11
- --search-button-border-color: var(--coras-color-neutral-300);
12
- --search-button-border-radius: var(--coras-radius-lg);
13
- --search-button-background-color-hover: var(--coras-color-primary-200);
14
- --search-button-background-color-active: var(--coras-color-primary-100);
9
+ --search-button-background-color: var(--coras-color-field);
10
+ --search-button-color: var(--coras-color-text-muted);
11
+ --search-button-border-color: var(--coras-color-field-border);
12
+ --search-button-border-radius: var(--coras-radius-search);
13
+ --search-button-background-color-hover: color-mix(
14
+ in srgb,
15
+ var(--coras-color-field),
16
+ var(--coras-state-overlay) var(--coras-state-hover)
17
+ );
18
+ --search-button-background-color-active: color-mix(
19
+ in srgb,
20
+ var(--coras-color-field),
21
+ var(--coras-state-overlay) var(--coras-state-active)
22
+ );
15
23
  --search-button-border-color-disabled: var(--coras-color-neutral-400);
16
24
  --search-button-color-disabled: var(--coras-color-neutral-400);
17
- --search-button-icon-color: var(--coras-color-text-secondary);
25
+ --search-button-icon-color: var(--coras-color-text-muted);
18
26
  }
19
27
 
20
28
  button {
@@ -20,6 +20,7 @@ export declare class CorasSeatedSelector extends LitElement {
20
20
  private selectionValid;
21
21
  private violations;
22
22
  private reserved;
23
+ private sheetExpanded;
23
24
  private fallbackFired;
24
25
  private seatsTask;
25
26
  private chartDataCache;
@@ -31,6 +32,7 @@ export declare class CorasSeatedSelector extends LitElement {
31
32
  private seatLabelFor;
32
33
  private handleObjectSelected;
33
34
  private handleObjectDeselected;
35
+ private toggleSheet;
34
36
  reservationCreated(): void;
35
37
  private handleSelectionValid;
36
38
  private handleSelectionInvalid;
@@ -49,6 +49,10 @@ let CorasSeatedSelector = class CorasSeatedSelector extends LitElement {
49
49
  // it stops covering the basket that opens on top of it - until the shopper
50
50
  // changes their selection, which reopens the bar for another go.
51
51
  this.reserved = false;
52
+ // On small screens the summary bar acts as a bottom sheet: collapsed to a
53
+ // seat-count-and-total handle, expanded to the full breakdown on tap. Ignored
54
+ // on wider screens, where the breakdown always shows.
55
+ this.sheetExpanded = false;
52
56
  this.fallbackFired = false;
53
57
  this.seatsTask = new Task(this, {
54
58
  task: async ([client, attractionId, instanceId, locale, distributorID, currency,]) => {
@@ -91,8 +95,14 @@ let CorasSeatedSelector = class CorasSeatedSelector extends LitElement {
91
95
  fireInternalEvent(this, "seats-unavailable", {});
92
96
  };
93
97
  this.handleObjectSelected = (event) => {
94
- this.reserved = false;
95
98
  const { label } = event.detail;
99
+ // Ignore any seat the current availability data doesn't know about (e.g. one
100
+ // a stale seats.io session restored after it was already booked), otherwise
101
+ // it enters the selection priced at 0 and the reservation fails.
102
+ if (this.chartData && !(label in this.chartData.availableSeats)) {
103
+ return;
104
+ }
105
+ this.reserved = false;
96
106
  if (!this.selectedSeats.some((seat) => seat.id === label)) {
97
107
  this.selectedSeats = [
98
108
  ...this.selectedSeats,
@@ -105,6 +115,9 @@ let CorasSeatedSelector = class CorasSeatedSelector extends LitElement {
105
115
  const { label } = event.detail;
106
116
  this.selectedSeats = this.selectedSeats.filter((seat) => seat.id !== label);
107
117
  };
118
+ this.toggleSheet = () => {
119
+ this.sheetExpanded = !this.sheetExpanded;
120
+ };
108
121
  this.handleSelectionValid = () => {
109
122
  this.selectionValid = true;
110
123
  this.violations = [];
@@ -207,23 +220,50 @@ let CorasSeatedSelector = class CorasSeatedSelector extends LitElement {
207
220
  if (!data || this.selectedSeats.length === 0 || this.reserved) {
208
221
  return nothing;
209
222
  }
210
- const { groups, total } = buildSelectionSummary(this.selectedSeats, data.availableSeats, data.flatPriceBands, data.categories);
223
+ const { groups, fees, total } = buildSelectionSummary(this.selectedSeats, data.availableSeats, data.flatPriceBands, data.categories);
224
+ const seatCount = this.selectedSeats.length;
211
225
  return html `
212
- <div class="drawer" part="drawer">
226
+ <div class="drawer" part="drawer" data-expanded=${this.sheetExpanded}>
213
227
  <div class="drawer-inner">
214
- <div class="drawer-summary">
215
- <p class="drawer-total">
216
- ${msg("Total")} ${this.formatPrice(total)}
217
- </p>
218
- ${map(groups, (group) => html `
228
+ <button
229
+ type="button"
230
+ class="sheet-handle"
231
+ aria-expanded=${this.sheetExpanded}
232
+ aria-controls="drawer-summary"
233
+ @click=${this.toggleSheet}
234
+ >
235
+ <span class="sheet-handle-label">
236
+ ${msg(str `${seatCount} seats selected`)}
237
+ </span>
238
+ <span class="sheet-handle-total">${this.formatPrice(total)}</span>
239
+ <span class="sheet-chevron" aria-hidden="true"></span>
240
+ </button>
241
+
242
+ <div class="drawer-summary" id="drawer-summary">
243
+ ${map(groups, (group) => {
244
+ const ticketLabel = `${group.count} ${group.label}`;
245
+ const seatList = group.seatLabels.join(", ");
246
+ const unitPrice = this.formatPrice(group.unitPrice);
247
+ return html `
219
248
  <p class="drawer-group">
220
249
  <span
221
250
  class="drawer-dot"
222
251
  style="background:${group.color}"
223
252
  ></span>
224
- ${msg(str `${group.count} ${group.label} Tickets : ${group.seatLabels.join(", ")} (${this.formatPrice(group.unitPrice)} each)`)}
253
+ ${msg(str `${ticketLabel} Tickets : ${seatList} (${unitPrice} each)`)}
225
254
  </p>
226
- `)}
255
+ `;
256
+ })}
257
+ ${fees > 0
258
+ ? html `
259
+ <p class="drawer-fee">
260
+ ${msg(str `Booking fee ${this.formatPrice(fees)}`)}
261
+ </p>
262
+ `
263
+ : nothing}
264
+ <p class="drawer-total">
265
+ ${msg("Total")} ${this.formatPrice(total)}
266
+ </p>
227
267
  </div>
228
268
 
229
269
  <coras-button
@@ -326,6 +366,9 @@ __decorate([
326
366
  __decorate([
327
367
  state()
328
368
  ], CorasSeatedSelector.prototype, "reserved", void 0);
369
+ __decorate([
370
+ state()
371
+ ], CorasSeatedSelector.prototype, "sheetExpanded", void 0);
329
372
  CorasSeatedSelector = __decorate([
330
373
  localized()
331
374
  ], CorasSeatedSelector);
@@ -4,9 +4,12 @@ export default css `
4
4
  ${component}
5
5
 
6
6
  :host {
7
+ --coras-seated-max-width: 720px;
8
+
7
9
  display: flex;
8
10
  flex-direction: column;
9
- gap: var(--coras-spacing-md, 16px);
11
+ gap: 1rem;
12
+ max-width: var(--coras-seated-max-width);
10
13
  }
11
14
 
12
15
  .heading {
@@ -36,20 +39,18 @@ export default css `
36
39
  justify-content: center;
37
40
  box-sizing: border-box;
38
41
  padding: 24px clamp(16px, 4vw, 48px);
39
- background: var(--coras-color-background, #fcfcff);
40
- border-top: 1px solid var(--coras-color-neutral-200, #e6e6e6);
41
- box-shadow: 1px -4px 8px 4px rgba(0, 0, 0, 0.03);
42
+ background: var(--coras-color-background);
43
+ border-top: 1px solid var(--coras-color-divider);
44
+ box-shadow: var(--coras-shadow-top);
42
45
  }
43
46
 
44
- /* Cap the content width and centre it so the summary and the button stay
45
- close together on wide screens instead of hugging opposite edges. */
46
47
  .drawer-inner {
47
48
  display: flex;
48
49
  align-items: center;
49
50
  justify-content: space-between;
50
51
  gap: 24px;
51
52
  width: 100%;
52
- max-width: 720px;
53
+ max-width: var(--coras-seated-max-width);
53
54
  }
54
55
 
55
56
  .drawer-summary {
@@ -59,13 +60,6 @@ export default css `
59
60
  min-width: 0;
60
61
  }
61
62
 
62
- .drawer-total {
63
- margin: 0;
64
- color: var(--coras-color-text);
65
- font-size: var(--coras-font-size-base);
66
- font-weight: var(--coras-font-weight-medium);
67
- }
68
-
69
63
  .drawer-group {
70
64
  display: flex;
71
65
  align-items: center;
@@ -82,6 +76,25 @@ export default css `
82
76
  border-radius: 50%;
83
77
  }
84
78
 
79
+ .drawer-fee {
80
+ margin: 0;
81
+ color: var(--coras-color-text-muted);
82
+ font-size: var(--coras-font-size-sm);
83
+ }
84
+
85
+ .drawer-total {
86
+ margin: 4px 0 0;
87
+ padding-top: 8px;
88
+ border-top: 1px solid var(--coras-color-divider);
89
+ color: var(--coras-color-text);
90
+ font-size: var(--coras-font-size-base);
91
+ font-weight: var(--coras-font-weight-medium);
92
+ }
93
+
94
+ .sheet-handle {
95
+ display: none;
96
+ }
97
+
85
98
  @media (max-width: 600px) {
86
99
  .drawer {
87
100
  padding: 16px;
@@ -92,5 +105,55 @@ export default css `
92
105
  align-items: stretch;
93
106
  gap: 12px;
94
107
  }
108
+
109
+ .sheet-handle {
110
+ display: flex;
111
+ align-items: center;
112
+ gap: 8px;
113
+ width: 100%;
114
+ padding: 0;
115
+ background: none;
116
+ border: none;
117
+ cursor: pointer;
118
+ color: var(--coras-color-text);
119
+ font: inherit;
120
+ text-align: start;
121
+ }
122
+
123
+ .sheet-handle-label {
124
+ font-size: var(--coras-font-size-sm);
125
+ }
126
+
127
+ .sheet-handle-total {
128
+ margin-inline-start: auto;
129
+ font-size: var(--coras-font-size-base);
130
+ font-weight: var(--coras-font-weight-medium);
131
+ }
132
+
133
+ .sheet-chevron {
134
+ flex-shrink: 0;
135
+ width: 8px;
136
+ height: 8px;
137
+ border-right: 2px solid currentColor;
138
+ border-bottom: 2px solid currentColor;
139
+ transform: rotate(-135deg);
140
+ transition: transform 0.15s ease;
141
+ }
142
+
143
+ .drawer[data-expanded="true"] .sheet-chevron {
144
+ transform: rotate(45deg);
145
+ }
146
+
147
+ .drawer-summary {
148
+ display: none;
149
+ }
150
+
151
+ .drawer[data-expanded="true"] .drawer-summary {
152
+ display: flex;
153
+ }
154
+
155
+ .drawer-total {
156
+ display: none;
157
+ }
95
158
  }
96
159
  `;
@@ -15,6 +15,8 @@ export declare class CorasSeatsIO extends LitElement {
15
15
  maxSelectedObjects: number;
16
16
  private container;
17
17
  private seatsioInstance;
18
+ private readonly colorScheme;
19
+ private renderedScheme;
18
20
  private eventsCallbacks;
19
21
  private getConfig;
20
22
  private loadSeatsio;
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { html, LitElement, } from "lit";
8
8
  import { property, query } from "lit/decorators.js";
9
9
  import { fireInternalEvent } from "../../core/events.js";
10
+ import { ColorSchemeController } from "../../core/color-scheme.js";
10
11
  import { convertToLocaleCurrency } from "../../core/currency/index.js";
11
12
  import { SEATS_IO_DEFAULTS } from "./seats-io.constants.js";
12
13
  import styles from "./seats-io.styles.js";
@@ -25,6 +26,11 @@ export class CorasSeatsIO extends LitElement {
25
26
  this.selectedObjects = [];
26
27
  this.maxSelectedObjects = 0;
27
28
  this.seatsioInstance = null;
29
+ // The chart's dark/light styling is baked in at render time, so track the
30
+ // effective scheme and rebuild when it flips (the controller requests an
31
+ // update on both an SDK colour-scheme change and an OS preference change).
32
+ this.colorScheme = new ColorSchemeController(this);
33
+ this.renderedScheme = null;
28
34
  this.eventsCallbacks = {
29
35
  onObjectSelected: (object) => fireInternalEvent(this, "seats-io-object-selected", object),
30
36
  onObjectDeselected: (object) => fireInternalEvent(this, "seats-io-object-deselected", object),
@@ -50,6 +56,9 @@ export class CorasSeatsIO extends LitElement {
50
56
  workspaceKey: this.workspaceKey,
51
57
  event: this.event,
52
58
  language: this.language,
59
+ // The map inherits the embed's effective colour scheme so its background
60
+ // matches a dark theme instead of staying white.
61
+ colorScheme: this.colorScheme.scheme,
53
62
  // Prices reach seats.io as raw minor units (e.g. 3500). Format them to the
54
63
  // shopper's currency and locale so tooltips and the legend read "£35.00",
55
64
  // not "3500". A presentation-layer callback, so unlike the renderer-engine
@@ -80,7 +89,11 @@ export class CorasSeatsIO extends LitElement {
80
89
  ? { maxSelectedObjects: this.maxSelectedObjects }
81
90
  : {}),
82
91
  selectionValidators: [{ type: "noOrphanSeats" }],
83
- session: "continue",
92
+ // Start a fresh hold session on every mount. "continue" restores the
93
+ // previous browser session, so reopening the map after a reservation
94
+ // re-selected seats that are no longer available - selecting them at
95
+ // price 0 and breaking "Add to basket".
96
+ session: "start",
84
97
  };
85
98
  return config;
86
99
  }
@@ -113,11 +126,21 @@ export class CorasSeatsIO extends LitElement {
113
126
  }
114
127
  async updated(changed) {
115
128
  super.updated(changed);
129
+ // Everything below is baked into the chart at construction, so a change to
130
+ // any of it needs a rebuild, not a prop update the running chart ignores.
131
+ // The scheme is not a Lit property (the controller drives it), so compare it
132
+ // against the scheme the current chart was built with.
133
+ const schemeChanged = this.colorScheme.scheme !== this.renderedScheme;
116
134
  if (changed.has("event") ||
117
135
  changed.has("workspaceKey") ||
118
136
  changed.has("region") ||
119
137
  changed.has("language") ||
120
- changed.has("chartData")) {
138
+ changed.has("chartData") ||
139
+ changed.has("currency") ||
140
+ changed.has("currencyLocale") ||
141
+ changed.has("maxSelectedObjects") ||
142
+ schemeChanged) {
143
+ this.renderedScheme = this.colorScheme.scheme;
121
144
  try {
122
145
  await this.getSeatsio();
123
146
  this.seatsioInstance?.destroy();
@@ -1,11 +1,12 @@
1
1
  export declare const SEATS_IO_DEFAULTS: {
2
2
  showRowLabels: boolean;
3
3
  showRowLines: boolean;
4
+ fitTo: "widthAndHeight";
4
5
  showFullScreenButton: boolean;
5
6
  legend: {
6
7
  hideNonSelectableCategories: boolean;
7
8
  };
8
- objectTooltip: {
9
+ objectPopover: {
9
10
  showUnavailableNotice: boolean;
10
11
  };
11
12
  loading: string;
@@ -1,6 +1,10 @@
1
1
  export const SEATS_IO_DEFAULTS = {
2
2
  showRowLabels: true,
3
3
  showRowLines: true,
4
+ // Fill the container in both dimensions so the chart doesn't float in a wide
5
+ // margin (with the seats.io controls stranded far from the seats) on large
6
+ // screens. Paired with the capped map width on the seated selector.
7
+ fitTo: "widthAndHeight",
4
8
  // Let shoppers pop the map out to full screen; the enlarge affordance sits
5
9
  // next to seats.io's own zoom controls.
6
10
  showFullScreenButton: true,
@@ -8,7 +12,8 @@ export const SEATS_IO_DEFAULTS = {
8
12
  hideNonSelectableCategories: true,
9
13
  },
10
14
  // Show an "unavailable" note when hovering a seat that can't be picked.
11
- objectTooltip: {
15
+ // `objectPopover` is the current key; `objectTooltip` is deprecated.
16
+ objectPopover: {
12
17
  showUnavailableNotice: true,
13
18
  },
14
19
  loading: " ",
@@ -36,10 +36,13 @@ export interface SelectionGroup {
36
36
  color: string;
37
37
  seatLabels: string[];
38
38
  unitPrice: number;
39
+ bookingFee: number;
39
40
  count: number;
40
41
  }
41
42
  export interface SelectionSummary {
42
43
  groups: SelectionGroup[];
44
+ subtotal: number;
45
+ fees: number;
43
46
  total: number;
44
47
  }
45
48
  export interface SeatsChartData {
@@ -65,8 +68,11 @@ export declare const findPriceBand: (seatLabel: string, availableSeats: Record<s
65
68
  export declare const buildTickets: (selectedLabels: string[], availableSeats: Record<string, AvailableSeat>, flatPriceBands: FlatPriceBand[]) => TicketRequest[];
66
69
  /**
67
70
  * Groups the selected seats by price-band category for the booking drawer:
68
- * one row per category with its colour, seat labels, unit price (incl. fees)
69
- * and count, plus the order total. All amounts in minor units.
71
+ * one row per category with its colour, seat labels, base unit price, per-seat
72
+ * booking fee and count. The base unit price matches the seat tooltip on the
73
+ * map; the booking fee is surfaced on its own line so the shopper can reconcile
74
+ * the two. subtotal + fees === total, which is the fee-inclusive amount booked.
75
+ * All amounts in minor units.
70
76
  */
71
77
  export declare const buildSelectionSummary: (seats: SelectedSeat[], availableSeats: Record<string, AvailableSeat>, flatPriceBands: FlatPriceBand[], categories: ChartCategory[]) => SelectionSummary;
72
78
  export declare const makeIsSeatSelectable: (availableSeats: Record<string, AvailableSeat>) => (object: SelectableObject) => boolean;
@@ -97,12 +97,17 @@ export const buildTickets = (selectedLabels, availableSeats, flatPriceBands) =>
97
97
  };
98
98
  /**
99
99
  * Groups the selected seats by price-band category for the booking drawer:
100
- * one row per category with its colour, seat labels, unit price (incl. fees)
101
- * and count, plus the order total. All amounts in minor units.
100
+ * one row per category with its colour, seat labels, base unit price, per-seat
101
+ * booking fee and count. The base unit price matches the seat tooltip on the
102
+ * map; the booking fee is surfaced on its own line so the shopper can reconcile
103
+ * the two. subtotal + fees === total, which is the fee-inclusive amount booked.
104
+ * All amounts in minor units.
102
105
  */
103
106
  export const buildSelectionSummary = (seats, availableSeats, flatPriceBands, categories) => {
104
107
  const categoryByKey = new Map(categories.map((category) => [category.key, category]));
105
108
  const groups = new Map();
109
+ let subtotal = 0;
110
+ let fees = 0;
106
111
  let total = 0;
107
112
  seats.forEach((seat) => {
108
113
  const meta = availableSeats[seat.id];
@@ -110,6 +115,8 @@ export const buildSelectionSummary = (seats, availableSeats, flatPriceBands, cat
110
115
  if (!meta || !band) {
111
116
  return;
112
117
  }
118
+ subtotal += band.basePrice;
119
+ fees += band.bookingFee;
113
120
  total += band.fullPrice;
114
121
  const key = String(meta.categoryID);
115
122
  const existing = groups.get(key);
@@ -124,12 +131,13 @@ export const buildSelectionSummary = (seats, availableSeats, flatPriceBands, cat
124
131
  label: category?.label ?? key,
125
132
  color: category?.color ?? "",
126
133
  seatLabels: [seat.seatLabel],
127
- unitPrice: band.fullPrice,
134
+ unitPrice: band.basePrice,
135
+ bookingFee: band.bookingFee,
128
136
  count: 1,
129
137
  });
130
138
  }
131
139
  });
132
- return { groups: [...groups.values()], total };
140
+ return { groups: [...groups.values()], subtotal, fees, total };
133
141
  };
134
142
  const isReserved = (object) => {
135
143
  const status = "status" in object ? object.status : undefined;
@@ -19,6 +19,7 @@ export default css `
19
19
 
20
20
  & > .caption {
21
21
  padding: 0.6rem 1rem 0.9rem 1rem;
22
+ font-family: var(--coras-font-family-heading);
22
23
  font-weight: var(--select-list-caption-font-weight);
23
24
  font-size: var(--select-list-caption-font-size);
24
25
  color: var(--select-list-caption-icon-color);
@@ -7,9 +7,9 @@ export default css `
7
7
  --select-option-font-size: var(--coras-font-size-base);
8
8
  --select-option-line-height: var(--coras-font-size-2xl);
9
9
  --select-option-color: var(--coras-color-text);
10
- --select-option-hovered-background-color: var(--coras-color-surface-hover);
11
- --select-option-selected-background-color: var(--coras-color-surface-hover);
12
- --select-option-check-mark-color: var(--coras-color-primary-500);
10
+ --select-option-hovered-background-color: var(--coras-color-menu-hover);
11
+ --select-option-selected-background-color: var(--coras-color-menu-hover);
12
+ --select-option-check-mark-color: var(--coras-color-primary);
13
13
 
14
14
  --check-mark-size: 12px;
15
15
 
@@ -5,7 +5,7 @@ export default css `
5
5
 
6
6
  :host {
7
7
  --sort-dropdown-button-icon-color: var(--coras-color-text);
8
- --sort-dropdown-button-icon-color-hover: var(--coras-color-primary-700);
8
+ --sort-dropdown-button-icon-color-hover: var(--coras-color-primary);
9
9
  }
10
10
 
11
11
  coras-button {
@@ -5,7 +5,7 @@ export default css `
5
5
 
6
6
  :host {
7
7
  --sort-list-label-font-size: var(--coras-font-size-sm);
8
- --sort-list-label-color: var(--coras-color-text-secondary);
8
+ --sort-list-label-color: var(--coras-color-text-muted);
9
9
  --sort-list-label-font-weight: var(--coras-font-weight-normal);
10
10
  }
11
11