@bowlos/reservations 0.41.0 → 0.43.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.
- package/AGENTS.md +9 -3
- package/HEADLESS.md +61 -0
- package/README.md +61 -0
- package/dist/{account-DEX2Lr78.d.cts → account-B4sZBmPI.d.cts} +866 -14
- package/dist/{account-DEX2Lr78.d.ts → account-B4sZBmPI.d.ts} +866 -14
- package/dist/booking-change-Dd4PVgd3.d.cts +487 -0
- package/dist/booking-change-DzYs9133.d.ts +487 -0
- package/dist/{chunk-VJIS56OO.js → chunk-4JMGS4YB.js} +96 -5
- package/dist/chunk-4JMGS4YB.js.map +1 -0
- package/dist/{chunk-FMFHNBDH.js → chunk-T2E6AEC7.js} +98 -5
- package/dist/chunk-T2E6AEC7.js.map +1 -0
- package/dist/{chunk-44WKP6MW.js → chunk-V4JRDYW4.js} +31 -3
- package/dist/chunk-V4JRDYW4.js.map +1 -0
- package/dist/{chunk-BWJHRJN6.js → chunk-YQRTBGXU.js} +3 -3
- package/dist/{chunk-BWJHRJN6.js.map → chunk-YQRTBGXU.js.map} +1 -1
- package/dist/cli.cjs +5 -0
- package/dist/cli.cjs.map +1 -1
- package/dist/components.cjs +313 -0
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +12 -6
- package/dist/components.d.ts +12 -6
- package/dist/components.js +109 -6
- package/dist/components.js.map +1 -1
- package/dist/index.cjs +33 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/payments.cjs +34 -12
- package/dist/payments.cjs.map +1 -1
- package/dist/payments.d.cts +10 -2
- package/dist/payments.d.ts +10 -2
- package/dist/payments.js +5 -78
- package/dist/payments.js.map +1 -1
- package/dist/{react-CrRciA7I.d.ts → react-C6NWC80d.d.cts} +2 -2
- package/dist/{react-QJrsaOnN.d.cts → react-DVdtpw5n.d.ts} +2 -2
- package/dist/react.cjs +112 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +22 -6
- package/dist/react.d.ts +22 -6
- package/dist/react.js +5 -5
- package/package.json +1 -1
- package/templates/center-site/package.json +1 -1
- package/dist/booking-change-4DGu-B08.d.ts +0 -1282
- package/dist/booking-change-aK6P37FZ.d.cts +0 -1282
- package/dist/chunk-44WKP6MW.js.map +0 -1
- package/dist/chunk-FMFHNBDH.js.map +0 -1
- package/dist/chunk-VJIS56OO.js.map +0 -1
package/dist/components.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { CSSProperties, ReactNode } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
import {
|
|
6
|
-
import { d as UseAccountResult } from './react-
|
|
3
|
+
import { Y as PublicSurface, D as CatalogItem, N as EventOffer, l as GetWalletPassUrlArgs, p as BookingChangePayment } from './booking-change-Dd4PVgd3.cjs';
|
|
4
|
+
export { F as CatalogResult, H as CatalogSection } from './booking-change-Dd4PVgd3.cjs';
|
|
5
|
+
import { b3 as PricingMode, b1 as PaymentIntentInfo, an as Customer, b9 as SavedCardScope, aG as JoinWaitlistArgs } from './account-B4sZBmPI.cjs';
|
|
6
|
+
import { d as UseAccountResult } from './react-C6NWC80d.cjs';
|
|
7
7
|
import { InquiryFormType } from '@bowlos/shared';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -326,7 +326,7 @@ interface AccountDashboardLabels {
|
|
|
326
326
|
autoRenews: string;
|
|
327
327
|
balanceDue: string;
|
|
328
328
|
}
|
|
329
|
-
type AccountSection = "reservations" | "memberships" | "loyalty" | "credits" | "passes" | "eventOrders" | "packageOrders" | "gameCards" | "profile" | "communications" | "paymentMethods" | "security" | "privacy";
|
|
329
|
+
type AccountSection = "waitlist" | "reservations" | "memberships" | "loyalty" | "credits" | "passes" | "eventOrders" | "packageOrders" | "gameCards" | "profile" | "communications" | "paymentMethods" | "security" | "privacy";
|
|
330
330
|
interface AccountDashboardProps {
|
|
331
331
|
/** The Brand this site belongs to (account reads are Brand-scoped). */
|
|
332
332
|
brandId: string;
|
|
@@ -770,4 +770,10 @@ interface BookingChangeProps {
|
|
|
770
770
|
}
|
|
771
771
|
declare function BookingChange({ brandId, centerId, reservationId, expectedVersion, initial, unitNoun, renderPayment, labels, className, }: BookingChangeProps): react_jsx_runtime.JSX.Element;
|
|
772
772
|
|
|
773
|
-
|
|
773
|
+
interface WaitlistJoinProps {
|
|
774
|
+
args: JoinWaitlistArgs;
|
|
775
|
+
onJoined?: () => void;
|
|
776
|
+
}
|
|
777
|
+
declare function WaitlistJoin({ args, onJoined }: WaitlistJoinProps): react_jsx_runtime.JSX.Element;
|
|
778
|
+
|
|
779
|
+
export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AccountSection, AddToWalletButtons, type AddToWalletButtonsProps, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingCatalog, type BookingCatalogLabels, type BookingCatalogProps, BookingChange, type BookingChangeProps, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens, CatalogItem, ChangePasswordForm, type ChangePasswordFormProps, CommunicationPrefs, type CommunicationPrefsProps, EventList, type EventListLabels, type EventListProps, type FlashBrand, FlashSale, FlashSaleIndex, type FlashSaleIndexItem, type FlashSaleIndexLabels, type FlashSaleIndexProps, type FlashSaleIndexView, type FlashSaleItem, type FlashSaleLabels, type FlashSaleProps, type FlashSaleView, GameCardHistory, type GameCardHistoryProps, InquiryForm, type InquiryFormProps, MaintenanceBanner, type MaintenanceBannerProps, MembershipDetail, type MembershipDetailProps, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, PricingTable, type PricingTableLabels, type PricingTableProps, PrivacyCenter, type PrivacyCenterProps, ProfileForm, type ProfileFormProps, SavedCards, type SavedCardsProps, WaitlistJoin, type WaitlistJoinProps, formatCents, formatCentsRange };
|
package/dist/components.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { CSSProperties, ReactNode } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
import {
|
|
6
|
-
import { d as UseAccountResult } from './react-
|
|
3
|
+
import { Y as PublicSurface, D as CatalogItem, N as EventOffer, l as GetWalletPassUrlArgs, p as BookingChangePayment } from './booking-change-DzYs9133.js';
|
|
4
|
+
export { F as CatalogResult, H as CatalogSection } from './booking-change-DzYs9133.js';
|
|
5
|
+
import { b3 as PricingMode, b1 as PaymentIntentInfo, an as Customer, b9 as SavedCardScope, aG as JoinWaitlistArgs } from './account-B4sZBmPI.js';
|
|
6
|
+
import { d as UseAccountResult } from './react-DVdtpw5n.js';
|
|
7
7
|
import { InquiryFormType } from '@bowlos/shared';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -326,7 +326,7 @@ interface AccountDashboardLabels {
|
|
|
326
326
|
autoRenews: string;
|
|
327
327
|
balanceDue: string;
|
|
328
328
|
}
|
|
329
|
-
type AccountSection = "reservations" | "memberships" | "loyalty" | "credits" | "passes" | "eventOrders" | "packageOrders" | "gameCards" | "profile" | "communications" | "paymentMethods" | "security" | "privacy";
|
|
329
|
+
type AccountSection = "waitlist" | "reservations" | "memberships" | "loyalty" | "credits" | "passes" | "eventOrders" | "packageOrders" | "gameCards" | "profile" | "communications" | "paymentMethods" | "security" | "privacy";
|
|
330
330
|
interface AccountDashboardProps {
|
|
331
331
|
/** The Brand this site belongs to (account reads are Brand-scoped). */
|
|
332
332
|
brandId: string;
|
|
@@ -770,4 +770,10 @@ interface BookingChangeProps {
|
|
|
770
770
|
}
|
|
771
771
|
declare function BookingChange({ brandId, centerId, reservationId, expectedVersion, initial, unitNoun, renderPayment, labels, className, }: BookingChangeProps): react_jsx_runtime.JSX.Element;
|
|
772
772
|
|
|
773
|
-
|
|
773
|
+
interface WaitlistJoinProps {
|
|
774
|
+
args: JoinWaitlistArgs;
|
|
775
|
+
onJoined?: () => void;
|
|
776
|
+
}
|
|
777
|
+
declare function WaitlistJoin({ args, onJoined }: WaitlistJoinProps): react_jsx_runtime.JSX.Element;
|
|
778
|
+
|
|
779
|
+
export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AccountSection, AddToWalletButtons, type AddToWalletButtonsProps, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingCatalog, type BookingCatalogLabels, type BookingCatalogProps, BookingChange, type BookingChangeProps, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens, CatalogItem, ChangePasswordForm, type ChangePasswordFormProps, CommunicationPrefs, type CommunicationPrefsProps, EventList, type EventListLabels, type EventListProps, type FlashBrand, FlashSale, FlashSaleIndex, type FlashSaleIndexItem, type FlashSaleIndexLabels, type FlashSaleIndexProps, type FlashSaleIndexView, type FlashSaleItem, type FlashSaleLabels, type FlashSaleProps, type FlashSaleView, GameCardHistory, type GameCardHistoryProps, InquiryForm, type InquiryFormProps, MaintenanceBanner, type MaintenanceBannerProps, MembershipDetail, type MembershipDetailProps, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, PricingTable, type PricingTableLabels, type PricingTableProps, PrivacyCenter, type PrivacyCenterProps, ProfileForm, type ProfileFormProps, SavedCards, type SavedCardsProps, WaitlistJoin, type WaitlistJoinProps, formatCents, formatCentsRange };
|
package/dist/components.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { INQUIRY_FORMS } from './chunk-YAXBZJMI.js';
|
|
2
|
-
import { useBookingFlow, useCenters, useMyGameCardHistory, useWalletPassUrl, useUpdateMyProfile, useMyCommunicationPrefs, useSetMyCommunicationPref, useAccountDeletion, useMyMembershipMembers, useAddMyMembershipMember, useCancelMyMembership, useOpenMembershipBillingPortal, useBookingChange, useMyPackageOrders } from './chunk-
|
|
2
|
+
import { useBookingFlow, useCenters, useMyGameCardHistory, useWalletPassUrl, useUpdateMyProfile, useMyCommunicationPrefs, useSetMyCommunicationPref, useAccountDeletion, useMyMembershipMembers, useAddMyMembershipMember, useCancelMyMembership, useOpenMembershipBillingPortal, useBookingChange, useWaitlistJoin, useMyPackageOrders } from './chunk-4JMGS4YB.js';
|
|
3
3
|
import './chunk-I37IJNYU.js';
|
|
4
|
-
import { token, styles, formatCents, formatMinuteLabel, AccountPanel, QueryState, useAccountAction, minutesToTime, useCountdown, formatCentsRange, timeToMinutes } from './chunk-
|
|
5
|
-
export { BOWLOS_DEFAULT_THEME, BowlosTheme, formatCents, formatCentsRange } from './chunk-
|
|
6
|
-
import { useTestMode, useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useSavedCards, useRemoveCard, useSetDefaultCard, useChangePassword, useBowlosMutation, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog, useRetailPricing, useMyMembershipDetail, useMyGameCards, useMyEventOrders } from './chunk-
|
|
7
|
-
import { availableUnitCount } from './chunk-
|
|
4
|
+
import { token, styles, formatCents, formatMinuteLabel, AccountPanel, QueryState, useAccountAction, minutesToTime, useCountdown, formatCentsRange, timeToMinutes, AddCardForm } from './chunk-T2E6AEC7.js';
|
|
5
|
+
export { BOWLOS_DEFAULT_THEME, BowlosTheme, formatCents, formatCentsRange } from './chunk-T2E6AEC7.js';
|
|
6
|
+
import { useTestMode, useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useSavedCards, useRemoveCard, useSetDefaultCard, useChangePassword, useBowlosMutation, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog, useRetailPricing, useMyMembershipDetail, useMyGameCards, useMyEventOrders, useBowlosQuery } from './chunk-YQRTBGXU.js';
|
|
7
|
+
import { availableUnitCount } from './chunk-V4JRDYW4.js';
|
|
8
8
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
9
|
import { useState, useEffect, useMemo, useRef } from 'react';
|
|
10
10
|
|
|
@@ -1073,6 +1073,42 @@ function CommunicationPrefs({ brandId, labels, className }) {
|
|
|
1073
1073
|
action.feedback
|
|
1074
1074
|
] });
|
|
1075
1075
|
}
|
|
1076
|
+
function MyWaitlist({ brandId, centerId }) {
|
|
1077
|
+
const rows = useBowlosQuery(
|
|
1078
|
+
"listMyWaitlist",
|
|
1079
|
+
{ brandId, centerId },
|
|
1080
|
+
{ auth: true }
|
|
1081
|
+
);
|
|
1082
|
+
const leave = useBowlosMutation("leaveWaitlist", {
|
|
1083
|
+
auth: true
|
|
1084
|
+
});
|
|
1085
|
+
const action = useAccountAction();
|
|
1086
|
+
return /* @__PURE__ */ jsxs(AccountPanel, { title: "Pending \u2014 waitlist", children: [
|
|
1087
|
+
/* @__PURE__ */ jsx(QueryState, { ...rows, loadingLabel: "Loading\u2026" }),
|
|
1088
|
+
/* @__PURE__ */ jsx("ul", { children: rows.data?.filter((e) => e.status === "waiting" || e.status === "pending_card").map((e) => /* @__PURE__ */ jsxs("li", { children: [
|
|
1089
|
+
e.product,
|
|
1090
|
+
" \u2014 ",
|
|
1091
|
+
e.dateISO,
|
|
1092
|
+
" \u2014 ",
|
|
1093
|
+
formatCents(e.amountCents),
|
|
1094
|
+
" \u2014",
|
|
1095
|
+
" ",
|
|
1096
|
+
e.status === "pending_card" ? "Card required" : "Card on file",
|
|
1097
|
+
/* @__PURE__ */ jsx(
|
|
1098
|
+
"button",
|
|
1099
|
+
{
|
|
1100
|
+
disabled: action.busy,
|
|
1101
|
+
onClick: () => void action.run(async () => {
|
|
1102
|
+
await leave.run({ brandId, centerId, entryId: e.entryId });
|
|
1103
|
+
await rows.refetch();
|
|
1104
|
+
}, "Removed from waitlist \u2014 not charged."),
|
|
1105
|
+
children: "Leave"
|
|
1106
|
+
}
|
|
1107
|
+
)
|
|
1108
|
+
] }, e.entryId)) }),
|
|
1109
|
+
action.feedback
|
|
1110
|
+
] });
|
|
1111
|
+
}
|
|
1076
1112
|
function SavedCards({
|
|
1077
1113
|
brandId,
|
|
1078
1114
|
centerId,
|
|
@@ -1512,6 +1548,8 @@ function Dashboard({
|
|
|
1512
1548
|
/* @__PURE__ */ jsx("p", { style: s.listTitle, children: p.kind }),
|
|
1513
1549
|
/* @__PURE__ */ jsx("span", { style: s.badge, children: p.state })
|
|
1514
1550
|
] }, p.id)) }) }, section);
|
|
1551
|
+
case "waitlist":
|
|
1552
|
+
return /* @__PURE__ */ jsx(MyWaitlist, { brandId, centerId }, section);
|
|
1515
1553
|
case "eventOrders":
|
|
1516
1554
|
return /* @__PURE__ */ jsx(EventOrders, { brandId, title: labels?.eventOrders }, section);
|
|
1517
1555
|
case "packageOrders":
|
|
@@ -2455,7 +2493,72 @@ function BookingChange({
|
|
|
2455
2493
|
!["idle", "pay", "polling", "applying", "previewing"].includes(change.status) && /* @__PURE__ */ jsx("button", { style: styles().ghostBtn, disabled: action.busy, onClick: change.reset, children: t.reset })
|
|
2456
2494
|
] });
|
|
2457
2495
|
}
|
|
2496
|
+
function WaitlistJoin({ args, onJoined }) {
|
|
2497
|
+
const flow = useWaitlistJoin();
|
|
2498
|
+
const [consent, setConsent] = useState(false);
|
|
2499
|
+
return /* @__PURE__ */ jsxs("section", { "aria-label": "Join waitlist", children: [
|
|
2500
|
+
flow.status === "idle" && /* @__PURE__ */ jsx(
|
|
2501
|
+
"button",
|
|
2502
|
+
{
|
|
2503
|
+
onClick: () => {
|
|
2504
|
+
setConsent(false);
|
|
2505
|
+
void flow.join(args).catch(() => {
|
|
2506
|
+
});
|
|
2507
|
+
},
|
|
2508
|
+
children: "Join waitlist"
|
|
2509
|
+
}
|
|
2510
|
+
),
|
|
2511
|
+
flow.status === "quoting" && /* @__PURE__ */ jsx("p", { children: "Getting your price\u2026" }),
|
|
2512
|
+
flow.status === "card" && flow.entry && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2513
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
2514
|
+
formatCents(flow.entry.amountCents),
|
|
2515
|
+
" \u2014 charged only if a spot opens."
|
|
2516
|
+
] }),
|
|
2517
|
+
!flow.setupIntent ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2518
|
+
/* @__PURE__ */ jsxs("label", { children: [
|
|
2519
|
+
/* @__PURE__ */ jsx(
|
|
2520
|
+
"input",
|
|
2521
|
+
{
|
|
2522
|
+
type: "checkbox",
|
|
2523
|
+
checked: consent,
|
|
2524
|
+
onChange: (e) => setConsent(e.target.checked)
|
|
2525
|
+
}
|
|
2526
|
+
),
|
|
2527
|
+
"I authorize a charge of ",
|
|
2528
|
+
formatCents(flow.entry.amountCents),
|
|
2529
|
+
" to this card if a spot opens."
|
|
2530
|
+
] }),
|
|
2531
|
+
/* @__PURE__ */ jsx(
|
|
2532
|
+
"button",
|
|
2533
|
+
{
|
|
2534
|
+
disabled: !consent,
|
|
2535
|
+
onClick: () => void flow.createCardSetup().catch(() => {
|
|
2536
|
+
}),
|
|
2537
|
+
children: "Add card"
|
|
2538
|
+
}
|
|
2539
|
+
)
|
|
2540
|
+
] }) : /* @__PURE__ */ jsx(
|
|
2541
|
+
AddCardForm,
|
|
2542
|
+
{
|
|
2543
|
+
brandId: args.brandId ?? "",
|
|
2544
|
+
centerId: args.centerId,
|
|
2545
|
+
setupIntent: flow.setupIntent,
|
|
2546
|
+
onSetupConfirmed: async (intent) => {
|
|
2547
|
+
await flow.cardConfirmed(intent);
|
|
2548
|
+
onJoined?.();
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
)
|
|
2552
|
+
] }),
|
|
2553
|
+
flow.status === "confirming" && /* @__PURE__ */ jsx("p", { children: "Confirming\u2026" }),
|
|
2554
|
+
flow.status === "joined" && /* @__PURE__ */ jsx("p", { children: "Pending \u2014 waitlist. You will be charged only if a spot opens." }),
|
|
2555
|
+
flow.status === "error" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2556
|
+
/* @__PURE__ */ jsx("p", { role: "alert", children: flow.error instanceof Error ? flow.error.message : "Unable to join waitlist." }),
|
|
2557
|
+
/* @__PURE__ */ jsx("button", { onClick: flow.reset, children: "Try again" })
|
|
2558
|
+
] })
|
|
2559
|
+
] });
|
|
2560
|
+
}
|
|
2458
2561
|
|
|
2459
|
-
export { AccountDashboard, AccountMenu, AddToWalletButtons, AuthForm, AuthGate, BookingCatalog, BookingChange, BookingFlow, ChangePasswordForm, CommunicationPrefs, EventList, FlashSale, FlashSaleIndex, GameCardHistory, InquiryForm, MaintenanceBanner, MembershipDetail, PricingTable, PrivacyCenter, ProfileForm, SavedCards };
|
|
2562
|
+
export { AccountDashboard, AccountMenu, AddToWalletButtons, AuthForm, AuthGate, BookingCatalog, BookingChange, BookingFlow, ChangePasswordForm, CommunicationPrefs, EventList, FlashSale, FlashSaleIndex, GameCardHistory, InquiryForm, MaintenanceBanner, MembershipDetail, PricingTable, PrivacyCenter, ProfileForm, SavedCards, WaitlistJoin };
|
|
2460
2563
|
//# sourceMappingURL=components.js.map
|
|
2461
2564
|
//# sourceMappingURL=components.js.map
|