@coras-io/embed 0.5.0 → 0.6.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 (373) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +15 -2
  3. package/dist/components/accordion/accordion-item/accordion-item.component.js +9 -3
  4. package/dist/components/accordion/accordion-item/accordion-item.styles.js +4 -0
  5. package/dist/components/accordion/accordion.component.js +8 -0
  6. package/dist/components/alert/alert.component.d.ts +1 -1
  7. package/dist/components/alert/alert.component.js +4 -3
  8. package/dist/components/attraction-card/base/attraction-card.mixin.d.ts +0 -2
  9. package/dist/components/attraction-card/base/attraction-card.mixin.js +0 -6
  10. package/dist/components/attraction-card/base/attraction-card.types.d.ts +0 -1
  11. package/dist/components/basket-mobile/basket-mobile.component.d.ts +14 -3
  12. package/dist/components/basket-mobile/basket-mobile.component.js +71 -15
  13. package/dist/components/better-carousel/better-carousel.component.d.ts +3 -5
  14. package/dist/components/better-carousel/better-carousel.component.js +13 -34
  15. package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.component.js +5 -12
  16. package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.styles.js +13 -5
  17. package/dist/components/breadcrumbs/breadcrumbs.component.d.ts +0 -1
  18. package/dist/components/breadcrumbs/breadcrumbs.component.js +5 -8
  19. package/dist/components/breadcrumbs/breadcrumbs.styles.js +8 -2
  20. package/dist/components/button/button.constants.d.ts +1 -2
  21. package/dist/components/button/button.constants.js +0 -1
  22. package/dist/components/calendar/base/calendar.mixin.js +5 -1
  23. package/dist/components/calendar/multi/multi.component.d.ts +2 -2
  24. package/dist/components/calendar/multi/multi.component.js +12 -19
  25. package/dist/components/carousel/carousel.component.js +9 -2
  26. package/dist/components/categories-tree/categories-tree.component.d.ts +5 -3
  27. package/dist/components/categories-tree/categories-tree.component.js +22 -21
  28. package/dist/components/checkbox/checkbox.component.js +5 -1
  29. package/dist/components/checkbox-group/checkbox-group.component.js +1 -1
  30. package/dist/components/checkbox-group/checkbox-group.styles.js +1 -1
  31. package/dist/components/chip/chip.component.js +8 -3
  32. package/dist/components/crypto-auth-modal/crypto-auth-modal.component.d.ts +6 -0
  33. package/dist/components/crypto-auth-modal/crypto-auth-modal.component.js +15 -1
  34. package/dist/components/currencies-list/currencies-list.component.js +0 -1
  35. package/dist/components/dialog/dialog.component.js +52 -21
  36. package/dist/components/drawer/drawer.component.d.ts +3 -2
  37. package/dist/components/drawer/drawer.component.js +13 -18
  38. package/dist/components/drawer/drawer.styles.js +5 -2
  39. package/dist/components/dropdown/dropdown.component.js +6 -9
  40. package/dist/components/expiration-timer/expiration-timer.component.d.ts +2 -3
  41. package/dist/components/expiration-timer/expiration-timer.component.js +10 -8
  42. package/dist/components/explore-card/explore-card.component.js +3 -1
  43. package/dist/components/explore-card/explore-card.styles.js +31 -0
  44. package/dist/components/filters-drawer/filters-drawer.component.js +1 -1
  45. package/dist/components/flag-icon/flag-icon.component.d.ts +4 -2
  46. package/dist/components/flag-icon/flag-icon.component.js +16 -4
  47. package/dist/components/icon/icon.component.js +15 -2
  48. package/dist/components/image/image.component.js +4 -3
  49. package/dist/components/image-viewer/image-viewer.component.js +6 -4
  50. package/dist/components/input-field/input-field.component.js +10 -6
  51. package/dist/components/layout/layout.styles.js +1 -1
  52. package/dist/components/locales-list/locales-list.component.js +0 -1
  53. package/dist/components/location-image/location-image.component.js +0 -1
  54. package/dist/components/locations-results/locations-results.component.d.ts +10 -0
  55. package/dist/components/locations-results/locations-results.component.js +22 -15
  56. package/dist/components/locations-results/locations-results.styles.js +4 -1
  57. package/dist/components/message-card/message-card.component.d.ts +1 -1
  58. package/dist/components/message-card/message-card.component.js +4 -3
  59. package/dist/components/mobile-menu-item/mobile-menu-item.component.d.ts +0 -1
  60. package/dist/components/mobile-menu-item/mobile-menu-item.component.js +14 -16
  61. package/dist/components/mobile-menu-item/mobile-menu-item.styles.js +9 -5
  62. package/dist/components/option-group/option-chip/option-chip.component.d.ts +4 -1
  63. package/dist/components/option-group/option-chip/option-chip.component.js +23 -10
  64. package/dist/components/option-group/option-group.component.d.ts +3 -1
  65. package/dist/components/option-group/option-group.component.js +10 -3
  66. package/dist/components/overlay/overlay.component.d.ts +0 -5
  67. package/dist/components/overlay/overlay.component.js +3 -15
  68. package/dist/components/phone-country-code/phone-country-code.component.d.ts +4 -0
  69. package/dist/components/phone-country-code/phone-country-code.component.js +37 -0
  70. package/dist/components/phone-country-codes/phone-country-codes.component.js +1 -1
  71. package/dist/components/phone-field/phone-field.component.js +2 -2
  72. package/dist/components/search-button/search-button.component.d.ts +1 -1
  73. package/dist/components/search-button/search-button.component.js +13 -7
  74. package/dist/components/seated-selector/seated-selector.component.js +3 -3
  75. package/dist/components/seats-io/seats-io.component.d.ts +3 -2
  76. package/dist/components/seats-io/seats-io.component.js +31 -13
  77. package/dist/components/seats-io/seats-io.constants.d.ts +0 -2
  78. package/dist/components/seats-io/seats-io.constants.js +0 -3
  79. package/dist/components/seats-io/seats-io.transform.d.ts +1 -6
  80. package/dist/components/seats-io/seats-io.transform.js +1 -20
  81. package/dist/components/select-list/select-list.component.js +7 -2
  82. package/dist/components/select-list/select-option/select-option.component.d.ts +3 -1
  83. package/dist/components/select-list/select-option/select-option.component.js +10 -3
  84. package/dist/components/tabs/tabs.component.d.ts +2 -0
  85. package/dist/components/tabs/tabs.component.js +59 -5
  86. package/dist/components/time-tag/time-tag.component.js +1 -1
  87. package/dist/containers/basket/basket.component.d.ts +1 -1
  88. package/dist/containers/basket/basket.component.js +21 -20
  89. package/dist/containers/navbar/navbar.component.d.ts +12 -8
  90. package/dist/containers/navbar/navbar.component.js +108 -62
  91. package/dist/containers/navbar/navbar.styles.js +23 -5
  92. package/dist/containers/navbar/navbar.utils.js +4 -4
  93. package/dist/contexts/basket/basket.provider.d.ts +3 -4
  94. package/dist/contexts/basket/basket.provider.js +46 -61
  95. package/dist/contexts/basket/basket.types.d.ts +0 -2
  96. package/dist/controllers/time-expiration.d.ts +15 -2
  97. package/dist/controllers/time-expiration.js +47 -17
  98. package/dist/core/api/client.d.ts +9 -0
  99. package/dist/core/api/client.js +26 -0
  100. package/dist/core/api/middlewares/booking-session/booking-session.constants.d.ts +0 -2
  101. package/dist/core/api/middlewares/booking-session/booking-session.constants.js +0 -2
  102. package/dist/core/api/middlewares/booking-session/booking-session.js +3 -12
  103. package/dist/core/api/middlewares/booking-session/booking-session.utils.d.ts +0 -1
  104. package/dist/core/api/middlewares/booking-session/booking-session.utils.js +6 -28
  105. package/dist/core/api/middlewares/error-handler/error-handler.js +5 -1
  106. package/dist/core/api/middlewares/retry/retry.constants.d.ts +3 -0
  107. package/dist/core/api/middlewares/retry/retry.constants.js +7 -0
  108. package/dist/core/api/middlewares/retry/retry.d.ts +2 -0
  109. package/dist/core/api/middlewares/retry/retry.js +48 -0
  110. package/dist/core/api/queries.d.ts +13 -38
  111. package/dist/core/api/queries.js +16 -99
  112. package/dist/core/events.d.ts +2 -4
  113. package/dist/core/i18n/date.d.ts +14 -5
  114. package/dist/core/i18n/date.js +47 -20
  115. package/dist/core/i18n/localization.js +10 -3
  116. package/dist/core/images/helpers.js +6 -5
  117. package/dist/core/logger.d.ts +17 -0
  118. package/dist/core/logger.js +13 -0
  119. package/dist/core/types/api-schema.d.ts +7872 -0
  120. package/dist/core/types/seats-config.d.ts +5 -4
  121. package/dist/core/types/seats-config.js +10 -3
  122. package/dist/core/utils/crypto-address.d.ts +12 -0
  123. package/dist/core/utils/crypto-address.js +17 -0
  124. package/dist/core/utils/datetime.d.ts +13 -11
  125. package/dist/core/utils/datetime.js +41 -51
  126. package/dist/core/utils/loyalty.d.ts +8 -0
  127. package/dist/core/utils/loyalty.js +10 -0
  128. package/dist/core/utils/redaction.d.ts +9 -0
  129. package/dist/core/utils/redaction.js +58 -0
  130. package/dist/core/utils/time.js +2 -3
  131. package/dist/helpers/helpers.d.ts +6 -0
  132. package/dist/helpers/helpers.js +33 -16
  133. package/dist/locales/ar-SA.d.ts +38 -21
  134. package/dist/locales/ar-SA.js +38 -21
  135. package/dist/locales/da-DK.d.ts +38 -21
  136. package/dist/locales/da-DK.js +38 -21
  137. package/dist/locales/de-DE.d.ts +38 -21
  138. package/dist/locales/de-DE.js +38 -21
  139. package/dist/locales/en-IE.d.ts +38 -21
  140. package/dist/locales/en-IE.js +38 -21
  141. package/dist/locales/en-US.d.ts +38 -21
  142. package/dist/locales/en-US.js +38 -21
  143. package/dist/locales/es-ES.d.ts +38 -21
  144. package/dist/locales/es-ES.js +38 -21
  145. package/dist/locales/fr-FR.d.ts +38 -21
  146. package/dist/locales/fr-FR.js +38 -21
  147. package/dist/locales/fr-MA.d.ts +38 -21
  148. package/dist/locales/fr-MA.js +38 -21
  149. package/dist/locales/is-IS.d.ts +38 -21
  150. package/dist/locales/is-IS.js +38 -21
  151. package/dist/locales/it-IT.d.ts +38 -21
  152. package/dist/locales/it-IT.js +38 -21
  153. package/dist/locales/ms-MY.d.ts +38 -21
  154. package/dist/locales/ms-MY.js +38 -21
  155. package/dist/locales/nb-NO.d.ts +38 -21
  156. package/dist/locales/nb-NO.js +38 -21
  157. package/dist/locales/pl-PL.d.ts +38 -21
  158. package/dist/locales/pl-PL.js +38 -21
  159. package/dist/locales/pt-PT.d.ts +38 -21
  160. package/dist/locales/pt-PT.js +38 -21
  161. package/dist/locales/sv-SE.d.ts +38 -21
  162. package/dist/locales/sv-SE.js +38 -21
  163. package/dist/locales/th-TH.d.ts +38 -21
  164. package/dist/locales/th-TH.js +38 -21
  165. package/dist/locales/tr-TR.d.ts +38 -21
  166. package/dist/locales/tr-TR.js +38 -21
  167. package/dist/locales/zh-CN.d.ts +38 -21
  168. package/dist/locales/zh-CN.js +38 -21
  169. package/dist/locales/zh-HK.d.ts +38 -21
  170. package/dist/locales/zh-HK.js +38 -21
  171. package/dist/mixins/base.mixin.d.ts +3 -1
  172. package/dist/mixins/base.mixin.js +10 -7
  173. package/dist/mixins/coinbase.mixin.d.ts +13 -17
  174. package/dist/mixins/coinbase.mixin.js +251 -288
  175. package/dist/mixins/error-modal.mixin.js +8 -4
  176. package/dist/mixins/location-search/location-search.d.ts +13 -1
  177. package/dist/mixins/location-search/location-search.js +35 -27
  178. package/dist/mixins/overlay/overlay-mixin.js +39 -3
  179. package/dist/mixins/overlay/types.d.ts +1 -0
  180. package/dist/mixins/search-mixin/search-mixin.js +8 -5
  181. package/dist/sdk/diagnostics.js +2 -0
  182. package/dist/sdk/mount.d.ts +10 -0
  183. package/dist/sdk/mount.js +20 -1
  184. package/dist/sdk/page-registry.js +5 -0
  185. package/dist/sdk/params.d.ts +53 -0
  186. package/dist/sdk/params.js +180 -0
  187. package/dist/sdk/redaction.d.ts +1 -4
  188. package/dist/sdk/redaction.js +2 -41
  189. package/dist/sdk/types.d.ts +21 -7
  190. package/dist/sdk/url.d.ts +1 -1
  191. package/dist/sdk/url.js +12 -5
  192. package/dist/sdk/validation.d.ts +1 -26
  193. package/dist/sdk/validation.js +14 -152
  194. package/dist/styles/tokens.d.ts +1 -1
  195. package/dist/styles/tokens.generated.d.ts +1 -1
  196. package/dist/styles/tokens.generated.js +1 -1
  197. package/dist/views/chrome-only-page/chrome-only-page.component.d.ts +30 -0
  198. package/dist/views/chrome-only-page/chrome-only-page.component.js +24 -0
  199. package/dist/views/chrome-only-page/chrome-only-page.d.ts +8 -0
  200. package/dist/views/chrome-only-page/chrome-only-page.js +6 -0
  201. package/dist/views/chrome-only-page/chrome-only-page.styles.js +13 -0
  202. package/dist/views/details-page/details-page.component.d.ts +11 -4
  203. package/dist/views/details-page/details-page.component.js +263 -237
  204. package/dist/views/details-page/details-page.utilts.d.ts +63 -3
  205. package/dist/views/details-page/details-page.utilts.js +53 -5
  206. package/dist/views/details-page/partials/location-categories/location-categories.component.d.ts +29 -0
  207. package/dist/views/details-page/partials/location-categories/location-categories.component.js +149 -0
  208. package/dist/views/details-page/partials/location-categories/location-categories.d.ts +8 -0
  209. package/dist/views/details-page/partials/location-categories/location-categories.js +6 -0
  210. package/dist/views/details-page/partials/location-categories/location-categories.styles.js +35 -0
  211. package/dist/views/details-page/partials/location-highlights/location-highlights.component.d.ts +26 -0
  212. package/dist/views/details-page/partials/location-highlights/location-highlights.component.js +158 -0
  213. package/dist/views/details-page/partials/location-highlights/location-highlights.d.ts +8 -0
  214. package/dist/views/details-page/partials/location-highlights/location-highlights.js +6 -0
  215. package/dist/views/details-page/partials/location-highlights/location-highlights.styles.js +42 -0
  216. package/dist/views/details-page/partials/tour-description/tour-description.component.js +1 -4
  217. package/dist/views/help-page/help-page.component.d.ts +2 -0
  218. package/dist/views/help-page/help-page.component.js +37 -18
  219. package/dist/views/help-page/help-page.utils.js +6 -5
  220. package/dist/views/landing-page/landing-page.component.d.ts +5 -8
  221. package/dist/views/landing-page/landing-page.component.js +82 -97
  222. package/dist/views/payment-page/controllers/crypto-auth.controller.d.ts +10 -4
  223. package/dist/views/payment-page/controllers/crypto-auth.controller.js +53 -31
  224. package/dist/views/payment-page/controllers/crypto-transfer.controller.d.ts +9 -5
  225. package/dist/views/payment-page/controllers/crypto-transfer.controller.js +26 -39
  226. package/dist/views/payment-page/controllers/payment-flow.controller.d.ts +6 -1
  227. package/dist/views/payment-page/controllers/payment-flow.controller.js +1 -0
  228. package/dist/views/payment-page/controllers/stripe-payment.controller.d.ts +20 -2
  229. package/dist/views/payment-page/controllers/stripe-payment.controller.js +42 -19
  230. package/dist/views/payment-page/partials/activity-details/activity-details.component.d.ts +2 -0
  231. package/dist/views/payment-page/partials/activity-details/activity-details.component.js +6 -3
  232. package/dist/views/payment-page/partials/billing-address/billing-address.component.d.ts +2 -0
  233. package/dist/views/payment-page/partials/billing-address/billing-address.component.js +5 -1
  234. package/dist/views/payment-page/partials/confirmation/confirmation.component.js +2 -3
  235. package/dist/views/payment-page/partials/country-field/country-field.component.js +1 -1
  236. package/dist/views/payment-page/partials/payment-type-selector/payment-type-selector.component.js +3 -3
  237. package/dist/views/payment-page/partials/stripe/stripe.component.d.ts +2 -0
  238. package/dist/views/payment-page/partials/stripe/stripe.component.js +36 -7
  239. package/dist/views/payment-page/partials/stripe/stripe.utils.js +0 -3
  240. package/dist/views/payment-page/payment-page.component.d.ts +39 -6
  241. package/dist/views/payment-page/payment-page.component.js +302 -178
  242. package/dist/views/payment-page/payment-page.constants.d.ts +1 -27
  243. package/dist/views/payment-page/payment-page.constants.js +3 -30
  244. package/dist/views/payment-page/payment-page.types.d.ts +1 -19
  245. package/dist/views/payment-page/payment-page.utils.d.ts +22 -13
  246. package/dist/views/payment-page/payment-page.utils.js +57 -75
  247. package/dist/views/payment-page/services/payment-api.service.d.ts +16 -34
  248. package/dist/views/payment-page/services/payment-api.service.js +19 -27
  249. package/dist/views/search-page/search-page.component.d.ts +2 -0
  250. package/dist/views/search-page/search-page.component.js +39 -20
  251. package/dist/views/suggestion-widget/suggestion-widget.component.d.ts +1 -0
  252. package/dist/views/suggestion-widget/suggestion-widget.component.js +6 -5
  253. package/package.json +24 -20
  254. package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.component.d.ts +0 -10
  255. package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.component.js +0 -43
  256. package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.d.ts +0 -8
  257. package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.js +0 -6
  258. package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.styles.js +0 -23
  259. package/dist/components/attraction-discovery/attraction-discovery.component.d.ts +0 -10
  260. package/dist/components/attraction-discovery/attraction-discovery.component.js +0 -52
  261. package/dist/components/attraction-discovery/attraction-discovery.constants.d.ts +0 -4
  262. package/dist/components/attraction-discovery/attraction-discovery.constants.js +0 -5
  263. package/dist/components/attraction-discovery/attraction-discovery.d.ts +0 -8
  264. package/dist/components/attraction-discovery/attraction-discovery.js +0 -6
  265. package/dist/components/attraction-discovery/attraction-discovery.styles.js +0 -193
  266. package/dist/components/basket-rewards/basket-rewards.component.d.ts +0 -10
  267. package/dist/components/basket-rewards/basket-rewards.component.js +0 -52
  268. package/dist/components/basket-rewards/basket-rewards.d.ts +0 -8
  269. package/dist/components/basket-rewards/basket-rewards.js +0 -6
  270. package/dist/components/basket-rewards/basket-rewards.styles.js +0 -18
  271. package/dist/components/filter-chip/filter-chip.component.d.ts +0 -12
  272. package/dist/components/filter-chip/filter-chip.component.js +0 -68
  273. package/dist/components/filter-chip/filter-chip.constants.d.ts +0 -2
  274. package/dist/components/filter-chip/filter-chip.constants.js +0 -2
  275. package/dist/components/filter-chip/filter-chip.d.ts +0 -8
  276. package/dist/components/filter-chip/filter-chip.js +0 -6
  277. package/dist/components/filter-chip/filter-chip.styles.d.ts +0 -2
  278. package/dist/components/filter-chip/filter-chip.styles.js +0 -162
  279. package/dist/components/image-carousel/image-carousel-item/image-carousel-item.component.d.ts +0 -10
  280. package/dist/components/image-carousel/image-carousel-item/image-carousel-item.component.js +0 -43
  281. package/dist/components/image-carousel/image-carousel-item/image-carousel-item.d.ts +0 -8
  282. package/dist/components/image-carousel/image-carousel-item/image-carousel-item.js +0 -6
  283. package/dist/components/image-carousel/image-carousel-item/image-carousel-item.styles.d.ts +0 -2
  284. package/dist/components/image-carousel/image-carousel-item/image-carousel-item.styles.js +0 -28
  285. package/dist/components/image-carousel/image-carousel.component.d.ts +0 -8
  286. package/dist/components/image-carousel/image-carousel.component.js +0 -36
  287. package/dist/components/image-carousel/image-carousel.d.ts +0 -8
  288. package/dist/components/image-carousel/image-carousel.js +0 -6
  289. package/dist/components/image-carousel/image-carousel.styles.d.ts +0 -2
  290. package/dist/components/image-carousel/image-carousel.styles.js +0 -72
  291. package/dist/components/itinerary/itinerary-item/itinerary-item.component.d.ts +0 -9
  292. package/dist/components/itinerary/itinerary-item/itinerary-item.component.js +0 -45
  293. package/dist/components/itinerary/itinerary-item/itinerary-item.d.ts +0 -8
  294. package/dist/components/itinerary/itinerary-item/itinerary-item.js +0 -6
  295. package/dist/components/itinerary/itinerary-item/itinerary-item.styles.d.ts +0 -2
  296. package/dist/components/itinerary/itinerary-item/itinerary-item.styles.js +0 -70
  297. package/dist/components/itinerary/itinerary.component.d.ts +0 -7
  298. package/dist/components/itinerary/itinerary.component.js +0 -23
  299. package/dist/components/itinerary/itinerary.d.ts +0 -8
  300. package/dist/components/itinerary/itinerary.js +0 -6
  301. package/dist/components/itinerary/itinerary.styles.d.ts +0 -2
  302. package/dist/components/itinerary/itinerary.styles.js +0 -15
  303. package/dist/components/marketing-tag/marketing-tag.component.d.ts +0 -5
  304. package/dist/components/marketing-tag/marketing-tag.component.js +0 -8
  305. package/dist/components/marketing-tag/marketing-tag.d.ts +0 -8
  306. package/dist/components/marketing-tag/marketing-tag.js +0 -6
  307. package/dist/components/marketing-tag/marketing-tag.styles.d.ts +0 -2
  308. package/dist/components/marketing-tag/marketing-tag.styles.js +0 -36
  309. package/dist/components/price/price.component.d.ts +0 -12
  310. package/dist/components/price/price.component.js +0 -38
  311. package/dist/components/price/price.d.ts +0 -8
  312. package/dist/components/price/price.js +0 -6
  313. package/dist/components/reviews/review/review.component.d.ts +0 -9
  314. package/dist/components/reviews/review/review.component.js +0 -41
  315. package/dist/components/reviews/review/review.d.ts +0 -8
  316. package/dist/components/reviews/review/review.js +0 -6
  317. package/dist/components/reviews/review/review.styles.d.ts +0 -2
  318. package/dist/components/reviews/review/review.styles.js +0 -45
  319. package/dist/components/reviews/reviews.component.d.ts +0 -9
  320. package/dist/components/reviews/reviews.component.js +0 -56
  321. package/dist/components/reviews/reviews.d.ts +0 -8
  322. package/dist/components/reviews/reviews.js +0 -6
  323. package/dist/components/reviews/reviews.styles.d.ts +0 -2
  324. package/dist/components/reviews/reviews.styles.js +0 -73
  325. package/dist/components/selected-tickets-preview/selected-tickets-preview.component.d.ts +0 -10
  326. package/dist/components/selected-tickets-preview/selected-tickets-preview.component.js +0 -51
  327. package/dist/components/selected-tickets-preview/selected-tickets-preview.d.ts +0 -8
  328. package/dist/components/selected-tickets-preview/selected-tickets-preview.js +0 -6
  329. package/dist/components/selected-tickets-preview/selected-tickets-preview.styles.d.ts +0 -2
  330. package/dist/components/selected-tickets-preview/selected-tickets-preview.styles.js +0 -89
  331. package/dist/components/tag/tag.component.d.ts +0 -8
  332. package/dist/components/tag/tag.component.js +0 -33
  333. package/dist/components/tag/tag.constants.d.ts +0 -1
  334. package/dist/components/tag/tag.constants.js +0 -1
  335. package/dist/components/tag/tag.d.ts +0 -8
  336. package/dist/components/tag/tag.js +0 -6
  337. package/dist/components/tag/tag.styles.d.ts +0 -2
  338. package/dist/components/tag/tag.styles.js +0 -56
  339. package/dist/components/tooltip/tooltip.component.d.ts +0 -19
  340. package/dist/components/tooltip/tooltip.component.js +0 -124
  341. package/dist/components/tooltip/tooltip.d.ts +0 -8
  342. package/dist/components/tooltip/tooltip.js +0 -6
  343. package/dist/components/tooltip/tooltip.styles.d.ts +0 -2
  344. package/dist/components/tooltip/tooltip.styles.js +0 -79
  345. package/dist/core/signals.d.ts +0 -2
  346. package/dist/core/signals.js +0 -3
  347. package/dist/core/storybook/argTypes.d.ts +0 -1
  348. package/dist/core/storybook/argTypes.js +0 -46
  349. package/dist/core/storybook/cssprops.d.ts +0 -30
  350. package/dist/core/storybook/cssprops.js +0 -46
  351. package/dist/core/storybook/demo.d.ts +0 -4
  352. package/dist/core/storybook/demo.js +0 -17
  353. package/dist/core/types/api-errors.d.ts +0 -8
  354. package/dist/core/types/api-errors.js +0 -1
  355. package/dist/styles/contrast-fixtures.d.ts +0 -5
  356. package/dist/styles/contrast-fixtures.js +0 -131
  357. package/dist/views/payment-page/domain/payment-mappers.d.ts +0 -7
  358. package/dist/views/payment-page/domain/payment-mappers.js +0 -7
  359. package/dist/views/payment-page/domain/payment-validators.d.ts +0 -6
  360. package/dist/views/payment-page/domain/payment-validators.js +0 -6
  361. package/dist/views/payment-page/domain/recovery-payload.d.ts +0 -8
  362. package/dist/views/payment-page/domain/recovery-payload.js +0 -7
  363. package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.component.d.ts +0 -22
  364. package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.component.js +0 -65
  365. package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.d.ts +0 -8
  366. package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.js +0 -6
  367. package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.styles.d.ts +0 -2
  368. package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.styles.js +0 -12
  369. package/dist/views/payment-page/payment-page.validation-schema.d.ts +0 -28
  370. package/dist/views/payment-page/payment-page.validation-schema.js +0 -42
  371. /package/dist/{components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.styles.d.ts → views/chrome-only-page/chrome-only-page.styles.d.ts} +0 -0
  372. /package/dist/{components/attraction-discovery/attraction-discovery.styles.d.ts → views/details-page/partials/location-categories/location-categories.styles.d.ts} +0 -0
  373. /package/dist/{components/basket-rewards/basket-rewards.styles.d.ts → views/details-page/partials/location-highlights/location-highlights.styles.d.ts} +0 -0
@@ -9,7 +9,7 @@ import { property, state } from "lit/decorators.js";
9
9
  import { classMap } from "lit/directives/class-map.js";
10
10
  import { memo } from "../../../core/utils/function.js";
11
11
  import { title } from "../../../core/utils/text.js";
12
- import { addDays, addMonths, differenceInCalendarMonths, differenceInDays, endOfMonth, endOfWeek, format, formatISO, isBefore, isSameMonth, isWithinInterval, parse, parseISO, startOfMonth, startOfWeek, } from "date-fns";
12
+ import { addDays, addMonths, differenceInCalendarMonths, differenceInDays, endOfMonth, endOfWeek, format, formatISO, isBefore, isSameMonth, isWithinInterval, parse, parseISO, startOfMonth, startOfToday, startOfWeek, } from "date-fns";
13
13
  import { getCalendarLocale, weekdayNames } from "../../../core/i18n/date.js";
14
14
  import { fireInternalEvent } from "../../../core/events.js";
15
15
  import styles from "./calendar.styles.js";
@@ -47,6 +47,10 @@ export const BaseCalendarMixin = (superClass) => {
47
47
  if (!this.range) {
48
48
  return false;
49
49
  }
50
+ // A range picks travel dates, and a past day can never be booked.
51
+ if (isBefore(day, startOfToday())) {
52
+ return true;
53
+ }
50
54
  if (this.selectedDates.length === 1 &&
51
55
  this.selectedDates[0] !== undefined) {
52
56
  return isBefore(day, parseISO(this.selectedDates[0]));
@@ -1,9 +1,9 @@
1
- import { type CSSResultGroup, LitElement } from "lit";
1
+ import { type CSSResultGroup, LitElement, type PropertyValues } from "lit";
2
2
  declare const BaseCalendarLitElement: import("../base/calendar.types.js").Constructor<import("../base/calendar.types.js").BaseCalendarMixinInterface> & typeof LitElement;
3
3
  export declare class CorasMultiMonthCalendar extends BaseCalendarLitElement {
4
4
  static styles: CSSResultGroup;
5
5
  private visibleMonthsDays;
6
- connectedCallback(): void;
6
+ protected willUpdate(changed: PropertyValues): void;
7
7
  render(): import("lit").TemplateResult<1>;
8
8
  }
9
9
  export {};
@@ -1,12 +1,5 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
1
  import { eachMonthOfInterval, format, parse } from "date-fns";
8
- import { LitElement, html } from "lit";
9
- import { state } from "lit/decorators.js";
2
+ import { LitElement, html, } from "lit";
10
3
  import { title } from "../../../core/utils/text.js";
11
4
  import { map } from "lit/directives/map.js";
12
5
  import styles from "./multi.styles.js";
@@ -16,24 +9,27 @@ const BaseCalendarLitElement = BaseCalendarMixin(LitElement);
16
9
  export class CorasMultiMonthCalendar extends BaseCalendarLitElement {
17
10
  constructor() {
18
11
  super(...arguments);
12
+ // Derived from minDate and maxDate in willUpdate, so the months follow
13
+ // the bounds instead of being fixed at connection time.
19
14
  this.visibleMonthsDays = {};
20
15
  }
21
16
  static { this.styles = [
22
17
  super.styles,
23
18
  styles,
24
19
  ]; }
25
- connectedCallback() {
26
- super.connectedCallback();
20
+ willUpdate(changed) {
21
+ super.willUpdate(changed);
22
+ if (!changed.has("minDate") && !changed.has("maxDate")) {
23
+ return;
24
+ }
27
25
  const eachMonth = eachMonthOfInterval({
28
26
  start: parse(this.minDate, "yyyy-MM", new Date()),
29
27
  end: parse(this.maxDate, "yyyy-MM", new Date()),
30
28
  });
31
- this.visibleMonthsDays = eachMonth.reduce((acc, month) => {
32
- const key = format(month, "yyyy-MM");
33
- const value = this.generateMonthDays(month);
34
- acc[key] = value;
35
- return acc;
36
- }, {});
29
+ this.visibleMonthsDays = Object.fromEntries(eachMonth.map((month) => [
30
+ format(month, "yyyy-MM"),
31
+ this.generateMonthDays(month),
32
+ ]));
37
33
  }
38
34
  render() {
39
35
  return html `
@@ -54,6 +50,3 @@ export class CorasMultiMonthCalendar extends BaseCalendarLitElement {
54
50
  `;
55
51
  }
56
52
  }
57
- __decorate([
58
- state()
59
- ], CorasMultiMonthCalendar.prototype, "visibleMonthsDays", void 0);
@@ -4,6 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
+ import { localized, msg } from "@lit/localize";
7
8
  import { LitElement, html } from "lit";
8
9
  import { property, query, queryAssignedElements, state, } from "lit/decorators.js";
9
10
  import { classMap } from "lit/directives/class-map.js";
@@ -11,7 +12,7 @@ import "../button/button.js";
11
12
  import "../icon/icon.js";
12
13
  import styles from "./carousel.styles.js";
13
14
  const OFFSET = 1;
14
- export class CorasCarousel extends LitElement {
15
+ let CorasCarousel = class CorasCarousel extends LitElement {
15
16
  constructor() {
16
17
  super(...arguments);
17
18
  this.assetsURL = "";
@@ -85,6 +86,7 @@ export class CorasCarousel extends LitElement {
85
86
  ><coras-icon
86
87
  assets-url="${this.assetsURL}"
87
88
  icon="chevron-left"
89
+ label=${msg("Previous")}
88
90
  ></coras-icon
89
91
  ></coras-button>
90
92
  <coras-button
@@ -97,12 +99,13 @@ export class CorasCarousel extends LitElement {
97
99
  ><coras-icon
98
100
  assets-url="${this.assetsURL}"
99
101
  icon="chevron-right"
102
+ label=${msg("Next")}
100
103
  ></coras-icon
101
104
  ></coras-button>
102
105
  </div>
103
106
  ${this.renderFooter()}`;
104
107
  }
105
- }
108
+ };
106
109
  __decorate([
107
110
  property({ type: String, attribute: "assets-url" })
108
111
  ], CorasCarousel.prototype, "assetsURL", void 0);
@@ -130,3 +133,7 @@ __decorate([
130
133
  __decorate([
131
134
  state()
132
135
  ], CorasCarousel.prototype, "currentScrollPosition", void 0);
136
+ CorasCarousel = __decorate([
137
+ localized()
138
+ ], CorasCarousel);
139
+ export { CorasCarousel };
@@ -1,13 +1,15 @@
1
- import { LitElement, type CSSResultGroup } from "lit";
1
+ import { LitElement, type CSSResultGroup, type PropertyValues } from "lit";
2
2
  import type { components } from "../../core/types/api-schema.js";
3
3
  import "../checkbox/checkbox.js";
4
4
  import "../checkbox-group/checkbox-group.js";
5
5
  export declare class CorasCategoriesTree extends LitElement {
6
6
  static styles: CSSResultGroup;
7
7
  categories: components["schemas"]["Category"][];
8
- get selectedCategories(): string;
9
- set selectedCategories(value: string);
8
+ /** Comma-separated slugs; a parent slug stands for all of its subcategories */
9
+ selectedCategories: string;
10
10
  private _selectedSlugs;
11
+ protected willUpdate(changed: PropertyValues): void;
12
+ private expandSelection;
11
13
  private getEventDetail;
12
14
  private handleCheckboxChange;
13
15
  private getParentCategoryStatus;
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { LitElement, html } from "lit";
7
+ import { LitElement, html, } from "lit";
8
8
  import { fireInternalEvent } from "../../core/events.js";
9
9
  import { property, state } from "lit/decorators.js";
10
10
  import { CheckboxVariants } from "../checkbox/checkbox.constants.js";
@@ -15,38 +15,36 @@ export class CorasCategoriesTree extends LitElement {
15
15
  constructor() {
16
16
  super(...arguments);
17
17
  this.categories = [];
18
+ /** Comma-separated slugs; a parent slug stands for all of its subcategories */
19
+ this.selectedCategories = "";
18
20
  this._selectedSlugs = new Set();
19
21
  }
20
22
  static { this.styles = styles; }
21
- get selectedCategories() {
22
- return Array.from(this._selectedSlugs).sort().join(",");
23
+ willUpdate(changed) {
24
+ // Expansion needs both inputs, and they may arrive in either order.
25
+ if (changed.has("categories") || changed.has("selectedCategories")) {
26
+ this._selectedSlugs = this.expandSelection(this.selectedCategories);
27
+ }
23
28
  }
24
- set selectedCategories(value) {
25
- const oldSlugs = new Set(this._selectedSlugs);
29
+ expandSelection(value) {
26
30
  const inputSlugs = new Set(value
27
- ?.split(",")
28
- .filter(Boolean)
29
- .map((s) => s.trim()) ?? []);
30
- const newSlugs = new Set(inputSlugs);
31
+ .split(",")
32
+ .map((slug) => slug.trim())
33
+ .filter(Boolean));
34
+ const slugs = new Set(inputSlugs);
31
35
  for (const category of this.categories) {
32
36
  if (!category.subcategories || category.subcategories.length === 0) {
33
37
  continue;
34
38
  }
35
39
  const subcategorySlugs = category.subcategories.map((sub) => sub.slug);
36
40
  if (inputSlugs.has(category.slug)) {
37
- subcategorySlugs.forEach((slug) => newSlugs.add(slug));
41
+ subcategorySlugs.forEach((slug) => slugs.add(slug));
38
42
  }
39
- else if (subcategorySlugs.length > 0 &&
40
- subcategorySlugs.every((slug) => inputSlugs.has(slug))) {
41
- newSlugs.add(category.slug);
43
+ else if (subcategorySlugs.every((slug) => inputSlugs.has(slug))) {
44
+ slugs.add(category.slug);
42
45
  }
43
46
  }
44
- if (oldSlugs.size !== newSlugs.size ||
45
- ![...oldSlugs].every((slug) => newSlugs.has(slug)) ||
46
- ![...newSlugs].every((slug) => oldSlugs.has(slug))) {
47
- this._selectedSlugs = newSlugs;
48
- this.requestUpdate("selectedCategories", oldSlugs);
49
- }
47
+ return slugs;
50
48
  }
51
49
  getEventDetail() {
52
50
  const result = new Set();
@@ -137,7 +135,10 @@ export class CorasCategoriesTree extends LitElement {
137
135
  }
138
136
  if (changed) {
139
137
  this._selectedSlugs = workingSelectedSlugs;
140
- fireInternalEvent(this, "selection-changed", this.getEventDetail());
138
+ // Keep the public property in step so a later `categories` change
139
+ // re-expands the user's current selection, not a stale one.
140
+ this.selectedCategories = this.getEventDetail();
141
+ fireInternalEvent(this, "selection-changed", this.selectedCategories);
141
142
  }
142
143
  }
143
144
  getParentCategoryStatus(category) {
@@ -196,7 +197,7 @@ __decorate([
196
197
  ], CorasCategoriesTree.prototype, "categories", void 0);
197
198
  __decorate([
198
199
  property({ type: String })
199
- ], CorasCategoriesTree.prototype, "selectedCategories", null);
200
+ ], CorasCategoriesTree.prototype, "selectedCategories", void 0);
200
201
  __decorate([
201
202
  state()
202
203
  ], CorasCategoriesTree.prototype, "_selectedSlugs", void 0);
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { LitElement, html } from "lit";
8
8
  import { property } from "lit/decorators.js";
9
9
  import { classMap } from "lit/directives/class-map.js";
10
+ import { ifDefined } from "lit/directives/if-defined.js";
10
11
  import { fireInternalEvent } from "../../core/events.js";
11
12
  import { CheckboxVariants } from "./checkbox.constants.js";
12
13
  import styles from "./checkbox.styles.js";
@@ -26,8 +27,9 @@ export class CorasCheckbox extends LitElement {
26
27
  }
27
28
  static { this.styles = styles; }
28
29
  render() {
30
+ const indeterminate = this.variant === CheckboxVariants.INDETERMINATE;
29
31
  const inputClasses = {
30
- indeterminate: this.variant === CheckboxVariants.INDETERMINATE,
32
+ indeterminate,
31
33
  main: this.variant === CheckboxVariants.MAIN && this.checked,
32
34
  };
33
35
  return html `
@@ -36,6 +38,8 @@ export class CorasCheckbox extends LitElement {
36
38
  class=${classMap(inputClasses)}
37
39
  part="input"
38
40
  .checked=${this.checked}
41
+ .indeterminate=${indeterminate}
42
+ aria-checked=${ifDefined(indeterminate ? "mixed" : undefined)}
39
43
  value=${this.value}
40
44
  type="checkbox"
41
45
  name="checkbox"
@@ -5,7 +5,7 @@ export class CorasCheckboxGroup extends LitElement {
5
5
  static { this.styles = styles; }
6
6
  render() {
7
7
  return html `<div class="checkbox-group">
8
- <slot name="primary" id="category-option"></slot>
8
+ <slot name="primary"></slot>
9
9
  <div class="options">
10
10
  <slot></slot>
11
11
  </div>
@@ -13,7 +13,7 @@ export default css `
13
13
  }
14
14
 
15
15
  .checkbox-group {
16
- #category-option {
16
+ slot[name="primary"] {
17
17
  font-size: var(--checkbox-group-category-option-font-size);
18
18
  font-weight: var(--checkbox-group-category-option-font-weight);
19
19
  color: var(--checkbox-group-category-option-color);
@@ -4,6 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
+ import { localized, msg } from "@lit/localize";
7
8
  import { html, LitElement } from "lit";
8
9
  import { property } from "lit/decorators.js";
9
10
  import { classMap } from "lit/directives/class-map.js";
@@ -11,7 +12,7 @@ import { fireInternalEvent } from "../../core/events.js";
11
12
  import "../button/button.js";
12
13
  import "../icon/icon.js";
13
14
  import styles from "./chip.styles.js";
14
- export class CorasChip extends LitElement {
15
+ let CorasChip = class CorasChip extends LitElement {
15
16
  constructor() {
16
17
  super(...arguments);
17
18
  this.assetsURL = "";
@@ -38,16 +39,20 @@ export class CorasChip extends LitElement {
38
39
  <coras-icon
39
40
  assets-url="${this.assetsURL}"
40
41
  icon="close"
41
- label="remove"
42
+ label=${msg("Remove")}
42
43
  ></coras-icon>
43
44
  </button>
44
45
  </span>
45
46
  `;
46
47
  }
47
- }
48
+ };
48
49
  __decorate([
49
50
  property({ type: String, attribute: "assets-url" })
50
51
  ], CorasChip.prototype, "assetsURL", void 0);
51
52
  __decorate([
52
53
  property()
53
54
  ], CorasChip.prototype, "variant", void 0);
55
+ CorasChip = __decorate([
56
+ localized()
57
+ ], CorasChip);
58
+ export { CorasChip };
@@ -87,6 +87,12 @@ export declare class CorasCryptoAuthModal extends LitElement {
87
87
  mfaEnrollmentError: string;
88
88
  /** Whether to show resend button for email OTP */
89
89
  showResend: boolean;
90
+ /**
91
+ * Number of email codes sent so far. Each increment confirms a resend
92
+ * succeeded and restarts the resend cooldown; a failed resend leaves the
93
+ * count alone so the button stays available.
94
+ */
95
+ emailCodeSendCount: number;
90
96
  /** Rate limit error message */
91
97
  rateLimitError: string;
92
98
  /** SMS rate limit error message */
@@ -62,6 +62,12 @@ let CorasCryptoAuthModal = class CorasCryptoAuthModal extends LitElement {
62
62
  this.mfaEnrollmentError = "";
63
63
  /** Whether to show resend button for email OTP */
64
64
  this.showResend = false;
65
+ /**
66
+ * Number of email codes sent so far. Each increment confirms a resend
67
+ * succeeded and restarts the resend cooldown; a failed resend leaves the
68
+ * count alone so the button stays available.
69
+ */
70
+ this.emailCodeSendCount = 0;
65
71
  /** Rate limit error message */
66
72
  this.rateLimitError = "";
67
73
  /** SMS rate limit error message */
@@ -119,6 +125,11 @@ let CorasCryptoAuthModal = class CorasCryptoAuthModal extends LitElement {
119
125
  // Deferred: Lit prohibits synchronous re-entrant property updates inside updated()
120
126
  setTimeout(() => this._startEmailResendTimer(), 0);
121
127
  }
128
+ else if (changedProperties.has("emailCodeSendCount") &&
129
+ changedProperties.get("emailCodeSendCount") !== undefined &&
130
+ this.codeSent) {
131
+ setTimeout(() => this._startEmailResendTimer(), 0);
132
+ }
122
133
  if (changedProperties.has("mfaEnrollmentCodeSent") &&
123
134
  this.mfaEnrollmentCodeSent) {
124
135
  this._mfaOtpCode = "";
@@ -207,7 +218,7 @@ let CorasCryptoAuthModal = class CorasCryptoAuthModal extends LitElement {
207
218
  const otpElement = this.renderRoot.querySelector("#email-otp");
208
219
  if (otpElement)
209
220
  otpElement.value = "";
210
- this._startEmailResendTimer();
221
+ // The cooldown starts when the parent confirms the send (emailCodeSendCount).
211
222
  fireInternalEvent(this, "resend-email-code", {});
212
223
  }
213
224
  handleInitiateMfaEnrollment() {
@@ -521,6 +532,9 @@ __decorate([
521
532
  __decorate([
522
533
  property({ type: Boolean, attribute: "show-resend" })
523
534
  ], CorasCryptoAuthModal.prototype, "showResend", void 0);
535
+ __decorate([
536
+ property({ type: Number, attribute: "email-code-send-count" })
537
+ ], CorasCryptoAuthModal.prototype, "emailCodeSendCount", void 0);
524
538
  __decorate([
525
539
  property({ type: String, attribute: "rate-limit-error" })
526
540
  ], CorasCryptoAuthModal.prototype, "rateLimitError", void 0);
@@ -39,7 +39,6 @@ export function renderCurrenciesOption({ currency, selected, onSelect, }) {
39
39
  const symbol = currencySymbol[currency];
40
40
  return html `
41
41
  <coras-select-option
42
- key=${currency}
43
42
  ?selected=${selected}
44
43
  @click=${() => onSelect && onSelect(currency)}
45
44
  >
@@ -12,7 +12,7 @@ import { msg, localized } from "@lit/localize";
12
12
  import { fireInternalEvent } from "../../core/events.js";
13
13
  import { scrollLock } from "../../core/utils/scroll-lock.js";
14
14
  import styles from "./dialog.styles.js";
15
- const FOCUSABLE_SELECTOR = [
15
+ const NATIVE_FOCUSABLE_SELECTOR = [
16
16
  'a[href]:not([tabindex="-1"])',
17
17
  'button:not([disabled]):not([tabindex="-1"])',
18
18
  'input:not([disabled]):not([tabindex="-1"])',
@@ -20,6 +20,40 @@ const FOCUSABLE_SELECTOR = [
20
20
  'textarea:not([disabled]):not([tabindex="-1"])',
21
21
  '[tabindex]:not([tabindex="-1"])',
22
22
  ].join(",");
23
+ // Custom elements whose host is not focusable but whose shadow root holds the
24
+ // real control. They are invisible to the native selector, so the trap has to
25
+ // look inside them.
26
+ const FOCUSABLE_CUSTOM_ELEMENTS = [
27
+ "coras-button",
28
+ "coras-checkbox",
29
+ "coras-field",
30
+ "coras-otp",
31
+ "coras-select-list",
32
+ ];
33
+ const FOCUSABLE_CANDIDATE_SELECTOR = [
34
+ NATIVE_FOCUSABLE_SELECTOR,
35
+ ...FOCUSABLE_CUSTOM_ELEMENTS,
36
+ ].join(",");
37
+ function resolveFocusTarget(candidate) {
38
+ if (candidate.matches(NATIVE_FOCUSABLE_SELECTOR)) {
39
+ return candidate;
40
+ }
41
+ const focusesThroughShadowRoot = candidate.shadowRoot?.delegatesFocus ||
42
+ FOCUSABLE_CUSTOM_ELEMENTS.includes(candidate.localName);
43
+ if (!focusesThroughShadowRoot) {
44
+ return null;
45
+ }
46
+ return (candidate.shadowRoot?.querySelector(NATIVE_FOCUSABLE_SELECTOR) ?? null);
47
+ }
48
+ // `document.activeElement` stops at the first shadow host, so walk down to the
49
+ // element that really holds focus.
50
+ function deepActiveElement() {
51
+ let active = document.activeElement;
52
+ while (active?.shadowRoot?.activeElement) {
53
+ active = active.shadowRoot.activeElement;
54
+ }
55
+ return active;
56
+ }
23
57
  /**
24
58
  * A unified dialog component that displays content in a modal overlay.
25
59
  *
@@ -45,7 +79,7 @@ let CorasDialog = class CorasDialog extends LitElement {
45
79
  /** Whether the dialog is open */
46
80
  this.open = false;
47
81
  /** Accessible label for the dialog */
48
- this.label = "Dialog";
82
+ this.label = msg("Dialog");
49
83
  /** Whether to show the built-in close button */
50
84
  this.showCloseButton = true;
51
85
  /** Whether to show the back button */
@@ -166,39 +200,36 @@ let CorasDialog = class CorasDialog extends LitElement {
166
200
  const dialog = this.shadowRoot?.querySelector(".dialog");
167
201
  if (!dialog)
168
202
  return;
169
- // Get focusable elements from both shadow DOM and slotted light DOM
170
- const shadowFocusable = Array.from(dialog.querySelectorAll(FOCUSABLE_SELECTOR));
171
- const slots = dialog.querySelectorAll("slot");
172
- const slottedFocusable = [];
173
- slots.forEach((slot) => {
174
- const assigned = slot.assignedElements({ flatten: true });
175
- assigned.forEach((el) => {
176
- if (el.matches?.(FOCUSABLE_SELECTOR)) {
177
- slottedFocusable.push(el);
178
- }
179
- const nested = el.querySelectorAll?.(FOCUSABLE_SELECTOR);
180
- if (nested) {
181
- slottedFocusable.push(...Array.from(nested));
203
+ // Collect candidates from both shadow DOM and slotted light DOM
204
+ const candidates = Array.from(dialog.querySelectorAll(FOCUSABLE_CANDIDATE_SELECTOR));
205
+ dialog.querySelectorAll("slot").forEach((slot) => {
206
+ slot.assignedElements({ flatten: true }).forEach((el) => {
207
+ if (el.matches(FOCUSABLE_CANDIDATE_SELECTOR)) {
208
+ candidates.push(el);
182
209
  }
210
+ candidates.push(...el.querySelectorAll(FOCUSABLE_CANDIDATE_SELECTOR));
183
211
  });
184
212
  });
185
- const focusable = [...shadowFocusable, ...slottedFocusable].filter((el) => el.offsetParent !== null);
213
+ const focusable = candidates
214
+ .map(resolveFocusTarget)
215
+ .filter((el) => el !== null && el.offsetParent !== null);
186
216
  if (focusable.length === 0) {
187
- event.preventDefault();
188
217
  return;
189
218
  }
190
219
  const first = focusable[0];
191
220
  const last = focusable[focusable.length - 1];
221
+ const active = deepActiveElement();
222
+ // Focus outside the list (the panel itself, or the body) is treated as a
223
+ // boundary so Tab cannot leave the dialog from there either.
224
+ const atBoundary = active === null || !focusable.includes(active);
192
225
  if (event.shiftKey) {
193
- if (document.activeElement === first ||
194
- this.shadowRoot?.activeElement === first) {
226
+ if (active === first || atBoundary) {
195
227
  event.preventDefault();
196
228
  last.focus();
197
229
  }
198
230
  }
199
231
  else {
200
- if (document.activeElement === last ||
201
- this.shadowRoot?.activeElement === last) {
232
+ if (active === last || atBoundary) {
202
233
  event.preventDefault();
203
234
  first.focus();
204
235
  }
@@ -1,11 +1,12 @@
1
- import { type CSSResultGroup, LitElement, type PropertyValues } from "lit";
1
+ import { type CSSResultGroup, LitElement } from "lit";
2
2
  import "../icon/icon.js";
3
3
  declare const CorasDrawer_base: import("../../mixins/overlay/types.js").Constructor<import("../../mixins/overlay/types.js").OverlayMixinInterface> & typeof LitElement;
4
4
  export declare class CorasDrawer extends CorasDrawer_base {
5
5
  static styles: CSSResultGroup;
6
6
  assetsURL: string;
7
7
  label: string;
8
- protected updated(changed: PropertyValues): void;
8
+ private panel;
9
+ focusPanel(): void;
9
10
  private renderHeader;
10
11
  render(): import("lit").TemplateResult<1>;
11
12
  }
@@ -5,8 +5,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { localized, msg } from "@lit/localize";
8
- import { LitElement, html, } from "lit";
9
- import { property } from "lit/decorators.js";
8
+ import { LitElement, html } from "lit";
9
+ import { property, query } from "lit/decorators.js";
10
10
  import { classMap } from "lit/directives/class-map.js";
11
11
  import "../icon/icon.js";
12
12
  import { OverlayMixin } from "../../mixins/overlay/overlay-mixin.js";
@@ -15,13 +15,15 @@ let CorasDrawer = class CorasDrawer extends OverlayMixin(LitElement) {
15
15
  constructor() {
16
16
  super(...arguments);
17
17
  this.assetsURL = "";
18
- this.label = "Drawer";
18
+ this.label = msg("Drawer");
19
19
  this.renderHeader = () => {
20
20
  return html `
21
21
  <div class="header">
22
22
  <slot name="header" data-testid="drawer-header-slot"></slot>
23
- <div
23
+ <button
24
24
  class="close"
25
+ type="button"
26
+ aria-label=${msg("Close")}
25
27
  @click="${this.handleModalClosed}"
26
28
  data-testid="drawer-close"
27
29
  >
@@ -29,27 +31,17 @@ let CorasDrawer = class CorasDrawer extends OverlayMixin(LitElement) {
29
31
  assets-url="${this.assetsURL}"
30
32
  part="header-icon"
31
33
  icon="close"
32
- label=${msg("Close")}
34
+ aria-hidden="true"
33
35
  close-icon-style
34
36
  ></coras-icon>
35
- </div>
37
+ </button>
36
38
  </div>
37
39
  `;
38
40
  };
39
41
  }
40
42
  static { this.styles = styles; }
41
- updated(changed) {
42
- super.updated(changed);
43
- if (changed.has("open")) {
44
- // to prevent scrolling when the drawer is open we hide the scrollbar,
45
- // but we need to add scrollbar width margin to the body to prevent the
46
- // content from jumping
47
- const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
48
- window.document.body.style.marginInlineEnd = this.open
49
- ? `${scrollbarWidth}px`
50
- : "";
51
- window.document.body.style.overflow = this.open ? "hidden" : "";
52
- }
43
+ focusPanel() {
44
+ this.panel.focus();
53
45
  }
54
46
  render() {
55
47
  const classes = {
@@ -89,6 +81,9 @@ __decorate([
89
81
  __decorate([
90
82
  property({ type: String })
91
83
  ], CorasDrawer.prototype, "label", void 0);
84
+ __decorate([
85
+ query(".panel")
86
+ ], CorasDrawer.prototype, "panel", void 0);
92
87
  CorasDrawer = __decorate([
93
88
  localized()
94
89
  ], CorasDrawer);
@@ -64,8 +64,11 @@ export default css `
64
64
 
65
65
  .close {
66
66
  display: flex;
67
- justify-content: flex-end;
68
- flex-grow: 1;
67
+ margin-inline-start: auto;
68
+ padding: 0;
69
+ border: 0;
70
+ background: none;
71
+ cursor: pointer;
69
72
 
70
73
  coras-icon {
71
74
  display: flex;