@bowlos/reservations 0.30.0 → 0.31.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.
@@ -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-BdOZC2nx.cjs';
4
- export { h as CatalogResult, i as CatalogSection } from './catalog-BdOZC2nx.cjs';
3
+ import { m as PublicSurface, g as CatalogItem } from './catalog-LU1sl0gc.cjs';
4
+ export { h as CatalogResult, i as CatalogSection } from './catalog-LU1sl0gc.cjs';
5
5
  import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-BzO2guh0.cjs';
6
- import { d as UseAccountResult } from './react-CYgFZdHO.cjs';
6
+ import { d as UseAccountResult } from './react-CX-zIAb5.cjs';
7
7
  import { InquiryFormType } from '@bowlos/shared';
8
8
 
9
9
  /**
@@ -550,4 +550,23 @@ interface InquiryFormProps {
550
550
  }
551
551
  declare function InquiryForm({ formType, action, onSuccess, submitLabel, successMessage, className, fieldStyle, labelStyle, inputStyle, }: InquiryFormProps): react_jsx_runtime.JSX.Element;
552
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 };
553
+ interface PricingTableLabels {
554
+ heading?: string;
555
+ walkInHeading?: string;
556
+ specialsHeading?: string;
557
+ dayCol?: string;
558
+ timeCol?: string;
559
+ loading?: string;
560
+ empty?: string;
561
+ }
562
+ interface PricingTableProps {
563
+ centerId: string;
564
+ /** Hide the walk-in matrix and show only website specials. */
565
+ specialsOnly?: boolean;
566
+ labels?: PricingTableLabels;
567
+ className?: string;
568
+ style?: CSSProperties;
569
+ }
570
+ declare function PricingTable({ centerId, specialsOnly, labels, className, style, }: PricingTableProps): react_jsx_runtime.JSX.Element | null;
571
+
572
+ 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, PricingTable, type PricingTableLabels, type PricingTableProps, formatCents, formatCentsRange };
@@ -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-C-YyKVk5.js';
4
- export { h as CatalogResult, i as CatalogSection } from './catalog-C-YyKVk5.js';
3
+ import { m as PublicSurface, g as CatalogItem } from './catalog-Ck_HLOff.js';
4
+ export { h as CatalogResult, i as CatalogSection } from './catalog-Ck_HLOff.js';
5
5
  import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-BzO2guh0.js';
6
- import { d as UseAccountResult } from './react-BQaKMnCR.js';
6
+ import { d as UseAccountResult } from './react-RNgTkCVk.js';
7
7
  import { InquiryFormType } from '@bowlos/shared';
8
8
 
9
9
  /**
@@ -550,4 +550,23 @@ interface InquiryFormProps {
550
550
  }
551
551
  declare function InquiryForm({ formType, action, onSuccess, submitLabel, successMessage, className, fieldStyle, labelStyle, inputStyle, }: InquiryFormProps): react_jsx_runtime.JSX.Element;
552
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 };
553
+ interface PricingTableLabels {
554
+ heading?: string;
555
+ walkInHeading?: string;
556
+ specialsHeading?: string;
557
+ dayCol?: string;
558
+ timeCol?: string;
559
+ loading?: string;
560
+ empty?: string;
561
+ }
562
+ interface PricingTableProps {
563
+ centerId: string;
564
+ /** Hide the walk-in matrix and show only website specials. */
565
+ specialsOnly?: boolean;
566
+ labels?: PricingTableLabels;
567
+ className?: string;
568
+ style?: CSSProperties;
569
+ }
570
+ declare function PricingTable({ centerId, specialsOnly, labels, className, style, }: PricingTableProps): react_jsx_runtime.JSX.Element | null;
571
+
572
+ 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, PricingTable, type PricingTableLabels, type PricingTableProps, formatCents, formatCentsRange };
@@ -1,5 +1,5 @@
1
- import { INQUIRY_FORMS } from './chunk-WWKULPFX.js';
2
- import { useTestMode, useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog } from './chunk-44AWSRIG.js';
1
+ import { INQUIRY_FORMS } from './chunk-EQH5HDYQ.js';
2
+ import { useTestMode, useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog, useRetailPricing } from './chunk-S5GEG7SW.js';
3
3
  import { availableUnitCount } from './chunk-P5YWNLEC.js';
4
4
  import { token, styles, formatCents, formatMinuteLabel, minutesToTime, useCountdown, formatCentsRange } from './chunk-Y3YSDO3H.js';
5
5
  export { BOWLOS_DEFAULT_THEME, BowlosTheme, formatCents, formatCentsRange } from './chunk-Y3YSDO3H.js';
@@ -1248,7 +1248,130 @@ function InquiryForm({
1248
1248
  /* @__PURE__ */ jsx("button", { type: "submit", disabled: status === "submitting", children: status === "submitting" ? "Sending\u2026" : submitLabel })
1249
1249
  ] });
1250
1250
  }
1251
+ var DAY_NAMES = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
1252
+ function fmtMinute(m) {
1253
+ const hh = Math.floor(m / 60) % 24;
1254
+ const mm = m % 60;
1255
+ const ampm = hh < 12 ? "AM" : "PM";
1256
+ const h12 = hh % 12 === 0 ? 12 : hh % 12;
1257
+ return mm === 0 ? `${h12} ${ampm}` : `${h12}:${String(mm).padStart(2, "0")} ${ampm}`;
1258
+ }
1259
+ function rateForMode(r, mode) {
1260
+ switch (mode) {
1261
+ case "per_unit_per_hour":
1262
+ return r.rateUnitHourCents;
1263
+ case "per_person_per_hour":
1264
+ return r.ratePersonHourCents;
1265
+ case "per_game":
1266
+ return r.rateGameCents;
1267
+ }
1268
+ }
1269
+ function modeLabel(mode, unitPlural) {
1270
+ switch (mode) {
1271
+ case "per_unit_per_hour":
1272
+ return `Per ${unitPlural.replace(/s$/, "")}/hr`;
1273
+ case "per_person_per_hour":
1274
+ return "Per person/hr";
1275
+ case "per_game":
1276
+ return "Per game";
1277
+ }
1278
+ }
1279
+ function AttractionRates({ a }) {
1280
+ if (a.walkInRates.length === 0) return null;
1281
+ const modes = a.enabledModes;
1282
+ return /* @__PURE__ */ jsxs("div", { style: { marginBottom: "1.5rem" }, children: [
1283
+ /* @__PURE__ */ jsx("h4", { style: { margin: "0 0 0.5rem", fontSize: "1.05rem" }, children: a.name }),
1284
+ /* @__PURE__ */ jsxs("table", { style: { width: "100%", borderCollapse: "collapse", fontSize: "0.95rem" }, children: [
1285
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { style: { textAlign: "left", color: token("colorMuted") }, children: [
1286
+ /* @__PURE__ */ jsx("th", { style: { padding: "0.35rem 0.5rem" }, children: "Day" }),
1287
+ /* @__PURE__ */ jsx("th", { style: { padding: "0.35rem 0.5rem" }, children: "Time" }),
1288
+ modes.map((m) => /* @__PURE__ */ jsx("th", { style: { padding: "0.35rem 0.5rem", textAlign: "right" }, children: modeLabel(m, a.unitLabelPlural) }, m))
1289
+ ] }) }),
1290
+ /* @__PURE__ */ jsx("tbody", { children: a.walkInRates.map((r, i) => /* @__PURE__ */ jsxs(
1291
+ "tr",
1292
+ {
1293
+ style: { borderTop: `1px solid ${token("colorBorder")}` },
1294
+ children: [
1295
+ /* @__PURE__ */ jsx("td", { style: { padding: "0.35rem 0.5rem" }, children: DAY_NAMES[r.dayOfWeek] }),
1296
+ /* @__PURE__ */ jsx("td", { style: { padding: "0.35rem 0.5rem" }, children: r.label ?? `${fmtMinute(r.startMinuteOfDay)} \u2013 ${fmtMinute(r.endMinuteOfDay)}` }),
1297
+ modes.map((m) => {
1298
+ const cents = rateForMode(r, m);
1299
+ return /* @__PURE__ */ jsx("td", { style: { padding: "0.35rem 0.5rem", textAlign: "right" }, children: cents === null ? "\u2014" : formatCents(cents) }, m);
1300
+ })
1301
+ ]
1302
+ },
1303
+ i
1304
+ )) })
1305
+ ] })
1306
+ ] });
1307
+ }
1308
+ function SpecialCard({ s }) {
1309
+ return /* @__PURE__ */ jsxs(
1310
+ "div",
1311
+ {
1312
+ style: {
1313
+ border: `1px solid ${token("colorBorder")}`,
1314
+ borderRadius: token("radius"),
1315
+ background: token("colorSurface"),
1316
+ padding: "0.85rem 1rem",
1317
+ display: "flex",
1318
+ justifyContent: "space-between",
1319
+ gap: "1rem",
1320
+ alignItems: "baseline"
1321
+ },
1322
+ children: [
1323
+ /* @__PURE__ */ jsxs("div", { children: [
1324
+ /* @__PURE__ */ jsx("div", { style: { fontWeight: 600 }, children: s.name }),
1325
+ /* @__PURE__ */ jsx("div", { style: { color: token("colorMuted"), fontSize: "0.9rem" }, children: s.description }),
1326
+ /* @__PURE__ */ jsx("div", { style: { color: token("colorMuted"), fontSize: "0.8rem" }, children: s.attractionName })
1327
+ ] }),
1328
+ s.priceCents !== null && /* @__PURE__ */ jsx("div", { style: { fontWeight: 700, color: token("colorPrimary"), whiteSpace: "nowrap" }, children: formatCents(s.priceCents) })
1329
+ ]
1330
+ }
1331
+ );
1332
+ }
1333
+ function PricingTable({
1334
+ centerId,
1335
+ specialsOnly = false,
1336
+ labels,
1337
+ className,
1338
+ style
1339
+ }) {
1340
+ const { data, loading } = useRetailPricing({ centerId });
1341
+ if (loading && !data) {
1342
+ return /* @__PURE__ */ jsx("div", { style: { fontFamily: token("fontFamily"), color: token("colorMuted") }, children: labels?.loading ?? "Loading pricing\u2026" });
1343
+ }
1344
+ if (!data) return null;
1345
+ const hasWalkIn = data.attractions.some((a) => a.walkInRates.length > 0);
1346
+ const hasSpecials = data.specials.length > 0;
1347
+ if (!hasWalkIn && !hasSpecials) {
1348
+ return /* @__PURE__ */ jsx("div", { style: { fontFamily: token("fontFamily"), color: token("colorMuted") }, children: labels?.empty ?? "Pricing isn't published yet." });
1349
+ }
1350
+ return /* @__PURE__ */ jsxs(
1351
+ "div",
1352
+ {
1353
+ className,
1354
+ style: {
1355
+ fontFamily: token("fontFamily"),
1356
+ color: token("colorText"),
1357
+ background: token("colorBg"),
1358
+ ...style
1359
+ },
1360
+ children: [
1361
+ labels?.heading && /* @__PURE__ */ jsx("h3", { style: { margin: "0 0 1rem" }, children: labels.heading }),
1362
+ hasSpecials && /* @__PURE__ */ jsxs("section", { style: { marginBottom: "1.75rem" }, children: [
1363
+ /* @__PURE__ */ jsx("h3", { style: { margin: "0 0 0.75rem", fontSize: "1.15rem" }, children: labels?.specialsHeading ?? "Specials" }),
1364
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "0.6rem" }, children: data.specials.map((s) => /* @__PURE__ */ jsx(SpecialCard, { s }, s.planId)) })
1365
+ ] }),
1366
+ !specialsOnly && hasWalkIn && /* @__PURE__ */ jsxs("section", { children: [
1367
+ /* @__PURE__ */ jsx("h3", { style: { margin: "0 0 0.75rem", fontSize: "1.15rem" }, children: labels?.walkInHeading ?? "Walk-in rates" }),
1368
+ data.attractions.map((a) => /* @__PURE__ */ jsx(AttractionRates, { a }, a.attractionId))
1369
+ ] })
1370
+ ]
1371
+ }
1372
+ );
1373
+ }
1251
1374
 
1252
- export { AccountDashboard, AccountMenu, AuthForm, AuthGate, BookingCatalog, BookingFlow, FlashSale, FlashSaleIndex, InquiryForm, MaintenanceBanner };
1375
+ export { AccountDashboard, AccountMenu, AuthForm, AuthGate, BookingCatalog, BookingFlow, FlashSale, FlashSaleIndex, InquiryForm, MaintenanceBanner, PricingTable };
1253
1376
  //# sourceMappingURL=components.js.map
1254
1377
  //# sourceMappingURL=components.js.map