@planetaexo/design-system 0.13.2 → 0.14.0
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 +24 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.js +24 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2172,7 +2172,7 @@ function OfferAdventureCard({ adventure }) {
|
|
|
2172
2172
|
}
|
|
2173
2173
|
function Offer({
|
|
2174
2174
|
logo = "/logo-planetaexo.png",
|
|
2175
|
-
logoAlt = "
|
|
2175
|
+
logoAlt = "PlanetaEXO",
|
|
2176
2176
|
title,
|
|
2177
2177
|
subtitle,
|
|
2178
2178
|
adventures,
|
|
@@ -4871,7 +4871,9 @@ var DEFAULT_LABELS3 = {
|
|
|
4871
4871
|
nationalityLabel: "Nationality",
|
|
4872
4872
|
selectPlaceholder: "Select an option\u2026",
|
|
4873
4873
|
optionalLabel: "(optional)",
|
|
4874
|
-
requiredFieldError: "Required"
|
|
4874
|
+
requiredFieldError: "Required",
|
|
4875
|
+
dateLabel: "Date",
|
|
4876
|
+
datesLabel: "Dates"
|
|
4875
4877
|
};
|
|
4876
4878
|
var TERMS_ACCEPT_KEY = "__registrationTermsAccepted";
|
|
4877
4879
|
function emptyName() {
|
|
@@ -5482,7 +5484,7 @@ function FieldRenderer({
|
|
|
5482
5484
|
}
|
|
5483
5485
|
function RegistrationForm({
|
|
5484
5486
|
logo = "/logo-planetaexo.png",
|
|
5485
|
-
logoAlt = "
|
|
5487
|
+
logoAlt = "PlanetaEXO",
|
|
5486
5488
|
heroImage,
|
|
5487
5489
|
heroImageAlt = "",
|
|
5488
5490
|
title,
|
|
@@ -5652,7 +5654,7 @@ function RegistrationForm({
|
|
|
5652
5654
|
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: adventure.name })
|
|
5653
5655
|
] }),
|
|
5654
5656
|
dateRange && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
|
|
5655
|
-
/* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: (adventure == null ? void 0 : adventure.startDate) && (adventure == null ? void 0 : adventure.endDate) ?
|
|
5657
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: (adventure == null ? void 0 : adventure.startDate) && (adventure == null ? void 0 : adventure.endDate) ? L.datesLabel : L.dateLabel }),
|
|
5656
5658
|
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground text-right min-w-0", children: dateRange })
|
|
5657
5659
|
] }),
|
|
5658
5660
|
(adventure == null ? void 0 : adventure.partnerName) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
|
|
@@ -5836,7 +5838,7 @@ function phoneCountryDial(code) {
|
|
|
5836
5838
|
var _a, _b;
|
|
5837
5839
|
return (_b = (_a = PHONE_COUNTRIES.find((c) => c.code === code)) == null ? void 0 : _a.dial) != null ? _b : code;
|
|
5838
5840
|
}
|
|
5839
|
-
function defaultFormatAnswer(field, value, fmtDate) {
|
|
5841
|
+
function defaultFormatAnswer(field, value, fmtDate, booleanLabels = { yes: "Yes", no: "No" }) {
|
|
5840
5842
|
var _a, _b, _c, _d, _e, _f;
|
|
5841
5843
|
if (value == null || value === "") return "\u2014";
|
|
5842
5844
|
if (value instanceof Date) return fmtDate(value);
|
|
@@ -5846,7 +5848,7 @@ function defaultFormatAnswer(field, value, fmtDate) {
|
|
|
5846
5848
|
}
|
|
5847
5849
|
return value.filter(Boolean).join(", ") || "\u2014";
|
|
5848
5850
|
}
|
|
5849
|
-
if (typeof value === "boolean") return value ?
|
|
5851
|
+
if (typeof value === "boolean") return value ? booleanLabels.yes : booleanLabels.no;
|
|
5850
5852
|
if (typeof value === "object") {
|
|
5851
5853
|
if ("contactName" in value) {
|
|
5852
5854
|
const ec = value;
|
|
@@ -5901,11 +5903,12 @@ function RegistrationSuccessCard({
|
|
|
5901
5903
|
booking,
|
|
5902
5904
|
traveller,
|
|
5903
5905
|
tripInfoLabels,
|
|
5906
|
+
booleanLabels,
|
|
5904
5907
|
density = "comfortable",
|
|
5905
5908
|
submissionTimestamps,
|
|
5906
5909
|
submissionTimestampsLabels
|
|
5907
5910
|
}) {
|
|
5908
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
5911
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
5909
5912
|
const isMinimal = variant === "minimal";
|
|
5910
5913
|
const isCompact = density === "compact";
|
|
5911
5914
|
const sorted = isMinimal ? [] : [...fields].sort((a, b) => {
|
|
@@ -5919,11 +5922,17 @@ function RegistrationSuccessCard({
|
|
|
5919
5922
|
adventureLabel: (_b = tripInfoLabels == null ? void 0 : tripInfoLabels.adventureLabel) != null ? _b : "Adventure",
|
|
5920
5923
|
bookingLabel: (_c = tripInfoLabels == null ? void 0 : tripInfoLabels.bookingLabel) != null ? _c : "Booking",
|
|
5921
5924
|
partnerLabel: (_d = tripInfoLabels == null ? void 0 : tripInfoLabels.partnerLabel) != null ? _d : "Partner",
|
|
5922
|
-
travellerLabel: (_e = tripInfoLabels == null ? void 0 : tripInfoLabels.travellerLabel) != null ? _e : "Traveller"
|
|
5925
|
+
travellerLabel: (_e = tripInfoLabels == null ? void 0 : tripInfoLabels.travellerLabel) != null ? _e : "Traveller",
|
|
5926
|
+
dateLabel: (_f = tripInfoLabels == null ? void 0 : tripInfoLabels.dateLabel) != null ? _f : "Date",
|
|
5927
|
+
datesLabel: (_g = tripInfoLabels == null ? void 0 : tripInfoLabels.datesLabel) != null ? _g : "Dates"
|
|
5928
|
+
};
|
|
5929
|
+
const BL = {
|
|
5930
|
+
yes: (_h = booleanLabels == null ? void 0 : booleanLabels.yes) != null ? _h : "Yes",
|
|
5931
|
+
no: (_i = booleanLabels == null ? void 0 : booleanLabels.no) != null ? _i : "No"
|
|
5923
5932
|
};
|
|
5924
5933
|
const STL = {
|
|
5925
|
-
submittedAt: (
|
|
5926
|
-
lastUpdatedAt: (
|
|
5934
|
+
submittedAt: (_j = submissionTimestampsLabels == null ? void 0 : submissionTimestampsLabels.submittedAt) != null ? _j : "Submitted",
|
|
5935
|
+
lastUpdatedAt: (_k = submissionTimestampsLabels == null ? void 0 : submissionTimestampsLabels.lastUpdatedAt) != null ? _k : "Last updated"
|
|
5927
5936
|
};
|
|
5928
5937
|
const hasTimestamps = !isMinimal && !!submissionTimestamps && (!!submissionTimestamps.submittedAt || !!submissionTimestamps.lastUpdatedAt);
|
|
5929
5938
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -5974,7 +5983,7 @@ function RegistrationSuccessCard({
|
|
|
5974
5983
|
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "w-1/2 text-foreground font-medium text-right min-w-0 break-words", children: adventure.name })
|
|
5975
5984
|
] }),
|
|
5976
5985
|
dateRange && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-x-4", children: [
|
|
5977
|
-
/* @__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) ?
|
|
5986
|
+
/* @__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) ? TL.datesLabel : TL.dateLabel }),
|
|
5978
5987
|
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "w-1/2 text-foreground text-right min-w-0 break-words", children: dateRange })
|
|
5979
5988
|
] }),
|
|
5980
5989
|
(adventure == null ? void 0 : adventure.partnerName) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-x-4", children: [
|
|
@@ -5992,18 +6001,18 @@ function RegistrationSuccessCard({
|
|
|
5992
6001
|
] }) }),
|
|
5993
6002
|
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: [
|
|
5994
6003
|
/* @__PURE__ */ jsxRuntime.jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: f.label }),
|
|
5995
|
-
/* @__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)))(
|
|
6004
|
+
/* @__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, BL)))(
|
|
5996
6005
|
f,
|
|
5997
6006
|
answers[f.id]
|
|
5998
6007
|
) })
|
|
5999
6008
|
] }, f.id)) }) }),
|
|
6000
|
-
!isMinimal && terms && /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: (
|
|
6009
|
+
!isMinimal && terms && /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: (_l = termsLabels == null ? void 0 : termsLabels.title) != null ? _l : "Terms & Conditions", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3 text-sm font-ui", children: [
|
|
6001
6010
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
6002
6011
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
|
|
6003
6012
|
"inline-flex h-5 w-5 items-center justify-center rounded-full text-white text-xs font-bold",
|
|
6004
6013
|
terms.accepted ? "bg-primary" : "bg-destructive"
|
|
6005
6014
|
), children: terms.accepted ? "\u2713" : "\u2717" }),
|
|
6006
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: terms.accepted ? "text-primary font-medium" : "text-destructive font-medium", children: terms.accepted ? (
|
|
6015
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: terms.accepted ? "text-primary font-medium" : "text-destructive font-medium", children: terms.accepted ? (_m = termsLabels == null ? void 0 : termsLabels.accepted) != null ? _m : "Accepted" : (_n = termsLabels == null ? void 0 : termsLabels.notAccepted) != null ? _n : "Not accepted" })
|
|
6007
6016
|
] }),
|
|
6008
6017
|
termsLayout === "full" && terms.markdown.trim().length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6009
6018
|
"div",
|
|
@@ -7600,7 +7609,7 @@ function SiteHeader({
|
|
|
7600
7609
|
variant = "transparent",
|
|
7601
7610
|
links = DEFAULT_HEADER_LINKS,
|
|
7602
7611
|
logoSrc = "/logo-planetaexo.png",
|
|
7603
|
-
logoAlt = "
|
|
7612
|
+
logoAlt = "PlanetaEXO",
|
|
7604
7613
|
languages = DEFAULT_LANGUAGES,
|
|
7605
7614
|
currentLanguage = "EN",
|
|
7606
7615
|
onLanguageChange,
|