@bowlos/reservations 0.27.0 → 0.28.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 +37 -0
- package/dist/{account-D40XqO4d.d.cts → account-BZ-lZcs5.d.cts} +1 -1
- package/dist/{account-BwGAUqXP.d.ts → account-DVAwhiki.d.ts} +1 -1
- package/dist/{catalog-V2LD9X6-.d.cts → catalog-BdOZC2nx.d.cts} +1 -1
- package/dist/{catalog-OLD8ShC_.d.ts → catalog-C-YyKVk5.d.ts} +1 -1
- package/dist/{chunk-AB3D63RF.js → chunk-44AWSRIG.js} +32 -4
- package/dist/chunk-44AWSRIG.js.map +1 -0
- package/dist/{chunk-IG6SFBZK.js → chunk-P5YWNLEC.js} +26 -2
- package/dist/chunk-P5YWNLEC.js.map +1 -0
- package/dist/cli.cjs +24 -0
- package/dist/cli.cjs.map +1 -1
- package/dist/components.cjs +104 -1
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +15 -4
- package/dist/components.d.ts +15 -4
- package/dist/components.js +106 -3
- package/dist/components.js.map +1 -1
- package/dist/{data-CtrEtDnP.d.cts → data-BzO2guh0.d.cts} +14 -0
- package/dist/{data-CtrEtDnP.d.ts → data-BzO2guh0.d.ts} +14 -0
- package/dist/index.cjs +24 -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.d.cts +1 -1
- package/dist/payments.d.ts +1 -1
- package/dist/{react-CLHP9bcD.d.ts → react-BQaKMnCR.d.ts} +8 -2
- package/dist/{react-B2zTfI5g.d.cts → react-CYgFZdHO.d.cts} +8 -2
- package/dist/react.cjs +53 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +5 -5
- package/dist/react.d.ts +5 -5
- package/dist/react.js +3 -3
- package/package.json +1 -1
- package/templates/center-site/package.json +1 -1
- package/dist/chunk-AB3D63RF.js.map +0 -1
- package/dist/chunk-IG6SFBZK.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-BdOZC2nx.cjs';
|
|
4
|
+
export { h as CatalogResult, i as CatalogSection } from './catalog-BdOZC2nx.cjs';
|
|
5
|
+
import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-BzO2guh0.cjs';
|
|
6
|
+
import { d as UseAccountResult } from './react-CYgFZdHO.cjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Themeable design tokens for the `@bowlos/reservations/components` layer.
|
|
@@ -165,6 +165,17 @@ interface AuthGateLabels {
|
|
|
165
165
|
finishProfile: string;
|
|
166
166
|
saving: string;
|
|
167
167
|
signOut: string;
|
|
168
|
+
forgotPassword: string;
|
|
169
|
+
resetHeading: string;
|
|
170
|
+
resetIntro: string;
|
|
171
|
+
sendResetCode: string;
|
|
172
|
+
sending: string;
|
|
173
|
+
resetCode: string;
|
|
174
|
+
newPassword: string;
|
|
175
|
+
resetCodeSent: string;
|
|
176
|
+
setNewPassword: string;
|
|
177
|
+
resetting: string;
|
|
178
|
+
backToSignIn: string;
|
|
168
179
|
}
|
|
169
180
|
/**
|
|
170
181
|
* The presentational session form — driven by a session controller passed in,
|
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-C-YyKVk5.js';
|
|
4
|
+
export { h as CatalogResult, i as CatalogSection } from './catalog-C-YyKVk5.js';
|
|
5
|
+
import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-BzO2guh0.js';
|
|
6
|
+
import { d as UseAccountResult } from './react-BQaKMnCR.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Themeable design tokens for the `@bowlos/reservations/components` layer.
|
|
@@ -165,6 +165,17 @@ interface AuthGateLabels {
|
|
|
165
165
|
finishProfile: string;
|
|
166
166
|
saving: string;
|
|
167
167
|
signOut: string;
|
|
168
|
+
forgotPassword: string;
|
|
169
|
+
resetHeading: string;
|
|
170
|
+
resetIntro: string;
|
|
171
|
+
sendResetCode: string;
|
|
172
|
+
sending: string;
|
|
173
|
+
resetCode: string;
|
|
174
|
+
newPassword: string;
|
|
175
|
+
resetCodeSent: string;
|
|
176
|
+
setNewPassword: string;
|
|
177
|
+
resetting: string;
|
|
178
|
+
backToSignIn: string;
|
|
168
179
|
}
|
|
169
180
|
/**
|
|
170
181
|
* The presentational session form — driven by a session controller passed in,
|
package/dist/components.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useTestMode, useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog } from './chunk-
|
|
2
|
-
import { availableUnitCount } from './chunk-
|
|
1
|
+
import { useTestMode, useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog } from './chunk-44AWSRIG.js';
|
|
2
|
+
import { availableUnitCount } from './chunk-P5YWNLEC.js';
|
|
3
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
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -52,7 +52,18 @@ var DEFAULT_LABELS = {
|
|
|
52
52
|
needAccount: "New here? Create an account",
|
|
53
53
|
finishProfile: "Save profile",
|
|
54
54
|
saving: "Saving\u2026",
|
|
55
|
-
signOut: "Sign out"
|
|
55
|
+
signOut: "Sign out",
|
|
56
|
+
forgotPassword: "Forgot password?",
|
|
57
|
+
resetHeading: "Reset your password",
|
|
58
|
+
resetIntro: "Enter your email and we'll send you a reset code.",
|
|
59
|
+
sendResetCode: "Send reset code",
|
|
60
|
+
sending: "Sending\u2026",
|
|
61
|
+
resetCode: "Reset code",
|
|
62
|
+
newPassword: "New password",
|
|
63
|
+
resetCodeSent: "If that email has an account, a reset code is on its way. Enter it below with your new password.",
|
|
64
|
+
setNewPassword: "Set new password",
|
|
65
|
+
resetting: "Resetting\u2026",
|
|
66
|
+
backToSignIn: "Back to sign in"
|
|
56
67
|
};
|
|
57
68
|
function AuthForm({
|
|
58
69
|
account,
|
|
@@ -64,6 +75,7 @@ function AuthForm({
|
|
|
64
75
|
const [email, setEmail] = useState("");
|
|
65
76
|
const [password, setPassword] = useState("");
|
|
66
77
|
const [fullName, setFullName] = useState("");
|
|
78
|
+
const [resetCode, setResetCode] = useState("");
|
|
67
79
|
const [busy, setBusy] = useState(false);
|
|
68
80
|
const s = styles();
|
|
69
81
|
async function guard(action) {
|
|
@@ -89,6 +101,17 @@ function AuthForm({
|
|
|
89
101
|
e.preventDefault();
|
|
90
102
|
void guard(() => account.link({ fullName, email, marketingOptIn: false }));
|
|
91
103
|
};
|
|
104
|
+
const onForgotRequest = (e) => {
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
void guard(async () => {
|
|
107
|
+
await account.requestPasswordReset(email);
|
|
108
|
+
setMode("forgotReset");
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
const onForgotReset = (e) => {
|
|
112
|
+
e.preventDefault();
|
|
113
|
+
void guard(() => account.resetPassword(email, resetCode.trim(), password));
|
|
114
|
+
};
|
|
92
115
|
if (account.status === "loading") {
|
|
93
116
|
return /* @__PURE__ */ jsx("div", { className, style: s.card, children: /* @__PURE__ */ jsx("p", { style: s.muted, children: t.loading }) });
|
|
94
117
|
}
|
|
@@ -118,6 +141,77 @@ function AuthForm({
|
|
|
118
141
|
] });
|
|
119
142
|
}
|
|
120
143
|
if (account.status === "linked") return null;
|
|
144
|
+
if (mode === "forgotRequest") {
|
|
145
|
+
return /* @__PURE__ */ jsxs("form", { className, style: s.card, onSubmit: onForgotRequest, children: [
|
|
146
|
+
/* @__PURE__ */ jsx("h3", { style: s.heading, children: t.resetHeading }),
|
|
147
|
+
/* @__PURE__ */ jsx("p", { style: s.muted, children: t.resetIntro }),
|
|
148
|
+
/* @__PURE__ */ jsxs("label", { style: s.label, children: [
|
|
149
|
+
t.email,
|
|
150
|
+
/* @__PURE__ */ jsx(
|
|
151
|
+
"input",
|
|
152
|
+
{
|
|
153
|
+
type: "email",
|
|
154
|
+
value: email,
|
|
155
|
+
onChange: (e) => setEmail(e.target.value),
|
|
156
|
+
style: s.input,
|
|
157
|
+
required: true
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
] }),
|
|
161
|
+
/* @__PURE__ */ jsx("button", { type: "submit", style: s.primaryBtn, disabled: busy, children: busy ? t.sending : t.sendResetCode }),
|
|
162
|
+
/* @__PURE__ */ jsx("button", { type: "button", style: s.linkBtn, onClick: () => setMode("signIn"), children: t.backToSignIn }),
|
|
163
|
+
account.error && /* @__PURE__ */ jsx("p", { style: s.error, children: account.error.code })
|
|
164
|
+
] });
|
|
165
|
+
}
|
|
166
|
+
if (mode === "forgotReset") {
|
|
167
|
+
return /* @__PURE__ */ jsxs("form", { className, style: s.card, onSubmit: onForgotReset, children: [
|
|
168
|
+
/* @__PURE__ */ jsx("h3", { style: s.heading, children: t.resetHeading }),
|
|
169
|
+
/* @__PURE__ */ jsx("p", { style: s.muted, children: t.resetCodeSent }),
|
|
170
|
+
/* @__PURE__ */ jsxs("label", { style: s.label, children: [
|
|
171
|
+
t.email,
|
|
172
|
+
/* @__PURE__ */ jsx(
|
|
173
|
+
"input",
|
|
174
|
+
{
|
|
175
|
+
type: "email",
|
|
176
|
+
value: email,
|
|
177
|
+
onChange: (e) => setEmail(e.target.value),
|
|
178
|
+
style: s.input,
|
|
179
|
+
required: true
|
|
180
|
+
}
|
|
181
|
+
)
|
|
182
|
+
] }),
|
|
183
|
+
/* @__PURE__ */ jsxs("label", { style: s.label, children: [
|
|
184
|
+
t.resetCode,
|
|
185
|
+
/* @__PURE__ */ jsx(
|
|
186
|
+
"input",
|
|
187
|
+
{
|
|
188
|
+
value: resetCode,
|
|
189
|
+
onChange: (e) => setResetCode(e.target.value),
|
|
190
|
+
style: s.input,
|
|
191
|
+
inputMode: "numeric",
|
|
192
|
+
autoComplete: "one-time-code",
|
|
193
|
+
required: true
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
] }),
|
|
197
|
+
/* @__PURE__ */ jsxs("label", { style: s.label, children: [
|
|
198
|
+
t.newPassword,
|
|
199
|
+
/* @__PURE__ */ jsx(
|
|
200
|
+
"input",
|
|
201
|
+
{
|
|
202
|
+
type: "password",
|
|
203
|
+
value: password,
|
|
204
|
+
onChange: (e) => setPassword(e.target.value),
|
|
205
|
+
style: s.input,
|
|
206
|
+
required: true
|
|
207
|
+
}
|
|
208
|
+
)
|
|
209
|
+
] }),
|
|
210
|
+
/* @__PURE__ */ jsx("button", { type: "submit", style: s.primaryBtn, disabled: busy, children: busy ? t.resetting : t.setNewPassword }),
|
|
211
|
+
/* @__PURE__ */ jsx("button", { type: "button", style: s.linkBtn, onClick: () => setMode("signIn"), children: t.backToSignIn }),
|
|
212
|
+
account.error && /* @__PURE__ */ jsx("p", { style: s.error, children: account.error.code })
|
|
213
|
+
] });
|
|
214
|
+
}
|
|
121
215
|
return /* @__PURE__ */ jsxs("form", { className, style: s.card, onSubmit: onAuth, children: [
|
|
122
216
|
/* @__PURE__ */ jsx("h3", { style: s.heading, children: mode === "signIn" ? t.signInHeading : t.signUpHeading }),
|
|
123
217
|
mode === "signUp" && /* @__PURE__ */ jsxs("label", { style: s.label, children: [
|
|
@@ -168,6 +262,15 @@ function AuthForm({
|
|
|
168
262
|
children: mode === "signIn" ? t.needAccount : t.haveAccount
|
|
169
263
|
}
|
|
170
264
|
),
|
|
265
|
+
mode === "signIn" && /* @__PURE__ */ jsx(
|
|
266
|
+
"button",
|
|
267
|
+
{
|
|
268
|
+
type: "button",
|
|
269
|
+
style: s.linkBtn,
|
|
270
|
+
onClick: () => setMode("forgotRequest"),
|
|
271
|
+
children: t.forgotPassword
|
|
272
|
+
}
|
|
273
|
+
),
|
|
171
274
|
account.error && /* @__PURE__ */ jsx("p", { style: s.error, children: account.error.code })
|
|
172
275
|
] });
|
|
173
276
|
}
|