@ticketboothapp/booking 0.1.11 → 0.1.13

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 (255) hide show
  1. package/package.json +2 -1
  2. package/src/app/photo-sessions/photo-packages.ts +75 -0
  3. package/src/assets/icons/partner-logos/getyourguide.svg +8 -0
  4. package/src/assets/icons/plus.svg +3 -0
  5. package/src/colours.css +23 -0
  6. package/src/components/BookingDetails.module.css +1591 -0
  7. package/src/components/BookingDetails.tsx +2072 -354
  8. package/src/components/BookingWidget.tsx +28 -248
  9. package/src/components/JobApplicationDialog.module.css +440 -0
  10. package/src/components/JobApplicationDialog.tsx +620 -0
  11. package/src/components/ManageBookingView.tsx +28 -36
  12. package/src/components/PhoneInputWithCountry.module.css +131 -0
  13. package/src/components/PhoneInputWithCountry.tsx +44 -0
  14. package/src/components/PickupLocationDialog.module.css +360 -0
  15. package/src/components/PickupLocationDialog.tsx +357 -0
  16. package/src/components/PickupLocationMap.tsx +110 -0
  17. package/src/components/PostBookingDependentAddOnUpsell.module.css +174 -0
  18. package/src/components/PostBookingDependentAddOnUpsell.tsx +407 -0
  19. package/src/components/accordion.css +27 -0
  20. package/src/components/accordion.tsx +29 -0
  21. package/src/components/analytics/AnalyticsConsentRestore.tsx +19 -0
  22. package/src/components/analytics/AnalyticsScripts.tsx +106 -0
  23. package/src/components/analytics/CookieConsentBanner.css +86 -0
  24. package/src/components/analytics/CookieConsentBanner.tsx +102 -0
  25. package/src/components/booking/AddOnsSection.module.css +10 -0
  26. package/src/components/booking/AddOnsSection.tsx +184 -0
  27. package/src/components/booking/AdminPaymentChoiceModal.tsx +98 -0
  28. package/src/components/booking/BookingDialog.module.css +643 -0
  29. package/src/components/booking/BookingDialog.tsx +356 -0
  30. package/src/components/booking/BookingFlow.tsx +4385 -0
  31. package/src/components/booking/BookingFlowCollage.module.css +148 -0
  32. package/src/components/booking/BookingFlowCollage.tsx +184 -0
  33. package/src/components/booking/BookingFlowPlaceholder.module.css +27 -0
  34. package/src/components/booking/BookingFlowPlaceholder.tsx +25 -0
  35. package/src/components/booking/BookingFlowPreview.tsx +51 -0
  36. package/src/components/booking/BookingProductGrid.module.css +359 -0
  37. package/src/components/booking/BookingProductGrid.tsx +497 -0
  38. package/src/components/booking/Calendar.module.css +616 -0
  39. package/src/components/{Calendar.tsx → booking/Calendar.tsx} +464 -247
  40. package/src/components/booking/CancellationPolicySelector.module.css +124 -0
  41. package/src/components/booking/CancellationPolicySelector.tsx +142 -0
  42. package/src/components/booking/ChangeBookingDialog.tsx +562 -0
  43. package/src/components/booking/CheckoutForm.module.css +244 -0
  44. package/src/components/booking/CheckoutForm.tsx +364 -0
  45. package/src/components/{CheckoutModal.tsx → booking/CheckoutModal.tsx} +176 -19
  46. package/src/components/booking/DapFlowCollage.tsx +88 -0
  47. package/src/components/booking/DapTourDescription.tsx +35 -0
  48. package/src/components/booking/DependentAddOnBookingDialog.tsx +1350 -0
  49. package/src/components/booking/DependentAddOnPaymentForm.tsx +124 -0
  50. package/src/components/booking/InfoTooltip.tsx +108 -0
  51. package/src/components/booking/ItineraryBox.module.css +258 -0
  52. package/src/components/booking/ItineraryBox.tsx +550 -0
  53. package/src/components/{ItineraryBuilder.tsx → booking/ItineraryBuilder.tsx} +1 -2
  54. package/src/components/booking/ItineraryPlaceholder.module.css +45 -0
  55. package/src/components/booking/ItineraryPlaceholder.tsx +26 -0
  56. package/src/components/{MealDrinkAddOnSelector.tsx → booking/MealDrinkAddOnSelector.tsx} +21 -13
  57. package/src/components/booking/PickupLocationSelector.module.css +124 -0
  58. package/src/components/{PickupLocationSelector.tsx → booking/PickupLocationSelector.tsx} +315 -290
  59. package/src/components/booking/PickupTimeSelector.module.css +134 -0
  60. package/src/components/booking/PickupTimeSelector.tsx +112 -0
  61. package/src/components/{PriceBreakdown.tsx → booking/PriceBreakdown.tsx} +3 -3
  62. package/src/components/{PriceSummary.tsx → booking/PriceSummary.tsx} +51 -28
  63. package/src/components/booking/PrivateShuttleBookingFlow.module.css +357 -0
  64. package/src/components/booking/PrivateShuttleBookingFlow.tsx +2662 -0
  65. package/src/components/booking/PromoCodeInput.module.css +166 -0
  66. package/src/components/booking/PromoCodeInput.tsx +99 -0
  67. package/src/components/booking/ReturnTimeSelector.module.css +173 -0
  68. package/src/components/booking/ReturnTimeSelector.tsx +145 -0
  69. package/src/components/{TermsAcceptance.tsx → booking/TermsAcceptance.tsx} +9 -8
  70. package/src/components/booking/TicketSelector.module.css +164 -0
  71. package/src/components/booking/TicketSelector.tsx +199 -0
  72. package/src/components/booking/TourDescription.module.css +304 -0
  73. package/src/components/booking/TourDescription.tsx +273 -0
  74. package/src/components/booking/booking-flow-ui.ts +15 -1
  75. package/src/components/booking/booking-flow.css +944 -0
  76. package/src/components/bottom-sheet.module.css +78 -0
  77. package/src/components/bottom-sheet.tsx +60 -0
  78. package/src/components/breadcrumb.module.css +40 -0
  79. package/src/components/breadcrumb.tsx +36 -0
  80. package/src/components/button.css +245 -0
  81. package/src/components/button.tsx +152 -0
  82. package/src/components/client-bottom-sheet.tsx +14 -0
  83. package/src/components/colorable-svg.tsx +29 -0
  84. package/src/components/conditional-footer.tsx +27 -0
  85. package/src/components/contact-us.module.css +147 -0
  86. package/src/components/contact-us.tsx +49 -0
  87. package/src/components/email-signup.css +151 -0
  88. package/src/components/email-signup.tsx +63 -0
  89. package/src/components/faq-wrapper.module.css +47 -0
  90. package/src/components/faq-wrapper.tsx +15 -0
  91. package/src/components/footer.css +187 -0
  92. package/src/components/footer.tsx +143 -0
  93. package/src/components/global-simple-modal.tsx +33 -0
  94. package/src/components/google-review-summary.module.css +77 -0
  95. package/src/components/google-review-summary.tsx +50 -0
  96. package/src/components/hero-image.css +13 -0
  97. package/src/components/hero-image.tsx +44 -0
  98. package/src/components/image.css +29 -0
  99. package/src/components/image.tsx +113 -0
  100. package/src/components/language-aware-link.tsx +72 -0
  101. package/src/components/language-switcher.module.css +124 -0
  102. package/src/components/language-switcher.tsx +75 -0
  103. package/src/components/map-section.css +59 -0
  104. package/src/components/map-section.tsx +63 -0
  105. package/src/components/navbar.module.css +152 -0
  106. package/src/components/navbar.tsx +125 -0
  107. package/src/components/parallax-provider.tsx +11 -0
  108. package/src/components/partner/PartnerBookingPage.module.css +130 -0
  109. package/src/components/partner/PartnerBookingPage.tsx +390 -0
  110. package/src/components/partner/PartnerBookingPageWithBrowserMetadata.tsx +19 -35
  111. package/src/components/product-tag.module.css +30 -0
  112. package/src/components/product-tag.tsx +34 -0
  113. package/src/components/product-theme-pages/best-option.module.css +70 -0
  114. package/src/components/product-theme-pages/best-option.tsx +35 -0
  115. package/src/components/product-theme-pages/extended-tour-options.module.css +22 -0
  116. package/src/components/product-theme-pages/extended-tour-options.tsx +11 -0
  117. package/src/components/product-theme-pages/image-modal.tsx +248 -0
  118. package/src/components/product-theme-pages/photo-gallery.module.css +200 -0
  119. package/src/components/product-theme-pages/photo-gallery.tsx +90 -0
  120. package/src/components/product-theme-pages/product-theme-page-layout.module.css +13 -0
  121. package/src/components/product-theme-pages/product-theme-page-layout.tsx +67 -0
  122. package/src/components/product-theme-pages/top-of-fold.module.css +179 -0
  123. package/src/components/product-theme-pages/top-of-fold.tsx +80 -0
  124. package/src/components/product-tile/image-only-product-tile-desktop.module.css +106 -0
  125. package/src/components/product-tile/image-only-product-tile-desktop.tsx +56 -0
  126. package/src/components/product-tile/image-only-product-tile-mobile.module.css +122 -0
  127. package/src/components/product-tile/image-only-product-tile-mobile.tsx +89 -0
  128. package/src/components/product-tile/image-only-product-tile.tsx +44 -0
  129. package/src/components/product-tile/product-tile-card.module.css +84 -0
  130. package/src/components/product-tile/product-tile-card.tsx +61 -0
  131. package/src/components/review-highlights-section.css +85 -0
  132. package/src/components/review-highlights-section.tsx +127 -0
  133. package/src/components/season-closure-overlay.module.css +99 -0
  134. package/src/components/season-closure-overlay.tsx +98 -0
  135. package/src/components/simple-modal.tsx +69 -0
  136. package/src/components/simple-top-of-fold.module.css +76 -0
  137. package/src/components/simple-top-of-fold.tsx +34 -0
  138. package/src/components/spacer.css +41 -0
  139. package/src/components/spacer.tsx +23 -0
  140. package/src/components/star-rating.module.css +74 -0
  141. package/src/components/star-rating.tsx +48 -0
  142. package/src/components/terms/TermsContent.tsx +178 -0
  143. package/src/components/title-subtitle.module.css +10 -0
  144. package/src/components/title-subtitle.tsx +30 -0
  145. package/src/components/translatable-reviews.tsx +75 -0
  146. package/src/components/value-pill.module.css +59 -0
  147. package/src/components/value-pill.tsx +46 -0
  148. package/src/components/value-props.css +185 -0
  149. package/src/components/value-props.tsx +88 -0
  150. package/src/constants/booking-guide-quiz.ts +64 -0
  151. package/src/constants/contact-info.ts +2 -0
  152. package/src/constants/faq.ts +44 -0
  153. package/src/constants/images.ts +556 -0
  154. package/src/constants/json-ld/faq-json-ld.tsx +170 -0
  155. package/src/constants/json-ld/homepage-json-ld.tsx +138 -0
  156. package/src/constants/json-ld/job-posting-json-ld.tsx +92 -0
  157. package/src/constants/json-ld/organization-json-ld.tsx +62 -0
  158. package/src/constants/json-ld/page-json-ld.tsx +6 -0
  159. package/src/constants/json-ld/product-json-ld.tsx +154 -0
  160. package/src/constants/json-ld/review-json-ld.tsx +377 -0
  161. package/src/constants/navigation-links/footer-links.ts +48 -0
  162. package/src/constants/navigation-links/nav-bar-links.ts +41 -0
  163. package/src/constants/navigation-links/navigation-link.ts +6 -0
  164. package/src/constants/pill-values.ts +210 -0
  165. package/src/constants/products.ts +155 -0
  166. package/src/constants/quiz-recommendations.ts +506 -0
  167. package/src/constants/reviews.ts +75 -0
  168. package/src/constants/staff.ts +197 -0
  169. package/src/constants/value-props.ts +58 -0
  170. package/src/data/dap-descriptions/session-couples-families-friends.en.json +61 -0
  171. package/src/data/dap-descriptions/session-elopements.en.json +60 -0
  172. package/src/data/dap-descriptions/session-proposals.en.json +60 -0
  173. package/src/data/product-descriptions/afternoon-delight.en.json +35 -0
  174. package/src/data/product-descriptions/emerald-lake-escape.en.json +68 -0
  175. package/src/data/product-descriptions/lake-louise-adventure.en.json +74 -0
  176. package/src/data/product-descriptions/moraine-lake-adventure.en.json +78 -0
  177. package/src/data/product-descriptions/moraine-lake-sunrise-lake-louise-golden-hour.en.json +65 -0
  178. package/src/data/product-descriptions/moraine-lake-sunrise.en.json +64 -0
  179. package/src/data/product-descriptions/private-tour.en.json +80 -0
  180. package/src/data/product-descriptions/two-lakes-combo.en.json +65 -0
  181. package/src/data/products-config.json +101 -0
  182. package/src/hooks/use-bottom-sheet.tsx +15 -0
  183. package/src/hooks/use-simple-modal.tsx +27 -0
  184. package/src/hooks/useBookingSourceMetadataFromLocation.ts +21 -0
  185. package/src/hooks/useEmailSubscription.tsx +103 -0
  186. package/src/hooks/useEmbeddedInIframe.ts +16 -0
  187. package/src/hooks/useIsBookingLaunchLive.ts +49 -0
  188. package/src/hooks/useQuiz.tsx +210 -0
  189. package/src/index.ts +27 -2
  190. package/src/lib/analytics.ts +197 -0
  191. package/src/lib/booking/booking-source.ts +20 -2
  192. package/src/lib/{checkout-breakdown.ts → booking/checkout-breakdown.ts} +1 -1
  193. package/src/lib/booking/correlation-id.ts +46 -0
  194. package/src/lib/{i18n → booking/i18n}/messages/en.json +48 -4
  195. package/src/lib/{i18n → booking/i18n}/messages/fr.json +48 -4
  196. package/src/lib/booking/itinerary-display.ts +36 -0
  197. package/src/lib/{itinerary-labels.ts → booking/itinerary-labels.ts} +1 -1
  198. package/src/lib/{location-calculations.ts → booking/location-calculations.ts} +4 -4
  199. package/src/lib/{location-utils.ts → booking/location-utils.ts} +26 -0
  200. package/src/lib/{map-utils.ts → booking/map-utils.ts} +3 -3
  201. package/src/lib/booking/normalize-booking-product-id.ts +7 -0
  202. package/src/lib/{pickup-location-types.ts → booking/pickup-location-types.ts} +2 -2
  203. package/src/lib/{pricing.ts → booking/pricing.ts} +2 -2
  204. package/src/lib/booking/product-option-id.ts +35 -0
  205. package/src/lib/booking/source-metadata.ts +72 -7
  206. package/src/lib/booking/sunday-week.ts +14 -0
  207. package/src/lib/booking/trace-context.ts +62 -0
  208. package/src/lib/booking-api.ts +1793 -0
  209. package/src/lib/{constants.ts → booking-constants.ts} +11 -5
  210. package/src/lib/booking-types.ts +36 -0
  211. package/src/lib/currency.ts +38 -45
  212. package/src/lib/dap-descriptions.ts +50 -0
  213. package/src/lib/dap-itinerary-preview.ts +315 -0
  214. package/src/lib/dependent-add-on-api.ts +434 -0
  215. package/src/lib/env.ts +89 -5
  216. package/src/lib/firebase.ts +20 -0
  217. package/src/lib/job-application-api.ts +83 -0
  218. package/src/lib/manage-booking-embed-print.ts +16 -0
  219. package/src/lib/manage-booking-post-checkout.ts +68 -0
  220. package/src/lib/photo-dap-config.ts +228 -0
  221. package/src/lib/pickup/map-utils.ts +56 -0
  222. package/src/lib/pickup/marker-icons.ts +19 -0
  223. package/src/lib/product-descriptions.ts +66 -0
  224. package/src/lib/products-config.ts +73 -0
  225. package/src/providers/booking-dialog-provider.tsx +107 -38
  226. package/src/providers/bottom-sheet-provider.tsx +40 -0
  227. package/src/providers/dependent-add-on-dialog-provider.tsx +105 -0
  228. package/src/radius.css +5 -0
  229. package/src/spacing.css +7 -0
  230. package/src/strings/en.json +1774 -0
  231. package/src/strings/es.json +1573 -0
  232. package/src/strings/fr.json +1573 -0
  233. package/src/strings/index.js +23 -0
  234. package/src/text-style.css +97 -0
  235. package/src/types/fareharbor.d.ts +12 -0
  236. package/src/types/quiz.ts +59 -0
  237. package/src/utils/currency-converter.ts +101 -0
  238. package/src/components/BookingFlow.tsx +0 -2952
  239. package/src/components/LanguageSwitcher.tsx +0 -30
  240. package/src/components/PrivateShuttleBookingFlow.tsx +0 -2290
  241. package/src/components/ProductList.tsx +0 -78
  242. package/src/components/WhatsAppPhoneInput.tsx +0 -224
  243. package/src/components/index.ts +0 -31
  244. package/src/lib/api.ts +0 -801
  245. package/src/lib/booking-api-auth.ts +0 -9
  246. package/src/lib/checkout-breakdown.test.ts +0 -70
  247. package/src/types/google-maps.d.ts +0 -2
  248. /package/src/components/{CurrencySwitcher.tsx → booking/CurrencySwitcher.tsx} +0 -0
  249. /package/src/components/{ErrorBoundary.tsx → booking/ErrorBoundary.tsx} +0 -0
  250. /package/src/lib/{i18n → booking/i18n}/config.ts +0 -0
  251. /package/src/lib/{i18n → booking/i18n}/index.tsx +0 -0
  252. /package/src/lib/{marker-icons.ts → booking/marker-icons.ts} +0 -0
  253. /package/src/lib/{places-api.ts → booking/places-api.ts} +0 -0
  254. /package/src/lib/{theme.ts → booking/theme.ts} +0 -0
  255. /package/src/lib/{utils.ts → booking/utils.ts} +0 -0
@@ -0,0 +1,166 @@
1
+ /**
2
+ * Promo row — all layout in this module so it matches on viavia (full Tailwind) and in
3
+ * embedded hosts (e.g. provider dashboard) that only load booking-flow.css, not every Tailwind utility.
4
+ */
5
+
6
+ /* Mobile: label above field (like CheckoutForm). sm+: label left of field. */
7
+ .promoRow {
8
+ display: flex;
9
+ flex-direction: column;
10
+ align-items: stretch;
11
+ gap: 0.25rem;
12
+ padding-top: 1rem;
13
+ padding-bottom: 0.5rem;
14
+ font-size: 0.875rem;
15
+ line-height: 1.25rem;
16
+ border-top: 1px solid var(--booking-stone-200, #e7e5e4);
17
+ min-width: 0;
18
+ }
19
+
20
+ @media (min-width: 640px) {
21
+ .promoRow {
22
+ flex-direction: row;
23
+ align-items: center;
24
+ gap: 0.5rem;
25
+ }
26
+ }
27
+
28
+ .promoLabel {
29
+ flex-shrink: 0;
30
+ white-space: nowrap;
31
+ color: var(--booking-stone-600, #57534e);
32
+ }
33
+
34
+ .promoFieldRow {
35
+ display: flex;
36
+ align-items: center;
37
+ gap: 0.5rem;
38
+ flex: 1 1 0;
39
+ min-width: 0;
40
+ }
41
+
42
+ .promoDiscount {
43
+ margin-left: auto;
44
+ flex-shrink: 0;
45
+ white-space: nowrap;
46
+ font-weight: 500;
47
+ color: #dc2626;
48
+ }
49
+
50
+ .promoErrorInline {
51
+ font-size: 0.875rem;
52
+ line-height: 1.25rem;
53
+ color: #dc2626;
54
+ white-space: nowrap;
55
+ }
56
+
57
+ .inputWrap {
58
+ position: relative;
59
+ flex: 1 1 0;
60
+ min-width: 0;
61
+ max-width: 100%;
62
+ }
63
+
64
+ @media (min-width: 640px) {
65
+ .inputWrap {
66
+ max-width: 250px;
67
+ }
68
+ }
69
+
70
+ /* Box with icons inside (x and check) */
71
+ .input {
72
+ width: 100%;
73
+ min-width: 0;
74
+ padding: 0.375rem 2.25rem 0.375rem 0.5rem;
75
+ font-size: 0.875rem;
76
+ border-radius: 0.25rem;
77
+ border: 1px solid var(--booking-stone-300, #d6d3d1);
78
+ background: #fff;
79
+ color: var(--booking-stone-900, #1c1917);
80
+ box-sizing: border-box;
81
+ }
82
+
83
+ .input:focus {
84
+ outline: none;
85
+ border-color: var(--booking-stone-500, #78716c);
86
+ }
87
+
88
+ .input:read-only {
89
+ background: var(--booking-stone-50, #fafaf9);
90
+ cursor: default;
91
+ padding-right: 3.5rem;
92
+ }
93
+
94
+ /* X and check icons inside the box - dashboard style */
95
+ .removeBtn {
96
+ position: absolute;
97
+ right: 0.25rem;
98
+ top: 50%;
99
+ transform: translateY(-50%);
100
+ width: 1.5rem;
101
+ height: 1.5rem;
102
+ padding: 0;
103
+ border-radius: 9999px;
104
+ color: var(--booking-stone-500, #78716c);
105
+ background: var(--booking-stone-200, #e7e5e4);
106
+ border: none;
107
+ cursor: pointer;
108
+ display: flex;
109
+ align-items: center;
110
+ justify-content: center;
111
+ }
112
+
113
+ .removeBtn:hover {
114
+ background: var(--booking-stone-300, #d6d3d1);
115
+ color: var(--booking-stone-700, #44403c);
116
+ }
117
+
118
+ .loading {
119
+ position: absolute;
120
+ right: 0.5rem;
121
+ top: 50%;
122
+ transform: translateY(-50%);
123
+ width: 1.25rem;
124
+ height: 1.25rem;
125
+ border-radius: 9999px;
126
+ background: var(--booking-stone-100, #f5f5f4);
127
+ animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
128
+ }
129
+
130
+ @keyframes pulse {
131
+ 0%, 100% { opacity: 1; }
132
+ 50% { opacity: 0.5; }
133
+ }
134
+
135
+ .errorIcon {
136
+ position: absolute;
137
+ right: 0.5rem;
138
+ top: 50%;
139
+ transform: translateY(-50%);
140
+ width: 1.25rem;
141
+ height: 1.25rem;
142
+ border-radius: 9999px;
143
+ background: #ef4444;
144
+ color: #fff;
145
+ display: flex;
146
+ align-items: center;
147
+ justify-content: center;
148
+ }
149
+
150
+ /* Check icon - inside box, next to remove btn */
151
+ .appliedBadge {
152
+ position: absolute;
153
+ right: 2rem;
154
+ top: 50%;
155
+ transform: translateY(-50%);
156
+ width: 1.5rem;
157
+ height: 1.5rem;
158
+ border-radius: 9999px;
159
+ background: var(--booking-emerald-500, #10b981);
160
+ color: #fff;
161
+ display: flex;
162
+ align-items: center;
163
+ justify-content: center;
164
+ flex-shrink: 0;
165
+ }
166
+
@@ -0,0 +1,99 @@
1
+ 'use client';
2
+
3
+ import { Check, X } from 'lucide-react';
4
+ import { formatCurrencyAmount } from '@/lib/currency';
5
+ import type { Currency } from './CurrencySwitcher';
6
+ import styles from './PromoCodeInput.module.css';
7
+
8
+ type TranslationFn = (key: string, params?: Record<string, string>) => string;
9
+
10
+ interface PromoCodeInputProps {
11
+ promoCodeInput: string;
12
+ appliedPromoCode: string | null;
13
+ promoCodeError: string;
14
+ promoCodeValidating: boolean;
15
+ promoDiscountAmount: number;
16
+ currency: Currency;
17
+ locale: string;
18
+ t: TranslationFn;
19
+ onInputChange: (value: string) => void;
20
+ onApply: () => void;
21
+ onRemove: () => void;
22
+ locked?: boolean;
23
+ }
24
+
25
+ export function PromoCodeInput({
26
+ promoCodeInput,
27
+ appliedPromoCode,
28
+ promoCodeError,
29
+ promoCodeValidating,
30
+ promoDiscountAmount,
31
+ currency,
32
+ locale,
33
+ t,
34
+ onInputChange,
35
+ onApply,
36
+ onRemove,
37
+ locked = false,
38
+ }: PromoCodeInputProps) {
39
+ return (
40
+ <div className={styles.promoRow}>
41
+ <label htmlFor="booking-promo-code" className={styles.promoLabel}>
42
+ {t('booking.optionalPromoCode') || 'Promo / voucher / gift card'}
43
+ </label>
44
+ <div className={styles.promoFieldRow}>
45
+ <div className={styles.inputWrap}>
46
+ <input
47
+ type="text"
48
+ name="promoCode"
49
+ id="booking-promo-code"
50
+ value={promoCodeInput}
51
+ onChange={(e) => onInputChange(e.target.value.toUpperCase())}
52
+ onKeyDown={(e) => {
53
+ if (e.key === 'Enter') {
54
+ e.preventDefault();
55
+ onApply();
56
+ }
57
+ }}
58
+ placeholder={t('booking.promoCodePlaceholder')}
59
+ autoComplete="off"
60
+ readOnly={locked || !!appliedPromoCode}
61
+ disabled={locked}
62
+ className={styles.input}
63
+ />
64
+ {appliedPromoCode ? (
65
+ <>
66
+ <span className={styles.appliedBadge} aria-label={t('booking.promoApplied', { code: appliedPromoCode })}>
67
+ <Check className="w-3.5 h-3.5" strokeWidth={3} />
68
+ </span>
69
+ {!locked && (
70
+ <button
71
+ type="button"
72
+ onClick={onRemove}
73
+ className={styles.removeBtn}
74
+ aria-label={t('booking.removePromo')}
75
+ >
76
+ <X className="w-4 h-4" strokeWidth={2.5} />
77
+ </button>
78
+ )}
79
+ </>
80
+ ) : promoCodeValidating ? (
81
+ <span className={styles.loading} aria-hidden />
82
+ ) : promoCodeError ? (
83
+ <span className={styles.errorIcon} aria-label={promoCodeError}>
84
+ <X className="w-3 h-3" strokeWidth={3} />
85
+ </span>
86
+ ) : null}
87
+ </div>
88
+ {promoDiscountAmount > 0 && (
89
+ <span className={styles.promoDiscount}>
90
+ -{formatCurrencyAmount(promoDiscountAmount, currency, locale as 'en' | 'fr')}
91
+ </span>
92
+ )}
93
+ {promoCodeError && (
94
+ <span className={styles.promoErrorInline}>{promoCodeError}</span>
95
+ )}
96
+ </div>
97
+ </div>
98
+ );
99
+ }
@@ -0,0 +1,173 @@
1
+ /**
2
+ * Return time selector - list of return options with stay summary
3
+ */
4
+
5
+ .label {
6
+ display: block;
7
+ font-size: 0.875rem;
8
+ font-weight: 500;
9
+ color: var(--booking-stone-700, #44403c);
10
+ margin-bottom: 1rem;
11
+ }
12
+
13
+ .list {
14
+ display: flex;
15
+ flex-direction: column;
16
+ gap: 0.5rem;
17
+ }
18
+
19
+ .btn {
20
+ width: 100%;
21
+ padding: 1rem 1.25rem;
22
+ border-radius: 0.5rem;
23
+ border: 2px solid;
24
+ transition: all 0.2s;
25
+ text-align: left;
26
+ position: relative;
27
+ }
28
+
29
+ .btnSelected {
30
+ border-color: var(--booking-emerald-600, #059669);
31
+ background: var(--booking-emerald-600, #059669);
32
+ color: #fff;
33
+ }
34
+
35
+ .btnSelected .time,
36
+ .btnSelected .location {
37
+ color: rgba(255, 255, 255, 0.95);
38
+ }
39
+
40
+ .btnSelected .staySummary {
41
+ color: rgba(255, 255, 255, 0.85);
42
+ }
43
+
44
+ .btnSelected .price {
45
+ color: rgba(255, 255, 255, 0.95);
46
+ }
47
+
48
+ .btnAvailable {
49
+ border-color: var(--booking-stone-200, #e7e5e4);
50
+ background: var(--light-orange-background-dark, #f7e4dc);
51
+ }
52
+
53
+ .btnAvailable:hover {
54
+ border-color: #6ee7b7;
55
+ background: var(--light-orange-background, #fff1eb);
56
+ }
57
+
58
+ .btnDisabled {
59
+ border-color: var(--booking-stone-200, #e7e5e4);
60
+ background: var(--booking-stone-100, #f5f5f4);
61
+ color: var(--booking-stone-400, #a8a29e);
62
+ cursor: not-allowed;
63
+ }
64
+
65
+ .btnSoldOutAdmin {
66
+ border-color: #fca5a5;
67
+ background: #fee2e2;
68
+ color: #b91c1c;
69
+ }
70
+
71
+ .btnSoldOutAdmin:hover {
72
+ border-color: #fca5a5;
73
+ background: #fee2e2;
74
+ }
75
+
76
+ .btnSoldOutLocked {
77
+ border-color: #fca5a5;
78
+ background: #fee2e2;
79
+ color: #b91c1c;
80
+ cursor: not-allowed;
81
+ }
82
+
83
+ .btnSoldOutLocked:hover {
84
+ border-color: #fca5a5;
85
+ background: #fee2e2;
86
+ }
87
+
88
+ .badge {
89
+ position: absolute;
90
+ top: -0.5rem;
91
+ right: -0.25rem;
92
+ font-family: 'Poppins', sans-serif;
93
+ font-size: 0.75rem;
94
+ font-weight: 600;
95
+ text-transform: lowercase;
96
+ color: #fff;
97
+ padding: 0.25rem 0.5rem;
98
+ border-radius: 9999px;
99
+ background-color: #ff4d00;
100
+ }
101
+
102
+ .content {
103
+ display: flex;
104
+ align-items: center;
105
+ justify-content: space-between;
106
+ }
107
+
108
+ .details {
109
+ flex: 1;
110
+ }
111
+
112
+ .time {
113
+ font-weight: 500;
114
+ color: var(--booking-stone-900, #1c1917);
115
+ }
116
+
117
+ .location {
118
+ font-size: 0.75rem;
119
+ color: var(--booking-stone-600, #57534e);
120
+ margin-top: 0.125rem;
121
+ }
122
+
123
+ .capacity {
124
+ font-size: 0.75rem;
125
+ color: var(--booking-stone-500, #78716c);
126
+ margin-top: 0.125rem;
127
+ font-variant-numeric: tabular-nums;
128
+ }
129
+
130
+ .btnSelected .capacityDefault {
131
+ color: rgba(255, 255, 255, 0.9);
132
+ }
133
+
134
+ .capacityProjected {
135
+ font-size: 0.7rem;
136
+ line-height: 1.2;
137
+ margin-top: 0.25rem;
138
+ font-weight: 600;
139
+ color: #b91c1c;
140
+ font-variant-numeric: tabular-nums;
141
+ }
142
+
143
+ .staySummary {
144
+ font-size: 0.75rem;
145
+ color: var(--booking-stone-500, #78716c);
146
+ margin-top: 0.25rem;
147
+ font-weight: 600;
148
+ }
149
+
150
+ .soldOut {
151
+ font-size: 0.75rem;
152
+ font-weight: 500;
153
+ margin-top: 0.25rem;
154
+ color: #b91c1c;
155
+ }
156
+
157
+ .price {
158
+ font-size: 0.875rem;
159
+ font-weight: 600;
160
+ margin-left: 1rem;
161
+ }
162
+
163
+ .priceIncluded {
164
+ color: var(--booking-stone-600, #57534e);
165
+ }
166
+
167
+ .pricePositive {
168
+ color: var(--booking-emerald-600, #059669);
169
+ }
170
+
171
+ .priceNegative {
172
+ color: #b91c1c;
173
+ }
@@ -0,0 +1,145 @@
1
+ 'use client';
2
+
3
+ import { parseISO } from 'date-fns';
4
+ import { formatInTimeZone } from 'date-fns-tz';
5
+ import { formatCurrencyAmount } from '@/lib/currency';
6
+ import type { ReturnOption } from '@/lib/booking-api';
7
+ import type { Currency } from './CurrencySwitcher';
8
+ import styles from './ReturnTimeSelector.module.css';
9
+
10
+ type TranslationFn = (key: string, params?: Record<string, string | number>) => string;
11
+
12
+ interface ReturnTimeSelectorProps {
13
+ returnOptions: ReturnOption[];
14
+ selectedReturnOption: ReturnOption | null;
15
+ selectedTicketCount: number;
16
+ companyTimezone: string;
17
+ currency: Currency;
18
+ locale: string;
19
+ isAdmin: boolean;
20
+ t: TranslationFn;
21
+ onReturnSelect: (option: ReturnOption) => void;
22
+ getStaySummary: (returnDateTime: Date) => string | null;
23
+ }
24
+
25
+ export function ReturnTimeSelector({
26
+ returnOptions,
27
+ selectedReturnOption,
28
+ selectedTicketCount,
29
+ companyTimezone,
30
+ currency,
31
+ locale,
32
+ isAdmin,
33
+ t,
34
+ onReturnSelect,
35
+ getStaySummary,
36
+ }: ReturnTimeSelectorProps) {
37
+ const sortedReturnOptions = [...returnOptions].sort((a, b) => {
38
+ const timeA = parseISO(a.dateTime).getTime();
39
+ const timeB = parseISO(b.dateTime).getTime();
40
+ return timeA - timeB;
41
+ });
42
+
43
+ return (
44
+ <div>
45
+ <label className={styles.label}>
46
+ {t('booking.selectReturnTime') || 'Select Return Time'}
47
+ </label>
48
+
49
+ <div className={styles.list}>
50
+ {sortedReturnOptions.map((returnOption, index) => {
51
+ const returnDateTime = parseISO(returnOption.dateTime);
52
+ const displayTime = formatInTimeZone(returnDateTime, companyTimezone, 'h:mm a');
53
+ const isSelected = selectedReturnOption?.returnAvailabilityId === returnOption.returnAvailabilityId;
54
+ const isSoldOut = returnOption.vacancies === 0;
55
+ const returnVacancies = returnOption.vacancies;
56
+ const returnTotalCap = returnOption.totalCapacity ?? 0;
57
+ const returnBooked =
58
+ returnOption.bookedCapacity ?? (returnTotalCap - returnVacancies);
59
+ const projectedSeats = returnBooked + selectedTicketCount;
60
+ const isInsufficientForParty =
61
+ selectedTicketCount > 0 && (returnOption.vacancies ?? 0) < selectedTicketCount;
62
+ const canSelectReturn = isAdmin || (!isSoldOut && !isInsufficientForParty);
63
+ const priceAdjustmentPerPerson = returnOption.priceAdjustmentByCurrency?.[currency] ?? 0;
64
+ const returnOptionsCount = returnOptions.length;
65
+ const isMostPopular = returnOptionsCount > 1 && index === 0;
66
+ const staySummary = getStaySummary(returnDateTime);
67
+ const showAdminProjectedLoad =
68
+ isSelected && isAdmin && returnTotalCap > 0 && selectedTicketCount > returnVacancies;
69
+ const btnClass = (() => {
70
+ if (isSelected) return styles.btnSelected;
71
+ if (!isAdmin) {
72
+ return (isSoldOut || isInsufficientForParty) ? styles.btnSoldOutLocked : styles.btnAvailable;
73
+ }
74
+ if (isSoldOut && returnVacancies === 0) return styles.btnSoldOutAdmin;
75
+ return styles.btnAvailable;
76
+ })();
77
+ const priceClass = priceAdjustmentPerPerson === 0
78
+ ? styles.priceIncluded
79
+ : priceAdjustmentPerPerson > 0
80
+ ? styles.pricePositive
81
+ : styles.priceNegative;
82
+
83
+ return (
84
+ <button
85
+ key={returnOption.returnAvailabilityId}
86
+ onClick={() => canSelectReturn && onReturnSelect(returnOption)}
87
+ disabled={!canSelectReturn}
88
+ className={`${styles.btn} ${btnClass} ${isSelected ? 'booking-return-selected' : ''}`}
89
+ >
90
+ {isMostPopular && (
91
+ <div className={styles.badge}>
92
+ {t('booking.mostPopular')}
93
+ </div>
94
+ )}
95
+ <div className={styles.content}>
96
+ <div className={styles.details}>
97
+ <div className={styles.time}>{displayTime}</div>
98
+ <div className={styles.location}>from {returnOption.returnLocation}</div>
99
+ {isAdmin && returnTotalCap > 0 && (showAdminProjectedLoad ? (
100
+ <div className={styles.capacityProjected} aria-live="polite">
101
+ <div>{t('booking.adminBookingLoadLine1', { projected: projectedSeats })}</div>
102
+ <div>{t('booking.adminBookingLoadLine2', { total: returnTotalCap })}</div>
103
+ </div>
104
+ ) : (
105
+ <div
106
+ className={
107
+ isSelected
108
+ ? `${styles.capacity} ${styles.capacityDefault}`
109
+ : styles.capacity
110
+ }
111
+ >
112
+ {t('calendar.spotsAvailable', { count: returnVacancies })}
113
+ </div>
114
+ ))}
115
+ {staySummary && (
116
+ <div className={styles.staySummary}>
117
+ {staySummary}
118
+ </div>
119
+ )}
120
+ {isSoldOut && (
121
+ <div className={styles.soldOut}>
122
+ {t('booking.soldOut')}
123
+ </div>
124
+ )}
125
+ {isInsufficientForParty && !isAdmin && (
126
+ <div className={styles.soldOut}>
127
+ {`Only ${returnOption.vacancies} spot${returnOption.vacancies === 1 ? '' : 's'} left, decrease your ticket count below to select this time`}
128
+ </div>
129
+ )}
130
+ </div>
131
+ <div className={`${styles.price} ${priceClass}`}>
132
+ {priceAdjustmentPerPerson === 0
133
+ ? 'Included'
134
+ : priceAdjustmentPerPerson > 0
135
+ ? `+${formatCurrencyAmount(priceAdjustmentPerPerson, currency, locale as 'en' | 'fr')} per person`
136
+ : `${formatCurrencyAmount(priceAdjustmentPerPerson, currency, locale as 'en' | 'fr')} per person`}
137
+ </div>
138
+ </div>
139
+ </button>
140
+ );
141
+ })}
142
+ </div>
143
+ </div>
144
+ );
145
+ }
@@ -1,14 +1,15 @@
1
1
  'use client';
2
2
 
3
3
  import { useState } from 'react';
4
+ import { TermsContent } from '@/components/terms/TermsContent';
4
5
 
5
6
  export interface TermsAcceptanceProps {
6
7
  checked: boolean;
7
8
  onChange: (checked: boolean) => void;
8
9
  /** Translation function for labels */
9
10
  t: (key: string) => string;
10
- /** Optional custom terms content (HTML or plain text). If not provided, uses t('terms.content'). */
11
- termsContent?: string;
11
+ /** Optional custom terms content (React node). If not provided, uses full TermsContent from terms-conditions page. */
12
+ termsContent?: React.ReactNode;
12
13
  }
13
14
 
14
15
  /**
@@ -24,16 +25,16 @@ export function TermsAcceptance({
24
25
  termsContent,
25
26
  }: TermsAcceptanceProps) {
26
27
  const [modalOpen, setModalOpen] = useState(false);
27
- const content = termsContent ?? t('terms.content');
28
+ const content = termsContent ?? <TermsContent className="text-xs [&_h1]:text-base [&_h2]:text-sm [&_h3]:text-xs [&_p]:text-xs" />;
28
29
 
29
30
  return (
30
31
  <>
31
- <label className="flex items-start gap-3 cursor-pointer group">
32
+ <label className="flex items-center gap-3 cursor-pointer group">
32
33
  <input
33
34
  type="checkbox"
34
35
  checked={checked}
35
36
  onChange={(e) => onChange(e.target.checked)}
36
- className="mt-1 rounded border-stone-300 text-emerald-600 focus:ring-emerald-500"
37
+ className="shrink-0 rounded border-stone-300 text-emerald-600 focus:ring-emerald-500"
37
38
  aria-describedby="terms-view-link"
38
39
  />
39
40
  <span className="text-sm text-stone-700">
@@ -80,14 +81,14 @@ export function TermsAcceptance({
80
81
  </svg>
81
82
  </button>
82
83
  </div>
83
- <div className="flex-1 overflow-y-auto px-5 py-4 text-sm text-stone-600 whitespace-pre-wrap">
84
+ <div className="flex-1 min-h-0 overflow-y-auto px-5 py-4">
84
85
  {content}
85
86
  </div>
86
87
  <div className="px-5 py-4 border-t border-stone-200 shrink-0 flex gap-3 justify-end">
87
88
  <button
88
89
  type="button"
89
90
  onClick={() => setModalOpen(false)}
90
- className="px-4 py-2 text-sm font-medium text-stone-700 bg-stone-100 rounded-lg hover:bg-stone-200"
91
+ className="px-4 py-3 text-sm font-medium text-stone-700 bg-stone-100 rounded-lg hover:bg-stone-200"
91
92
  >
92
93
  {t('common.close')}
93
94
  </button>
@@ -97,7 +98,7 @@ export function TermsAcceptance({
97
98
  onChange(true);
98
99
  setModalOpen(false);
99
100
  }}
100
- className="px-4 py-2 text-sm font-medium text-white bg-emerald-600 rounded-lg hover:bg-emerald-700"
101
+ className="px-4 py-3 text-sm font-medium text-white bg-emerald-600 rounded-lg hover:bg-emerald-700"
101
102
  >
102
103
  {t('terms.acceptAndClose')}
103
104
  </button>