@planetaexo/design-system 0.4.15 → 0.4.16

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var React21 = require('react');
3
+ var React22 = require('react');
4
4
  var classVarianceAuthority = require('class-variance-authority');
5
5
  var clsx = require('clsx');
6
6
  var tailwindMerge = require('tailwind-merge');
@@ -36,7 +36,7 @@ function _interopNamespace(e) {
36
36
  return Object.freeze(n);
37
37
  }
38
38
 
39
- var React21__namespace = /*#__PURE__*/_interopNamespace(React21);
39
+ var React22__namespace = /*#__PURE__*/_interopNamespace(React22);
40
40
 
41
41
  var __defProp = Object.defineProperty;
42
42
  var __defProps = Object.defineProperties;
@@ -101,7 +101,7 @@ var buttonVariants = classVarianceAuthority.cva(
101
101
  }
102
102
  }
103
103
  );
104
- var Button = React21__namespace.forwardRef(
104
+ var Button = React22__namespace.forwardRef(
105
105
  (_a, ref) => {
106
106
  var _b = _a, { className, variant, size } = _b, props = __objRest(_b, ["className", "variant", "size"]);
107
107
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -296,10 +296,10 @@ function DialogDescription(_a) {
296
296
  }, props)
297
297
  );
298
298
  }
299
- var FloatingInput = React21__namespace.forwardRef(
299
+ var FloatingInput = React22__namespace.forwardRef(
300
300
  (_a, ref) => {
301
301
  var _b = _a, { label, error, id, className, required } = _b, props = __objRest(_b, ["label", "error", "id", "className", "required"]);
302
- const inputId = id != null ? id : React21__namespace.useId();
302
+ const inputId = id != null ? id : React22__namespace.useId();
303
303
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", className), children: [
304
304
  /* @__PURE__ */ jsxRuntime.jsx(
305
305
  "input",
@@ -339,10 +339,10 @@ var FloatingInput = React21__namespace.forwardRef(
339
339
  }
340
340
  );
341
341
  FloatingInput.displayName = "FloatingInput";
342
- var FloatingSelect = React21__namespace.forwardRef(
342
+ var FloatingSelect = React22__namespace.forwardRef(
343
343
  (_a, ref) => {
344
344
  var _b = _a, { label, error, id, className, required, children, value } = _b, props = __objRest(_b, ["label", "error", "id", "className", "required", "children", "value"]);
345
- const inputId = id != null ? id : React21__namespace.useId();
345
+ const inputId = id != null ? id : React22__namespace.useId();
346
346
  const hasValue = typeof value === "string" ? value !== "" : value !== void 0 && value !== null;
347
347
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", className), children: [
348
348
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -605,11 +605,11 @@ function PhoneCountrySelect({
605
605
  className
606
606
  }) {
607
607
  var _a;
608
- const [open, setOpen] = React21__namespace.useState(false);
609
- const containerRef = React21__namespace.useRef(null);
610
- const listRef = React21__namespace.useRef(null);
608
+ const [open, setOpen] = React22__namespace.useState(false);
609
+ const containerRef = React22__namespace.useRef(null);
610
+ const listRef = React22__namespace.useRef(null);
611
611
  const selected = (_a = PHONE_COUNTRIES.find((c) => c.code === value)) != null ? _a : PHONE_COUNTRIES[0];
612
- React21__namespace.useEffect(() => {
612
+ React22__namespace.useEffect(() => {
613
613
  if (!open) return;
614
614
  const handler = (e) => {
615
615
  var _a2;
@@ -620,7 +620,7 @@ function PhoneCountrySelect({
620
620
  document.addEventListener("mousedown", handler);
621
621
  return () => document.removeEventListener("mousedown", handler);
622
622
  }, [open]);
623
- React21__namespace.useEffect(() => {
623
+ React22__namespace.useEffect(() => {
624
624
  if (!open || !listRef.current) return;
625
625
  const activeEl = listRef.current.querySelector("[data-selected=true]");
626
626
  activeEl == null ? void 0 : activeEl.scrollIntoView({ block: "nearest" });
@@ -884,8 +884,8 @@ function CalendarDayButton(_a) {
884
884
  "locale"
885
885
  ]);
886
886
  const defaultClassNames = reactDayPicker.getDefaultClassNames();
887
- const ref = React21__namespace.useRef(null);
888
- React21__namespace.useEffect(() => {
887
+ const ref = React22__namespace.useRef(null);
888
+ React22__namespace.useEffect(() => {
889
889
  var _a2;
890
890
  if (modifiers.focused) (_a2 = ref.current) == null ? void 0 : _a2.focus();
891
891
  }, [modifiers.focused]);
@@ -915,16 +915,16 @@ function BirthDateField({
915
915
  error,
916
916
  className
917
917
  }) {
918
- const [open, setOpen] = React21__namespace.useState(false);
919
- const [text, setText] = React21__namespace.useState(
918
+ const [open, setOpen] = React22__namespace.useState(false);
919
+ const [text, setText] = React22__namespace.useState(
920
920
  value ? dateFns.format(value, "dd/MM/yyyy") : ""
921
921
  );
922
- const containerRef = React21__namespace.useRef(null);
923
- const inputId = React21__namespace.useId();
924
- React21__namespace.useEffect(() => {
922
+ const containerRef = React22__namespace.useRef(null);
923
+ const inputId = React22__namespace.useId();
924
+ React22__namespace.useEffect(() => {
925
925
  setText(value ? dateFns.format(value, "dd/MM/yyyy") : "");
926
926
  }, [value]);
927
- React21__namespace.useEffect(() => {
927
+ React22__namespace.useEffect(() => {
928
928
  if (!open) return;
929
929
  const handler = (e) => {
930
930
  var _a;
@@ -1127,14 +1127,14 @@ function CountrySearchField({
1127
1127
  }) {
1128
1128
  var _a;
1129
1129
  const list = countries != null ? countries : COUNTRIES;
1130
- const [query, setQuery] = React21__namespace.useState("");
1131
- const [open, setOpen] = React21__namespace.useState(false);
1132
- const containerRef = React21__namespace.useRef(null);
1133
- const searchRef = React21__namespace.useRef(null);
1130
+ const [query, setQuery] = React22__namespace.useState("");
1131
+ const [open, setOpen] = React22__namespace.useState(false);
1132
+ const containerRef = React22__namespace.useRef(null);
1133
+ const searchRef = React22__namespace.useRef(null);
1134
1134
  const selected = list.find((c) => c.code === value);
1135
1135
  const isFloated = open || !!selected;
1136
1136
  const filtered = query.trim() ? list.filter((c) => c.name.toLowerCase().includes(query.toLowerCase())) : list;
1137
- React21__namespace.useEffect(() => {
1137
+ React22__namespace.useEffect(() => {
1138
1138
  if (!open) return;
1139
1139
  const handler = (e) => {
1140
1140
  var _a2;
@@ -1241,7 +1241,7 @@ function Alert({ variant = "info", children, className }) {
1241
1241
  function AdventureCard({ adventure }) {
1242
1242
  var _a, _b, _c, _d, _e, _f;
1243
1243
  const isControlled = (_b = (_a = adventure.optionals) == null ? void 0 : _a.some((o) => o.onCheckedChange !== void 0)) != null ? _b : false;
1244
- const [checkedInternal, setCheckedInternal] = React21__namespace.useState(
1244
+ const [checkedInternal, setCheckedInternal] = React22__namespace.useState(
1245
1245
  new Set((_d = (_c = adventure.optionals) == null ? void 0 : _c.filter((o) => o.defaultChecked).map((o) => o.id)) != null ? _d : [])
1246
1246
  );
1247
1247
  const isChecked = (opt) => {
@@ -1578,7 +1578,7 @@ function BookingShell({
1578
1578
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-2xl border border-border bg-card overflow-hidden", children: [
1579
1579
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-b border-border px-5 py-4 bg-muted/20", children: [
1580
1580
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-bold text-foreground font-heading mb-2", children: title }),
1581
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: steps.map((label, i) => /* @__PURE__ */ jsxRuntime.jsxs(React21__namespace.Fragment, { children: [
1581
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: steps.map((label, i) => /* @__PURE__ */ jsxRuntime.jsxs(React22__namespace.Fragment, { children: [
1582
1582
  /* @__PURE__ */ jsxRuntime.jsx(
1583
1583
  "span",
1584
1584
  {
@@ -1777,7 +1777,7 @@ function TermsSection({
1777
1777
  termsContent
1778
1778
  }) {
1779
1779
  var _a;
1780
- const [modalOpen, setModalOpen] = React21__namespace.useState(false);
1780
+ const [modalOpen, setModalOpen] = React22__namespace.useState(false);
1781
1781
  const i18n = (_a = TERMS_I18N[locale]) != null ? _a : TERMS_I18N.en;
1782
1782
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-border p-4 flex flex-col gap-3", children: [
1783
1783
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: title }),
@@ -1865,9 +1865,9 @@ function BookingWizard({
1865
1865
  depositInfo,
1866
1866
  onCancel
1867
1867
  }) {
1868
- const [step, setStep] = React21__namespace.useState("responsible");
1869
- const [error, setError] = React21__namespace.useState(null);
1870
- const [responsible, setResponsible] = React21__namespace.useState({
1868
+ const [step, setStep] = React22__namespace.useState("responsible");
1869
+ const [error, setError] = React22__namespace.useState(null);
1870
+ const [responsible, setResponsible] = React22__namespace.useState({
1871
1871
  firstName: "",
1872
1872
  lastName: "",
1873
1873
  email: "",
@@ -1886,7 +1886,7 @@ function BookingWizard({
1886
1886
  return s + ((_b = (_a = a.slots) == null ? void 0 : _a.children) != null ? _b : 0);
1887
1887
  }, 0);
1888
1888
  const totalPax = totalAdults + totalChildren;
1889
- const [travellers, setTravellers] = React21__namespace.useState(
1889
+ const [travellers, setTravellers] = React22__namespace.useState(
1890
1890
  Array.from({ length: Math.max(totalPax, 1) }, () => ({
1891
1891
  firstName: "",
1892
1892
  lastName: "",
@@ -1894,9 +1894,9 @@ function BookingWizard({
1894
1894
  email: ""
1895
1895
  }))
1896
1896
  );
1897
- const [payAmount, setPayAmount] = React21__namespace.useState("full");
1898
- const [payMethod, setPayMethod] = React21__namespace.useState("stripe");
1899
- const [termsAccepted, setTermsAccepted] = React21__namespace.useState(false);
1897
+ const [payAmount, setPayAmount] = React22__namespace.useState("full");
1898
+ const [payMethod, setPayMethod] = React22__namespace.useState("stripe");
1899
+ const [termsAccepted, setTermsAccepted] = React22__namespace.useState(false);
1900
1900
  const setR = (k, v) => setResponsible((p) => __spreadProps(__spreadValues({}, p), { [k]: v }));
1901
1901
  const setT = (i, k, v) => setTravellers((prev) => prev.map((t, idx) => idx === i ? __spreadProps(__spreadValues({}, t), { [k]: v }) : t));
1902
1902
  const setTDob = (i, v) => setTravellers((prev) => prev.map((t, idx) => idx === i ? __spreadProps(__spreadValues({}, t), { dateOfBirth: v }) : t));
@@ -2097,7 +2097,7 @@ function Offer({
2097
2097
  continueDisabled,
2098
2098
  className
2099
2099
  }) {
2100
- const [showBooking, setShowBooking] = React21__namespace.useState(false);
2100
+ const [showBooking, setShowBooking] = React22__namespace.useState(false);
2101
2101
  const isShowingCheckout = !!checkoutSlot || showBooking;
2102
2102
  const handleBook = () => {
2103
2103
  if (!checkoutSlot && !externalBookingFlow) setShowBooking(true);
@@ -2219,9 +2219,9 @@ function AdventureSection({
2219
2219
  onAddSuggestedTraveller
2220
2220
  }) {
2221
2221
  var _a, _b, _c;
2222
- const [detailsOpen, setDetailsOpen] = React21__namespace.useState(false);
2223
- const [addModalOpen, setAddModalOpen] = React21__namespace.useState(false);
2224
- const [newTraveller, setNewTraveller] = React21__namespace.useState({
2222
+ const [detailsOpen, setDetailsOpen] = React22__namespace.useState(false);
2223
+ const [addModalOpen, setAddModalOpen] = React22__namespace.useState(false);
2224
+ const [newTraveller, setNewTraveller] = React22__namespace.useState({
2225
2225
  firstName: "",
2226
2226
  lastName: "",
2227
2227
  passport: "",
@@ -3640,11 +3640,11 @@ function DatePickerField({
3640
3640
  fromDate,
3641
3641
  className
3642
3642
  }) {
3643
- const [open, setOpen] = React21__namespace.useState(false);
3644
- const containerRef = React21__namespace.useRef(null);
3645
- const [calendarWidth, setCalendarWidth] = React21__namespace.useState();
3643
+ const [open, setOpen] = React22__namespace.useState(false);
3644
+ const containerRef = React22__namespace.useRef(null);
3645
+ const [calendarWidth, setCalendarWidth] = React22__namespace.useState();
3646
3646
  const hasValue = !!value;
3647
- React21__namespace.useEffect(() => {
3647
+ React22__namespace.useEffect(() => {
3648
3648
  if (!containerRef.current) return;
3649
3649
  const observer = new ResizeObserver(([entry]) => {
3650
3650
  setCalendarWidth(entry.contentRect.width);
@@ -3753,7 +3753,7 @@ function BookingForm({
3753
3753
  subtitle = "Free enquiry \u2013 no commitment",
3754
3754
  className
3755
3755
  }) {
3756
- const [values, setValues] = React21__namespace.useState(__spreadValues(__spreadValues({}, defaultInitial), defaultValues));
3756
+ const [values, setValues] = React22__namespace.useState(__spreadValues(__spreadValues({}, defaultInitial), defaultValues));
3757
3757
  const set = (key, value) => setValues((prev) => __spreadProps(__spreadValues({}, prev), { [key]: value }));
3758
3758
  const handleSubmit = (e) => {
3759
3759
  e.preventDefault();
@@ -4267,11 +4267,11 @@ function FloatingTextarea({
4267
4267
  }
4268
4268
  function SelectField({ field, value, onChange, error }) {
4269
4269
  var _a, _b, _c;
4270
- const [open, setOpen] = React21__namespace.useState(false);
4271
- const containerRef = React21__namespace.useRef(null);
4270
+ const [open, setOpen] = React22__namespace.useState(false);
4271
+ const containerRef = React22__namespace.useRef(null);
4272
4272
  const options = (_a = field.options) != null ? _a : [];
4273
4273
  const selectedOpt = (_b = options.find((o) => o.value === value)) != null ? _b : null;
4274
- React21__namespace.useEffect(() => {
4274
+ React22__namespace.useEffect(() => {
4275
4275
  if (!open) return;
4276
4276
  const handleOutside = (e) => {
4277
4277
  if (containerRef.current && !containerRef.current.contains(e.target)) {
@@ -4638,11 +4638,11 @@ function RegistrationForm({
4638
4638
  className
4639
4639
  }) {
4640
4640
  var _a;
4641
- const L = React21__namespace.useMemo(
4641
+ const L = React22__namespace.useMemo(
4642
4642
  () => __spreadValues(__spreadValues({}, DEFAULT_LABELS3), labels != null ? labels : {}),
4643
4643
  [labels]
4644
4644
  );
4645
- const sortedFields = React21__namespace.useMemo(
4645
+ const sortedFields = React22__namespace.useMemo(
4646
4646
  () => [...fields].sort((a, b) => {
4647
4647
  var _a2, _b;
4648
4648
  return ((_a2 = a.order) != null ? _a2 : 0) - ((_b = b.order) != null ? _b : 0);
@@ -4650,7 +4650,7 @@ function RegistrationForm({
4650
4650
  [fields]
4651
4651
  );
4652
4652
  const isControlled = values !== void 0;
4653
- const [internal, setInternal] = React21__namespace.useState(
4653
+ const [internal, setInternal] = React22__namespace.useState(
4654
4654
  () => initializeValues(
4655
4655
  sortedFields,
4656
4656
  defaultValues != null ? defaultValues : {},
@@ -4658,9 +4658,9 @@ function RegistrationForm({
4658
4658
  includeTerms
4659
4659
  )
4660
4660
  );
4661
- const [submitAttempted, setSubmitAttempted] = React21__namespace.useState(false);
4662
- const [validationErrors, setValidationErrors] = React21__namespace.useState({});
4663
- React21__namespace.useEffect(() => {
4661
+ const [submitAttempted, setSubmitAttempted] = React22__namespace.useState(false);
4662
+ const [validationErrors, setValidationErrors] = React22__namespace.useState({});
4663
+ React22__namespace.useEffect(() => {
4664
4664
  if (isControlled) return;
4665
4665
  setInternal((prev) => {
4666
4666
  const next = initializeValues(
@@ -4717,7 +4717,7 @@ function RegistrationForm({
4717
4717
  const termsError = submitAttempted && termsEnabled && !termsAccepted;
4718
4718
  const firstErrorFieldId = Object.keys(fieldErrors)[0];
4719
4719
  const scrollTargetId = firstErrorFieldId ? `rf-${firstErrorFieldId}` : termsError ? "rf-terms" : null;
4720
- React21__namespace.useEffect(() => {
4720
+ React22__namespace.useEffect(() => {
4721
4721
  if (!submitAttempted || !scrollTargetId) return;
4722
4722
  const timer = setTimeout(() => {
4723
4723
  const elem = document.getElementById(scrollTargetId);
@@ -5025,6 +5025,132 @@ function RegistrationSuccessCard({
5025
5025
  ] }, f.id)) }) })
5026
5026
  ] });
5027
5027
  }
5028
+ var OTPCodeInput = ({
5029
+ value,
5030
+ onChange,
5031
+ label,
5032
+ error,
5033
+ disabled = false,
5034
+ length = 6,
5035
+ className,
5036
+ id,
5037
+ required
5038
+ }) => {
5039
+ const baseId = id != null ? id : React22__namespace.useId();
5040
+ const inputRefs = React22__namespace.useRef([]);
5041
+ const digits = React22__namespace.useMemo(() => {
5042
+ const arr = value.split("").slice(0, length);
5043
+ while (arr.length < length) arr.push("");
5044
+ return arr;
5045
+ }, [value, length]);
5046
+ const updateValue = (newDigits) => {
5047
+ onChange(newDigits.join(""));
5048
+ };
5049
+ const focusSlot = (index) => {
5050
+ var _a;
5051
+ if (index >= 0 && index < length) {
5052
+ (_a = inputRefs.current[index]) == null ? void 0 : _a.focus();
5053
+ }
5054
+ };
5055
+ const handleChange = (index, raw) => {
5056
+ const numeric = raw.replace(/\D/g, "");
5057
+ if (!numeric) return;
5058
+ const newDigits = [...digits];
5059
+ newDigits[index] = numeric[numeric.length - 1];
5060
+ updateValue(newDigits);
5061
+ if (index < length - 1) {
5062
+ focusSlot(index + 1);
5063
+ }
5064
+ };
5065
+ const handleKeyDown = (index, e) => {
5066
+ if (e.key === "Backspace") {
5067
+ e.preventDefault();
5068
+ const newDigits = [...digits];
5069
+ if (newDigits[index]) {
5070
+ newDigits[index] = "";
5071
+ updateValue(newDigits);
5072
+ } else if (index > 0) {
5073
+ newDigits[index - 1] = "";
5074
+ updateValue(newDigits);
5075
+ focusSlot(index - 1);
5076
+ }
5077
+ } else if (e.key === "ArrowLeft") {
5078
+ e.preventDefault();
5079
+ focusSlot(index - 1);
5080
+ } else if (e.key === "ArrowRight") {
5081
+ e.preventDefault();
5082
+ focusSlot(index + 1);
5083
+ } else if (e.key === "Tab") ; else if (!/^\d$/.test(e.key) && e.key.length === 1) {
5084
+ e.preventDefault();
5085
+ }
5086
+ };
5087
+ const handlePaste = (e) => {
5088
+ e.preventDefault();
5089
+ const pasted = e.clipboardData.getData("text").replace(/\D/g, "").slice(0, length);
5090
+ if (!pasted) return;
5091
+ const newDigits = [...digits];
5092
+ for (let i = 0; i < pasted.length; i++) {
5093
+ newDigits[i] = pasted[i];
5094
+ }
5095
+ updateValue(newDigits);
5096
+ const nextEmpty = newDigits.findIndex((d, i) => i >= pasted.length && !d);
5097
+ focusSlot(nextEmpty !== -1 ? nextEmpty : Math.min(pasted.length, length - 1));
5098
+ };
5099
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col", className), children: [
5100
+ /* @__PURE__ */ jsxRuntime.jsx(
5101
+ "label",
5102
+ {
5103
+ className: cn(
5104
+ "text-sm text-muted-foreground mb-2",
5105
+ required && "after:content-['*'] after:text-primary after:ml-0.5"
5106
+ ),
5107
+ children: label
5108
+ }
5109
+ ),
5110
+ /* @__PURE__ */ jsxRuntime.jsx(
5111
+ "div",
5112
+ {
5113
+ className: cn(
5114
+ "flex gap-2",
5115
+ disabled && "opacity-50 pointer-events-none"
5116
+ ),
5117
+ role: "group",
5118
+ "aria-label": label,
5119
+ children: digits.map((digit, index) => /* @__PURE__ */ jsxRuntime.jsx(
5120
+ "input",
5121
+ {
5122
+ ref: (el) => {
5123
+ inputRefs.current[index] = el;
5124
+ },
5125
+ id: index === 0 ? baseId : `${baseId}-${index}`,
5126
+ type: "text",
5127
+ inputMode: "numeric",
5128
+ pattern: "\\d*",
5129
+ maxLength: 1,
5130
+ value: digit,
5131
+ autoComplete: index === 0 ? "one-time-code" : "off",
5132
+ "aria-label": `${label} d\xEDgito ${index + 1} de ${length}`,
5133
+ disabled,
5134
+ onChange: (e) => handleChange(index, e.target.value),
5135
+ onKeyDown: (e) => handleKeyDown(index, e),
5136
+ onPaste: handlePaste,
5137
+ onFocus: (e) => e.target.select(),
5138
+ className: cn(
5139
+ "w-10 h-12 text-center text-lg rounded-lg border",
5140
+ "bg-background text-foreground border-border",
5141
+ "transition-colors",
5142
+ "focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary",
5143
+ error && "border-destructive focus:border-destructive focus:ring-destructive"
5144
+ )
5145
+ },
5146
+ index
5147
+ ))
5148
+ }
5149
+ ),
5150
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-destructive", children: error })
5151
+ ] });
5152
+ };
5153
+ OTPCodeInput.displayName = "OTPCodeInput";
5028
5154
  function Checkbox(_a) {
5029
5155
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
5030
5156
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -5050,7 +5176,7 @@ function Checkbox(_a) {
5050
5176
  })
5051
5177
  );
5052
5178
  }
5053
- var AccordionVariantContext = React21__namespace.createContext("default");
5179
+ var AccordionVariantContext = React22__namespace.createContext("default");
5054
5180
  function Accordion(_a) {
5055
5181
  var _b = _a, { className, variant = "default" } = _b, props = __objRest(_b, ["className", "variant"]);
5056
5182
  return /* @__PURE__ */ jsxRuntime.jsx(AccordionVariantContext.Provider, { value: variant, children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -5068,7 +5194,7 @@ function Accordion(_a) {
5068
5194
  }
5069
5195
  function AccordionItem(_a) {
5070
5196
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
5071
- const variant = React21__namespace.useContext(AccordionVariantContext);
5197
+ const variant = React22__namespace.useContext(AccordionVariantContext);
5072
5198
  return /* @__PURE__ */ jsxRuntime.jsx(
5073
5199
  accordion.Accordion.Item,
5074
5200
  __spreadValues({
@@ -5089,7 +5215,7 @@ function AccordionTrigger(_a) {
5089
5215
  "className",
5090
5216
  "children"
5091
5217
  ]);
5092
- const variant = React21__namespace.useContext(AccordionVariantContext);
5218
+ const variant = React22__namespace.useContext(AccordionVariantContext);
5093
5219
  return /* @__PURE__ */ jsxRuntime.jsx(accordion.Accordion.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
5094
5220
  accordion.Accordion.Trigger,
5095
5221
  __spreadProps(__spreadValues({
@@ -5143,7 +5269,7 @@ function AccordionContent(_a) {
5143
5269
  "className",
5144
5270
  "children"
5145
5271
  ]);
5146
- const variant = React21__namespace.useContext(AccordionVariantContext);
5272
+ const variant = React22__namespace.useContext(AccordionVariantContext);
5147
5273
  return /* @__PURE__ */ jsxRuntime.jsx(
5148
5274
  accordion.Accordion.Panel,
5149
5275
  __spreadProps(__spreadValues({
@@ -5175,7 +5301,7 @@ function FilterPanel({
5175
5301
  title = "Filters",
5176
5302
  className
5177
5303
  }) {
5178
- const [internalValue, setInternalValue] = React21__namespace.useState(
5304
+ const [internalValue, setInternalValue] = React22__namespace.useState(
5179
5305
  () => Object.fromEntries(groups.map((g) => [g.id, []]))
5180
5306
  );
5181
5307
  const selected = value != null ? value : internalValue;
@@ -5337,11 +5463,11 @@ function ItineraryModal({
5337
5463
  onNext
5338
5464
  }) {
5339
5465
  var _a, _b, _c;
5340
- const [imgIndex, setImgIndex] = React21__namespace.useState(0);
5466
+ const [imgIndex, setImgIndex] = React22__namespace.useState(0);
5341
5467
  const images = stop ? [stop.coverImage, ...(_a = stop.images) != null ? _a : []] : [];
5342
5468
  const isFirst = (stop == null ? void 0 : stop.dayNumber) === ((_b = allStops[0]) == null ? void 0 : _b.dayNumber);
5343
5469
  const isLast = (stop == null ? void 0 : stop.dayNumber) === ((_c = allStops[allStops.length - 1]) == null ? void 0 : _c.dayNumber);
5344
- React21__namespace.useEffect(() => {
5470
+ React22__namespace.useEffect(() => {
5345
5471
  setImgIndex(0);
5346
5472
  }, [stop == null ? void 0 : stop.dayNumber]);
5347
5473
  if (!stop) return null;
@@ -5468,8 +5594,8 @@ function ItineraryModal({
5468
5594
  ) });
5469
5595
  }
5470
5596
  function Itinerary({ title, subtitle, stops, className }) {
5471
- const [activeIndex, setActiveIndex] = React21__namespace.useState(null);
5472
- const scrollRef = React21__namespace.useRef(null);
5597
+ const [activeIndex, setActiveIndex] = React22__namespace.useState(null);
5598
+ const scrollRef = React22__namespace.useRef(null);
5473
5599
  const activeStop = activeIndex !== null ? stops[activeIndex] : null;
5474
5600
  const scrollBy = (dir) => {
5475
5601
  if (!scrollRef.current) return;
@@ -5555,8 +5681,8 @@ function MenuTrip({
5555
5681
  bold = true,
5556
5682
  className
5557
5683
  }) {
5558
- const scrollRef = React21__namespace.useRef(null);
5559
- React21__namespace.useEffect(() => {
5684
+ const scrollRef = React22__namespace.useRef(null);
5685
+ React22__namespace.useEffect(() => {
5560
5686
  if (!scrollRef.current || !activeSection) return;
5561
5687
  const container = scrollRef.current;
5562
5688
  const btn = container.querySelector(
@@ -5702,18 +5828,18 @@ function Lightbox({
5702
5828
  onClose
5703
5829
  }) {
5704
5830
  var _a;
5705
- const [index, setIndex] = React21__namespace.useState(initialIndex);
5831
+ const [index, setIndex] = React22__namespace.useState(initialIndex);
5706
5832
  const total = photos.length;
5707
5833
  const photo = photos[index];
5708
- const prev = React21__namespace.useCallback(
5834
+ const prev = React22__namespace.useCallback(
5709
5835
  () => setIndex((i) => (i - 1 + total) % total),
5710
5836
  [total]
5711
5837
  );
5712
- const next = React21__namespace.useCallback(
5838
+ const next = React22__namespace.useCallback(
5713
5839
  () => setIndex((i) => (i + 1) % total),
5714
5840
  [total]
5715
5841
  );
5716
- React21__namespace.useEffect(() => {
5842
+ React22__namespace.useEffect(() => {
5717
5843
  const onKey = (e) => {
5718
5844
  if (e.key === "Escape") onClose();
5719
5845
  if (e.key === "ArrowLeft") prev();
@@ -5907,7 +6033,7 @@ function GridGallery({
5907
6033
  initialVisible,
5908
6034
  onOpen
5909
6035
  }) {
5910
- const [expanded, setExpanded] = React21__namespace.useState(false);
6036
+ const [expanded, setExpanded] = React22__namespace.useState(false);
5911
6037
  const cols = gridCols(photos.length);
5912
6038
  const hasMore = photos.length > initialVisible;
5913
6039
  const visible = expanded || !hasMore ? photos : photos.slice(0, initialVisible);
@@ -5937,7 +6063,7 @@ function MasonryGallery({
5937
6063
  initialVisible,
5938
6064
  onOpen
5939
6065
  }) {
5940
- const [expanded, setExpanded] = React21__namespace.useState(false);
6066
+ const [expanded, setExpanded] = React22__namespace.useState(false);
5941
6067
  const hasMore = photos.length > initialVisible;
5942
6068
  const visible = expanded || !hasMore ? photos : photos.slice(0, initialVisible);
5943
6069
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -6010,7 +6136,7 @@ function FeaturedGallery({
6010
6136
  photos,
6011
6137
  onOpen
6012
6138
  }) {
6013
- const [expanded, setExpanded] = React21__namespace.useState(false);
6139
+ const [expanded, setExpanded] = React22__namespace.useState(false);
6014
6140
  const featured = photos.slice(0, 3);
6015
6141
  const extra = photos.slice(3);
6016
6142
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -6087,8 +6213,8 @@ function PhotoGallery({
6087
6213
  onPhotoClick,
6088
6214
  className
6089
6215
  }) {
6090
- const [lightboxIndex, setLightboxIndex] = React21__namespace.useState(null);
6091
- const normalised = React21__namespace.useMemo(() => photos.map(normalise), [photos]);
6216
+ const [lightboxIndex, setLightboxIndex] = React22__namespace.useState(null);
6217
+ const normalised = React22__namespace.useMemo(() => photos.map(normalise), [photos]);
6092
6218
  const handleOpen = (index) => {
6093
6219
  setLightboxIndex(index);
6094
6220
  onPhotoClick == null ? void 0 : onPhotoClick(normalised[index].src, index);
@@ -6177,7 +6303,7 @@ function PricingTrip({
6177
6303
  variant = "card",
6178
6304
  className
6179
6305
  }) {
6180
- const [showPricing, setShowPricing] = React21__namespace.useState(false);
6306
+ const [showPricing, setShowPricing] = React22__namespace.useState(false);
6181
6307
  if (variant === "compact") {
6182
6308
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex items-center gap-3", className), children: [
6183
6309
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -6500,14 +6626,14 @@ function SiteHeader({
6500
6626
  className
6501
6627
  }) {
6502
6628
  const t = VARIANT[variant];
6503
- const [openMenu, setOpenMenu] = React21__namespace.useState(null);
6504
- const [langOpen, setLangOpen] = React21__namespace.useState(false);
6505
- const [mobileOpen, setMobileOpen] = React21__namespace.useState(false);
6506
- const [openMobileSection, setOpenMobileSection] = React21__namespace.useState(null);
6507
- const [activeLang, setActiveLang] = React21__namespace.useState(currentLanguage);
6629
+ const [openMenu, setOpenMenu] = React22__namespace.useState(null);
6630
+ const [langOpen, setLangOpen] = React22__namespace.useState(false);
6631
+ const [mobileOpen, setMobileOpen] = React22__namespace.useState(false);
6632
+ const [openMobileSection, setOpenMobileSection] = React22__namespace.useState(null);
6633
+ const [activeLang, setActiveLang] = React22__namespace.useState(currentLanguage);
6508
6634
  const toggleMobileSection = (label) => setOpenMobileSection((prev) => prev === label ? null : label);
6509
- const menuCloseTimer = React21__namespace.useRef(void 0);
6510
- const langCloseTimer = React21__namespace.useRef(void 0);
6635
+ const menuCloseTimer = React22__namespace.useRef(void 0);
6636
+ const langCloseTimer = React22__namespace.useRef(void 0);
6511
6637
  const handleMenuEnter = (label) => {
6512
6638
  clearTimeout(menuCloseTimer.current);
6513
6639
  setOpenMenu(label);
@@ -6528,7 +6654,7 @@ function SiteHeader({
6528
6654
  setOpenMenu(null);
6529
6655
  setLangOpen(false);
6530
6656
  };
6531
- React21__namespace.useEffect(() => () => {
6657
+ React22__namespace.useEffect(() => () => {
6532
6658
  clearTimeout(menuCloseTimer.current);
6533
6659
  clearTimeout(langCloseTimer.current);
6534
6660
  }, []);
@@ -6793,7 +6919,7 @@ function SiteHeader({
6793
6919
  ), children: [
6794
6920
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: languages.map((lang, i) => {
6795
6921
  const isActive = lang.code === activeLang;
6796
- return /* @__PURE__ */ jsxRuntime.jsxs(React21__namespace.Fragment, { children: [
6922
+ return /* @__PURE__ */ jsxRuntime.jsxs(React22__namespace.Fragment, { children: [
6797
6923
  i > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
6798
6924
  "text-xs select-none",
6799
6925
  variant === "white" ? "text-border" : "text-white/15"
@@ -6855,8 +6981,8 @@ function SiteHeader({
6855
6981
  );
6856
6982
  }
6857
6983
  function ThemeToggle({ className }) {
6858
- const [dark, setDark] = React21__namespace.useState(false);
6859
- React21__namespace.useEffect(() => {
6984
+ const [dark, setDark] = React22__namespace.useState(false);
6985
+ React22__namespace.useEffect(() => {
6860
6986
  const saved = localStorage.getItem("theme");
6861
6987
  const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
6862
6988
  const isDark = saved === "dark" || !saved && prefersDark;
@@ -7007,7 +7133,7 @@ function TripCard({
7007
7133
  );
7008
7134
  }
7009
7135
  function useHlsVideo(videoRef, src) {
7010
- React21__namespace.useEffect(() => {
7136
+ React22__namespace.useEffect(() => {
7011
7137
  if (!src || !videoRef.current) return;
7012
7138
  const video = videoRef.current;
7013
7139
  if (!src.includes(".m3u8")) return;
@@ -7049,11 +7175,11 @@ function TripHeader({
7049
7175
  className
7050
7176
  }) {
7051
7177
  var _a;
7052
- const [heroIndex, setHeroIndex] = React21__namespace.useState(0);
7053
- const [videoReady, setVideoReady] = React21__namespace.useState(false);
7054
- const videoRef = React21__namespace.useRef(null);
7178
+ const [heroIndex, setHeroIndex] = React22__namespace.useState(0);
7179
+ const [videoReady, setVideoReady] = React22__namespace.useState(false);
7180
+ const videoRef = React22__namespace.useRef(null);
7055
7181
  const isHls = !!(videoUrl == null ? void 0 : videoUrl.includes(".m3u8"));
7056
- const validImages = React21__namespace.useMemo(
7182
+ const validImages = React22__namespace.useMemo(
7057
7183
  () => images.map((u) => u == null ? void 0 : u.trim()).filter(Boolean),
7058
7184
  [images]
7059
7185
  );
@@ -7068,7 +7194,7 @@ function TripHeader({
7068
7194
  const nights = duration ? (_a = duration.nights) != null ? _a : Math.max(duration.days - 1, 1) : null;
7069
7195
  const hasMeta = !!(destination || duration);
7070
7196
  useHlsVideo(videoRef, isHls ? videoUrl : void 0);
7071
- React21__namespace.useEffect(() => {
7197
+ React22__namespace.useEffect(() => {
7072
7198
  if (!videoUrl) return;
7073
7199
  const el = videoRef.current;
7074
7200
  if (!el) return;
@@ -7210,7 +7336,7 @@ function TripHeader({
7210
7336
  siteHeader ? "-mt-44" : "-mt-36"
7211
7337
  ),
7212
7338
  children: [
7213
- breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3 flex items-center gap-1.5 flex-wrap", children: breadcrumb.map((crumb, i) => /* @__PURE__ */ jsxRuntime.jsxs(React21__namespace.Fragment, { children: [
7339
+ breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3 flex items-center gap-1.5 flex-wrap", children: breadcrumb.map((crumb, i) => /* @__PURE__ */ jsxRuntime.jsxs(React22__namespace.Fragment, { children: [
7214
7340
  i > 0 && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "h-3 w-3 text-white/50 shrink-0" }),
7215
7341
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-white/70 font-ui hover:text-white/90 cursor-default", children: crumb.label })
7216
7342
  ] }, i)) }),
@@ -7310,19 +7436,19 @@ function TripPage({
7310
7436
  features,
7311
7437
  className
7312
7438
  }) {
7313
- const [activeSection, setActiveSection] = React21__namespace.useState("");
7314
- const [navFloating, setNavFloating] = React21__namespace.useState(false);
7315
- const [navHidden, setNavHidden] = React21__namespace.useState(false);
7316
- const [isFloating, setIsFloating] = React21__namespace.useState(false);
7317
- const [sidebarPos, setSidebarPos] = React21__namespace.useState(null);
7318
- const [pricingBarVisible, setPricingBarVisible] = React21__namespace.useState(false);
7319
- const navRef = React21__namespace.useRef(null);
7320
- const navSentinelRef = React21__namespace.useRef(null);
7321
- const sentinelRef = React21__namespace.useRef(null);
7322
- const sidebarPlaceholderRef = React21__namespace.useRef(null);
7323
- const pricingBarRef = React21__namespace.useRef(null);
7324
- const galleryRef = React21__namespace.useRef(null);
7325
- const sections = React21__namespace.useMemo(
7439
+ const [activeSection, setActiveSection] = React22__namespace.useState("");
7440
+ const [navFloating, setNavFloating] = React22__namespace.useState(false);
7441
+ const [navHidden, setNavHidden] = React22__namespace.useState(false);
7442
+ const [isFloating, setIsFloating] = React22__namespace.useState(false);
7443
+ const [sidebarPos, setSidebarPos] = React22__namespace.useState(null);
7444
+ const [pricingBarVisible, setPricingBarVisible] = React22__namespace.useState(false);
7445
+ const navRef = React22__namespace.useRef(null);
7446
+ const navSentinelRef = React22__namespace.useRef(null);
7447
+ const sentinelRef = React22__namespace.useRef(null);
7448
+ const sidebarPlaceholderRef = React22__namespace.useRef(null);
7449
+ const pricingBarRef = React22__namespace.useRef(null);
7450
+ const galleryRef = React22__namespace.useRef(null);
7451
+ const sections = React22__namespace.useMemo(
7326
7452
  () => [
7327
7453
  { id: "key-info", label: "Key info", show: !!(infoGroups == null ? void 0 : infoGroups.length) },
7328
7454
  { id: "overview", label: "Overview", show: !!overview },
@@ -7337,7 +7463,7 @@ function TripPage({
7337
7463
  // eslint-disable-next-line react-hooks/exhaustive-deps
7338
7464
  []
7339
7465
  );
7340
- React21__namespace.useEffect(() => {
7466
+ React22__namespace.useEffect(() => {
7341
7467
  const sentinel = navSentinelRef.current;
7342
7468
  if (!sentinel) return;
7343
7469
  const update = () => setNavFloating(sentinel.getBoundingClientRect().top < 1);
@@ -7345,7 +7471,7 @@ function TripPage({
7345
7471
  update();
7346
7472
  return () => document.removeEventListener("scroll", update, { capture: true });
7347
7473
  }, []);
7348
- React21__namespace.useEffect(() => {
7474
+ React22__namespace.useEffect(() => {
7349
7475
  const sentinel = sentinelRef.current;
7350
7476
  if (!sentinel) return;
7351
7477
  const update = () => setIsFloating(sentinel.getBoundingClientRect().top < 1);
@@ -7353,7 +7479,7 @@ function TripPage({
7353
7479
  update();
7354
7480
  return () => document.removeEventListener("scroll", update, { capture: true });
7355
7481
  }, []);
7356
- React21__namespace.useEffect(() => {
7482
+ React22__namespace.useEffect(() => {
7357
7483
  const measure = () => {
7358
7484
  if (!sidebarPlaceholderRef.current) return;
7359
7485
  const rect = sidebarPlaceholderRef.current.getBoundingClientRect();
@@ -7363,7 +7489,7 @@ function TripPage({
7363
7489
  window.addEventListener("resize", measure);
7364
7490
  return () => window.removeEventListener("resize", measure);
7365
7491
  }, [isFloating]);
7366
- React21__namespace.useEffect(() => {
7492
+ React22__namespace.useEffect(() => {
7367
7493
  const check = () => {
7368
7494
  var _a;
7369
7495
  const target = (_a = galleryRef.current) != null ? _a : pricingBarRef.current;
@@ -7374,7 +7500,7 @@ function TripPage({
7374
7500
  check();
7375
7501
  return () => document.removeEventListener("scroll", check, { capture: true });
7376
7502
  }, []);
7377
- React21__namespace.useEffect(() => {
7503
+ React22__namespace.useEffect(() => {
7378
7504
  const check = () => {
7379
7505
  if (!pricingBarRef.current) return;
7380
7506
  setNavHidden(pricingBarRef.current.getBoundingClientRect().top < window.innerHeight * 0.92);
@@ -7383,7 +7509,7 @@ function TripPage({
7383
7509
  check();
7384
7510
  return () => document.removeEventListener("scroll", check, { capture: true });
7385
7511
  }, []);
7386
- React21__namespace.useEffect(() => {
7512
+ React22__namespace.useEffect(() => {
7387
7513
  if (sections.length === 0) return;
7388
7514
  setActiveSection(sections[0].id);
7389
7515
  const update = () => {
@@ -8100,21 +8226,21 @@ function LeadCapturePopup({
8100
8226
  }) {
8101
8227
  var _a;
8102
8228
  const config = __spreadValues(__spreadValues({}, DEFAULTS), _config);
8103
- const [open, setOpen] = React21.useState(false);
8104
- const [closing, setClosing] = React21.useState(false);
8105
- const [submitted, setSubmitted] = React21.useState(false);
8106
- const [submitting, setSubmitting] = React21.useState(false);
8107
- const [error, setError] = React21.useState(null);
8108
- const [name, setName] = React21.useState("");
8109
- const [email, setEmail] = React21.useState("");
8110
- const [travelDate, setTravelDate] = React21.useState("");
8111
- const panelRef = React21.useRef(null);
8112
- const nameRef = React21.useRef(null);
8113
- const show = React21.useCallback(() => {
8229
+ const [open, setOpen] = React22.useState(false);
8230
+ const [closing, setClosing] = React22.useState(false);
8231
+ const [submitted, setSubmitted] = React22.useState(false);
8232
+ const [submitting, setSubmitting] = React22.useState(false);
8233
+ const [error, setError] = React22.useState(null);
8234
+ const [name, setName] = React22.useState("");
8235
+ const [email, setEmail] = React22.useState("");
8236
+ const [travelDate, setTravelDate] = React22.useState("");
8237
+ const panelRef = React22.useRef(null);
8238
+ const nameRef = React22.useRef(null);
8239
+ const show = React22.useCallback(() => {
8114
8240
  if (isDismissed()) return;
8115
8241
  setOpen(true);
8116
8242
  }, []);
8117
- React21.useEffect(() => {
8243
+ React22.useEffect(() => {
8118
8244
  var _a2;
8119
8245
  if (isDismissed()) return;
8120
8246
  if (config.trigger === "delay") {
@@ -8141,7 +8267,7 @@ function LeadCapturePopup({
8141
8267
  return () => window.removeEventListener("scroll", handler);
8142
8268
  }
8143
8269
  }, [config.trigger, config.delaySeconds, config.scrollPercent, show]);
8144
- React21.useEffect(() => {
8270
+ React22.useEffect(() => {
8145
8271
  if (open && !submitted) {
8146
8272
  requestAnimationFrame(() => {
8147
8273
  var _a2;
@@ -8149,7 +8275,7 @@ function LeadCapturePopup({
8149
8275
  });
8150
8276
  }
8151
8277
  }, [open, submitted]);
8152
- const close = React21.useCallback(() => {
8278
+ const close = React22.useCallback(() => {
8153
8279
  setClosing(true);
8154
8280
  setDismissed(config.dismissDays);
8155
8281
  setTimeout(() => {
@@ -8157,7 +8283,7 @@ function LeadCapturePopup({
8157
8283
  setClosing(false);
8158
8284
  }, 250);
8159
8285
  }, [config.dismissDays]);
8160
- React21.useEffect(() => {
8286
+ React22.useEffect(() => {
8161
8287
  if (!open) return;
8162
8288
  const handler = (e) => {
8163
8289
  if (e.key === "Escape") close();
@@ -8165,7 +8291,7 @@ function LeadCapturePopup({
8165
8291
  document.addEventListener("keydown", handler);
8166
8292
  return () => document.removeEventListener("keydown", handler);
8167
8293
  }, [open, close]);
8168
- const onOverlayClick = React21.useCallback(
8294
+ const onOverlayClick = React22.useCallback(
8169
8295
  (e) => {
8170
8296
  if (panelRef.current && !panelRef.current.contains(e.target)) {
8171
8297
  close();
@@ -8421,6 +8547,7 @@ exports.Itinerary = Itinerary;
8421
8547
  exports.LOGO_PLANETAEXO_DATA_URI = LOGO_PLANETAEXO_DATA_URI;
8422
8548
  exports.LeadCapturePopup = LeadCapturePopup;
8423
8549
  exports.MenuTrip = MenuTrip;
8550
+ exports.OTPCodeInput = OTPCodeInput;
8424
8551
  exports.Offer = Offer;
8425
8552
  exports.OfferAdventureCard = OfferAdventureCard;
8426
8553
  exports.PaymentAmountSelector = PaymentAmountSelector;