@planetaexo/design-system 0.7.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 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,
@@ -2268,9 +2281,10 @@ function AdventureSection({
2268
2281
  hasConfirmRemoveTraveller,
2269
2282
  onRequestOpenAddModal,
2270
2283
  onRequestOpenEditModal,
2271
- onRequestOpenDeleteModal
2284
+ onRequestOpenDeleteModal,
2285
+ cannotRemoveLastTravellerLabel
2272
2286
  }) {
2273
- var _a, _b, _c, _d;
2287
+ var _a, _b, _c, _d, _e, _f, _g;
2274
2288
  const [detailsOpen, setDetailsOpen] = React22__namespace.useState(false);
2275
2289
  const handleCopyUrl = (url) => {
2276
2290
  navigator.clipboard.writeText(url);
@@ -2304,7 +2318,7 @@ function AdventureSection({
2304
2318
  ] })
2305
2319
  ] })
2306
2320
  ] }),
2307
- (adventure.included && adventure.included.length > 0 || adventure.notIncluded && adventure.notIncluded.length > 0 || adventure.cancellationPolicy && adventure.cancellationPolicy.length > 0) && /* @__PURE__ */ jsxRuntime.jsxs(
2321
+ (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(
2308
2322
  "button",
2309
2323
  {
2310
2324
  type: "button",
@@ -2315,7 +2329,7 @@ function AdventureSection({
2315
2329
  detailsOpen && "border-primary text-primary"
2316
2330
  ),
2317
2331
  children: [
2318
- "Details",
2332
+ (_d = adventure.itineraryLabel) != null ? _d : "Details",
2319
2333
  detailsOpen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUpIcon, { className: "w-3 h-3" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "w-3 h-3" })
2320
2334
  ]
2321
2335
  }
@@ -2336,28 +2350,28 @@ function AdventureSection({
2336
2350
  tag
2337
2351
  )) })
2338
2352
  ] }),
2339
- (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: [
2340
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: (_d = adventure.itineraryLabel) != null ? _d : "Itinerary" }),
2341
- adventure.detailsSlot ? /* @__PURE__ */ jsxRuntime.jsx(
2342
- "div",
2343
- {
2344
- className: cn(
2345
- "text-foreground",
2346
- "[&_p]:text-sm [&_p]:text-foreground/80 [&_p]:leading-relaxed [&_p]:mb-2",
2347
- "[&_h2]:text-lg [&_h2]:font-bold [&_h2]:text-foreground [&_h2]:mb-2 [&_h2]:mt-4",
2348
- "[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-foreground [&_h3]:mb-1 [&_h3]:mt-3",
2349
- "[&_strong]:font-bold [&_strong]:text-foreground",
2350
- "[&_em]:italic",
2351
- "[&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2",
2352
- "[&_ul]:list-disc [&_ul]:pl-5 [&_ul]:space-y-1",
2353
- "[&_ol]:list-decimal [&_ol]:pl-5 [&_ol]:space-y-1",
2354
- "[&_li]:text-sm [&_li]:text-foreground/80 [&_li]:leading-relaxed"
2355
- ),
2356
- children: adventure.detailsSlot
2357
- }
2358
- ) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground/80 leading-relaxed font-sans", children: adventure.description })
2359
- ] }),
2360
2353
  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: [
2354
+ (adventure.detailsSlot || adventure.description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
2355
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: "Itinerary" }),
2356
+ adventure.detailsSlot ? /* @__PURE__ */ jsxRuntime.jsx(
2357
+ "div",
2358
+ {
2359
+ className: cn(
2360
+ "text-foreground",
2361
+ "[&_p]:text-sm [&_p]:text-foreground/80 [&_p]:leading-snug [&_p]:mb-2",
2362
+ "[&_h2]:text-lg [&_h2]:font-bold [&_h2]:text-foreground [&_h2]:mb-2 [&_h2]:mt-4",
2363
+ "[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-foreground [&_h3]:mb-1 [&_h3]:mt-3",
2364
+ "[&_strong]:font-bold [&_strong]:text-foreground",
2365
+ "[&_em]:italic",
2366
+ "[&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2",
2367
+ "[&_ul]:list-disc [&_ul]:pl-5 [&_ul]:space-y-1",
2368
+ "[&_ol]:list-decimal [&_ol]:pl-5 [&_ol]:space-y-1",
2369
+ "[&_li]:text-sm [&_li]:text-foreground/80 [&_li]:leading-snug"
2370
+ ),
2371
+ children: adventure.detailsSlot
2372
+ }
2373
+ ) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground/80 leading-snug font-sans", children: adventure.description })
2374
+ ] }),
2361
2375
  adventure.included && adventure.included.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
2362
2376
  /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: "O que est\xE1 incluso" }),
2363
2377
  /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-1.5", children: adventure.included.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs(
@@ -2443,121 +2457,139 @@ function AdventureSection({
2443
2457
  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",
2444
2458
  children: [
2445
2459
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { className: "w-3 h-3" }),
2446
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children: "More travellers" }),
2447
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sm:hidden", children: "Add" })
2460
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children: (_e = adventure.addTravellerLabel) != null ? _e : "More travellers" }),
2461
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sm:hidden", children: (_g = (_f = adventure.addTravellerShortLabel) != null ? _f : adventure.addTravellerLabel) != null ? _g : "Add" })
2448
2462
  ]
2449
2463
  }
2450
2464
  )
2451
2465
  ] })
2452
2466
  ] }),
2453
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col divide-y divide-border", children: adventure.travellers.map((t) => /* @__PURE__ */ jsxRuntime.jsxs(
2454
- "div",
2455
- {
2456
- className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 py-3 first:pt-0",
2457
- children: [
2458
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 min-w-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5 min-w-0 flex-1", children: [
2459
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
2460
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm font-semibold text-foreground font-ui truncate", children: [
2461
- t.firstName,
2462
- " ",
2463
- t.lastName
2467
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col divide-y divide-border", children: adventure.travellers.map((t) => {
2468
+ const canRemoveTraveller = adventure.travellers.length > 1;
2469
+ const disabledRemoveTitle = canRemoveTraveller ? void 0 : cannotRemoveLastTravellerLabel != null ? cannotRemoveLastTravellerLabel : "Cannot remove last traveller";
2470
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2471
+ "div",
2472
+ {
2473
+ className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 py-3 first:pt-0",
2474
+ children: [
2475
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 min-w-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5 min-w-0 flex-1", children: [
2476
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
2477
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm font-semibold text-foreground font-ui truncate", children: [
2478
+ t.firstName,
2479
+ " ",
2480
+ t.lastName
2481
+ ] }),
2482
+ t.isChild && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold font-heading rounded-full px-2 py-0.5 bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400 shrink-0", children: "Child" })
2464
2483
  ] }),
2465
- t.isChild && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold font-heading rounded-full px-2 py-0.5 bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400 shrink-0", children: "Child" })
2466
- ] }),
2467
- t.formUrl && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
2468
- /* @__PURE__ */ jsxRuntime.jsxs(
2469
- "a",
2470
- {
2471
- href: t.formUrl,
2472
- target: "_blank",
2473
- rel: "noopener noreferrer",
2474
- className: "flex items-center gap-1 text-xs text-primary hover:text-primary/80 transition-colors font-ui",
2475
- children: [
2476
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLinkIcon, { className: "w-3 h-3" }),
2477
- "Open"
2478
- ]
2479
- }
2480
- ),
2481
- /* @__PURE__ */ jsxRuntime.jsx(
2482
- "button",
2483
- {
2484
- type: "button",
2485
- onClick: () => handleCopyUrl(t.formUrl),
2486
- className: "flex items-center text-xs text-muted-foreground hover:text-primary transition-colors font-ui",
2487
- "aria-label": "Copy form URL",
2488
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyIcon, { className: "w-3 h-3" })
2489
- }
2490
- )
2491
- ] })
2492
- ] }) }),
2493
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 sm:gap-3 justify-between sm:justify-end", children: [
2494
- /* @__PURE__ */ jsxRuntime.jsx(
2495
- "span",
2496
- {
2497
- className: cn(
2498
- "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-bold font-heading uppercase tracking-wider shrink-0",
2499
- t.status === "completed" ? "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400" : "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"
2484
+ t.formUrl && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
2485
+ /* @__PURE__ */ jsxRuntime.jsxs(
2486
+ "a",
2487
+ {
2488
+ href: t.formUrl,
2489
+ target: "_blank",
2490
+ rel: "noopener noreferrer",
2491
+ className: "flex items-center gap-1 text-xs text-primary hover:text-primary/80 transition-colors font-ui",
2492
+ children: [
2493
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLinkIcon, { className: "w-3 h-3" }),
2494
+ "Open"
2495
+ ]
2496
+ }
2500
2497
  ),
2501
- children: t.status
2502
- }
2503
- ),
2504
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5 shrink-0", children: [
2505
- (onEditTraveller || hasSubmitEditTraveller) && /* @__PURE__ */ jsxRuntime.jsx(
2506
- "button",
2507
- {
2508
- type: "button",
2509
- onClick: () => {
2510
- if (onEditTraveller) {
2511
- onEditTraveller(adventure.id, t.id);
2512
- } else {
2513
- onRequestOpenEditModal == null ? void 0 : onRequestOpenEditModal(adventure.id, t);
2514
- }
2515
- },
2516
- className: "flex h-8 w-8 sm:h-7 sm:w-7 items-center justify-center rounded-lg text-muted-foreground hover:text-primary hover:bg-primary/10 transition-colors",
2517
- "aria-label": `Edit ${t.firstName}`,
2518
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PencilIcon, { className: "w-3.5 h-3.5" })
2519
- }
2520
- ),
2521
- (onRemoveTraveller || hasConfirmRemoveTraveller) && /* @__PURE__ */ jsxRuntime.jsx(
2522
- "button",
2498
+ /* @__PURE__ */ jsxRuntime.jsx(
2499
+ "button",
2500
+ {
2501
+ type: "button",
2502
+ onClick: () => handleCopyUrl(t.formUrl),
2503
+ className: "flex items-center text-xs text-muted-foreground hover:text-primary transition-colors font-ui",
2504
+ "aria-label": "Copy form URL",
2505
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyIcon, { className: "w-3 h-3" })
2506
+ }
2507
+ )
2508
+ ] })
2509
+ ] }) }),
2510
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 sm:gap-3 justify-between sm:justify-end", children: [
2511
+ /* @__PURE__ */ jsxRuntime.jsx(
2512
+ "span",
2523
2513
  {
2524
- type: "button",
2525
- onClick: () => {
2526
- if (onRemoveTraveller) {
2527
- onRemoveTraveller(adventure.id, t.id);
2528
- } else {
2529
- onRequestOpenDeleteModal == null ? void 0 : onRequestOpenDeleteModal(adventure.id, t);
2530
- }
2531
- },
2532
- className: "flex h-8 w-8 sm:h-7 sm:w-7 items-center justify-center rounded-lg text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",
2533
- "aria-label": `Delete ${t.firstName}`,
2534
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { className: "w-3.5 h-3.5" })
2514
+ className: cn(
2515
+ "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-bold font-heading uppercase tracking-wider shrink-0",
2516
+ t.status === "completed" ? "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400" : "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"
2517
+ ),
2518
+ children: t.status
2535
2519
  }
2536
2520
  ),
2537
- (onUnassignFromAdventure || onRemoveTraveller || hasConfirmRemoveTraveller) && /* @__PURE__ */ jsxRuntime.jsx(
2538
- "button",
2539
- {
2540
- type: "button",
2541
- onClick: () => {
2542
- if (onUnassignFromAdventure) {
2543
- onUnassignFromAdventure(adventure.id, t.id);
2544
- } else if (onRemoveTraveller) {
2545
- onRemoveTraveller(adventure.id, t.id);
2546
- } else {
2547
- onRequestOpenDeleteModal == null ? void 0 : onRequestOpenDeleteModal(adventure.id, t);
2548
- }
2549
- },
2550
- className: "flex h-8 w-8 sm:h-7 sm:w-7 items-center justify-center rounded-lg text-muted-foreground hover:text-amber-500 hover:bg-amber-500/10 transition-colors",
2551
- "aria-label": `Remove ${t.firstName} from adventure`,
2552
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserMinusIcon, { className: "w-3.5 h-3.5" })
2553
- }
2554
- )
2521
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5 shrink-0", children: [
2522
+ (onEditTraveller || hasSubmitEditTraveller) && /* @__PURE__ */ jsxRuntime.jsx(
2523
+ "button",
2524
+ {
2525
+ type: "button",
2526
+ onClick: () => {
2527
+ if (onEditTraveller) {
2528
+ onEditTraveller(adventure.id, t.id);
2529
+ } else {
2530
+ onRequestOpenEditModal == null ? void 0 : onRequestOpenEditModal(adventure.id, t);
2531
+ }
2532
+ },
2533
+ className: "flex h-8 w-8 sm:h-7 sm:w-7 items-center justify-center rounded-lg text-muted-foreground hover:text-primary hover:bg-primary/10 transition-colors",
2534
+ "aria-label": `Edit ${t.firstName}`,
2535
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PencilIcon, { className: "w-3.5 h-3.5" })
2536
+ }
2537
+ ),
2538
+ (onRemoveTraveller || hasConfirmRemoveTraveller) && /* @__PURE__ */ jsxRuntime.jsx(
2539
+ "button",
2540
+ {
2541
+ type: "button",
2542
+ onClick: () => {
2543
+ if (!canRemoveTraveller) return;
2544
+ if (onRemoveTraveller) {
2545
+ onRemoveTraveller(adventure.id, t.id);
2546
+ } else {
2547
+ onRequestOpenDeleteModal == null ? void 0 : onRequestOpenDeleteModal(adventure.id, t);
2548
+ }
2549
+ },
2550
+ disabled: !canRemoveTraveller,
2551
+ title: disabledRemoveTitle,
2552
+ "aria-disabled": !canRemoveTraveller,
2553
+ className: cn(
2554
+ "flex h-8 w-8 sm:h-7 sm:w-7 items-center justify-center rounded-lg text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",
2555
+ "disabled:opacity-40 disabled:cursor-not-allowed disabled:pointer-events-none disabled:hover:text-muted-foreground disabled:hover:bg-transparent"
2556
+ ),
2557
+ "aria-label": `Delete ${t.firstName}`,
2558
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { className: "w-3.5 h-3.5" })
2559
+ }
2560
+ ),
2561
+ (onUnassignFromAdventure || onRemoveTraveller || hasConfirmRemoveTraveller) && /* @__PURE__ */ jsxRuntime.jsx(
2562
+ "button",
2563
+ {
2564
+ type: "button",
2565
+ onClick: () => {
2566
+ if (!canRemoveTraveller) return;
2567
+ if (onUnassignFromAdventure) {
2568
+ onUnassignFromAdventure(adventure.id, t.id);
2569
+ } else if (onRemoveTraveller) {
2570
+ onRemoveTraveller(adventure.id, t.id);
2571
+ } else {
2572
+ onRequestOpenDeleteModal == null ? void 0 : onRequestOpenDeleteModal(adventure.id, t);
2573
+ }
2574
+ },
2575
+ disabled: !canRemoveTraveller,
2576
+ title: disabledRemoveTitle,
2577
+ "aria-disabled": !canRemoveTraveller,
2578
+ className: cn(
2579
+ "flex h-8 w-8 sm:h-7 sm:w-7 items-center justify-center rounded-lg text-muted-foreground hover:text-amber-500 hover:bg-amber-500/10 transition-colors",
2580
+ "disabled:opacity-40 disabled:cursor-not-allowed disabled:pointer-events-none disabled:hover:text-muted-foreground disabled:hover:bg-transparent"
2581
+ ),
2582
+ "aria-label": `Remove ${t.firstName} from adventure`,
2583
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserMinusIcon, { className: "w-3.5 h-3.5" })
2584
+ }
2585
+ )
2586
+ ] })
2555
2587
  ] })
2556
- ] })
2557
- ]
2558
- },
2559
- t.id
2560
- )) }),
2588
+ ]
2589
+ },
2590
+ t.id
2591
+ );
2592
+ }) }),
2561
2593
  adventure.suggestedTravellers && adventure.suggestedTravellers.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 pt-2", children: [
2562
2594
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground font-ui", children: "Add to this adventure" }),
2563
2595
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2", children: adventure.suggestedTravellers.map((st) => /* @__PURE__ */ jsxRuntime.jsxs(
@@ -3015,6 +3047,10 @@ function BookingDetails({
3015
3047
  contact,
3016
3048
  agentName,
3017
3049
  agentContactUrl,
3050
+ agentNameFallback,
3051
+ agentLabel,
3052
+ agentContactLabel,
3053
+ cannotRemoveLastTravellerLabel,
3018
3054
  adventures,
3019
3055
  summaryLineItems,
3020
3056
  subtotal,
@@ -3164,26 +3200,49 @@ function BookingDetails({
3164
3200
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold", children: contact.name }),
3165
3201
  contact.email && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground font-sans truncate", children: contact.email })
3166
3202
  ] }),
3167
- agentName && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-border bg-card p-4 flex items-center gap-3.5 min-w-0", children: [
3168
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary font-heading font-bold text-sm uppercase", children: agentName.charAt(0) }),
3169
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
3170
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: "Your Agent" }),
3171
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-foreground font-sans", children: agentName })
3172
- ] }),
3173
- agentContactUrl && /* @__PURE__ */ jsxRuntime.jsxs(
3174
- "a",
3175
- {
3176
- href: agentContactUrl,
3177
- target: "_blank",
3178
- rel: "noopener noreferrer",
3179
- className: "ml-auto shrink-0 flex items-center gap-1.5 rounded-full bg-primary/10 px-3.5 py-1.5 text-xs font-semibold text-primary font-ui transition-colors hover:bg-primary/20",
3180
- children: [
3181
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageCircleIcon, { className: "w-3.5 h-3.5" }),
3182
- "Contact"
3183
- ]
3184
- }
3185
- )
3186
- ] }),
3203
+ (() => {
3204
+ const hasAgent = !!agentName;
3205
+ const displayName = hasAgent ? agentName : agentNameFallback != null ? agentNameFallback : "No agent assigned";
3206
+ const initial = hasAgent ? agentName.charAt(0) : "?";
3207
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-border bg-card p-4 flex items-center gap-3.5 min-w-0", children: [
3208
+ /* @__PURE__ */ jsxRuntime.jsx(
3209
+ "div",
3210
+ {
3211
+ className: cn(
3212
+ "flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-heading font-bold text-sm uppercase",
3213
+ hasAgent ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground"
3214
+ ),
3215
+ children: initial
3216
+ }
3217
+ ),
3218
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
3219
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: agentLabel != null ? agentLabel : "Your Agent" }),
3220
+ /* @__PURE__ */ jsxRuntime.jsx(
3221
+ "p",
3222
+ {
3223
+ className: cn(
3224
+ "text-sm font-sans truncate",
3225
+ hasAgent ? "font-semibold text-foreground" : "italic text-muted-foreground"
3226
+ ),
3227
+ children: displayName
3228
+ }
3229
+ )
3230
+ ] }),
3231
+ hasAgent && agentContactUrl && /* @__PURE__ */ jsxRuntime.jsxs(
3232
+ "a",
3233
+ {
3234
+ href: agentContactUrl,
3235
+ target: "_blank",
3236
+ rel: "noopener noreferrer",
3237
+ className: "ml-auto shrink-0 flex items-center gap-1.5 rounded-full bg-primary/10 px-3.5 py-1.5 text-xs font-semibold text-primary font-ui transition-colors hover:bg-primary/20",
3238
+ children: [
3239
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageCircleIcon, { className: "w-3.5 h-3.5" }),
3240
+ agentContactLabel != null ? agentContactLabel : "Contact"
3241
+ ]
3242
+ }
3243
+ )
3244
+ ] });
3245
+ })(),
3187
3246
  /* @__PURE__ */ jsxRuntime.jsxs(InfoCard, { label: "Total People", children: [
3188
3247
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
3189
3248
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UsersIcon, { className: "w-4 h-4 text-primary shrink-0" }),
@@ -3220,7 +3279,8 @@ function BookingDetails({
3220
3279
  hasConfirmRemoveTraveller,
3221
3280
  onRequestOpenAddModal: handleRequestOpenAddModal,
3222
3281
  onRequestOpenEditModal: handleRequestOpenEditModal,
3223
- onRequestOpenDeleteModal: handleRequestOpenDeleteModal
3282
+ onRequestOpenDeleteModal: handleRequestOpenDeleteModal,
3283
+ cannotRemoveLastTravellerLabel
3224
3284
  },
3225
3285
  adventure.id
3226
3286
  ))
@@ -3635,7 +3695,7 @@ function BookingConfirmation({
3635
3695
  /* @__PURE__ */ jsxRuntime.jsx(
3636
3696
  "div",
3637
3697
  {
3638
- style: { fontSize: "14px", color: emailTokens.bodyText, lineHeight: "1.6", margin: 0 },
3698
+ style: { fontSize: "14px", color: emailTokens.bodyText, lineHeight: "1.4", margin: 0 },
3639
3699
  dangerouslySetInnerHTML: { __html: adventure.description }
3640
3700
  }
3641
3701
  )