@planetaexo/design-system 0.8.0 → 0.9.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 +52 -63
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +52 -63
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -284,6 +284,10 @@ interface BookingAdventure {
|
|
|
284
284
|
formName?: string;
|
|
285
285
|
/** Quando true, desabilita o botão "Add contact as traveller" desta aventura. */
|
|
286
286
|
addContactAsTravellerDisabled?: boolean;
|
|
287
|
+
/** Texto do botão "Add traveller" (desktop). Default: "More travellers". */
|
|
288
|
+
addTravellerLabel?: string;
|
|
289
|
+
/** Texto curto exibido em mobile (sm:hidden). Default: "Add". */
|
|
290
|
+
addTravellerShortLabel?: string;
|
|
287
291
|
}
|
|
288
292
|
interface BookingContact {
|
|
289
293
|
name: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -284,6 +284,10 @@ interface BookingAdventure {
|
|
|
284
284
|
formName?: string;
|
|
285
285
|
/** Quando true, desabilita o botão "Add contact as traveller" desta aventura. */
|
|
286
286
|
addContactAsTravellerDisabled?: boolean;
|
|
287
|
+
/** Texto do botão "Add traveller" (desktop). Default: "More travellers". */
|
|
288
|
+
addTravellerLabel?: string;
|
|
289
|
+
/** Texto curto exibido em mobile (sm:hidden). Default: "Add". */
|
|
290
|
+
addTravellerShortLabel?: string;
|
|
287
291
|
}
|
|
288
292
|
interface BookingContact {
|
|
289
293
|
name: string;
|
package/dist/index.js
CHANGED
|
@@ -1353,11 +1353,11 @@ function AdventureCard({ adventure }) {
|
|
|
1353
1353
|
/* @__PURE__ */ jsx(Separator, { className: "my-1" }),
|
|
1354
1354
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
1355
1355
|
/* @__PURE__ */ jsx("p", { className: "text-[10px] font-bold text-muted-foreground font-heading uppercase tracking-widest mb-3", children: (_f = adventure.itineraryLabel) != null ? _f : "Itinerary" }),
|
|
1356
|
-
adventure.description && !adventure.detailsSlot && /* @__PURE__ */ jsx("p", { className: "text-base text-foreground/80 leading-
|
|
1356
|
+
adventure.description && !adventure.detailsSlot && /* @__PURE__ */ jsx("p", { className: "text-base text-foreground/80 leading-snug font-sans", children: adventure.description }),
|
|
1357
1357
|
adventure.detailsSlot && /* @__PURE__ */ jsx("div", { className: cn(
|
|
1358
1358
|
"text-foreground",
|
|
1359
1359
|
// Base paragraph and heading styles
|
|
1360
|
-
"[&_p]:text-base [&_p]:text-foreground/80 [&_p]:leading-
|
|
1360
|
+
"[&_p]:text-base [&_p]:text-foreground/80 [&_p]:leading-snug [&_p]:mb-2",
|
|
1361
1361
|
"[&_h2]:text-xl [&_h2]:font-bold [&_h2]:text-foreground [&_h2]:mb-2 [&_h2]:mt-4",
|
|
1362
1362
|
"[&_h3]:text-lg [&_h3]:font-semibold [&_h3]:text-foreground [&_h3]:mb-1 [&_h3]:mt-3",
|
|
1363
1363
|
"[&_strong]:font-bold [&_strong]:text-foreground",
|
|
@@ -1367,7 +1367,7 @@ function AdventureCard({ adventure }) {
|
|
|
1367
1367
|
// Standard lists
|
|
1368
1368
|
"[&_ul:not(.list-check):not(.list-cross)]:list-disc [&_ul:not(.list-check):not(.list-cross)]:pl-5 [&_ul:not(.list-check):not(.list-cross)]:space-y-1",
|
|
1369
1369
|
"[&_ol]:list-decimal [&_ol]:pl-5 [&_ol]:space-y-1",
|
|
1370
|
-
"[&_li]:text-base [&_li]:text-foreground/80 [&_li]:leading-
|
|
1370
|
+
"[&_li]:text-base [&_li]:text-foreground/80 [&_li]:leading-snug",
|
|
1371
1371
|
// Check list (✓)
|
|
1372
1372
|
"[&_.list-check]:list-none [&_.list-check]:pl-5 [&_.list-check]:space-y-1",
|
|
1373
1373
|
"[&_.list-check_li]:relative [&_.list-check_li]:before:absolute [&_.list-check_li]:before:-left-5 [&_.list-check_li]:before:content-['\u2713'] [&_.list-check_li]:before:text-primary [&_.list-check_li]:before:font-bold",
|
|
@@ -2214,16 +2214,29 @@ function StatusBadge({ status }) {
|
|
|
2214
2214
|
);
|
|
2215
2215
|
}
|
|
2216
2216
|
function totalPeople(adventures) {
|
|
2217
|
-
var _a, _b, _c, _d, _e, _f;
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2217
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2218
|
+
const byId = /* @__PURE__ */ new Map();
|
|
2219
|
+
for (const adv of adventures) {
|
|
2220
|
+
for (const t of (_a = adv.travellers) != null ? _a : []) {
|
|
2221
|
+
if (!byId.has(t.id)) byId.set(t.id, t);
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
if (byId.size === 0) {
|
|
2225
|
+
let adults2 = 0, children2 = 0, seniors2 = 0;
|
|
2226
|
+
for (const a of adventures) {
|
|
2227
|
+
adults2 += (_c = (_b = a.slots) == null ? void 0 : _b.adults) != null ? _c : 0;
|
|
2228
|
+
children2 += (_e = (_d = a.slots) == null ? void 0 : _d.children) != null ? _e : 0;
|
|
2229
|
+
seniors2 += (_g = (_f = a.slots) == null ? void 0 : _f.seniors) != null ? _g : 0;
|
|
2230
|
+
}
|
|
2231
|
+
return { adults: adults2, children: children2, seniors: seniors2, total: adults2 + children2 + seniors2 };
|
|
2225
2232
|
}
|
|
2226
|
-
|
|
2233
|
+
let adults = 0, children = 0, seniors = 0;
|
|
2234
|
+
for (const t of byId.values()) {
|
|
2235
|
+
if (t.personType === "CHILD" || t.isChild) children++;
|
|
2236
|
+
else if (t.personType === "SENIOR") seniors++;
|
|
2237
|
+
else adults++;
|
|
2238
|
+
}
|
|
2239
|
+
return { adults, children, seniors, total: byId.size };
|
|
2227
2240
|
}
|
|
2228
2241
|
function InfoCard({
|
|
2229
2242
|
label,
|
|
@@ -2250,9 +2263,8 @@ function AdventureSection({
|
|
|
2250
2263
|
onRequestOpenDeleteModal,
|
|
2251
2264
|
cannotRemoveLastTravellerLabel
|
|
2252
2265
|
}) {
|
|
2253
|
-
var _a, _b, _c, _d;
|
|
2266
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2254
2267
|
const [detailsOpen, setDetailsOpen] = React22.useState(false);
|
|
2255
|
-
const [itineraryOpen, setItineraryOpen] = React22.useState(true);
|
|
2256
2268
|
const handleCopyUrl = (url) => {
|
|
2257
2269
|
navigator.clipboard.writeText(url);
|
|
2258
2270
|
};
|
|
@@ -2285,7 +2297,7 @@ function AdventureSection({
|
|
|
2285
2297
|
] })
|
|
2286
2298
|
] })
|
|
2287
2299
|
] }),
|
|
2288
|
-
(adventure.included && adventure.included.length > 0 || adventure.notIncluded && adventure.notIncluded.length > 0 || adventure.cancellationPolicy && adventure.cancellationPolicy.length > 0) && /* @__PURE__ */ jsxs(
|
|
2300
|
+
(adventure.detailsSlot || adventure.description || adventure.included && adventure.included.length > 0 || adventure.notIncluded && adventure.notIncluded.length > 0 || adventure.cancellationPolicy && adventure.cancellationPolicy.length > 0) && /* @__PURE__ */ jsxs(
|
|
2289
2301
|
"button",
|
|
2290
2302
|
{
|
|
2291
2303
|
type: "button",
|
|
@@ -2296,7 +2308,7 @@ function AdventureSection({
|
|
|
2296
2308
|
detailsOpen && "border-primary text-primary"
|
|
2297
2309
|
),
|
|
2298
2310
|
children: [
|
|
2299
|
-
"Details",
|
|
2311
|
+
(_d = adventure.itineraryLabel) != null ? _d : "Details",
|
|
2300
2312
|
detailsOpen ? /* @__PURE__ */ jsx(ChevronUpIcon, { className: "w-3 h-3" }) : /* @__PURE__ */ jsx(ChevronDownIcon, { className: "w-3 h-3" })
|
|
2301
2313
|
]
|
|
2302
2314
|
}
|
|
@@ -2317,51 +2329,28 @@ function AdventureSection({
|
|
|
2317
2329
|
tag
|
|
2318
2330
|
)) })
|
|
2319
2331
|
] }),
|
|
2320
|
-
(adventure.detailsSlot || adventure.description) && /* @__PURE__ */ jsxs("div", { className: "border-t border-border px-5 lg:px-6 py-5 flex flex-col gap-2", children: [
|
|
2321
|
-
/* @__PURE__ */ jsxs(
|
|
2322
|
-
"button",
|
|
2323
|
-
{
|
|
2324
|
-
type: "button",
|
|
2325
|
-
onClick: () => setItineraryOpen((v) => !v),
|
|
2326
|
-
className: cn(
|
|
2327
|
-
"group flex w-full items-center justify-between gap-2 text-left",
|
|
2328
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded"
|
|
2329
|
-
),
|
|
2330
|
-
"aria-expanded": itineraryOpen,
|
|
2331
|
-
children: [
|
|
2332
|
-
/* @__PURE__ */ jsx("h4", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest group-hover:text-foreground transition-colors", children: (_d = adventure.itineraryLabel) != null ? _d : "Itinerary" }),
|
|
2333
|
-
/* @__PURE__ */ jsx(
|
|
2334
|
-
ChevronDownIcon,
|
|
2335
|
-
{
|
|
2336
|
-
className: cn(
|
|
2337
|
-
"w-4 h-4 text-muted-foreground shrink-0 transition-transform",
|
|
2338
|
-
itineraryOpen && "rotate-180"
|
|
2339
|
-
)
|
|
2340
|
-
}
|
|
2341
|
-
)
|
|
2342
|
-
]
|
|
2343
|
-
}
|
|
2344
|
-
),
|
|
2345
|
-
itineraryOpen && (adventure.detailsSlot ? /* @__PURE__ */ jsx(
|
|
2346
|
-
"div",
|
|
2347
|
-
{
|
|
2348
|
-
className: cn(
|
|
2349
|
-
"text-foreground",
|
|
2350
|
-
"[&_p]:text-sm [&_p]:text-foreground/80 [&_p]:leading-relaxed [&_p]:mb-2",
|
|
2351
|
-
"[&_h2]:text-lg [&_h2]:font-bold [&_h2]:text-foreground [&_h2]:mb-2 [&_h2]:mt-4",
|
|
2352
|
-
"[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-foreground [&_h3]:mb-1 [&_h3]:mt-3",
|
|
2353
|
-
"[&_strong]:font-bold [&_strong]:text-foreground",
|
|
2354
|
-
"[&_em]:italic",
|
|
2355
|
-
"[&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2",
|
|
2356
|
-
"[&_ul]:list-disc [&_ul]:pl-5 [&_ul]:space-y-1",
|
|
2357
|
-
"[&_ol]:list-decimal [&_ol]:pl-5 [&_ol]:space-y-1",
|
|
2358
|
-
"[&_li]:text-sm [&_li]:text-foreground/80 [&_li]:leading-relaxed"
|
|
2359
|
-
),
|
|
2360
|
-
children: adventure.detailsSlot
|
|
2361
|
-
}
|
|
2362
|
-
) : /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground/80 leading-relaxed font-sans", children: adventure.description }))
|
|
2363
|
-
] }),
|
|
2364
2332
|
detailsOpen && /* @__PURE__ */ jsxs("div", { className: "border-t border-border px-5 lg:px-6 py-5 flex flex-col gap-5 bg-muted/10", children: [
|
|
2333
|
+
(adventure.detailsSlot || adventure.description) && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
2334
|
+
/* @__PURE__ */ jsx("h4", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: "Itinerary" }),
|
|
2335
|
+
adventure.detailsSlot ? /* @__PURE__ */ jsx(
|
|
2336
|
+
"div",
|
|
2337
|
+
{
|
|
2338
|
+
className: cn(
|
|
2339
|
+
"text-foreground",
|
|
2340
|
+
"[&_p]:text-sm [&_p]:text-foreground/80 [&_p]:leading-snug [&_p]:mb-2",
|
|
2341
|
+
"[&_h2]:text-lg [&_h2]:font-bold [&_h2]:text-foreground [&_h2]:mb-2 [&_h2]:mt-4",
|
|
2342
|
+
"[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-foreground [&_h3]:mb-1 [&_h3]:mt-3",
|
|
2343
|
+
"[&_strong]:font-bold [&_strong]:text-foreground",
|
|
2344
|
+
"[&_em]:italic",
|
|
2345
|
+
"[&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2",
|
|
2346
|
+
"[&_ul]:list-disc [&_ul]:pl-5 [&_ul]:space-y-1",
|
|
2347
|
+
"[&_ol]:list-decimal [&_ol]:pl-5 [&_ol]:space-y-1",
|
|
2348
|
+
"[&_li]:text-sm [&_li]:text-foreground/80 [&_li]:leading-snug"
|
|
2349
|
+
),
|
|
2350
|
+
children: adventure.detailsSlot
|
|
2351
|
+
}
|
|
2352
|
+
) : /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground/80 leading-snug font-sans", children: adventure.description })
|
|
2353
|
+
] }),
|
|
2365
2354
|
adventure.included && adventure.included.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
2366
2355
|
/* @__PURE__ */ jsx("h4", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: "O que est\xE1 incluso" }),
|
|
2367
2356
|
/* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-1.5", children: adventure.included.map((item, i) => /* @__PURE__ */ jsxs(
|
|
@@ -2447,8 +2436,8 @@ function AdventureSection({
|
|
|
2447
2436
|
className: "flex items-center gap-1.5 rounded-full border border-border px-3 py-1.5 text-xs font-ui text-primary hover:border-primary hover:bg-primary/5 transition-colors",
|
|
2448
2437
|
children: [
|
|
2449
2438
|
/* @__PURE__ */ jsx(PlusIcon, { className: "w-3 h-3" }),
|
|
2450
|
-
/* @__PURE__ */ jsx("span", { className: "hidden sm:inline", children: "More travellers" }),
|
|
2451
|
-
/* @__PURE__ */ jsx("span", { className: "sm:hidden", children: "Add" })
|
|
2439
|
+
/* @__PURE__ */ jsx("span", { className: "hidden sm:inline", children: (_e = adventure.addTravellerLabel) != null ? _e : "More travellers" }),
|
|
2440
|
+
/* @__PURE__ */ jsx("span", { className: "sm:hidden", children: (_g = (_f = adventure.addTravellerShortLabel) != null ? _f : adventure.addTravellerLabel) != null ? _g : "Add" })
|
|
2452
2441
|
]
|
|
2453
2442
|
}
|
|
2454
2443
|
)
|
|
@@ -3685,7 +3674,7 @@ function BookingConfirmation({
|
|
|
3685
3674
|
/* @__PURE__ */ jsx(
|
|
3686
3675
|
"div",
|
|
3687
3676
|
{
|
|
3688
|
-
style: { fontSize: "14px", color: emailTokens.bodyText, lineHeight: "1.
|
|
3677
|
+
style: { fontSize: "14px", color: emailTokens.bodyText, lineHeight: "1.4", margin: 0 },
|
|
3689
3678
|
dangerouslySetInnerHTML: { __html: adventure.description }
|
|
3690
3679
|
}
|
|
3691
3680
|
)
|