@planetaexo/design-system 0.48.1 → 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 +58 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -7
- package/dist/index.d.ts +51 -7
- package/dist/index.js +59 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -219,11 +219,13 @@ function DialogContent(_a) {
|
|
|
219
219
|
var _b = _a, {
|
|
220
220
|
className,
|
|
221
221
|
children,
|
|
222
|
-
showCloseButton = true
|
|
222
|
+
showCloseButton = true,
|
|
223
|
+
closeLabel = "Close"
|
|
223
224
|
} = _b, props = __objRest(_b, [
|
|
224
225
|
"className",
|
|
225
226
|
"children",
|
|
226
|
-
"showCloseButton"
|
|
227
|
+
"showCloseButton",
|
|
228
|
+
"closeLabel"
|
|
227
229
|
]);
|
|
228
230
|
return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
|
|
229
231
|
/* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
|
|
@@ -246,7 +248,7 @@ function DialogContent(_a) {
|
|
|
246
248
|
Button2,
|
|
247
249
|
{
|
|
248
250
|
variant: "ghost",
|
|
249
|
-
className: "absolute top-2 right-2",
|
|
251
|
+
className: "absolute top-2 right-2 cursor-pointer",
|
|
250
252
|
size: "icon-sm"
|
|
251
253
|
}
|
|
252
254
|
),
|
|
@@ -255,7 +257,7 @@ function DialogContent(_a) {
|
|
|
255
257
|
lucideReact.XIcon,
|
|
256
258
|
{}
|
|
257
259
|
),
|
|
258
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children:
|
|
260
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: closeLabel })
|
|
259
261
|
]
|
|
260
262
|
}
|
|
261
263
|
)
|
|
@@ -278,10 +280,12 @@ function DialogFooter(_a) {
|
|
|
278
280
|
var _b = _a, {
|
|
279
281
|
className,
|
|
280
282
|
showCloseButton = false,
|
|
283
|
+
closeLabel = "Close",
|
|
281
284
|
children
|
|
282
285
|
} = _b, props = __objRest(_b, [
|
|
283
286
|
"className",
|
|
284
287
|
"showCloseButton",
|
|
288
|
+
"closeLabel",
|
|
285
289
|
"children"
|
|
286
290
|
]);
|
|
287
291
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -295,7 +299,7 @@ function DialogFooter(_a) {
|
|
|
295
299
|
}, props), {
|
|
296
300
|
children: [
|
|
297
301
|
children,
|
|
298
|
-
showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Close, { render: /* @__PURE__ */ jsxRuntime.jsx(Button2, { variant: "outline" }), children:
|
|
302
|
+
showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Close, { render: /* @__PURE__ */ jsxRuntime.jsx(Button2, { variant: "outline" }), children: closeLabel })
|
|
299
303
|
]
|
|
300
304
|
})
|
|
301
305
|
);
|
|
@@ -1291,11 +1295,13 @@ function AdventureCard({
|
|
|
1291
1295
|
labels,
|
|
1292
1296
|
interactionsDisabled
|
|
1293
1297
|
}) {
|
|
1294
|
-
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;
|
|
1295
1299
|
const isControlled = (_b = (_a = adventure.optionals) == null ? void 0 : _a.some((o) => o.onCheckedChange !== void 0)) != null ? _b : false;
|
|
1296
1300
|
const [checkedInternal, setCheckedInternal] = React28__namespace.useState(
|
|
1297
1301
|
new Set((_d = (_c = adventure.optionals) == null ? void 0 : _c.filter((o) => o.defaultChecked).map((o) => o.id)) != null ? _d : [])
|
|
1298
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;
|
|
1299
1305
|
const isChecked = (opt) => {
|
|
1300
1306
|
var _a2;
|
|
1301
1307
|
return isControlled ? (_a2 = opt.checked) != null ? _a2 : false : checkedInternal.has(opt.id);
|
|
@@ -1317,7 +1323,7 @@ function AdventureCard({
|
|
|
1317
1323
|
"img",
|
|
1318
1324
|
{
|
|
1319
1325
|
src: adventure.image,
|
|
1320
|
-
alt: (
|
|
1326
|
+
alt: (_f = adventure.imageAlt) != null ? _f : adventure.title,
|
|
1321
1327
|
className: "w-full h-full object-cover"
|
|
1322
1328
|
}
|
|
1323
1329
|
) }),
|
|
@@ -1332,7 +1338,7 @@ function AdventureCard({
|
|
|
1332
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",
|
|
1333
1339
|
children: [
|
|
1334
1340
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "w-3 h-3" }),
|
|
1335
|
-
(
|
|
1341
|
+
(_g = labels == null ? void 0 : labels.remove) != null ? _g : "Remove"
|
|
1336
1342
|
]
|
|
1337
1343
|
}
|
|
1338
1344
|
)
|
|
@@ -1349,9 +1355,9 @@ function AdventureCard({
|
|
|
1349
1355
|
adventure.location
|
|
1350
1356
|
] }),
|
|
1351
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: [
|
|
1352
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-bold text-muted-foreground font-heading uppercase tracking-widest", children: (
|
|
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" }),
|
|
1353
1359
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", children: adventure.optionals.map((opt) => {
|
|
1354
|
-
var _a2, _b2, _c2, _d2, _e2;
|
|
1360
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
1355
1361
|
const checked = isChecked(opt);
|
|
1356
1362
|
const minQty = (_a2 = opt.minQuantity) != null ? _a2 : 1;
|
|
1357
1363
|
const maxQty = (_b2 = opt.maxQuantity) != null ? _b2 : 50;
|
|
@@ -1359,6 +1365,7 @@ function AdventureCard({
|
|
|
1359
1365
|
const currentQty = (_c2 = opt.quantity) != null ? _c2 : minQty;
|
|
1360
1366
|
const canDec = currentQty > minQty;
|
|
1361
1367
|
const canInc = currentQty < maxQty;
|
|
1368
|
+
const hasDescription = !!((_d2 = opt.description) == null ? void 0 : _d2.trim());
|
|
1362
1369
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-wrap items-center gap-x-3 gap-y-1.5", interactionsDisabled && "opacity-60"), children: [
|
|
1363
1370
|
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: cn("flex items-center gap-3 group", interactionsDisabled ? "cursor-not-allowed" : "cursor-pointer"), children: [
|
|
1364
1371
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1384,6 +1391,19 @@ function AdventureCard({
|
|
|
1384
1391
|
] })
|
|
1385
1392
|
] })
|
|
1386
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
|
+
),
|
|
1387
1407
|
showStepper && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 ml-auto", children: [
|
|
1388
1408
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1389
1409
|
"button",
|
|
@@ -1394,7 +1414,7 @@ function AdventureCard({
|
|
|
1394
1414
|
return !interactionsDisabled && canDec && ((_a3 = opt.onQuantityChange) == null ? void 0 : _a3.call(opt, opt.id, currentQty - 1));
|
|
1395
1415
|
},
|
|
1396
1416
|
disabled: interactionsDisabled || !canDec,
|
|
1397
|
-
"aria-label": (
|
|
1417
|
+
"aria-label": (_g2 = opt.decreaseQuantityLabel) != null ? _g2 : "Decrease quantity",
|
|
1398
1418
|
className: cn(
|
|
1399
1419
|
"h-7 w-7 rounded border border-border flex items-center justify-center text-sm font-semibold",
|
|
1400
1420
|
"transition-colors",
|
|
@@ -1413,7 +1433,7 @@ function AdventureCard({
|
|
|
1413
1433
|
return !interactionsDisabled && canInc && ((_a3 = opt.onQuantityChange) == null ? void 0 : _a3.call(opt, opt.id, currentQty + 1));
|
|
1414
1434
|
},
|
|
1415
1435
|
disabled: interactionsDisabled || !canInc,
|
|
1416
|
-
"aria-label": (
|
|
1436
|
+
"aria-label": (_h2 = opt.increaseQuantityLabel) != null ? _h2 : "Increase quantity",
|
|
1417
1437
|
className: cn(
|
|
1418
1438
|
"h-7 w-7 rounded border border-border flex items-center justify-center text-sm font-semibold",
|
|
1419
1439
|
"transition-colors",
|
|
@@ -1428,12 +1448,31 @@ function AdventureCard({
|
|
|
1428
1448
|
opt.scheduledAtLabel
|
|
1429
1449
|
] })
|
|
1430
1450
|
] }, opt.id);
|
|
1431
|
-
}) })
|
|
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
|
+
)
|
|
1432
1471
|
] }),
|
|
1433
1472
|
(adventure.description || adventure.detailsSlot) && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1434
1473
|
/* @__PURE__ */ jsxRuntime.jsx(Separator, { className: "my-1" }),
|
|
1435
1474
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1436
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-bold text-muted-foreground font-heading uppercase tracking-widest mb-3", children: (
|
|
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" }),
|
|
1437
1476
|
adventure.description && !adventure.detailsSlot && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-foreground/80 leading-snug font-sans", children: adventure.description }),
|
|
1438
1477
|
adventure.detailsSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
|
|
1439
1478
|
"text-foreground",
|
|
@@ -1459,21 +1498,21 @@ function AdventureCard({
|
|
|
1459
1498
|
] })
|
|
1460
1499
|
] }),
|
|
1461
1500
|
adventure.included && adventure.included.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2.5 mt-1", children: [
|
|
1462
|
-
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (
|
|
1501
|
+
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (_p = adventure.includedLabel) != null ? _p : "What's included" }),
|
|
1463
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: [
|
|
1464
1503
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "w-4 h-4 text-primary shrink-0 mt-1" }),
|
|
1465
1504
|
item
|
|
1466
1505
|
] }, i)) })
|
|
1467
1506
|
] }),
|
|
1468
1507
|
adventure.notIncluded && adventure.notIncluded.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2.5 mt-1", children: [
|
|
1469
|
-
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (
|
|
1508
|
+
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (_q = adventure.notIncludedLabel) != null ? _q : "What's not included" }),
|
|
1470
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: [
|
|
1471
1510
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "w-4 h-4 text-destructive shrink-0 mt-1" }),
|
|
1472
1511
|
item
|
|
1473
1512
|
] }, i)) })
|
|
1474
1513
|
] }),
|
|
1475
1514
|
adventure.cancellationPolicy && adventure.cancellationPolicy.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2.5 mt-1", children: [
|
|
1476
|
-
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (
|
|
1515
|
+
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (_r = adventure.cancellationPolicyLabel) != null ? _r : "Cancellation policy" }),
|
|
1477
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: [
|
|
1478
1517
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-primary shrink-0 mt-2.5" }),
|
|
1479
1518
|
item
|
|
@@ -12046,10 +12085,9 @@ function TripHeader({
|
|
|
12046
12085
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/85 via-black/20 to-transparent" }),
|
|
12047
12086
|
siteHeader && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12048
12087
|
SiteHeader,
|
|
12049
|
-
{
|
|
12050
|
-
links: Array.isArray(siteHeader) ? siteHeader : void 0,
|
|
12088
|
+
__spreadProps(__spreadValues({}, Array.isArray(siteHeader) ? { links: siteHeader } : typeof siteHeader === "object" ? siteHeader : {}), {
|
|
12051
12089
|
position: "overlay"
|
|
12052
|
-
}
|
|
12090
|
+
})
|
|
12053
12091
|
),
|
|
12054
12092
|
!videoUrl && showCarousel && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12055
12093
|
/* @__PURE__ */ jsxRuntime.jsx(
|