@bowlos/reservations 0.34.0 → 0.36.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 +196 -2
- package/README.md +130 -0
- package/dist/{account-CsCusw5Z.d.ts → account-DfM2COaz.d.ts} +47 -2
- package/dist/{account-Di8nktqp.d.cts → account-oCvYWmO9.d.cts} +47 -2
- package/dist/{catalog-DdvLcOrs.d.cts → catalog-DbhdwmnX.d.cts} +4 -1
- package/dist/{catalog-DT-ePirK.d.ts → catalog-XkjgPI5C.d.ts} +4 -1
- package/dist/{chunk-GIAJQPMM.js → chunk-3JSVEOKG.js} +8 -4
- package/dist/chunk-3JSVEOKG.js.map +1 -0
- package/dist/{chunk-CAXGTKJQ.js → chunk-TEHRROVY.js} +37 -4
- package/dist/chunk-TEHRROVY.js.map +1 -0
- package/dist/{chunk-EQH5HDYQ.js → chunk-YAXBZJMI.js} +2 -2
- package/dist/{chunk-EQH5HDYQ.js.map → chunk-YAXBZJMI.js.map} +1 -1
- package/dist/cli.cjs +5 -3
- package/dist/cli.cjs.map +1 -1
- package/dist/components.cjs +13 -5
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +4 -4
- package/dist/components.d.ts +4 -4
- package/dist/components.js +16 -7
- package/dist/components.js.map +1 -1
- package/dist/{data-BaHVz6fa.d.cts → data-BJkB-tvM.d.cts} +32 -4
- package/dist/{data-BaHVz6fa.d.ts → data-BJkB-tvM.d.ts} +32 -4
- package/dist/index.cjs +28 -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 +22 -5
- package/dist/index.js.map +1 -1
- package/dist/payments.d.cts +1 -1
- package/dist/payments.d.ts +1 -1
- package/dist/{react-DImwA9C9.d.ts → react-0MyyTtE4.d.ts} +2 -2
- package/dist/{react-DK1elmLQ.d.cts → react-CWAG4cW0.d.cts} +2 -2
- package/dist/react.cjs +43 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +23 -7
- package/dist/react.d.ts +23 -7
- package/dist/react.js +3 -3
- package/package.json +3 -2
- package/templates/center-site/app/book/page.tsx +11 -23
- package/templates/center-site/app/catalog/page.tsx +16 -9
- package/templates/center-site/package.json +1 -1
- package/dist/chunk-CAXGTKJQ.js.map +0 -1
- package/dist/chunk-GIAJQPMM.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 { m as PublicSurface, g as CatalogItem } from './catalog-
|
|
4
|
-
export { h as CatalogResult, i as CatalogSection } from './catalog-
|
|
5
|
-
import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-
|
|
6
|
-
import { d as UseAccountResult } from './react-
|
|
3
|
+
import { m as PublicSurface, g as CatalogItem } from './catalog-DbhdwmnX.cjs';
|
|
4
|
+
export { h as CatalogResult, i as CatalogSection } from './catalog-DbhdwmnX.cjs';
|
|
5
|
+
import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-BJkB-tvM.cjs';
|
|
6
|
+
import { d as UseAccountResult } from './react-CWAG4cW0.cjs';
|
|
7
7
|
import { InquiryFormType } from '@bowlos/shared';
|
|
8
8
|
|
|
9
9
|
/**
|
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 { m as PublicSurface, g as CatalogItem } from './catalog-
|
|
4
|
-
export { h as CatalogResult, i as CatalogSection } from './catalog-
|
|
5
|
-
import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-
|
|
6
|
-
import { d as UseAccountResult } from './react-
|
|
3
|
+
import { m as PublicSurface, g as CatalogItem } from './catalog-XkjgPI5C.js';
|
|
4
|
+
export { h as CatalogResult, i as CatalogSection } from './catalog-XkjgPI5C.js';
|
|
5
|
+
import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-BJkB-tvM.js';
|
|
6
|
+
import { d as UseAccountResult } from './react-0MyyTtE4.js';
|
|
7
7
|
import { InquiryFormType } from '@bowlos/shared';
|
|
8
8
|
|
|
9
9
|
/**
|
package/dist/components.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { INQUIRY_FORMS } from './chunk-
|
|
2
|
-
import { useTestMode, useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog, useRetailPricing } from './chunk-
|
|
3
|
-
import { availableUnitCount } from './chunk-
|
|
1
|
+
import { INQUIRY_FORMS } from './chunk-YAXBZJMI.js';
|
|
2
|
+
import { useTestMode, useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog, useRetailPricing } from './chunk-TEHRROVY.js';
|
|
3
|
+
import { availableUnitCount } from './chunk-3JSVEOKG.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';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -323,6 +323,13 @@ var COUNT_LABEL = {
|
|
|
323
323
|
per_person_per_hour: "Bowlers",
|
|
324
324
|
per_game: "Games"
|
|
325
325
|
};
|
|
326
|
+
function countNoun(noun, count, fallbackPlural) {
|
|
327
|
+
if (noun) return count === 1 ? noun.singular : noun.plural;
|
|
328
|
+
return fallbackPlural;
|
|
329
|
+
}
|
|
330
|
+
function titleCase(s) {
|
|
331
|
+
return s.length === 0 ? s : s[0].toUpperCase() + s.slice(1);
|
|
332
|
+
}
|
|
326
333
|
var ADDON_RATE_SUFFIX = {
|
|
327
334
|
per_person: " / person",
|
|
328
335
|
per_unit: " / unit",
|
|
@@ -442,7 +449,7 @@ function BookingFlow({
|
|
|
442
449
|
}),
|
|
443
450
|
[centerId, productId, dateISO, startMinuteOfDay, endMinuteOfDay, pricingMode, count, selectedAddons, acctName, acctEmail]
|
|
444
451
|
);
|
|
445
|
-
const
|
|
452
|
+
const availableUnits = availability.data ? availableUnitCount(availability.data) : null;
|
|
446
453
|
const quoteCents = preview.data?.totalCentsPerPlan?.[0]?.totalCents ?? null;
|
|
447
454
|
const addonList = addons.data ?? [];
|
|
448
455
|
const startOptions = startTimes.data ?? [];
|
|
@@ -514,7 +521,7 @@ function BookingFlow({
|
|
|
514
521
|
const fee = preview.data?.reservationFee;
|
|
515
522
|
const feeCents = typeof fee?.amountCents === "number" ? fee.amountCents : 0;
|
|
516
523
|
const feeLabel = typeof fee?.label === "string" && fee.label ? fee.label : t.reservationFeeLabel;
|
|
517
|
-
const reservationLine = t.reservationLineLabel.replace("{count}", String(count)).replace("{unit}", COUNT_LABEL[pricingMode]).replace("{date}", formatDateLabel(dateISO)).replace("{time}", `${formatMinuteLabel(startMinuteOfDay)}\u2013${formatMinuteLabel(endMinuteOfDay)}`);
|
|
524
|
+
const reservationLine = t.reservationLineLabel.replace("{count}", String(count)).replace("{unit}", countNoun(preview.data?.unitNoun, count, COUNT_LABEL[pricingMode])).replace("{date}", formatDateLabel(dateISO)).replace("{time}", `${formatMinuteLabel(startMinuteOfDay)}\u2013${formatMinuteLabel(endMinuteOfDay)}`);
|
|
518
525
|
const chosenAddons = addonList.map((a) => ({ ...a, quantity: addonQtys[a.id] ?? 0 })).filter((a) => a.quantity > 0);
|
|
519
526
|
const fallbackAddonsCents = chosenAddons.reduce(
|
|
520
527
|
(sum, a) => sum + a.priceCents * a.quantity,
|
|
@@ -629,7 +636,9 @@ function BookingFlow({
|
|
|
629
636
|
)
|
|
630
637
|
] }),
|
|
631
638
|
/* @__PURE__ */ jsxs("label", { style: s.label, children: [
|
|
632
|
-
|
|
639
|
+
titleCase(
|
|
640
|
+
(availability.data?.unitNoun ?? preview.data?.unitNoun)?.plural ?? COUNT_LABEL[pricingMode]
|
|
641
|
+
),
|
|
633
642
|
/* @__PURE__ */ jsx(
|
|
634
643
|
"input",
|
|
635
644
|
{
|
|
@@ -680,7 +689,7 @@ function BookingFlow({
|
|
|
680
689
|
] }) : null
|
|
681
690
|
] }) : t.signInAtCheckout }),
|
|
682
691
|
/* @__PURE__ */ jsxs("p", { style: s.meta, "aria-live": "polite", children: [
|
|
683
|
-
dateISO === "" || startOptions.length === 0 ? "" : availability.loading ? t.checkingAvailability :
|
|
692
|
+
dateISO === "" || startOptions.length === 0 ? "" : availability.loading ? t.checkingAvailability : availableUnits !== null ? `${availableUnits} ${countNoun(availability.data?.unitNoun ?? unitLabel, availableUnits, unitLabel.plural)} available` : availability.error ? availability.error.code : "",
|
|
684
693
|
startOptions.length > 0 && quoteCents !== null ? ` \xB7 ${formatCents(quoteCents)}` : ""
|
|
685
694
|
] }),
|
|
686
695
|
/* @__PURE__ */ jsx(
|