@planetaexo/design-system 0.3.3 → 0.3.5

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: [
@@ -6363,6 +6423,81 @@ function ActivityCard({
6363
6423
  }
6364
6424
  );
6365
6425
  }
6426
+ var VARIANT_STYLES = {
6427
+ error: "text-destructive border-destructive/30 bg-destructive/5",
6428
+ warning: "text-amber-400 border-amber-500/30 bg-amber-500/10",
6429
+ success: "text-primary border-primary/30 bg-primary/10",
6430
+ info: "text-muted-foreground border-primary/25 bg-primary/5"
6431
+ };
6432
+ function Alert({ variant = "info", children, className }) {
6433
+ return /* @__PURE__ */ jsxRuntime.jsx(
6434
+ "div",
6435
+ {
6436
+ className: cn(
6437
+ "rounded-lg border px-3 py-2 text-sm font-sans leading-snug",
6438
+ VARIANT_STYLES[variant],
6439
+ className
6440
+ ),
6441
+ children
6442
+ }
6443
+ );
6444
+ }
6445
+ function PaymentModalShell({
6446
+ open,
6447
+ title,
6448
+ subtitle,
6449
+ bookingRef,
6450
+ busy,
6451
+ busyMessage,
6452
+ onClose,
6453
+ closeLabel = "Cancel",
6454
+ closeDisabled,
6455
+ children,
6456
+ className
6457
+ }) {
6458
+ if (!open) return null;
6459
+ return /* @__PURE__ */ jsxRuntime.jsx(
6460
+ "div",
6461
+ {
6462
+ className: "fixed inset-0 z-[100] flex items-center justify-center bg-black/70 p-4",
6463
+ role: "dialog",
6464
+ "aria-modal": "true",
6465
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
6466
+ "div",
6467
+ {
6468
+ className: cn(
6469
+ "relative w-full max-w-md rounded-2xl border border-border bg-card p-6 shadow-xl",
6470
+ "max-h-[90vh] overflow-y-auto",
6471
+ className
6472
+ ),
6473
+ children: [
6474
+ onClose && /* @__PURE__ */ jsxRuntime.jsx(
6475
+ "button",
6476
+ {
6477
+ type: "button",
6478
+ onClick: () => !closeDisabled && onClose(),
6479
+ disabled: closeDisabled,
6480
+ "aria-label": closeLabel,
6481
+ className: "absolute right-4 top-4 text-xl leading-none text-muted-foreground hover:text-foreground disabled:opacity-40 transition-colors",
6482
+ children: "\xD7"
6483
+ }
6484
+ ),
6485
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "pr-8 text-lg font-bold text-foreground font-heading", children: title }),
6486
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm text-muted-foreground font-sans", children: subtitle }),
6487
+ bookingRef != null && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "mt-1 text-xs text-muted-foreground font-sans", children: [
6488
+ "#",
6489
+ bookingRef
6490
+ ] }),
6491
+ busy ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-8 flex flex-col items-center gap-4 py-6", children: [
6492
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-10 w-10 animate-spin rounded-full border-2 border-primary/30 border-t-primary" }),
6493
+ busyMessage && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-center text-sm text-muted-foreground font-sans", children: busyMessage })
6494
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-6", children })
6495
+ ]
6496
+ }
6497
+ )
6498
+ }
6499
+ );
6500
+ }
6366
6501
  function Input(_a) {
6367
6502
  var _b = _a, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
6368
6503
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -6727,6 +6862,7 @@ function LeadCapturePopup({
6727
6862
  }
6728
6863
 
6729
6864
  exports.ActivityCard = ActivityCard;
6865
+ exports.Alert = Alert;
6730
6866
  exports.BookingConfirmation = BookingConfirmation;
6731
6867
  exports.BookingConfirmationEmail = BookingConfirmationEmail;
6732
6868
  exports.BookingDetails = BookingDetails;
@@ -6746,10 +6882,14 @@ exports.LeadCapturePopup = LeadCapturePopup;
6746
6882
  exports.MenuTrip = MenuTrip;
6747
6883
  exports.Offer = Offer;
6748
6884
  exports.OfferAdventureCard = OfferAdventureCard;
6885
+ exports.PaymentAmountSelector = PaymentAmountSelector;
6886
+ exports.PaymentMethodSelector = PaymentMethodSelector;
6887
+ exports.PaymentModalShell = PaymentModalShell;
6749
6888
  exports.PhoneCountrySelect = PhoneCountrySelect;
6750
6889
  exports.PhotoGallery = PhotoGallery;
6751
6890
  exports.PricingTrip = PricingTrip;
6752
6891
  exports.SiteHeader = SiteHeader;
6892
+ exports.TermsSection = TermsSection;
6753
6893
  exports.ThemeToggle = ThemeToggle;
6754
6894
  exports.TripCard = TripCard;
6755
6895
  exports.TripHeader = TripHeader;