@bowlos/reservations 0.28.0 → 0.30.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 +67 -0
- package/README.md +7 -0
- package/dist/chunk-WWKULPFX.js +45 -0
- package/dist/chunk-WWKULPFX.js.map +1 -0
- package/dist/components.cjs +121 -0
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +33 -1
- package/dist/components.d.ts +33 -1
- package/dist/components.js +95 -1
- package/dist/components.js.map +1 -1
- package/dist/index.cjs +65 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -1
- package/dist/index.d.ts +26 -1
- package/dist/index.js +24 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/center-site/package.json +1 -1
package/dist/components.d.cts
CHANGED
|
@@ -4,6 +4,7 @@ import { m as PublicSurface, g as CatalogItem } from './catalog-BdOZC2nx.cjs';
|
|
|
4
4
|
export { h as CatalogResult, i as CatalogSection } from './catalog-BdOZC2nx.cjs';
|
|
5
5
|
import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-BzO2guh0.cjs';
|
|
6
6
|
import { d as UseAccountResult } from './react-CYgFZdHO.cjs';
|
|
7
|
+
import { InquiryFormType } from '@bowlos/shared';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Themeable design tokens for the `@bowlos/reservations/components` layer.
|
|
@@ -284,6 +285,14 @@ interface MyPass {
|
|
|
284
285
|
kind: string;
|
|
285
286
|
state: string;
|
|
286
287
|
generation: number;
|
|
288
|
+
/**
|
|
289
|
+
* True while the underlying booking/card/membership still warrants an
|
|
290
|
+
* "Add to Apple/Google Wallet" (the server returns no pass URL once it's
|
|
291
|
+
* false). Reservation/package = the booking's Center-local day isn't over;
|
|
292
|
+
* game card = active && unexpired; membership = not lapsed. Gate any
|
|
293
|
+
* add-to-wallet affordance on this. See HEADLESS.md.
|
|
294
|
+
*/
|
|
295
|
+
walletEligible: boolean;
|
|
287
296
|
}
|
|
288
297
|
interface AccountDashboardLabels {
|
|
289
298
|
welcome: string;
|
|
@@ -518,4 +527,27 @@ declare function formatCents(cents: number): string;
|
|
|
518
527
|
/** A min–max money range, collapsing to one value when they're equal. */
|
|
519
528
|
declare function formatCentsRange(minCents: number, maxCents: number): string;
|
|
520
529
|
|
|
521
|
-
|
|
530
|
+
/**
|
|
531
|
+
* Inquiry forms ("No Dead Ends" #3) — a headless-first contact / party-inquiry
|
|
532
|
+
* form. Renders the fields for `formType` from the shared registry and POSTs
|
|
533
|
+
* `{ formType, fields }` to the center site's OWN server route (`action`), which
|
|
534
|
+
* signs + forwards to BowlOS via `forwardInquiry`. Intentionally minimal markup
|
|
535
|
+
* + a `className` passthrough so it inherits the site's design; pass `inputStyle`
|
|
536
|
+
* / `labelStyle` to theme without forking. Includes a hidden honeypot the server
|
|
537
|
+
* drops as spam.
|
|
538
|
+
*/
|
|
539
|
+
interface InquiryFormProps {
|
|
540
|
+
formType: InquiryFormType;
|
|
541
|
+
/** The site's own server route that signs + forwards (calls forwardInquiry). */
|
|
542
|
+
action: string;
|
|
543
|
+
onSuccess?: () => void;
|
|
544
|
+
submitLabel?: string;
|
|
545
|
+
successMessage?: string;
|
|
546
|
+
className?: string;
|
|
547
|
+
fieldStyle?: CSSProperties;
|
|
548
|
+
labelStyle?: CSSProperties;
|
|
549
|
+
inputStyle?: CSSProperties;
|
|
550
|
+
}
|
|
551
|
+
declare function InquiryForm({ formType, action, onSuccess, submitLabel, successMessage, className, fieldStyle, labelStyle, inputStyle, }: InquiryFormProps): react_jsx_runtime.JSX.Element;
|
|
552
|
+
|
|
553
|
+
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, InquiryForm, type InquiryFormProps, MaintenanceBanner, type MaintenanceBannerProps, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, formatCents, formatCentsRange };
|
package/dist/components.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { m as PublicSurface, g as CatalogItem } from './catalog-C-YyKVk5.js';
|
|
|
4
4
|
export { h as CatalogResult, i as CatalogSection } from './catalog-C-YyKVk5.js';
|
|
5
5
|
import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-BzO2guh0.js';
|
|
6
6
|
import { d as UseAccountResult } from './react-BQaKMnCR.js';
|
|
7
|
+
import { InquiryFormType } from '@bowlos/shared';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Themeable design tokens for the `@bowlos/reservations/components` layer.
|
|
@@ -284,6 +285,14 @@ interface MyPass {
|
|
|
284
285
|
kind: string;
|
|
285
286
|
state: string;
|
|
286
287
|
generation: number;
|
|
288
|
+
/**
|
|
289
|
+
* True while the underlying booking/card/membership still warrants an
|
|
290
|
+
* "Add to Apple/Google Wallet" (the server returns no pass URL once it's
|
|
291
|
+
* false). Reservation/package = the booking's Center-local day isn't over;
|
|
292
|
+
* game card = active && unexpired; membership = not lapsed. Gate any
|
|
293
|
+
* add-to-wallet affordance on this. See HEADLESS.md.
|
|
294
|
+
*/
|
|
295
|
+
walletEligible: boolean;
|
|
287
296
|
}
|
|
288
297
|
interface AccountDashboardLabels {
|
|
289
298
|
welcome: string;
|
|
@@ -518,4 +527,27 @@ declare function formatCents(cents: number): string;
|
|
|
518
527
|
/** A min–max money range, collapsing to one value when they're equal. */
|
|
519
528
|
declare function formatCentsRange(minCents: number, maxCents: number): string;
|
|
520
529
|
|
|
521
|
-
|
|
530
|
+
/**
|
|
531
|
+
* Inquiry forms ("No Dead Ends" #3) — a headless-first contact / party-inquiry
|
|
532
|
+
* form. Renders the fields for `formType` from the shared registry and POSTs
|
|
533
|
+
* `{ formType, fields }` to the center site's OWN server route (`action`), which
|
|
534
|
+
* signs + forwards to BowlOS via `forwardInquiry`. Intentionally minimal markup
|
|
535
|
+
* + a `className` passthrough so it inherits the site's design; pass `inputStyle`
|
|
536
|
+
* / `labelStyle` to theme without forking. Includes a hidden honeypot the server
|
|
537
|
+
* drops as spam.
|
|
538
|
+
*/
|
|
539
|
+
interface InquiryFormProps {
|
|
540
|
+
formType: InquiryFormType;
|
|
541
|
+
/** The site's own server route that signs + forwards (calls forwardInquiry). */
|
|
542
|
+
action: string;
|
|
543
|
+
onSuccess?: () => void;
|
|
544
|
+
submitLabel?: string;
|
|
545
|
+
successMessage?: string;
|
|
546
|
+
className?: string;
|
|
547
|
+
fieldStyle?: CSSProperties;
|
|
548
|
+
labelStyle?: CSSProperties;
|
|
549
|
+
inputStyle?: CSSProperties;
|
|
550
|
+
}
|
|
551
|
+
declare function InquiryForm({ formType, action, onSuccess, submitLabel, successMessage, className, fieldStyle, labelStyle, inputStyle, }: InquiryFormProps): react_jsx_runtime.JSX.Element;
|
|
552
|
+
|
|
553
|
+
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, InquiryForm, type InquiryFormProps, MaintenanceBanner, type MaintenanceBannerProps, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, formatCents, formatCentsRange };
|
package/dist/components.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { INQUIRY_FORMS } from './chunk-WWKULPFX.js';
|
|
1
2
|
import { useTestMode, useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog } from './chunk-44AWSRIG.js';
|
|
2
3
|
import { availableUnitCount } from './chunk-P5YWNLEC.js';
|
|
3
4
|
import { token, styles, formatCents, formatMinuteLabel, minutesToTime, useCountdown, formatCentsRange } from './chunk-Y3YSDO3H.js';
|
|
@@ -1154,7 +1155,100 @@ function formatDay(iso) {
|
|
|
1154
1155
|
timeZone: "UTC"
|
|
1155
1156
|
});
|
|
1156
1157
|
}
|
|
1158
|
+
var HONEYPOT_STYLE = {
|
|
1159
|
+
position: "absolute",
|
|
1160
|
+
left: "-9999px",
|
|
1161
|
+
width: 1,
|
|
1162
|
+
height: 1,
|
|
1163
|
+
opacity: 0
|
|
1164
|
+
};
|
|
1165
|
+
function InquiryForm({
|
|
1166
|
+
formType,
|
|
1167
|
+
action,
|
|
1168
|
+
onSuccess,
|
|
1169
|
+
submitLabel = "Send",
|
|
1170
|
+
successMessage = "Thanks \u2014 we\u2019ll be in touch shortly.",
|
|
1171
|
+
className,
|
|
1172
|
+
fieldStyle,
|
|
1173
|
+
labelStyle,
|
|
1174
|
+
inputStyle
|
|
1175
|
+
}) {
|
|
1176
|
+
const def = INQUIRY_FORMS[formType];
|
|
1177
|
+
const [values, setValues] = useState({});
|
|
1178
|
+
const [status, setStatus] = useState("idle");
|
|
1179
|
+
const [error, setError] = useState(null);
|
|
1180
|
+
const set = (key, val) => setValues((v) => ({ ...v, [key]: val }));
|
|
1181
|
+
const onSubmit = async (e) => {
|
|
1182
|
+
e.preventDefault();
|
|
1183
|
+
setStatus("submitting");
|
|
1184
|
+
setError(null);
|
|
1185
|
+
try {
|
|
1186
|
+
const res = await fetch(action, {
|
|
1187
|
+
method: "POST",
|
|
1188
|
+
headers: { "content-type": "application/json" },
|
|
1189
|
+
body: JSON.stringify({ formType, fields: values })
|
|
1190
|
+
});
|
|
1191
|
+
if (!res.ok) {
|
|
1192
|
+
setStatus("error");
|
|
1193
|
+
setError("Something went wrong. Please try again.");
|
|
1194
|
+
return;
|
|
1195
|
+
}
|
|
1196
|
+
setStatus("done");
|
|
1197
|
+
onSuccess?.();
|
|
1198
|
+
} catch {
|
|
1199
|
+
setStatus("error");
|
|
1200
|
+
setError("Network error. Please try again.");
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1203
|
+
if (status === "done") {
|
|
1204
|
+
return /* @__PURE__ */ jsx("p", { className, children: successMessage });
|
|
1205
|
+
}
|
|
1206
|
+
return /* @__PURE__ */ jsxs("form", { className, onSubmit, children: [
|
|
1207
|
+
def.fields.map((f) => {
|
|
1208
|
+
const multiline = f.key === "message" || f.key === "notes";
|
|
1209
|
+
return /* @__PURE__ */ jsxs("div", { style: fieldStyle, children: [
|
|
1210
|
+
/* @__PURE__ */ jsxs("label", { style: { display: "block", ...labelStyle }, children: [
|
|
1211
|
+
f.label,
|
|
1212
|
+
f.required ? " *" : ""
|
|
1213
|
+
] }),
|
|
1214
|
+
multiline ? /* @__PURE__ */ jsx(
|
|
1215
|
+
"textarea",
|
|
1216
|
+
{
|
|
1217
|
+
required: f.required,
|
|
1218
|
+
value: values[f.key] ?? "",
|
|
1219
|
+
onChange: (e) => set(f.key, e.target.value),
|
|
1220
|
+
style: inputStyle
|
|
1221
|
+
}
|
|
1222
|
+
) : /* @__PURE__ */ jsx(
|
|
1223
|
+
"input",
|
|
1224
|
+
{
|
|
1225
|
+
type: f.key === "email" ? "email" : "text",
|
|
1226
|
+
required: f.required,
|
|
1227
|
+
value: values[f.key] ?? "",
|
|
1228
|
+
onChange: (e) => set(f.key, e.target.value),
|
|
1229
|
+
style: inputStyle
|
|
1230
|
+
}
|
|
1231
|
+
)
|
|
1232
|
+
] }, f.key);
|
|
1233
|
+
}),
|
|
1234
|
+
/* @__PURE__ */ jsx(
|
|
1235
|
+
"input",
|
|
1236
|
+
{
|
|
1237
|
+
type: "text",
|
|
1238
|
+
name: "_honeypot",
|
|
1239
|
+
tabIndex: -1,
|
|
1240
|
+
autoComplete: "off",
|
|
1241
|
+
"aria-hidden": "true",
|
|
1242
|
+
style: HONEYPOT_STYLE,
|
|
1243
|
+
value: values._honeypot ?? "",
|
|
1244
|
+
onChange: (e) => set("_honeypot", e.target.value)
|
|
1245
|
+
}
|
|
1246
|
+
),
|
|
1247
|
+
error && /* @__PURE__ */ jsx("p", { role: "alert", children: error }),
|
|
1248
|
+
/* @__PURE__ */ jsx("button", { type: "submit", disabled: status === "submitting", children: status === "submitting" ? "Sending\u2026" : submitLabel })
|
|
1249
|
+
] });
|
|
1250
|
+
}
|
|
1157
1251
|
|
|
1158
|
-
export { AccountDashboard, AccountMenu, AuthForm, AuthGate, BookingCatalog, BookingFlow, FlashSale, FlashSaleIndex, MaintenanceBanner };
|
|
1252
|
+
export { AccountDashboard, AccountMenu, AuthForm, AuthGate, BookingCatalog, BookingFlow, FlashSale, FlashSaleIndex, InquiryForm, MaintenanceBanner };
|
|
1159
1253
|
//# sourceMappingURL=components.js.map
|
|
1160
1254
|
//# sourceMappingURL=components.js.map
|