@planetaexo/design-system 0.19.0 → 0.21.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 +33 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -2
- package/dist/index.d.ts +20 -2
- package/dist/index.js +33 -34
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -266,6 +266,8 @@ interface OfferProps {
|
|
|
266
266
|
* quando essa URL é informada.
|
|
267
267
|
*/
|
|
268
268
|
confirmedState?: OfferConfirmedState;
|
|
269
|
+
/** When true, opcionais (checkbox + stepper) ficam read-only. Usado em estado expirado. */
|
|
270
|
+
interactionsDisabled?: boolean;
|
|
269
271
|
className?: string;
|
|
270
272
|
}
|
|
271
273
|
interface BookingShellProps {
|
|
@@ -347,7 +349,7 @@ declare function BookingConfirmedCard({ title, email, message, onBack, backLabel
|
|
|
347
349
|
declare function OfferAdventureCard({ adventure }: {
|
|
348
350
|
adventure: OfferAdventureItem;
|
|
349
351
|
}): react_jsx_runtime.JSX.Element;
|
|
350
|
-
declare function Offer({ logo, logoAlt, title, subtitle, adventures, subtotal, total, depositInfo, agent, onContinue, continueLabel, externalBookingFlow, checkoutSlot, summaryNotesSlot, summaryDiscountLine, continueDisabled, labels, confirmedState, className, }: OfferProps): react_jsx_runtime.JSX.Element;
|
|
352
|
+
declare function Offer({ logo, logoAlt, title, subtitle, adventures, subtotal, total, depositInfo, agent, onContinue, continueLabel, externalBookingFlow, checkoutSlot, summaryNotesSlot, summaryDiscountLine, continueDisabled, labels, confirmedState, interactionsDisabled, className, }: OfferProps): react_jsx_runtime.JSX.Element;
|
|
351
353
|
|
|
352
354
|
type BookingStatus = "pending" | "confirmed" | "cancelled" | "completed" | "pendingRegistration" | "pendingPayment" | "pendingPaymentOverdue" | "complete";
|
|
353
355
|
interface BookingTraveller {
|
|
@@ -1233,8 +1235,24 @@ interface RegistrationSuccessCardProps {
|
|
|
1233
1235
|
* campos da interface são ignorados aqui.
|
|
1234
1236
|
*/
|
|
1235
1237
|
labels?: RegistrationFormLabels;
|
|
1238
|
+
/**
|
|
1239
|
+
* Override de `break-inside` da seção "Trip info" — default `"avoid"` preserva
|
|
1240
|
+
* o comportamento legado (não quebra). Em PDFs onde header + Trip info juntos
|
|
1241
|
+
* podem ultrapassar a 1ª página, passar `"auto"` deixa a quebra fluir
|
|
1242
|
+
* naturalmente em vez de empurrar a seção inteira para a página 2.
|
|
1243
|
+
*/
|
|
1244
|
+
tripInfoBreakInside?: "auto" | "avoid";
|
|
1245
|
+
/**
|
|
1246
|
+
* Tipografia do conteúdo do parágrafo de Terms & Conditions.
|
|
1247
|
+
* - `"default"` (padrão): sans-serif (`font-ui`) — usado no fluxo web.
|
|
1248
|
+
* - `"compact-serif"`: serifada (`font-serif`) menor (`text-[8pt]`,
|
|
1249
|
+
* `leading-tight`) otimizada para PDF impresso/visualização A4.
|
|
1250
|
+
* Apenas o `<p>` do conteúdo é afetado — título da seção e badge
|
|
1251
|
+
* "Accepted/Not accepted" permanecem inalterados.
|
|
1252
|
+
*/
|
|
1253
|
+
termsTypography?: "default" | "compact-serif";
|
|
1236
1254
|
}
|
|
1237
|
-
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;
|
|
1255
|
+
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, tripInfoBreakInside, termsTypography, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
1238
1256
|
|
|
1239
1257
|
interface FloatingInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
1240
1258
|
label: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -266,6 +266,8 @@ interface OfferProps {
|
|
|
266
266
|
* quando essa URL é informada.
|
|
267
267
|
*/
|
|
268
268
|
confirmedState?: OfferConfirmedState;
|
|
269
|
+
/** When true, opcionais (checkbox + stepper) ficam read-only. Usado em estado expirado. */
|
|
270
|
+
interactionsDisabled?: boolean;
|
|
269
271
|
className?: string;
|
|
270
272
|
}
|
|
271
273
|
interface BookingShellProps {
|
|
@@ -347,7 +349,7 @@ declare function BookingConfirmedCard({ title, email, message, onBack, backLabel
|
|
|
347
349
|
declare function OfferAdventureCard({ adventure }: {
|
|
348
350
|
adventure: OfferAdventureItem;
|
|
349
351
|
}): react_jsx_runtime.JSX.Element;
|
|
350
|
-
declare function Offer({ logo, logoAlt, title, subtitle, adventures, subtotal, total, depositInfo, agent, onContinue, continueLabel, externalBookingFlow, checkoutSlot, summaryNotesSlot, summaryDiscountLine, continueDisabled, labels, confirmedState, className, }: OfferProps): react_jsx_runtime.JSX.Element;
|
|
352
|
+
declare function Offer({ logo, logoAlt, title, subtitle, adventures, subtotal, total, depositInfo, agent, onContinue, continueLabel, externalBookingFlow, checkoutSlot, summaryNotesSlot, summaryDiscountLine, continueDisabled, labels, confirmedState, interactionsDisabled, className, }: OfferProps): react_jsx_runtime.JSX.Element;
|
|
351
353
|
|
|
352
354
|
type BookingStatus = "pending" | "confirmed" | "cancelled" | "completed" | "pendingRegistration" | "pendingPayment" | "pendingPaymentOverdue" | "complete";
|
|
353
355
|
interface BookingTraveller {
|
|
@@ -1233,8 +1235,24 @@ interface RegistrationSuccessCardProps {
|
|
|
1233
1235
|
* campos da interface são ignorados aqui.
|
|
1234
1236
|
*/
|
|
1235
1237
|
labels?: RegistrationFormLabels;
|
|
1238
|
+
/**
|
|
1239
|
+
* Override de `break-inside` da seção "Trip info" — default `"avoid"` preserva
|
|
1240
|
+
* o comportamento legado (não quebra). Em PDFs onde header + Trip info juntos
|
|
1241
|
+
* podem ultrapassar a 1ª página, passar `"auto"` deixa a quebra fluir
|
|
1242
|
+
* naturalmente em vez de empurrar a seção inteira para a página 2.
|
|
1243
|
+
*/
|
|
1244
|
+
tripInfoBreakInside?: "auto" | "avoid";
|
|
1245
|
+
/**
|
|
1246
|
+
* Tipografia do conteúdo do parágrafo de Terms & Conditions.
|
|
1247
|
+
* - `"default"` (padrão): sans-serif (`font-ui`) — usado no fluxo web.
|
|
1248
|
+
* - `"compact-serif"`: serifada (`font-serif`) menor (`text-[8pt]`,
|
|
1249
|
+
* `leading-tight`) otimizada para PDF impresso/visualização A4.
|
|
1250
|
+
* Apenas o `<p>` do conteúdo é afetado — título da seção e badge
|
|
1251
|
+
* "Accepted/Not accepted" permanecem inalterados.
|
|
1252
|
+
*/
|
|
1253
|
+
termsTypography?: "default" | "compact-serif";
|
|
1236
1254
|
}
|
|
1237
|
-
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;
|
|
1255
|
+
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, tripInfoBreakInside, termsTypography, }: RegistrationSuccessCardProps): react_jsx_runtime.JSX.Element;
|
|
1238
1256
|
|
|
1239
1257
|
interface FloatingInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
1240
1258
|
label: string;
|
package/dist/index.js
CHANGED
|
@@ -1261,7 +1261,11 @@ function Alert({ variant = "info", children, className }) {
|
|
|
1261
1261
|
}
|
|
1262
1262
|
);
|
|
1263
1263
|
}
|
|
1264
|
-
function AdventureCard({
|
|
1264
|
+
function AdventureCard({
|
|
1265
|
+
adventure,
|
|
1266
|
+
labels,
|
|
1267
|
+
interactionsDisabled
|
|
1268
|
+
}) {
|
|
1265
1269
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
1266
1270
|
const isControlled = (_b = (_a = adventure.optionals) == null ? void 0 : _a.some((o) => o.onCheckedChange !== void 0)) != null ? _b : false;
|
|
1267
1271
|
const [checkedInternal, setCheckedInternal] = React23.useState(
|
|
@@ -1330,15 +1334,19 @@ function AdventureCard({ adventure, labels }) {
|
|
|
1330
1334
|
const currentQty = (_c2 = opt.quantity) != null ? _c2 : minQty;
|
|
1331
1335
|
const canDec = currentQty > minQty;
|
|
1332
1336
|
const canInc = currentQty < maxQty;
|
|
1333
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1.5", children: [
|
|
1334
|
-
/* @__PURE__ */ jsxs("label", { className: "flex items-center gap-3 cursor-
|
|
1337
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-wrap items-center gap-x-3 gap-y-1.5", interactionsDisabled && "opacity-60"), children: [
|
|
1338
|
+
/* @__PURE__ */ jsxs("label", { className: cn("flex items-center gap-3 group", interactionsDisabled ? "cursor-not-allowed" : "cursor-pointer"), children: [
|
|
1335
1339
|
/* @__PURE__ */ jsx(
|
|
1336
1340
|
"input",
|
|
1337
1341
|
{
|
|
1338
1342
|
type: "checkbox",
|
|
1339
1343
|
checked,
|
|
1340
1344
|
onChange: () => toggleOptional(opt),
|
|
1341
|
-
|
|
1345
|
+
disabled: interactionsDisabled,
|
|
1346
|
+
className: cn(
|
|
1347
|
+
"h-4 w-4 shrink-0 rounded border-border accent-primary",
|
|
1348
|
+
interactionsDisabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
1349
|
+
)
|
|
1342
1350
|
}
|
|
1343
1351
|
),
|
|
1344
1352
|
/* @__PURE__ */ jsxs("span", { className: "text-sm font-sans text-foreground/80 group-hover:text-foreground transition-colors leading-snug", children: [
|
|
@@ -1358,14 +1366,14 @@ function AdventureCard({ adventure, labels }) {
|
|
|
1358
1366
|
type: "button",
|
|
1359
1367
|
onClick: () => {
|
|
1360
1368
|
var _a3;
|
|
1361
|
-
return canDec && ((_a3 = opt.onQuantityChange) == null ? void 0 : _a3.call(opt, opt.id, currentQty - 1));
|
|
1369
|
+
return !interactionsDisabled && canDec && ((_a3 = opt.onQuantityChange) == null ? void 0 : _a3.call(opt, opt.id, currentQty - 1));
|
|
1362
1370
|
},
|
|
1363
|
-
disabled: !canDec,
|
|
1371
|
+
disabled: interactionsDisabled || !canDec,
|
|
1364
1372
|
"aria-label": (_d2 = opt.decreaseQuantityLabel) != null ? _d2 : "Decrease quantity",
|
|
1365
1373
|
className: cn(
|
|
1366
1374
|
"h-7 w-7 rounded border border-border flex items-center justify-center text-sm font-semibold",
|
|
1367
1375
|
"transition-colors",
|
|
1368
|
-
canDec ? "hover:bg-muted cursor-pointer text-foreground" : "opacity-40 cursor-not-allowed text-muted-foreground"
|
|
1376
|
+
interactionsDisabled ? "opacity-40 cursor-not-allowed text-muted-foreground" : canDec ? "hover:bg-muted cursor-pointer text-foreground" : "opacity-40 cursor-not-allowed text-muted-foreground"
|
|
1369
1377
|
),
|
|
1370
1378
|
children: "\u2212"
|
|
1371
1379
|
}
|
|
@@ -1377,14 +1385,14 @@ function AdventureCard({ adventure, labels }) {
|
|
|
1377
1385
|
type: "button",
|
|
1378
1386
|
onClick: () => {
|
|
1379
1387
|
var _a3;
|
|
1380
|
-
return canInc && ((_a3 = opt.onQuantityChange) == null ? void 0 : _a3.call(opt, opt.id, currentQty + 1));
|
|
1388
|
+
return !interactionsDisabled && canInc && ((_a3 = opt.onQuantityChange) == null ? void 0 : _a3.call(opt, opt.id, currentQty + 1));
|
|
1381
1389
|
},
|
|
1382
|
-
disabled: !canInc,
|
|
1390
|
+
disabled: interactionsDisabled || !canInc,
|
|
1383
1391
|
"aria-label": (_e2 = opt.increaseQuantityLabel) != null ? _e2 : "Increase quantity",
|
|
1384
1392
|
className: cn(
|
|
1385
1393
|
"h-7 w-7 rounded border border-border flex items-center justify-center text-sm font-semibold",
|
|
1386
1394
|
"transition-colors",
|
|
1387
|
-
canInc ? "hover:bg-muted cursor-pointer text-foreground" : "opacity-40 cursor-not-allowed text-muted-foreground"
|
|
1395
|
+
interactionsDisabled ? "opacity-40 cursor-not-allowed text-muted-foreground" : canInc ? "hover:bg-muted cursor-pointer text-foreground" : "opacity-40 cursor-not-allowed text-muted-foreground"
|
|
1388
1396
|
),
|
|
1389
1397
|
children: "+"
|
|
1390
1398
|
}
|
|
@@ -1456,28 +1464,16 @@ function OfferSidebar({
|
|
|
1456
1464
|
bookLabel,
|
|
1457
1465
|
bookDisabled,
|
|
1458
1466
|
labels,
|
|
1459
|
-
bookHref
|
|
1460
|
-
bookHrefLabel
|
|
1467
|
+
bookHref
|
|
1461
1468
|
}) {
|
|
1462
1469
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
1463
1470
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
1464
|
-
/* @__PURE__ */ jsxs("div", { className: "hidden lg:flex rounded-2xl border border-border bg-card p-5 flex-col gap-4", children: [
|
|
1471
|
+
!bookHref && /* @__PURE__ */ jsxs("div", { className: "hidden lg:flex rounded-2xl border border-border bg-card p-5 flex-col gap-4", children: [
|
|
1465
1472
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
1466
1473
|
/* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-widest text-muted-foreground font-heading mb-1", children: (_a = labels == null ? void 0 : labels.bookingTotal) != null ? _a : "Booking Total" }),
|
|
1467
1474
|
/* @__PURE__ */ jsx("p", { className: "text-3xl font-black text-primary font-heading leading-none", children: total })
|
|
1468
1475
|
] }),
|
|
1469
|
-
|
|
1470
|
-
"a",
|
|
1471
|
-
{
|
|
1472
|
-
href: bookHref,
|
|
1473
|
-
className: cn(
|
|
1474
|
-
"w-full inline-flex items-center justify-center rounded-full bg-primary py-3 text-sm font-bold tracking-wide uppercase",
|
|
1475
|
-
"text-primary-foreground font-heading transition-colors hover:bg-primary/90",
|
|
1476
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
1477
|
-
),
|
|
1478
|
-
children: bookHrefLabel != null ? bookHrefLabel : bookLabel
|
|
1479
|
-
}
|
|
1480
|
-
) : /* @__PURE__ */ jsx(
|
|
1476
|
+
/* @__PURE__ */ jsx(
|
|
1481
1477
|
"button",
|
|
1482
1478
|
{
|
|
1483
1479
|
type: "button",
|
|
@@ -2235,6 +2231,7 @@ function Offer({
|
|
|
2235
2231
|
continueDisabled,
|
|
2236
2232
|
labels,
|
|
2237
2233
|
confirmedState,
|
|
2234
|
+
interactionsDisabled,
|
|
2238
2235
|
className
|
|
2239
2236
|
}) {
|
|
2240
2237
|
var _a, _b, _c;
|
|
@@ -2269,7 +2266,7 @@ function Offer({
|
|
|
2269
2266
|
/* @__PURE__ */ jsx(MapIcon, { className: "w-5 h-5 text-primary shrink-0" }),
|
|
2270
2267
|
/* @__PURE__ */ jsx("h2", { className: "font-bold text-foreground font-heading text-base", children: (_b = labels == null ? void 0 : labels.includedAdventures) != null ? _b : "Included Adventures" })
|
|
2271
2268
|
] }),
|
|
2272
|
-
adventures.map((adventure) => /* @__PURE__ */ jsx(AdventureCard, { adventure, labels }, adventure.id))
|
|
2269
|
+
adventures.map((adventure) => /* @__PURE__ */ jsx(AdventureCard, { adventure, labels, interactionsDisabled }, adventure.id))
|
|
2273
2270
|
] }),
|
|
2274
2271
|
!isShowingCheckout && /* @__PURE__ */ jsx(
|
|
2275
2272
|
OfferSummarySection,
|
|
@@ -2306,8 +2303,7 @@ function Offer({
|
|
|
2306
2303
|
bookLabel: continueLabel,
|
|
2307
2304
|
bookDisabled: continueDisabled,
|
|
2308
2305
|
labels,
|
|
2309
|
-
bookHref: confirmedState == null ? void 0 : confirmedState.viewBookingHref
|
|
2310
|
-
bookHrefLabel: confirmedState == null ? void 0 : confirmedState.viewBookingLabel
|
|
2306
|
+
bookHref: confirmedState == null ? void 0 : confirmedState.viewBookingHref
|
|
2311
2307
|
}
|
|
2312
2308
|
) })
|
|
2313
2309
|
] }),
|
|
@@ -5164,13 +5160,14 @@ function formatDateRange(adventure, fmt) {
|
|
|
5164
5160
|
function FormSection2({
|
|
5165
5161
|
title,
|
|
5166
5162
|
children,
|
|
5167
|
-
className
|
|
5163
|
+
className,
|
|
5164
|
+
breakInside = "avoid"
|
|
5168
5165
|
}) {
|
|
5169
5166
|
return /* @__PURE__ */ jsxs(
|
|
5170
5167
|
"div",
|
|
5171
5168
|
{
|
|
5172
5169
|
className: cn("flex flex-col gap-5", className),
|
|
5173
|
-
style: { breakInside
|
|
5170
|
+
style: { breakInside },
|
|
5174
5171
|
children: [
|
|
5175
5172
|
/* @__PURE__ */ jsxs(
|
|
5176
5173
|
"div",
|
|
@@ -6106,7 +6103,9 @@ function RegistrationSuccessCard({
|
|
|
6106
6103
|
density = "comfortable",
|
|
6107
6104
|
submissionTimestamps,
|
|
6108
6105
|
submissionTimestampsLabels,
|
|
6109
|
-
labels: scLabels
|
|
6106
|
+
labels: scLabels,
|
|
6107
|
+
tripInfoBreakInside = "avoid",
|
|
6108
|
+
termsTypography = "default"
|
|
6110
6109
|
}) {
|
|
6111
6110
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
6112
6111
|
const isMinimal = variant === "minimal";
|
|
@@ -6171,7 +6170,7 @@ function RegistrationSuccessCard({
|
|
|
6171
6170
|
/* @__PURE__ */ jsx("span", { className: "tabular-nums", children: submissionTimestamps.lastUpdatedAt })
|
|
6172
6171
|
] })
|
|
6173
6172
|
] }),
|
|
6174
|
-
hasTripInfo && /* @__PURE__ */ jsx(FormSection2, { title: TL.sectionTitle, children: /* @__PURE__ */ jsxs("dl", { className: "flex flex-col gap-y-3 text-sm font-ui", children: [
|
|
6173
|
+
hasTripInfo && /* @__PURE__ */ jsx(FormSection2, { title: TL.sectionTitle, breakInside: tripInfoBreakInside, children: /* @__PURE__ */ jsxs("dl", { className: "flex flex-col gap-y-3 text-sm font-ui", children: [
|
|
6175
6174
|
adventure && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-x-4", children: [
|
|
6176
6175
|
/* @__PURE__ */ jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: TL.adventureLabel }),
|
|
6177
6176
|
/* @__PURE__ */ jsx("dd", { className: "w-1/2 text-foreground font-medium text-right min-w-0 break-words", children: adventure.name })
|
|
@@ -6223,8 +6222,8 @@ function RegistrationSuccessCard({
|
|
|
6223
6222
|
"p",
|
|
6224
6223
|
{
|
|
6225
6224
|
className: cn(
|
|
6226
|
-
"whitespace-pre-wrap break-words text-foreground
|
|
6227
|
-
isCompact ? "text-xs leading-snug" : "text-sm leading-relaxed"
|
|
6225
|
+
"whitespace-pre-wrap break-words text-foreground",
|
|
6226
|
+
termsTypography === "compact-serif" ? "font-serif text-[8pt] leading-tight" : cn("font-ui", isCompact ? "text-xs leading-snug" : "text-sm leading-relaxed")
|
|
6228
6227
|
),
|
|
6229
6228
|
children: terms.markdown
|
|
6230
6229
|
}
|