@planetaexo/design-system 0.48.2 → 0.49.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
@@ -248,7 +248,7 @@ function DialogContent(_a) {
248
248
  Button2,
249
249
  {
250
250
  variant: "ghost",
251
- className: "absolute top-2 right-2",
251
+ className: "absolute top-2 right-2 cursor-pointer",
252
252
  size: "icon-sm"
253
253
  }
254
254
  ),
@@ -1295,11 +1295,13 @@ function AdventureCard({
1295
1295
  labels,
1296
1296
  interactionsDisabled
1297
1297
  }) {
1298
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
1298
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
1299
1299
  const isControlled = (_b = (_a = adventure.optionals) == null ? void 0 : _a.some((o) => o.onCheckedChange !== void 0)) != null ? _b : false;
1300
1300
  const [checkedInternal, setCheckedInternal] = React28__namespace.useState(
1301
1301
  new Set((_d = (_c = adventure.optionals) == null ? void 0 : _c.filter((o) => o.defaultChecked).map((o) => o.id)) != null ? _d : [])
1302
1302
  );
1303
+ const [openDescriptionId, setOpenDescriptionId] = React28__namespace.useState(null);
1304
+ const openDescriptionOptional = openDescriptionId ? (_e = adventure.optionals) == null ? void 0 : _e.find((o) => o.id === openDescriptionId) : void 0;
1303
1305
  const isChecked = (opt) => {
1304
1306
  var _a2;
1305
1307
  return isControlled ? (_a2 = opt.checked) != null ? _a2 : false : checkedInternal.has(opt.id);
@@ -1321,7 +1323,7 @@ function AdventureCard({
1321
1323
  "img",
1322
1324
  {
1323
1325
  src: adventure.image,
1324
- alt: (_e = adventure.imageAlt) != null ? _e : adventure.title,
1326
+ alt: (_f = adventure.imageAlt) != null ? _f : adventure.title,
1325
1327
  className: "w-full h-full object-cover"
1326
1328
  }
1327
1329
  ) }),
@@ -1336,7 +1338,7 @@ function AdventureCard({
1336
1338
  className: "flex items-center gap-1.5 rounded-full border border-border px-3 py-1 text-xs text-muted-foreground font-ui hover:border-destructive hover:text-destructive transition-colors",
1337
1339
  children: [
1338
1340
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "w-3 h-3" }),
1339
- (_f = labels == null ? void 0 : labels.remove) != null ? _f : "Remove"
1341
+ (_g = labels == null ? void 0 : labels.remove) != null ? _g : "Remove"
1340
1342
  ]
1341
1343
  }
1342
1344
  )
@@ -1353,9 +1355,9 @@ function AdventureCard({
1353
1355
  adventure.location
1354
1356
  ] }),
1355
1357
  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: [
1356
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-bold text-muted-foreground font-heading uppercase tracking-widest", children: (_g = labels == null ? void 0 : labels.availableOptionals) != null ? _g : "Available optionals" }),
1358
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-bold text-muted-foreground font-heading uppercase tracking-widest", children: (_h = labels == null ? void 0 : labels.availableOptionals) != null ? _h : "Available optionals" }),
1357
1359
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", children: adventure.optionals.map((opt) => {
1358
- var _a2, _b2, _c2, _d2, _e2;
1360
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
1359
1361
  const checked = isChecked(opt);
1360
1362
  const minQty = (_a2 = opt.minQuantity) != null ? _a2 : 1;
1361
1363
  const maxQty = (_b2 = opt.maxQuantity) != null ? _b2 : 50;
@@ -1363,6 +1365,7 @@ function AdventureCard({
1363
1365
  const currentQty = (_c2 = opt.quantity) != null ? _c2 : minQty;
1364
1366
  const canDec = currentQty > minQty;
1365
1367
  const canInc = currentQty < maxQty;
1368
+ const hasDescription = !!((_d2 = opt.description) == null ? void 0 : _d2.trim());
1366
1369
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-wrap items-center gap-x-3 gap-y-1.5", interactionsDisabled && "opacity-60"), children: [
1367
1370
  /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cn("flex items-center gap-3 group", interactionsDisabled ? "cursor-not-allowed" : "cursor-pointer"), children: [
1368
1371
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -1388,6 +1391,19 @@ function AdventureCard({
1388
1391
  ] })
1389
1392
  ] })
1390
1393
  ] }),
1394
+ hasDescription && /* @__PURE__ */ jsxRuntime.jsx(
1395
+ "button",
1396
+ {
1397
+ type: "button",
1398
+ onClick: (e) => {
1399
+ e.stopPropagation();
1400
+ setOpenDescriptionId(opt.id);
1401
+ },
1402
+ "aria-label": (_f2 = (_e2 = labels == null ? void 0 : labels.optionalInfo) == null ? void 0 : _e2.triggerAriaLabel) != null ? _f2 : "More info",
1403
+ className: "inline-flex cursor-pointer items-center justify-center text-muted-foreground hover:text-primary transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",
1404
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Info, { className: "w-4 h-4" })
1405
+ }
1406
+ ),
1391
1407
  showStepper && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 ml-auto", children: [
1392
1408
  /* @__PURE__ */ jsxRuntime.jsx(
1393
1409
  "button",
@@ -1398,7 +1414,7 @@ function AdventureCard({
1398
1414
  return !interactionsDisabled && canDec && ((_a3 = opt.onQuantityChange) == null ? void 0 : _a3.call(opt, opt.id, currentQty - 1));
1399
1415
  },
1400
1416
  disabled: interactionsDisabled || !canDec,
1401
- "aria-label": (_d2 = opt.decreaseQuantityLabel) != null ? _d2 : "Decrease quantity",
1417
+ "aria-label": (_g2 = opt.decreaseQuantityLabel) != null ? _g2 : "Decrease quantity",
1402
1418
  className: cn(
1403
1419
  "h-7 w-7 rounded border border-border flex items-center justify-center text-sm font-semibold",
1404
1420
  "transition-colors",
@@ -1417,7 +1433,7 @@ function AdventureCard({
1417
1433
  return !interactionsDisabled && canInc && ((_a3 = opt.onQuantityChange) == null ? void 0 : _a3.call(opt, opt.id, currentQty + 1));
1418
1434
  },
1419
1435
  disabled: interactionsDisabled || !canInc,
1420
- "aria-label": (_e2 = opt.increaseQuantityLabel) != null ? _e2 : "Increase quantity",
1436
+ "aria-label": (_h2 = opt.increaseQuantityLabel) != null ? _h2 : "Increase quantity",
1421
1437
  className: cn(
1422
1438
  "h-7 w-7 rounded border border-border flex items-center justify-center text-sm font-semibold",
1423
1439
  "transition-colors",
@@ -1432,12 +1448,31 @@ function AdventureCard({
1432
1448
  opt.scheduledAtLabel
1433
1449
  ] })
1434
1450
  ] }, opt.id);
1435
- }) })
1451
+ }) }),
1452
+ /* @__PURE__ */ jsxRuntime.jsx(
1453
+ Dialog,
1454
+ {
1455
+ open: openDescriptionId !== null,
1456
+ onOpenChange: (open) => !open && setOpenDescriptionId(null),
1457
+ children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "max-w-lg max-h-[85vh] overflow-y-auto p-6 sm:max-w-lg", children: [
1458
+ /* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { className: "gap-3 pr-8", children: [
1459
+ /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: "font-heading text-xl font-bold text-foreground leading-snug", children: (_i = openDescriptionOptional == null ? void 0 : openDescriptionOptional.label) != null ? _i : "" }),
1460
+ (openDescriptionOptional == null ? void 0 : openDescriptionOptional.pricePerPerson) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex w-fit items-center rounded-full bg-primary/10 px-3 py-1 text-sm font-semibold text-primary font-heading", children: openDescriptionOptional.pricePerPerson })
1461
+ ] }),
1462
+ /* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
1463
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
1464
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-bold text-muted-foreground font-heading uppercase tracking-widest", children: (_k = (_j = labels == null ? void 0 : labels.optionalInfo) == null ? void 0 : _j.descriptionLabel) != null ? _k : "Description" }),
1465
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-sans text-foreground leading-relaxed whitespace-pre-wrap", children: (_l = openDescriptionOptional == null ? void 0 : openDescriptionOptional.description) != null ? _l : "" })
1466
+ ] }),
1467
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(DialogClose, { className: "cursor-pointer px-4 py-2 rounded-lg bg-primary text-primary-foreground text-sm font-heading font-semibold hover:bg-primary/90 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: (_n = (_m = labels == null ? void 0 : labels.optionalInfo) == null ? void 0 : _m.closeLabel) != null ? _n : "Close" }) })
1468
+ ] })
1469
+ }
1470
+ )
1436
1471
  ] }),
1437
1472
  (adventure.description || adventure.detailsSlot) && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1438
1473
  /* @__PURE__ */ jsxRuntime.jsx(Separator, { className: "my-1" }),
1439
1474
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1440
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-bold text-muted-foreground font-heading uppercase tracking-widest mb-3", children: (_h = adventure.itineraryLabel) != null ? _h : "Details" }),
1475
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-bold text-muted-foreground font-heading uppercase tracking-widest mb-3", children: (_o = adventure.itineraryLabel) != null ? _o : "Details" }),
1441
1476
  adventure.description && !adventure.detailsSlot && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-foreground/80 leading-snug font-sans", children: adventure.description }),
1442
1477
  adventure.detailsSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
1443
1478
  "text-foreground",
@@ -1463,21 +1498,21 @@ function AdventureCard({
1463
1498
  ] })
1464
1499
  ] }),
1465
1500
  adventure.included && adventure.included.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2.5 mt-1", children: [
1466
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (_i = adventure.includedLabel) != null ? _i : "What's included" }),
1501
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (_p = adventure.includedLabel) != null ? _p : "What's included" }),
1467
1502
  /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-1.5", children: adventure.included.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-start gap-2 text-base text-foreground/80 font-sans", children: [
1468
1503
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "w-4 h-4 text-primary shrink-0 mt-1" }),
1469
1504
  item
1470
1505
  ] }, i)) })
1471
1506
  ] }),
1472
1507
  adventure.notIncluded && adventure.notIncluded.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2.5 mt-1", children: [
1473
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (_j = adventure.notIncludedLabel) != null ? _j : "What's not included" }),
1508
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (_q = adventure.notIncludedLabel) != null ? _q : "What's not included" }),
1474
1509
  /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-1.5", children: adventure.notIncluded.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-start gap-2 text-base text-foreground/80 font-sans", children: [
1475
1510
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "w-4 h-4 text-destructive shrink-0 mt-1" }),
1476
1511
  item
1477
1512
  ] }, i)) })
1478
1513
  ] }),
1479
1514
  adventure.cancellationPolicy && adventure.cancellationPolicy.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2.5 mt-1", children: [
1480
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (_k = adventure.cancellationPolicyLabel) != null ? _k : "Cancellation policy" }),
1515
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (_r = adventure.cancellationPolicyLabel) != null ? _r : "Cancellation policy" }),
1481
1516
  /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-1.5", children: adventure.cancellationPolicy.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-start gap-2 text-base text-muted-foreground font-sans", children: [
1482
1517
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-primary shrink-0 mt-2.5" }),
1483
1518
  item