@bowlos/reservations 0.26.0 → 0.27.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.
Files changed (34) hide show
  1. package/HEADLESS.md +72 -16
  2. package/README.md +7 -5
  3. package/dist/{account-N1Zs7yvQ.d.ts → account-BwGAUqXP.d.ts} +1 -1
  4. package/dist/{account-BXf9e6UW.d.cts → account-D40XqO4d.d.cts} +1 -1
  5. package/dist/{catalog-BF_xtQxf.d.ts → catalog-OLD8ShC_.d.ts} +1 -1
  6. package/dist/{catalog-CVvwgrbZ.d.cts → catalog-V2LD9X6-.d.cts} +1 -1
  7. package/dist/{chunk-AYQIKZCU.js → chunk-AB3D63RF.js} +3 -3
  8. package/dist/{chunk-AYQIKZCU.js.map → chunk-AB3D63RF.js.map} +1 -1
  9. package/dist/{chunk-PPCQFT3U.js → chunk-IG6SFBZK.js} +6 -4
  10. package/dist/chunk-IG6SFBZK.js.map +1 -0
  11. package/dist/components.cjs +32 -19
  12. package/dist/components.cjs.map +1 -1
  13. package/dist/components.d.cts +6 -4
  14. package/dist/components.d.ts +6 -4
  15. package/dist/components.js +34 -21
  16. package/dist/components.js.map +1 -1
  17. package/dist/{data-BCbYaSC1.d.cts → data-CtrEtDnP.d.cts} +9 -3
  18. package/dist/{data-BCbYaSC1.d.ts → data-CtrEtDnP.d.ts} +9 -3
  19. package/dist/index.cjs +4 -2
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +4 -4
  22. package/dist/index.d.ts +4 -4
  23. package/dist/index.js +2 -2
  24. package/dist/payments.d.cts +1 -1
  25. package/dist/payments.d.ts +1 -1
  26. package/dist/{react-Y11QkXEQ.d.cts → react-B2zTfI5g.d.cts} +2 -2
  27. package/dist/{react-BQikV5KJ.d.ts → react-CLHP9bcD.d.ts} +2 -2
  28. package/dist/react.cjs.map +1 -1
  29. package/dist/react.d.cts +5 -5
  30. package/dist/react.d.ts +5 -5
  31. package/dist/react.js +3 -3
  32. package/package.json +1 -1
  33. package/templates/center-site/package.json +1 -1
  34. package/dist/chunk-PPCQFT3U.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { CSSProperties, ReactNode } from 'react';
3
- import { m as PublicSurface, g as CatalogItem } from './catalog-CVvwgrbZ.cjs';
4
- export { h as CatalogResult, i as CatalogSection } from './catalog-CVvwgrbZ.cjs';
5
- import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-BCbYaSC1.cjs';
6
- import { d as UseAccountResult } from './react-Y11QkXEQ.cjs';
3
+ import { m as PublicSurface, g as CatalogItem } from './catalog-V2LD9X6-.cjs';
4
+ export { h as CatalogResult, i as CatalogSection } from './catalog-V2LD9X6-.cjs';
5
+ import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-CtrEtDnP.cjs';
6
+ import { d as UseAccountResult } from './react-B2zTfI5g.cjs';
7
7
 
8
8
  /**
9
9
  * Themeable design tokens for the `@bowlos/reservations/components` layer.
@@ -93,6 +93,8 @@ interface BookingFlowLabels {
93
93
  bookingAs: string;
94
94
  notYou: string;
95
95
  signInHint: string;
96
+ signInToContinue: string;
97
+ signInAtCheckout: string;
96
98
  }
97
99
  interface BookingFlowProps {
98
100
  centerId: string;
@@ -1,9 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { CSSProperties, ReactNode } from 'react';
3
- import { m as PublicSurface, g as CatalogItem } from './catalog-BF_xtQxf.js';
4
- export { h as CatalogResult, i as CatalogSection } from './catalog-BF_xtQxf.js';
5
- import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-BCbYaSC1.js';
6
- import { d as UseAccountResult } from './react-BQikV5KJ.js';
3
+ import { m as PublicSurface, g as CatalogItem } from './catalog-OLD8ShC_.js';
4
+ export { h as CatalogResult, i as CatalogSection } from './catalog-OLD8ShC_.js';
5
+ import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-CtrEtDnP.js';
6
+ import { d as UseAccountResult } from './react-CLHP9bcD.js';
7
7
 
8
8
  /**
9
9
  * Themeable design tokens for the `@bowlos/reservations/components` layer.
@@ -93,6 +93,8 @@ interface BookingFlowLabels {
93
93
  bookingAs: string;
94
94
  notYou: string;
95
95
  signInHint: string;
96
+ signInToContinue: string;
97
+ signInAtCheckout: string;
96
98
  }
97
99
  interface BookingFlowProps {
98
100
  centerId: string;
@@ -1,5 +1,5 @@
1
- import { useTestMode, useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog } from './chunk-AYQIKZCU.js';
2
- import { availableUnitCount } from './chunk-PPCQFT3U.js';
1
+ import { useTestMode, useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog } from './chunk-AB3D63RF.js';
2
+ import { availableUnitCount } from './chunk-IG6SFBZK.js';
3
3
  import { token, styles, formatCents, formatMinuteLabel, minutesToTime, useCountdown, formatCentsRange } from './chunk-Y3YSDO3H.js';
4
4
  export { BOWLOS_DEFAULT_THEME, BowlosTheme, formatCents, formatCentsRange } from './chunk-Y3YSDO3H.js';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -210,7 +210,9 @@ var DEFAULT_LABELS2 = {
210
210
  checkingAvailability: "Checking availability\u2026",
211
211
  bookingAs: "Booking as {name}",
212
212
  notYou: "Not you?",
213
- signInHint: "Sign in to book faster"
213
+ signInHint: "Sign in to book faster",
214
+ signInToContinue: "Sign in to continue",
215
+ signInAtCheckout: "You can browse and price your booking now \u2014 you'll sign in to complete it."
214
216
  };
215
217
  var COUNT_LABEL = {
216
218
  per_unit_per_hour: "Lanes",
@@ -275,7 +277,7 @@ function BookingFlow({
275
277
  const countArgs = pricingMode === "per_person_per_hour" ? { persons: count } : pricingMode === "per_game" ? { games: count } : { units: count };
276
278
  const availability = useAvailability(
277
279
  { productId, dateISO, startMinuteOfDay, endMinuteOfDay },
278
- { enabled: dateISO !== "" && signedIn }
280
+ { enabled: dateISO !== "" }
279
281
  );
280
282
  const preview = useBookingPreview(
281
283
  {
@@ -288,12 +290,12 @@ function BookingFlow({
288
290
  ...countArgs,
289
291
  addons: selectedAddons
290
292
  },
291
- { enabled: dateISO !== "" && signedIn }
293
+ { enabled: dateISO !== "", auth: signedIn }
292
294
  );
293
- const addons = useAddons({ productId }, { enabled: signedIn });
295
+ const addons = useAddons({ productId }, { enabled: true });
294
296
  const startTimes = useStartTimes(
295
297
  { productId, dateISO, durationMinutes, mode: pricingMode },
296
- { enabled: dateISO !== "" && signedIn }
298
+ { enabled: dateISO !== "" }
297
299
  );
298
300
  const flow = useBookingFlow();
299
301
  const onConfirmedRef = useRef(onConfirmed);
@@ -397,9 +399,6 @@ function BookingFlow({
397
399
  flow.error && /* @__PURE__ */ jsx("p", { style: s.error, children: flow.error.code })
398
400
  ] });
399
401
  }
400
- if (!signedIn) {
401
- return /* @__PURE__ */ jsx(AuthForm, { account, className });
402
- }
403
402
  const holding = flow.status === "holding";
404
403
  if (reviewing) {
405
404
  const chosenAddons = addonList.map((a) => ({ ...a, quantity: addonQtys[a.id] ?? 0 })).filter((a) => a.quantity > 0);
@@ -434,15 +433,29 @@ function BookingFlow({
434
433
  /* @__PURE__ */ jsx("strong", { children: t.orderTotal }),
435
434
  /* @__PURE__ */ jsx("strong", { children: quoteCents != null ? formatCents(quoteCents) : "\u2014" })
436
435
  ] }),
437
- /* @__PURE__ */ jsx(
438
- "button",
439
- {
440
- type: "button",
441
- style: s.primaryBtn,
442
- disabled: holding || quoteCents == null,
443
- onClick: () => void flow.startHold(bookingArgs),
444
- children: holding ? t.securing : t.continueToPayment
445
- }
436
+ signedIn ? (
437
+ // Signed in → place the hold + pay. Disabled until the (possibly
438
+ // post-login) quote resolves, so we never hold/charge against a
439
+ // total the customer hasn't seen. (D4: "Continue" waits for the
440
+ // re-quote.)
441
+ /* @__PURE__ */ jsx(
442
+ "button",
443
+ {
444
+ type: "button",
445
+ style: s.primaryBtn,
446
+ disabled: holding || preview.loading || quoteCents == null,
447
+ onClick: () => void flow.startHold(bookingArgs),
448
+ children: holding ? t.securing : t.continueToPayment
449
+ }
450
+ )
451
+ ) : (
452
+ // Signed out → gate here (mirrors the white-label "Sign in to
453
+ // continue" card). After sign-in the quote re-runs with auth, so
454
+ // member rate / credit apply before payment.
455
+ /* @__PURE__ */ jsxs("div", { style: s.stack, children: [
456
+ /* @__PURE__ */ jsx("p", { style: s.body, children: t.signInToContinue }),
457
+ /* @__PURE__ */ jsx(AuthForm, { account })
458
+ ] })
446
459
  ),
447
460
  /* @__PURE__ */ jsx("button", { type: "button", style: s.linkBtn, disabled: holding, onClick: () => setReviewing(false), children: t.editOrder }),
448
461
  flow.error && /* @__PURE__ */ jsxs("p", { style: s.error, children: [
@@ -518,13 +531,13 @@ function BookingFlow({
518
531
  )
519
532
  ] }, addon.id))
520
533
  ] }) : null,
521
- /* @__PURE__ */ jsxs("p", { style: s.meta, children: [
534
+ /* @__PURE__ */ jsx("p", { style: s.meta, children: signedIn ? /* @__PURE__ */ jsxs(Fragment, { children: [
522
535
  t.bookingAs.replace("{name}", acctName),
523
536
  accountHref ? /* @__PURE__ */ jsxs(Fragment, { children: [
524
537
  " \xB7 ",
525
538
  /* @__PURE__ */ jsx("a", { href: accountHref, style: s.linkBtn, children: t.notYou })
526
539
  ] }) : null
527
- ] }),
540
+ ] }) : t.signInAtCheckout }),
528
541
  /* @__PURE__ */ jsxs("p", { style: s.meta, "aria-live": "polite", children: [
529
542
  dateISO === "" || startOptions.length === 0 ? "" : availability.loading ? t.checkingAvailability : freeUnits !== null ? `${freeUnits} ${freeUnits === 1 ? unitLabel.singular : unitLabel.plural} available` : availability.error ? availability.error.code : "",
530
543
  startOptions.length > 0 && quoteCents !== null ? ` \xB7 ${formatCents(quoteCents)}` : ""