@planetaexo/design-system 0.9.1 → 0.9.3

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
@@ -5559,11 +5559,12 @@ function isoOrDateToString(v) {
5559
5559
  return d.toISOString().slice(0, 10);
5560
5560
  }
5561
5561
  function RegistrationSuccessCard({
5562
+ variant = "full",
5562
5563
  title = "Thanks \u2014 your answers have been received.",
5563
5564
  message = "We'll get in touch if anything else is needed.",
5564
5565
  answersTitle = "Your submitted answers",
5565
- fields,
5566
- answers,
5566
+ fields = [],
5567
+ answers = {},
5567
5568
  dateFormatter = isoOrDateToString,
5568
5569
  formatAnswer,
5569
5570
  className,
@@ -5571,17 +5572,20 @@ function RegistrationSuccessCard({
5571
5572
  logo,
5572
5573
  logoAlt = "PlanetaEXO",
5573
5574
  terms,
5575
+ termsLayout = "summary",
5576
+ termsLabels,
5574
5577
  adventure,
5575
5578
  booking,
5576
5579
  traveller,
5577
5580
  tripInfoLabels
5578
5581
  }) {
5579
- var _a, _b, _c, _d, _e;
5580
- const sorted = [...fields].sort((a, b) => {
5582
+ var _a, _b, _c, _d, _e, _f, _g, _h;
5583
+ const isMinimal = variant === "minimal";
5584
+ const sorted = isMinimal ? [] : [...fields].sort((a, b) => {
5581
5585
  var _a2, _b2;
5582
5586
  return ((_a2 = a.order) != null ? _a2 : 0) - ((_b2 = b.order) != null ? _b2 : 0);
5583
5587
  }).filter((f) => Object.prototype.hasOwnProperty.call(answers, f.id));
5584
- const hasTripInfo = !!(adventure || booking || traveller);
5588
+ const hasTripInfo = !isMinimal && !!(adventure || booking || traveller);
5585
5589
  const dateRange = adventure ? formatDateRange(adventure, dateFormatter) : null;
5586
5590
  const TL = {
5587
5591
  sectionTitle: (_a = tripInfoLabels == null ? void 0 : tripInfoLabels.sectionTitle) != null ? _a : "Trip info",
@@ -5607,40 +5611,43 @@ function RegistrationSuccessCard({
5607
5611
  message && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground font-ui", children: message })
5608
5612
  ] }),
5609
5613
  hasTripInfo && /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: TL.sectionTitle, children: /* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "flex flex-col gap-y-3 text-sm font-ui", children: [
5610
- adventure && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5611
- /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: TL.adventureLabel }),
5612
- /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: adventure.name })
5614
+ adventure && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-x-4", children: [
5615
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: TL.adventureLabel }),
5616
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "w-1/2 text-foreground font-medium text-right min-w-0 break-words", children: adventure.name })
5613
5617
  ] }),
5614
- dateRange && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5615
- /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: (adventure == null ? void 0 : adventure.startDate) && (adventure == null ? void 0 : adventure.endDate) ? "Dates" : "Date" }),
5616
- /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground text-right min-w-0", children: dateRange })
5618
+ dateRange && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-x-4", children: [
5619
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: (adventure == null ? void 0 : adventure.startDate) && (adventure == null ? void 0 : adventure.endDate) ? "Dates" : "Date" }),
5620
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "w-1/2 text-foreground text-right min-w-0 break-words", children: dateRange })
5617
5621
  ] }),
5618
- (adventure == null ? void 0 : adventure.partnerName) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5619
- /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: TL.partnerLabel }),
5620
- /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground text-right min-w-0", children: adventure.partnerName })
5622
+ (adventure == null ? void 0 : adventure.partnerName) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-x-4", children: [
5623
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: TL.partnerLabel }),
5624
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "w-1/2 text-foreground text-right min-w-0 break-words", children: adventure.partnerName })
5621
5625
  ] }),
5622
- booking && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5623
- /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: TL.bookingLabel }),
5624
- /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-mono tabular-nums text-right min-w-0", children: booking.id })
5626
+ booking && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-x-4", children: [
5627
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: TL.bookingLabel }),
5628
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "w-1/2 text-foreground font-mono tabular-nums text-right min-w-0 break-words", children: booking.id })
5625
5629
  ] }),
5626
- traveller && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5627
- /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: TL.travellerLabel }),
5628
- /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: traveller.fullName })
5630
+ traveller && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-x-4", children: [
5631
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: TL.travellerLabel }),
5632
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "w-1/2 text-foreground font-medium text-right min-w-0 break-words", children: traveller.fullName })
5629
5633
  ] })
5630
5634
  ] }) }),
5631
- sorted.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: answersTitle, children: /* @__PURE__ */ jsxRuntime.jsx("dl", { className: "flex flex-col gap-y-3 text-sm font-ui", children: sorted.map((f) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5632
- /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: f.label }),
5633
- /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground text-right min-w-0 break-words", children: (formatAnswer != null ? formatAnswer : ((field, v) => defaultFormatAnswer(field, v, dateFormatter)))(
5635
+ sorted.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: answersTitle, children: /* @__PURE__ */ jsxRuntime.jsx("dl", { className: "flex flex-col gap-y-3 text-sm font-ui", children: sorted.map((f) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-x-4", children: [
5636
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: f.label }),
5637
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "w-1/2 text-foreground text-right min-w-0 break-words", children: (formatAnswer != null ? formatAnswer : ((field, v) => defaultFormatAnswer(field, v, dateFormatter)))(
5634
5638
  f,
5635
5639
  answers[f.id]
5636
5640
  ) })
5637
5641
  ] }, f.id)) }) }),
5638
- terms && /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: "Terms & Conditions", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm font-ui", children: [
5639
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
5640
- "inline-flex h-5 w-5 items-center justify-center rounded-full text-white text-xs font-bold",
5641
- terms.accepted ? "bg-primary" : "bg-destructive"
5642
- ), children: terms.accepted ? "\u2713" : "\u2717" }),
5643
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: terms.accepted ? "text-primary font-medium" : "text-destructive font-medium", children: terms.accepted ? "Accepted" : "Not accepted" })
5642
+ !isMinimal && terms && /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: (_f = termsLabels == null ? void 0 : termsLabels.title) != null ? _f : "Terms & Conditions", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3 text-sm font-ui", children: [
5643
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
5644
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
5645
+ "inline-flex h-5 w-5 items-center justify-center rounded-full text-white text-xs font-bold",
5646
+ terms.accepted ? "bg-primary" : "bg-destructive"
5647
+ ), children: terms.accepted ? "\u2713" : "\u2717" }),
5648
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: terms.accepted ? "text-primary font-medium" : "text-destructive font-medium", children: terms.accepted ? (_g = termsLabels == null ? void 0 : termsLabels.accepted) != null ? _g : "Accepted" : (_h = termsLabels == null ? void 0 : termsLabels.notAccepted) != null ? _h : "Not accepted" })
5649
+ ] }),
5650
+ termsLayout === "full" && terms.markdown.trim().length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-lg border border-border bg-muted/30 p-4", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "whitespace-pre-wrap break-words text-sm leading-relaxed text-foreground font-ui", children: terms.markdown }) })
5644
5651
  ] }) })
5645
5652
  ] });
5646
5653
  }