@planetaexo/design-system 0.5.1 → 0.5.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
@@ -4874,7 +4874,16 @@ function RegistrationForm({
4874
4874
  /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: traveller.fullName })
4875
4875
  ] })
4876
4876
  ] }) }),
4877
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(readOnly && "cursor-not-allowed"), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(readOnly && "pointer-events-none opacity-50 select-none"), children: [
4877
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
4878
+ readOnly && [
4879
+ "opacity-50 select-none",
4880
+ "[&_input]:cursor-not-allowed",
4881
+ "[&_select]:cursor-not-allowed",
4882
+ "[&_textarea]:cursor-not-allowed",
4883
+ "[&_button]:cursor-not-allowed",
4884
+ "[&_label]:cursor-not-allowed"
4885
+ ].join(" ")
4886
+ ), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(readOnly && "pointer-events-none"), children: [
4878
4887
  /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: L.detailsSectionTitle, children: sortedFields.map((field) => {
4879
4888
  var _a2;
4880
4889
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { id: `rf-${field.id}`, className: "flex flex-col gap-1.5", children: [
@@ -5087,12 +5096,26 @@ function RegistrationSuccessCard({
5087
5096
  dateFormatter = isoOrDateToString,
5088
5097
  formatAnswer,
5089
5098
  className,
5090
- actions
5099
+ actions,
5100
+ adventure,
5101
+ booking,
5102
+ traveller,
5103
+ tripInfoLabels
5091
5104
  }) {
5105
+ var _a, _b, _c, _d, _e;
5092
5106
  const sorted = [...fields].sort((a, b) => {
5093
- var _a, _b;
5094
- return ((_a = a.order) != null ? _a : 0) - ((_b = b.order) != null ? _b : 0);
5107
+ var _a2, _b2;
5108
+ return ((_a2 = a.order) != null ? _a2 : 0) - ((_b2 = b.order) != null ? _b2 : 0);
5095
5109
  }).filter((f) => Object.prototype.hasOwnProperty.call(answers, f.id));
5110
+ const hasTripInfo = !!(adventure || booking || traveller);
5111
+ const dateRange = adventure ? formatDateRange(adventure, dateFormatter) : null;
5112
+ const TL = {
5113
+ sectionTitle: (_a = tripInfoLabels == null ? void 0 : tripInfoLabels.sectionTitle) != null ? _a : "Trip info",
5114
+ adventureLabel: (_b = tripInfoLabels == null ? void 0 : tripInfoLabels.adventureLabel) != null ? _b : "Adventure",
5115
+ bookingLabel: (_c = tripInfoLabels == null ? void 0 : tripInfoLabels.bookingLabel) != null ? _c : "Booking",
5116
+ partnerLabel: (_d = tripInfoLabels == null ? void 0 : tripInfoLabels.partnerLabel) != null ? _d : "Partner",
5117
+ travellerLabel: (_e = tripInfoLabels == null ? void 0 : tripInfoLabels.travellerLabel) != null ? _e : "Traveller"
5118
+ };
5096
5119
  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: [
5097
5120
  actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-3 justify-end", children: actions }),
5098
5121
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-3 text-center", children: [
@@ -5100,6 +5123,28 @@ function RegistrationSuccessCard({
5100
5123
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-black uppercase tracking-wide text-foreground font-heading leading-tight", children: title }),
5101
5124
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground font-ui", children: message })
5102
5125
  ] }),
5126
+ 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: [
5127
+ adventure && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5128
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: TL.adventureLabel }),
5129
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: adventure.name })
5130
+ ] }),
5131
+ dateRange && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5132
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: (adventure == null ? void 0 : adventure.startDate) && (adventure == null ? void 0 : adventure.endDate) ? "Dates" : "Date" }),
5133
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground text-right min-w-0", children: dateRange })
5134
+ ] }),
5135
+ (adventure == null ? void 0 : adventure.partnerName) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5136
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: TL.partnerLabel }),
5137
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground text-right min-w-0", children: adventure.partnerName })
5138
+ ] }),
5139
+ booking && /* @__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.bookingLabel }),
5141
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-mono tabular-nums text-right min-w-0", children: booking.id })
5142
+ ] }),
5143
+ traveller && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5144
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: TL.travellerLabel }),
5145
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: traveller.fullName })
5146
+ ] })
5147
+ ] }) }),
5103
5148
  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: [
5104
5149
  /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: f.label }),
5105
5150
  /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground text-right min-w-0 break-words", children: (formatAnswer != null ? formatAnswer : ((field, v) => defaultFormatAnswer(field, v, dateFormatter)))(