@bowlos/reservations 0.20.0 → 0.21.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 (36) hide show
  1. package/HEADLESS.md +203 -6
  2. package/README.md +7 -0
  3. package/dist/{catalog-eofYl46p.d.cts → catalog-BuafmB8y.d.cts} +67 -2
  4. package/dist/{catalog-BGPCoIOm.d.ts → catalog-bpCn9klL.d.ts} +67 -2
  5. package/dist/{chunk-3GAXATYP.js → chunk-FV6SROO2.js} +22 -4
  6. package/dist/chunk-FV6SROO2.js.map +1 -0
  7. package/dist/{chunk-32FTBLXQ.js → chunk-S5T4OCBY.js} +25 -3
  8. package/dist/chunk-S5T4OCBY.js.map +1 -0
  9. package/dist/components.cjs +11 -6
  10. package/dist/components.cjs.map +1 -1
  11. package/dist/components.d.cts +10 -4
  12. package/dist/components.d.ts +10 -4
  13. package/dist/components.js +11 -6
  14. package/dist/components.js.map +1 -1
  15. package/dist/{data-ymW_rWbz.d.cts → data-BKlgn8Ln.d.cts} +72 -1
  16. package/dist/{data-ymW_rWbz.d.ts → data-BKlgn8Ln.d.ts} +72 -1
  17. package/dist/index.cjs +45 -0
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +3 -3
  20. package/dist/index.d.ts +3 -3
  21. package/dist/index.js +18 -3
  22. package/dist/index.js.map +1 -1
  23. package/dist/payments.d.cts +1 -1
  24. package/dist/payments.d.ts +1 -1
  25. package/dist/{react-Bh0z-Lnb.d.ts → react-BI2RKM5p.d.ts} +1 -1
  26. package/dist/{react-DHvo_ZHf.d.cts → react-D2mBw_-l.d.cts} +1 -1
  27. package/dist/react.cjs +73 -0
  28. package/dist/react.cjs.map +1 -1
  29. package/dist/react.d.cts +35 -5
  30. package/dist/react.d.ts +35 -5
  31. package/dist/react.js +37 -4
  32. package/dist/react.js.map +1 -1
  33. package/package.json +1 -1
  34. package/templates/center-site/package.json +1 -1
  35. package/dist/chunk-32FTBLXQ.js.map +0 -1
  36. package/dist/chunk-3GAXATYP.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { CSSProperties, ReactNode } from 'react';
3
- import { N as PricingMode, J as PaymentIntentInfo, l as Customer } from './data-ymW_rWbz.cjs';
4
- import { c as UseAccountResult } from './react-DHvo_ZHf.cjs';
3
+ import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-BKlgn8Ln.cjs';
4
+ import { c as UseAccountResult } from './react-D2mBw_-l.cjs';
5
5
  import './errors-IIK7xibp.cjs';
6
6
 
7
7
  /**
@@ -435,9 +435,14 @@ type CatalogOffer = {
435
435
  } | {
436
436
  kind: "event";
437
437
  id: string;
438
+ slug: string;
438
439
  name: string;
439
440
  date: string;
440
441
  description: string | null;
442
+ purchaseMode: "reservation" | "ticket";
443
+ productId: string | null;
444
+ pricePlanId: string | null;
445
+ priceCents: number | null;
441
446
  } | {
442
447
  kind: "package";
443
448
  id: string;
@@ -477,8 +482,9 @@ interface BookingCatalogProps {
477
482
  centerId: string;
478
483
  /**
479
484
  * Called when a customer picks an offer. Route by `offer.kind`: a `product`
480
- * or `event` → your `<BookingFlow>` (preset the event's date); a `package` /
481
- * `membership` / `gamecard` → its buy page.
485
+ * → your `<BookingFlow>`; an `event` → its landing page (`offer.slug`) or,
486
+ * for reservation-mode events, your booking flow with the event date/window
487
+ * preset; a `package` / `membership` / `gamecard` → its buy page.
482
488
  */
483
489
  onSelect: (offer: CatalogOffer) => void;
484
490
  labels?: Partial<BookingCatalogLabels>;
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { CSSProperties, ReactNode } from 'react';
3
- import { N as PricingMode, J as PaymentIntentInfo, l as Customer } from './data-ymW_rWbz.js';
4
- import { c as UseAccountResult } from './react-Bh0z-Lnb.js';
3
+ import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-BKlgn8Ln.js';
4
+ import { c as UseAccountResult } from './react-BI2RKM5p.js';
5
5
  import './errors-IIK7xibp.js';
6
6
 
7
7
  /**
@@ -435,9 +435,14 @@ type CatalogOffer = {
435
435
  } | {
436
436
  kind: "event";
437
437
  id: string;
438
+ slug: string;
438
439
  name: string;
439
440
  date: string;
440
441
  description: string | null;
442
+ purchaseMode: "reservation" | "ticket";
443
+ productId: string | null;
444
+ pricePlanId: string | null;
445
+ priceCents: number | null;
441
446
  } | {
442
447
  kind: "package";
443
448
  id: string;
@@ -477,8 +482,9 @@ interface BookingCatalogProps {
477
482
  centerId: string;
478
483
  /**
479
484
  * Called when a customer picks an offer. Route by `offer.kind`: a `product`
480
- * or `event` → your `<BookingFlow>` (preset the event's date); a `package` /
481
- * `membership` / `gamecard` → its buy page.
485
+ * → your `<BookingFlow>`; an `event` → its landing page (`offer.slug`) or,
486
+ * for reservation-mode events, your booking flow with the event date/window
487
+ * preset; a `package` / `membership` / `gamecard` → its buy page.
482
488
  */
483
489
  onSelect: (offer: CatalogOffer) => void;
484
490
  labels?: Partial<BookingCatalogLabels>;
@@ -1,5 +1,5 @@
1
- import { useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useProducts, useEvents, usePackages, usePublicMemberships, useGameCards } from './chunk-3GAXATYP.js';
2
- import { availableUnitCount } from './chunk-32FTBLXQ.js';
1
+ import { useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useProducts, useEventOffers, usePackages, usePublicMemberships, useGameCards } from './chunk-FV6SROO2.js';
2
+ import { availableUnitCount } from './chunk-S5T4OCBY.js';
3
3
  import { styles, formatCents, formatMinuteLabel, token, minutesToTime, useCountdown, formatCentsRange } from './chunk-Y3YSDO3H.js';
4
4
  export { BOWLOS_DEFAULT_THEME, BowlosTheme, formatCents, formatCentsRange } from './chunk-Y3YSDO3H.js';
5
5
  import { useState, useEffect, useMemo, useRef } from 'react';
@@ -841,7 +841,7 @@ function BookingCatalog({ brandId, centerId, onSelect, labels, className }) {
841
841
  const t = { ...DEFAULT_LABELS7, ...labels };
842
842
  const s = styles();
843
843
  const products = useProducts({ centerId });
844
- const events = useEvents({ centerId });
844
+ const events = useEventOffers({ centerId });
845
845
  const packages = usePackages({ brandId, centerId });
846
846
  const memberships = usePublicMemberships({ centerId });
847
847
  const gameCards = useGameCards({ brandId, centerId });
@@ -853,9 +853,14 @@ function BookingCatalog({ brandId, centerId, onSelect, labels, className }) {
853
853
  const eventOffers = (events.data ?? []).map((e) => ({
854
854
  kind: "event",
855
855
  id: e.id,
856
- name: e.name,
856
+ slug: e.slug,
857
+ name: e.title,
857
858
  date: e.date,
858
- description: e.description
859
+ description: e.subtitle ?? e.description,
860
+ purchaseMode: e.purchaseMode,
861
+ productId: e.productId,
862
+ pricePlanId: e.pricePlanId,
863
+ priceCents: e.priceCents
859
864
  }));
860
865
  const packageOffers = (packages.data ?? []).map((p) => ({
861
866
  kind: "package",
@@ -913,7 +918,7 @@ function subtitle(offer, t) {
913
918
  case "product":
914
919
  return `${offer.attractionName} \xB7 ${offer.durationMinutes} ${t.minutesAbbrev}`;
915
920
  case "event":
916
- return offer.date;
921
+ return offer.priceCents !== null ? `${offer.date} \xB7 ${formatCents(offer.priceCents)}` : offer.date;
917
922
  case "membership":
918
923
  return `${formatCents(offer.priceCents)}${t.perMonth}`;
919
924
  case "package":