@planetaexo/design-system 0.12.7 → 0.13.1

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" }),
@@ -3239,7 +3287,7 @@ function OrderSummary({
3239
3287
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-foreground font-sans", children: depositInfo.totalPaid })
3240
3288
  ] }),
3241
3289
  depositInfo && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 rounded-lg bg-muted/50 border border-border p-4", children: [
3242
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
3290
+ !depositInfo.hideDepositLine && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
3243
3291
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-muted-foreground font-sans", children: [
3244
3292
  "Deposit (",
3245
3293
  depositInfo.depositPercent,