@planetaexo/design-system 0.5.2 → 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 +39 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +39 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -626,8 +626,18 @@ interface RegistrationSuccessCardProps {
|
|
|
626
626
|
formatAnswer?: (field: RegistrationField, value: RegistrationFieldValue) => string;
|
|
627
627
|
className?: string;
|
|
628
628
|
actions?: React.ReactNode;
|
|
629
|
+
adventure?: RegistrationAdventure | null;
|
|
630
|
+
booking?: RegistrationBooking | null;
|
|
631
|
+
traveller?: RegistrationTraveller | null;
|
|
632
|
+
tripInfoLabels?: {
|
|
633
|
+
sectionTitle?: string;
|
|
634
|
+
adventureLabel?: string;
|
|
635
|
+
bookingLabel?: string;
|
|
636
|
+
partnerLabel?: string;
|
|
637
|
+
travellerLabel?: string;
|
|
638
|
+
};
|
|
629
639
|
}
|
|
630
|
-
declare function RegistrationSuccessCard({ title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, className, actions, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
640
|
+
declare function RegistrationSuccessCard({ title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, className, actions, adventure, booking, traveller, tripInfoLabels, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
631
641
|
|
|
632
642
|
interface FloatingInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
633
643
|
label: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -626,8 +626,18 @@ interface RegistrationSuccessCardProps {
|
|
|
626
626
|
formatAnswer?: (field: RegistrationField, value: RegistrationFieldValue) => string;
|
|
627
627
|
className?: string;
|
|
628
628
|
actions?: React.ReactNode;
|
|
629
|
+
adventure?: RegistrationAdventure | null;
|
|
630
|
+
booking?: RegistrationBooking | null;
|
|
631
|
+
traveller?: RegistrationTraveller | null;
|
|
632
|
+
tripInfoLabels?: {
|
|
633
|
+
sectionTitle?: string;
|
|
634
|
+
adventureLabel?: string;
|
|
635
|
+
bookingLabel?: string;
|
|
636
|
+
partnerLabel?: string;
|
|
637
|
+
travellerLabel?: string;
|
|
638
|
+
};
|
|
629
639
|
}
|
|
630
|
-
declare function RegistrationSuccessCard({ title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, className, actions, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
640
|
+
declare function RegistrationSuccessCard({ title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, className, actions, adventure, booking, traveller, tripInfoLabels, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
631
641
|
|
|
632
642
|
interface FloatingInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
633
643
|
label: string;
|
package/dist/index.js
CHANGED
|
@@ -5075,12 +5075,26 @@ function RegistrationSuccessCard({
|
|
|
5075
5075
|
dateFormatter = isoOrDateToString,
|
|
5076
5076
|
formatAnswer,
|
|
5077
5077
|
className,
|
|
5078
|
-
actions
|
|
5078
|
+
actions,
|
|
5079
|
+
adventure,
|
|
5080
|
+
booking,
|
|
5081
|
+
traveller,
|
|
5082
|
+
tripInfoLabels
|
|
5079
5083
|
}) {
|
|
5084
|
+
var _a, _b, _c, _d, _e;
|
|
5080
5085
|
const sorted = [...fields].sort((a, b) => {
|
|
5081
|
-
var
|
|
5082
|
-
return ((
|
|
5086
|
+
var _a2, _b2;
|
|
5087
|
+
return ((_a2 = a.order) != null ? _a2 : 0) - ((_b2 = b.order) != null ? _b2 : 0);
|
|
5083
5088
|
}).filter((f) => Object.prototype.hasOwnProperty.call(answers, f.id));
|
|
5089
|
+
const hasTripInfo = !!(adventure || booking || traveller);
|
|
5090
|
+
const dateRange = adventure ? formatDateRange(adventure, dateFormatter) : null;
|
|
5091
|
+
const TL = {
|
|
5092
|
+
sectionTitle: (_a = tripInfoLabels == null ? void 0 : tripInfoLabels.sectionTitle) != null ? _a : "Trip info",
|
|
5093
|
+
adventureLabel: (_b = tripInfoLabels == null ? void 0 : tripInfoLabels.adventureLabel) != null ? _b : "Adventure",
|
|
5094
|
+
bookingLabel: (_c = tripInfoLabels == null ? void 0 : tripInfoLabels.bookingLabel) != null ? _c : "Booking",
|
|
5095
|
+
partnerLabel: (_d = tripInfoLabels == null ? void 0 : tripInfoLabels.partnerLabel) != null ? _d : "Partner",
|
|
5096
|
+
travellerLabel: (_e = tripInfoLabels == null ? void 0 : tripInfoLabels.travellerLabel) != null ? _e : "Traveller"
|
|
5097
|
+
};
|
|
5084
5098
|
return /* @__PURE__ */ jsxs("div", { className: cn("rounded-xl border border-border bg-card p-6 sm:p-8 flex flex-col gap-10", className), children: [
|
|
5085
5099
|
actions && /* @__PURE__ */ jsx("div", { className: "flex gap-3 justify-end", children: actions }),
|
|
5086
5100
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-3 text-center", children: [
|
|
@@ -5088,6 +5102,28 @@ function RegistrationSuccessCard({
|
|
|
5088
5102
|
/* @__PURE__ */ jsx("h2", { className: "text-2xl font-black uppercase tracking-wide text-foreground font-heading leading-tight", children: title }),
|
|
5089
5103
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground font-ui", children: message })
|
|
5090
5104
|
] }),
|
|
5105
|
+
hasTripInfo && /* @__PURE__ */ jsx(FormSection2, { title: TL.sectionTitle, children: /* @__PURE__ */ jsxs("dl", { className: "flex flex-col gap-y-3 text-sm font-ui", children: [
|
|
5106
|
+
adventure && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
|
|
5107
|
+
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: TL.adventureLabel }),
|
|
5108
|
+
/* @__PURE__ */ jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: adventure.name })
|
|
5109
|
+
] }),
|
|
5110
|
+
dateRange && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
|
|
5111
|
+
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: (adventure == null ? void 0 : adventure.startDate) && (adventure == null ? void 0 : adventure.endDate) ? "Dates" : "Date" }),
|
|
5112
|
+
/* @__PURE__ */ jsx("dd", { className: "text-foreground text-right min-w-0", children: dateRange })
|
|
5113
|
+
] }),
|
|
5114
|
+
(adventure == null ? void 0 : adventure.partnerName) && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
|
|
5115
|
+
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: TL.partnerLabel }),
|
|
5116
|
+
/* @__PURE__ */ jsx("dd", { className: "text-foreground text-right min-w-0", children: adventure.partnerName })
|
|
5117
|
+
] }),
|
|
5118
|
+
booking && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
|
|
5119
|
+
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: TL.bookingLabel }),
|
|
5120
|
+
/* @__PURE__ */ jsx("dd", { className: "text-foreground font-mono tabular-nums text-right min-w-0", children: booking.id })
|
|
5121
|
+
] }),
|
|
5122
|
+
traveller && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
|
|
5123
|
+
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: TL.travellerLabel }),
|
|
5124
|
+
/* @__PURE__ */ jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: traveller.fullName })
|
|
5125
|
+
] })
|
|
5126
|
+
] }) }),
|
|
5091
5127
|
sorted.length > 0 && /* @__PURE__ */ jsx(FormSection2, { title: answersTitle, children: /* @__PURE__ */ jsx("dl", { className: "flex flex-col gap-y-3 text-sm font-ui", children: sorted.map((f) => /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
|
|
5092
5128
|
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: f.label }),
|
|
5093
5129
|
/* @__PURE__ */ jsx("dd", { className: "text-foreground text-right min-w-0 break-words", children: (formatAnswer != null ? formatAnswer : ((field, v) => defaultFormatAnswer(field, v, dateFormatter)))(
|