@planetaexo/design-system 0.6.0 → 0.8.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 +614 -212
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +83 -3
- package/dist/index.d.ts +83 -3
- package/dist/index.js +614 -212
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2262,21 +2262,18 @@ function AdventureSection({
|
|
|
2262
2262
|
onRemoveTraveller,
|
|
2263
2263
|
onAddSuggestedTraveller,
|
|
2264
2264
|
onAddTraveller,
|
|
2265
|
-
onUnassignFromAdventure
|
|
2265
|
+
onUnassignFromAdventure,
|
|
2266
|
+
hasSubmitAddTraveller,
|
|
2267
|
+
hasSubmitEditTraveller,
|
|
2268
|
+
hasConfirmRemoveTraveller,
|
|
2269
|
+
onRequestOpenAddModal,
|
|
2270
|
+
onRequestOpenEditModal,
|
|
2271
|
+
onRequestOpenDeleteModal,
|
|
2272
|
+
cannotRemoveLastTravellerLabel
|
|
2266
2273
|
}) {
|
|
2267
2274
|
var _a, _b, _c, _d;
|
|
2268
2275
|
const [detailsOpen, setDetailsOpen] = React22__namespace.useState(false);
|
|
2269
|
-
const [
|
|
2270
|
-
const [newTraveller, setNewTraveller] = React22__namespace.useState({
|
|
2271
|
-
firstName: "",
|
|
2272
|
-
lastName: "",
|
|
2273
|
-
passport: "",
|
|
2274
|
-
type: "adult",
|
|
2275
|
-
email: "",
|
|
2276
|
-
dateOfBirth: "",
|
|
2277
|
-
phone: ""
|
|
2278
|
-
});
|
|
2279
|
-
const setField = (k, v) => setNewTraveller((p) => __spreadProps(__spreadValues({}, p), { [k]: v }));
|
|
2276
|
+
const [itineraryOpen, setItineraryOpen] = React22__namespace.useState(true);
|
|
2280
2277
|
const handleCopyUrl = (url) => {
|
|
2281
2278
|
navigator.clipboard.writeText(url);
|
|
2282
2279
|
};
|
|
@@ -2342,8 +2339,31 @@ function AdventureSection({
|
|
|
2342
2339
|
)) })
|
|
2343
2340
|
] }),
|
|
2344
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: [
|
|
2345
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2346
|
-
|
|
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(
|
|
2347
2367
|
"div",
|
|
2348
2368
|
{
|
|
2349
2369
|
className: cn(
|
|
@@ -2360,7 +2380,7 @@ function AdventureSection({
|
|
|
2360
2380
|
),
|
|
2361
2381
|
children: adventure.detailsSlot
|
|
2362
2382
|
}
|
|
2363
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground/80 leading-relaxed font-sans", children: adventure.description })
|
|
2383
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground/80 leading-relaxed font-sans", children: adventure.description }))
|
|
2364
2384
|
] }),
|
|
2365
2385
|
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: [
|
|
2366
2386
|
adventure.included && adventure.included.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
@@ -2434,11 +2454,17 @@ function AdventureSection({
|
|
|
2434
2454
|
]
|
|
2435
2455
|
}
|
|
2436
2456
|
),
|
|
2437
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2457
|
+
(onAddTraveller || hasSubmitAddTraveller) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2438
2458
|
"button",
|
|
2439
2459
|
{
|
|
2440
2460
|
type: "button",
|
|
2441
|
-
onClick: () =>
|
|
2461
|
+
onClick: () => {
|
|
2462
|
+
if (onAddTraveller) {
|
|
2463
|
+
onAddTraveller(adventure.id);
|
|
2464
|
+
} else {
|
|
2465
|
+
onRequestOpenAddModal == null ? void 0 : onRequestOpenAddModal(adventure.id);
|
|
2466
|
+
}
|
|
2467
|
+
},
|
|
2442
2468
|
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",
|
|
2443
2469
|
children: [
|
|
2444
2470
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { className: "w-3 h-3" }),
|
|
@@ -2449,94 +2475,132 @@ function AdventureSection({
|
|
|
2449
2475
|
)
|
|
2450
2476
|
] })
|
|
2451
2477
|
] }),
|
|
2452
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col divide-y divide-border", children: adventure.travellers.map((t) =>
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2478
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col divide-y divide-border", children: adventure.travellers.map((t) => {
|
|
2479
|
+
const canRemoveTraveller = adventure.travellers.length > 1;
|
|
2480
|
+
const disabledRemoveTitle = canRemoveTraveller ? void 0 : cannotRemoveLastTravellerLabel != null ? cannotRemoveLastTravellerLabel : "Cannot remove last traveller";
|
|
2481
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2482
|
+
"div",
|
|
2483
|
+
{
|
|
2484
|
+
className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 py-3 first:pt-0",
|
|
2485
|
+
children: [
|
|
2486
|
+
/* @__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: [
|
|
2487
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
2488
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm font-semibold text-foreground font-ui truncate", children: [
|
|
2489
|
+
t.firstName,
|
|
2490
|
+
" ",
|
|
2491
|
+
t.lastName
|
|
2492
|
+
] }),
|
|
2493
|
+
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" })
|
|
2463
2494
|
] }),
|
|
2464
|
-
t.
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
]
|
|
2478
|
-
}
|
|
2479
|
-
),
|
|
2480
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2481
|
-
"button",
|
|
2482
|
-
{
|
|
2483
|
-
type: "button",
|
|
2484
|
-
onClick: () => handleCopyUrl(t.formUrl),
|
|
2485
|
-
className: "flex items-center text-xs text-muted-foreground hover:text-primary transition-colors font-ui",
|
|
2486
|
-
"aria-label": "Copy form URL",
|
|
2487
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyIcon, { className: "w-3 h-3" })
|
|
2488
|
-
}
|
|
2489
|
-
)
|
|
2490
|
-
] })
|
|
2491
|
-
] }) }),
|
|
2492
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 sm:gap-3 justify-between sm:justify-end", children: [
|
|
2493
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2494
|
-
"span",
|
|
2495
|
-
{
|
|
2496
|
-
className: cn(
|
|
2497
|
-
"inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-bold font-heading uppercase tracking-wider shrink-0",
|
|
2498
|
-
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"
|
|
2495
|
+
t.formUrl && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2496
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2497
|
+
"a",
|
|
2498
|
+
{
|
|
2499
|
+
href: t.formUrl,
|
|
2500
|
+
target: "_blank",
|
|
2501
|
+
rel: "noopener noreferrer",
|
|
2502
|
+
className: "flex items-center gap-1 text-xs text-primary hover:text-primary/80 transition-colors font-ui",
|
|
2503
|
+
children: [
|
|
2504
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLinkIcon, { className: "w-3 h-3" }),
|
|
2505
|
+
"Open"
|
|
2506
|
+
]
|
|
2507
|
+
}
|
|
2499
2508
|
),
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
"button",
|
|
2509
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2510
|
+
"button",
|
|
2511
|
+
{
|
|
2512
|
+
type: "button",
|
|
2513
|
+
onClick: () => handleCopyUrl(t.formUrl),
|
|
2514
|
+
className: "flex items-center text-xs text-muted-foreground hover:text-primary transition-colors font-ui",
|
|
2515
|
+
"aria-label": "Copy form URL",
|
|
2516
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyIcon, { className: "w-3 h-3" })
|
|
2517
|
+
}
|
|
2518
|
+
)
|
|
2519
|
+
] })
|
|
2520
|
+
] }) }),
|
|
2521
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 sm:gap-3 justify-between sm:justify-end", children: [
|
|
2522
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2523
|
+
"span",
|
|
2516
2524
|
{
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
children:
|
|
2525
|
+
className: cn(
|
|
2526
|
+
"inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-bold font-heading uppercase tracking-wider shrink-0",
|
|
2527
|
+
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"
|
|
2528
|
+
),
|
|
2529
|
+
children: t.status
|
|
2522
2530
|
}
|
|
2523
2531
|
),
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2532
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5 shrink-0", children: [
|
|
2533
|
+
(onEditTraveller || hasSubmitEditTraveller) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2534
|
+
"button",
|
|
2535
|
+
{
|
|
2536
|
+
type: "button",
|
|
2537
|
+
onClick: () => {
|
|
2538
|
+
if (onEditTraveller) {
|
|
2539
|
+
onEditTraveller(adventure.id, t.id);
|
|
2540
|
+
} else {
|
|
2541
|
+
onRequestOpenEditModal == null ? void 0 : onRequestOpenEditModal(adventure.id, t);
|
|
2542
|
+
}
|
|
2543
|
+
},
|
|
2544
|
+
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",
|
|
2545
|
+
"aria-label": `Edit ${t.firstName}`,
|
|
2546
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PencilIcon, { className: "w-3.5 h-3.5" })
|
|
2547
|
+
}
|
|
2548
|
+
),
|
|
2549
|
+
(onRemoveTraveller || hasConfirmRemoveTraveller) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2550
|
+
"button",
|
|
2551
|
+
{
|
|
2552
|
+
type: "button",
|
|
2553
|
+
onClick: () => {
|
|
2554
|
+
if (!canRemoveTraveller) return;
|
|
2555
|
+
if (onRemoveTraveller) {
|
|
2556
|
+
onRemoveTraveller(adventure.id, t.id);
|
|
2557
|
+
} else {
|
|
2558
|
+
onRequestOpenDeleteModal == null ? void 0 : onRequestOpenDeleteModal(adventure.id, t);
|
|
2559
|
+
}
|
|
2560
|
+
},
|
|
2561
|
+
disabled: !canRemoveTraveller,
|
|
2562
|
+
title: disabledRemoveTitle,
|
|
2563
|
+
"aria-disabled": !canRemoveTraveller,
|
|
2564
|
+
className: cn(
|
|
2565
|
+
"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",
|
|
2566
|
+
"disabled:opacity-40 disabled:cursor-not-allowed disabled:pointer-events-none disabled:hover:text-muted-foreground disabled:hover:bg-transparent"
|
|
2567
|
+
),
|
|
2568
|
+
"aria-label": `Delete ${t.firstName}`,
|
|
2569
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { className: "w-3.5 h-3.5" })
|
|
2570
|
+
}
|
|
2571
|
+
),
|
|
2572
|
+
(onUnassignFromAdventure || onRemoveTraveller || hasConfirmRemoveTraveller) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2573
|
+
"button",
|
|
2574
|
+
{
|
|
2575
|
+
type: "button",
|
|
2576
|
+
onClick: () => {
|
|
2577
|
+
if (!canRemoveTraveller) return;
|
|
2578
|
+
if (onUnassignFromAdventure) {
|
|
2579
|
+
onUnassignFromAdventure(adventure.id, t.id);
|
|
2580
|
+
} else if (onRemoveTraveller) {
|
|
2581
|
+
onRemoveTraveller(adventure.id, t.id);
|
|
2582
|
+
} else {
|
|
2583
|
+
onRequestOpenDeleteModal == null ? void 0 : onRequestOpenDeleteModal(adventure.id, t);
|
|
2584
|
+
}
|
|
2585
|
+
},
|
|
2586
|
+
disabled: !canRemoveTraveller,
|
|
2587
|
+
title: disabledRemoveTitle,
|
|
2588
|
+
"aria-disabled": !canRemoveTraveller,
|
|
2589
|
+
className: cn(
|
|
2590
|
+
"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",
|
|
2591
|
+
"disabled:opacity-40 disabled:cursor-not-allowed disabled:pointer-events-none disabled:hover:text-muted-foreground disabled:hover:bg-transparent"
|
|
2592
|
+
),
|
|
2593
|
+
"aria-label": `Remove ${t.firstName} from adventure`,
|
|
2594
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserMinusIcon, { className: "w-3.5 h-3.5" })
|
|
2595
|
+
}
|
|
2596
|
+
)
|
|
2597
|
+
] })
|
|
2534
2598
|
] })
|
|
2535
|
-
]
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
)
|
|
2599
|
+
]
|
|
2600
|
+
},
|
|
2601
|
+
t.id
|
|
2602
|
+
);
|
|
2603
|
+
}) }),
|
|
2540
2604
|
adventure.suggestedTravellers && adventure.suggestedTravellers.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 pt-2", children: [
|
|
2541
2605
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground font-ui", children: "Add to this adventure" }),
|
|
2542
2606
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2", children: adventure.suggestedTravellers.map((st) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2582,111 +2646,303 @@ function AdventureSection({
|
|
|
2582
2646
|
] })
|
|
2583
2647
|
] });
|
|
2584
2648
|
})()
|
|
2585
|
-
] })
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
)
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2649
|
+
] })
|
|
2650
|
+
] });
|
|
2651
|
+
}
|
|
2652
|
+
function TravellerFormFields({ value, onChange, config }) {
|
|
2653
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
2654
|
+
const labels = (_a = config == null ? void 0 : config.labels) != null ? _a : {};
|
|
2655
|
+
const disabledTypes = new Set((_b = config == null ? void 0 : config.disabledPersonTypes) != null ? _b : []);
|
|
2656
|
+
const documentLabel = (config == null ? void 0 : config.requireCpf) ? (_c = labels.documentCpf) != null ? _c : "CPF" : (_d = labels.documentPassport) != null ? _d : "Passport (optional)";
|
|
2657
|
+
const documentPlaceholder = (config == null ? void 0 : config.requireCpf) ? "000.000.000-00" : void 0;
|
|
2658
|
+
const isChild = value.personType === "CHILD";
|
|
2659
|
+
const childEmail = config == null ? void 0 : config.childEmailFromContact;
|
|
2660
|
+
const emailRequired = value.personType === "ADULT" || value.personType === "SENIOR";
|
|
2661
|
+
const emailLabel = `${(_e = labels.email) != null ? _e : "Email"}${emailRequired ? " *" : ""}`;
|
|
2662
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2663
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2664
|
+
FloatingInput,
|
|
2665
|
+
{
|
|
2666
|
+
label: (_f = labels.firstName) != null ? _f : "First name *",
|
|
2667
|
+
required: true,
|
|
2668
|
+
value: value.firstName,
|
|
2669
|
+
onChange: (e) => onChange({ firstName: e.target.value })
|
|
2670
|
+
}
|
|
2671
|
+
),
|
|
2672
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2673
|
+
FloatingInput,
|
|
2674
|
+
{
|
|
2675
|
+
label: (_g = labels.lastName) != null ? _g : "Last name *",
|
|
2676
|
+
required: true,
|
|
2677
|
+
value: value.lastName,
|
|
2678
|
+
onChange: (e) => onChange({ lastName: e.target.value })
|
|
2679
|
+
}
|
|
2680
|
+
),
|
|
2681
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2682
|
+
FloatingInput,
|
|
2683
|
+
{
|
|
2684
|
+
label: documentLabel,
|
|
2685
|
+
placeholder: documentPlaceholder,
|
|
2686
|
+
value: (_h = value.documentNumber) != null ? _h : "",
|
|
2687
|
+
onChange: (e) => onChange({ documentNumber: e.target.value })
|
|
2688
|
+
}
|
|
2689
|
+
),
|
|
2690
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2691
|
+
FloatingSelect,
|
|
2692
|
+
{
|
|
2693
|
+
label: (_i = labels.personTypeLabel) != null ? _i : "Type (adult/child/senior)",
|
|
2694
|
+
value: value.personType,
|
|
2695
|
+
onChange: (e) => onChange({ personType: e.target.value }),
|
|
2696
|
+
children: [
|
|
2697
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "ADULT", disabled: disabledTypes.has("ADULT"), children: (_j = labels.personTypeAdult) != null ? _j : "Adult" }),
|
|
2698
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "CHILD", disabled: disabledTypes.has("CHILD"), children: (_k = labels.personTypeChild) != null ? _k : "Child" }),
|
|
2699
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "SENIOR", disabled: disabledTypes.has("SENIOR"), children: (_l = labels.personTypeSenior) != null ? _l : "Senior" })
|
|
2700
|
+
]
|
|
2701
|
+
}
|
|
2702
|
+
),
|
|
2703
|
+
isChild && childEmail ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2704
|
+
FloatingInput,
|
|
2705
|
+
{
|
|
2706
|
+
label: (_m = labels.email) != null ? _m : "Email",
|
|
2707
|
+
type: "email",
|
|
2708
|
+
value: childEmail,
|
|
2709
|
+
readOnly: true,
|
|
2710
|
+
disabled: true
|
|
2711
|
+
}
|
|
2712
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2713
|
+
FloatingInput,
|
|
2714
|
+
{
|
|
2715
|
+
label: emailLabel,
|
|
2716
|
+
type: "email",
|
|
2717
|
+
value: (_n = value.email) != null ? _n : "",
|
|
2718
|
+
onChange: (e) => onChange({ email: e.target.value }),
|
|
2719
|
+
required: emailRequired
|
|
2720
|
+
}
|
|
2721
|
+
),
|
|
2722
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2723
|
+
FloatingInput,
|
|
2724
|
+
{
|
|
2725
|
+
label: (_o = labels.birthDate) != null ? _o : "Date of birth",
|
|
2726
|
+
type: "date",
|
|
2727
|
+
value: (_p = value.birthDate) != null ? _p : "",
|
|
2728
|
+
onChange: (e) => onChange({ birthDate: e.target.value })
|
|
2729
|
+
}
|
|
2730
|
+
),
|
|
2731
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2732
|
+
FloatingInput,
|
|
2733
|
+
{
|
|
2734
|
+
label: (_q = labels.phone) != null ? _q : "Phone (optional)",
|
|
2735
|
+
type: "tel",
|
|
2736
|
+
value: (_r = value.phone) != null ? _r : "",
|
|
2737
|
+
onChange: (e) => onChange({ phone: e.target.value }),
|
|
2738
|
+
placeholder: "+5511987654321"
|
|
2739
|
+
}
|
|
2740
|
+
)
|
|
2741
|
+
] });
|
|
2742
|
+
}
|
|
2743
|
+
function createInitialAddFormData(config) {
|
|
2744
|
+
var _a;
|
|
2745
|
+
const disabled = new Set((_a = config == null ? void 0 : config.disabledPersonTypes) != null ? _a : []);
|
|
2746
|
+
const personType = !disabled.has("ADULT") ? "ADULT" : !disabled.has("CHILD") ? "CHILD" : "SENIOR";
|
|
2747
|
+
return {
|
|
2748
|
+
firstName: "",
|
|
2749
|
+
lastName: "",
|
|
2750
|
+
email: "",
|
|
2751
|
+
documentNumber: "",
|
|
2752
|
+
phone: "",
|
|
2753
|
+
birthDate: "",
|
|
2754
|
+
personType
|
|
2755
|
+
};
|
|
2756
|
+
}
|
|
2757
|
+
function AddTravellerDialog({
|
|
2758
|
+
open,
|
|
2759
|
+
adventureId,
|
|
2760
|
+
onClose,
|
|
2761
|
+
onSubmit,
|
|
2762
|
+
config,
|
|
2763
|
+
saving,
|
|
2764
|
+
errorMessage
|
|
2765
|
+
}) {
|
|
2766
|
+
var _a, _b, _c, _d, _e;
|
|
2767
|
+
const [form, setForm] = React22__namespace.useState(() => createInitialAddFormData(config));
|
|
2768
|
+
React22__namespace.useEffect(() => {
|
|
2769
|
+
if (open) {
|
|
2770
|
+
setForm(createInitialAddFormData(config));
|
|
2771
|
+
}
|
|
2772
|
+
}, [open, config]);
|
|
2773
|
+
const childEmailFromContact = config == null ? void 0 : config.childEmailFromContact;
|
|
2774
|
+
const labels = (_a = config == null ? void 0 : config.labels) != null ? _a : {};
|
|
2775
|
+
const handleSubmit = async (e) => {
|
|
2776
|
+
var _a2, _b2, _c2;
|
|
2777
|
+
e.preventDefault();
|
|
2778
|
+
if (!adventureId) return;
|
|
2779
|
+
const data = __spreadProps(__spreadValues({}, form), {
|
|
2780
|
+
firstName: form.firstName.trim(),
|
|
2781
|
+
lastName: form.lastName.trim(),
|
|
2782
|
+
email: form.personType === "CHILD" && childEmailFromContact ? childEmailFromContact : ((_a2 = form.email) == null ? void 0 : _a2.trim()) || void 0,
|
|
2783
|
+
documentNumber: ((_b2 = form.documentNumber) == null ? void 0 : _b2.trim()) || void 0,
|
|
2784
|
+
phone: ((_c2 = form.phone) == null ? void 0 : _c2.trim()) || void 0,
|
|
2785
|
+
birthDate: form.birthDate || void 0
|
|
2786
|
+
});
|
|
2787
|
+
await onSubmit(adventureId, data);
|
|
2788
|
+
};
|
|
2789
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2790
|
+
Dialog,
|
|
2791
|
+
{
|
|
2792
|
+
open,
|
|
2793
|
+
onOpenChange: (o) => {
|
|
2794
|
+
if (!o) onClose();
|
|
2795
|
+
},
|
|
2796
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "sm:max-w-lg", children: [
|
|
2797
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: "font-heading text-xl", children: (_b = labels.modalAddTitle) != null ? _b : "Add traveller" }) }),
|
|
2798
|
+
/* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleSubmit, className: "space-y-3", children: [
|
|
2657
2799
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2658
|
-
|
|
2800
|
+
TravellerFormFields,
|
|
2659
2801
|
{
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
children: "Cancel"
|
|
2802
|
+
value: form,
|
|
2803
|
+
onChange: (patch) => setForm((prev) => __spreadValues(__spreadValues({}, prev), patch)),
|
|
2804
|
+
config
|
|
2664
2805
|
}
|
|
2665
2806
|
),
|
|
2807
|
+
errorMessage && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive font-sans", children: errorMessage }),
|
|
2808
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { children: [
|
|
2809
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: onClose, children: (_c = labels.cancel) != null ? _c : "Cancel" }),
|
|
2810
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", size: "sm", disabled: saving, children: saving ? (_d = labels.saving) != null ? _d : "Saving..." : (_e = labels.add) != null ? _e : "Add" })
|
|
2811
|
+
] })
|
|
2812
|
+
] })
|
|
2813
|
+
] })
|
|
2814
|
+
}
|
|
2815
|
+
);
|
|
2816
|
+
}
|
|
2817
|
+
function EditTravellerDialog({
|
|
2818
|
+
open,
|
|
2819
|
+
adventureId,
|
|
2820
|
+
traveller,
|
|
2821
|
+
onClose,
|
|
2822
|
+
onSubmit,
|
|
2823
|
+
config,
|
|
2824
|
+
saving,
|
|
2825
|
+
errorMessage
|
|
2826
|
+
}) {
|
|
2827
|
+
var _a, _b, _c, _d, _e;
|
|
2828
|
+
const [form, setForm] = React22__namespace.useState(() => ({
|
|
2829
|
+
firstName: "",
|
|
2830
|
+
lastName: "",
|
|
2831
|
+
email: "",
|
|
2832
|
+
documentNumber: "",
|
|
2833
|
+
phone: "",
|
|
2834
|
+
birthDate: "",
|
|
2835
|
+
personType: "ADULT"
|
|
2836
|
+
}));
|
|
2837
|
+
React22__namespace.useEffect(() => {
|
|
2838
|
+
var _a2, _b2, _c2, _d2, _e2, _f;
|
|
2839
|
+
if (open && traveller) {
|
|
2840
|
+
setForm({
|
|
2841
|
+
firstName: (_a2 = traveller.firstName) != null ? _a2 : "",
|
|
2842
|
+
lastName: (_b2 = traveller.lastName) != null ? _b2 : "",
|
|
2843
|
+
email: (_c2 = traveller.email) != null ? _c2 : "",
|
|
2844
|
+
documentNumber: (_d2 = traveller.documentNumber) != null ? _d2 : "",
|
|
2845
|
+
phone: (_e2 = traveller.phone) != null ? _e2 : "",
|
|
2846
|
+
birthDate: traveller.birthDate ? traveller.birthDate.slice(0, 10) : "",
|
|
2847
|
+
personType: (_f = traveller.personType) != null ? _f : traveller.isChild ? "CHILD" : "ADULT"
|
|
2848
|
+
});
|
|
2849
|
+
}
|
|
2850
|
+
}, [open, traveller]);
|
|
2851
|
+
const childEmailFromContact = config == null ? void 0 : config.childEmailFromContact;
|
|
2852
|
+
const labels = (_a = config == null ? void 0 : config.labels) != null ? _a : {};
|
|
2853
|
+
const handleSubmit = async (e) => {
|
|
2854
|
+
var _a2, _b2, _c2;
|
|
2855
|
+
e.preventDefault();
|
|
2856
|
+
if (!adventureId || !traveller) return;
|
|
2857
|
+
const data = __spreadProps(__spreadValues({}, form), {
|
|
2858
|
+
firstName: form.firstName.trim(),
|
|
2859
|
+
lastName: form.lastName.trim(),
|
|
2860
|
+
email: form.personType === "CHILD" && childEmailFromContact ? childEmailFromContact : ((_a2 = form.email) == null ? void 0 : _a2.trim()) || void 0,
|
|
2861
|
+
documentNumber: ((_b2 = form.documentNumber) == null ? void 0 : _b2.trim()) || void 0,
|
|
2862
|
+
phone: ((_c2 = form.phone) == null ? void 0 : _c2.trim()) || void 0,
|
|
2863
|
+
birthDate: form.birthDate || void 0
|
|
2864
|
+
});
|
|
2865
|
+
await onSubmit(adventureId, traveller.id, data);
|
|
2866
|
+
};
|
|
2867
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2868
|
+
Dialog,
|
|
2869
|
+
{
|
|
2870
|
+
open,
|
|
2871
|
+
onOpenChange: (o) => {
|
|
2872
|
+
if (!o) onClose();
|
|
2873
|
+
},
|
|
2874
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "sm:max-w-lg", children: [
|
|
2875
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: "font-heading text-xl", children: (_b = labels.modalEditTitle) != null ? _b : "Edit traveller" }) }),
|
|
2876
|
+
/* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleSubmit, className: "space-y-3", children: [
|
|
2666
2877
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2667
|
-
|
|
2878
|
+
TravellerFormFields,
|
|
2879
|
+
{
|
|
2880
|
+
value: form,
|
|
2881
|
+
onChange: (patch) => setForm((prev) => __spreadValues(__spreadValues({}, prev), patch)),
|
|
2882
|
+
config
|
|
2883
|
+
}
|
|
2884
|
+
),
|
|
2885
|
+
errorMessage && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive font-sans", children: errorMessage }),
|
|
2886
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { children: [
|
|
2887
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: onClose, children: (_c = labels.cancel) != null ? _c : "Cancel" }),
|
|
2888
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", size: "sm", disabled: saving, children: saving ? (_d = labels.saving) != null ? _d : "Saving..." : (_e = labels.save) != null ? _e : "Save" })
|
|
2889
|
+
] })
|
|
2890
|
+
] })
|
|
2891
|
+
] })
|
|
2892
|
+
}
|
|
2893
|
+
);
|
|
2894
|
+
}
|
|
2895
|
+
function DeleteTravellerDialog({
|
|
2896
|
+
open,
|
|
2897
|
+
adventureId,
|
|
2898
|
+
traveller,
|
|
2899
|
+
onClose,
|
|
2900
|
+
onConfirm,
|
|
2901
|
+
config,
|
|
2902
|
+
saving,
|
|
2903
|
+
errorMessage
|
|
2904
|
+
}) {
|
|
2905
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
2906
|
+
const labels = (_a = config == null ? void 0 : config.labels) != null ? _a : {};
|
|
2907
|
+
const name = traveller ? `${(_b = traveller.firstName) != null ? _b : ""} ${(_c = traveller.lastName) != null ? _c : ""}`.trim() : "";
|
|
2908
|
+
const description = ((_d = labels.modalDeleteConfirm) != null ? _d : 'Delete traveller "{name}"?').replace(
|
|
2909
|
+
"{name}",
|
|
2910
|
+
name
|
|
2911
|
+
);
|
|
2912
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2913
|
+
Dialog,
|
|
2914
|
+
{
|
|
2915
|
+
open,
|
|
2916
|
+
onOpenChange: (o) => {
|
|
2917
|
+
if (!o) onClose();
|
|
2918
|
+
},
|
|
2919
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "sm:max-w-sm", children: [
|
|
2920
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
|
|
2921
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: (_e = labels.modalDeleteTitle) != null ? _e : "Delete traveller?" }),
|
|
2922
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogDescription, { children: description })
|
|
2923
|
+
] }),
|
|
2924
|
+
errorMessage && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive font-sans", children: errorMessage }),
|
|
2925
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { children: [
|
|
2926
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: onClose, children: (_f = labels.cancel) != null ? _f : "Cancel" }),
|
|
2927
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2928
|
+
Button,
|
|
2668
2929
|
{
|
|
2669
2930
|
type: "button",
|
|
2931
|
+
variant: "destructive",
|
|
2932
|
+
size: "sm",
|
|
2933
|
+
disabled: saving,
|
|
2670
2934
|
onClick: () => {
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
lastName: "",
|
|
2675
|
-
passport: "",
|
|
2676
|
-
type: "adult",
|
|
2677
|
-
email: "",
|
|
2678
|
-
dateOfBirth: "",
|
|
2679
|
-
phone: ""
|
|
2680
|
-
});
|
|
2935
|
+
if (adventureId && traveller) {
|
|
2936
|
+
void onConfirm(adventureId, traveller.id);
|
|
2937
|
+
}
|
|
2681
2938
|
},
|
|
2682
|
-
|
|
2683
|
-
children: "Add"
|
|
2939
|
+
children: saving ? (_h = (_g = labels.deleting) != null ? _g : labels.saving) != null ? _h : "Deleting..." : (_i = labels.delete) != null ? _i : "Delete"
|
|
2684
2940
|
}
|
|
2685
2941
|
)
|
|
2686
2942
|
] })
|
|
2687
2943
|
] })
|
|
2688
|
-
|
|
2689
|
-
|
|
2944
|
+
}
|
|
2945
|
+
);
|
|
2690
2946
|
}
|
|
2691
2947
|
function OrderSummary({
|
|
2692
2948
|
adventures,
|
|
@@ -2802,6 +3058,10 @@ function BookingDetails({
|
|
|
2802
3058
|
contact,
|
|
2803
3059
|
agentName,
|
|
2804
3060
|
agentContactUrl,
|
|
3061
|
+
agentNameFallback,
|
|
3062
|
+
agentLabel,
|
|
3063
|
+
agentContactLabel,
|
|
3064
|
+
cannotRemoveLastTravellerLabel,
|
|
2805
3065
|
adventures,
|
|
2806
3066
|
summaryLineItems,
|
|
2807
3067
|
subtotal,
|
|
@@ -2813,6 +3073,14 @@ function BookingDetails({
|
|
|
2813
3073
|
onAddSuggestedTraveller,
|
|
2814
3074
|
onAddTraveller,
|
|
2815
3075
|
onUnassignFromAdventure,
|
|
3076
|
+
onSubmitAddTraveller,
|
|
3077
|
+
onSubmitEditTraveller,
|
|
3078
|
+
onConfirmRemoveTraveller,
|
|
3079
|
+
travellerFormConfig,
|
|
3080
|
+
addTravellerSaving,
|
|
3081
|
+
editTravellerSaving,
|
|
3082
|
+
removeTravellerSaving,
|
|
3083
|
+
travellerFormError,
|
|
2816
3084
|
onPayBalance,
|
|
2817
3085
|
onCancelRequest,
|
|
2818
3086
|
logoSrc,
|
|
@@ -2823,6 +3091,72 @@ function BookingDetails({
|
|
|
2823
3091
|
}) {
|
|
2824
3092
|
var _a, _b, _c;
|
|
2825
3093
|
const people = totalPeople(adventures);
|
|
3094
|
+
const hasSubmitAddTraveller = !!onSubmitAddTraveller;
|
|
3095
|
+
const hasSubmitEditTraveller = !!onSubmitEditTraveller;
|
|
3096
|
+
const hasConfirmRemoveTraveller = !!onConfirmRemoveTraveller;
|
|
3097
|
+
const [addModalState, setAddModalState] = React22__namespace.useState({
|
|
3098
|
+
open: false,
|
|
3099
|
+
adventureId: null
|
|
3100
|
+
});
|
|
3101
|
+
const [editModalState, setEditModalState] = React22__namespace.useState({ open: false, adventureId: null, traveller: null });
|
|
3102
|
+
const [deleteModalState, setDeleteModalState] = React22__namespace.useState({ open: false, adventureId: null, traveller: null });
|
|
3103
|
+
const handleRequestOpenAddModal = React22__namespace.useCallback((adventureId) => {
|
|
3104
|
+
setAddModalState({ open: true, adventureId });
|
|
3105
|
+
}, []);
|
|
3106
|
+
const handleRequestOpenEditModal = React22__namespace.useCallback(
|
|
3107
|
+
(adventureId, traveller) => {
|
|
3108
|
+
setEditModalState({ open: true, adventureId, traveller });
|
|
3109
|
+
},
|
|
3110
|
+
[]
|
|
3111
|
+
);
|
|
3112
|
+
const handleRequestOpenDeleteModal = React22__namespace.useCallback(
|
|
3113
|
+
(adventureId, traveller) => {
|
|
3114
|
+
setDeleteModalState({ open: true, adventureId, traveller });
|
|
3115
|
+
},
|
|
3116
|
+
[]
|
|
3117
|
+
);
|
|
3118
|
+
const closeAddModal = React22__namespace.useCallback(() => {
|
|
3119
|
+
setAddModalState({ open: false, adventureId: null });
|
|
3120
|
+
}, []);
|
|
3121
|
+
const closeEditModal = React22__namespace.useCallback(() => {
|
|
3122
|
+
setEditModalState({ open: false, adventureId: null, traveller: null });
|
|
3123
|
+
}, []);
|
|
3124
|
+
const closeDeleteModal = React22__namespace.useCallback(() => {
|
|
3125
|
+
setDeleteModalState({ open: false, adventureId: null, traveller: null });
|
|
3126
|
+
}, []);
|
|
3127
|
+
const handleAddSubmit = React22__namespace.useCallback(
|
|
3128
|
+
async (adventureId, data) => {
|
|
3129
|
+
if (!onSubmitAddTraveller) return;
|
|
3130
|
+
try {
|
|
3131
|
+
await onSubmitAddTraveller(adventureId, data);
|
|
3132
|
+
closeAddModal();
|
|
3133
|
+
} catch (e) {
|
|
3134
|
+
}
|
|
3135
|
+
},
|
|
3136
|
+
[onSubmitAddTraveller, closeAddModal]
|
|
3137
|
+
);
|
|
3138
|
+
const handleEditSubmit = React22__namespace.useCallback(
|
|
3139
|
+
async (adventureId, travellerId, data) => {
|
|
3140
|
+
if (!onSubmitEditTraveller) return;
|
|
3141
|
+
try {
|
|
3142
|
+
await onSubmitEditTraveller(adventureId, travellerId, data);
|
|
3143
|
+
closeEditModal();
|
|
3144
|
+
} catch (e) {
|
|
3145
|
+
}
|
|
3146
|
+
},
|
|
3147
|
+
[onSubmitEditTraveller, closeEditModal]
|
|
3148
|
+
);
|
|
3149
|
+
const handleDeleteConfirm = React22__namespace.useCallback(
|
|
3150
|
+
async (adventureId, travellerId) => {
|
|
3151
|
+
if (!onConfirmRemoveTraveller) return;
|
|
3152
|
+
try {
|
|
3153
|
+
await onConfirmRemoveTraveller(adventureId, travellerId);
|
|
3154
|
+
closeDeleteModal();
|
|
3155
|
+
} catch (e) {
|
|
3156
|
+
}
|
|
3157
|
+
},
|
|
3158
|
+
[onConfirmRemoveTraveller, closeDeleteModal]
|
|
3159
|
+
);
|
|
2826
3160
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2827
3161
|
(logoSrc || onSignOut) && /* @__PURE__ */ jsxRuntime.jsx("header", { className: "w-full border-b border-border bg-card/50 backdrop-blur-sm sticky top-0 z-30", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full max-w-5xl mx-auto px-4 sm:px-6 lg:px-0 h-14 flex items-center justify-between gap-4", children: [
|
|
2828
3162
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1" }),
|
|
@@ -2877,26 +3211,49 @@ function BookingDetails({
|
|
|
2877
3211
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold", children: contact.name }),
|
|
2878
3212
|
contact.email && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground font-sans truncate", children: contact.email })
|
|
2879
3213
|
] }),
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
3214
|
+
(() => {
|
|
3215
|
+
const hasAgent = !!agentName;
|
|
3216
|
+
const displayName = hasAgent ? agentName : agentNameFallback != null ? agentNameFallback : "No agent assigned";
|
|
3217
|
+
const initial = hasAgent ? agentName.charAt(0) : "?";
|
|
3218
|
+
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: [
|
|
3219
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3220
|
+
"div",
|
|
3221
|
+
{
|
|
3222
|
+
className: cn(
|
|
3223
|
+
"flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-heading font-bold text-sm uppercase",
|
|
3224
|
+
hasAgent ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground"
|
|
3225
|
+
),
|
|
3226
|
+
children: initial
|
|
3227
|
+
}
|
|
3228
|
+
),
|
|
3229
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
|
|
3230
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: agentLabel != null ? agentLabel : "Your Agent" }),
|
|
3231
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3232
|
+
"p",
|
|
3233
|
+
{
|
|
3234
|
+
className: cn(
|
|
3235
|
+
"text-sm font-sans truncate",
|
|
3236
|
+
hasAgent ? "font-semibold text-foreground" : "italic text-muted-foreground"
|
|
3237
|
+
),
|
|
3238
|
+
children: displayName
|
|
3239
|
+
}
|
|
3240
|
+
)
|
|
3241
|
+
] }),
|
|
3242
|
+
hasAgent && agentContactUrl && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3243
|
+
"a",
|
|
3244
|
+
{
|
|
3245
|
+
href: agentContactUrl,
|
|
3246
|
+
target: "_blank",
|
|
3247
|
+
rel: "noopener noreferrer",
|
|
3248
|
+
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",
|
|
3249
|
+
children: [
|
|
3250
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageCircleIcon, { className: "w-3.5 h-3.5" }),
|
|
3251
|
+
agentContactLabel != null ? agentContactLabel : "Contact"
|
|
3252
|
+
]
|
|
3253
|
+
}
|
|
3254
|
+
)
|
|
3255
|
+
] });
|
|
3256
|
+
})(),
|
|
2900
3257
|
/* @__PURE__ */ jsxRuntime.jsxs(InfoCard, { label: "Total People", children: [
|
|
2901
3258
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2902
3259
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.UsersIcon, { className: "w-4 h-4 text-primary shrink-0" }),
|
|
@@ -2927,7 +3284,14 @@ function BookingDetails({
|
|
|
2927
3284
|
onRemoveTraveller,
|
|
2928
3285
|
onAddSuggestedTraveller,
|
|
2929
3286
|
onAddTraveller,
|
|
2930
|
-
onUnassignFromAdventure
|
|
3287
|
+
onUnassignFromAdventure,
|
|
3288
|
+
hasSubmitAddTraveller,
|
|
3289
|
+
hasSubmitEditTraveller,
|
|
3290
|
+
hasConfirmRemoveTraveller,
|
|
3291
|
+
onRequestOpenAddModal: handleRequestOpenAddModal,
|
|
3292
|
+
onRequestOpenEditModal: handleRequestOpenEditModal,
|
|
3293
|
+
onRequestOpenDeleteModal: handleRequestOpenDeleteModal,
|
|
3294
|
+
cannotRemoveLastTravellerLabel
|
|
2931
3295
|
},
|
|
2932
3296
|
adventure.id
|
|
2933
3297
|
))
|
|
@@ -3003,6 +3367,44 @@ function BookingDetails({
|
|
|
3003
3367
|
] })
|
|
3004
3368
|
]
|
|
3005
3369
|
}
|
|
3370
|
+
),
|
|
3371
|
+
hasSubmitAddTraveller && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3372
|
+
AddTravellerDialog,
|
|
3373
|
+
{
|
|
3374
|
+
open: addModalState.open,
|
|
3375
|
+
adventureId: addModalState.adventureId,
|
|
3376
|
+
onClose: closeAddModal,
|
|
3377
|
+
onSubmit: handleAddSubmit,
|
|
3378
|
+
config: travellerFormConfig,
|
|
3379
|
+
saving: addTravellerSaving,
|
|
3380
|
+
errorMessage: addModalState.open ? travellerFormError : null
|
|
3381
|
+
}
|
|
3382
|
+
),
|
|
3383
|
+
hasSubmitEditTraveller && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3384
|
+
EditTravellerDialog,
|
|
3385
|
+
{
|
|
3386
|
+
open: editModalState.open,
|
|
3387
|
+
adventureId: editModalState.adventureId,
|
|
3388
|
+
traveller: editModalState.traveller,
|
|
3389
|
+
onClose: closeEditModal,
|
|
3390
|
+
onSubmit: handleEditSubmit,
|
|
3391
|
+
config: travellerFormConfig,
|
|
3392
|
+
saving: editTravellerSaving,
|
|
3393
|
+
errorMessage: editModalState.open ? travellerFormError : null
|
|
3394
|
+
}
|
|
3395
|
+
),
|
|
3396
|
+
hasConfirmRemoveTraveller && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3397
|
+
DeleteTravellerDialog,
|
|
3398
|
+
{
|
|
3399
|
+
open: deleteModalState.open,
|
|
3400
|
+
adventureId: deleteModalState.adventureId,
|
|
3401
|
+
traveller: deleteModalState.traveller,
|
|
3402
|
+
onClose: closeDeleteModal,
|
|
3403
|
+
onConfirm: handleDeleteConfirm,
|
|
3404
|
+
config: travellerFormConfig,
|
|
3405
|
+
saving: removeTravellerSaving,
|
|
3406
|
+
errorMessage: deleteModalState.open ? travellerFormError : null
|
|
3407
|
+
}
|
|
3006
3408
|
)
|
|
3007
3409
|
] });
|
|
3008
3410
|
}
|