@planetaexo/design-system 0.19.0 → 0.20.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.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 {
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 {
package/dist/index.js CHANGED
@@ -1261,7 +1261,11 @@ function Alert({ variant = "info", children, className }) {
1261
1261
  }
1262
1262
  );
1263
1263
  }
1264
- function AdventureCard({ adventure, labels }) {
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-pointer group", children: [
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
- className: "h-4 w-4 shrink-0 rounded border-border accent-primary cursor-pointer"
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
- bookHref ? /* @__PURE__ */ jsx(
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
  ] }),