@planetaexo/design-system 0.13.1 → 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 +27 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +27 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -325,6 +325,9 @@ interface BookingDepositInfo {
|
|
|
325
325
|
remainingAmount: string;
|
|
326
326
|
balanceDueDate: string;
|
|
327
327
|
isPaidInFull?: boolean;
|
|
328
|
+
/** Label da linha do depósito. Default: "Deposit". Use "Paid" em contextos
|
|
329
|
+
* pós-compra onde o valor reflete o que o cliente realmente pagou. */
|
|
330
|
+
depositLabel?: string;
|
|
328
331
|
/** Valor numérico do saldo restante (em unidade monetária). Quando fornecido,
|
|
329
332
|
* o botão "Pay remaining balance" só é renderizado se > 0.
|
|
330
333
|
* Mantém backward compat: consumers que não passam o valor conservam o
|
|
@@ -776,6 +779,10 @@ interface RegistrationFormLabels {
|
|
|
776
779
|
selectPlaceholder?: string;
|
|
777
780
|
optionalLabel?: string;
|
|
778
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;
|
|
779
786
|
}
|
|
780
787
|
interface RegistrationFormProps {
|
|
781
788
|
/** Logo shown above the title. Defaults to "/logo-planetaexo.png" (matching Offer). Pass null to hide. */
|
|
@@ -863,6 +870,18 @@ interface RegistrationSuccessCardProps {
|
|
|
863
870
|
bookingLabel?: string;
|
|
864
871
|
partnerLabel?: string;
|
|
865
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;
|
|
866
885
|
};
|
|
867
886
|
/**
|
|
868
887
|
* Visual density of the card.
|
|
@@ -885,7 +904,7 @@ interface RegistrationSuccessCardProps {
|
|
|
885
904
|
lastUpdatedAt?: string;
|
|
886
905
|
};
|
|
887
906
|
}
|
|
888
|
-
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;
|
|
889
908
|
|
|
890
909
|
interface FloatingInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
891
910
|
label: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -325,6 +325,9 @@ interface BookingDepositInfo {
|
|
|
325
325
|
remainingAmount: string;
|
|
326
326
|
balanceDueDate: string;
|
|
327
327
|
isPaidInFull?: boolean;
|
|
328
|
+
/** Label da linha do depósito. Default: "Deposit". Use "Paid" em contextos
|
|
329
|
+
* pós-compra onde o valor reflete o que o cliente realmente pagou. */
|
|
330
|
+
depositLabel?: string;
|
|
328
331
|
/** Valor numérico do saldo restante (em unidade monetária). Quando fornecido,
|
|
329
332
|
* o botão "Pay remaining balance" só é renderizado se > 0.
|
|
330
333
|
* Mantém backward compat: consumers que não passam o valor conservam o
|
|
@@ -776,6 +779,10 @@ interface RegistrationFormLabels {
|
|
|
776
779
|
selectPlaceholder?: string;
|
|
777
780
|
optionalLabel?: string;
|
|
778
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;
|
|
779
786
|
}
|
|
780
787
|
interface RegistrationFormProps {
|
|
781
788
|
/** Logo shown above the title. Defaults to "/logo-planetaexo.png" (matching Offer). Pass null to hide. */
|
|
@@ -863,6 +870,18 @@ interface RegistrationSuccessCardProps {
|
|
|
863
870
|
bookingLabel?: string;
|
|
864
871
|
partnerLabel?: string;
|
|
865
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;
|
|
866
885
|
};
|
|
867
886
|
/**
|
|
868
887
|
* Visual density of the card.
|
|
@@ -885,7 +904,7 @@ interface RegistrationSuccessCardProps {
|
|
|
885
904
|
lastUpdatedAt?: string;
|
|
886
905
|
};
|
|
887
906
|
}
|
|
888
|
-
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;
|
|
889
908
|
|
|
890
909
|
interface FloatingInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
891
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,
|
|
@@ -3181,6 +3181,7 @@ function OrderSummary({
|
|
|
3181
3181
|
balanceDueLabel,
|
|
3182
3182
|
totalPaidLabel
|
|
3183
3183
|
}) {
|
|
3184
|
+
var _a;
|
|
3184
3185
|
return /* @__PURE__ */ jsxs("div", { className: "rounded-2xl border border-border bg-card p-5 lg:p-6 flex flex-col gap-4", children: [
|
|
3185
3186
|
/* @__PURE__ */ jsx("h3", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: "Order Summary" }),
|
|
3186
3187
|
/* @__PURE__ */ jsx(Separator, {}),
|
|
@@ -3268,7 +3269,8 @@ function OrderSummary({
|
|
|
3268
3269
|
depositInfo && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 rounded-lg bg-muted/50 border border-border p-4", children: [
|
|
3269
3270
|
!depositInfo.hideDepositLine && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
3270
3271
|
/* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground font-sans", children: [
|
|
3271
|
-
"Deposit
|
|
3272
|
+
(_a = depositInfo.depositLabel) != null ? _a : "Deposit",
|
|
3273
|
+
" (",
|
|
3272
3274
|
depositInfo.depositPercent,
|
|
3273
3275
|
"%)"
|
|
3274
3276
|
] }),
|
|
@@ -4848,7 +4850,9 @@ var DEFAULT_LABELS3 = {
|
|
|
4848
4850
|
nationalityLabel: "Nationality",
|
|
4849
4851
|
selectPlaceholder: "Select an option\u2026",
|
|
4850
4852
|
optionalLabel: "(optional)",
|
|
4851
|
-
requiredFieldError: "Required"
|
|
4853
|
+
requiredFieldError: "Required",
|
|
4854
|
+
dateLabel: "Date",
|
|
4855
|
+
datesLabel: "Dates"
|
|
4852
4856
|
};
|
|
4853
4857
|
var TERMS_ACCEPT_KEY = "__registrationTermsAccepted";
|
|
4854
4858
|
function emptyName() {
|
|
@@ -5459,7 +5463,7 @@ function FieldRenderer({
|
|
|
5459
5463
|
}
|
|
5460
5464
|
function RegistrationForm({
|
|
5461
5465
|
logo = "/logo-planetaexo.png",
|
|
5462
|
-
logoAlt = "
|
|
5466
|
+
logoAlt = "PlanetaEXO",
|
|
5463
5467
|
heroImage,
|
|
5464
5468
|
heroImageAlt = "",
|
|
5465
5469
|
title,
|
|
@@ -5629,7 +5633,7 @@ function RegistrationForm({
|
|
|
5629
5633
|
/* @__PURE__ */ jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: adventure.name })
|
|
5630
5634
|
] }),
|
|
5631
5635
|
dateRange && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
|
|
5632
|
-
/* @__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 }),
|
|
5633
5637
|
/* @__PURE__ */ jsx("dd", { className: "text-foreground text-right min-w-0", children: dateRange })
|
|
5634
5638
|
] }),
|
|
5635
5639
|
(adventure == null ? void 0 : adventure.partnerName) && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
|
|
@@ -5813,7 +5817,7 @@ function phoneCountryDial(code) {
|
|
|
5813
5817
|
var _a, _b;
|
|
5814
5818
|
return (_b = (_a = PHONE_COUNTRIES.find((c) => c.code === code)) == null ? void 0 : _a.dial) != null ? _b : code;
|
|
5815
5819
|
}
|
|
5816
|
-
function defaultFormatAnswer(field, value, fmtDate) {
|
|
5820
|
+
function defaultFormatAnswer(field, value, fmtDate, booleanLabels = { yes: "Yes", no: "No" }) {
|
|
5817
5821
|
var _a, _b, _c, _d, _e, _f;
|
|
5818
5822
|
if (value == null || value === "") return "\u2014";
|
|
5819
5823
|
if (value instanceof Date) return fmtDate(value);
|
|
@@ -5823,7 +5827,7 @@ function defaultFormatAnswer(field, value, fmtDate) {
|
|
|
5823
5827
|
}
|
|
5824
5828
|
return value.filter(Boolean).join(", ") || "\u2014";
|
|
5825
5829
|
}
|
|
5826
|
-
if (typeof value === "boolean") return value ?
|
|
5830
|
+
if (typeof value === "boolean") return value ? booleanLabels.yes : booleanLabels.no;
|
|
5827
5831
|
if (typeof value === "object") {
|
|
5828
5832
|
if ("contactName" in value) {
|
|
5829
5833
|
const ec = value;
|
|
@@ -5878,11 +5882,12 @@ function RegistrationSuccessCard({
|
|
|
5878
5882
|
booking,
|
|
5879
5883
|
traveller,
|
|
5880
5884
|
tripInfoLabels,
|
|
5885
|
+
booleanLabels,
|
|
5881
5886
|
density = "comfortable",
|
|
5882
5887
|
submissionTimestamps,
|
|
5883
5888
|
submissionTimestampsLabels
|
|
5884
5889
|
}) {
|
|
5885
|
-
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;
|
|
5886
5891
|
const isMinimal = variant === "minimal";
|
|
5887
5892
|
const isCompact = density === "compact";
|
|
5888
5893
|
const sorted = isMinimal ? [] : [...fields].sort((a, b) => {
|
|
@@ -5896,11 +5901,17 @@ function RegistrationSuccessCard({
|
|
|
5896
5901
|
adventureLabel: (_b = tripInfoLabels == null ? void 0 : tripInfoLabels.adventureLabel) != null ? _b : "Adventure",
|
|
5897
5902
|
bookingLabel: (_c = tripInfoLabels == null ? void 0 : tripInfoLabels.bookingLabel) != null ? _c : "Booking",
|
|
5898
5903
|
partnerLabel: (_d = tripInfoLabels == null ? void 0 : tripInfoLabels.partnerLabel) != null ? _d : "Partner",
|
|
5899
|
-
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"
|
|
5900
5911
|
};
|
|
5901
5912
|
const STL = {
|
|
5902
|
-
submittedAt: (
|
|
5903
|
-
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"
|
|
5904
5915
|
};
|
|
5905
5916
|
const hasTimestamps = !isMinimal && !!submissionTimestamps && (!!submissionTimestamps.submittedAt || !!submissionTimestamps.lastUpdatedAt);
|
|
5906
5917
|
return /* @__PURE__ */ jsxs(
|
|
@@ -5951,7 +5962,7 @@ function RegistrationSuccessCard({
|
|
|
5951
5962
|
/* @__PURE__ */ jsx("dd", { className: "w-1/2 text-foreground font-medium text-right min-w-0 break-words", children: adventure.name })
|
|
5952
5963
|
] }),
|
|
5953
5964
|
dateRange && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-x-4", children: [
|
|
5954
|
-
/* @__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 }),
|
|
5955
5966
|
/* @__PURE__ */ jsx("dd", { className: "w-1/2 text-foreground text-right min-w-0 break-words", children: dateRange })
|
|
5956
5967
|
] }),
|
|
5957
5968
|
(adventure == null ? void 0 : adventure.partnerName) && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-x-4", children: [
|
|
@@ -5969,18 +5980,18 @@ function RegistrationSuccessCard({
|
|
|
5969
5980
|
] }) }),
|
|
5970
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: [
|
|
5971
5982
|
/* @__PURE__ */ jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: f.label }),
|
|
5972
|
-
/* @__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)))(
|
|
5973
5984
|
f,
|
|
5974
5985
|
answers[f.id]
|
|
5975
5986
|
) })
|
|
5976
5987
|
] }, f.id)) }) }),
|
|
5977
|
-
!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: [
|
|
5978
5989
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
5979
5990
|
/* @__PURE__ */ jsx("div", { className: cn(
|
|
5980
5991
|
"inline-flex h-5 w-5 items-center justify-center rounded-full text-white text-xs font-bold",
|
|
5981
5992
|
terms.accepted ? "bg-primary" : "bg-destructive"
|
|
5982
5993
|
), children: terms.accepted ? "\u2713" : "\u2717" }),
|
|
5983
|
-
/* @__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" })
|
|
5984
5995
|
] }),
|
|
5985
5996
|
termsLayout === "full" && terms.markdown.trim().length > 0 && /* @__PURE__ */ jsx(
|
|
5986
5997
|
"div",
|
|
@@ -7577,7 +7588,7 @@ function SiteHeader({
|
|
|
7577
7588
|
variant = "transparent",
|
|
7578
7589
|
links = DEFAULT_HEADER_LINKS,
|
|
7579
7590
|
logoSrc = "/logo-planetaexo.png",
|
|
7580
|
-
logoAlt = "
|
|
7591
|
+
logoAlt = "PlanetaEXO",
|
|
7581
7592
|
languages = DEFAULT_LANGUAGES,
|
|
7582
7593
|
currentLanguage = "EN",
|
|
7583
7594
|
onLanguageChange,
|