@ticketboothapp/booking 1.2.24 → 1.2.25-rc.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 (158) hide show
  1. package/package.json +29 -2
  2. package/src/assets/icons/minus.svg +7 -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 +2264 -0
  8. package/src/components/BookingWidget.tsx +302 -0
  9. package/src/components/ManageBookingView.tsx +437 -0
  10. package/src/components/PhoneInputWithCountry.module.css +131 -0
  11. package/src/components/PhoneInputWithCountry.tsx +44 -0
  12. package/src/components/PickupLocationDialog.module.css +360 -0
  13. package/src/components/PickupLocationDialog.tsx +357 -0
  14. package/src/components/PostBookingDependentAddOnUpsell.module.css +174 -0
  15. package/src/components/PostBookingDependentAddOnUpsell.tsx +407 -0
  16. package/src/components/booking/AddOnsSection.module.css +10 -0
  17. package/src/components/booking/AddOnsSection.tsx +184 -0
  18. package/src/components/booking/AdminPaymentChoiceModal.tsx +98 -0
  19. package/src/components/booking/BookingDialog.module.css +643 -0
  20. package/src/components/booking/BookingDialog.tsx +356 -0
  21. package/src/components/booking/BookingFlow.tsx +4385 -0
  22. package/src/components/booking/BookingFlowCollage.module.css +148 -0
  23. package/src/components/booking/BookingFlowCollage.tsx +184 -0
  24. package/src/components/booking/BookingFlowPlaceholder.module.css +27 -0
  25. package/src/components/booking/BookingFlowPlaceholder.tsx +25 -0
  26. package/src/components/booking/BookingFlowPreview.tsx +51 -0
  27. package/src/components/booking/BookingProductGrid.module.css +359 -0
  28. package/src/components/booking/BookingProductGrid.tsx +497 -0
  29. package/src/components/booking/Calendar.module.css +616 -0
  30. package/src/components/booking/Calendar.tsx +1123 -0
  31. package/src/components/booking/CancellationPolicySelector.module.css +124 -0
  32. package/src/components/booking/CancellationPolicySelector.tsx +142 -0
  33. package/src/components/booking/ChangeBookingDialog.tsx +562 -0
  34. package/src/components/booking/CheckoutForm.module.css +244 -0
  35. package/src/components/booking/CheckoutForm.tsx +364 -0
  36. package/src/components/booking/CheckoutModal.tsx +451 -0
  37. package/src/components/booking/CurrencySwitcher.tsx +81 -0
  38. package/src/components/booking/DapFlowCollage.tsx +88 -0
  39. package/src/components/booking/DapTourDescription.tsx +35 -0
  40. package/src/components/booking/DependentAddOnBookingDialog.tsx +1350 -0
  41. package/src/components/booking/DependentAddOnPaymentForm.tsx +124 -0
  42. package/src/components/booking/ErrorBoundary.tsx +63 -0
  43. package/src/components/booking/InfoTooltip.tsx +108 -0
  44. package/src/components/booking/ItineraryBox.module.css +258 -0
  45. package/src/components/booking/ItineraryBox.tsx +550 -0
  46. package/src/components/booking/ItineraryBuilder.tsx +82 -0
  47. package/src/components/booking/ItineraryPlaceholder.module.css +45 -0
  48. package/src/components/booking/ItineraryPlaceholder.tsx +26 -0
  49. package/src/components/booking/MealDrinkAddOnSelector.tsx +338 -0
  50. package/src/components/booking/PickupLocationSelector.module.css +124 -0
  51. package/src/components/booking/PickupLocationSelector.tsx +1566 -0
  52. package/src/components/booking/PickupTimeSelector.module.css +134 -0
  53. package/src/components/booking/PickupTimeSelector.tsx +112 -0
  54. package/src/components/booking/PriceBreakdown.tsx +154 -0
  55. package/src/components/booking/PriceSummary.tsx +234 -0
  56. package/src/components/booking/PrivateShuttleBookingFlow.module.css +357 -0
  57. package/src/components/booking/PrivateShuttleBookingFlow.tsx +2662 -0
  58. package/src/components/booking/PromoCodeInput.module.css +166 -0
  59. package/src/components/booking/PromoCodeInput.tsx +99 -0
  60. package/src/components/booking/ReturnTimeSelector.module.css +173 -0
  61. package/src/components/booking/ReturnTimeSelector.tsx +145 -0
  62. package/src/components/booking/TermsAcceptance.tsx +111 -0
  63. package/src/components/booking/TicketSelector.module.css +164 -0
  64. package/src/components/booking/TicketSelector.tsx +199 -0
  65. package/src/components/booking/TourDescription.module.css +304 -0
  66. package/src/components/booking/TourDescription.tsx +273 -0
  67. package/src/components/booking/booking-flow-ui.ts +38 -0
  68. package/src/components/booking/booking-flow.css +944 -0
  69. package/src/components/button.css +245 -0
  70. package/src/components/button.tsx +152 -0
  71. package/src/components/colorable-svg.tsx +29 -0
  72. package/src/components/image.css +29 -0
  73. package/src/components/image.tsx +113 -0
  74. package/src/components/partner/PartnerBookingPage.module.css +130 -0
  75. package/src/components/partner/PartnerBookingPage.tsx +390 -0
  76. package/src/components/partner/PartnerBookingPageWithBrowserMetadata.tsx +45 -0
  77. package/src/components/product-tag.module.css +30 -0
  78. package/src/components/product-tag.tsx +34 -0
  79. package/src/components/product-theme-pages/image-modal.tsx +248 -0
  80. package/src/components/product-theme-pages/photo-gallery.module.css +200 -0
  81. package/src/components/terms/TermsContent.tsx +178 -0
  82. package/src/components/value-pill.module.css +59 -0
  83. package/src/components/value-pill.tsx +46 -0
  84. package/src/constants/images.ts +556 -0
  85. package/src/constants/pill-values.ts +210 -0
  86. package/src/constants/products.ts +155 -0
  87. package/src/contexts/AvailabilitiesCacheContext.tsx +125 -0
  88. package/src/contexts/BookingAppContext.tsx +134 -0
  89. package/src/contexts/CompanyContext.tsx +70 -0
  90. package/src/data/dap-descriptions/session-couples-families-friends.en.json +61 -0
  91. package/src/data/dap-descriptions/session-elopements.en.json +60 -0
  92. package/src/data/dap-descriptions/session-proposals.en.json +60 -0
  93. package/src/data/product-descriptions/afternoon-delight.en.json +35 -0
  94. package/src/data/product-descriptions/emerald-lake-escape.en.json +68 -0
  95. package/src/data/product-descriptions/lake-louise-adventure.en.json +74 -0
  96. package/src/data/product-descriptions/moraine-lake-adventure.en.json +78 -0
  97. package/src/data/product-descriptions/moraine-lake-sunrise-lake-louise-golden-hour.en.json +65 -0
  98. package/src/data/product-descriptions/moraine-lake-sunrise.en.json +64 -0
  99. package/src/data/product-descriptions/private-tour.en.json +80 -0
  100. package/src/data/product-descriptions/two-lakes-combo.en.json +65 -0
  101. package/src/data/products-config.json +101 -0
  102. package/src/hooks/useBookingSourceMetadataFromLocation.ts +21 -0
  103. package/src/hooks/useIsBookingLaunchLive.ts +49 -0
  104. package/src/index.ts +79 -0
  105. package/src/lib/analytics.ts +197 -0
  106. package/src/lib/booking/booking-source.ts +51 -0
  107. package/src/lib/booking/checkout-breakdown.ts +69 -0
  108. package/src/lib/booking/correlation-id.ts +46 -0
  109. package/src/lib/booking/i18n/config.ts +21 -0
  110. package/src/lib/booking/i18n/index.tsx +144 -0
  111. package/src/lib/booking/i18n/messages/en.json +236 -0
  112. package/src/lib/booking/i18n/messages/fr.json +236 -0
  113. package/src/lib/booking/itinerary-display.ts +36 -0
  114. package/src/lib/booking/itinerary-labels.ts +70 -0
  115. package/src/lib/booking/location-calculations.ts +43 -0
  116. package/src/lib/booking/location-utils.ts +165 -0
  117. package/src/lib/booking/map-utils.ts +153 -0
  118. package/src/lib/booking/marker-icons.ts +113 -0
  119. package/src/lib/booking/normalize-booking-product-id.ts +21 -0
  120. package/src/lib/booking/pickup-location-types.ts +25 -0
  121. package/src/lib/booking/places-api.ts +154 -0
  122. package/src/lib/booking/pricing.ts +466 -0
  123. package/src/lib/booking/product-option-id.ts +35 -0
  124. package/src/lib/booking/source-metadata.ts +226 -0
  125. package/src/lib/booking/sunday-week.ts +14 -0
  126. package/src/lib/booking/theme.ts +83 -0
  127. package/src/lib/booking/trace-context.ts +62 -0
  128. package/src/lib/booking/utils.ts +9 -0
  129. package/src/lib/booking-api.ts +1793 -0
  130. package/src/lib/booking-constants.ts +23 -0
  131. package/src/lib/booking-ref.ts +13 -0
  132. package/src/lib/booking-types.ts +36 -0
  133. package/src/lib/currency.ts +81 -0
  134. package/src/lib/dap-descriptions.ts +50 -0
  135. package/src/lib/dap-itinerary-preview.ts +315 -0
  136. package/src/lib/dependent-add-on-api.ts +434 -0
  137. package/src/lib/env.ts +96 -0
  138. package/src/lib/firebase.ts +20 -0
  139. package/src/lib/job-application-api.ts +83 -0
  140. package/src/lib/manage-booking-embed-print.ts +16 -0
  141. package/src/lib/manage-booking-post-checkout.ts +68 -0
  142. package/src/lib/photo-dap-config.ts +228 -0
  143. package/src/lib/photo-packages.ts +75 -0
  144. package/src/lib/pickup/map-utils.ts +56 -0
  145. package/src/lib/pickup/marker-icons.ts +19 -0
  146. package/src/lib/product-descriptions.ts +66 -0
  147. package/src/lib/products-config.ts +73 -0
  148. package/src/providers/booking-dialog-provider.tsx +282 -0
  149. package/src/providers/dependent-add-on-dialog-provider.tsx +105 -0
  150. package/src/radius.css +5 -0
  151. package/src/spacing.css +7 -0
  152. package/src/strings/en.json +1774 -0
  153. package/src/strings/es.json +1573 -0
  154. package/src/strings/fr.json +1573 -0
  155. package/src/strings/index.js +23 -0
  156. package/src/text-style.css +56 -0
  157. package/src/utils/currency-converter.ts +101 -0
  158. package/tsconfig.json +8 -2
@@ -0,0 +1,244 @@
1
+ /**
2
+ * Checkout form - contact info, pickup location, terms, submit
3
+ */
4
+
5
+ .section {
6
+ border-top: 1px solid var(--booking-stone-200, #e7e5e4);
7
+ padding-top: 0.5rem;
8
+ margin-top: -1rem;
9
+ }
10
+
11
+ .summaryWrapper {
12
+ margin-bottom: 1rem;
13
+ }
14
+
15
+ .contactSection {
16
+ margin-top: 1.5rem;
17
+ display: flex;
18
+ flex-direction: column;
19
+ gap: 1rem;
20
+ }
21
+
22
+ .contactGrid {
23
+ display: grid;
24
+ grid-template-columns: 1fr;
25
+ gap: 1rem;
26
+ }
27
+
28
+ @media (min-width: 640px) {
29
+ .contactGrid {
30
+ grid-template-columns: repeat(2, 1fr);
31
+ }
32
+ }
33
+
34
+ .label {
35
+ display: block;
36
+ font-size: 0.875rem;
37
+ font-weight: 500;
38
+ color: var(--booking-stone-700, #44403c);
39
+ margin-bottom: 0.5rem;
40
+ }
41
+
42
+ .required {
43
+ color: #b91c1c;
44
+ }
45
+
46
+ .input {
47
+ width: 100%;
48
+ padding: 0.875rem 1.25rem;
49
+ border-radius: 0.5rem;
50
+ border: 1px solid var(--booking-stone-300, #d6d3d1);
51
+ font-size: 1rem;
52
+ color: var(--booking-stone-900, #1c1917);
53
+ }
54
+
55
+ .input:focus {
56
+ outline: none;
57
+ border-color: var(--booking-stone-500, #78716c);
58
+ }
59
+
60
+ .inputError {
61
+ font-size: 0.75rem;
62
+ color: #b91c1c;
63
+ margin-top: 0.375rem;
64
+ }
65
+
66
+ .contactStaticValue {
67
+ margin: 0;
68
+ font-size: 1rem;
69
+ line-height: 1.4;
70
+ color: var(--booking-stone-900, #1c1917);
71
+ font-weight: 500;
72
+ }
73
+
74
+ .pickupSection {
75
+ border-top: 1px solid var(--booking-stone-200, #e7e5e4);
76
+ padding-top: 1.5rem;
77
+ margin-top: 1.5rem;
78
+ }
79
+
80
+ .pickupHeader {
81
+ display: flex;
82
+ align-items: center;
83
+ justify-content: space-between;
84
+ }
85
+
86
+ .pickupLabel {
87
+ display: block;
88
+ font-size: 0.875rem;
89
+ font-weight: 500;
90
+ color: var(--booking-stone-700, #44403c);
91
+ margin-bottom: 0.25rem;
92
+ }
93
+
94
+ .pickupName {
95
+ font-size: 0.875rem;
96
+ color: var(--booking-stone-900, #1c1917);
97
+ }
98
+
99
+ .pickupAddress {
100
+ font-size: 0.75rem;
101
+ color: var(--booking-stone-500, #78716c);
102
+ }
103
+
104
+ .pickupNotes {
105
+ font-size: 0.75rem;
106
+ color: #b45309;
107
+ background: #fffbeb;
108
+ border: 1px solid #fde68a;
109
+ border-radius: 0.25rem;
110
+ padding: 0.5rem;
111
+ margin-top: 0.5rem;
112
+ }
113
+
114
+ .changeBtn {
115
+ font-size: 0.875rem;
116
+ color: var(--booking-emerald-600, #059669);
117
+ text-decoration: underline;
118
+ background: none;
119
+ border: none;
120
+ cursor: pointer;
121
+ }
122
+
123
+ .changeBtn:hover {
124
+ color: var(--booking-emerald-700, #047857);
125
+ }
126
+
127
+ .errorBox {
128
+ padding: 1rem;
129
+ background: #fef2f2;
130
+ border: 1px solid #fecaca;
131
+ border-radius: 0.5rem;
132
+ color: #b91c1c;
133
+ margin-top: 1rem;
134
+ }
135
+
136
+ .adminSection {
137
+ margin-top: 1rem;
138
+ padding: 1rem;
139
+ background: rgba(254, 243, 199, 0.5);
140
+ border: 1px solid #fde68a;
141
+ border-radius: 0.5rem;
142
+ display: flex;
143
+ flex-direction: column;
144
+ gap: 0.75rem;
145
+ }
146
+
147
+ .adminTitle {
148
+ font-size: 0.875rem;
149
+ font-weight: 500;
150
+ color: var(--booking-stone-700, #44403c);
151
+ }
152
+
153
+ .adminCheckbox {
154
+ display: flex;
155
+ align-items: flex-start;
156
+ gap: 0.5rem;
157
+ cursor: pointer;
158
+ }
159
+
160
+ .adminCheckbox input {
161
+ margin-top: 0.25rem;
162
+ height: 1rem;
163
+ width: 1rem;
164
+ border-radius: 0.25rem;
165
+ border: 1px solid var(--booking-stone-300, #d6d3d1);
166
+ }
167
+
168
+ .adminCheckbox span {
169
+ font-size: 0.875rem;
170
+ color: var(--booking-stone-600, #57534e);
171
+ }
172
+
173
+ .termsSection {
174
+ margin-top: 1rem;
175
+ padding: 1rem;
176
+ background: var(--booking-stone-50, #fafaf9);
177
+ border-radius: 0.5rem;
178
+ border: 1px solid var(--booking-stone-200, #e7e5e4);
179
+ }
180
+
181
+ .attributionConfirmSection {
182
+ margin-top: 0.75rem;
183
+ padding: 0.85rem 0.95rem;
184
+ border: 1px solid #bfdbfe;
185
+ background: #eff6ff;
186
+ border-radius: 0.5rem;
187
+ }
188
+
189
+ .attributionSummaryText {
190
+ margin: 0;
191
+ font-size: 0.875rem;
192
+ line-height: 1.4;
193
+ color: #1e3a8a;
194
+ }
195
+
196
+ .attributionConfirmLabel {
197
+ margin-top: 0.55rem;
198
+ display: flex;
199
+ gap: 0.5rem;
200
+ align-items: flex-start;
201
+ cursor: pointer;
202
+ }
203
+
204
+ .attributionConfirmLabel input {
205
+ margin-top: 0.2rem;
206
+ }
207
+
208
+ .attributionConfirmLabel span {
209
+ font-size: 0.8125rem;
210
+ line-height: 1.35;
211
+ color: #1e40af;
212
+ font-weight: 500;
213
+ }
214
+
215
+ .submitBtnWrapper {
216
+ display: flex;
217
+ justify-content: center;
218
+ margin-top: 1rem;
219
+ }
220
+
221
+ /* Higher specificity to override .booking-flow-preflight button reset */
222
+ .section .submitBtn {
223
+ padding: 1rem 1.5rem;
224
+ min-height: 3.25rem;
225
+ background: var(--booking-emerald-600, #059669);
226
+ color: #fff;
227
+ font-weight: 600;
228
+ border-radius: 0.5rem;
229
+ border: none;
230
+ cursor: pointer;
231
+ transition: all 0.2s;
232
+ }
233
+
234
+ .section .submitBtn:disabled {
235
+ opacity: 0.5;
236
+ cursor: not-allowed;
237
+ }
238
+
239
+ .secureNote {
240
+ text-align: center;
241
+ font-size: 0.875rem;
242
+ color: var(--booking-stone-500, #78716c);
243
+ margin-top: 1rem;
244
+ }
@@ -0,0 +1,364 @@
1
+ 'use client';
2
+
3
+ import { PriceSummary, type PriceSummaryLine } from './PriceSummary';
4
+ import { TermsAcceptance } from './TermsAcceptance';
5
+ import { PickupLocationSelector } from './PickupLocationSelector';
6
+ import type { Currency } from './CurrencySwitcher';
7
+ import type { PickupLocation, Destination } from '@/lib/booking-api';
8
+ import styles from './CheckoutForm.module.css';
9
+ import Button, { ButtonHoverColor } from '@/components/button';
10
+ import { AnimatePresence, motion } from 'framer-motion';
11
+
12
+ type TranslationFn = (key: string, params?: Record<string, string>) => string;
13
+
14
+ interface CheckoutFormProps {
15
+ // Price summary
16
+ priceSummaryLines: PriceSummaryLine[];
17
+ totalPrice: number;
18
+ subtotal?: number;
19
+ taxAmount: number;
20
+ taxRate?: number;
21
+ currency: Currency;
22
+ locale: string;
23
+ t: TranslationFn;
24
+ extraBetweenTaxAndTotal: React.ReactNode;
25
+ /** Overrides PriceSummary final row label (e.g. change booking) */
26
+ totalSummaryLabel?: string;
27
+ // Promo (passed as extraBetweenTaxAndTotal content - we'll keep it in parent for now)
28
+ // Contact info
29
+ firstName: string;
30
+ lastName: string;
31
+ email: string;
32
+ onFirstNameChange: (value: string) => void;
33
+ onLastNameChange: (value: string) => void;
34
+ onEmailChange: (value: string) => void;
35
+ readOnlyContactFields?: boolean;
36
+ // Pickup location
37
+ pickupLocations?: PickupLocation[];
38
+ destinations?: Destination[];
39
+ pickupLocationId: string | null;
40
+ pickupLocationSkipped: boolean;
41
+ selectedPickupLocation: PickupLocation | null | undefined;
42
+ highlightedPickupLocationIds?: string[];
43
+ onLocationSelect: (locationId: string | null, customLocation?: unknown) => void;
44
+ onSkip: () => void;
45
+ onChangePickup: () => void;
46
+ // Terms
47
+ termsAccepted: boolean;
48
+ onTermsChange: (checked: boolean) => void;
49
+ // Admin
50
+ isAdmin: boolean;
51
+ skipConfirmationCommunications: boolean;
52
+ disableAutoCommunications: boolean;
53
+ onSkipConfirmationChange: (checked: boolean) => void;
54
+ onDisableCommunicationsChange: (checked: boolean) => void;
55
+ // Error & submit
56
+ error: string;
57
+ loading: boolean;
58
+ totalQuantity: number;
59
+ onCheckout: () => void;
60
+ submitLabel?: string;
61
+ hideSubmitButton?: boolean;
62
+ /** Extra disabled state (e.g. change-booking quote still loading) without showing reservation spinner */
63
+ submitDisabled?: boolean;
64
+ attributionSummary?: string;
65
+ attributionConfirmLabel?: string;
66
+ attributionConfirmed?: boolean;
67
+ onAttributionConfirmedChange?: (checked: boolean) => void;
68
+ }
69
+
70
+ export function CheckoutForm({
71
+ priceSummaryLines,
72
+ totalPrice,
73
+ subtotal,
74
+ taxAmount,
75
+ taxRate,
76
+ currency,
77
+ locale,
78
+ t,
79
+ extraBetweenTaxAndTotal,
80
+ totalSummaryLabel,
81
+ firstName,
82
+ lastName,
83
+ email,
84
+ onFirstNameChange,
85
+ onLastNameChange,
86
+ onEmailChange,
87
+ readOnlyContactFields = false,
88
+ pickupLocations,
89
+ destinations = [],
90
+ pickupLocationId,
91
+ pickupLocationSkipped,
92
+ selectedPickupLocation,
93
+ highlightedPickupLocationIds,
94
+ onLocationSelect,
95
+ onSkip,
96
+ onChangePickup,
97
+ termsAccepted,
98
+ onTermsChange,
99
+ isAdmin,
100
+ skipConfirmationCommunications,
101
+ disableAutoCommunications,
102
+ onSkipConfirmationChange,
103
+ onDisableCommunicationsChange,
104
+ error,
105
+ loading,
106
+ totalQuantity,
107
+ onCheckout,
108
+ submitLabel,
109
+ hideSubmitButton = false,
110
+ submitDisabled = false,
111
+ attributionSummary,
112
+ attributionConfirmLabel,
113
+ attributionConfirmed = false,
114
+ onAttributionConfirmedChange,
115
+ }: CheckoutFormProps) {
116
+ return (
117
+ <div className={styles.section}>
118
+ <div className={styles.summaryWrapper}>
119
+ <PriceSummary
120
+ lines={priceSummaryLines}
121
+ total={totalPrice}
122
+ currency={currency}
123
+ locale={locale as 'en' | 'fr'}
124
+ subtotal={subtotal}
125
+ taxAmount={taxAmount}
126
+ taxRate={taxRate}
127
+ size="sm"
128
+ t={t}
129
+ extraBetweenTaxAndTotal={extraBetweenTaxAndTotal}
130
+ totalLabel={totalSummaryLabel}
131
+ />
132
+ </div>
133
+
134
+ {/* Contact info */}
135
+ <div className={styles.contactSection}>
136
+ {readOnlyContactFields ? (
137
+ <>
138
+ <div className={styles.contactGrid}>
139
+ <div>
140
+ <p className={styles.label}>
141
+ {t('booking.firstName') || 'First Name'}
142
+ </p>
143
+ <p className={styles.contactStaticValue}>{firstName || '—'}</p>
144
+ </div>
145
+ <div>
146
+ <p className={styles.label}>
147
+ {t('booking.lastName') || 'Last Name'}
148
+ </p>
149
+ <p className={styles.contactStaticValue}>{lastName || '—'}</p>
150
+ </div>
151
+ </div>
152
+ <div>
153
+ <p className={styles.label}>{t('booking.emailForConfirmation')}</p>
154
+ <p className={styles.contactStaticValue}>{email || '—'}</p>
155
+ </div>
156
+ </>
157
+ ) : (
158
+ <>
159
+ <div className={styles.contactGrid}>
160
+ <div>
161
+ <label className={styles.label} htmlFor="booking-firstName">
162
+ {t('booking.firstName') || 'First Name'} <span className={styles.required}>*</span>
163
+ </label>
164
+ <input
165
+ type="text"
166
+ name="firstName"
167
+ id="booking-firstName"
168
+ value={firstName}
169
+ onChange={(e) => onFirstNameChange(e.target.value)}
170
+ placeholder={t('booking.firstNamePlaceholder') || 'Jane'}
171
+ autoComplete="given-name"
172
+ required
173
+ className={styles.input}
174
+ />
175
+ </div>
176
+ <div>
177
+ <label className={styles.label} htmlFor="booking-lastName">
178
+ {t('booking.lastName') || 'Last Name'} <span className={styles.required}>*</span>
179
+ </label>
180
+ <input
181
+ type="text"
182
+ name="lastName"
183
+ id="booking-lastName"
184
+ value={lastName}
185
+ onChange={(e) => onLastNameChange(e.target.value)}
186
+ placeholder={t('booking.lastNamePlaceholder') || 'Smith'}
187
+ autoComplete="family-name"
188
+ required
189
+ className={styles.input}
190
+ />
191
+ </div>
192
+ </div>
193
+ <div>
194
+ <label className={styles.label} htmlFor="booking-email">
195
+ {t('booking.emailForConfirmation')} <span className={styles.required}>*</span>
196
+ </label>
197
+ <input
198
+ type="email"
199
+ name="email"
200
+ id="booking-email"
201
+ value={email}
202
+ onChange={(e) => onEmailChange(e.target.value)}
203
+ placeholder={t('common.emailPlaceholder')}
204
+ autoComplete="email"
205
+ required
206
+ className={styles.input}
207
+ />
208
+ {email && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email) && (
209
+ <p className={styles.inputError}>{t('booking.invalidEmail') || 'Please enter a valid email address'}</p>
210
+ )}
211
+ </div>
212
+ </>
213
+ )}
214
+ </div>
215
+
216
+ {/* Pickup location */}
217
+ {pickupLocations && pickupLocations.length > 0 && (
218
+ <div id="pickup-location-section" className={styles.pickupSection}>
219
+ <AnimatePresence mode="wait" initial={false}>
220
+ {pickupLocationId || pickupLocationSkipped ? (
221
+ <motion.div
222
+ key="collapsed"
223
+ initial={{ opacity: 0, y: -8 }}
224
+ animate={{ opacity: 1, y: 0 }}
225
+ exit={{ opacity: 0, y: -8 }}
226
+ transition={{ duration: 0.4, ease: [0.25, 0.46, 0.45, 0.94] }}
227
+ className={styles.pickupCollapsedWrapper}
228
+ >
229
+ <div className={styles.pickupHeader}>
230
+ <div>
231
+ <label className={styles.pickupLabel}>
232
+ {t('pickup.pickupLocation')}
233
+ </label>
234
+ {pickupLocationSkipped ? (
235
+ <p className={styles.pickupName}>
236
+ {t('booking.pickupLocationUnknown')}
237
+ </p>
238
+ ) : (
239
+ <>
240
+ <p className={styles.pickupName}>
241
+ {selectedPickupLocation?.name}
242
+ </p>
243
+ <p className={styles.pickupAddress}>
244
+ {selectedPickupLocation?.address}
245
+ </p>
246
+ {selectedPickupLocation?.notes && (
247
+ <p className={styles.pickupNotes}>
248
+ {selectedPickupLocation.notes}
249
+ </p>
250
+ )}
251
+ </>
252
+ )}
253
+ </div>
254
+ <button
255
+ onClick={onChangePickup}
256
+ className={styles.changeBtn}
257
+ >
258
+ {t('common.change')}
259
+ </button>
260
+ </div>
261
+ </motion.div>
262
+ ) : (
263
+ <motion.div
264
+ key="expanded"
265
+ initial={{ opacity: 0, y: -8 }}
266
+ animate={{ opacity: 1, y: 0 }}
267
+ exit={{ opacity: 0, y: -8 }}
268
+ transition={{ duration: 0.4, ease: [0.25, 0.46, 0.45, 0.94] }}
269
+ className={styles.pickupExpandedWrapper}
270
+ >
271
+ <PickupLocationSelector
272
+ pickupLocations={pickupLocations}
273
+ selectedLocationId={pickupLocationId}
274
+ isSkipped={pickupLocationSkipped}
275
+ destinations={destinations}
276
+ highlightedPickupLocationIds={highlightedPickupLocationIds}
277
+ onLocationSelect={onLocationSelect}
278
+ onSkip={onSkip}
279
+ />
280
+ </motion.div>
281
+ )}
282
+ </AnimatePresence>
283
+ </div>
284
+ )}
285
+
286
+ {/* Admin: communication options */}
287
+ {isAdmin && (
288
+ <div className={styles.adminSection}>
289
+ <p className={styles.adminTitle}>Communications (admin)</p>
290
+ <label className={styles.adminCheckbox}>
291
+ <input
292
+ type="checkbox"
293
+ checked={skipConfirmationCommunications}
294
+ onChange={(e) => onSkipConfirmationChange(e.target.checked)}
295
+ />
296
+ <span>Don&apos;t send confirmation email/SMS/WhatsApp for this booking (you can send manually later). Cancellation and reminder emails still send.</span>
297
+ </label>
298
+ <label className={styles.adminCheckbox}>
299
+ <input
300
+ type="checkbox"
301
+ checked={disableAutoCommunications}
302
+ onChange={(e) => onDisableCommunicationsChange(e.target.checked)}
303
+ />
304
+ <span>Disable all auto communications for this booking (no confirmation, cancellation, or reminders). Can be changed later on the booking.</span>
305
+ </label>
306
+ </div>
307
+ )}
308
+
309
+ {/* Terms & Conditions */}
310
+ <div className={styles.termsSection}>
311
+ <TermsAcceptance
312
+ checked={termsAccepted}
313
+ onChange={onTermsChange}
314
+ t={t}
315
+ />
316
+ </div>
317
+
318
+ {attributionSummary ? (
319
+ <div className={styles.attributionConfirmSection}>
320
+ <p className={styles.attributionSummaryText}>{attributionSummary}</p>
321
+ {attributionConfirmLabel ? (
322
+ <label className={styles.attributionConfirmLabel}>
323
+ <input
324
+ type="checkbox"
325
+ checked={attributionConfirmed}
326
+ onChange={(e) => onAttributionConfirmedChange?.(e.target.checked)}
327
+ />
328
+ <span>{attributionConfirmLabel}</span>
329
+ </label>
330
+ ) : null}
331
+ </div>
332
+ ) : null}
333
+
334
+ {/* Error Message */}
335
+ {error && (
336
+ <div className={styles.errorBox}>
337
+ {error}
338
+ </div>
339
+ )}
340
+
341
+ {!hideSubmitButton && (
342
+ <div className={styles.submitBtnWrapper}>
343
+ <Button
344
+ onClick={onCheckout}
345
+ isLarge={true}
346
+ hoverColor={ButtonHoverColor.Turquoise}
347
+ disabled={
348
+ loading ||
349
+ submitDisabled ||
350
+ !termsAccepted ||
351
+ Boolean(attributionConfirmLabel && !attributionConfirmed)
352
+ }
353
+ className={styles.submitBtn}
354
+ >
355
+ {loading ? t('booking.creatingReservation') : (submitLabel || t('booking.continueToPayment'))}
356
+ </Button>
357
+ </div>
358
+ )}
359
+ <p className={styles.secureNote}>
360
+ {t('booking.securePayment')}
361
+ </p>
362
+ </div>
363
+ );
364
+ }