@planetaexo/design-system 0.3.3 → 0.3.4

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
@@ -1556,6 +1556,103 @@ function BookingShell({
1556
1556
  ] })
1557
1557
  ] });
1558
1558
  }
1559
+ function PaymentAmountSelector({
1560
+ title = "What do you want to pay now?",
1561
+ depositLabel,
1562
+ fullLabel,
1563
+ value,
1564
+ onChange
1565
+ }) {
1566
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
1567
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-bold text-foreground font-heading", children: title }),
1568
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-2", children: ["deposit", "full"].map((opt) => /* @__PURE__ */ jsxRuntime.jsx(
1569
+ "button",
1570
+ {
1571
+ type: "button",
1572
+ onClick: () => onChange(opt),
1573
+ className: cn(
1574
+ "rounded-lg border-2 px-4 py-3 text-sm text-left font-sans transition-colors",
1575
+ value === opt ? "border-primary bg-primary/5 text-foreground font-semibold" : "border-border bg-background text-muted-foreground hover:border-primary/40"
1576
+ ),
1577
+ children: opt === "deposit" ? depositLabel : fullLabel
1578
+ },
1579
+ opt
1580
+ )) })
1581
+ ] });
1582
+ }
1583
+ function PaymentMethodSelector({
1584
+ title = "Payment method",
1585
+ methods,
1586
+ value,
1587
+ onChange
1588
+ }) {
1589
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-border p-4 flex flex-col gap-3", children: [
1590
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: title }),
1591
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", children: methods.map((m) => /* @__PURE__ */ jsxRuntime.jsxs(
1592
+ "button",
1593
+ {
1594
+ type: "button",
1595
+ disabled: m.disabled,
1596
+ onClick: () => !m.disabled && onChange(m.id),
1597
+ className: cn(
1598
+ "flex items-start gap-3 rounded-lg border-2 px-4 py-3 text-left transition-colors",
1599
+ "disabled:opacity-50 disabled:cursor-not-allowed",
1600
+ value === m.id ? "border-primary bg-primary/5" : "border-border bg-background hover:border-primary/40"
1601
+ ),
1602
+ children: [
1603
+ /* @__PURE__ */ jsxRuntime.jsx(
1604
+ "span",
1605
+ {
1606
+ className: cn(
1607
+ "mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors",
1608
+ value === m.id ? "border-primary" : "border-border"
1609
+ ),
1610
+ children: value === m.id && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-2 w-2 rounded-full bg-primary" })
1611
+ }
1612
+ ),
1613
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex flex-col gap-0.5", children: [
1614
+ /* @__PURE__ */ jsxRuntime.jsx(
1615
+ "span",
1616
+ {
1617
+ className: cn(
1618
+ "text-sm font-semibold font-sans",
1619
+ value === m.id ? "text-primary" : "text-foreground"
1620
+ ),
1621
+ children: m.label
1622
+ }
1623
+ ),
1624
+ m.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground font-sans", children: m.description })
1625
+ ] })
1626
+ ]
1627
+ },
1628
+ m.id
1629
+ )) })
1630
+ ] });
1631
+ }
1632
+ function TermsSection({
1633
+ title = "Terms and conditions",
1634
+ checked,
1635
+ onChange,
1636
+ label,
1637
+ warningMessage
1638
+ }) {
1639
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-border p-4 flex flex-col gap-3", children: [
1640
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: title }),
1641
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-start gap-2.5 cursor-pointer", children: [
1642
+ /* @__PURE__ */ jsxRuntime.jsx(
1643
+ "input",
1644
+ {
1645
+ type: "checkbox",
1646
+ checked,
1647
+ onChange: (e) => onChange(e.target.checked),
1648
+ className: "h-4 w-4 shrink-0 mt-0.5 rounded border-border accent-primary cursor-pointer"
1649
+ }
1650
+ ),
1651
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-sans text-foreground/80 leading-snug", children: label })
1652
+ ] }),
1653
+ !checked && warningMessage && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-amber-400 flex items-center gap-1", children: warningMessage })
1654
+ ] });
1655
+ }
1559
1656
  var WIZARD_STEPS = [
1560
1657
  { id: "responsible", label: "Responsible party details" },
1561
1658
  { id: "travellers", label: "Travellers" },
@@ -1772,70 +1869,33 @@ function BookingWizard({
1772
1869
  ] }),
1773
1870
  step === "payment" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-5", children: [
1774
1871
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground font-sans", children: "When you confirm, we will open secure online payment (Stripe). Choose deposit vs full amount below when applicable." }),
1775
- depositInfo && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
1776
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-bold text-foreground font-heading", children: "What do you want to pay now?" }),
1777
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-2", children: ["deposit", "full"].map((opt) => /* @__PURE__ */ jsxRuntime.jsx(
1778
- "button",
1779
- {
1780
- type: "button",
1781
- onClick: () => setPayAmount(opt),
1782
- className: cn(
1783
- "rounded-lg border-2 px-4 py-3 text-sm text-left font-sans transition-colors",
1784
- payAmount === opt ? "border-primary bg-primary/5 text-foreground font-semibold" : "border-border bg-background text-muted-foreground hover:border-primary/40"
1785
- ),
1786
- children: opt === "deposit" ? depositLabel : fullLabel
1787
- },
1788
- opt
1789
- )) })
1790
- ] }),
1791
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-border p-4 flex flex-col gap-3", children: [
1792
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest flex items-center gap-1.5", children: [
1793
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "$" }),
1794
- " Payment method"
1795
- ] }),
1796
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", children: [
1797
- { id: "stripe", label: "Credit / Debit card", sub: "Secure payment via Stripe" },
1798
- { id: "pix", label: "PIX", sub: "Instant transfer \u2014 Brazil only" },
1799
- { id: "bank", label: "Bank transfer", sub: "Wire / TED / DOC" }
1800
- ].map((m) => /* @__PURE__ */ jsxRuntime.jsxs(
1801
- "button",
1802
- {
1803
- type: "button",
1804
- onClick: () => setPayMethod(m.id),
1805
- className: cn(
1806
- "flex items-start gap-3 rounded-lg border-2 px-4 py-3 text-left transition-colors",
1807
- payMethod === m.id ? "border-primary bg-primary/5" : "border-border bg-background hover:border-primary/40"
1808
- ),
1809
- children: [
1810
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
1811
- "mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors",
1812
- payMethod === m.id ? "border-primary" : "border-border"
1813
- ), children: payMethod === m.id && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-2 w-2 rounded-full bg-primary" }) }),
1814
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex flex-col gap-0.5", children: [
1815
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
1816
- "text-sm font-semibold font-sans",
1817
- payMethod === m.id ? "text-primary" : "text-foreground"
1818
- ), children: m.label }),
1819
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground font-sans", children: m.sub })
1820
- ] })
1821
- ]
1822
- },
1823
- m.id
1824
- )) })
1825
- ] }),
1826
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-border p-4 flex flex-col gap-3", children: [
1827
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: "Terms and conditions" }),
1828
- /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-start gap-2.5 cursor-pointer", children: [
1829
- /* @__PURE__ */ jsxRuntime.jsx(
1830
- "input",
1831
- {
1832
- type: "checkbox",
1833
- checked: termsAccepted,
1834
- onChange: (e) => setTermsAccepted(e.target.checked),
1835
- className: "h-4 w-4 shrink-0 mt-0.5 rounded border-border accent-primary cursor-pointer"
1836
- }
1837
- ),
1838
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-sans text-foreground/80 leading-snug", children: [
1872
+ depositInfo && /* @__PURE__ */ jsxRuntime.jsx(
1873
+ PaymentAmountSelector,
1874
+ {
1875
+ depositLabel,
1876
+ fullLabel,
1877
+ value: payAmount,
1878
+ onChange: setPayAmount
1879
+ }
1880
+ ),
1881
+ /* @__PURE__ */ jsxRuntime.jsx(
1882
+ PaymentMethodSelector,
1883
+ {
1884
+ methods: [
1885
+ { id: "stripe", label: "Credit / Debit card", description: "Secure payment via Stripe" },
1886
+ { id: "pix", label: "PIX", description: "Instant transfer \u2014 Brazil only" },
1887
+ { id: "bank", label: "Bank transfer", description: "Wire / TED / DOC" }
1888
+ ],
1889
+ value: payMethod,
1890
+ onChange: (v) => setPayMethod(v)
1891
+ }
1892
+ ),
1893
+ /* @__PURE__ */ jsxRuntime.jsx(
1894
+ TermsSection,
1895
+ {
1896
+ checked: termsAccepted,
1897
+ onChange: setTermsAccepted,
1898
+ label: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1839
1899
  "I have read and accept the",
1840
1900
  " ",
1841
1901
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -1850,8 +1910,8 @@ function BookingWizard({
1850
1910
  " ",
1851
1911
  "of the reservation."
1852
1912
  ] })
1853
- ] })
1854
- ] }),
1913
+ }
1914
+ ),
1855
1915
  /* @__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: [
1856
1916
  /* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: "font-heading text-xl", children: "Terms and Conditions" }) }),
1857
1917
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4 text-sm font-sans text-foreground/80 leading-relaxed", children: [
@@ -6746,10 +6806,13 @@ exports.LeadCapturePopup = LeadCapturePopup;
6746
6806
  exports.MenuTrip = MenuTrip;
6747
6807
  exports.Offer = Offer;
6748
6808
  exports.OfferAdventureCard = OfferAdventureCard;
6809
+ exports.PaymentAmountSelector = PaymentAmountSelector;
6810
+ exports.PaymentMethodSelector = PaymentMethodSelector;
6749
6811
  exports.PhoneCountrySelect = PhoneCountrySelect;
6750
6812
  exports.PhotoGallery = PhotoGallery;
6751
6813
  exports.PricingTrip = PricingTrip;
6752
6814
  exports.SiteHeader = SiteHeader;
6815
+ exports.TermsSection = TermsSection;
6753
6816
  exports.ThemeToggle = ThemeToggle;
6754
6817
  exports.TripCard = TripCard;
6755
6818
  exports.TripHeader = TripHeader;