@planetaexo/design-system 0.5.2 → 0.5.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
@@ -5096,26 +5096,84 @@ function RegistrationSuccessCard({
5096
5096
  dateFormatter = isoOrDateToString,
5097
5097
  formatAnswer,
5098
5098
  className,
5099
- actions
5099
+ actions,
5100
+ logo,
5101
+ logoAlt = "PlanetaEXO",
5102
+ terms,
5103
+ adventure,
5104
+ booking,
5105
+ traveller,
5106
+ tripInfoLabels
5100
5107
  }) {
5108
+ var _a, _b, _c, _d, _e;
5101
5109
  const sorted = [...fields].sort((a, b) => {
5102
- var _a, _b;
5103
- return ((_a = a.order) != null ? _a : 0) - ((_b = b.order) != null ? _b : 0);
5110
+ var _a2, _b2;
5111
+ return ((_a2 = a.order) != null ? _a2 : 0) - ((_b2 = b.order) != null ? _b2 : 0);
5104
5112
  }).filter((f) => Object.prototype.hasOwnProperty.call(answers, f.id));
5113
+ const hasTripInfo = !!(adventure || booking || traveller);
5114
+ const dateRange = adventure ? formatDateRange(adventure, dateFormatter) : null;
5115
+ const TL = {
5116
+ sectionTitle: (_a = tripInfoLabels == null ? void 0 : tripInfoLabels.sectionTitle) != null ? _a : "Trip info",
5117
+ adventureLabel: (_b = tripInfoLabels == null ? void 0 : tripInfoLabels.adventureLabel) != null ? _b : "Adventure",
5118
+ bookingLabel: (_c = tripInfoLabels == null ? void 0 : tripInfoLabels.bookingLabel) != null ? _c : "Booking",
5119
+ partnerLabel: (_d = tripInfoLabels == null ? void 0 : tripInfoLabels.partnerLabel) != null ? _d : "Partner",
5120
+ travellerLabel: (_e = tripInfoLabels == null ? void 0 : tripInfoLabels.travellerLabel) != null ? _e : "Traveller"
5121
+ };
5105
5122
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("rounded-xl border border-border bg-card p-6 sm:p-8 flex flex-col gap-10", className), children: [
5106
5123
  actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-3 justify-end", children: actions }),
5107
5124
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-3 text-center", children: [
5108
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-flex h-14 w-14 items-center justify-center rounded-full bg-primary/10 text-primary", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheckIcon, { size: 28 }) }),
5125
+ logo !== null && /* eslint-disable-next-line @next/next/no-img-element */
5126
+ /* @__PURE__ */ jsxRuntime.jsx(
5127
+ "img",
5128
+ {
5129
+ src: logo != null ? logo : "/logo-planetaexo.png",
5130
+ alt: logoAlt,
5131
+ className: "h-10 w-auto object-contain"
5132
+ }
5133
+ ),
5134
+ logo === void 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-flex h-14 w-14 items-center justify-center rounded-full bg-primary/10 text-primary", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheckIcon, { size: 28 }) }),
5109
5135
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-black uppercase tracking-wide text-foreground font-heading leading-tight", children: title }),
5110
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground font-ui", children: message })
5136
+ message && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground font-ui", children: message })
5111
5137
  ] }),
5138
+ 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: [
5139
+ adventure && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5140
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: TL.adventureLabel }),
5141
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: adventure.name })
5142
+ ] }),
5143
+ dateRange && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5144
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: (adventure == null ? void 0 : adventure.startDate) && (adventure == null ? void 0 : adventure.endDate) ? "Dates" : "Date" }),
5145
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground text-right min-w-0", children: dateRange })
5146
+ ] }),
5147
+ (adventure == null ? void 0 : adventure.partnerName) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5148
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: TL.partnerLabel }),
5149
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground text-right min-w-0", children: adventure.partnerName })
5150
+ ] }),
5151
+ booking && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5152
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: TL.bookingLabel }),
5153
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-mono tabular-nums text-right min-w-0", children: booking.id })
5154
+ ] }),
5155
+ traveller && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5156
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: TL.travellerLabel }),
5157
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: traveller.fullName })
5158
+ ] })
5159
+ ] }) }),
5112
5160
  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: [
5113
5161
  /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: f.label }),
5114
5162
  /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground text-right min-w-0 break-words", children: (formatAnswer != null ? formatAnswer : ((field, v) => defaultFormatAnswer(field, v, dateFormatter)))(
5115
5163
  f,
5116
5164
  answers[f.id]
5117
5165
  ) })
5118
- ] }, f.id)) }) })
5166
+ ] }, f.id)) }) }),
5167
+ terms && /* @__PURE__ */ jsxRuntime.jsxs(FormSection2, { title: "Terms & Conditions", children: [
5168
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-lg border border-border bg-muted/30 p-4 max-h-48 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "whitespace-pre-wrap text-sm leading-relaxed text-foreground font-ui", children: terms.markdown }) }),
5169
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm font-ui", children: [
5170
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
5171
+ "inline-flex h-5 w-5 items-center justify-center rounded-full text-white text-xs",
5172
+ terms.accepted ? "bg-primary" : "bg-destructive"
5173
+ ), children: terms.accepted ? "\u2713" : "\u2717" }),
5174
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: terms.accepted ? "text-primary font-medium" : "text-destructive font-medium", children: terms.accepted ? "Accepted" : "Not accepted" })
5175
+ ] })
5176
+ ] })
5119
5177
  ] });
5120
5178
  }
5121
5179
  var OTPCodeInput = ({