@bowlos/reservations 0.24.0 → 0.26.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/HEADLESS.md +68 -1
- package/README.md +10 -0
- package/dist/{account-C9SvfE3q.d.cts → account-BXf9e6UW.d.cts} +1 -1
- package/dist/{account-B9tDfXke.d.ts → account-N1Zs7yvQ.d.ts} +1 -1
- package/dist/{catalog-BPh01sfG.d.ts → catalog-BF_xtQxf.d.ts} +9 -1
- package/dist/{catalog-I7Lpar3V.d.cts → catalog-CVvwgrbZ.d.cts} +9 -1
- package/dist/{chunk-CRETIPLS.js → chunk-AYQIKZCU.js} +16 -5
- package/dist/chunk-AYQIKZCU.js.map +1 -0
- package/dist/{chunk-S5T4OCBY.js → chunk-PPCQFT3U.js} +19 -4
- package/dist/chunk-PPCQFT3U.js.map +1 -0
- package/dist/cli.cjs +17 -2
- package/dist/cli.cjs.map +1 -1
- package/dist/components.cjs +57 -1
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +17 -5
- package/dist/components.d.ts +17 -5
- package/dist/components.js +54 -6
- package/dist/components.js.map +1 -1
- package/dist/{data-BKlgn8Ln.d.cts → data-BCbYaSC1.d.cts} +43 -2
- package/dist/{data-BKlgn8Ln.d.ts → data-BCbYaSC1.d.ts} +43 -2
- package/dist/index.cjs +17 -2
- 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/index.js.map +1 -1
- package/dist/payments.cjs +4 -2
- package/dist/payments.cjs.map +1 -1
- package/dist/payments.d.cts +11 -3
- package/dist/payments.d.ts +11 -3
- package/dist/payments.js +4 -2
- package/dist/payments.js.map +1 -1
- package/dist/{react-C0c5k3Tt.d.ts → react-BQikV5KJ.d.ts} +4 -2
- package/dist/{react--584Q9zx.d.cts → react-Y11QkXEQ.d.cts} +4 -2
- package/dist/react.cjs +30 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +18 -6
- package/dist/react.d.ts +18 -6
- package/dist/react.js +3 -3
- package/package.json +2 -2
- package/templates/center-site/package.json +1 -1
- package/dist/chunk-CRETIPLS.js.map +0 -1
- package/dist/chunk-S5T4OCBY.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
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
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';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Themeable design tokens for the `@bowlos/reservations/components` layer.
|
|
@@ -47,6 +47,18 @@ declare function BowlosTheme({ theme, className, style, children, }: {
|
|
|
47
47
|
children: ReactNode;
|
|
48
48
|
}): react_jsx_runtime.JSX.Element;
|
|
49
49
|
|
|
50
|
+
interface MaintenanceBannerProps {
|
|
51
|
+
brandId: string;
|
|
52
|
+
centerId: string;
|
|
53
|
+
/** Which surface's catalog/visibility to read. Default "sdk_custom_site". */
|
|
54
|
+
surface?: PublicSurface;
|
|
55
|
+
/** Override the default customer-facing copy (never mention "test mode"). */
|
|
56
|
+
message?: string;
|
|
57
|
+
className?: string;
|
|
58
|
+
style?: CSSProperties;
|
|
59
|
+
}
|
|
60
|
+
declare function MaintenanceBanner({ brandId, centerId, surface, message, className, style, }: MaintenanceBannerProps): react_jsx_runtime.JSX.Element | null;
|
|
61
|
+
|
|
50
62
|
/** Visible strings — override any subset for copy/i18n. */
|
|
51
63
|
interface BookingFlowLabels {
|
|
52
64
|
heading: string;
|
|
@@ -493,4 +505,4 @@ declare function formatCents(cents: number): string;
|
|
|
493
505
|
/** A min–max money range, collapsing to one value when they're equal. */
|
|
494
506
|
declare function formatCentsRange(minCents: number, maxCents: number): string;
|
|
495
507
|
|
|
496
|
-
export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AccountSection, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingCatalog, type BookingCatalogLabels, type BookingCatalogProps, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens, CatalogItem, type FlashBrand, FlashSale, FlashSaleIndex, type FlashSaleIndexItem, type FlashSaleIndexLabels, type FlashSaleIndexProps, type FlashSaleIndexView, type FlashSaleItem, type FlashSaleLabels, type FlashSaleProps, type FlashSaleView, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, formatCents, formatCentsRange };
|
|
508
|
+
export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AccountSection, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingCatalog, type BookingCatalogLabels, type BookingCatalogProps, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens, CatalogItem, type FlashBrand, FlashSale, FlashSaleIndex, type FlashSaleIndexItem, type FlashSaleIndexLabels, type FlashSaleIndexProps, type FlashSaleIndexView, type FlashSaleItem, type FlashSaleLabels, type FlashSaleProps, type FlashSaleView, MaintenanceBanner, type MaintenanceBannerProps, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, 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
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
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';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Themeable design tokens for the `@bowlos/reservations/components` layer.
|
|
@@ -47,6 +47,18 @@ declare function BowlosTheme({ theme, className, style, children, }: {
|
|
|
47
47
|
children: ReactNode;
|
|
48
48
|
}): react_jsx_runtime.JSX.Element;
|
|
49
49
|
|
|
50
|
+
interface MaintenanceBannerProps {
|
|
51
|
+
brandId: string;
|
|
52
|
+
centerId: string;
|
|
53
|
+
/** Which surface's catalog/visibility to read. Default "sdk_custom_site". */
|
|
54
|
+
surface?: PublicSurface;
|
|
55
|
+
/** Override the default customer-facing copy (never mention "test mode"). */
|
|
56
|
+
message?: string;
|
|
57
|
+
className?: string;
|
|
58
|
+
style?: CSSProperties;
|
|
59
|
+
}
|
|
60
|
+
declare function MaintenanceBanner({ brandId, centerId, surface, message, className, style, }: MaintenanceBannerProps): react_jsx_runtime.JSX.Element | null;
|
|
61
|
+
|
|
50
62
|
/** Visible strings — override any subset for copy/i18n. */
|
|
51
63
|
interface BookingFlowLabels {
|
|
52
64
|
heading: string;
|
|
@@ -493,4 +505,4 @@ declare function formatCents(cents: number): string;
|
|
|
493
505
|
/** A min–max money range, collapsing to one value when they're equal. */
|
|
494
506
|
declare function formatCentsRange(minCents: number, maxCents: number): string;
|
|
495
507
|
|
|
496
|
-
export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AccountSection, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingCatalog, type BookingCatalogLabels, type BookingCatalogProps, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens, CatalogItem, type FlashBrand, FlashSale, FlashSaleIndex, type FlashSaleIndexItem, type FlashSaleIndexLabels, type FlashSaleIndexProps, type FlashSaleIndexView, type FlashSaleItem, type FlashSaleLabels, type FlashSaleProps, type FlashSaleView, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, formatCents, formatCentsRange };
|
|
508
|
+
export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AccountSection, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingCatalog, type BookingCatalogLabels, type BookingCatalogProps, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens, CatalogItem, type FlashBrand, FlashSale, FlashSaleIndex, type FlashSaleIndexItem, type FlashSaleIndexLabels, type FlashSaleIndexProps, type FlashSaleIndexView, type FlashSaleItem, type FlashSaleLabels, type FlashSaleProps, type FlashSaleView, MaintenanceBanner, type MaintenanceBannerProps, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, formatCents, formatCentsRange };
|
package/dist/components.js
CHANGED
|
@@ -1,10 +1,42 @@
|
|
|
1
|
-
import { useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog } from './chunk-
|
|
2
|
-
import { availableUnitCount } from './chunk-
|
|
3
|
-
import { styles, formatCents, formatMinuteLabel,
|
|
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';
|
|
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
|
-
import { useState, useEffect, useMemo, useRef } from 'react';
|
|
6
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
|
+
import { useState, useEffect, useMemo, useRef } from 'react';
|
|
7
7
|
|
|
8
|
+
var DEFAULT_MESSAGE = "We're performing maintenance \u2014 online booking is temporarily unavailable. Please check back soon.";
|
|
9
|
+
function MaintenanceBanner({
|
|
10
|
+
brandId,
|
|
11
|
+
centerId,
|
|
12
|
+
surface = "sdk_custom_site",
|
|
13
|
+
message,
|
|
14
|
+
className,
|
|
15
|
+
style
|
|
16
|
+
}) {
|
|
17
|
+
const { maintenanceMode } = useTestMode({ brandId, centerId, surface });
|
|
18
|
+
if (!maintenanceMode) return null;
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
role: "status",
|
|
23
|
+
className,
|
|
24
|
+
style: {
|
|
25
|
+
fontFamily: token("fontFamily"),
|
|
26
|
+
color: token("colorText"),
|
|
27
|
+
background: token("colorBg"),
|
|
28
|
+
borderLeft: `4px solid ${token("colorPrimary")}`,
|
|
29
|
+
border: `1px solid ${token("colorBorder")}`,
|
|
30
|
+
borderLeftWidth: 4,
|
|
31
|
+
borderRadius: token("radius"),
|
|
32
|
+
padding: "0.75rem 1rem",
|
|
33
|
+
fontWeight: 600,
|
|
34
|
+
...style
|
|
35
|
+
},
|
|
36
|
+
children: message ?? DEFAULT_MESSAGE
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
8
40
|
var DEFAULT_LABELS = {
|
|
9
41
|
signInHeading: "Sign in",
|
|
10
42
|
signUpHeading: "Create your account",
|
|
@@ -46,7 +78,11 @@ function AuthForm({
|
|
|
46
78
|
const onAuth = (e) => {
|
|
47
79
|
e.preventDefault();
|
|
48
80
|
void guard(
|
|
49
|
-
() => mode === "signIn" ? account.signIn(email, password) :
|
|
81
|
+
() => mode === "signIn" ? account.signIn(email, password) : (
|
|
82
|
+
// Atomic sign-up: login + customer profile in one call (no orphan
|
|
83
|
+
// window from a missed/raced second step).
|
|
84
|
+
account.register(email, password, { fullName, marketingOptIn: false })
|
|
85
|
+
)
|
|
50
86
|
);
|
|
51
87
|
};
|
|
52
88
|
const onLink = (e) => {
|
|
@@ -84,6 +120,18 @@ function AuthForm({
|
|
|
84
120
|
if (account.status === "linked") return null;
|
|
85
121
|
return /* @__PURE__ */ jsxs("form", { className, style: s.card, onSubmit: onAuth, children: [
|
|
86
122
|
/* @__PURE__ */ jsx("h3", { style: s.heading, children: mode === "signIn" ? t.signInHeading : t.signUpHeading }),
|
|
123
|
+
mode === "signUp" && /* @__PURE__ */ jsxs("label", { style: s.label, children: [
|
|
124
|
+
t.name,
|
|
125
|
+
/* @__PURE__ */ jsx(
|
|
126
|
+
"input",
|
|
127
|
+
{
|
|
128
|
+
value: fullName,
|
|
129
|
+
onChange: (e) => setFullName(e.target.value),
|
|
130
|
+
style: s.input,
|
|
131
|
+
required: true
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
] }),
|
|
87
135
|
/* @__PURE__ */ jsxs("label", { style: s.label, children: [
|
|
88
136
|
t.email,
|
|
89
137
|
/* @__PURE__ */ jsx(
|
|
@@ -991,6 +1039,6 @@ function formatDay(iso) {
|
|
|
991
1039
|
});
|
|
992
1040
|
}
|
|
993
1041
|
|
|
994
|
-
export { AccountDashboard, AccountMenu, AuthForm, AuthGate, BookingCatalog, BookingFlow, FlashSale, FlashSaleIndex };
|
|
1042
|
+
export { AccountDashboard, AccountMenu, AuthForm, AuthGate, BookingCatalog, BookingFlow, FlashSale, FlashSaleIndex, MaintenanceBanner };
|
|
995
1043
|
//# sourceMappingURL=components.js.map
|
|
996
1044
|
//# sourceMappingURL=components.js.map
|