@planetaexo/design-system 0.8.0 → 0.9.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
@@ -1374,11 +1374,11 @@ function AdventureCard({ adventure }) {
1374
1374
  /* @__PURE__ */ jsxRuntime.jsx(Separator, { className: "my-1" }),
1375
1375
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1376
1376
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-bold text-muted-foreground font-heading uppercase tracking-widest mb-3", children: (_f = adventure.itineraryLabel) != null ? _f : "Itinerary" }),
1377
- adventure.description && !adventure.detailsSlot && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-foreground/80 leading-relaxed font-sans", children: adventure.description }),
1377
+ adventure.description && !adventure.detailsSlot && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-foreground/80 leading-snug font-sans", children: adventure.description }),
1378
1378
  adventure.detailsSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
1379
1379
  "text-foreground",
1380
1380
  // Base paragraph and heading styles
1381
- "[&_p]:text-base [&_p]:text-foreground/80 [&_p]:leading-relaxed [&_p]:mb-2",
1381
+ "[&_p]:text-base [&_p]:text-foreground/80 [&_p]:leading-snug [&_p]:mb-2",
1382
1382
  "[&_h2]:text-xl [&_h2]:font-bold [&_h2]:text-foreground [&_h2]:mb-2 [&_h2]:mt-4",
1383
1383
  "[&_h3]:text-lg [&_h3]:font-semibold [&_h3]:text-foreground [&_h3]:mb-1 [&_h3]:mt-3",
1384
1384
  "[&_strong]:font-bold [&_strong]:text-foreground",
@@ -1388,7 +1388,7 @@ function AdventureCard({ adventure }) {
1388
1388
  // Standard lists
1389
1389
  "[&_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",
1390
1390
  "[&_ol]:list-decimal [&_ol]:pl-5 [&_ol]:space-y-1",
1391
- "[&_li]:text-base [&_li]:text-foreground/80 [&_li]:leading-relaxed",
1391
+ "[&_li]:text-base [&_li]:text-foreground/80 [&_li]:leading-snug",
1392
1392
  // Check list (✓)
1393
1393
  "[&_.list-check]:list-none [&_.list-check]:pl-5 [&_.list-check]:space-y-1",
1394
1394
  "[&_.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",
@@ -2235,16 +2235,29 @@ function StatusBadge({ status }) {
2235
2235
  );
2236
2236
  }
2237
2237
  function totalPeople(adventures) {
2238
- var _a, _b, _c, _d, _e, _f;
2239
- let adults = 0;
2240
- let children = 0;
2241
- let seniors = 0;
2242
- for (const a of adventures) {
2243
- adults += (_b = (_a = a.slots) == null ? void 0 : _a.adults) != null ? _b : 0;
2244
- children += (_d = (_c = a.slots) == null ? void 0 : _c.children) != null ? _d : 0;
2245
- seniors += (_f = (_e = a.slots) == null ? void 0 : _e.seniors) != null ? _f : 0;
2238
+ var _a, _b, _c, _d, _e, _f, _g;
2239
+ const byId = /* @__PURE__ */ new Map();
2240
+ for (const adv of adventures) {
2241
+ for (const t of (_a = adv.travellers) != null ? _a : []) {
2242
+ if (!byId.has(t.id)) byId.set(t.id, t);
2243
+ }
2244
+ }
2245
+ if (byId.size === 0) {
2246
+ let adults2 = 0, children2 = 0, seniors2 = 0;
2247
+ for (const a of adventures) {
2248
+ adults2 += (_c = (_b = a.slots) == null ? void 0 : _b.adults) != null ? _c : 0;
2249
+ children2 += (_e = (_d = a.slots) == null ? void 0 : _d.children) != null ? _e : 0;
2250
+ seniors2 += (_g = (_f = a.slots) == null ? void 0 : _f.seniors) != null ? _g : 0;
2251
+ }
2252
+ return { adults: adults2, children: children2, seniors: seniors2, total: adults2 + children2 + seniors2 };
2246
2253
  }
2247
- return { adults, children, seniors, total: adults + children + seniors };
2254
+ let adults = 0, children = 0, seniors = 0;
2255
+ for (const t of byId.values()) {
2256
+ if (t.personType === "CHILD" || t.isChild) children++;
2257
+ else if (t.personType === "SENIOR") seniors++;
2258
+ else adults++;
2259
+ }
2260
+ return { adults, children, seniors, total: byId.size };
2248
2261
  }
2249
2262
  function InfoCard({
2250
2263
  label,
@@ -2263,6 +2276,7 @@ function AdventureSection({
2263
2276
  onAddSuggestedTraveller,
2264
2277
  onAddTraveller,
2265
2278
  onUnassignFromAdventure,
2279
+ onCopyFormLink,
2266
2280
  hasSubmitAddTraveller,
2267
2281
  hasSubmitEditTraveller,
2268
2282
  hasConfirmRemoveTraveller,
@@ -2271,11 +2285,14 @@ function AdventureSection({
2271
2285
  onRequestOpenDeleteModal,
2272
2286
  cannotRemoveLastTravellerLabel
2273
2287
  }) {
2274
- var _a, _b, _c, _d;
2288
+ var _a, _b, _c, _d, _e, _f, _g;
2275
2289
  const [detailsOpen, setDetailsOpen] = React22__namespace.useState(false);
2276
- const [itineraryOpen, setItineraryOpen] = React22__namespace.useState(true);
2277
2290
  const handleCopyUrl = (url) => {
2278
- navigator.clipboard.writeText(url);
2291
+ if (onCopyFormLink) {
2292
+ onCopyFormLink(url);
2293
+ } else {
2294
+ void navigator.clipboard.writeText(url);
2295
+ }
2279
2296
  };
2280
2297
  const people = adventure.slots;
2281
2298
  [
@@ -2306,7 +2323,7 @@ function AdventureSection({
2306
2323
  ] })
2307
2324
  ] })
2308
2325
  ] }),
2309
- (adventure.included && adventure.included.length > 0 || adventure.notIncluded && adventure.notIncluded.length > 0 || adventure.cancellationPolicy && adventure.cancellationPolicy.length > 0) && /* @__PURE__ */ jsxRuntime.jsxs(
2326
+ (adventure.detailsSlot || adventure.description || adventure.included && adventure.included.length > 0 || adventure.notIncluded && adventure.notIncluded.length > 0 || adventure.cancellationPolicy && adventure.cancellationPolicy.length > 0) && /* @__PURE__ */ jsxRuntime.jsxs(
2310
2327
  "button",
2311
2328
  {
2312
2329
  type: "button",
@@ -2317,7 +2334,7 @@ function AdventureSection({
2317
2334
  detailsOpen && "border-primary text-primary"
2318
2335
  ),
2319
2336
  children: [
2320
- "Details",
2337
+ (_d = adventure.itineraryLabel) != null ? _d : "Details",
2321
2338
  detailsOpen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUpIcon, { className: "w-3 h-3" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "w-3 h-3" })
2322
2339
  ]
2323
2340
  }
@@ -2338,51 +2355,28 @@ function AdventureSection({
2338
2355
  tag
2339
2356
  )) })
2340
2357
  ] }),
2341
- (adventure.detailsSlot || adventure.description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-border px-5 lg:px-6 py-5 flex flex-col gap-2", children: [
2342
- /* @__PURE__ */ jsxRuntime.jsxs(
2343
- "button",
2344
- {
2345
- type: "button",
2346
- onClick: () => setItineraryOpen((v) => !v),
2347
- className: cn(
2348
- "group flex w-full items-center justify-between gap-2 text-left",
2349
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded"
2350
- ),
2351
- "aria-expanded": itineraryOpen,
2352
- children: [
2353
- /* @__PURE__ */ jsxRuntime.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" }),
2354
- /* @__PURE__ */ jsxRuntime.jsx(
2355
- lucideReact.ChevronDownIcon,
2356
- {
2357
- className: cn(
2358
- "w-4 h-4 text-muted-foreground shrink-0 transition-transform",
2359
- itineraryOpen && "rotate-180"
2360
- )
2361
- }
2362
- )
2363
- ]
2364
- }
2365
- ),
2366
- itineraryOpen && (adventure.detailsSlot ? /* @__PURE__ */ jsxRuntime.jsx(
2367
- "div",
2368
- {
2369
- className: cn(
2370
- "text-foreground",
2371
- "[&_p]:text-sm [&_p]:text-foreground/80 [&_p]:leading-relaxed [&_p]:mb-2",
2372
- "[&_h2]:text-lg [&_h2]:font-bold [&_h2]:text-foreground [&_h2]:mb-2 [&_h2]:mt-4",
2373
- "[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-foreground [&_h3]:mb-1 [&_h3]:mt-3",
2374
- "[&_strong]:font-bold [&_strong]:text-foreground",
2375
- "[&_em]:italic",
2376
- "[&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2",
2377
- "[&_ul]:list-disc [&_ul]:pl-5 [&_ul]:space-y-1",
2378
- "[&_ol]:list-decimal [&_ol]:pl-5 [&_ol]:space-y-1",
2379
- "[&_li]:text-sm [&_li]:text-foreground/80 [&_li]:leading-relaxed"
2380
- ),
2381
- children: adventure.detailsSlot
2382
- }
2383
- ) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground/80 leading-relaxed font-sans", children: adventure.description }))
2384
- ] }),
2385
2358
  detailsOpen && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-border px-5 lg:px-6 py-5 flex flex-col gap-5 bg-muted/10", children: [
2359
+ (adventure.detailsSlot || adventure.description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
2360
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: "Itinerary" }),
2361
+ adventure.detailsSlot ? /* @__PURE__ */ jsxRuntime.jsx(
2362
+ "div",
2363
+ {
2364
+ className: cn(
2365
+ "text-foreground",
2366
+ "[&_p]:text-sm [&_p]:text-foreground/80 [&_p]:leading-snug [&_p]:mb-2",
2367
+ "[&_h2]:text-lg [&_h2]:font-bold [&_h2]:text-foreground [&_h2]:mb-2 [&_h2]:mt-4",
2368
+ "[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-foreground [&_h3]:mb-1 [&_h3]:mt-3",
2369
+ "[&_strong]:font-bold [&_strong]:text-foreground",
2370
+ "[&_em]:italic",
2371
+ "[&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2",
2372
+ "[&_ul]:list-disc [&_ul]:pl-5 [&_ul]:space-y-1",
2373
+ "[&_ol]:list-decimal [&_ol]:pl-5 [&_ol]:space-y-1",
2374
+ "[&_li]:text-sm [&_li]:text-foreground/80 [&_li]:leading-snug"
2375
+ ),
2376
+ children: adventure.detailsSlot
2377
+ }
2378
+ ) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground/80 leading-snug font-sans", children: adventure.description })
2379
+ ] }),
2386
2380
  adventure.included && adventure.included.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
2387
2381
  /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: "O que est\xE1 incluso" }),
2388
2382
  /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-1.5", children: adventure.included.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs(
@@ -2468,8 +2462,8 @@ function AdventureSection({
2468
2462
  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",
2469
2463
  children: [
2470
2464
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { className: "w-3 h-3" }),
2471
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children: "More travellers" }),
2472
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sm:hidden", children: "Add" })
2465
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children: (_e = adventure.addTravellerLabel) != null ? _e : "More travellers" }),
2466
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sm:hidden", children: (_g = (_f = adventure.addTravellerShortLabel) != null ? _f : adventure.addTravellerLabel) != null ? _g : "Add" })
2473
2467
  ]
2474
2468
  }
2475
2469
  )
@@ -2601,24 +2595,38 @@ function AdventureSection({
2601
2595
  t.id
2602
2596
  );
2603
2597
  }) }),
2604
- adventure.suggestedTravellers && adventure.suggestedTravellers.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 pt-2", children: [
2605
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground font-ui", children: "Add to this adventure" }),
2606
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2", children: adventure.suggestedTravellers.map((st) => /* @__PURE__ */ jsxRuntime.jsxs(
2607
- "button",
2608
- {
2609
- type: "button",
2610
- onClick: () => onAddSuggestedTraveller == null ? void 0 : onAddSuggestedTraveller(adventure.id, st.id),
2611
- className: "flex items-center gap-1.5 rounded-full border border-border px-3 py-1.5 text-xs font-ui text-foreground hover:border-primary hover:text-primary hover:bg-primary/5 transition-colors",
2612
- children: [
2613
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { className: "w-3 h-3" }),
2614
- st.firstName,
2615
- " ",
2616
- st.lastName
2617
- ]
2618
- },
2619
- st.id
2620
- )) })
2621
- ] }),
2598
+ adventure.suggestedTravellers && adventure.suggestedTravellers.length > 0 && (() => {
2599
+ var _a2;
2600
+ const atCapacity = totalSlots > 0 && adventure.travellers.length >= totalSlots;
2601
+ const atCapacityTooltip = atCapacity ? (_a2 = adventure.atCapacityLabel) != null ? _a2 : "Adventure full" : void 0;
2602
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 pt-2", children: [
2603
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground font-ui", children: "Add to this adventure" }),
2604
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2", children: adventure.suggestedTravellers.map((st) => /* @__PURE__ */ jsxRuntime.jsxs(
2605
+ "button",
2606
+ {
2607
+ type: "button",
2608
+ onClick: () => {
2609
+ if (atCapacity) return;
2610
+ onAddSuggestedTraveller == null ? void 0 : onAddSuggestedTraveller(adventure.id, st.id);
2611
+ },
2612
+ disabled: atCapacity,
2613
+ title: atCapacityTooltip,
2614
+ "aria-disabled": atCapacity,
2615
+ className: cn(
2616
+ "flex items-center gap-1.5 rounded-full border border-border px-3 py-1.5 text-xs font-ui text-foreground hover:border-primary hover:text-primary hover:bg-primary/5 transition-colors",
2617
+ "disabled:opacity-40 disabled:cursor-not-allowed disabled:pointer-events-none disabled:hover:border-border disabled:hover:text-foreground disabled:hover:bg-transparent"
2618
+ ),
2619
+ children: [
2620
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { className: "w-3 h-3" }),
2621
+ st.firstName,
2622
+ " ",
2623
+ st.lastName
2624
+ ]
2625
+ },
2626
+ st.id
2627
+ )) })
2628
+ ] });
2629
+ })(),
2622
2630
  adventure.travellers.length > 0 && totalSlots > 0 && (() => {
2623
2631
  const completed = adventure.travellers.filter((t) => t.status === "completed").length;
2624
2632
  const percent = Math.round(completed / totalSlots * 100);
@@ -3073,6 +3081,7 @@ function BookingDetails({
3073
3081
  onAddSuggestedTraveller,
3074
3082
  onAddTraveller,
3075
3083
  onUnassignFromAdventure,
3084
+ onCopyFormLink,
3076
3085
  onSubmitAddTraveller,
3077
3086
  onSubmitEditTraveller,
3078
3087
  onConfirmRemoveTraveller,
@@ -3285,6 +3294,7 @@ function BookingDetails({
3285
3294
  onAddSuggestedTraveller,
3286
3295
  onAddTraveller,
3287
3296
  onUnassignFromAdventure,
3297
+ onCopyFormLink,
3288
3298
  hasSubmitAddTraveller,
3289
3299
  hasSubmitEditTraveller,
3290
3300
  hasConfirmRemoveTraveller,
@@ -3706,7 +3716,7 @@ function BookingConfirmation({
3706
3716
  /* @__PURE__ */ jsxRuntime.jsx(
3707
3717
  "div",
3708
3718
  {
3709
- style: { fontSize: "14px", color: emailTokens.bodyText, lineHeight: "1.6", margin: 0 },
3719
+ style: { fontSize: "14px", color: emailTokens.bodyText, lineHeight: "1.4", margin: 0 },
3710
3720
  dangerouslySetInnerHTML: { __html: adventure.description }
3711
3721
  }
3712
3722
  )