@planetaexo/design-system 0.3.13 → 0.3.15

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
@@ -1707,13 +1707,71 @@ function PaymentMethodSelector({
1707
1707
  )) })
1708
1708
  ] });
1709
1709
  }
1710
+ var TERMS_I18N = {
1711
+ en: {
1712
+ before: "I have read and accept the ",
1713
+ link: "terms and conditions",
1714
+ after: " of the reservation.",
1715
+ modalTitle: "Terms and Conditions",
1716
+ closeLabel: "Close"
1717
+ },
1718
+ pt: {
1719
+ before: "Li e aceito os ",
1720
+ link: "termos e condi\xE7\xF5es",
1721
+ after: " da reserva.",
1722
+ modalTitle: "Termos e Condi\xE7\xF5es",
1723
+ closeLabel: "Fechar"
1724
+ },
1725
+ fr: {
1726
+ before: "J'ai lu et j'accepte les ",
1727
+ link: "conditions g\xE9n\xE9rales",
1728
+ after: " de la r\xE9servation.",
1729
+ modalTitle: "Conditions G\xE9n\xE9rales",
1730
+ closeLabel: "Fermer"
1731
+ },
1732
+ de: {
1733
+ before: "Ich habe die ",
1734
+ link: "Allgemeinen Gesch\xE4ftsbedingungen",
1735
+ after: " gelesen und akzeptiere sie.",
1736
+ modalTitle: "Allgemeine Gesch\xE4ftsbedingungen",
1737
+ closeLabel: "Schlie\xDFen"
1738
+ }
1739
+ };
1740
+ var TERMS_CONTENT = [
1741
+ {
1742
+ body: "These Terms and Conditions govern your booking with PlanetaEXO. By making a reservation, you agree to the following terms. Please read them carefully before confirming your booking."
1743
+ },
1744
+ {
1745
+ heading: "1. Bookings and payments",
1746
+ body: "A booking is confirmed only upon receipt of the required deposit or full payment as specified in your proposal. Prices are quoted in the currency indicated in your proposal. Full payment is due prior to departure on the date stipulated in your booking confirmation. PlanetaEXO reserves the right to cancel unconfirmed reservations and is not responsible for exchange rate fluctuations after payment is received."
1747
+ },
1748
+ {
1749
+ heading: "2. Cancellation policy",
1750
+ body: "All cancellations must be submitted in writing. The following fees apply: more than 30 days before departure \u2014 loss of deposit; 15\u201330 days before departure \u2014 50% of the total cost; fewer than 15 days before departure \u2014 100% of the total cost. Cases involving force majeure or documented medical emergencies will be evaluated individually."
1751
+ },
1752
+ {
1753
+ heading: "3. Changes and modifications",
1754
+ body: "PlanetaEXO reserves the right to modify itineraries, accommodations, or activities for reasons of safety, weather conditions, force majeure, or other circumstances beyond our control. You will be notified of any significant changes as promptly as possible. Minor adjustments do not entitle the traveller to a refund or compensation."
1755
+ },
1756
+ {
1757
+ heading: "4. Travel insurance",
1758
+ body: "We strongly recommend that all travellers obtain comprehensive travel insurance covering trip cancellation, medical emergencies, evacuation, and baggage loss prior to departure. PlanetaEXO is not liable for costs or losses that would have been covered by adequate travel insurance."
1759
+ },
1760
+ {
1761
+ heading: "5. Liability",
1762
+ body: "PlanetaEXO's liability is limited to the total amount paid by the client for the services in question. We are not responsible for indirect losses, consequential damages, or service failures caused by third-party providers (airlines, hotels, local operators) or force majeure events. Participation in adventure activities carries inherent risks; travellers acknowledge and accept these risks by confirming their booking."
1763
+ }
1764
+ ];
1710
1765
  function TermsSection({
1711
1766
  title = "Terms and conditions",
1712
1767
  checked,
1713
1768
  onChange,
1714
- label,
1715
- warningMessage
1769
+ warningMessage,
1770
+ locale = "en"
1716
1771
  }) {
1772
+ var _a;
1773
+ const [modalOpen, setModalOpen] = React19__namespace.useState(false);
1774
+ const i18n = (_a = TERMS_I18N[locale]) != null ? _a : TERMS_I18N.en;
1717
1775
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-border p-4 flex flex-col gap-3", children: [
1718
1776
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: title }),
1719
1777
  /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-start gap-2.5 cursor-pointer", children: [
@@ -1726,9 +1784,67 @@ function TermsSection({
1726
1784
  className: "h-4 w-4 shrink-0 mt-0.5 rounded border-border accent-primary cursor-pointer"
1727
1785
  }
1728
1786
  ),
1729
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-sans text-foreground/80 leading-snug", children: label })
1787
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-sans text-foreground/80 leading-snug", children: [
1788
+ i18n.before,
1789
+ /* @__PURE__ */ jsxRuntime.jsx(
1790
+ "button",
1791
+ {
1792
+ type: "button",
1793
+ onClick: () => setModalOpen(true),
1794
+ className: "text-primary underline underline-offset-2 hover:text-primary/80 transition-colors",
1795
+ children: i18n.link
1796
+ }
1797
+ ),
1798
+ i18n.after
1799
+ ] })
1730
1800
  ] }),
1731
- !checked && warningMessage && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-amber-400 flex items-center gap-1", children: warningMessage })
1801
+ !checked && warningMessage && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-amber-400 flex items-center gap-1", children: warningMessage }),
1802
+ /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: modalOpen, onOpenChange: setModalOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "max-w-2xl w-full max-h-[80vh] overflow-y-auto", children: [
1803
+ /* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs(DialogTitle, { className: "font-heading text-xl", children: [
1804
+ i18n.modalTitle,
1805
+ " \u2014 PlanetaEXO"
1806
+ ] }) }),
1807
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4 space-y-5 text-sm font-sans text-foreground/80 leading-relaxed", children: TERMS_CONTENT.map((section, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1808
+ section.heading && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-bold text-foreground font-heading mb-1", children: section.heading }),
1809
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: section.body })
1810
+ ] }, i)) }),
1811
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-6 flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(
1812
+ DialogClose,
1813
+ {
1814
+ className: "px-4 py-2 rounded-lg bg-primary text-white text-sm font-heading font-semibold hover:bg-primary/90 transition-colors",
1815
+ children: i18n.closeLabel
1816
+ }
1817
+ ) })
1818
+ ] }) })
1819
+ ] });
1820
+ }
1821
+ function BookingConfirmedCard({
1822
+ title = "Booking confirmed!",
1823
+ email,
1824
+ message,
1825
+ onBack,
1826
+ backLabel = "Back to offer"
1827
+ }) {
1828
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-2xl border border-border bg-card p-8 flex flex-col items-center gap-6 text-center", children: [
1829
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-20 w-20 items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2Icon, { className: "w-10 h-10 text-primary" }) }),
1830
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1831
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-2xl font-black text-foreground font-heading", children: title }),
1832
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-sm text-muted-foreground font-sans max-w-sm mx-auto leading-relaxed", children: message != null ? message : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1833
+ "A confirmation email has been sent to",
1834
+ " ",
1835
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-foreground", children: email || "your email" }),
1836
+ ". Our team will be in touch shortly."
1837
+ ] }) })
1838
+ ] }),
1839
+ onBack && /* @__PURE__ */ jsxRuntime.jsx(
1840
+ "button",
1841
+ {
1842
+ type: "button",
1843
+ onClick: onBack,
1844
+ className: "rounded-full border border-primary px-6 py-2.5 text-sm font-bold text-primary font-heading hover:bg-primary/10 transition-colors",
1845
+ children: backLabel
1846
+ }
1847
+ )
1732
1848
  ] });
1733
1849
  }
1734
1850
  var WIZARD_STEPS = [
@@ -1774,7 +1890,6 @@ function BookingWizard({
1774
1890
  const [payAmount, setPayAmount] = React19__namespace.useState("full");
1775
1891
  const [payMethod, setPayMethod] = React19__namespace.useState("stripe");
1776
1892
  const [termsAccepted, setTermsAccepted] = React19__namespace.useState(false);
1777
- const [termsModalOpen, setTermsModalOpen] = React19__namespace.useState(false);
1778
1893
  const setR = (k, v) => setResponsible((p) => __spreadProps(__spreadValues({}, p), { [k]: v }));
1779
1894
  const setT = (i, k, v) => setTravellers((prev) => prev.map((t, idx) => idx === i ? __spreadProps(__spreadValues({}, t), { [k]: v }) : t));
1780
1895
  const setTDob = (i, v) => setTravellers((prev) => prev.map((t, idx) => idx === i ? __spreadProps(__spreadValues({}, t), { dateOfBirth: v }) : t));
@@ -1814,34 +1929,7 @@ function BookingWizard({
1814
1929
  const depositLabel = depositInfo ? `Pay deposit (${depositInfo.depositPercent}%) \u2014 ${depositInfo.depositAmount}` : "Pay deposit";
1815
1930
  const fullLabel = `Pay full amount \u2014 ${total}`;
1816
1931
  if (step === "confirmed") {
1817
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-2xl border border-border bg-card p-8 flex flex-col items-center gap-6 text-center", children: [
1818
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-20 w-20 items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2Icon, { className: "w-10 h-10 text-primary" }) }),
1819
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1820
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-2xl font-black text-foreground font-heading", children: "Booking confirmed!" }),
1821
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "mt-2 text-sm text-muted-foreground font-sans max-w-sm mx-auto leading-relaxed", children: [
1822
- "A confirmation email has been sent to",
1823
- " ",
1824
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-foreground", children: responsible.email || "your email" }),
1825
- ". Our team will be in touch shortly."
1826
- ] })
1827
- ] }),
1828
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-border bg-muted/30 px-6 py-4 w-full max-w-xs", children: [
1829
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground font-sans uppercase tracking-wider", children: "Booking reference" }),
1830
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-lg font-black text-primary font-heading mt-1", children: [
1831
- "PEX-",
1832
- Math.random().toString(36).slice(2, 8).toUpperCase()
1833
- ] })
1834
- ] }),
1835
- /* @__PURE__ */ jsxRuntime.jsx(
1836
- "button",
1837
- {
1838
- type: "button",
1839
- onClick: onCancel,
1840
- className: "rounded-full border border-primary px-6 py-2.5 text-sm font-bold text-primary font-heading hover:bg-primary/10 transition-colors",
1841
- children: "Back to offer"
1842
- }
1843
- )
1844
- ] });
1932
+ return /* @__PURE__ */ jsxRuntime.jsx(BookingConfirmedCard, { email: responsible.email, onBack: onCancel });
1845
1933
  }
1846
1934
  return /* @__PURE__ */ jsxRuntime.jsx(
1847
1935
  BookingShell,
@@ -1972,53 +2060,9 @@ function BookingWizard({
1972
2060
  TermsSection,
1973
2061
  {
1974
2062
  checked: termsAccepted,
1975
- onChange: setTermsAccepted,
1976
- label: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1977
- "I have read and accept the",
1978
- " ",
1979
- /* @__PURE__ */ jsxRuntime.jsx(
1980
- "button",
1981
- {
1982
- type: "button",
1983
- onClick: () => setTermsModalOpen(true),
1984
- className: "underline underline-offset-2 text-primary hover:text-primary/80 transition-colors font-semibold",
1985
- children: "terms and conditions"
1986
- }
1987
- ),
1988
- " ",
1989
- "of the reservation."
1990
- ] })
2063
+ onChange: setTermsAccepted
1991
2064
  }
1992
- ),
1993
- /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: termsModalOpen, onOpenChange: setTermsModalOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "!max-w-[80vw] w-[80vw] max-h-[85vh] overflow-y-auto", children: [
1994
- /* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: "font-heading text-xl", children: "Terms and Conditions" }) }),
1995
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4 text-sm font-sans text-foreground/80 leading-relaxed", children: [
1996
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: 'These terms and conditions ("Terms") govern the booking of travel experiences offered through Planeta EXO ("Company"). By confirming a booking, you agree to these Terms in full.' }),
1997
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-bold text-foreground font-heading text-base", children: "1. Bookings and payments" }),
1998
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "A booking is confirmed upon receipt of the required deposit or full payment. The deposit amount is specified in your offer. The remaining balance must be paid by the balance due date stated in your offer." }),
1999
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-bold text-foreground font-heading text-base", children: "2. Cancellation policy" }),
2000
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Cancellations made more than 60 days before departure are eligible for a full refund of the deposit. Cancellations between 30 and 60 days forfeit 50% of the deposit. Cancellations within 30 days of departure are non-refundable." }),
2001
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-bold text-foreground font-heading text-base", children: "3. Changes and modifications" }),
2002
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "The Company reserves the right to modify itineraries due to weather, safety, or operational reasons. Equivalent alternatives will be offered wherever possible." }),
2003
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-bold text-foreground font-heading text-base", children: "4. Travel insurance" }),
2004
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Comprehensive travel insurance is strongly recommended. The Company is not liable for costs arising from trip interruption, medical emergencies, or personal loss." }),
2005
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-bold text-foreground font-heading text-base", children: "5. Liability" }),
2006
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Participation in adventure activities carries inherent risk. By booking, you acknowledge and accept these risks. The Company's liability is limited to the total booking amount." }),
2007
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pt-2", children: /* @__PURE__ */ jsxRuntime.jsx(
2008
- DialogClose,
2009
- {
2010
- render: /* @__PURE__ */ jsxRuntime.jsx(
2011
- "button",
2012
- {
2013
- type: "button",
2014
- className: "rounded-full bg-primary px-6 py-2.5 text-sm font-bold text-primary-foreground font-heading hover:bg-primary/90 transition-colors"
2015
- }
2016
- ),
2017
- children: "Close"
2018
- }
2019
- ) })
2020
- ] })
2021
- ] }) })
2065
+ )
2022
2066
  ] })
2023
2067
  ] })
2024
2068
  }
@@ -7167,6 +7211,7 @@ exports.ActivityCard = ActivityCard;
7167
7211
  exports.Alert = Alert;
7168
7212
  exports.BookingConfirmation = BookingConfirmation;
7169
7213
  exports.BookingConfirmationEmail = BookingConfirmationEmail;
7214
+ exports.BookingConfirmedCard = BookingConfirmedCard;
7170
7215
  exports.BookingDetails = BookingDetails;
7171
7216
  exports.BookingForm = BookingForm;
7172
7217
  exports.BookingShell = BookingShell;