@planetaexo/design-system 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +40 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +40 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -288,6 +288,9 @@ interface BookingAdventure {
|
|
|
288
288
|
addTravellerLabel?: string;
|
|
289
289
|
/** Texto curto exibido em mobile (sm:hidden). Default: "Add". */
|
|
290
290
|
addTravellerShortLabel?: string;
|
|
291
|
+
/** Tooltip exibido quando chips de "Add to this adventure" estão desabilitados por capacidade.
|
|
292
|
+
* Default: "Adventure full". */
|
|
293
|
+
atCapacityLabel?: string;
|
|
291
294
|
}
|
|
292
295
|
interface BookingContact {
|
|
293
296
|
name: string;
|
|
@@ -341,6 +344,9 @@ interface BookingDetailsProps {
|
|
|
341
344
|
onAddTraveller?: (adventureId: string) => void;
|
|
342
345
|
/** Quando fornecida, desassocia o viajante da aventura sem deletá-lo da reserva. */
|
|
343
346
|
onUnassignFromAdventure?: (adventureId: string, travellerId: string) => void;
|
|
347
|
+
/** Quando fornecida, o consumer assume clipboard + feedback visual (ex.: toast). Fallback:
|
|
348
|
+
* `navigator.clipboard.writeText` sem feedback. */
|
|
349
|
+
onCopyFormLink?: (url: string) => void;
|
|
344
350
|
/** Submit do modal de ADD interno. Usado quando `onAddTraveller` NÃO é passado. */
|
|
345
351
|
onSubmitAddTraveller?: (adventureId: string, data: TravellerFormData) => Promise<void> | void;
|
|
346
352
|
/** Submit do modal de EDIT interno. Usado quando `onEditTraveller` NÃO é passado. */
|
|
@@ -369,7 +375,7 @@ interface BookingDetailsProps {
|
|
|
369
375
|
signOutLabel?: string;
|
|
370
376
|
className?: string;
|
|
371
377
|
}
|
|
372
|
-
declare function BookingDetails({ bookingId, status, createdAt, contact, agentName, agentContactUrl, agentNameFallback, agentLabel, agentContactLabel, cannotRemoveLastTravellerLabel, adventures, summaryLineItems, subtotal, total, depositInfo, onAddContactAsTraveller, onEditTraveller, onRemoveTraveller, onAddSuggestedTraveller, onAddTraveller, onUnassignFromAdventure, onSubmitAddTraveller, onSubmitEditTraveller, onConfirmRemoveTraveller, travellerFormConfig, addTravellerSaving, editTravellerSaving, removeTravellerSaving, travellerFormError, onPayBalance, onCancelRequest, logoSrc, logoAlt, onSignOut, signOutLabel, className, }: BookingDetailsProps): react_jsx_runtime.JSX.Element;
|
|
378
|
+
declare function BookingDetails({ bookingId, status, createdAt, contact, agentName, agentContactUrl, agentNameFallback, agentLabel, agentContactLabel, cannotRemoveLastTravellerLabel, adventures, summaryLineItems, subtotal, total, depositInfo, onAddContactAsTraveller, onEditTraveller, onRemoveTraveller, onAddSuggestedTraveller, onAddTraveller, onUnassignFromAdventure, onCopyFormLink, onSubmitAddTraveller, onSubmitEditTraveller, onConfirmRemoveTraveller, travellerFormConfig, addTravellerSaving, editTravellerSaving, removeTravellerSaving, travellerFormError, onPayBalance, onCancelRequest, logoSrc, logoAlt, onSignOut, signOutLabel, className, }: BookingDetailsProps): react_jsx_runtime.JSX.Element;
|
|
373
379
|
|
|
374
380
|
interface BookingConfirmationLabels {
|
|
375
381
|
ctaButton?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -288,6 +288,9 @@ interface BookingAdventure {
|
|
|
288
288
|
addTravellerLabel?: string;
|
|
289
289
|
/** Texto curto exibido em mobile (sm:hidden). Default: "Add". */
|
|
290
290
|
addTravellerShortLabel?: string;
|
|
291
|
+
/** Tooltip exibido quando chips de "Add to this adventure" estão desabilitados por capacidade.
|
|
292
|
+
* Default: "Adventure full". */
|
|
293
|
+
atCapacityLabel?: string;
|
|
291
294
|
}
|
|
292
295
|
interface BookingContact {
|
|
293
296
|
name: string;
|
|
@@ -341,6 +344,9 @@ interface BookingDetailsProps {
|
|
|
341
344
|
onAddTraveller?: (adventureId: string) => void;
|
|
342
345
|
/** Quando fornecida, desassocia o viajante da aventura sem deletá-lo da reserva. */
|
|
343
346
|
onUnassignFromAdventure?: (adventureId: string, travellerId: string) => void;
|
|
347
|
+
/** Quando fornecida, o consumer assume clipboard + feedback visual (ex.: toast). Fallback:
|
|
348
|
+
* `navigator.clipboard.writeText` sem feedback. */
|
|
349
|
+
onCopyFormLink?: (url: string) => void;
|
|
344
350
|
/** Submit do modal de ADD interno. Usado quando `onAddTraveller` NÃO é passado. */
|
|
345
351
|
onSubmitAddTraveller?: (adventureId: string, data: TravellerFormData) => Promise<void> | void;
|
|
346
352
|
/** Submit do modal de EDIT interno. Usado quando `onEditTraveller` NÃO é passado. */
|
|
@@ -369,7 +375,7 @@ interface BookingDetailsProps {
|
|
|
369
375
|
signOutLabel?: string;
|
|
370
376
|
className?: string;
|
|
371
377
|
}
|
|
372
|
-
declare function BookingDetails({ bookingId, status, createdAt, contact, agentName, agentContactUrl, agentNameFallback, agentLabel, agentContactLabel, cannotRemoveLastTravellerLabel, adventures, summaryLineItems, subtotal, total, depositInfo, onAddContactAsTraveller, onEditTraveller, onRemoveTraveller, onAddSuggestedTraveller, onAddTraveller, onUnassignFromAdventure, onSubmitAddTraveller, onSubmitEditTraveller, onConfirmRemoveTraveller, travellerFormConfig, addTravellerSaving, editTravellerSaving, removeTravellerSaving, travellerFormError, onPayBalance, onCancelRequest, logoSrc, logoAlt, onSignOut, signOutLabel, className, }: BookingDetailsProps): react_jsx_runtime.JSX.Element;
|
|
378
|
+
declare function BookingDetails({ bookingId, status, createdAt, contact, agentName, agentContactUrl, agentNameFallback, agentLabel, agentContactLabel, cannotRemoveLastTravellerLabel, adventures, summaryLineItems, subtotal, total, depositInfo, onAddContactAsTraveller, onEditTraveller, onRemoveTraveller, onAddSuggestedTraveller, onAddTraveller, onUnassignFromAdventure, onCopyFormLink, onSubmitAddTraveller, onSubmitEditTraveller, onConfirmRemoveTraveller, travellerFormConfig, addTravellerSaving, editTravellerSaving, removeTravellerSaving, travellerFormError, onPayBalance, onCancelRequest, logoSrc, logoAlt, onSignOut, signOutLabel, className, }: BookingDetailsProps): react_jsx_runtime.JSX.Element;
|
|
373
379
|
|
|
374
380
|
interface BookingConfirmationLabels {
|
|
375
381
|
ctaButton?: string;
|
package/dist/index.js
CHANGED
|
@@ -2255,6 +2255,7 @@ function AdventureSection({
|
|
|
2255
2255
|
onAddSuggestedTraveller,
|
|
2256
2256
|
onAddTraveller,
|
|
2257
2257
|
onUnassignFromAdventure,
|
|
2258
|
+
onCopyFormLink,
|
|
2258
2259
|
hasSubmitAddTraveller,
|
|
2259
2260
|
hasSubmitEditTraveller,
|
|
2260
2261
|
hasConfirmRemoveTraveller,
|
|
@@ -2266,7 +2267,11 @@ function AdventureSection({
|
|
|
2266
2267
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
2267
2268
|
const [detailsOpen, setDetailsOpen] = React22.useState(false);
|
|
2268
2269
|
const handleCopyUrl = (url) => {
|
|
2269
|
-
|
|
2270
|
+
if (onCopyFormLink) {
|
|
2271
|
+
onCopyFormLink(url);
|
|
2272
|
+
} else {
|
|
2273
|
+
void navigator.clipboard.writeText(url);
|
|
2274
|
+
}
|
|
2270
2275
|
};
|
|
2271
2276
|
const people = adventure.slots;
|
|
2272
2277
|
[
|
|
@@ -2569,24 +2574,38 @@ function AdventureSection({
|
|
|
2569
2574
|
t.id
|
|
2570
2575
|
);
|
|
2571
2576
|
}) }),
|
|
2572
|
-
adventure.suggestedTravellers && adventure.suggestedTravellers.length > 0 &&
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2577
|
+
adventure.suggestedTravellers && adventure.suggestedTravellers.length > 0 && (() => {
|
|
2578
|
+
var _a2;
|
|
2579
|
+
const atCapacity = totalSlots > 0 && adventure.travellers.length >= totalSlots;
|
|
2580
|
+
const atCapacityTooltip = atCapacity ? (_a2 = adventure.atCapacityLabel) != null ? _a2 : "Adventure full" : void 0;
|
|
2581
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 pt-2", children: [
|
|
2582
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground font-ui", children: "Add to this adventure" }),
|
|
2583
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: adventure.suggestedTravellers.map((st) => /* @__PURE__ */ jsxs(
|
|
2584
|
+
"button",
|
|
2585
|
+
{
|
|
2586
|
+
type: "button",
|
|
2587
|
+
onClick: () => {
|
|
2588
|
+
if (atCapacity) return;
|
|
2589
|
+
onAddSuggestedTraveller == null ? void 0 : onAddSuggestedTraveller(adventure.id, st.id);
|
|
2590
|
+
},
|
|
2591
|
+
disabled: atCapacity,
|
|
2592
|
+
title: atCapacityTooltip,
|
|
2593
|
+
"aria-disabled": atCapacity,
|
|
2594
|
+
className: cn(
|
|
2595
|
+
"flex items-center gap-1.5 rounded-full border border-border px-3 py-1.5 text-xs font-ui text-foreground hover:border-primary hover:text-primary hover:bg-primary/5 transition-colors",
|
|
2596
|
+
"disabled:opacity-40 disabled:cursor-not-allowed disabled:pointer-events-none disabled:hover:border-border disabled:hover:text-foreground disabled:hover:bg-transparent"
|
|
2597
|
+
),
|
|
2598
|
+
children: [
|
|
2599
|
+
/* @__PURE__ */ jsx(PlusIcon, { className: "w-3 h-3" }),
|
|
2600
|
+
st.firstName,
|
|
2601
|
+
" ",
|
|
2602
|
+
st.lastName
|
|
2603
|
+
]
|
|
2604
|
+
},
|
|
2605
|
+
st.id
|
|
2606
|
+
)) })
|
|
2607
|
+
] });
|
|
2608
|
+
})(),
|
|
2590
2609
|
adventure.travellers.length > 0 && totalSlots > 0 && (() => {
|
|
2591
2610
|
const completed = adventure.travellers.filter((t) => t.status === "completed").length;
|
|
2592
2611
|
const percent = Math.round(completed / totalSlots * 100);
|
|
@@ -3041,6 +3060,7 @@ function BookingDetails({
|
|
|
3041
3060
|
onAddSuggestedTraveller,
|
|
3042
3061
|
onAddTraveller,
|
|
3043
3062
|
onUnassignFromAdventure,
|
|
3063
|
+
onCopyFormLink,
|
|
3044
3064
|
onSubmitAddTraveller,
|
|
3045
3065
|
onSubmitEditTraveller,
|
|
3046
3066
|
onConfirmRemoveTraveller,
|
|
@@ -3253,6 +3273,7 @@ function BookingDetails({
|
|
|
3253
3273
|
onAddSuggestedTraveller,
|
|
3254
3274
|
onAddTraveller,
|
|
3255
3275
|
onUnassignFromAdventure,
|
|
3276
|
+
onCopyFormLink,
|
|
3256
3277
|
hasSubmitAddTraveller,
|
|
3257
3278
|
hasSubmitEditTraveller,
|
|
3258
3279
|
hasConfirmRemoveTraveller,
|