@planetaexo/design-system 0.12.0 → 0.12.2
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.
- package/dist/index.cjs +181 -324
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -55
- package/dist/index.d.ts +17 -55
- package/dist/index.js +165 -307
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React23 from 'react';
|
|
2
2
|
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
@@ -81,7 +81,7 @@ var buttonVariants = cva(
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
|
-
var Button =
|
|
84
|
+
var Button = React23.forwardRef(
|
|
85
85
|
(_a, ref) => {
|
|
86
86
|
var _b = _a, { className, variant, size } = _b, props = __objRest(_b, ["className", "variant", "size"]);
|
|
87
87
|
return /* @__PURE__ */ jsx(
|
|
@@ -302,10 +302,10 @@ function DialogDescription(_a) {
|
|
|
302
302
|
}, props)
|
|
303
303
|
);
|
|
304
304
|
}
|
|
305
|
-
var FloatingInput =
|
|
305
|
+
var FloatingInput = React23.forwardRef(
|
|
306
306
|
(_a, ref) => {
|
|
307
307
|
var _b = _a, { label, error, id, className, required } = _b, props = __objRest(_b, ["label", "error", "id", "className", "required"]);
|
|
308
|
-
const inputId = id != null ? id :
|
|
308
|
+
const inputId = id != null ? id : React23.useId();
|
|
309
309
|
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
310
310
|
/* @__PURE__ */ jsx(
|
|
311
311
|
"input",
|
|
@@ -345,10 +345,10 @@ var FloatingInput = React22.forwardRef(
|
|
|
345
345
|
}
|
|
346
346
|
);
|
|
347
347
|
FloatingInput.displayName = "FloatingInput";
|
|
348
|
-
var FloatingSelect =
|
|
348
|
+
var FloatingSelect = React23.forwardRef(
|
|
349
349
|
(_a, ref) => {
|
|
350
350
|
var _b = _a, { label, error, id, className, required, children, value } = _b, props = __objRest(_b, ["label", "error", "id", "className", "required", "children", "value"]);
|
|
351
|
-
const inputId = id != null ? id :
|
|
351
|
+
const inputId = id != null ? id : React23.useId();
|
|
352
352
|
const hasValue = typeof value === "string" ? value !== "" : value !== void 0 && value !== null;
|
|
353
353
|
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
354
354
|
/* @__PURE__ */ jsx(
|
|
@@ -612,11 +612,11 @@ function PhoneCountrySelect({
|
|
|
612
612
|
disabled
|
|
613
613
|
}) {
|
|
614
614
|
var _a;
|
|
615
|
-
const [open, setOpen] =
|
|
616
|
-
const containerRef =
|
|
617
|
-
const listRef =
|
|
615
|
+
const [open, setOpen] = React23.useState(false);
|
|
616
|
+
const containerRef = React23.useRef(null);
|
|
617
|
+
const listRef = React23.useRef(null);
|
|
618
618
|
const selected = (_a = PHONE_COUNTRIES.find((c) => c.code === value)) != null ? _a : PHONE_COUNTRIES[0];
|
|
619
|
-
|
|
619
|
+
React23.useEffect(() => {
|
|
620
620
|
if (!open) return;
|
|
621
621
|
const handler = (e) => {
|
|
622
622
|
var _a2;
|
|
@@ -627,7 +627,7 @@ function PhoneCountrySelect({
|
|
|
627
627
|
document.addEventListener("mousedown", handler);
|
|
628
628
|
return () => document.removeEventListener("mousedown", handler);
|
|
629
629
|
}, [open]);
|
|
630
|
-
|
|
630
|
+
React23.useEffect(() => {
|
|
631
631
|
if (!open || !listRef.current) return;
|
|
632
632
|
const activeEl = listRef.current.querySelector("[data-selected=true]");
|
|
633
633
|
activeEl == null ? void 0 : activeEl.scrollIntoView({ block: "nearest" });
|
|
@@ -897,8 +897,8 @@ function CalendarDayButton(_a) {
|
|
|
897
897
|
"locale"
|
|
898
898
|
]);
|
|
899
899
|
const defaultClassNames = getDefaultClassNames();
|
|
900
|
-
const ref =
|
|
901
|
-
|
|
900
|
+
const ref = React23.useRef(null);
|
|
901
|
+
React23.useEffect(() => {
|
|
902
902
|
var _a2;
|
|
903
903
|
if (modifiers.focused) (_a2 = ref.current) == null ? void 0 : _a2.focus();
|
|
904
904
|
}, [modifiers.focused]);
|
|
@@ -929,16 +929,16 @@ function BirthDateField({
|
|
|
929
929
|
className,
|
|
930
930
|
disabled
|
|
931
931
|
}) {
|
|
932
|
-
const [open, setOpen] =
|
|
933
|
-
const [text, setText] =
|
|
932
|
+
const [open, setOpen] = React23.useState(false);
|
|
933
|
+
const [text, setText] = React23.useState(
|
|
934
934
|
value ? format(value, "dd/MM/yyyy") : ""
|
|
935
935
|
);
|
|
936
|
-
const containerRef =
|
|
937
|
-
const inputId =
|
|
938
|
-
|
|
936
|
+
const containerRef = React23.useRef(null);
|
|
937
|
+
const inputId = React23.useId();
|
|
938
|
+
React23.useEffect(() => {
|
|
939
939
|
setText(value ? format(value, "dd/MM/yyyy") : "");
|
|
940
940
|
}, [value]);
|
|
941
|
-
|
|
941
|
+
React23.useEffect(() => {
|
|
942
942
|
if (!open) return;
|
|
943
943
|
const handler = (e) => {
|
|
944
944
|
var _a;
|
|
@@ -1147,14 +1147,14 @@ function CountrySearchField({
|
|
|
1147
1147
|
}) {
|
|
1148
1148
|
var _a;
|
|
1149
1149
|
const list = countries != null ? countries : COUNTRIES;
|
|
1150
|
-
const [query, setQuery] =
|
|
1151
|
-
const [open, setOpen] =
|
|
1152
|
-
const containerRef =
|
|
1153
|
-
const searchRef =
|
|
1150
|
+
const [query, setQuery] = React23.useState("");
|
|
1151
|
+
const [open, setOpen] = React23.useState(false);
|
|
1152
|
+
const containerRef = React23.useRef(null);
|
|
1153
|
+
const searchRef = React23.useRef(null);
|
|
1154
1154
|
const selected = list.find((c) => c.code === value);
|
|
1155
1155
|
const isFloated = open || !!selected;
|
|
1156
1156
|
const filtered = query.trim() ? list.filter((c) => c.name.toLowerCase().includes(query.toLowerCase())) : list;
|
|
1157
|
-
|
|
1157
|
+
React23.useEffect(() => {
|
|
1158
1158
|
if (!open) return;
|
|
1159
1159
|
const handler = (e) => {
|
|
1160
1160
|
var _a2;
|
|
@@ -1264,7 +1264,7 @@ function Alert({ variant = "info", children, className }) {
|
|
|
1264
1264
|
function AdventureCard({ adventure }) {
|
|
1265
1265
|
var _a, _b, _c, _d, _e, _f;
|
|
1266
1266
|
const isControlled = (_b = (_a = adventure.optionals) == null ? void 0 : _a.some((o) => o.onCheckedChange !== void 0)) != null ? _b : false;
|
|
1267
|
-
const [checkedInternal, setCheckedInternal] =
|
|
1267
|
+
const [checkedInternal, setCheckedInternal] = React23.useState(
|
|
1268
1268
|
new Set((_d = (_c = adventure.optionals) == null ? void 0 : _c.filter((o) => o.defaultChecked).map((o) => o.id)) != null ? _d : [])
|
|
1269
1269
|
);
|
|
1270
1270
|
const isChecked = (opt) => {
|
|
@@ -1601,7 +1601,7 @@ function BookingShell({
|
|
|
1601
1601
|
return /* @__PURE__ */ jsxs("div", { className: "rounded-2xl border border-border bg-card overflow-hidden", children: [
|
|
1602
1602
|
/* @__PURE__ */ jsxs("div", { className: "border-b border-border px-5 py-4 bg-muted/20", children: [
|
|
1603
1603
|
/* @__PURE__ */ jsx("h3", { className: "text-base font-bold text-foreground font-heading mb-2", children: title }),
|
|
1604
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: steps.map((label, i) => /* @__PURE__ */ jsxs(
|
|
1604
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: steps.map((label, i) => /* @__PURE__ */ jsxs(React23.Fragment, { children: [
|
|
1605
1605
|
/* @__PURE__ */ jsx(
|
|
1606
1606
|
"span",
|
|
1607
1607
|
{
|
|
@@ -1800,7 +1800,7 @@ function TermsSection({
|
|
|
1800
1800
|
termsContent
|
|
1801
1801
|
}) {
|
|
1802
1802
|
var _a;
|
|
1803
|
-
const [modalOpen, setModalOpen] =
|
|
1803
|
+
const [modalOpen, setModalOpen] = React23.useState(false);
|
|
1804
1804
|
const i18n = (_a = TERMS_I18N[locale]) != null ? _a : TERMS_I18N.en;
|
|
1805
1805
|
return /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-border p-4 flex flex-col gap-3", children: [
|
|
1806
1806
|
/* @__PURE__ */ jsx("p", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: title }),
|
|
@@ -1888,9 +1888,9 @@ function BookingWizard({
|
|
|
1888
1888
|
depositInfo,
|
|
1889
1889
|
onCancel
|
|
1890
1890
|
}) {
|
|
1891
|
-
const [step, setStep] =
|
|
1892
|
-
const [error, setError] =
|
|
1893
|
-
const [responsible, setResponsible] =
|
|
1891
|
+
const [step, setStep] = React23.useState("responsible");
|
|
1892
|
+
const [error, setError] = React23.useState(null);
|
|
1893
|
+
const [responsible, setResponsible] = React23.useState({
|
|
1894
1894
|
firstName: "",
|
|
1895
1895
|
lastName: "",
|
|
1896
1896
|
email: "",
|
|
@@ -1909,7 +1909,7 @@ function BookingWizard({
|
|
|
1909
1909
|
return s + ((_b = (_a = a.slots) == null ? void 0 : _a.children) != null ? _b : 0);
|
|
1910
1910
|
}, 0);
|
|
1911
1911
|
const totalPax = totalAdults + totalChildren;
|
|
1912
|
-
const [travellers, setTravellers] =
|
|
1912
|
+
const [travellers, setTravellers] = React23.useState(
|
|
1913
1913
|
Array.from({ length: Math.max(totalPax, 1) }, () => ({
|
|
1914
1914
|
firstName: "",
|
|
1915
1915
|
lastName: "",
|
|
@@ -1917,9 +1917,9 @@ function BookingWizard({
|
|
|
1917
1917
|
email: ""
|
|
1918
1918
|
}))
|
|
1919
1919
|
);
|
|
1920
|
-
const [payAmount, setPayAmount] =
|
|
1921
|
-
const [payMethod, setPayMethod] =
|
|
1922
|
-
const [termsAccepted, setTermsAccepted] =
|
|
1920
|
+
const [payAmount, setPayAmount] = React23.useState("full");
|
|
1921
|
+
const [payMethod, setPayMethod] = React23.useState("stripe");
|
|
1922
|
+
const [termsAccepted, setTermsAccepted] = React23.useState(false);
|
|
1923
1923
|
const setR = (k, v) => setResponsible((p) => __spreadProps(__spreadValues({}, p), { [k]: v }));
|
|
1924
1924
|
const setT = (i, k, v) => setTravellers((prev) => prev.map((t, idx) => idx === i ? __spreadProps(__spreadValues({}, t), { [k]: v }) : t));
|
|
1925
1925
|
const setTDob = (i, v) => setTravellers((prev) => prev.map((t, idx) => idx === i ? __spreadProps(__spreadValues({}, t), { dateOfBirth: v }) : t));
|
|
@@ -2120,7 +2120,7 @@ function Offer({
|
|
|
2120
2120
|
continueDisabled,
|
|
2121
2121
|
className
|
|
2122
2122
|
}) {
|
|
2123
|
-
const [showBooking, setShowBooking] =
|
|
2123
|
+
const [showBooking, setShowBooking] = React23.useState(false);
|
|
2124
2124
|
const isShowingCheckout = !!checkoutSlot || showBooking;
|
|
2125
2125
|
const handleBook = () => {
|
|
2126
2126
|
if (!checkoutSlot && !externalBookingFlow) setShowBooking(true);
|
|
@@ -2458,7 +2458,7 @@ function AdventureSection({
|
|
|
2458
2458
|
cannotRemoveLastTravellerLabel
|
|
2459
2459
|
}) {
|
|
2460
2460
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2461
|
-
const [detailsOpen, setDetailsOpen] =
|
|
2461
|
+
const [detailsOpen, setDetailsOpen] = React23.useState(false);
|
|
2462
2462
|
const handleCopyUrl = (url) => {
|
|
2463
2463
|
if (onCopyFormLink) {
|
|
2464
2464
|
onCopyFormLink(url);
|
|
@@ -2944,8 +2944,8 @@ function AddTravellerDialog({
|
|
|
2944
2944
|
errorMessage
|
|
2945
2945
|
}) {
|
|
2946
2946
|
var _a, _b, _c, _d, _e;
|
|
2947
|
-
const [form, setForm] =
|
|
2948
|
-
|
|
2947
|
+
const [form, setForm] = React23.useState(() => createInitialAddFormData(config));
|
|
2948
|
+
React23.useEffect(() => {
|
|
2949
2949
|
if (open) {
|
|
2950
2950
|
setForm(createInitialAddFormData(config));
|
|
2951
2951
|
}
|
|
@@ -3005,7 +3005,7 @@ function EditTravellerDialog({
|
|
|
3005
3005
|
errorMessage
|
|
3006
3006
|
}) {
|
|
3007
3007
|
var _a, _b, _c, _d, _e;
|
|
3008
|
-
const [form, setForm] =
|
|
3008
|
+
const [form, setForm] = React23.useState(() => ({
|
|
3009
3009
|
firstName: "",
|
|
3010
3010
|
lastName: "",
|
|
3011
3011
|
email: "",
|
|
@@ -3014,7 +3014,7 @@ function EditTravellerDialog({
|
|
|
3014
3014
|
birthDate: "",
|
|
3015
3015
|
personType: "ADULT"
|
|
3016
3016
|
}));
|
|
3017
|
-
|
|
3017
|
+
React23.useEffect(() => {
|
|
3018
3018
|
var _a2, _b2, _c2, _d2, _e2, _f;
|
|
3019
3019
|
if (open && traveller) {
|
|
3020
3020
|
setForm({
|
|
@@ -3281,37 +3281,37 @@ function BookingDetails({
|
|
|
3281
3281
|
const hasSubmitAddTraveller = !!onSubmitAddTraveller;
|
|
3282
3282
|
const hasSubmitEditTraveller = !!onSubmitEditTraveller;
|
|
3283
3283
|
const hasConfirmRemoveTraveller = !!onConfirmRemoveTraveller;
|
|
3284
|
-
const [addModalState, setAddModalState] =
|
|
3284
|
+
const [addModalState, setAddModalState] = React23.useState({
|
|
3285
3285
|
open: false,
|
|
3286
3286
|
adventureId: null
|
|
3287
3287
|
});
|
|
3288
|
-
const [editModalState, setEditModalState] =
|
|
3289
|
-
const [deleteModalState, setDeleteModalState] =
|
|
3290
|
-
const handleRequestOpenAddModal =
|
|
3288
|
+
const [editModalState, setEditModalState] = React23.useState({ open: false, adventureId: null, traveller: null });
|
|
3289
|
+
const [deleteModalState, setDeleteModalState] = React23.useState({ open: false, adventureId: null, traveller: null });
|
|
3290
|
+
const handleRequestOpenAddModal = React23.useCallback((adventureId) => {
|
|
3291
3291
|
setAddModalState({ open: true, adventureId });
|
|
3292
3292
|
}, []);
|
|
3293
|
-
const handleRequestOpenEditModal =
|
|
3293
|
+
const handleRequestOpenEditModal = React23.useCallback(
|
|
3294
3294
|
(adventureId, traveller) => {
|
|
3295
3295
|
setEditModalState({ open: true, adventureId, traveller });
|
|
3296
3296
|
},
|
|
3297
3297
|
[]
|
|
3298
3298
|
);
|
|
3299
|
-
const handleRequestOpenDeleteModal =
|
|
3299
|
+
const handleRequestOpenDeleteModal = React23.useCallback(
|
|
3300
3300
|
(adventureId, traveller) => {
|
|
3301
3301
|
setDeleteModalState({ open: true, adventureId, traveller });
|
|
3302
3302
|
},
|
|
3303
3303
|
[]
|
|
3304
3304
|
);
|
|
3305
|
-
const closeAddModal =
|
|
3305
|
+
const closeAddModal = React23.useCallback(() => {
|
|
3306
3306
|
setAddModalState({ open: false, adventureId: null });
|
|
3307
3307
|
}, []);
|
|
3308
|
-
const closeEditModal =
|
|
3308
|
+
const closeEditModal = React23.useCallback(() => {
|
|
3309
3309
|
setEditModalState({ open: false, adventureId: null, traveller: null });
|
|
3310
3310
|
}, []);
|
|
3311
|
-
const closeDeleteModal =
|
|
3311
|
+
const closeDeleteModal = React23.useCallback(() => {
|
|
3312
3312
|
setDeleteModalState({ open: false, adventureId: null, traveller: null });
|
|
3313
3313
|
}, []);
|
|
3314
|
-
const handleAddSubmit =
|
|
3314
|
+
const handleAddSubmit = React23.useCallback(
|
|
3315
3315
|
async (adventureId, data) => {
|
|
3316
3316
|
if (!onSubmitAddTraveller) return;
|
|
3317
3317
|
try {
|
|
@@ -3322,7 +3322,7 @@ function BookingDetails({
|
|
|
3322
3322
|
},
|
|
3323
3323
|
[onSubmitAddTraveller, closeAddModal]
|
|
3324
3324
|
);
|
|
3325
|
-
const handleEditSubmit =
|
|
3325
|
+
const handleEditSubmit = React23.useCallback(
|
|
3326
3326
|
async (adventureId, travellerId, data) => {
|
|
3327
3327
|
if (!onSubmitEditTraveller) return;
|
|
3328
3328
|
try {
|
|
@@ -3333,7 +3333,7 @@ function BookingDetails({
|
|
|
3333
3333
|
},
|
|
3334
3334
|
[onSubmitEditTraveller, closeEditModal]
|
|
3335
3335
|
);
|
|
3336
|
-
const handleDeleteConfirm =
|
|
3336
|
+
const handleDeleteConfirm = React23.useCallback(
|
|
3337
3337
|
async (adventureId, travellerId) => {
|
|
3338
3338
|
if (!onConfirmRemoveTraveller) return;
|
|
3339
3339
|
try {
|
|
@@ -3985,7 +3985,8 @@ var DEFAULT_LABELS2 = {
|
|
|
3985
3985
|
numberOfPeopleLabel: "Number of People:",
|
|
3986
3986
|
hostLabel: "Host:",
|
|
3987
3987
|
postCtaMessage: "After adding everyone, you will also receive your own registration email, just like the other travellers. Please make sure everyone completes this step so we can organise everything properly.",
|
|
3988
|
-
closingMessage: "If you have any questions, just reply to this email \u2014 happy to help."
|
|
3988
|
+
closingMessage: "If you have any questions, just reply to this email \u2014 happy to help.",
|
|
3989
|
+
nextStepsHeading: "Next steps:"
|
|
3989
3990
|
};
|
|
3990
3991
|
function BookingConfirmationEmail({
|
|
3991
3992
|
recipientName,
|
|
@@ -3998,7 +3999,9 @@ function BookingConfirmationEmail({
|
|
|
3998
3999
|
numberOfPeople,
|
|
3999
4000
|
host,
|
|
4000
4001
|
labels,
|
|
4001
|
-
className
|
|
4002
|
+
className,
|
|
4003
|
+
nextSteps,
|
|
4004
|
+
nextStepsImportant
|
|
4002
4005
|
}) {
|
|
4003
4006
|
const l = __spreadValues(__spreadValues({}, DEFAULT_LABELS2), labels);
|
|
4004
4007
|
const ctaStyle = {
|
|
@@ -4015,12 +4018,13 @@ function BookingConfirmationEmail({
|
|
|
4015
4018
|
const AddTravellersCta = addTravellersUrl ? /* @__PURE__ */ jsx("a", { href: addTravellersUrl, style: ctaStyle, children: l.ctaButton }) : /* @__PURE__ */ jsx("span", { style: ctaStyle, role: "presentation", children: l.ctaButton });
|
|
4016
4019
|
const tableRows = [
|
|
4017
4020
|
{ label: l.bookingNumberLabel, value: bookingNumber },
|
|
4018
|
-
{ label: l.activityLabel, value: activity },
|
|
4021
|
+
...activity && activity.trim().length > 0 ? [{ label: l.activityLabel, value: activity }] : [],
|
|
4019
4022
|
{ label: l.adventureLabel, value: adventure },
|
|
4020
4023
|
{ label: l.startingDateLabel, value: startingDate },
|
|
4021
4024
|
{ label: l.numberOfPeopleLabel, value: String(numberOfPeople) },
|
|
4022
4025
|
{ label: l.hostLabel, value: host }
|
|
4023
4026
|
];
|
|
4027
|
+
const showNextSteps = Array.isArray(nextSteps) && nextSteps.length > 0;
|
|
4024
4028
|
return /* @__PURE__ */ jsxs(
|
|
4025
4029
|
"div",
|
|
4026
4030
|
{
|
|
@@ -4050,6 +4054,30 @@ function BookingConfirmationEmail({
|
|
|
4050
4054
|
/* @__PURE__ */ jsx("td", { style: { padding: "4px 16px 4px 0", color: emailTokens.mutedForeground }, children: row.label }),
|
|
4051
4055
|
/* @__PURE__ */ jsx("td", { style: { padding: "4px 0", fontWeight: "500", color: emailTokens.foreground }, children: row.value })
|
|
4052
4056
|
] }, i)) }) }),
|
|
4057
|
+
showNextSteps && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4058
|
+
/* @__PURE__ */ jsx("hr", { style: { border: "none", borderTop: `1px solid ${emailTokens.border}`, marginBottom: "32px" } }),
|
|
4059
|
+
/* @__PURE__ */ jsx("p", { style: { marginBottom: "20px", fontWeight: "700", color: emailTokens.foreground, fontFamily: emailTokens.fontFamily, fontSize: "18px" }, children: l.nextStepsHeading }),
|
|
4060
|
+
/* @__PURE__ */ jsx("div", { style: { borderRadius: "12px", border: `1px solid ${emailTokens.border}`, padding: "20px", marginBottom: "24px" }, children: nextSteps.map((step, i) => /* @__PURE__ */ jsx("table", { cellPadding: 0, cellSpacing: 0, style: { borderCollapse: "collapse", width: "100%", marginBottom: i < nextSteps.length - 1 ? "16px" : "0" }, children: /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
4061
|
+
/* @__PURE__ */ jsx("td", { style: { verticalAlign: "top", width: "32px", paddingRight: "14px" }, children: /* @__PURE__ */ jsx("span", { style: {
|
|
4062
|
+
display: "inline-block",
|
|
4063
|
+
height: "24px",
|
|
4064
|
+
width: "24px",
|
|
4065
|
+
lineHeight: "24px",
|
|
4066
|
+
textAlign: "center",
|
|
4067
|
+
borderRadius: "9999px",
|
|
4068
|
+
backgroundColor: emailTokens.primaryLight,
|
|
4069
|
+
fontSize: "12px",
|
|
4070
|
+
fontWeight: "700",
|
|
4071
|
+
color: emailTokens.primary,
|
|
4072
|
+
marginTop: "2px"
|
|
4073
|
+
}, children: i + 1 }) }),
|
|
4074
|
+
/* @__PURE__ */ jsx("td", { style: { verticalAlign: "top" }, children: /* @__PURE__ */ jsx("p", { style: { fontSize: "14px", color: emailTokens.bodyText, lineHeight: "1.6", margin: 0 }, children: step }) })
|
|
4075
|
+
] }) }) }, i)) }),
|
|
4076
|
+
nextStepsImportant && nextStepsImportant.trim().length > 0 && /* @__PURE__ */ jsx("p", { style: { marginBottom: "32px", fontSize: "14px", color: emailTokens.foreground, lineHeight: "1.6" }, children: nextStepsImportant.split("\n").map((line, idx, arr) => /* @__PURE__ */ jsxs(React23.Fragment, { children: [
|
|
4077
|
+
line,
|
|
4078
|
+
idx < arr.length - 1 ? /* @__PURE__ */ jsx("br", {}) : null
|
|
4079
|
+
] }, idx)) })
|
|
4080
|
+
] }),
|
|
4053
4081
|
/* @__PURE__ */ jsx("hr", { style: { border: "none", borderTop: `1px solid ${emailTokens.border}`, marginBottom: "32px" } }),
|
|
4054
4082
|
/* @__PURE__ */ jsx("p", { style: { marginBottom: "16px" }, children: l.postCtaMessage }),
|
|
4055
4083
|
/* @__PURE__ */ jsx("p", { children: l.closingMessage })
|
|
@@ -4244,176 +4272,6 @@ function TravellerFormInviteEmail({
|
|
|
4244
4272
|
}
|
|
4245
4273
|
);
|
|
4246
4274
|
}
|
|
4247
|
-
function BookingWelcomeNewSystemEmail({
|
|
4248
|
-
greeting,
|
|
4249
|
-
introParagraph,
|
|
4250
|
-
bookingsHeading,
|
|
4251
|
-
bookings,
|
|
4252
|
-
bookingFormsCompleteLabel,
|
|
4253
|
-
bookingFormsPendingLabel,
|
|
4254
|
-
bookingFormsNoneLabel,
|
|
4255
|
-
ctaLabel,
|
|
4256
|
-
bookingCodeLabel,
|
|
4257
|
-
signatureLine,
|
|
4258
|
-
footerText,
|
|
4259
|
-
logoUrl,
|
|
4260
|
-
className
|
|
4261
|
-
}) {
|
|
4262
|
-
const ctaStyle = {
|
|
4263
|
-
display: "inline-block",
|
|
4264
|
-
backgroundColor: emailTokens.primary,
|
|
4265
|
-
color: emailTokens.primaryForeground,
|
|
4266
|
-
padding: "10px 20px",
|
|
4267
|
-
borderRadius: "6px",
|
|
4268
|
-
fontSize: "14px",
|
|
4269
|
-
fontWeight: 600,
|
|
4270
|
-
textDecoration: "none",
|
|
4271
|
-
fontFamily: emailTokens.fontFamily
|
|
4272
|
-
};
|
|
4273
|
-
return /* @__PURE__ */ jsxs(
|
|
4274
|
-
"div",
|
|
4275
|
-
{
|
|
4276
|
-
style: {
|
|
4277
|
-
fontFamily: emailTokens.fontFamily,
|
|
4278
|
-
color: emailTokens.foreground,
|
|
4279
|
-
maxWidth: "600px",
|
|
4280
|
-
margin: "0 auto",
|
|
4281
|
-
padding: "32px",
|
|
4282
|
-
border: `1px solid ${emailTokens.border}`,
|
|
4283
|
-
borderRadius: "12px",
|
|
4284
|
-
backgroundColor: emailTokens.white
|
|
4285
|
-
},
|
|
4286
|
-
className,
|
|
4287
|
-
children: [
|
|
4288
|
-
/* @__PURE__ */ jsx(EmailLogo, { src: logoUrl }),
|
|
4289
|
-
/* @__PURE__ */ jsx("p", { style: { fontSize: "16px", lineHeight: "1.5", margin: "0 0 12px" }, children: greeting }),
|
|
4290
|
-
/* @__PURE__ */ jsx("p", { style: { fontSize: "15px", lineHeight: "1.5", margin: "0 0 24px" }, children: introParagraph }),
|
|
4291
|
-
/* @__PURE__ */ jsx(
|
|
4292
|
-
"hr",
|
|
4293
|
-
{
|
|
4294
|
-
style: {
|
|
4295
|
-
border: "none",
|
|
4296
|
-
borderTop: `1px solid ${emailTokens.border}`,
|
|
4297
|
-
margin: "0 0 24px"
|
|
4298
|
-
}
|
|
4299
|
-
}
|
|
4300
|
-
),
|
|
4301
|
-
/* @__PURE__ */ jsx(
|
|
4302
|
-
"p",
|
|
4303
|
-
{
|
|
4304
|
-
style: {
|
|
4305
|
-
fontSize: "15px",
|
|
4306
|
-
fontWeight: 700,
|
|
4307
|
-
margin: "0 0 16px",
|
|
4308
|
-
color: emailTokens.foreground
|
|
4309
|
-
},
|
|
4310
|
-
children: bookingsHeading
|
|
4311
|
-
}
|
|
4312
|
-
),
|
|
4313
|
-
/* @__PURE__ */ jsx("ul", { style: { listStyle: "none", padding: 0, margin: "0 0 24px" }, children: bookings.map((b) => {
|
|
4314
|
-
const statusLine = b.formsStatus === "COMPLETO" ? bookingFormsCompleteLabel : b.formsStatus === "SEM_FORM" ? bookingFormsNoneLabel != null ? bookingFormsNoneLabel : "" : bookingFormsPendingLabel(b.formsCompleted, b.formsRequired);
|
|
4315
|
-
const statusIcon = b.formsStatus === "COMPLETO" ? "\u2713" : b.formsStatus === "SEM_FORM" ? "" : "\u26A0";
|
|
4316
|
-
const statusColor = b.formsStatus === "COMPLETO" ? emailTokens.green : b.formsStatus === "SEM_FORM" ? emailTokens.mutedForeground : emailTokens.destructive;
|
|
4317
|
-
return /* @__PURE__ */ jsxs(
|
|
4318
|
-
"li",
|
|
4319
|
-
{
|
|
4320
|
-
style: {
|
|
4321
|
-
marginBottom: "16px",
|
|
4322
|
-
padding: "16px",
|
|
4323
|
-
backgroundColor: emailTokens.muted,
|
|
4324
|
-
border: `1px solid ${emailTokens.border}`,
|
|
4325
|
-
borderRadius: "8px"
|
|
4326
|
-
},
|
|
4327
|
-
children: [
|
|
4328
|
-
/* @__PURE__ */ jsx(
|
|
4329
|
-
"p",
|
|
4330
|
-
{
|
|
4331
|
-
style: {
|
|
4332
|
-
fontSize: "15px",
|
|
4333
|
-
fontWeight: 600,
|
|
4334
|
-
margin: "0 0 6px",
|
|
4335
|
-
color: emailTokens.foreground
|
|
4336
|
-
},
|
|
4337
|
-
children: b.adventureName
|
|
4338
|
-
}
|
|
4339
|
-
),
|
|
4340
|
-
/* @__PURE__ */ jsx(
|
|
4341
|
-
"p",
|
|
4342
|
-
{
|
|
4343
|
-
style: {
|
|
4344
|
-
fontSize: "13px",
|
|
4345
|
-
color: emailTokens.mutedForeground,
|
|
4346
|
-
margin: "0 0 4px"
|
|
4347
|
-
},
|
|
4348
|
-
children: b.startDate
|
|
4349
|
-
}
|
|
4350
|
-
),
|
|
4351
|
-
/* @__PURE__ */ jsxs(
|
|
4352
|
-
"p",
|
|
4353
|
-
{
|
|
4354
|
-
style: {
|
|
4355
|
-
fontSize: "13px",
|
|
4356
|
-
color: emailTokens.mutedForeground,
|
|
4357
|
-
margin: "0 0 8px"
|
|
4358
|
-
},
|
|
4359
|
-
children: [
|
|
4360
|
-
/* @__PURE__ */ jsx("span", { style: { fontWeight: 600 }, children: bookingCodeLabel }),
|
|
4361
|
-
" ",
|
|
4362
|
-
/* @__PURE__ */ jsxs(
|
|
4363
|
-
"span",
|
|
4364
|
-
{
|
|
4365
|
-
style: {
|
|
4366
|
-
fontFamily: emailTokens.fontFamily,
|
|
4367
|
-
color: emailTokens.foreground,
|
|
4368
|
-
fontWeight: 600
|
|
4369
|
-
},
|
|
4370
|
-
children: [
|
|
4371
|
-
"#",
|
|
4372
|
-
b.bookingId
|
|
4373
|
-
]
|
|
4374
|
-
}
|
|
4375
|
-
)
|
|
4376
|
-
]
|
|
4377
|
-
}
|
|
4378
|
-
),
|
|
4379
|
-
statusLine && /* @__PURE__ */ jsxs(
|
|
4380
|
-
"p",
|
|
4381
|
-
{
|
|
4382
|
-
style: {
|
|
4383
|
-
fontSize: "13px",
|
|
4384
|
-
color: statusColor,
|
|
4385
|
-
margin: "0 0 12px",
|
|
4386
|
-
fontWeight: 500
|
|
4387
|
-
},
|
|
4388
|
-
children: [
|
|
4389
|
-
statusIcon ? `${statusIcon} ` : "",
|
|
4390
|
-
statusLine
|
|
4391
|
-
]
|
|
4392
|
-
}
|
|
4393
|
-
),
|
|
4394
|
-
/* @__PURE__ */ jsx("a", { href: b.bookingPublicUrl, style: ctaStyle, children: ctaLabel })
|
|
4395
|
-
]
|
|
4396
|
-
},
|
|
4397
|
-
b.bookingId
|
|
4398
|
-
);
|
|
4399
|
-
}) }),
|
|
4400
|
-
footerText && /* @__PURE__ */ jsx(
|
|
4401
|
-
"p",
|
|
4402
|
-
{
|
|
4403
|
-
style: {
|
|
4404
|
-
color: emailTokens.mutedForeground,
|
|
4405
|
-
fontSize: "13px",
|
|
4406
|
-
lineHeight: "1.5",
|
|
4407
|
-
margin: "0 0 16px"
|
|
4408
|
-
},
|
|
4409
|
-
children: footerText
|
|
4410
|
-
}
|
|
4411
|
-
),
|
|
4412
|
-
/* @__PURE__ */ jsx("p", { style: { fontSize: "14px", lineHeight: "1.5", margin: "0" }, children: signatureLine })
|
|
4413
|
-
]
|
|
4414
|
-
}
|
|
4415
|
-
);
|
|
4416
|
-
}
|
|
4417
4275
|
function CounterField({
|
|
4418
4276
|
label,
|
|
4419
4277
|
sublabel,
|
|
@@ -4528,11 +4386,11 @@ function DatePickerField({
|
|
|
4528
4386
|
fromDate,
|
|
4529
4387
|
className
|
|
4530
4388
|
}) {
|
|
4531
|
-
const [open, setOpen] =
|
|
4532
|
-
const containerRef =
|
|
4533
|
-
const [calendarWidth, setCalendarWidth] =
|
|
4389
|
+
const [open, setOpen] = React23.useState(false);
|
|
4390
|
+
const containerRef = React23.useRef(null);
|
|
4391
|
+
const [calendarWidth, setCalendarWidth] = React23.useState();
|
|
4534
4392
|
const hasValue = !!value;
|
|
4535
|
-
|
|
4393
|
+
React23.useEffect(() => {
|
|
4536
4394
|
if (!containerRef.current) return;
|
|
4537
4395
|
const observer = new ResizeObserver(([entry]) => {
|
|
4538
4396
|
setCalendarWidth(entry.contentRect.width);
|
|
@@ -4641,7 +4499,7 @@ function BookingForm({
|
|
|
4641
4499
|
subtitle = "Free enquiry \u2013 no commitment",
|
|
4642
4500
|
className
|
|
4643
4501
|
}) {
|
|
4644
|
-
const [values, setValues] =
|
|
4502
|
+
const [values, setValues] = React23.useState(__spreadValues(__spreadValues({}, defaultInitial), defaultValues));
|
|
4645
4503
|
const set = (key, value) => setValues((prev) => __spreadProps(__spreadValues({}, prev), { [key]: value }));
|
|
4646
4504
|
const handleSubmit = (e) => {
|
|
4647
4505
|
e.preventDefault();
|
|
@@ -5173,11 +5031,11 @@ function FloatingTextarea({
|
|
|
5173
5031
|
}
|
|
5174
5032
|
function SelectField({ field, value, onChange, error, disabled }) {
|
|
5175
5033
|
var _a, _b, _c;
|
|
5176
|
-
const [open, setOpen] =
|
|
5177
|
-
const containerRef =
|
|
5034
|
+
const [open, setOpen] = React23.useState(false);
|
|
5035
|
+
const containerRef = React23.useRef(null);
|
|
5178
5036
|
const options = (_a = field.options) != null ? _a : [];
|
|
5179
5037
|
const selectedOpt = (_b = options.find((o) => o.value === value)) != null ? _b : null;
|
|
5180
|
-
|
|
5038
|
+
React23.useEffect(() => {
|
|
5181
5039
|
if (!open) return;
|
|
5182
5040
|
const handleOutside = (e) => {
|
|
5183
5041
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -5566,11 +5424,11 @@ function RegistrationForm({
|
|
|
5566
5424
|
readOnly = false
|
|
5567
5425
|
}) {
|
|
5568
5426
|
var _a;
|
|
5569
|
-
const L =
|
|
5427
|
+
const L = React23.useMemo(
|
|
5570
5428
|
() => __spreadValues(__spreadValues({}, DEFAULT_LABELS3), labels != null ? labels : {}),
|
|
5571
5429
|
[labels]
|
|
5572
5430
|
);
|
|
5573
|
-
const sortedFields =
|
|
5431
|
+
const sortedFields = React23.useMemo(
|
|
5574
5432
|
() => [...fields].sort((a, b) => {
|
|
5575
5433
|
var _a2, _b;
|
|
5576
5434
|
return ((_a2 = a.order) != null ? _a2 : 0) - ((_b = b.order) != null ? _b : 0);
|
|
@@ -5578,7 +5436,7 @@ function RegistrationForm({
|
|
|
5578
5436
|
[fields]
|
|
5579
5437
|
);
|
|
5580
5438
|
const isControlled = values !== void 0;
|
|
5581
|
-
const [internal, setInternal] =
|
|
5439
|
+
const [internal, setInternal] = React23.useState(
|
|
5582
5440
|
() => initializeValues(
|
|
5583
5441
|
sortedFields,
|
|
5584
5442
|
defaultValues != null ? defaultValues : {},
|
|
@@ -5586,9 +5444,9 @@ function RegistrationForm({
|
|
|
5586
5444
|
includeTerms
|
|
5587
5445
|
)
|
|
5588
5446
|
);
|
|
5589
|
-
const [submitAttempted, setSubmitAttempted] =
|
|
5590
|
-
const [validationErrors, setValidationErrors] =
|
|
5591
|
-
|
|
5447
|
+
const [submitAttempted, setSubmitAttempted] = React23.useState(false);
|
|
5448
|
+
const [validationErrors, setValidationErrors] = React23.useState({});
|
|
5449
|
+
React23.useEffect(() => {
|
|
5592
5450
|
if (isControlled) return;
|
|
5593
5451
|
setInternal((prev) => {
|
|
5594
5452
|
const next = initializeValues(
|
|
@@ -5645,7 +5503,7 @@ function RegistrationForm({
|
|
|
5645
5503
|
const termsError = submitAttempted && termsEnabled && !termsAccepted;
|
|
5646
5504
|
const firstErrorFieldId = Object.keys(fieldErrors)[0];
|
|
5647
5505
|
const scrollTargetId = firstErrorFieldId ? `rf-${firstErrorFieldId}` : termsError ? "rf-terms" : null;
|
|
5648
|
-
|
|
5506
|
+
React23.useEffect(() => {
|
|
5649
5507
|
if (!submitAttempted || !scrollTargetId) return;
|
|
5650
5508
|
const timer = setTimeout(() => {
|
|
5651
5509
|
const elem = document.getElementById(scrollTargetId);
|
|
@@ -6099,10 +5957,10 @@ var OTPCodeInput = ({
|
|
|
6099
5957
|
id,
|
|
6100
5958
|
required
|
|
6101
5959
|
}) => {
|
|
6102
|
-
const baseId = id != null ? id :
|
|
6103
|
-
const inputRef =
|
|
6104
|
-
const [focused, setFocused] =
|
|
6105
|
-
const digits =
|
|
5960
|
+
const baseId = id != null ? id : React23.useId();
|
|
5961
|
+
const inputRef = React23.useRef(null);
|
|
5962
|
+
const [focused, setFocused] = React23.useState(false);
|
|
5963
|
+
const digits = React23.useMemo(() => {
|
|
6106
5964
|
const arr = value.split("").slice(0, length);
|
|
6107
5965
|
while (arr.length < length) arr.push("");
|
|
6108
5966
|
return arr;
|
|
@@ -6218,7 +6076,7 @@ function Checkbox(_a) {
|
|
|
6218
6076
|
})
|
|
6219
6077
|
);
|
|
6220
6078
|
}
|
|
6221
|
-
var AccordionVariantContext =
|
|
6079
|
+
var AccordionVariantContext = React23.createContext("default");
|
|
6222
6080
|
function Accordion(_a) {
|
|
6223
6081
|
var _b = _a, { className, variant = "default" } = _b, props = __objRest(_b, ["className", "variant"]);
|
|
6224
6082
|
return /* @__PURE__ */ jsx(AccordionVariantContext.Provider, { value: variant, children: /* @__PURE__ */ jsx(
|
|
@@ -6236,7 +6094,7 @@ function Accordion(_a) {
|
|
|
6236
6094
|
}
|
|
6237
6095
|
function AccordionItem(_a) {
|
|
6238
6096
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6239
|
-
const variant =
|
|
6097
|
+
const variant = React23.useContext(AccordionVariantContext);
|
|
6240
6098
|
return /* @__PURE__ */ jsx(
|
|
6241
6099
|
Accordion$1.Item,
|
|
6242
6100
|
__spreadValues({
|
|
@@ -6257,7 +6115,7 @@ function AccordionTrigger(_a) {
|
|
|
6257
6115
|
"className",
|
|
6258
6116
|
"children"
|
|
6259
6117
|
]);
|
|
6260
|
-
const variant =
|
|
6118
|
+
const variant = React23.useContext(AccordionVariantContext);
|
|
6261
6119
|
return /* @__PURE__ */ jsx(Accordion$1.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
|
|
6262
6120
|
Accordion$1.Trigger,
|
|
6263
6121
|
__spreadProps(__spreadValues({
|
|
@@ -6311,7 +6169,7 @@ function AccordionContent(_a) {
|
|
|
6311
6169
|
"className",
|
|
6312
6170
|
"children"
|
|
6313
6171
|
]);
|
|
6314
|
-
const variant =
|
|
6172
|
+
const variant = React23.useContext(AccordionVariantContext);
|
|
6315
6173
|
return /* @__PURE__ */ jsx(
|
|
6316
6174
|
Accordion$1.Panel,
|
|
6317
6175
|
__spreadProps(__spreadValues({
|
|
@@ -6343,7 +6201,7 @@ function FilterPanel({
|
|
|
6343
6201
|
title = "Filters",
|
|
6344
6202
|
className
|
|
6345
6203
|
}) {
|
|
6346
|
-
const [internalValue, setInternalValue] =
|
|
6204
|
+
const [internalValue, setInternalValue] = React23.useState(
|
|
6347
6205
|
() => Object.fromEntries(groups.map((g) => [g.id, []]))
|
|
6348
6206
|
);
|
|
6349
6207
|
const selected = value != null ? value : internalValue;
|
|
@@ -6505,11 +6363,11 @@ function ItineraryModal({
|
|
|
6505
6363
|
onNext
|
|
6506
6364
|
}) {
|
|
6507
6365
|
var _a, _b, _c;
|
|
6508
|
-
const [imgIndex, setImgIndex] =
|
|
6366
|
+
const [imgIndex, setImgIndex] = React23.useState(0);
|
|
6509
6367
|
const images = stop ? [stop.coverImage, ...(_a = stop.images) != null ? _a : []] : [];
|
|
6510
6368
|
const isFirst = (stop == null ? void 0 : stop.dayNumber) === ((_b = allStops[0]) == null ? void 0 : _b.dayNumber);
|
|
6511
6369
|
const isLast = (stop == null ? void 0 : stop.dayNumber) === ((_c = allStops[allStops.length - 1]) == null ? void 0 : _c.dayNumber);
|
|
6512
|
-
|
|
6370
|
+
React23.useEffect(() => {
|
|
6513
6371
|
setImgIndex(0);
|
|
6514
6372
|
}, [stop == null ? void 0 : stop.dayNumber]);
|
|
6515
6373
|
if (!stop) return null;
|
|
@@ -6636,8 +6494,8 @@ function ItineraryModal({
|
|
|
6636
6494
|
) });
|
|
6637
6495
|
}
|
|
6638
6496
|
function Itinerary({ title, subtitle, stops, className }) {
|
|
6639
|
-
const [activeIndex, setActiveIndex] =
|
|
6640
|
-
const scrollRef =
|
|
6497
|
+
const [activeIndex, setActiveIndex] = React23.useState(null);
|
|
6498
|
+
const scrollRef = React23.useRef(null);
|
|
6641
6499
|
const activeStop = activeIndex !== null ? stops[activeIndex] : null;
|
|
6642
6500
|
const scrollBy = (dir) => {
|
|
6643
6501
|
if (!scrollRef.current) return;
|
|
@@ -6723,8 +6581,8 @@ function MenuTrip({
|
|
|
6723
6581
|
bold = true,
|
|
6724
6582
|
className
|
|
6725
6583
|
}) {
|
|
6726
|
-
const scrollRef =
|
|
6727
|
-
|
|
6584
|
+
const scrollRef = React23.useRef(null);
|
|
6585
|
+
React23.useEffect(() => {
|
|
6728
6586
|
if (!scrollRef.current || !activeSection) return;
|
|
6729
6587
|
const container = scrollRef.current;
|
|
6730
6588
|
const btn = container.querySelector(
|
|
@@ -6870,18 +6728,18 @@ function Lightbox({
|
|
|
6870
6728
|
onClose
|
|
6871
6729
|
}) {
|
|
6872
6730
|
var _a;
|
|
6873
|
-
const [index, setIndex] =
|
|
6731
|
+
const [index, setIndex] = React23.useState(initialIndex);
|
|
6874
6732
|
const total = photos.length;
|
|
6875
6733
|
const photo = photos[index];
|
|
6876
|
-
const prev =
|
|
6734
|
+
const prev = React23.useCallback(
|
|
6877
6735
|
() => setIndex((i) => (i - 1 + total) % total),
|
|
6878
6736
|
[total]
|
|
6879
6737
|
);
|
|
6880
|
-
const next =
|
|
6738
|
+
const next = React23.useCallback(
|
|
6881
6739
|
() => setIndex((i) => (i + 1) % total),
|
|
6882
6740
|
[total]
|
|
6883
6741
|
);
|
|
6884
|
-
|
|
6742
|
+
React23.useEffect(() => {
|
|
6885
6743
|
const onKey = (e) => {
|
|
6886
6744
|
if (e.key === "Escape") onClose();
|
|
6887
6745
|
if (e.key === "ArrowLeft") prev();
|
|
@@ -7075,7 +6933,7 @@ function GridGallery({
|
|
|
7075
6933
|
initialVisible,
|
|
7076
6934
|
onOpen
|
|
7077
6935
|
}) {
|
|
7078
|
-
const [expanded, setExpanded] =
|
|
6936
|
+
const [expanded, setExpanded] = React23.useState(false);
|
|
7079
6937
|
const cols = gridCols(photos.length);
|
|
7080
6938
|
const hasMore = photos.length > initialVisible;
|
|
7081
6939
|
const visible = expanded || !hasMore ? photos : photos.slice(0, initialVisible);
|
|
@@ -7105,7 +6963,7 @@ function MasonryGallery({
|
|
|
7105
6963
|
initialVisible,
|
|
7106
6964
|
onOpen
|
|
7107
6965
|
}) {
|
|
7108
|
-
const [expanded, setExpanded] =
|
|
6966
|
+
const [expanded, setExpanded] = React23.useState(false);
|
|
7109
6967
|
const hasMore = photos.length > initialVisible;
|
|
7110
6968
|
const visible = expanded || !hasMore ? photos : photos.slice(0, initialVisible);
|
|
7111
6969
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -7178,7 +7036,7 @@ function FeaturedGallery({
|
|
|
7178
7036
|
photos,
|
|
7179
7037
|
onOpen
|
|
7180
7038
|
}) {
|
|
7181
|
-
const [expanded, setExpanded] =
|
|
7039
|
+
const [expanded, setExpanded] = React23.useState(false);
|
|
7182
7040
|
const featured = photos.slice(0, 3);
|
|
7183
7041
|
const extra = photos.slice(3);
|
|
7184
7042
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -7255,8 +7113,8 @@ function PhotoGallery({
|
|
|
7255
7113
|
onPhotoClick,
|
|
7256
7114
|
className
|
|
7257
7115
|
}) {
|
|
7258
|
-
const [lightboxIndex, setLightboxIndex] =
|
|
7259
|
-
const normalised =
|
|
7116
|
+
const [lightboxIndex, setLightboxIndex] = React23.useState(null);
|
|
7117
|
+
const normalised = React23.useMemo(() => photos.map(normalise), [photos]);
|
|
7260
7118
|
const handleOpen = (index) => {
|
|
7261
7119
|
setLightboxIndex(index);
|
|
7262
7120
|
onPhotoClick == null ? void 0 : onPhotoClick(normalised[index].src, index);
|
|
@@ -7345,7 +7203,7 @@ function PricingTrip({
|
|
|
7345
7203
|
variant = "card",
|
|
7346
7204
|
className
|
|
7347
7205
|
}) {
|
|
7348
|
-
const [showPricing, setShowPricing] =
|
|
7206
|
+
const [showPricing, setShowPricing] = React23.useState(false);
|
|
7349
7207
|
if (variant === "compact") {
|
|
7350
7208
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-3", className), children: [
|
|
7351
7209
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -7668,14 +7526,14 @@ function SiteHeader({
|
|
|
7668
7526
|
className
|
|
7669
7527
|
}) {
|
|
7670
7528
|
const t = VARIANT[variant];
|
|
7671
|
-
const [openMenu, setOpenMenu] =
|
|
7672
|
-
const [langOpen, setLangOpen] =
|
|
7673
|
-
const [mobileOpen, setMobileOpen] =
|
|
7674
|
-
const [openMobileSection, setOpenMobileSection] =
|
|
7675
|
-
const [activeLang, setActiveLang] =
|
|
7529
|
+
const [openMenu, setOpenMenu] = React23.useState(null);
|
|
7530
|
+
const [langOpen, setLangOpen] = React23.useState(false);
|
|
7531
|
+
const [mobileOpen, setMobileOpen] = React23.useState(false);
|
|
7532
|
+
const [openMobileSection, setOpenMobileSection] = React23.useState(null);
|
|
7533
|
+
const [activeLang, setActiveLang] = React23.useState(currentLanguage);
|
|
7676
7534
|
const toggleMobileSection = (label) => setOpenMobileSection((prev) => prev === label ? null : label);
|
|
7677
|
-
const menuCloseTimer =
|
|
7678
|
-
const langCloseTimer =
|
|
7535
|
+
const menuCloseTimer = React23.useRef(void 0);
|
|
7536
|
+
const langCloseTimer = React23.useRef(void 0);
|
|
7679
7537
|
const handleMenuEnter = (label) => {
|
|
7680
7538
|
clearTimeout(menuCloseTimer.current);
|
|
7681
7539
|
setOpenMenu(label);
|
|
@@ -7696,7 +7554,7 @@ function SiteHeader({
|
|
|
7696
7554
|
setOpenMenu(null);
|
|
7697
7555
|
setLangOpen(false);
|
|
7698
7556
|
};
|
|
7699
|
-
|
|
7557
|
+
React23.useEffect(() => () => {
|
|
7700
7558
|
clearTimeout(menuCloseTimer.current);
|
|
7701
7559
|
clearTimeout(langCloseTimer.current);
|
|
7702
7560
|
}, []);
|
|
@@ -7961,7 +7819,7 @@ function SiteHeader({
|
|
|
7961
7819
|
), children: [
|
|
7962
7820
|
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: languages.map((lang, i) => {
|
|
7963
7821
|
const isActive = lang.code === activeLang;
|
|
7964
|
-
return /* @__PURE__ */ jsxs(
|
|
7822
|
+
return /* @__PURE__ */ jsxs(React23.Fragment, { children: [
|
|
7965
7823
|
i > 0 && /* @__PURE__ */ jsx("span", { className: cn(
|
|
7966
7824
|
"text-xs select-none",
|
|
7967
7825
|
variant === "white" ? "text-border" : "text-white/15"
|
|
@@ -8023,8 +7881,8 @@ function SiteHeader({
|
|
|
8023
7881
|
);
|
|
8024
7882
|
}
|
|
8025
7883
|
function ThemeToggle({ className }) {
|
|
8026
|
-
const [dark, setDark] =
|
|
8027
|
-
|
|
7884
|
+
const [dark, setDark] = React23.useState(false);
|
|
7885
|
+
React23.useEffect(() => {
|
|
8028
7886
|
const saved = localStorage.getItem("theme");
|
|
8029
7887
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
8030
7888
|
const isDark = saved === "dark" || !saved && prefersDark;
|
|
@@ -8175,7 +8033,7 @@ function TripCard({
|
|
|
8175
8033
|
);
|
|
8176
8034
|
}
|
|
8177
8035
|
function useHlsVideo(videoRef, src) {
|
|
8178
|
-
|
|
8036
|
+
React23.useEffect(() => {
|
|
8179
8037
|
if (!src || !videoRef.current) return;
|
|
8180
8038
|
const video = videoRef.current;
|
|
8181
8039
|
if (!src.includes(".m3u8")) return;
|
|
@@ -8217,11 +8075,11 @@ function TripHeader({
|
|
|
8217
8075
|
className
|
|
8218
8076
|
}) {
|
|
8219
8077
|
var _a;
|
|
8220
|
-
const [heroIndex, setHeroIndex] =
|
|
8221
|
-
const [videoReady, setVideoReady] =
|
|
8222
|
-
const videoRef =
|
|
8078
|
+
const [heroIndex, setHeroIndex] = React23.useState(0);
|
|
8079
|
+
const [videoReady, setVideoReady] = React23.useState(false);
|
|
8080
|
+
const videoRef = React23.useRef(null);
|
|
8223
8081
|
const isHls = !!(videoUrl == null ? void 0 : videoUrl.includes(".m3u8"));
|
|
8224
|
-
const validImages =
|
|
8082
|
+
const validImages = React23.useMemo(
|
|
8225
8083
|
() => images.map((u) => u == null ? void 0 : u.trim()).filter(Boolean),
|
|
8226
8084
|
[images]
|
|
8227
8085
|
);
|
|
@@ -8236,7 +8094,7 @@ function TripHeader({
|
|
|
8236
8094
|
const nights = duration ? (_a = duration.nights) != null ? _a : Math.max(duration.days - 1, 1) : null;
|
|
8237
8095
|
const hasMeta = !!(destination || duration);
|
|
8238
8096
|
useHlsVideo(videoRef, isHls ? videoUrl : void 0);
|
|
8239
|
-
|
|
8097
|
+
React23.useEffect(() => {
|
|
8240
8098
|
if (!videoUrl) return;
|
|
8241
8099
|
const el = videoRef.current;
|
|
8242
8100
|
if (!el) return;
|
|
@@ -8378,7 +8236,7 @@ function TripHeader({
|
|
|
8378
8236
|
siteHeader ? "-mt-44" : "-mt-36"
|
|
8379
8237
|
),
|
|
8380
8238
|
children: [
|
|
8381
|
-
breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsx("div", { className: "mb-3 flex items-center gap-1.5 flex-wrap", children: breadcrumb.map((crumb, i) => /* @__PURE__ */ jsxs(
|
|
8239
|
+
breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsx("div", { className: "mb-3 flex items-center gap-1.5 flex-wrap", children: breadcrumb.map((crumb, i) => /* @__PURE__ */ jsxs(React23.Fragment, { children: [
|
|
8382
8240
|
i > 0 && /* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-3 w-3 text-white/50 shrink-0" }),
|
|
8383
8241
|
/* @__PURE__ */ jsx("span", { className: "text-xs text-white/70 font-ui hover:text-white/90 cursor-default", children: crumb.label })
|
|
8384
8242
|
] }, i)) }),
|
|
@@ -8478,19 +8336,19 @@ function TripPage({
|
|
|
8478
8336
|
features,
|
|
8479
8337
|
className
|
|
8480
8338
|
}) {
|
|
8481
|
-
const [activeSection, setActiveSection] =
|
|
8482
|
-
const [navFloating, setNavFloating] =
|
|
8483
|
-
const [navHidden, setNavHidden] =
|
|
8484
|
-
const [isFloating, setIsFloating] =
|
|
8485
|
-
const [sidebarPos, setSidebarPos] =
|
|
8486
|
-
const [pricingBarVisible, setPricingBarVisible] =
|
|
8487
|
-
const navRef =
|
|
8488
|
-
const navSentinelRef =
|
|
8489
|
-
const sentinelRef =
|
|
8490
|
-
const sidebarPlaceholderRef =
|
|
8491
|
-
const pricingBarRef =
|
|
8492
|
-
const galleryRef =
|
|
8493
|
-
const sections =
|
|
8339
|
+
const [activeSection, setActiveSection] = React23.useState("");
|
|
8340
|
+
const [navFloating, setNavFloating] = React23.useState(false);
|
|
8341
|
+
const [navHidden, setNavHidden] = React23.useState(false);
|
|
8342
|
+
const [isFloating, setIsFloating] = React23.useState(false);
|
|
8343
|
+
const [sidebarPos, setSidebarPos] = React23.useState(null);
|
|
8344
|
+
const [pricingBarVisible, setPricingBarVisible] = React23.useState(false);
|
|
8345
|
+
const navRef = React23.useRef(null);
|
|
8346
|
+
const navSentinelRef = React23.useRef(null);
|
|
8347
|
+
const sentinelRef = React23.useRef(null);
|
|
8348
|
+
const sidebarPlaceholderRef = React23.useRef(null);
|
|
8349
|
+
const pricingBarRef = React23.useRef(null);
|
|
8350
|
+
const galleryRef = React23.useRef(null);
|
|
8351
|
+
const sections = React23.useMemo(
|
|
8494
8352
|
() => [
|
|
8495
8353
|
{ id: "key-info", label: "Key info", show: !!(infoGroups == null ? void 0 : infoGroups.length) },
|
|
8496
8354
|
{ id: "overview", label: "Overview", show: !!overview },
|
|
@@ -8505,7 +8363,7 @@ function TripPage({
|
|
|
8505
8363
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8506
8364
|
[]
|
|
8507
8365
|
);
|
|
8508
|
-
|
|
8366
|
+
React23.useEffect(() => {
|
|
8509
8367
|
const sentinel = navSentinelRef.current;
|
|
8510
8368
|
if (!sentinel) return;
|
|
8511
8369
|
const update = () => setNavFloating(sentinel.getBoundingClientRect().top < 1);
|
|
@@ -8513,7 +8371,7 @@ function TripPage({
|
|
|
8513
8371
|
update();
|
|
8514
8372
|
return () => document.removeEventListener("scroll", update, { capture: true });
|
|
8515
8373
|
}, []);
|
|
8516
|
-
|
|
8374
|
+
React23.useEffect(() => {
|
|
8517
8375
|
const sentinel = sentinelRef.current;
|
|
8518
8376
|
if (!sentinel) return;
|
|
8519
8377
|
const update = () => setIsFloating(sentinel.getBoundingClientRect().top < 1);
|
|
@@ -8521,7 +8379,7 @@ function TripPage({
|
|
|
8521
8379
|
update();
|
|
8522
8380
|
return () => document.removeEventListener("scroll", update, { capture: true });
|
|
8523
8381
|
}, []);
|
|
8524
|
-
|
|
8382
|
+
React23.useEffect(() => {
|
|
8525
8383
|
const measure = () => {
|
|
8526
8384
|
if (!sidebarPlaceholderRef.current) return;
|
|
8527
8385
|
const rect = sidebarPlaceholderRef.current.getBoundingClientRect();
|
|
@@ -8531,7 +8389,7 @@ function TripPage({
|
|
|
8531
8389
|
window.addEventListener("resize", measure);
|
|
8532
8390
|
return () => window.removeEventListener("resize", measure);
|
|
8533
8391
|
}, [isFloating]);
|
|
8534
|
-
|
|
8392
|
+
React23.useEffect(() => {
|
|
8535
8393
|
const check = () => {
|
|
8536
8394
|
var _a;
|
|
8537
8395
|
const target = (_a = galleryRef.current) != null ? _a : pricingBarRef.current;
|
|
@@ -8542,7 +8400,7 @@ function TripPage({
|
|
|
8542
8400
|
check();
|
|
8543
8401
|
return () => document.removeEventListener("scroll", check, { capture: true });
|
|
8544
8402
|
}, []);
|
|
8545
|
-
|
|
8403
|
+
React23.useEffect(() => {
|
|
8546
8404
|
const check = () => {
|
|
8547
8405
|
if (!pricingBarRef.current) return;
|
|
8548
8406
|
setNavHidden(pricingBarRef.current.getBoundingClientRect().top < window.innerHeight * 0.92);
|
|
@@ -8551,7 +8409,7 @@ function TripPage({
|
|
|
8551
8409
|
check();
|
|
8552
8410
|
return () => document.removeEventListener("scroll", check, { capture: true });
|
|
8553
8411
|
}, []);
|
|
8554
|
-
|
|
8412
|
+
React23.useEffect(() => {
|
|
8555
8413
|
if (sections.length === 0) return;
|
|
8556
8414
|
setActiveSection(sections[0].id);
|
|
8557
8415
|
const update = () => {
|
|
@@ -8916,12 +8774,12 @@ function Toast({
|
|
|
8916
8774
|
duration = 6e3,
|
|
8917
8775
|
className
|
|
8918
8776
|
}) {
|
|
8919
|
-
const [mounted, setMounted] =
|
|
8920
|
-
const [visible, setVisible] =
|
|
8921
|
-
|
|
8777
|
+
const [mounted, setMounted] = React23.useState(false);
|
|
8778
|
+
const [visible, setVisible] = React23.useState(true);
|
|
8779
|
+
React23.useEffect(() => {
|
|
8922
8780
|
setMounted(true);
|
|
8923
8781
|
}, []);
|
|
8924
|
-
|
|
8782
|
+
React23.useEffect(() => {
|
|
8925
8783
|
if (duration === 0) return;
|
|
8926
8784
|
const t = setTimeout(() => {
|
|
8927
8785
|
setVisible(false);
|
|
@@ -9625,6 +9483,6 @@ function LeadCapturePopup({
|
|
|
9625
9483
|
);
|
|
9626
9484
|
}
|
|
9627
9485
|
|
|
9628
|
-
export { ActivityCard, AgentContactCard, Alert, BirthDateField, BookingConfirmation, BookingConfirmationEmail, BookingConfirmedCard, BookingDetails, BookingForm, BookingOtpEmail, BookingShell,
|
|
9486
|
+
export { ActivityCard, AgentContactCard, Alert, BirthDateField, BookingConfirmation, BookingConfirmationEmail, BookingConfirmedCard, BookingDetails, BookingForm, BookingOtpEmail, BookingShell, Button, COUNTRIES, CounterField, CountrySearchField, DEFAULT_HEADER_LINKS, DEFAULT_LANGUAGES, DatePickerField, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, FilterPanel, FloatingInput, FloatingSelect, Itinerary, LOGO_PLANETAEXO_DATA_URI, LeadCapturePopup, MenuTrip, OTPCodeInput, Offer, OfferAdventureCard, PaymentAmountSelector, PaymentMethodSelector, PaymentModalShell, PhoneCountrySelect, PhotoGallery, PricingTrip, RegistrationForm, RegistrationSuccessCard, SiteHeader, TERMS_ACCEPT_KEY, TermsSection, ThemeToggle, Toast, TravellerFormInviteEmail, TripCard, TripHeader, TripPage, buttonVariants, cn, emailTokens, getStripeAppearance, stripeAppearance, wrapEmailHtml };
|
|
9629
9487
|
//# sourceMappingURL=index.js.map
|
|
9630
9488
|
//# sourceMappingURL=index.js.map
|