@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 +49 -4
- 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 +49 -4
- 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
|
@@ -4853,7 +4853,16 @@ function RegistrationForm({
|
|
|
4853
4853
|
/* @__PURE__ */ jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: traveller.fullName })
|
|
4854
4854
|
] })
|
|
4855
4855
|
] }) }),
|
|
4856
|
-
/* @__PURE__ */ jsx("div", { className: cn(
|
|
4856
|
+
/* @__PURE__ */ jsx("div", { className: cn(
|
|
4857
|
+
readOnly && [
|
|
4858
|
+
"opacity-50 select-none",
|
|
4859
|
+
"[&_input]:cursor-not-allowed",
|
|
4860
|
+
"[&_select]:cursor-not-allowed",
|
|
4861
|
+
"[&_textarea]:cursor-not-allowed",
|
|
4862
|
+
"[&_button]:cursor-not-allowed",
|
|
4863
|
+
"[&_label]:cursor-not-allowed"
|
|
4864
|
+
].join(" ")
|
|
4865
|
+
), children: /* @__PURE__ */ jsxs("div", { className: cn(readOnly && "pointer-events-none"), children: [
|
|
4857
4866
|
/* @__PURE__ */ jsx(FormSection2, { title: L.detailsSectionTitle, children: sortedFields.map((field) => {
|
|
4858
4867
|
var _a2;
|
|
4859
4868
|
return /* @__PURE__ */ jsxs("div", { id: `rf-${field.id}`, className: "flex flex-col gap-1.5", children: [
|
|
@@ -5066,12 +5075,26 @@ function RegistrationSuccessCard({
|
|
|
5066
5075
|
dateFormatter = isoOrDateToString,
|
|
5067
5076
|
formatAnswer,
|
|
5068
5077
|
className,
|
|
5069
|
-
actions
|
|
5078
|
+
actions,
|
|
5079
|
+
adventure,
|
|
5080
|
+
booking,
|
|
5081
|
+
traveller,
|
|
5082
|
+
tripInfoLabels
|
|
5070
5083
|
}) {
|
|
5084
|
+
var _a, _b, _c, _d, _e;
|
|
5071
5085
|
const sorted = [...fields].sort((a, b) => {
|
|
5072
|
-
var
|
|
5073
|
-
return ((
|
|
5086
|
+
var _a2, _b2;
|
|
5087
|
+
return ((_a2 = a.order) != null ? _a2 : 0) - ((_b2 = b.order) != null ? _b2 : 0);
|
|
5074
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
|
+
};
|
|
5075
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: [
|
|
5076
5099
|
actions && /* @__PURE__ */ jsx("div", { className: "flex gap-3 justify-end", children: actions }),
|
|
5077
5100
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-3 text-center", children: [
|
|
@@ -5079,6 +5102,28 @@ function RegistrationSuccessCard({
|
|
|
5079
5102
|
/* @__PURE__ */ jsx("h2", { className: "text-2xl font-black uppercase tracking-wide text-foreground font-heading leading-tight", children: title }),
|
|
5080
5103
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground font-ui", children: message })
|
|
5081
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
|
+
] }) }),
|
|
5082
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: [
|
|
5083
5128
|
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: f.label }),
|
|
5084
5129
|
/* @__PURE__ */ jsx("dd", { className: "text-foreground text-right min-w-0 break-words", children: (formatAnswer != null ? formatAnswer : ((field, v) => defaultFormatAnswer(field, v, dateFormatter)))(
|