@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.d.cts
CHANGED
|
@@ -779,6 +779,10 @@ interface RegistrationFormLabels {
|
|
|
779
779
|
selectPlaceholder?: string;
|
|
780
780
|
optionalLabel?: string;
|
|
781
781
|
requiredFieldError?: string;
|
|
782
|
+
/** Singular date label (used when only one of startDate/endDate is set). Default: "Date". */
|
|
783
|
+
dateLabel?: string;
|
|
784
|
+
/** Plural date label (used when both startDate and endDate are set). Default: "Dates". */
|
|
785
|
+
datesLabel?: string;
|
|
782
786
|
}
|
|
783
787
|
interface RegistrationFormProps {
|
|
784
788
|
/** Logo shown above the title. Defaults to "/logo-planetaexo.png" (matching Offer). Pass null to hide. */
|
|
@@ -866,6 +870,18 @@ interface RegistrationSuccessCardProps {
|
|
|
866
870
|
bookingLabel?: string;
|
|
867
871
|
partnerLabel?: string;
|
|
868
872
|
travellerLabel?: string;
|
|
873
|
+
/** Singular date label. Default: "Date". */
|
|
874
|
+
dateLabel?: string;
|
|
875
|
+
/** Plural date label. Default: "Dates". */
|
|
876
|
+
datesLabel?: string;
|
|
877
|
+
};
|
|
878
|
+
/**
|
|
879
|
+
* Labels for boolean answers in the default formatAnswer (when no custom
|
|
880
|
+
* `formatAnswer` is supplied). Defaults: `{ yes: "Yes", no: "No" }`.
|
|
881
|
+
*/
|
|
882
|
+
booleanLabels?: {
|
|
883
|
+
yes?: string;
|
|
884
|
+
no?: string;
|
|
869
885
|
};
|
|
870
886
|
/**
|
|
871
887
|
* Visual density of the card.
|
|
@@ -888,7 +904,7 @@ interface RegistrationSuccessCardProps {
|
|
|
888
904
|
lastUpdatedAt?: string;
|
|
889
905
|
};
|
|
890
906
|
}
|
|
891
|
-
declare function RegistrationSuccessCard({ variant, title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, className, actions, logo, logoAlt, terms, termsLayout, termsLabels, adventure, booking, traveller, tripInfoLabels, density, submissionTimestamps, submissionTimestampsLabels, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
907
|
+
declare function RegistrationSuccessCard({ variant, title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, className, actions, logo, logoAlt, terms, termsLayout, termsLabels, adventure, booking, traveller, tripInfoLabels, booleanLabels, density, submissionTimestamps, submissionTimestampsLabels, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
892
908
|
|
|
893
909
|
interface FloatingInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
894
910
|
label: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -779,6 +779,10 @@ interface RegistrationFormLabels {
|
|
|
779
779
|
selectPlaceholder?: string;
|
|
780
780
|
optionalLabel?: string;
|
|
781
781
|
requiredFieldError?: string;
|
|
782
|
+
/** Singular date label (used when only one of startDate/endDate is set). Default: "Date". */
|
|
783
|
+
dateLabel?: string;
|
|
784
|
+
/** Plural date label (used when both startDate and endDate are set). Default: "Dates". */
|
|
785
|
+
datesLabel?: string;
|
|
782
786
|
}
|
|
783
787
|
interface RegistrationFormProps {
|
|
784
788
|
/** Logo shown above the title. Defaults to "/logo-planetaexo.png" (matching Offer). Pass null to hide. */
|
|
@@ -866,6 +870,18 @@ interface RegistrationSuccessCardProps {
|
|
|
866
870
|
bookingLabel?: string;
|
|
867
871
|
partnerLabel?: string;
|
|
868
872
|
travellerLabel?: string;
|
|
873
|
+
/** Singular date label. Default: "Date". */
|
|
874
|
+
dateLabel?: string;
|
|
875
|
+
/** Plural date label. Default: "Dates". */
|
|
876
|
+
datesLabel?: string;
|
|
877
|
+
};
|
|
878
|
+
/**
|
|
879
|
+
* Labels for boolean answers in the default formatAnswer (when no custom
|
|
880
|
+
* `formatAnswer` is supplied). Defaults: `{ yes: "Yes", no: "No" }`.
|
|
881
|
+
*/
|
|
882
|
+
booleanLabels?: {
|
|
883
|
+
yes?: string;
|
|
884
|
+
no?: string;
|
|
869
885
|
};
|
|
870
886
|
/**
|
|
871
887
|
* Visual density of the card.
|
|
@@ -888,7 +904,7 @@ interface RegistrationSuccessCardProps {
|
|
|
888
904
|
lastUpdatedAt?: string;
|
|
889
905
|
};
|
|
890
906
|
}
|
|
891
|
-
declare function RegistrationSuccessCard({ variant, title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, className, actions, logo, logoAlt, terms, termsLayout, termsLabels, adventure, booking, traveller, tripInfoLabels, density, submissionTimestamps, submissionTimestampsLabels, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
907
|
+
declare function RegistrationSuccessCard({ variant, title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, className, actions, logo, logoAlt, terms, termsLayout, termsLabels, adventure, booking, traveller, tripInfoLabels, booleanLabels, density, submissionTimestamps, submissionTimestampsLabels, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
892
908
|
|
|
893
909
|
interface FloatingInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
894
910
|
label: string;
|
package/dist/index.js
CHANGED
|
@@ -2151,7 +2151,7 @@ function OfferAdventureCard({ adventure }) {
|
|
|
2151
2151
|
}
|
|
2152
2152
|
function Offer({
|
|
2153
2153
|
logo = "/logo-planetaexo.png",
|
|
2154
|
-
logoAlt = "
|
|
2154
|
+
logoAlt = "PlanetaEXO",
|
|
2155
2155
|
title,
|
|
2156
2156
|
subtitle,
|
|
2157
2157
|
adventures,
|
|
@@ -4850,7 +4850,9 @@ var DEFAULT_LABELS3 = {
|
|
|
4850
4850
|
nationalityLabel: "Nationality",
|
|
4851
4851
|
selectPlaceholder: "Select an option\u2026",
|
|
4852
4852
|
optionalLabel: "(optional)",
|
|
4853
|
-
requiredFieldError: "Required"
|
|
4853
|
+
requiredFieldError: "Required",
|
|
4854
|
+
dateLabel: "Date",
|
|
4855
|
+
datesLabel: "Dates"
|
|
4854
4856
|
};
|
|
4855
4857
|
var TERMS_ACCEPT_KEY = "__registrationTermsAccepted";
|
|
4856
4858
|
function emptyName() {
|
|
@@ -5461,7 +5463,7 @@ function FieldRenderer({
|
|
|
5461
5463
|
}
|
|
5462
5464
|
function RegistrationForm({
|
|
5463
5465
|
logo = "/logo-planetaexo.png",
|
|
5464
|
-
logoAlt = "
|
|
5466
|
+
logoAlt = "PlanetaEXO",
|
|
5465
5467
|
heroImage,
|
|
5466
5468
|
heroImageAlt = "",
|
|
5467
5469
|
title,
|
|
@@ -5631,7 +5633,7 @@ function RegistrationForm({
|
|
|
5631
5633
|
/* @__PURE__ */ jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: adventure.name })
|
|
5632
5634
|
] }),
|
|
5633
5635
|
dateRange && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
|
|
5634
|
-
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: (adventure == null ? void 0 : adventure.startDate) && (adventure == null ? void 0 : adventure.endDate) ?
|
|
5636
|
+
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: (adventure == null ? void 0 : adventure.startDate) && (adventure == null ? void 0 : adventure.endDate) ? L.datesLabel : L.dateLabel }),
|
|
5635
5637
|
/* @__PURE__ */ jsx("dd", { className: "text-foreground text-right min-w-0", children: dateRange })
|
|
5636
5638
|
] }),
|
|
5637
5639
|
(adventure == null ? void 0 : adventure.partnerName) && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
|
|
@@ -5815,7 +5817,7 @@ function phoneCountryDial(code) {
|
|
|
5815
5817
|
var _a, _b;
|
|
5816
5818
|
return (_b = (_a = PHONE_COUNTRIES.find((c) => c.code === code)) == null ? void 0 : _a.dial) != null ? _b : code;
|
|
5817
5819
|
}
|
|
5818
|
-
function defaultFormatAnswer(field, value, fmtDate) {
|
|
5820
|
+
function defaultFormatAnswer(field, value, fmtDate, booleanLabels = { yes: "Yes", no: "No" }) {
|
|
5819
5821
|
var _a, _b, _c, _d, _e, _f;
|
|
5820
5822
|
if (value == null || value === "") return "\u2014";
|
|
5821
5823
|
if (value instanceof Date) return fmtDate(value);
|
|
@@ -5825,7 +5827,7 @@ function defaultFormatAnswer(field, value, fmtDate) {
|
|
|
5825
5827
|
}
|
|
5826
5828
|
return value.filter(Boolean).join(", ") || "\u2014";
|
|
5827
5829
|
}
|
|
5828
|
-
if (typeof value === "boolean") return value ?
|
|
5830
|
+
if (typeof value === "boolean") return value ? booleanLabels.yes : booleanLabels.no;
|
|
5829
5831
|
if (typeof value === "object") {
|
|
5830
5832
|
if ("contactName" in value) {
|
|
5831
5833
|
const ec = value;
|
|
@@ -5880,11 +5882,12 @@ function RegistrationSuccessCard({
|
|
|
5880
5882
|
booking,
|
|
5881
5883
|
traveller,
|
|
5882
5884
|
tripInfoLabels,
|
|
5885
|
+
booleanLabels,
|
|
5883
5886
|
density = "comfortable",
|
|
5884
5887
|
submissionTimestamps,
|
|
5885
5888
|
submissionTimestampsLabels
|
|
5886
5889
|
}) {
|
|
5887
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
5890
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
5888
5891
|
const isMinimal = variant === "minimal";
|
|
5889
5892
|
const isCompact = density === "compact";
|
|
5890
5893
|
const sorted = isMinimal ? [] : [...fields].sort((a, b) => {
|
|
@@ -5898,11 +5901,17 @@ function RegistrationSuccessCard({
|
|
|
5898
5901
|
adventureLabel: (_b = tripInfoLabels == null ? void 0 : tripInfoLabels.adventureLabel) != null ? _b : "Adventure",
|
|
5899
5902
|
bookingLabel: (_c = tripInfoLabels == null ? void 0 : tripInfoLabels.bookingLabel) != null ? _c : "Booking",
|
|
5900
5903
|
partnerLabel: (_d = tripInfoLabels == null ? void 0 : tripInfoLabels.partnerLabel) != null ? _d : "Partner",
|
|
5901
|
-
travellerLabel: (_e = tripInfoLabels == null ? void 0 : tripInfoLabels.travellerLabel) != null ? _e : "Traveller"
|
|
5904
|
+
travellerLabel: (_e = tripInfoLabels == null ? void 0 : tripInfoLabels.travellerLabel) != null ? _e : "Traveller",
|
|
5905
|
+
dateLabel: (_f = tripInfoLabels == null ? void 0 : tripInfoLabels.dateLabel) != null ? _f : "Date",
|
|
5906
|
+
datesLabel: (_g = tripInfoLabels == null ? void 0 : tripInfoLabels.datesLabel) != null ? _g : "Dates"
|
|
5907
|
+
};
|
|
5908
|
+
const BL = {
|
|
5909
|
+
yes: (_h = booleanLabels == null ? void 0 : booleanLabels.yes) != null ? _h : "Yes",
|
|
5910
|
+
no: (_i = booleanLabels == null ? void 0 : booleanLabels.no) != null ? _i : "No"
|
|
5902
5911
|
};
|
|
5903
5912
|
const STL = {
|
|
5904
|
-
submittedAt: (
|
|
5905
|
-
lastUpdatedAt: (
|
|
5913
|
+
submittedAt: (_j = submissionTimestampsLabels == null ? void 0 : submissionTimestampsLabels.submittedAt) != null ? _j : "Submitted",
|
|
5914
|
+
lastUpdatedAt: (_k = submissionTimestampsLabels == null ? void 0 : submissionTimestampsLabels.lastUpdatedAt) != null ? _k : "Last updated"
|
|
5906
5915
|
};
|
|
5907
5916
|
const hasTimestamps = !isMinimal && !!submissionTimestamps && (!!submissionTimestamps.submittedAt || !!submissionTimestamps.lastUpdatedAt);
|
|
5908
5917
|
return /* @__PURE__ */ jsxs(
|
|
@@ -5953,7 +5962,7 @@ function RegistrationSuccessCard({
|
|
|
5953
5962
|
/* @__PURE__ */ jsx("dd", { className: "w-1/2 text-foreground font-medium text-right min-w-0 break-words", children: adventure.name })
|
|
5954
5963
|
] }),
|
|
5955
5964
|
dateRange && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-x-4", children: [
|
|
5956
|
-
/* @__PURE__ */ jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: (adventure == null ? void 0 : adventure.startDate) && (adventure == null ? void 0 : adventure.endDate) ?
|
|
5965
|
+
/* @__PURE__ */ 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 }),
|
|
5957
5966
|
/* @__PURE__ */ jsx("dd", { className: "w-1/2 text-foreground text-right min-w-0 break-words", children: dateRange })
|
|
5958
5967
|
] }),
|
|
5959
5968
|
(adventure == null ? void 0 : adventure.partnerName) && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-x-4", children: [
|
|
@@ -5971,18 +5980,18 @@ function RegistrationSuccessCard({
|
|
|
5971
5980
|
] }) }),
|
|
5972
5981
|
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 gap-x-4", children: [
|
|
5973
5982
|
/* @__PURE__ */ jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: f.label }),
|
|
5974
|
-
/* @__PURE__ */ 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)))(
|
|
5983
|
+
/* @__PURE__ */ 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)))(
|
|
5975
5984
|
f,
|
|
5976
5985
|
answers[f.id]
|
|
5977
5986
|
) })
|
|
5978
5987
|
] }, f.id)) }) }),
|
|
5979
|
-
!isMinimal && terms && /* @__PURE__ */ jsx(FormSection2, { title: (
|
|
5988
|
+
!isMinimal && terms && /* @__PURE__ */ jsx(FormSection2, { title: (_l = termsLabels == null ? void 0 : termsLabels.title) != null ? _l : "Terms & Conditions", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 text-sm font-ui", children: [
|
|
5980
5989
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
5981
5990
|
/* @__PURE__ */ jsx("div", { className: cn(
|
|
5982
5991
|
"inline-flex h-5 w-5 items-center justify-center rounded-full text-white text-xs font-bold",
|
|
5983
5992
|
terms.accepted ? "bg-primary" : "bg-destructive"
|
|
5984
5993
|
), children: terms.accepted ? "\u2713" : "\u2717" }),
|
|
5985
|
-
/* @__PURE__ */ jsx("span", { className: terms.accepted ? "text-primary font-medium" : "text-destructive font-medium", children: terms.accepted ? (
|
|
5994
|
+
/* @__PURE__ */ 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" })
|
|
5986
5995
|
] }),
|
|
5987
5996
|
termsLayout === "full" && terms.markdown.trim().length > 0 && /* @__PURE__ */ jsx(
|
|
5988
5997
|
"div",
|
|
@@ -7579,7 +7588,7 @@ function SiteHeader({
|
|
|
7579
7588
|
variant = "transparent",
|
|
7580
7589
|
links = DEFAULT_HEADER_LINKS,
|
|
7581
7590
|
logoSrc = "/logo-planetaexo.png",
|
|
7582
|
-
logoAlt = "
|
|
7591
|
+
logoAlt = "PlanetaEXO",
|
|
7583
7592
|
languages = DEFAULT_LANGUAGES,
|
|
7584
7593
|
currentLanguage = "EN",
|
|
7585
7594
|
onLanguageChange,
|