@planetaexo/design-system 0.51.0 → 0.52.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 +468 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +71 -2
- package/dist/index.d.ts +71 -2
- package/dist/index.js +468 -22
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React28 from 'react';
|
|
2
|
-
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
2
|
+
import { useState, useRef, useCallback, useEffect, useId } from 'react';
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -3541,6 +3541,7 @@ function BookingDetails({
|
|
|
3541
3541
|
status,
|
|
3542
3542
|
statusLabel,
|
|
3543
3543
|
createdAt,
|
|
3544
|
+
cancelledAt,
|
|
3544
3545
|
contact,
|
|
3545
3546
|
agent,
|
|
3546
3547
|
agentName,
|
|
@@ -3585,7 +3586,7 @@ function BookingDetails({
|
|
|
3585
3586
|
labels,
|
|
3586
3587
|
className
|
|
3587
3588
|
}) {
|
|
3588
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H;
|
|
3589
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J;
|
|
3589
3590
|
const people = totalPeople(adventures);
|
|
3590
3591
|
const hasSubmitAddTraveller = !!onSubmitAddTraveller;
|
|
3591
3592
|
const hasSubmitEditTraveller = !!onSubmitEditTraveller;
|
|
@@ -3718,12 +3719,18 @@ function BookingDetails({
|
|
|
3718
3719
|
bookingId
|
|
3719
3720
|
] })
|
|
3720
3721
|
] }),
|
|
3721
|
-
/* @__PURE__ */
|
|
3722
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground font-sans", children: [
|
|
3723
|
+
(_b = (_a = labels == null ? void 0 : labels.createdOn) == null ? void 0 : _a.call(labels, createdAt)) != null ? _b : `Created on ${createdAt}`,
|
|
3724
|
+
cancelledAt && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3725
|
+
", ",
|
|
3726
|
+
/* @__PURE__ */ jsx("span", { className: "text-destructive font-medium", children: (_d = (_c = labels == null ? void 0 : labels.cancelledOn) == null ? void 0 : _c.call(labels, cancelledAt)) != null ? _d : `cancelled on ${cancelledAt}` })
|
|
3727
|
+
] })
|
|
3728
|
+
] })
|
|
3722
3729
|
] }),
|
|
3723
3730
|
/* @__PURE__ */ jsx(StatusBadge, { status, label: statusLabel })
|
|
3724
3731
|
] }),
|
|
3725
3732
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-3", children: [
|
|
3726
|
-
/* @__PURE__ */ jsxs(InfoCard, { label: (
|
|
3733
|
+
/* @__PURE__ */ jsxs(InfoCard, { label: (_e = labels == null ? void 0 : labels.contactInfo) != null ? _e : "Contact", children: [
|
|
3727
3734
|
/* @__PURE__ */ jsx("p", { className: "font-semibold", children: contact.name }),
|
|
3728
3735
|
contact.email && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground font-sans truncate", children: contact.email })
|
|
3729
3736
|
] }),
|
|
@@ -3731,7 +3738,7 @@ function BookingDetails({
|
|
|
3731
3738
|
AgentContactCard,
|
|
3732
3739
|
{
|
|
3733
3740
|
layout: "compact",
|
|
3734
|
-
name: (
|
|
3741
|
+
name: (_f = agent == null ? void 0 : agent.name) != null ? _f : agentName,
|
|
3735
3742
|
avatar: agent == null ? void 0 : agent.avatar,
|
|
3736
3743
|
email: agent == null ? void 0 : agent.email,
|
|
3737
3744
|
whatsappUrl: agent == null ? void 0 : agent.whatsappUrl,
|
|
@@ -3741,20 +3748,20 @@ function BookingDetails({
|
|
|
3741
3748
|
legacyContactLabel: agentContactLabel
|
|
3742
3749
|
}
|
|
3743
3750
|
),
|
|
3744
|
-
/* @__PURE__ */ jsxs(InfoCard, { label: (
|
|
3751
|
+
/* @__PURE__ */ jsxs(InfoCard, { label: (_g = labels == null ? void 0 : labels.totalPeople) != null ? _g : "Total People", children: [
|
|
3745
3752
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3746
3753
|
/* @__PURE__ */ jsx(UsersIcon, { className: "w-4 h-4 text-primary shrink-0" }),
|
|
3747
|
-
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: (
|
|
3754
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: (_i = (_h = labels == null ? void 0 : labels.personCount) == null ? void 0 : _h.call(labels, people.total)) != null ? _i : `${people.total} person(s)` })
|
|
3748
3755
|
] }),
|
|
3749
3756
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground font-sans", children: [
|
|
3750
|
-
people.adults > 0 ? (
|
|
3751
|
-
people.children > 0 ? (
|
|
3752
|
-
people.seniors > 0 ? (
|
|
3757
|
+
people.adults > 0 ? (_l = (_k = (_j = labels == null ? void 0 : labels.peopleBreakdown) == null ? void 0 : _j.adults) == null ? void 0 : _k.call(_j, people.adults)) != null ? _l : `Adults: ${people.adults}` : null,
|
|
3758
|
+
people.children > 0 ? (_o = (_n = (_m = labels == null ? void 0 : labels.peopleBreakdown) == null ? void 0 : _m.children) == null ? void 0 : _n.call(_m, people.children)) != null ? _o : `Children: ${people.children}` : null,
|
|
3759
|
+
people.seniors > 0 ? (_r = (_q = (_p = labels == null ? void 0 : labels.peopleBreakdown) == null ? void 0 : _p.seniors) == null ? void 0 : _q.call(_p, people.seniors)) != null ? _r : `Seniors: ${people.seniors}` : null
|
|
3753
3760
|
].filter(Boolean).join(" \xB7 ") })
|
|
3754
3761
|
] })
|
|
3755
3762
|
] }),
|
|
3756
3763
|
/* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-4", children: [
|
|
3757
|
-
/* @__PURE__ */ jsx("h2", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: (
|
|
3764
|
+
/* @__PURE__ */ jsx("h2", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: (_t = (_s = labels == null ? void 0 : labels.adventuresSection) == null ? void 0 : _s.call(labels, adventures.length)) != null ? _t : `Adventures (${adventures.length})` }),
|
|
3758
3765
|
adventures.map((adventure) => /* @__PURE__ */ jsx(
|
|
3759
3766
|
AdventureSection,
|
|
3760
3767
|
{
|
|
@@ -3799,23 +3806,23 @@ function BookingDetails({
|
|
|
3799
3806
|
/* @__PURE__ */ jsx("h3", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: contactSectionLabel != null ? contactSectionLabel : "Responsible Person" }),
|
|
3800
3807
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-x-6 gap-y-3", children: [
|
|
3801
3808
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
3802
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-bold text-muted-foreground/60 font-heading uppercase tracking-widest mb-0.5", children: (
|
|
3809
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-bold text-muted-foreground/60 font-heading uppercase tracking-widest mb-0.5", children: (_v = (_u = labels == null ? void 0 : labels.contactDetailsFields) == null ? void 0 : _u.name) != null ? _v : "Name" }),
|
|
3803
3810
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold text-foreground font-sans", children: contact.name })
|
|
3804
3811
|
] }),
|
|
3805
3812
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
3806
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-bold text-muted-foreground/60 font-heading uppercase tracking-widest mb-0.5", children: (
|
|
3807
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-foreground font-sans truncate", children: (
|
|
3813
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-bold text-muted-foreground/60 font-heading uppercase tracking-widest mb-0.5", children: (_x = (_w = labels == null ? void 0 : labels.contactDetailsFields) == null ? void 0 : _w.email) != null ? _x : "Email" }),
|
|
3814
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-foreground font-sans truncate", children: (_y = contact.email) != null ? _y : "\u2014" })
|
|
3808
3815
|
] }),
|
|
3809
3816
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
3810
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-bold text-muted-foreground/60 font-heading uppercase tracking-widest mb-0.5", children: (
|
|
3811
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-foreground font-sans", children: (
|
|
3817
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-bold text-muted-foreground/60 font-heading uppercase tracking-widest mb-0.5", children: (_A = (_z = labels == null ? void 0 : labels.contactDetailsFields) == null ? void 0 : _z.phone) != null ? _A : "Phone" }),
|
|
3818
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-foreground font-sans", children: (_B = contact.phone) != null ? _B : "\u2014" })
|
|
3812
3819
|
] }),
|
|
3813
3820
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
3814
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-bold text-muted-foreground/60 font-heading uppercase tracking-widest mb-0.5", children: (
|
|
3815
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-foreground font-sans", children: (
|
|
3821
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-bold text-muted-foreground/60 font-heading uppercase tracking-widest mb-0.5", children: (_D = (_C = labels == null ? void 0 : labels.contactDetailsFields) == null ? void 0 : _C.country) != null ? _D : "Country" }),
|
|
3822
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-foreground font-sans", children: (_E = contact.country) != null ? _E : "\u2014" })
|
|
3816
3823
|
] }),
|
|
3817
3824
|
contact.passport && /* @__PURE__ */ jsxs("div", { children: [
|
|
3818
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-bold text-muted-foreground/60 font-heading uppercase tracking-widest mb-0.5", children: (
|
|
3825
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-bold text-muted-foreground/60 font-heading uppercase tracking-widest mb-0.5", children: (_G = (_F = labels == null ? void 0 : labels.contactDetailsFields) == null ? void 0 : _F.document) != null ? _G : "Passport / ID" }),
|
|
3819
3826
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-foreground font-sans", children: contact.passport })
|
|
3820
3827
|
] }),
|
|
3821
3828
|
(() => {
|
|
@@ -3876,7 +3883,7 @@ function BookingDetails({
|
|
|
3876
3883
|
className: "flex items-center gap-1.5 text-xs font-ui text-muted-foreground hover:text-destructive transition-colors underline underline-offset-2",
|
|
3877
3884
|
children: [
|
|
3878
3885
|
/* @__PURE__ */ jsx(AlertCircleIcon, { className: "w-3 h-3" }),
|
|
3879
|
-
(
|
|
3886
|
+
(_H = labels == null ? void 0 : labels.cancelRequestLabel) != null ? _H : "Request cancellation"
|
|
3880
3887
|
]
|
|
3881
3888
|
}
|
|
3882
3889
|
)
|
|
@@ -3926,7 +3933,7 @@ function BookingDetails({
|
|
|
3926
3933
|
ResendInviteConfirmDialog,
|
|
3927
3934
|
{
|
|
3928
3935
|
open: resendInviteDialogState.open,
|
|
3929
|
-
travellerName: resendInviteDialogState.traveller ? `${(
|
|
3936
|
+
travellerName: resendInviteDialogState.traveller ? `${(_I = resendInviteDialogState.traveller.firstName) != null ? _I : ""} ${(_J = resendInviteDialogState.traveller.lastName) != null ? _J : ""}`.trim() : "",
|
|
3930
3937
|
onClose: closeResendInviteDialog,
|
|
3931
3938
|
onConfirm: () => {
|
|
3932
3939
|
const traveller = resendInviteDialogState.traveller;
|
|
@@ -14270,7 +14277,446 @@ function LeadCapturePopup({
|
|
|
14270
14277
|
}
|
|
14271
14278
|
);
|
|
14272
14279
|
}
|
|
14280
|
+
function ExoOrb({
|
|
14281
|
+
size = 80,
|
|
14282
|
+
logoSrc = "/white_transparent_exo.png",
|
|
14283
|
+
pulse = true,
|
|
14284
|
+
trackCursor = true,
|
|
14285
|
+
className
|
|
14286
|
+
}) {
|
|
14287
|
+
const uid = useId().replace(/:/g, "");
|
|
14288
|
+
const id = (name) => `exo-orb-${uid}-${name}`;
|
|
14289
|
+
const rootRef = useRef(null);
|
|
14290
|
+
const pupilRef = useRef(null);
|
|
14291
|
+
useEffect(() => {
|
|
14292
|
+
if (!trackCursor) return;
|
|
14293
|
+
if (typeof window === "undefined") return;
|
|
14294
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
14295
|
+
const root = rootRef.current;
|
|
14296
|
+
const pupil = pupilRef.current;
|
|
14297
|
+
if (!root || !pupil) return;
|
|
14298
|
+
const MAX_OFFSET = 3.5;
|
|
14299
|
+
const REACH_PX = 260;
|
|
14300
|
+
const EASE = 0.18;
|
|
14301
|
+
let targetX = 0, targetY = 0, curX = 0, curY = 0;
|
|
14302
|
+
let raf = 0;
|
|
14303
|
+
const onMove = (e) => {
|
|
14304
|
+
const r = root.getBoundingClientRect();
|
|
14305
|
+
const cx = r.left + r.width / 2;
|
|
14306
|
+
const cy = r.top + r.height / 2;
|
|
14307
|
+
const dx = e.clientX - cx;
|
|
14308
|
+
const dy = e.clientY - cy;
|
|
14309
|
+
const dist = Math.hypot(dx, dy) || 1;
|
|
14310
|
+
const factor = Math.min(dist, REACH_PX) / REACH_PX;
|
|
14311
|
+
targetX = dx / dist * MAX_OFFSET * factor;
|
|
14312
|
+
targetY = dy / dist * MAX_OFFSET * factor;
|
|
14313
|
+
};
|
|
14314
|
+
const onLeave = () => {
|
|
14315
|
+
targetX = 0;
|
|
14316
|
+
targetY = 0;
|
|
14317
|
+
};
|
|
14318
|
+
const tick = () => {
|
|
14319
|
+
curX += (targetX - curX) * EASE;
|
|
14320
|
+
curY += (targetY - curY) * EASE;
|
|
14321
|
+
pupil.setAttribute(
|
|
14322
|
+
"transform",
|
|
14323
|
+
`translate(${curX.toFixed(2)} ${curY.toFixed(2)})`
|
|
14324
|
+
);
|
|
14325
|
+
raf = requestAnimationFrame(tick);
|
|
14326
|
+
};
|
|
14327
|
+
window.addEventListener("pointermove", onMove, { passive: true });
|
|
14328
|
+
window.addEventListener("pointerleave", onLeave);
|
|
14329
|
+
window.addEventListener("blur", onLeave);
|
|
14330
|
+
raf = requestAnimationFrame(tick);
|
|
14331
|
+
return () => {
|
|
14332
|
+
cancelAnimationFrame(raf);
|
|
14333
|
+
window.removeEventListener("pointermove", onMove);
|
|
14334
|
+
window.removeEventListener("pointerleave", onLeave);
|
|
14335
|
+
window.removeEventListener("blur", onLeave);
|
|
14336
|
+
};
|
|
14337
|
+
}, [trackCursor]);
|
|
14338
|
+
return /* @__PURE__ */ jsxs(
|
|
14339
|
+
"span",
|
|
14340
|
+
{
|
|
14341
|
+
ref: rootRef,
|
|
14342
|
+
"aria-hidden": "true",
|
|
14343
|
+
className: cn("inline-block leading-none", className),
|
|
14344
|
+
style: { width: size, height: size },
|
|
14345
|
+
children: [
|
|
14346
|
+
/* @__PURE__ */ jsxs(
|
|
14347
|
+
"svg",
|
|
14348
|
+
{
|
|
14349
|
+
width: size,
|
|
14350
|
+
height: size,
|
|
14351
|
+
viewBox: "0 0 100 100",
|
|
14352
|
+
fill: "none",
|
|
14353
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14354
|
+
className: cn(
|
|
14355
|
+
"block overflow-visible",
|
|
14356
|
+
pulse && "motion-safe:animate-[exo-orb-pulse_3.6s_ease-in-out_infinite]"
|
|
14357
|
+
),
|
|
14358
|
+
children: [
|
|
14359
|
+
/* @__PURE__ */ jsxs("defs", { children: [
|
|
14360
|
+
/* @__PURE__ */ jsxs("radialGradient", { id: id("body"), cx: "35%", cy: "30%", r: "75%", children: [
|
|
14361
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "#a8efe2" }),
|
|
14362
|
+
/* @__PURE__ */ jsx("stop", { offset: "35%", stopColor: "#5bd3bf" }),
|
|
14363
|
+
/* @__PURE__ */ jsx("stop", { offset: "70%", stopColor: "#47bca9" }),
|
|
14364
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "#155b52" })
|
|
14365
|
+
] }),
|
|
14366
|
+
/* @__PURE__ */ jsxs("radialGradient", { id: id("highlight"), cx: "30%", cy: "22%", r: "35%", children: [
|
|
14367
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "#ffffff", stopOpacity: "0.85" }),
|
|
14368
|
+
/* @__PURE__ */ jsx("stop", { offset: "60%", stopColor: "#ffffff", stopOpacity: "0.10" }),
|
|
14369
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "#ffffff", stopOpacity: "0" })
|
|
14370
|
+
] }),
|
|
14371
|
+
/* @__PURE__ */ jsxs("radialGradient", { id: id("rim"), cx: "60%", cy: "85%", r: "65%", children: [
|
|
14372
|
+
/* @__PURE__ */ jsx("stop", { offset: "60%", stopColor: "#000000", stopOpacity: "0" }),
|
|
14373
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "#000000", stopOpacity: "0.35" })
|
|
14374
|
+
] }),
|
|
14375
|
+
/* @__PURE__ */ jsxs(
|
|
14376
|
+
"filter",
|
|
14377
|
+
{
|
|
14378
|
+
id: id("glow"),
|
|
14379
|
+
x: "-60%",
|
|
14380
|
+
y: "-60%",
|
|
14381
|
+
width: "220%",
|
|
14382
|
+
height: "220%",
|
|
14383
|
+
children: [
|
|
14384
|
+
/* @__PURE__ */ jsx("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "6", result: "blur" }),
|
|
14385
|
+
/* @__PURE__ */ jsx(
|
|
14386
|
+
"feColorMatrix",
|
|
14387
|
+
{
|
|
14388
|
+
in: "blur",
|
|
14389
|
+
type: "matrix",
|
|
14390
|
+
values: "0 0 0 0 0.28\n 0 0 0 0 0.74\n 0 0 0 0 0.66\n 0 0 0 1 0",
|
|
14391
|
+
result: "tinted"
|
|
14392
|
+
}
|
|
14393
|
+
),
|
|
14394
|
+
/* @__PURE__ */ jsx("feComponentTransfer", { in: "tinted", result: "strong", children: /* @__PURE__ */ jsx("feFuncA", { type: "linear", slope: 1.6 }) }),
|
|
14395
|
+
/* @__PURE__ */ jsxs("feMerge", { children: [
|
|
14396
|
+
/* @__PURE__ */ jsx("feMergeNode", { in: "strong" }),
|
|
14397
|
+
/* @__PURE__ */ jsx("feMergeNode", { in: "SourceGraphic" })
|
|
14398
|
+
] })
|
|
14399
|
+
]
|
|
14400
|
+
}
|
|
14401
|
+
),
|
|
14402
|
+
/* @__PURE__ */ jsx("clipPath", { id: id("clip"), children: /* @__PURE__ */ jsx("circle", { cx: "50", cy: "50", r: "22" }) })
|
|
14403
|
+
] }),
|
|
14404
|
+
/* @__PURE__ */ jsx(
|
|
14405
|
+
"circle",
|
|
14406
|
+
{
|
|
14407
|
+
cx: "50",
|
|
14408
|
+
cy: "50",
|
|
14409
|
+
r: "30",
|
|
14410
|
+
fill: "#47bca9",
|
|
14411
|
+
opacity: "0.18",
|
|
14412
|
+
filter: `url(#${id("glow")})`
|
|
14413
|
+
}
|
|
14414
|
+
),
|
|
14415
|
+
/* @__PURE__ */ jsxs("g", { filter: `url(#${id("glow")})`, children: [
|
|
14416
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "50", r: "22", fill: `url(#${id("body")})` }),
|
|
14417
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "50", r: "22", fill: `url(#${id("highlight")})` }),
|
|
14418
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "50", r: "22", fill: `url(#${id("rim")})` })
|
|
14419
|
+
] }),
|
|
14420
|
+
/* @__PURE__ */ jsx(
|
|
14421
|
+
"path",
|
|
14422
|
+
{
|
|
14423
|
+
d: "M 34 38 Q 50 28 66 38",
|
|
14424
|
+
stroke: "#ffffff",
|
|
14425
|
+
strokeOpacity: "0.45",
|
|
14426
|
+
strokeWidth: "1.4",
|
|
14427
|
+
strokeLinecap: "round",
|
|
14428
|
+
fill: "none"
|
|
14429
|
+
}
|
|
14430
|
+
),
|
|
14431
|
+
/* @__PURE__ */ jsx("g", { clipPath: `url(#${id("clip")})`, children: /* @__PURE__ */ jsx("g", { ref: pupilRef, children: /* @__PURE__ */ jsx(
|
|
14432
|
+
"image",
|
|
14433
|
+
{
|
|
14434
|
+
href: logoSrc,
|
|
14435
|
+
x: "33.8",
|
|
14436
|
+
y: "33.8",
|
|
14437
|
+
width: "32.4",
|
|
14438
|
+
height: "32.4",
|
|
14439
|
+
preserveAspectRatio: "xMidYMid meet"
|
|
14440
|
+
}
|
|
14441
|
+
) }) })
|
|
14442
|
+
]
|
|
14443
|
+
}
|
|
14444
|
+
),
|
|
14445
|
+
/* @__PURE__ */ jsx("style", { children: `@keyframes exo-orb-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.04)}}` })
|
|
14446
|
+
]
|
|
14447
|
+
}
|
|
14448
|
+
);
|
|
14449
|
+
}
|
|
14450
|
+
function Textarea(_a) {
|
|
14451
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
14452
|
+
return /* @__PURE__ */ jsx(
|
|
14453
|
+
"textarea",
|
|
14454
|
+
__spreadValues({
|
|
14455
|
+
"data-slot": "textarea",
|
|
14456
|
+
className: cn(
|
|
14457
|
+
"flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
|
|
14458
|
+
className
|
|
14459
|
+
)
|
|
14460
|
+
}, props)
|
|
14461
|
+
);
|
|
14462
|
+
}
|
|
14463
|
+
var DEFAULT_BASE_URL = "https://staging.ask.planetaexo.com";
|
|
14464
|
+
var DEFAULT_SUGGESTIONS = [
|
|
14465
|
+
{ label: "Where do I start?", ask: "I am new to PlanetaEXO, what should I check out first?" },
|
|
14466
|
+
{ label: "Destinations", ask: "What destinations does PlanetaEXO offer?" },
|
|
14467
|
+
{ label: "5 days in the Amazon", ask: "Plan a 5-day trip to the Amazon for two travelers." },
|
|
14468
|
+
{ label: "Mount Roraima trek", ask: "What is included in the Mount Roraima trek?" },
|
|
14469
|
+
{ label: "Best time for Pantanal", ask: "Best time of year to visit the Pantanal?" },
|
|
14470
|
+
{ label: "Fitness level needed", ask: "How fit do I need to be for an EXO trek?" }
|
|
14471
|
+
];
|
|
14472
|
+
function AskExo({
|
|
14473
|
+
baseUrl = DEFAULT_BASE_URL,
|
|
14474
|
+
variant = "suggestions",
|
|
14475
|
+
eyebrow = "PLANETAEXO",
|
|
14476
|
+
title = "Ask EXO",
|
|
14477
|
+
subtitle = "Our AI travel concierge will answer in seconds.",
|
|
14478
|
+
suggestions = DEFAULT_SUGGESTIONS,
|
|
14479
|
+
inputPlaceholder,
|
|
14480
|
+
submitLabel = "Ask",
|
|
14481
|
+
logoSrc = "/white_transparent_exo.png",
|
|
14482
|
+
className,
|
|
14483
|
+
teaser = "Need help?",
|
|
14484
|
+
teaserDelayMs = 2500,
|
|
14485
|
+
teaserDurationMs = 6e3
|
|
14486
|
+
}) {
|
|
14487
|
+
const [open, setOpen] = useState(false);
|
|
14488
|
+
const [question, setQuestion] = useState("");
|
|
14489
|
+
const [teaserVisible, setTeaserVisible] = useState(false);
|
|
14490
|
+
const teaserEnabled = !!teaser && teaser !== "";
|
|
14491
|
+
const inputRef = useRef(null);
|
|
14492
|
+
const textareaRef = useRef(null);
|
|
14493
|
+
useEffect(() => {
|
|
14494
|
+
if (!open) {
|
|
14495
|
+
setQuestion("");
|
|
14496
|
+
return;
|
|
14497
|
+
}
|
|
14498
|
+
const t = setTimeout(() => {
|
|
14499
|
+
var _a, _b;
|
|
14500
|
+
if (variant === "compose") (_a = textareaRef.current) == null ? void 0 : _a.focus();
|
|
14501
|
+
else (_b = inputRef.current) == null ? void 0 : _b.focus();
|
|
14502
|
+
}, 200);
|
|
14503
|
+
return () => clearTimeout(t);
|
|
14504
|
+
}, [open, variant]);
|
|
14505
|
+
useEffect(() => {
|
|
14506
|
+
if (!open) return;
|
|
14507
|
+
const onKey = (e) => {
|
|
14508
|
+
if (e.key === "Escape") setOpen(false);
|
|
14509
|
+
};
|
|
14510
|
+
document.addEventListener("keydown", onKey);
|
|
14511
|
+
return () => document.removeEventListener("keydown", onKey);
|
|
14512
|
+
}, [open]);
|
|
14513
|
+
useEffect(() => {
|
|
14514
|
+
if (!teaserEnabled || open) return;
|
|
14515
|
+
if (typeof window === "undefined") return;
|
|
14516
|
+
const showTimer = setTimeout(() => setTeaserVisible(true), teaserDelayMs);
|
|
14517
|
+
const hideTimer = setTimeout(
|
|
14518
|
+
() => setTeaserVisible(false),
|
|
14519
|
+
teaserDelayMs + teaserDurationMs
|
|
14520
|
+
);
|
|
14521
|
+
return () => {
|
|
14522
|
+
clearTimeout(showTimer);
|
|
14523
|
+
clearTimeout(hideTimer);
|
|
14524
|
+
};
|
|
14525
|
+
}, [teaserEnabled, teaserDelayMs, teaserDurationMs, open]);
|
|
14526
|
+
useEffect(() => {
|
|
14527
|
+
if (open) setTeaserVisible(false);
|
|
14528
|
+
}, [open]);
|
|
14529
|
+
const askExo = (q) => {
|
|
14530
|
+
const trimmed = q.trim();
|
|
14531
|
+
if (!trimmed) return;
|
|
14532
|
+
const url = baseUrl.replace(/\/+$/, "") + "/?q=" + encodeURIComponent(trimmed) + "&source=" + encodeURIComponent(window.location.href);
|
|
14533
|
+
window.open(url, "_blank", "noopener,noreferrer");
|
|
14534
|
+
setOpen(false);
|
|
14535
|
+
};
|
|
14536
|
+
const placeholder = inputPlaceholder != null ? inputPlaceholder : variant === "compose" ? "Type your question\u2026" : "Ask your own question\u2026";
|
|
14537
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14538
|
+
teaserEnabled && /* @__PURE__ */ jsx(
|
|
14539
|
+
"button",
|
|
14540
|
+
{
|
|
14541
|
+
type: "button",
|
|
14542
|
+
"aria-hidden": !teaserVisible,
|
|
14543
|
+
tabIndex: teaserVisible ? 0 : -1,
|
|
14544
|
+
onClick: () => setOpen(true),
|
|
14545
|
+
className: cn(
|
|
14546
|
+
// shape + tone
|
|
14547
|
+
"fixed right-24 bottom-13 z-40 cursor-pointer rounded-full border border-border bg-card px-3.5 py-1.5",
|
|
14548
|
+
"font-sans text-[12.5px] leading-none font-normal whitespace-nowrap text-muted-foreground",
|
|
14549
|
+
"shadow-[0_6px_18px_oklch(0.20_0.002_60_/_0.12)]",
|
|
14550
|
+
// entrance / exit animation
|
|
14551
|
+
"transition-[opacity,transform,color] duration-300 ease-out",
|
|
14552
|
+
teaserVisible ? "translate-x-0 scale-100 opacity-100" : "pointer-events-none translate-x-1 scale-95 opacity-0",
|
|
14553
|
+
// hover
|
|
14554
|
+
"hover:text-foreground",
|
|
14555
|
+
// a11y
|
|
14556
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-offset-2",
|
|
14557
|
+
"max-[480px]:hidden"
|
|
14558
|
+
),
|
|
14559
|
+
children: teaser
|
|
14560
|
+
}
|
|
14561
|
+
),
|
|
14562
|
+
/* @__PURE__ */ jsx(
|
|
14563
|
+
"button",
|
|
14564
|
+
{
|
|
14565
|
+
type: "button",
|
|
14566
|
+
"aria-label": open ? "Close Ask EXO" : "Open Ask EXO",
|
|
14567
|
+
"aria-expanded": open,
|
|
14568
|
+
"aria-controls": "ask-exo-panel",
|
|
14569
|
+
onClick: () => setOpen((v) => !v),
|
|
14570
|
+
className: cn(
|
|
14571
|
+
"fixed right-5 bottom-6 z-40 size-20 cursor-pointer border-0 bg-transparent p-0",
|
|
14572
|
+
"transition-transform duration-200 ease-out hover:-translate-y-px hover:scale-[1.04] active:translate-y-0 active:scale-[0.98]",
|
|
14573
|
+
"focus-visible:outline-none [-webkit-tap-highlight-color:transparent]"
|
|
14574
|
+
),
|
|
14575
|
+
children: /* @__PURE__ */ jsx(ExoOrb, { size: 80, logoSrc })
|
|
14576
|
+
}
|
|
14577
|
+
),
|
|
14578
|
+
/* @__PURE__ */ jsxs(
|
|
14579
|
+
"aside",
|
|
14580
|
+
{
|
|
14581
|
+
id: "ask-exo-panel",
|
|
14582
|
+
role: "dialog",
|
|
14583
|
+
"aria-labelledby": "ask-exo-title",
|
|
14584
|
+
"aria-hidden": !open,
|
|
14585
|
+
"data-open": open,
|
|
14586
|
+
className: cn(
|
|
14587
|
+
"fixed right-5 bottom-30 z-50 w-[400px] max-h-[min(640px,80vh)]",
|
|
14588
|
+
variant === "compose" && "max-h-[min(560px,82vh)]",
|
|
14589
|
+
"flex flex-col overflow-hidden rounded-2xl border border-border bg-card text-card-foreground",
|
|
14590
|
+
"shadow-[0_40px_100px_oklch(0.20_0.002_60_/_0.35)]",
|
|
14591
|
+
"transition-[opacity,transform] duration-200 ease-out",
|
|
14592
|
+
"data-[open=false]:pointer-events-none data-[open=false]:translate-y-4 data-[open=false]:scale-[0.985] data-[open=false]:opacity-0",
|
|
14593
|
+
"data-[open=true]:pointer-events-auto data-[open=true]:translate-y-0 data-[open=true]:scale-100 data-[open=true]:opacity-100",
|
|
14594
|
+
"max-[480px]:right-2 max-[480px]:bottom-28 max-[480px]:w-[calc(100%-1rem)] max-[480px]:rounded-xl",
|
|
14595
|
+
className
|
|
14596
|
+
),
|
|
14597
|
+
children: [
|
|
14598
|
+
/* @__PURE__ */ jsxs("header", { className: "relative border-b border-border bg-gradient-to-b from-primary-300/20 to-transparent px-5 py-4", children: [
|
|
14599
|
+
/* @__PURE__ */ jsx("p", { className: "m-0 mb-1 font-ui text-[10.5px] font-bold tracking-[1.4px] text-primary-800 uppercase", children: eyebrow }),
|
|
14600
|
+
/* @__PURE__ */ jsx(
|
|
14601
|
+
"h2",
|
|
14602
|
+
{
|
|
14603
|
+
id: "ask-exo-title",
|
|
14604
|
+
className: "m-0 font-heading text-[20px] font-bold tracking-[-0.3px] text-foreground",
|
|
14605
|
+
children: title
|
|
14606
|
+
}
|
|
14607
|
+
),
|
|
14608
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "mt-1.5 mb-0 font-sans text-[13.5px] leading-relaxed text-muted-foreground", children: subtitle }),
|
|
14609
|
+
/* @__PURE__ */ jsx(
|
|
14610
|
+
"button",
|
|
14611
|
+
{
|
|
14612
|
+
type: "button",
|
|
14613
|
+
"aria-label": "Close",
|
|
14614
|
+
onClick: () => setOpen(false),
|
|
14615
|
+
className: cn(
|
|
14616
|
+
"absolute top-3 right-3 inline-flex size-8 cursor-pointer items-center justify-center rounded-full border-0 bg-transparent text-muted-foreground transition-colors",
|
|
14617
|
+
"hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50"
|
|
14618
|
+
),
|
|
14619
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "size-4" })
|
|
14620
|
+
}
|
|
14621
|
+
)
|
|
14622
|
+
] }),
|
|
14623
|
+
variant === "compose" ? (
|
|
14624
|
+
/* — Compose variant: just a big textarea — */
|
|
14625
|
+
/* @__PURE__ */ jsxs(
|
|
14626
|
+
"form",
|
|
14627
|
+
{
|
|
14628
|
+
className: "flex flex-1 flex-col gap-2.5 overflow-y-auto p-5",
|
|
14629
|
+
onSubmit: (e) => {
|
|
14630
|
+
e.preventDefault();
|
|
14631
|
+
askExo(question);
|
|
14632
|
+
},
|
|
14633
|
+
children: [
|
|
14634
|
+
/* @__PURE__ */ jsx(
|
|
14635
|
+
Textarea,
|
|
14636
|
+
{
|
|
14637
|
+
ref: textareaRef,
|
|
14638
|
+
placeholder,
|
|
14639
|
+
value: question,
|
|
14640
|
+
onChange: (e) => setQuestion(e.target.value),
|
|
14641
|
+
maxLength: 500,
|
|
14642
|
+
className: "min-h-[220px] flex-1 resize-y bg-muted/50 px-4 py-3.5 font-sans text-[15px] leading-relaxed placeholder:italic focus-visible:bg-card"
|
|
14643
|
+
}
|
|
14644
|
+
),
|
|
14645
|
+
/* @__PURE__ */ jsx(
|
|
14646
|
+
Button2,
|
|
14647
|
+
{
|
|
14648
|
+
type: "submit",
|
|
14649
|
+
disabled: !question.trim(),
|
|
14650
|
+
className: "h-11 w-full font-ui text-[13px] font-bold tracking-[0.5px] uppercase",
|
|
14651
|
+
children: submitLabel
|
|
14652
|
+
}
|
|
14653
|
+
),
|
|
14654
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 mb-0 text-center font-ui text-[10.5px] font-bold tracking-[0.5px] text-muted-foreground uppercase", children: "Opens in a new tab" })
|
|
14655
|
+
]
|
|
14656
|
+
}
|
|
14657
|
+
)
|
|
14658
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14659
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-3.5 overflow-y-auto px-5 py-4", children: [
|
|
14660
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 mb-0 font-ui text-[10.5px] font-bold tracking-[1.2px] text-muted-foreground uppercase", children: "Suggested questions" }),
|
|
14661
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: suggestions.map((s) => /* @__PURE__ */ jsx(
|
|
14662
|
+
"button",
|
|
14663
|
+
{
|
|
14664
|
+
type: "button",
|
|
14665
|
+
onClick: () => askExo(s.ask),
|
|
14666
|
+
className: cn(
|
|
14667
|
+
"cursor-pointer rounded-full border border-border bg-muted/60 px-3.5 py-2 text-left font-ui text-[12.5px] font-bold leading-tight text-foreground",
|
|
14668
|
+
"transition-colors hover:border-primary hover:bg-primary-100 hover:text-primary-800",
|
|
14669
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50"
|
|
14670
|
+
),
|
|
14671
|
+
children: s.label
|
|
14672
|
+
},
|
|
14673
|
+
s.label
|
|
14674
|
+
)) })
|
|
14675
|
+
] }),
|
|
14676
|
+
/* @__PURE__ */ jsxs("footer", { className: "border-t border-border bg-card px-4 py-3.5", children: [
|
|
14677
|
+
/* @__PURE__ */ jsxs(
|
|
14678
|
+
"form",
|
|
14679
|
+
{
|
|
14680
|
+
className: "flex items-stretch gap-2",
|
|
14681
|
+
onSubmit: (e) => {
|
|
14682
|
+
e.preventDefault();
|
|
14683
|
+
askExo(question);
|
|
14684
|
+
},
|
|
14685
|
+
children: [
|
|
14686
|
+
/* @__PURE__ */ jsx(
|
|
14687
|
+
Input,
|
|
14688
|
+
{
|
|
14689
|
+
ref: inputRef,
|
|
14690
|
+
type: "text",
|
|
14691
|
+
placeholder,
|
|
14692
|
+
value: question,
|
|
14693
|
+
onChange: (e) => setQuestion(e.target.value),
|
|
14694
|
+
maxLength: 500,
|
|
14695
|
+
"aria-label": "Ask EXO",
|
|
14696
|
+
className: "h-10 flex-1 rounded-xl bg-muted/50 px-3.5 py-2.5 font-sans text-[14.5px] focus-visible:bg-card"
|
|
14697
|
+
}
|
|
14698
|
+
),
|
|
14699
|
+
/* @__PURE__ */ jsx(
|
|
14700
|
+
Button2,
|
|
14701
|
+
{
|
|
14702
|
+
type: "submit",
|
|
14703
|
+
disabled: !question.trim(),
|
|
14704
|
+
className: "h-10 min-w-[86px] rounded-xl font-ui text-[12px] font-bold tracking-[0.5px] uppercase",
|
|
14705
|
+
children: submitLabel
|
|
14706
|
+
}
|
|
14707
|
+
)
|
|
14708
|
+
]
|
|
14709
|
+
}
|
|
14710
|
+
),
|
|
14711
|
+
/* @__PURE__ */ jsx("p", { className: "mt-2.5 mb-0 text-center font-ui text-[10.5px] font-bold tracking-[0.5px] text-muted-foreground uppercase", children: "Opens in a new tab" })
|
|
14712
|
+
] })
|
|
14713
|
+
] })
|
|
14714
|
+
]
|
|
14715
|
+
}
|
|
14716
|
+
)
|
|
14717
|
+
] });
|
|
14718
|
+
}
|
|
14273
14719
|
|
|
14274
|
-
export { ActivityCard, AgentContactCard, Alert, BirthDateField, BookingAdventureCard, BookingCancellationEmail, BookingConfirmedCard, BookingCreatedEmail, BookingDetails, BookingForm, BookingOtpEmail, BookingPaymentConfirmationEmail, BookingShell, BookingSummary, Button, COUNTRIES, CounterField, CountrySearchField, DEFAULT_HEADER_LINKS, DEFAULT_LANGUAGES, DatePickerField, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, FilterPanel, FloatingInput, FloatingSelect, Itinerary, ItineraryDay, LOGO_PLANETAEXO_DATA_URI, LeadCapturePopup, MenuTrip, OTPCodeInput, Offer, OfferAdventureCard, PartnerBookingCreatedEmail, PartnerRegistrationCompleteEmail, PaymentAmountSelector, PaymentDetailsBlock, PaymentMethodSelector, PaymentModalShell, PaymentReceiptEmail, PaymentReminderEmail, PhoneCountrySelect, PhotoGallery, PricingTrip, RegistrationForm, RegistrationProgressBar, RegistrationReminderEmail, RegistrationReminderIndividualEmail, RegistrationSuccessCard, SiteHeader, TERMS_ACCEPT_KEY, TermsSection, ThemeToggle, Toast, TransferDetailsBlock, TravellerFormInviteEmail, TripCard, TripHeader, TripPage, TrustpilotEmbed, buttonVariants, cn, emailTokens, formatCpf, getStripeAppearance, itineraryDaySpecIcons, stripeAppearance, validateCpf, wrapEmailHtml };
|
|
14720
|
+
export { ActivityCard, AgentContactCard, Alert, AskExo, BirthDateField, BookingAdventureCard, BookingCancellationEmail, BookingConfirmedCard, BookingCreatedEmail, BookingDetails, BookingForm, BookingOtpEmail, BookingPaymentConfirmationEmail, BookingShell, BookingSummary, Button, COUNTRIES, CounterField, CountrySearchField, DEFAULT_HEADER_LINKS, DEFAULT_LANGUAGES, DatePickerField, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, ExoOrb, FilterPanel, FloatingInput, FloatingSelect, Itinerary, ItineraryDay, LOGO_PLANETAEXO_DATA_URI, LeadCapturePopup, MenuTrip, OTPCodeInput, Offer, OfferAdventureCard, PartnerBookingCreatedEmail, PartnerRegistrationCompleteEmail, PaymentAmountSelector, PaymentDetailsBlock, PaymentMethodSelector, PaymentModalShell, PaymentReceiptEmail, PaymentReminderEmail, PhoneCountrySelect, PhotoGallery, PricingTrip, RegistrationForm, RegistrationProgressBar, RegistrationReminderEmail, RegistrationReminderIndividualEmail, RegistrationSuccessCard, SiteHeader, TERMS_ACCEPT_KEY, TermsSection, ThemeToggle, Toast, TransferDetailsBlock, TravellerFormInviteEmail, TripCard, TripHeader, TripPage, TrustpilotEmbed, buttonVariants, cn, emailTokens, formatCpf, getStripeAppearance, itineraryDaySpecIcons, stripeAppearance, validateCpf, wrapEmailHtml };
|
|
14275
14721
|
//# sourceMappingURL=index.js.map
|
|
14276
14722
|
//# sourceMappingURL=index.js.map
|