@planetaexo/design-system 0.12.6 → 0.13.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 CHANGED
@@ -1342,16 +1342,22 @@ function AdventureCard({ adventure }) {
1342
1342
  ] }),
1343
1343
  adventure.optionals && adventure.optionals.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2 rounded-xl border border-border bg-muted/30 p-4 flex flex-col gap-3", children: [
1344
1344
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-bold text-muted-foreground font-heading uppercase tracking-widest", children: "Available optionals" }),
1345
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", children: adventure.optionals.map((opt) => /* @__PURE__ */ jsxRuntime.jsxs(
1346
- "label",
1347
- {
1348
- className: "flex items-center gap-3 cursor-pointer group",
1349
- children: [
1345
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", children: adventure.optionals.map((opt) => {
1346
+ var _a2, _b2, _c2, _d2, _e2;
1347
+ const checked = isChecked(opt);
1348
+ const minQty = (_a2 = opt.minQuantity) != null ? _a2 : 1;
1349
+ const maxQty = (_b2 = opt.maxQuantity) != null ? _b2 : 50;
1350
+ const showStepper = checked && opt.showQuantityControl !== false && opt.quantity != null && typeof opt.onQuantityChange === "function";
1351
+ const currentQty = (_c2 = opt.quantity) != null ? _c2 : minQty;
1352
+ const canDec = currentQty > minQty;
1353
+ const canInc = currentQty < maxQty;
1354
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1.5", children: [
1355
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-3 cursor-pointer group", children: [
1350
1356
  /* @__PURE__ */ jsxRuntime.jsx(
1351
1357
  "input",
1352
1358
  {
1353
1359
  type: "checkbox",
1354
- checked: isChecked(opt),
1360
+ checked,
1355
1361
  onChange: () => toggleOptional(opt),
1356
1362
  className: "h-4 w-4 shrink-0 rounded border-border accent-primary cursor-pointer"
1357
1363
  }
@@ -1365,10 +1371,52 @@ function AdventureCard({ adventure }) {
1365
1371
  ")"
1366
1372
  ] })
1367
1373
  ] })
1368
- ]
1369
- },
1370
- opt.id
1371
- )) })
1374
+ ] }),
1375
+ showStepper && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 ml-auto", children: [
1376
+ /* @__PURE__ */ jsxRuntime.jsx(
1377
+ "button",
1378
+ {
1379
+ type: "button",
1380
+ onClick: () => {
1381
+ var _a3;
1382
+ return canDec && ((_a3 = opt.onQuantityChange) == null ? void 0 : _a3.call(opt, opt.id, currentQty - 1));
1383
+ },
1384
+ disabled: !canDec,
1385
+ "aria-label": (_d2 = opt.decreaseQuantityLabel) != null ? _d2 : "Decrease quantity",
1386
+ className: cn(
1387
+ "h-7 w-7 rounded border border-border flex items-center justify-center text-sm font-semibold",
1388
+ "transition-colors",
1389
+ canDec ? "hover:bg-muted cursor-pointer text-foreground" : "opacity-40 cursor-not-allowed text-muted-foreground"
1390
+ ),
1391
+ children: "\u2212"
1392
+ }
1393
+ ),
1394
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-sans tabular-nums w-6 text-center text-foreground", children: currentQty }),
1395
+ /* @__PURE__ */ jsxRuntime.jsx(
1396
+ "button",
1397
+ {
1398
+ type: "button",
1399
+ onClick: () => {
1400
+ var _a3;
1401
+ return canInc && ((_a3 = opt.onQuantityChange) == null ? void 0 : _a3.call(opt, opt.id, currentQty + 1));
1402
+ },
1403
+ disabled: !canInc,
1404
+ "aria-label": (_e2 = opt.increaseQuantityLabel) != null ? _e2 : "Increase quantity",
1405
+ className: cn(
1406
+ "h-7 w-7 rounded border border-border flex items-center justify-center text-sm font-semibold",
1407
+ "transition-colors",
1408
+ canInc ? "hover:bg-muted cursor-pointer text-foreground" : "opacity-40 cursor-not-allowed text-muted-foreground"
1409
+ ),
1410
+ children: "+"
1411
+ }
1412
+ )
1413
+ ] }),
1414
+ opt.scheduledAtLabel && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1 text-xs text-muted-foreground font-sans", children: [
1415
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarIcon, { className: "w-3 h-3 text-primary shrink-0" }),
1416
+ opt.scheduledAtLabel
1417
+ ] })
1418
+ ] }, opt.id);
1419
+ }) })
1372
1420
  ] }),
1373
1421
  (adventure.description || adventure.detailsSlot) && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1374
1422
  /* @__PURE__ */ jsxRuntime.jsx(Separator, { className: "my-1" }),
@@ -3151,7 +3199,8 @@ function OrderSummary({
3151
3199
  subtotal,
3152
3200
  total,
3153
3201
  depositInfo,
3154
- balanceDueLabel
3202
+ balanceDueLabel,
3203
+ totalPaidLabel
3155
3204
  }) {
3156
3205
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-2xl border border-border bg-card p-5 lg:p-6 flex flex-col gap-4", children: [
3157
3206
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: "Order Summary" }),
@@ -3233,6 +3282,10 @@ function OrderSummary({
3233
3282
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-bold text-foreground font-heading", children: "Total" }),
3234
3283
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-2xl font-black text-primary font-heading", children: total })
3235
3284
  ] }),
3285
+ (depositInfo == null ? void 0 : depositInfo.totalPaid) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
3286
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground font-sans", children: totalPaidLabel != null ? totalPaidLabel : "Total paid" }),
3287
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-foreground font-sans", children: depositInfo.totalPaid })
3288
+ ] }),
3236
3289
  depositInfo && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 rounded-lg bg-muted/50 border border-border p-4", children: [
3237
3290
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
3238
3291
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-muted-foreground font-sans", children: [
@@ -3268,6 +3321,7 @@ function BookingDetails({
3268
3321
  contactSectionLabel,
3269
3322
  payBalanceLabel,
3270
3323
  balanceDueLabel,
3324
+ totalPaidLabel,
3271
3325
  cannotRemoveLastTravellerLabel,
3272
3326
  adventures,
3273
3327
  summaryLineItems,
@@ -3484,7 +3538,8 @@ function BookingDetails({
3484
3538
  subtotal,
3485
3539
  total,
3486
3540
  depositInfo,
3487
- balanceDueLabel
3541
+ balanceDueLabel,
3542
+ totalPaidLabel
3488
3543
  }
3489
3544
  ),
3490
3545
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-2xl border border-border bg-card p-5 lg:p-6 flex flex-col gap-4", children: [