@voyant-travel/bookings-react 0.186.0 → 0.187.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.
@@ -203,6 +203,19 @@ export function BookingJourney(props) {
203
203
  (quote.data.available === false ||
204
204
  (quote.data.invalidReason != null && quote.data.invalidReason !== ""));
205
205
  const quoteBlocked = hasQuoteError || quoteUnpriceable;
206
+ // The pristine baseline quote is intentionally un-priceable: a product has no
207
+ // price until its price driver — a room, or a traveler count — is chosen, and
208
+ // the engine reports that empty draft as `no_sell_amount_configured`. Suppress
209
+ // the un-priceable banner (and the side-panel error) for exactly that baseline
210
+ // so step 1 doesn't scream "can't be priced" before the buyer has picked
211
+ // anything. Any other reason (e.g. `rates_missing` on an already-picked stay,
212
+ // #2638), or the same code once a driver IS picked (a room that carries no
213
+ // price), still surfaces. Commit stays gated on `quoteBlocked` regardless, so
214
+ // an unpriced booking can never be submitted.
215
+ const priceDriversConfigured = (draft?.configure?.optionSelections?.length ?? 0) > 0 ||
216
+ Object.values(draft?.configure?.pax ?? {}).reduce((sum, n) => sum + (n ?? 0), 0) > 0;
217
+ const isPristineUnconfigured = quote.data?.invalidReason === "no_sell_amount_configured" && !priceDriversConfigured;
218
+ const showQuoteUnpriceable = quoteBlocked && !isPristineUnconfigured;
206
219
  const quoteReady = Boolean(quote.data?.quoteId);
207
220
  // Step navigation only hard-blocks on a thrown quote error (a transient fetch
208
221
  // failure that a retry fixes). An un-priceable quote (e.g. `rates_missing`
@@ -404,7 +417,7 @@ export function BookingJourney(props) {
404
417
  setConfirmError(null);
405
418
  void quote.refetch();
406
419
  };
407
- const quoteErrorBanner = quoteBlocked ? (_jsxs("div", { role: "alert", "aria-live": "polite", className: "flex flex-col items-start gap-2 rounded-md border border-destructive/40 bg-destructive/5 p-3 text-destructive text-sm", children: [_jsx("span", { children: hasQuoteError
420
+ const quoteErrorBanner = showQuoteUnpriceable ? (_jsxs("div", { role: "alert", "aria-live": "polite", className: "flex flex-col items-start gap-2 rounded-md border border-destructive/40 bg-destructive/5 p-3 text-destructive text-sm", children: [_jsx("span", { children: hasQuoteError
408
421
  ? messages.bookingJourney.validation.quoteFailed
409
422
  : messages.bookingJourney.validation.pricingUnavailable }), hasQuoteError ? (_jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: retryQuote, disabled: quote.isQuoting, children: messages.bookingJourney.validation.retryQuote })) : null] })) : null;
410
423
  // Renders one step's content. Shared by both layouts — the wizard shows
@@ -31,7 +31,7 @@ export function PriceSidePanel({ pricing, isQuoting, invalidReason, entitySummar
31
31
  // Departure shows directly under the product title — it's the most-glanced
32
32
  // fact, so it doesn't belong buried in the recap accordion.
33
33
  const departureText = draft ? stepHeadline("departure", draft, messages, locale) : "";
34
- return (_jsxs(Card, { className: className, children: [entitySummary?.heroImageUrl ? (_jsx("img", { src: entitySummary.heroImageUrl, alt: entitySummary.name, className: "aspect-video w-full object-cover" })) : null, entitySummary ? (_jsx(EntityHeader, { summary: entitySummary, departureText: departureText })) : null, _jsxs(CardContent, { className: "space-y-4", children: [steps && steps.length > 0 && currentStep && draft ? (_jsx(StepRecap, { steps: steps, currentStep: currentStep, draft: draft })) : null, invalidReason ? _jsx("p", { className: "text-destructive text-sm", children: invalidReason }) : null, !showPricing ? (_jsx("p", { className: "border-t pt-4 text-muted-foreground text-sm", children: pricingHint })) : isQuoting && !pricing ? (_jsxs("div", { className: "space-y-2 border-t pt-4", children: [_jsx(Skeleton, { className: "h-4 w-24" }), _jsx(Skeleton, { className: "h-4 w-32" }), _jsx(Skeleton, { className: "h-4 w-20" })] })) : null, showPricing && pricing ? (_jsxs("div", { className: "space-y-2 border-t pt-4", children: [_jsx("ul", { className: "space-y-1 text-sm", children: pricing.lines.map((line) => (_jsxs("li", { className: "flex justify-between", children: [_jsxs("span", { children: [line.label, line.quantity ? (_jsxs("span", { className: "text-muted-foreground", children: [" \u00D7 ", line.quantity] })) : null] }), _jsx("span", { children: formatMoney(line.totalAmount, pricing.currency, locale) })] }, `${line.kind}-${line.label}-${line.totalAmount}`))) }), pricing.taxes.length > 0 ? (_jsx("ul", { className: "space-y-1 border-t pt-2 text-sm text-muted-foreground", children: pricing.taxes.map((tax) => (_jsxs("li", { className: "flex justify-between", children: [_jsxs("span", { children: [tax.label, tax.rate > 0 ? ` (${formatTaxRate(tax.rate)})` : ""] }), _jsx("span", { children: formatMoney(tax.amount, pricing.currency, locale) })] }, tax.code))) })) : null, _jsxs("div", { className: "flex justify-between border-t pt-2 font-medium", children: [_jsx("span", { children: messages.bookingJourney.sidePanel.total }), _jsx("span", { children: formatMoney(pricing.total, pricing.currency, locale) })] })] })) : null, pricingExtras ? _jsx("div", { className: "border-t pt-4", children: pricingExtras }) : null] })] }));
34
+ return (_jsxs(Card, { className: className, children: [entitySummary?.heroImageUrl ? (_jsx("img", { src: entitySummary.heroImageUrl, alt: entitySummary.name, className: "aspect-video w-full object-cover" })) : null, entitySummary ? (_jsx(EntityHeader, { summary: entitySummary, departureText: departureText })) : null, _jsxs(CardContent, { className: "space-y-4", children: [steps && steps.length > 0 && currentStep && draft ? (_jsx(StepRecap, { steps: steps, currentStep: currentStep, draft: draft })) : null, invalidReason && showPricing ? (_jsx("p", { className: "text-destructive text-sm", children: messages.bookingJourney.validation.pricingUnavailable })) : null, !showPricing ? (_jsx("p", { className: "border-t pt-4 text-muted-foreground text-sm", children: pricingHint })) : isQuoting && !pricing ? (_jsxs("div", { className: "space-y-2 border-t pt-4", children: [_jsx(Skeleton, { className: "h-4 w-24" }), _jsx(Skeleton, { className: "h-4 w-32" }), _jsx(Skeleton, { className: "h-4 w-20" })] })) : null, showPricing && pricing ? (_jsxs("div", { className: "space-y-2 border-t pt-4", children: [_jsx("ul", { className: "space-y-1 text-sm", children: pricing.lines.map((line) => (_jsxs("li", { className: "flex justify-between", children: [_jsxs("span", { children: [line.label, line.quantity ? (_jsxs("span", { className: "text-muted-foreground", children: [" \u00D7 ", line.quantity] })) : null] }), _jsx("span", { children: formatMoney(line.totalAmount, pricing.currency, locale) })] }, `${line.kind}-${line.label}-${line.totalAmount}`))) }), pricing.taxes.length > 0 ? (_jsx("ul", { className: "space-y-1 border-t pt-2 text-sm text-muted-foreground", children: pricing.taxes.map((tax) => (_jsxs("li", { className: "flex justify-between", children: [_jsxs("span", { children: [tax.label, tax.rate > 0 ? ` (${formatTaxRate(tax.rate)})` : ""] }), _jsx("span", { children: formatMoney(tax.amount, pricing.currency, locale) })] }, tax.code))) })) : null, _jsxs("div", { className: "flex justify-between border-t pt-2 font-medium", children: [_jsx("span", { children: messages.bookingJourney.sidePanel.total }), _jsx("span", { children: formatMoney(pricing.total, pricing.currency, locale) })] })] })) : null, pricingExtras ? _jsx("div", { className: "border-t pt-4", children: pricingExtras }) : null] })] }));
35
35
  }
36
36
  function EntityHeader({ summary, departureText, }) {
37
37
  // Text block only — the hero image is rendered as a direct Card child above.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyant-travel/bookings-react",
3
- "version": "0.186.0",
3
+ "version": "0.187.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -150,24 +150,24 @@
150
150
  "react-dom": "^19.0.0",
151
151
  "react-hook-form": "^7.80.0",
152
152
  "zod": "^4.0.0",
153
- "@voyant-travel/accommodations": "^0.146.0",
153
+ "@voyant-travel/accommodations": "^0.147.0",
154
154
  "@voyant-travel/admin": "^0.128.3",
155
- "@voyant-travel/bookings": "^0.186.0",
156
- "@voyant-travel/catalog": "^0.184.0",
157
- "@voyant-travel/catalog-react": "^0.184.0",
158
- "@voyant-travel/distribution-react": "^0.176.0",
159
- "@voyant-travel/relationships-react": "^0.186.0",
160
- "@voyant-travel/finance": "^0.186.0",
161
- "@voyant-travel/finance-react": "^0.186.0",
162
- "@voyant-travel/identity-react": "^0.186.0",
163
- "@voyant-travel/legal-react": "^0.186.0",
164
- "@voyant-travel/commerce-react": "^0.68.0",
165
- "@voyant-travel/cruises": "^0.185.0",
166
- "@voyant-travel/inventory-react": "^0.68.0",
167
- "@voyant-travel/inventory": "^0.14.22",
168
- "@voyant-travel/storefront-react": "^0.188.0",
155
+ "@voyant-travel/bookings": "^0.187.0",
156
+ "@voyant-travel/catalog": "^0.185.0",
157
+ "@voyant-travel/catalog-react": "^0.185.0",
158
+ "@voyant-travel/distribution-react": "^0.177.0",
159
+ "@voyant-travel/relationships-react": "^0.187.0",
160
+ "@voyant-travel/finance": "^0.187.0",
161
+ "@voyant-travel/finance-react": "^0.187.0",
162
+ "@voyant-travel/identity-react": "^0.187.0",
163
+ "@voyant-travel/legal-react": "^0.187.0",
164
+ "@voyant-travel/commerce-react": "^0.69.0",
165
+ "@voyant-travel/cruises": "^0.186.0",
166
+ "@voyant-travel/inventory-react": "^0.69.0",
167
+ "@voyant-travel/inventory": "^0.14.24",
168
+ "@voyant-travel/storefront-react": "^0.189.0",
169
169
  "@voyant-travel/ui": "^0.109.3",
170
- "@voyant-travel/operations-react": "^0.67.0"
170
+ "@voyant-travel/operations-react": "^0.68.0"
171
171
  },
172
172
  "peerDependenciesMeta": {
173
173
  "@tanstack/react-table": {
@@ -251,26 +251,26 @@
251
251
  "typescript": "^6.0.3",
252
252
  "vitest": "^4.1.9",
253
253
  "zod": "^4.4.3",
254
- "@voyant-travel/accommodations": "^0.146.0",
254
+ "@voyant-travel/accommodations": "^0.147.0",
255
255
  "@voyant-travel/admin": "^0.128.3",
256
- "@voyant-travel/bookings": "^0.186.0",
257
- "@voyant-travel/catalog": "^0.184.0",
258
- "@voyant-travel/catalog-react": "^0.184.0",
259
- "@voyant-travel/distribution-react": "^0.176.0",
260
- "@voyant-travel/relationships-react": "^0.186.0",
261
- "@voyant-travel/finance": "^0.186.0",
262
- "@voyant-travel/finance-react": "^0.186.0",
263
- "@voyant-travel/identity-react": "^0.186.0",
264
- "@voyant-travel/legal-react": "^0.186.0",
265
- "@voyant-travel/commerce-react": "^0.68.0",
266
- "@voyant-travel/cruises": "^0.185.0",
267
- "@voyant-travel/inventory-react": "^0.68.0",
268
- "@voyant-travel/inventory": "^0.14.22",
256
+ "@voyant-travel/bookings": "^0.187.0",
257
+ "@voyant-travel/catalog": "^0.185.0",
258
+ "@voyant-travel/catalog-react": "^0.185.0",
259
+ "@voyant-travel/distribution-react": "^0.177.0",
260
+ "@voyant-travel/relationships-react": "^0.187.0",
261
+ "@voyant-travel/finance": "^0.187.0",
262
+ "@voyant-travel/finance-react": "^0.187.0",
263
+ "@voyant-travel/identity-react": "^0.187.0",
264
+ "@voyant-travel/legal-react": "^0.187.0",
265
+ "@voyant-travel/commerce-react": "^0.69.0",
266
+ "@voyant-travel/cruises": "^0.186.0",
267
+ "@voyant-travel/inventory-react": "^0.69.0",
268
+ "@voyant-travel/inventory": "^0.14.24",
269
269
  "@voyant-travel/react": "^0.104.2",
270
- "@voyant-travel/storefront-react": "^0.188.0",
270
+ "@voyant-travel/storefront-react": "^0.189.0",
271
271
  "@voyant-travel/ui": "^0.109.3",
272
272
  "@voyant-travel/voyant-typescript-config": "^0.1.0",
273
- "@voyant-travel/operations-react": "^0.67.0"
273
+ "@voyant-travel/operations-react": "^0.68.0"
274
274
  },
275
275
  "files": [
276
276
  "dist",