@planetaexo/design-system 0.16.0 → 0.18.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 +41 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -2
- package/dist/index.d.ts +26 -2
- package/dist/index.js +41 -29
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -676,6 +676,12 @@ interface BookingConfirmationLabels {
|
|
|
676
676
|
paidInFullLabel?: string;
|
|
677
677
|
footerMessage?: string;
|
|
678
678
|
footerContact?: (agent: string) => string;
|
|
679
|
+
/**
|
|
680
|
+
* Mensagem opcional renderizada antes do CTA quando `flow="manual"`. Usado
|
|
681
|
+
* para variantes de e-mail enviadas pelo agente manualmente (ex.: "You can
|
|
682
|
+
* access your booking at any time through the link below."). Default vazio.
|
|
683
|
+
*/
|
|
684
|
+
closingMessage?: string;
|
|
679
685
|
}
|
|
680
686
|
interface ConfirmationLineItem {
|
|
681
687
|
label: string;
|
|
@@ -752,8 +758,16 @@ interface BookingConfirmationProps {
|
|
|
752
758
|
labels?: Partial<BookingConfirmationLabels>;
|
|
753
759
|
/** className adicional no container */
|
|
754
760
|
className?: string;
|
|
761
|
+
/**
|
|
762
|
+
* Variante de fluxo de envio:
|
|
763
|
+
* - `"auto"` (default) — fluxo normal (greeting + confirmação + intro + CTA topo + nextSteps + booking + footer com agente).
|
|
764
|
+
* - `"manual"` — variante para reenvio manual pelo agente: oculta `nextSteps`,
|
|
765
|
+
* oculta CTA do topo, oculta `footerMessage`/`footerContact`, e renderiza
|
|
766
|
+
* `closingMessage` + CTA ao FINAL do corpo.
|
|
767
|
+
*/
|
|
768
|
+
flow?: "auto" | "manual";
|
|
755
769
|
}
|
|
756
|
-
declare function BookingConfirmation({ recipientName, logoUrl, bookingReference, adventures, summaryLineItems, subtotal, total, depositInfo, agent, viewBookingUrl, labels, className, }: BookingConfirmationProps): react_jsx_runtime.JSX.Element;
|
|
770
|
+
declare function BookingConfirmation({ recipientName, logoUrl, bookingReference, adventures, summaryLineItems, subtotal, total, depositInfo, agent, viewBookingUrl, labels, className, flow, }: BookingConfirmationProps): react_jsx_runtime.JSX.Element;
|
|
757
771
|
|
|
758
772
|
interface BookingConfirmationEmailLabels {
|
|
759
773
|
ctaButton?: string;
|
|
@@ -1111,6 +1125,16 @@ interface RegistrationSuccessCardProps {
|
|
|
1111
1125
|
/** Logo URL displayed above the title. Pass `null` to hide the logo. */
|
|
1112
1126
|
logo?: string | null;
|
|
1113
1127
|
logoAlt?: string;
|
|
1128
|
+
/**
|
|
1129
|
+
* Controls the green success check icon rendered above the title.
|
|
1130
|
+
* - `undefined` (default): legacy behavior — check renders only when `logo === undefined`
|
|
1131
|
+
* (i.e. only when no logo is passed at all). Preserves backward compatibility for
|
|
1132
|
+
* callers that pass a custom `logo` URL expecting it to replace the check.
|
|
1133
|
+
* - `true`: always renders the check icon, independently of `logo`. Use this when you
|
|
1134
|
+
* want a standalone logo (rendered outside the card) but still want the check inside.
|
|
1135
|
+
* - `false`: never renders the check icon.
|
|
1136
|
+
*/
|
|
1137
|
+
showSuccessIcon?: boolean;
|
|
1114
1138
|
/** Terms section rendered at the bottom of the card. */
|
|
1115
1139
|
terms?: {
|
|
1116
1140
|
markdown: string;
|
|
@@ -1167,7 +1191,7 @@ interface RegistrationSuccessCardProps {
|
|
|
1167
1191
|
*/
|
|
1168
1192
|
labels?: RegistrationFormLabels;
|
|
1169
1193
|
}
|
|
1170
|
-
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, labels: scLabels, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
1194
|
+
declare function RegistrationSuccessCard({ variant, title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, className, actions, logo, logoAlt, showSuccessIcon, terms, termsLayout, termsLabels, adventure, booking, traveller, tripInfoLabels, density, submissionTimestamps, submissionTimestampsLabels, labels: scLabels, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
1171
1195
|
|
|
1172
1196
|
interface FloatingInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
1173
1197
|
label: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -676,6 +676,12 @@ interface BookingConfirmationLabels {
|
|
|
676
676
|
paidInFullLabel?: string;
|
|
677
677
|
footerMessage?: string;
|
|
678
678
|
footerContact?: (agent: string) => string;
|
|
679
|
+
/**
|
|
680
|
+
* Mensagem opcional renderizada antes do CTA quando `flow="manual"`. Usado
|
|
681
|
+
* para variantes de e-mail enviadas pelo agente manualmente (ex.: "You can
|
|
682
|
+
* access your booking at any time through the link below."). Default vazio.
|
|
683
|
+
*/
|
|
684
|
+
closingMessage?: string;
|
|
679
685
|
}
|
|
680
686
|
interface ConfirmationLineItem {
|
|
681
687
|
label: string;
|
|
@@ -752,8 +758,16 @@ interface BookingConfirmationProps {
|
|
|
752
758
|
labels?: Partial<BookingConfirmationLabels>;
|
|
753
759
|
/** className adicional no container */
|
|
754
760
|
className?: string;
|
|
761
|
+
/**
|
|
762
|
+
* Variante de fluxo de envio:
|
|
763
|
+
* - `"auto"` (default) — fluxo normal (greeting + confirmação + intro + CTA topo + nextSteps + booking + footer com agente).
|
|
764
|
+
* - `"manual"` — variante para reenvio manual pelo agente: oculta `nextSteps`,
|
|
765
|
+
* oculta CTA do topo, oculta `footerMessage`/`footerContact`, e renderiza
|
|
766
|
+
* `closingMessage` + CTA ao FINAL do corpo.
|
|
767
|
+
*/
|
|
768
|
+
flow?: "auto" | "manual";
|
|
755
769
|
}
|
|
756
|
-
declare function BookingConfirmation({ recipientName, logoUrl, bookingReference, adventures, summaryLineItems, subtotal, total, depositInfo, agent, viewBookingUrl, labels, className, }: BookingConfirmationProps): react_jsx_runtime.JSX.Element;
|
|
770
|
+
declare function BookingConfirmation({ recipientName, logoUrl, bookingReference, adventures, summaryLineItems, subtotal, total, depositInfo, agent, viewBookingUrl, labels, className, flow, }: BookingConfirmationProps): react_jsx_runtime.JSX.Element;
|
|
757
771
|
|
|
758
772
|
interface BookingConfirmationEmailLabels {
|
|
759
773
|
ctaButton?: string;
|
|
@@ -1111,6 +1125,16 @@ interface RegistrationSuccessCardProps {
|
|
|
1111
1125
|
/** Logo URL displayed above the title. Pass `null` to hide the logo. */
|
|
1112
1126
|
logo?: string | null;
|
|
1113
1127
|
logoAlt?: string;
|
|
1128
|
+
/**
|
|
1129
|
+
* Controls the green success check icon rendered above the title.
|
|
1130
|
+
* - `undefined` (default): legacy behavior — check renders only when `logo === undefined`
|
|
1131
|
+
* (i.e. only when no logo is passed at all). Preserves backward compatibility for
|
|
1132
|
+
* callers that pass a custom `logo` URL expecting it to replace the check.
|
|
1133
|
+
* - `true`: always renders the check icon, independently of `logo`. Use this when you
|
|
1134
|
+
* want a standalone logo (rendered outside the card) but still want the check inside.
|
|
1135
|
+
* - `false`: never renders the check icon.
|
|
1136
|
+
*/
|
|
1137
|
+
showSuccessIcon?: boolean;
|
|
1114
1138
|
/** Terms section rendered at the bottom of the card. */
|
|
1115
1139
|
terms?: {
|
|
1116
1140
|
markdown: string;
|
|
@@ -1167,7 +1191,7 @@ interface RegistrationSuccessCardProps {
|
|
|
1167
1191
|
*/
|
|
1168
1192
|
labels?: RegistrationFormLabels;
|
|
1169
1193
|
}
|
|
1170
|
-
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, labels: scLabels, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
1194
|
+
declare function RegistrationSuccessCard({ variant, title, message, answersTitle, fields, answers, dateFormatter, formatAnswer, className, actions, logo, logoAlt, showSuccessIcon, terms, termsLayout, termsLabels, adventure, booking, traveller, tripInfoLabels, density, submissionTimestamps, submissionTimestampsLabels, labels: scLabels, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
1171
1195
|
|
|
1172
1196
|
interface FloatingInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
1173
1197
|
label: string;
|
package/dist/index.js
CHANGED
|
@@ -3787,7 +3787,8 @@ var DEFAULT_LABELS = {
|
|
|
3787
3787
|
balanceDueLabel: "Balance due",
|
|
3788
3788
|
paidInFullLabel: "\u2705 Paid in full",
|
|
3789
3789
|
footerMessage: "All travellers have been registered for this booking. Each person will receive a separate email with their individual details and any pre-departure information.",
|
|
3790
|
-
footerContact: (agent) => `If you have any questions, just reply to this email or contact ${agent} \u2014 happy to help
|
|
3790
|
+
footerContact: (agent) => `If you have any questions, just reply to this email or contact ${agent} \u2014 happy to help.`,
|
|
3791
|
+
closingMessage: "You can access your booking at any time through the link below."
|
|
3791
3792
|
};
|
|
3792
3793
|
function BookingConfirmation({
|
|
3793
3794
|
recipientName,
|
|
@@ -3801,13 +3802,15 @@ function BookingConfirmation({
|
|
|
3801
3802
|
agent,
|
|
3802
3803
|
viewBookingUrl,
|
|
3803
3804
|
labels,
|
|
3804
|
-
className
|
|
3805
|
+
className,
|
|
3806
|
+
flow = "auto"
|
|
3805
3807
|
}) {
|
|
3806
3808
|
const l = __spreadValues(__spreadValues({}, DEFAULT_LABELS), labels);
|
|
3807
3809
|
const allTravellers = adventures.flatMap((a) => {
|
|
3808
3810
|
var _a;
|
|
3809
3811
|
return (_a = a.travellers) != null ? _a : [];
|
|
3810
3812
|
});
|
|
3813
|
+
const isManualFlow = flow === "manual";
|
|
3811
3814
|
const ctaStyle = {
|
|
3812
3815
|
display: "inline-block",
|
|
3813
3816
|
backgroundColor: emailTokens.primary,
|
|
@@ -3840,31 +3843,33 @@ function BookingConfirmation({
|
|
|
3840
3843
|
/* @__PURE__ */ jsx(EmailLogo, { src: logoUrl, alt: l.logoAlt, paddingTop: "40px", paddingX: "32px" }),
|
|
3841
3844
|
/* @__PURE__ */ jsxs("div", { style: { paddingLeft: "32px", paddingRight: "32px" }, children: [
|
|
3842
3845
|
/* @__PURE__ */ jsx("p", { style: { marginBottom: "20px", marginTop: 0, fontSize: "16px" }, children: l.greeting(recipientName) }),
|
|
3843
|
-
/* @__PURE__ */ jsx("p", { style: { marginBottom: "20px", marginTop: 0, fontSize: "16px" }, children: l.confirmationMessage }),
|
|
3844
|
-
/* @__PURE__ */ jsx("p", { style: { marginBottom: "32px", marginTop: 0, fontSize: "16px" }, children: l.detailsIntro }),
|
|
3845
|
-
/* @__PURE__ */ jsx("div", { style: { marginBottom: "40px" }, children: ViewBookingCta })
|
|
3846
|
+
/* @__PURE__ */ jsx("p", { style: { marginBottom: isManualFlow ? "32px" : "20px", marginTop: 0, fontSize: "16px" }, children: l.confirmationMessage }),
|
|
3847
|
+
!isManualFlow && /* @__PURE__ */ jsx("p", { style: { marginBottom: "32px", marginTop: 0, fontSize: "16px" }, children: l.detailsIntro }),
|
|
3848
|
+
!isManualFlow && /* @__PURE__ */ jsx("div", { style: { marginBottom: "40px" }, children: ViewBookingCta })
|
|
3846
3849
|
] }),
|
|
3847
3850
|
/* @__PURE__ */ jsx("hr", { style: { border: "none", borderTop: `1px solid ${emailTokens.border}`, margin: "0 32px" } }),
|
|
3848
|
-
/* @__PURE__ */ jsxs(
|
|
3849
|
-
/* @__PURE__ */
|
|
3850
|
-
|
|
3851
|
-
/* @__PURE__ */ jsx("
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3851
|
+
!isManualFlow && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3852
|
+
/* @__PURE__ */ jsxs("div", { style: { paddingLeft: "32px", paddingRight: "32px", paddingTop: "32px", paddingBottom: "32px" }, children: [
|
|
3853
|
+
/* @__PURE__ */ jsx("p", { style: { marginTop: 0, marginBottom: "20px", fontWeight: "700", color: emailTokens.foreground, fontSize: "18px", fontFamily: emailTokens.fontFamily }, children: l.nextStepsHeading }),
|
|
3854
|
+
/* @__PURE__ */ jsx("div", { style: { borderRadius: "12px", border: `1px solid ${emailTokens.border}`, padding: "20px" }, children: l.nextSteps.map((step, i) => /* @__PURE__ */ jsx("table", { cellPadding: "0", cellSpacing: "0", style: { borderCollapse: "collapse", width: "100%", marginBottom: i < l.nextSteps.length - 1 ? "16px" : "0" }, children: /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
3855
|
+
/* @__PURE__ */ jsx("td", { style: { verticalAlign: "top", width: "32px", paddingRight: "14px" }, children: /* @__PURE__ */ jsx("span", { style: {
|
|
3856
|
+
display: "inline-block",
|
|
3857
|
+
height: "24px",
|
|
3858
|
+
width: "24px",
|
|
3859
|
+
lineHeight: "24px",
|
|
3860
|
+
textAlign: "center",
|
|
3861
|
+
borderRadius: "9999px",
|
|
3862
|
+
backgroundColor: emailTokens.primaryLight,
|
|
3863
|
+
fontSize: "12px",
|
|
3864
|
+
fontWeight: "700",
|
|
3865
|
+
color: emailTokens.primary,
|
|
3866
|
+
marginTop: "2px"
|
|
3867
|
+
}, children: i + 1 }) }),
|
|
3868
|
+
/* @__PURE__ */ jsx("td", { style: { verticalAlign: "top" }, children: /* @__PURE__ */ jsx("p", { style: { fontSize: "14px", color: emailTokens.bodyText, lineHeight: "1.6", margin: 0 }, children: step }) })
|
|
3869
|
+
] }) }) }, i)) })
|
|
3870
|
+
] }),
|
|
3871
|
+
/* @__PURE__ */ jsx("hr", { style: { border: "none", borderTop: `1px solid ${emailTokens.border}`, margin: "0 32px" } })
|
|
3866
3872
|
] }),
|
|
3867
|
-
/* @__PURE__ */ jsx("hr", { style: { border: "none", borderTop: `1px solid ${emailTokens.border}`, margin: "0 32px" } }),
|
|
3868
3873
|
/* @__PURE__ */ jsxs("div", { style: { paddingLeft: "32px", paddingRight: "32px", paddingTop: "32px", paddingBottom: "32px" }, children: [
|
|
3869
3874
|
/* @__PURE__ */ jsx("p", { style: { marginTop: 0, marginBottom: "20px", fontWeight: "700", color: emailTokens.foreground, fontSize: "18px", fontFamily: emailTokens.fontFamily }, children: l.bookingSummaryHeading }),
|
|
3870
3875
|
/* @__PURE__ */ jsx("div", { style: { borderRadius: "12px", border: `1px solid ${emailTokens.border}`, overflow: "hidden" }, children: /* @__PURE__ */ jsx("table", { style: { width: "100%", fontSize: "14px", borderCollapse: "collapse" }, children: /* @__PURE__ */ jsxs("tbody", { children: [
|
|
@@ -4028,11 +4033,11 @@ function BookingConfirmation({
|
|
|
4028
4033
|
/* @__PURE__ */ jsx("td", { style: { padding: "10px 16px", color: emailTokens.mutedForeground }, children: l.depositLabel(depositInfo.depositPercent) }),
|
|
4029
4034
|
/* @__PURE__ */ jsx("td", { style: { padding: "10px 16px", textAlign: "right", fontWeight: "500", color: emailTokens.foreground, whiteSpace: "nowrap" }, children: depositInfo.depositAmount })
|
|
4030
4035
|
] }),
|
|
4031
|
-
/* @__PURE__ */ jsxs("tr", { style: { borderBottom: `1px solid ${emailTokens.border}` }, children: [
|
|
4036
|
+
/* @__PURE__ */ jsxs("tr", { style: depositInfo.isPaidInFull ? {} : { borderBottom: `1px solid ${emailTokens.border}` }, children: [
|
|
4032
4037
|
/* @__PURE__ */ jsx("td", { style: { padding: "10px 16px", color: emailTokens.mutedForeground }, children: l.remainingBalanceLabel }),
|
|
4033
4038
|
/* @__PURE__ */ jsx("td", { style: { padding: "10px 16px", textAlign: "right", fontWeight: "500", color: emailTokens.foreground, whiteSpace: "nowrap" }, children: depositInfo.remainingAmount })
|
|
4034
4039
|
] }),
|
|
4035
|
-
/* @__PURE__ */ jsxs("tr", {
|
|
4040
|
+
!depositInfo.isPaidInFull && /* @__PURE__ */ jsxs("tr", { children: [
|
|
4036
4041
|
/* @__PURE__ */ jsx("td", { style: { padding: "10px 16px", color: emailTokens.mutedForeground }, children: l.balanceDueLabel }),
|
|
4037
4042
|
/* @__PURE__ */ jsx("td", { style: { padding: "10px 16px", textAlign: "right", fontWeight: "500", color: emailTokens.foreground, whiteSpace: "nowrap" }, children: depositInfo.balanceDueDate })
|
|
4038
4043
|
] }),
|
|
@@ -4041,10 +4046,16 @@ function BookingConfirmation({
|
|
|
4041
4046
|
] })
|
|
4042
4047
|
] }),
|
|
4043
4048
|
/* @__PURE__ */ jsx("hr", { style: { border: "none", borderTop: `1px solid ${emailTokens.border}`, margin: "0 32px" } }),
|
|
4044
|
-
/* @__PURE__ */
|
|
4049
|
+
/* @__PURE__ */ jsx("div", { style: { paddingLeft: "32px", paddingRight: "32px", paddingTop: "32px", paddingBottom: "40px" }, children: isManualFlow ? (
|
|
4050
|
+
// Manual flow: closing message + CTA no rodapé (substitui footerMessage/footerContact).
|
|
4051
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4052
|
+
/* @__PURE__ */ jsx("p", { style: { marginTop: 0, marginBottom: "32px", fontSize: "16px" }, children: l.closingMessage }),
|
|
4053
|
+
/* @__PURE__ */ jsx("div", { children: ViewBookingCta })
|
|
4054
|
+
] })
|
|
4055
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4045
4056
|
/* @__PURE__ */ jsx("p", { style: { marginTop: 0, marginBottom: "20px", fontSize: "16px" }, children: l.footerMessage }),
|
|
4046
4057
|
/* @__PURE__ */ jsx("p", { style: { marginTop: 0, marginBottom: 0, fontSize: "16px" }, children: l.footerContact(agent) })
|
|
4047
|
-
] })
|
|
4058
|
+
] }) })
|
|
4048
4059
|
]
|
|
4049
4060
|
}
|
|
4050
4061
|
);
|
|
@@ -6034,6 +6045,7 @@ function RegistrationSuccessCard({
|
|
|
6034
6045
|
actions,
|
|
6035
6046
|
logo,
|
|
6036
6047
|
logoAlt = "PlanetaEXO",
|
|
6048
|
+
showSuccessIcon,
|
|
6037
6049
|
terms,
|
|
6038
6050
|
termsLayout = "summary",
|
|
6039
6051
|
termsLabels,
|
|
@@ -6087,7 +6099,7 @@ function RegistrationSuccessCard({
|
|
|
6087
6099
|
className: "h-10 w-auto object-contain"
|
|
6088
6100
|
}
|
|
6089
6101
|
),
|
|
6090
|
-
logo === void 0 && /* @__PURE__ */ jsx("div", { className: "inline-flex h-14 w-14 items-center justify-center rounded-full bg-primary/10 text-primary", children: /* @__PURE__ */ jsx(CircleCheckIcon, { size: 28 }) }),
|
|
6102
|
+
(showSuccessIcon != null ? showSuccessIcon : logo === void 0) && /* @__PURE__ */ jsx("div", { className: "inline-flex h-14 w-14 items-center justify-center rounded-full bg-primary/10 text-primary", children: /* @__PURE__ */ jsx(CircleCheckIcon, { size: 28 }) }),
|
|
6091
6103
|
/* @__PURE__ */ jsx("h2", { className: "text-2xl font-black uppercase tracking-wide text-foreground font-heading leading-tight", children: title }),
|
|
6092
6104
|
message && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground font-ui", children: message })
|
|
6093
6105
|
] }),
|