@workos-inc/widgets 1.10.2 → 1.11.0-next.1776971102464
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/CHANGELOG.md +14 -5
- package/dist/cjs/api/endpoint.cjs +68 -0
- package/dist/cjs/api/endpoint.cjs.map +1 -1
- package/dist/cjs/api/endpoint.d.cts +87 -1
- package/dist/cjs/experimental/api/fetch.cjs +44 -0
- package/dist/cjs/experimental/api/fetch.cjs.map +1 -1
- package/dist/cjs/experimental/api/fetch.d.cts +117 -1
- package/dist/cjs/experimental/api/react-query.cjs +76 -0
- package/dist/cjs/experimental/api/react-query.cjs.map +1 -1
- package/dist/cjs/experimental/api/react-query.d.cts +155 -1
- package/dist/cjs/experimental/api/swr.cjs +88 -0
- package/dist/cjs/experimental/api/swr.cjs.map +1 -1
- package/dist/cjs/experimental/api/swr.d.cts +153 -1
- package/dist/cjs/lib/change-email-dialog.cjs +372 -0
- package/dist/cjs/lib/change-email-dialog.cjs.map +1 -0
- package/dist/cjs/lib/change-email-dialog.d.cts +13 -0
- package/dist/cjs/lib/set-password-dialog.cjs +145 -132
- package/dist/cjs/lib/set-password-dialog.cjs.map +1 -1
- package/dist/cjs/lib/set-password-dialog.d.cts +8 -1
- package/dist/cjs/lib/user-profile.cjs +21 -1
- package/dist/cjs/lib/user-profile.cjs.map +1 -1
- package/dist/esm/api/endpoint.d.ts +87 -1
- package/dist/esm/api/endpoint.js +62 -0
- package/dist/esm/api/endpoint.js.map +1 -1
- package/dist/esm/experimental/api/fetch.d.ts +117 -1
- package/dist/esm/experimental/api/fetch.js +40 -0
- package/dist/esm/experimental/api/fetch.js.map +1 -1
- package/dist/esm/experimental/api/react-query.d.ts +155 -1
- package/dist/esm/experimental/api/react-query.js +68 -0
- package/dist/esm/experimental/api/react-query.js.map +1 -1
- package/dist/esm/experimental/api/swr.d.ts +153 -1
- package/dist/esm/experimental/api/swr.js +78 -0
- package/dist/esm/experimental/api/swr.js.map +1 -1
- package/dist/esm/lib/change-email-dialog.d.ts +13 -0
- package/dist/esm/lib/change-email-dialog.js +343 -0
- package/dist/esm/lib/change-email-dialog.js.map +1 -0
- package/dist/esm/lib/set-password-dialog.d.ts +8 -1
- package/dist/esm/lib/set-password-dialog.js +144 -132
- package/dist/esm/lib/set-password-dialog.js.map +1 -1
- package/dist/esm/lib/user-profile.js +21 -1
- package/dist/esm/lib/user-profile.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { Me } from '../api/endpoint.js';
|
|
4
|
+
import '@tanstack/react-query';
|
|
5
|
+
import '../api/widgets-api-client.js';
|
|
6
|
+
|
|
7
|
+
interface ChangeEmailDialogProps {
|
|
8
|
+
user: Me;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare function ChangeEmailDialog({ children, user }: ChangeEmailDialogProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { ChangeEmailDialog };
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Callout, Flex, Text, VisuallyHidden } from "@radix-ui/themes";
|
|
4
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
5
|
+
import { Form } from "radix-ui";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import {
|
|
8
|
+
getMeQueryKey,
|
|
9
|
+
useAuthenticationInformation,
|
|
10
|
+
useSendEmailChange,
|
|
11
|
+
useVerifyEmailChange
|
|
12
|
+
} from "../api/endpoint.js";
|
|
13
|
+
import { useElevatedAccessToken } from "../api/api-provider.js";
|
|
14
|
+
import { Button, Dialog, Label, TextField } from "./elements.js";
|
|
15
|
+
import { ElevatedAccess } from "./elevated-access.js";
|
|
16
|
+
import { Translation } from "./i18n/translation.js";
|
|
17
|
+
import { useTranslation } from "./i18n/use-translation.js";
|
|
18
|
+
import * as Otp from "./otp-input.js";
|
|
19
|
+
import { SaveButton } from "./save-button.js";
|
|
20
|
+
import { SetPasswordForm } from "./set-password-dialog.js";
|
|
21
|
+
function ChangeEmailDialog({ children, user }) {
|
|
22
|
+
const [open, setOpen] = React.useState(false);
|
|
23
|
+
const handleClose = React.useCallback(() => {
|
|
24
|
+
setOpen(false);
|
|
25
|
+
}, []);
|
|
26
|
+
return /* @__PURE__ */ jsxs(Dialog.Root, { open, onOpenChange: setOpen, children: [
|
|
27
|
+
/* @__PURE__ */ jsx(Dialog.Trigger, { children }),
|
|
28
|
+
/* @__PURE__ */ jsx(Dialog.Content, { maxWidth: "480px", children: /* @__PURE__ */ jsx(ElevatedAccess, { children: /* @__PURE__ */ jsx(Content, { user, onClose: handleClose }) }) })
|
|
29
|
+
] });
|
|
30
|
+
}
|
|
31
|
+
function Content({ user, onClose }) {
|
|
32
|
+
const [step, setStep] = React.useState({ name: "send" });
|
|
33
|
+
const authInfo = useAuthenticationInformation();
|
|
34
|
+
const passwordIsSetUp = authInfo.data?.data.verificationMethods.Password?.isSetUp;
|
|
35
|
+
const handleVerified = React.useCallback(
|
|
36
|
+
(newEmail) => {
|
|
37
|
+
if (passwordIsSetUp === false) {
|
|
38
|
+
setStep({ name: "set-password", newEmail });
|
|
39
|
+
} else {
|
|
40
|
+
onClose();
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
[passwordIsSetUp, onClose]
|
|
44
|
+
);
|
|
45
|
+
switch (step.name) {
|
|
46
|
+
case "send":
|
|
47
|
+
return /* @__PURE__ */ jsx(
|
|
48
|
+
SendEmailChangeForm,
|
|
49
|
+
{
|
|
50
|
+
user,
|
|
51
|
+
onSuccess: (newEmail) => setStep({ name: "verify", newEmail })
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
case "verify":
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
56
|
+
VerifyEmailChangeForm,
|
|
57
|
+
{
|
|
58
|
+
newEmail: step.newEmail,
|
|
59
|
+
onBack: () => setStep({ name: "send" }),
|
|
60
|
+
onSuccess: () => handleVerified(step.newEmail)
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
case "set-password":
|
|
64
|
+
return /* @__PURE__ */ jsx(SetPasswordStep, { newEmail: step.newEmail, onDone: onClose });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function SendEmailChangeForm({ user, onSuccess }) {
|
|
68
|
+
const translate = useTranslation();
|
|
69
|
+
const [newEmail, setNewEmail] = React.useState("");
|
|
70
|
+
const sendEmailChange = useSendEmailChange({
|
|
71
|
+
mutation: {
|
|
72
|
+
onSuccess: (_response, variables) => {
|
|
73
|
+
onSuccess(variables.data.newEmail);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
78
|
+
/* @__PURE__ */ jsx(Dialog.Title, { mb: "2", children: /* @__PURE__ */ jsx(
|
|
79
|
+
Translation,
|
|
80
|
+
{
|
|
81
|
+
defaultMessage: "Change email address",
|
|
82
|
+
id: "KdUdX9",
|
|
83
|
+
description: "Dialog title for changing the user's email address"
|
|
84
|
+
}
|
|
85
|
+
) }),
|
|
86
|
+
/* @__PURE__ */ jsx(Dialog.Description, { mb: "5", children: /* @__PURE__ */ jsx(
|
|
87
|
+
Translation,
|
|
88
|
+
{
|
|
89
|
+
defaultMessage: "We'll send a verification code to your new email address to confirm the change. Your current email is {email}.",
|
|
90
|
+
id: "K6x8v6",
|
|
91
|
+
description: "Description explaining that a verification code will be sent to the new email, including the user's current email",
|
|
92
|
+
values: {
|
|
93
|
+
email: /* @__PURE__ */ jsx(Text, { weight: "bold", highContrast: true, children: user.email })
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
) }),
|
|
97
|
+
sendEmailChange.error ? /* @__PURE__ */ jsx(Callout.Root, { color: "red", mt: "-2", mb: "0", children: /* @__PURE__ */ jsx(Callout.Text, { children: getMutationErrorMessage(sendEmailChange.error) }) }) : null,
|
|
98
|
+
/* @__PURE__ */ jsxs(
|
|
99
|
+
Form.Root,
|
|
100
|
+
{
|
|
101
|
+
onSubmit: (event) => {
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
const trimmed = newEmail.trim();
|
|
104
|
+
if (!trimmed) return;
|
|
105
|
+
sendEmailChange.mutate({ data: { newEmail: trimmed } });
|
|
106
|
+
},
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ jsx(Flex, { my: "5", direction: "column", gap: "4", children: /* @__PURE__ */ jsx(Form.Field, { name: "newEmail", asChild: true, children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "1", children: [
|
|
109
|
+
/* @__PURE__ */ jsx(Form.Label, { asChild: true, children: /* @__PURE__ */ jsx(Label, { children: /* @__PURE__ */ jsx(
|
|
110
|
+
Translation,
|
|
111
|
+
{
|
|
112
|
+
defaultMessage: "New email address",
|
|
113
|
+
id: "dbgchn",
|
|
114
|
+
description: "Label for the new email input"
|
|
115
|
+
}
|
|
116
|
+
) }) }),
|
|
117
|
+
/* @__PURE__ */ jsx(Form.Control, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
118
|
+
TextField,
|
|
119
|
+
{
|
|
120
|
+
type: "email",
|
|
121
|
+
autoComplete: "email",
|
|
122
|
+
autoFocus: true,
|
|
123
|
+
required: true,
|
|
124
|
+
value: newEmail,
|
|
125
|
+
onChange: (event) => setNewEmail(event.target.value),
|
|
126
|
+
placeholder: translate({
|
|
127
|
+
defaultMessage: "name@example.com",
|
|
128
|
+
id: "QyYabV",
|
|
129
|
+
description: "Placeholder for the new email input"
|
|
130
|
+
}),
|
|
131
|
+
disabled: sendEmailChange.isPending
|
|
132
|
+
}
|
|
133
|
+
) })
|
|
134
|
+
] }) }) }),
|
|
135
|
+
/* @__PURE__ */ jsxs(Flex, { mt: "5", gap: "3", justify: "end", children: [
|
|
136
|
+
/* @__PURE__ */ jsx(Dialog.Close, { children: /* @__PURE__ */ jsx(
|
|
137
|
+
Button,
|
|
138
|
+
{
|
|
139
|
+
variant: "secondary",
|
|
140
|
+
type: "button",
|
|
141
|
+
disabled: sendEmailChange.isPending,
|
|
142
|
+
children: /* @__PURE__ */ jsx(
|
|
143
|
+
Translation,
|
|
144
|
+
{
|
|
145
|
+
defaultMessage: "Cancel",
|
|
146
|
+
id: "hHNj31",
|
|
147
|
+
description: "Cancel button text"
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
) }),
|
|
152
|
+
/* @__PURE__ */ jsx(
|
|
153
|
+
Button,
|
|
154
|
+
{
|
|
155
|
+
type: "submit",
|
|
156
|
+
loading: sendEmailChange.isPending,
|
|
157
|
+
disabled: !newEmail.trim(),
|
|
158
|
+
children: /* @__PURE__ */ jsx(
|
|
159
|
+
Translation,
|
|
160
|
+
{
|
|
161
|
+
defaultMessage: "Send verification code",
|
|
162
|
+
id: "1bX9l4",
|
|
163
|
+
description: "Button text to send the email change verification code"
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
)
|
|
168
|
+
] })
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
] });
|
|
173
|
+
}
|
|
174
|
+
function VerifyEmailChangeForm({
|
|
175
|
+
newEmail,
|
|
176
|
+
onBack,
|
|
177
|
+
onSuccess
|
|
178
|
+
}) {
|
|
179
|
+
const client = useQueryClient();
|
|
180
|
+
const { setElevatedAccess } = useElevatedAccessToken();
|
|
181
|
+
const verifyEmailChange = useVerifyEmailChange({
|
|
182
|
+
mutation: {
|
|
183
|
+
onSuccess: async (response) => {
|
|
184
|
+
setElevatedAccess({
|
|
185
|
+
token: response.elevatedAccessToken,
|
|
186
|
+
expiresAt: response.expiresAt
|
|
187
|
+
});
|
|
188
|
+
client.setQueryData(
|
|
189
|
+
getMeQueryKey(),
|
|
190
|
+
(old) => old ? { ...old, ...response.user } : response.user
|
|
191
|
+
);
|
|
192
|
+
await client.invalidateQueries({ queryKey: getMeQueryKey() });
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
const isSubmitting = verifyEmailChange.isPending;
|
|
197
|
+
const handleSubmit = (event) => {
|
|
198
|
+
event.preventDefault();
|
|
199
|
+
const formData = new FormData(event.currentTarget);
|
|
200
|
+
const code = formData.get("otp-code")?.toString() ?? "";
|
|
201
|
+
if (!code) return;
|
|
202
|
+
verifyEmailChange.mutate({ data: { code } });
|
|
203
|
+
};
|
|
204
|
+
return /* @__PURE__ */ jsxs(Form.Root, { onSubmit: handleSubmit, children: [
|
|
205
|
+
/* @__PURE__ */ jsx(Dialog.Title, { mb: "2", children: /* @__PURE__ */ jsx(
|
|
206
|
+
Translation,
|
|
207
|
+
{
|
|
208
|
+
defaultMessage: "Enter verification code",
|
|
209
|
+
id: "upvyOt",
|
|
210
|
+
description: "Dialog title for entering the email change verification code"
|
|
211
|
+
}
|
|
212
|
+
) }),
|
|
213
|
+
/* @__PURE__ */ jsx(Dialog.Description, { children: /* @__PURE__ */ jsx(
|
|
214
|
+
Translation,
|
|
215
|
+
{
|
|
216
|
+
defaultMessage: "A verification code was sent to {email}. Please enter it below.",
|
|
217
|
+
id: "9OH/qs",
|
|
218
|
+
description: "Description explaining where the email change code was sent",
|
|
219
|
+
values: {
|
|
220
|
+
email: /* @__PURE__ */ jsx(Text, { weight: "bold", highContrast: true, children: newEmail })
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
) }),
|
|
224
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "2", mt: "5", mx: "auto", width: "fit-content", children: [
|
|
225
|
+
/* @__PURE__ */ jsxs(
|
|
226
|
+
Otp.Root,
|
|
227
|
+
{
|
|
228
|
+
autoSubmit: true,
|
|
229
|
+
gap: "2",
|
|
230
|
+
justify: "center",
|
|
231
|
+
columns: "repeat(6, 48px)",
|
|
232
|
+
width: "fit-content",
|
|
233
|
+
rows: "48px",
|
|
234
|
+
name: "otp-code",
|
|
235
|
+
readOnly: isSubmitting,
|
|
236
|
+
children: [
|
|
237
|
+
/* @__PURE__ */ jsx(Otp.Input, { required: true, autoFocus: true, autoComplete: "off" }),
|
|
238
|
+
/* @__PURE__ */ jsx(Otp.Input, { required: true }),
|
|
239
|
+
/* @__PURE__ */ jsx(Otp.Input, { required: true }),
|
|
240
|
+
/* @__PURE__ */ jsx(Otp.Input, { required: true }),
|
|
241
|
+
/* @__PURE__ */ jsx(Otp.Input, { required: true }),
|
|
242
|
+
/* @__PURE__ */ jsx(Otp.Input, { required: true })
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
),
|
|
246
|
+
verifyEmailChange.error ? /* @__PURE__ */ jsx(Text, { color: "red", size: "2", as: "p", children: getMutationErrorMessage(verifyEmailChange.error) }) : null
|
|
247
|
+
] }),
|
|
248
|
+
/* @__PURE__ */ jsxs(Flex, { mt: "5", gap: "3", justify: "between", align: "center", children: [
|
|
249
|
+
/* @__PURE__ */ jsx(
|
|
250
|
+
Button,
|
|
251
|
+
{
|
|
252
|
+
variant: "secondary",
|
|
253
|
+
type: "button",
|
|
254
|
+
onClick: onBack,
|
|
255
|
+
disabled: isSubmitting,
|
|
256
|
+
children: /* @__PURE__ */ jsx(
|
|
257
|
+
Translation,
|
|
258
|
+
{
|
|
259
|
+
defaultMessage: "Use a different email",
|
|
260
|
+
id: "HVuco9",
|
|
261
|
+
description: "Button text to go back and change the new email address"
|
|
262
|
+
}
|
|
263
|
+
)
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "3", children: [
|
|
267
|
+
/* @__PURE__ */ jsx(Dialog.Close, { children: /* @__PURE__ */ jsx(Button, { variant: "secondary", type: "button", disabled: isSubmitting, children: /* @__PURE__ */ jsx(
|
|
268
|
+
Translation,
|
|
269
|
+
{
|
|
270
|
+
defaultMessage: "Cancel",
|
|
271
|
+
id: "hHNj31",
|
|
272
|
+
description: "Cancel button text"
|
|
273
|
+
}
|
|
274
|
+
) }) }),
|
|
275
|
+
/* @__PURE__ */ jsx(
|
|
276
|
+
SaveButton,
|
|
277
|
+
{
|
|
278
|
+
type: "submit",
|
|
279
|
+
loading: isSubmitting,
|
|
280
|
+
done: verifyEmailChange.isSuccess,
|
|
281
|
+
onDone: onSuccess,
|
|
282
|
+
children: /* @__PURE__ */ jsx(
|
|
283
|
+
Translation,
|
|
284
|
+
{
|
|
285
|
+
defaultMessage: "Confirm",
|
|
286
|
+
id: "EmYENK",
|
|
287
|
+
description: "Confirm button text for verification"
|
|
288
|
+
}
|
|
289
|
+
)
|
|
290
|
+
}
|
|
291
|
+
)
|
|
292
|
+
] })
|
|
293
|
+
] }),
|
|
294
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsx("section", { "aria-live": "polite", children: verifyEmailChange.error ? getMutationErrorMessage(verifyEmailChange.error) : null }) })
|
|
295
|
+
] });
|
|
296
|
+
}
|
|
297
|
+
function SetPasswordStep({ newEmail, onDone }) {
|
|
298
|
+
return /* @__PURE__ */ jsx(
|
|
299
|
+
SetPasswordForm,
|
|
300
|
+
{
|
|
301
|
+
description: /* @__PURE__ */ jsx(Dialog.Description, { children: /* @__PURE__ */ jsx(
|
|
302
|
+
Translation,
|
|
303
|
+
{
|
|
304
|
+
defaultMessage: "Your email has been successfully updated to {email}. You can also set a password now if you'd like to be able to sign in with email and password.",
|
|
305
|
+
id: "U7k/vL",
|
|
306
|
+
description: "Description for the set-password step after a successful email change",
|
|
307
|
+
values: {
|
|
308
|
+
email: /* @__PURE__ */ jsx(Text, { weight: "bold", highContrast: true, children: newEmail })
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
) }),
|
|
312
|
+
onSuccess: onDone,
|
|
313
|
+
cancel: /* @__PURE__ */ jsx(Button, { variant: "secondary", type: "button", onClick: onDone, children: /* @__PURE__ */ jsx(
|
|
314
|
+
Translation,
|
|
315
|
+
{
|
|
316
|
+
defaultMessage: "Not now",
|
|
317
|
+
id: "/7/PVX",
|
|
318
|
+
description: "Button to dismiss the set-password step and close the dialog"
|
|
319
|
+
}
|
|
320
|
+
) })
|
|
321
|
+
}
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
function getMutationErrorMessage(error) {
|
|
325
|
+
if (error instanceof Error) {
|
|
326
|
+
return error.message;
|
|
327
|
+
}
|
|
328
|
+
if (typeof error === "object" && error !== null && "message" in error && typeof error.message === "string") {
|
|
329
|
+
return error.message;
|
|
330
|
+
}
|
|
331
|
+
return /* @__PURE__ */ jsx(
|
|
332
|
+
Translation,
|
|
333
|
+
{
|
|
334
|
+
defaultMessage: "Something went wrong. Please try again.",
|
|
335
|
+
id: "Dn/G2O",
|
|
336
|
+
description: "Generic error message for email change failure"
|
|
337
|
+
}
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
export {
|
|
341
|
+
ChangeEmailDialog
|
|
342
|
+
};
|
|
343
|
+
//# sourceMappingURL=change-email-dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/change-email-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { Callout, Flex, Text, VisuallyHidden } from \"@radix-ui/themes\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { Form } from \"radix-ui\";\nimport * as React from \"react\";\nimport { type ReactNode } from \"react\";\nimport {\n getMeQueryKey,\n Me,\n useAuthenticationInformation,\n useSendEmailChange,\n useVerifyEmailChange,\n} from \"../api/endpoint.js\";\nimport { useElevatedAccessToken } from \"../api/api-provider.js\";\nimport { Button, Dialog, Label, TextField } from \"./elements.js\";\nimport { ElevatedAccess } from \"./elevated-access.js\";\nimport { Translation } from \"./i18n/translation.js\";\nimport { useTranslation } from \"./i18n/use-translation.js\";\nimport * as Otp from \"./otp-input.js\";\nimport { SaveButton } from \"./save-button.js\";\nimport { SetPasswordForm } from \"./set-password-dialog.js\";\n\ninterface ChangeEmailDialogProps {\n user: Me;\n children?: ReactNode;\n}\n\nexport function ChangeEmailDialog({ children, user }: ChangeEmailDialogProps) {\n const [open, setOpen] = React.useState(false);\n\n const handleClose = React.useCallback(() => {\n setOpen(false);\n }, []);\n\n return (\n <Dialog.Root open={open} onOpenChange={setOpen}>\n <Dialog.Trigger>{children}</Dialog.Trigger>\n\n <Dialog.Content maxWidth=\"480px\">\n <ElevatedAccess>\n <Content user={user} onClose={handleClose} />\n </ElevatedAccess>\n </Dialog.Content>\n </Dialog.Root>\n );\n}\n\ninterface ContentProps {\n user: Me;\n onClose: () => void;\n}\n\ntype Step =\n | { name: \"send\" }\n | { name: \"verify\"; newEmail: string }\n | { name: \"set-password\"; newEmail: string };\n\nfunction Content({ user, onClose }: ContentProps) {\n const [step, setStep] = React.useState<Step>({ name: \"send\" });\n const authInfo = useAuthenticationInformation();\n\n const passwordIsSetUp =\n authInfo.data?.data.verificationMethods.Password?.isSetUp;\n\n const handleVerified = React.useCallback(\n (newEmail: string) => {\n if (passwordIsSetUp === false) {\n setStep({ name: \"set-password\", newEmail });\n } else {\n onClose();\n }\n },\n [passwordIsSetUp, onClose],\n );\n\n switch (step.name) {\n case \"send\":\n return (\n <SendEmailChangeForm\n user={user}\n onSuccess={(newEmail) => setStep({ name: \"verify\", newEmail })}\n />\n );\n case \"verify\":\n return (\n <VerifyEmailChangeForm\n newEmail={step.newEmail}\n onBack={() => setStep({ name: \"send\" })}\n onSuccess={() => handleVerified(step.newEmail)}\n />\n );\n case \"set-password\":\n return <SetPasswordStep newEmail={step.newEmail} onDone={onClose} />;\n }\n}\n\ninterface SendEmailChangeFormProps {\n user: Me;\n onSuccess: (newEmail: string) => void;\n}\n\nfunction SendEmailChangeForm({ user, onSuccess }: SendEmailChangeFormProps) {\n const translate = useTranslation();\n const [newEmail, setNewEmail] = React.useState(\"\");\n const sendEmailChange = useSendEmailChange({\n mutation: {\n onSuccess: (_response, variables) => {\n onSuccess(variables.data.newEmail);\n },\n },\n });\n\n return (\n <>\n <Dialog.Title mb=\"2\">\n <Translation\n defaultMessage=\"Change email address\"\n id=\"KdUdX9\"\n description=\"Dialog title for changing the user's email address\"\n />\n </Dialog.Title>\n\n <Dialog.Description mb=\"5\">\n <Translation\n defaultMessage=\"We'll send a verification code to your new email address to confirm the change. Your current email is {email}.\"\n id=\"K6x8v6\"\n description=\"Description explaining that a verification code will be sent to the new email, including the user's current email\"\n values={{\n email: (\n <Text weight=\"bold\" highContrast>\n {user.email}\n </Text>\n ),\n }}\n />\n </Dialog.Description>\n\n {sendEmailChange.error ? (\n <Callout.Root color=\"red\" mt=\"-2\" mb=\"0\">\n <Callout.Text>\n {getMutationErrorMessage(sendEmailChange.error)}\n </Callout.Text>\n </Callout.Root>\n ) : null}\n\n <Form.Root\n onSubmit={(event) => {\n event.preventDefault();\n const trimmed = newEmail.trim();\n if (!trimmed) return;\n sendEmailChange.mutate({ data: { newEmail: trimmed } });\n }}\n >\n <Flex my=\"5\" direction=\"column\" gap=\"4\">\n <Form.Field name=\"newEmail\" asChild>\n <Flex direction=\"column\" gap=\"1\">\n <Form.Label asChild>\n <Label>\n <Translation\n defaultMessage=\"New email address\"\n id=\"dbgchn\"\n description=\"Label for the new email input\"\n />\n </Label>\n </Form.Label>\n <Form.Control asChild>\n <TextField\n type=\"email\"\n autoComplete=\"email\"\n autoFocus\n required\n value={newEmail}\n onChange={(event) => setNewEmail(event.target.value)}\n placeholder={translate({\n defaultMessage: \"name@example.com\",\n id: \"QyYabV\",\n description: \"Placeholder for the new email input\",\n })}\n disabled={sendEmailChange.isPending}\n />\n </Form.Control>\n </Flex>\n </Form.Field>\n </Flex>\n\n <Flex mt=\"5\" gap=\"3\" justify=\"end\">\n <Dialog.Close>\n <Button\n variant=\"secondary\"\n type=\"button\"\n disabled={sendEmailChange.isPending}\n >\n <Translation\n defaultMessage=\"Cancel\"\n id=\"hHNj31\"\n description=\"Cancel button text\"\n />\n </Button>\n </Dialog.Close>\n <Button\n type=\"submit\"\n loading={sendEmailChange.isPending}\n disabled={!newEmail.trim()}\n >\n <Translation\n defaultMessage=\"Send verification code\"\n id=\"1bX9l4\"\n description=\"Button text to send the email change verification code\"\n />\n </Button>\n </Flex>\n </Form.Root>\n </>\n );\n}\n\ninterface VerifyEmailChangeFormProps {\n newEmail: string;\n onBack: () => void;\n onSuccess: () => void;\n}\n\nfunction VerifyEmailChangeForm({\n newEmail,\n onBack,\n onSuccess,\n}: VerifyEmailChangeFormProps) {\n const client = useQueryClient();\n const { setElevatedAccess } = useElevatedAccessToken();\n const verifyEmailChange = useVerifyEmailChange({\n mutation: {\n onSuccess: async (response) => {\n setElevatedAccess({\n token: response.elevatedAccessToken,\n expiresAt: response.expiresAt,\n });\n client.setQueryData<Me>(getMeQueryKey(), (old) =>\n old ? { ...old, ...response.user } : response.user,\n );\n await client.invalidateQueries({ queryKey: getMeQueryKey() });\n },\n },\n });\n\n const isSubmitting = verifyEmailChange.isPending;\n\n const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n const formData = new FormData(event.currentTarget);\n const code = formData.get(\"otp-code\")?.toString() ?? \"\";\n if (!code) return;\n verifyEmailChange.mutate({ data: { code } });\n };\n\n return (\n <Form.Root onSubmit={handleSubmit}>\n <Dialog.Title mb=\"2\">\n <Translation\n defaultMessage=\"Enter verification code\"\n id=\"upvyOt\"\n description=\"Dialog title for entering the email change verification code\"\n />\n </Dialog.Title>\n\n <Dialog.Description>\n <Translation\n defaultMessage=\"A verification code was sent to {email}. Please enter it below.\"\n id=\"9OH/qs\"\n description=\"Description explaining where the email change code was sent\"\n values={{\n email: (\n <Text weight=\"bold\" highContrast>\n {newEmail}\n </Text>\n ),\n }}\n />\n </Dialog.Description>\n\n <Flex direction=\"column\" gap=\"2\" mt=\"5\" mx=\"auto\" width=\"fit-content\">\n <Otp.Root\n autoSubmit\n gap=\"2\"\n justify=\"center\"\n columns=\"repeat(6, 48px)\"\n width=\"fit-content\"\n rows=\"48px\"\n name=\"otp-code\"\n readOnly={isSubmitting}\n >\n <Otp.Input required autoFocus autoComplete=\"off\" />\n <Otp.Input required />\n <Otp.Input required />\n <Otp.Input required />\n <Otp.Input required />\n <Otp.Input required />\n </Otp.Root>\n\n {verifyEmailChange.error ? (\n <Text color=\"red\" size=\"2\" as=\"p\">\n {getMutationErrorMessage(verifyEmailChange.error)}\n </Text>\n ) : null}\n </Flex>\n\n <Flex mt=\"5\" gap=\"3\" justify=\"between\" align=\"center\">\n <Button\n variant=\"secondary\"\n type=\"button\"\n onClick={onBack}\n disabled={isSubmitting}\n >\n <Translation\n defaultMessage=\"Use a different email\"\n id=\"HVuco9\"\n description=\"Button text to go back and change the new email address\"\n />\n </Button>\n <Flex gap=\"3\">\n <Dialog.Close>\n <Button variant=\"secondary\" type=\"button\" disabled={isSubmitting}>\n <Translation\n defaultMessage=\"Cancel\"\n id=\"hHNj31\"\n description=\"Cancel button text\"\n />\n </Button>\n </Dialog.Close>\n <SaveButton\n type=\"submit\"\n loading={isSubmitting}\n done={verifyEmailChange.isSuccess}\n onDone={onSuccess}\n >\n <Translation\n defaultMessage=\"Confirm\"\n id=\"EmYENK\"\n description=\"Confirm button text for verification\"\n />\n </SaveButton>\n </Flex>\n </Flex>\n\n <VisuallyHidden asChild>\n <section aria-live=\"polite\">\n {verifyEmailChange.error\n ? getMutationErrorMessage(verifyEmailChange.error)\n : null}\n </section>\n </VisuallyHidden>\n </Form.Root>\n );\n}\n\ninterface SetPasswordStepProps {\n newEmail: string;\n onDone: () => void;\n}\n\nfunction SetPasswordStep({ newEmail, onDone }: SetPasswordStepProps) {\n return (\n <SetPasswordForm\n description={\n <Dialog.Description>\n <Translation\n defaultMessage=\"Your email has been successfully updated to {email}. You can also set a password now if you'd like to be able to sign in with email and password.\"\n id=\"U7k/vL\"\n description=\"Description for the set-password step after a successful email change\"\n values={{\n email: (\n <Text weight=\"bold\" highContrast>\n {newEmail}\n </Text>\n ),\n }}\n />\n </Dialog.Description>\n }\n onSuccess={onDone}\n cancel={\n <Button variant=\"secondary\" type=\"button\" onClick={onDone}>\n <Translation\n defaultMessage=\"Not now\"\n id=\"/7/PVX\"\n description=\"Button to dismiss the set-password step and close the dialog\"\n />\n </Button>\n }\n />\n );\n}\n\nfunction getMutationErrorMessage(error: unknown) {\n if (error instanceof Error) {\n return error.message;\n }\n\n if (\n typeof error === \"object\" &&\n error !== null &&\n \"message\" in error &&\n typeof error.message === \"string\"\n ) {\n return error.message;\n }\n\n return (\n <Translation\n defaultMessage=\"Something went wrong. Please try again.\"\n id=\"Dn/G2O\"\n description=\"Generic error message for email change failure\"\n />\n );\n}\n"],"mappings":";AAoCI,SA8EA,UA7EE,KADF;AAlCJ,SAAS,SAAS,MAAM,MAAM,sBAAsB;AACpD,SAAS,sBAAsB;AAC/B,SAAS,YAAY;AACrB,YAAY,WAAW;AAEvB;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,8BAA8B;AACvC,SAAS,QAAQ,QAAQ,OAAO,iBAAiB;AACjD,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAC/B,YAAY,SAAS;AACrB,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB;AAOzB,SAAS,kBAAkB,EAAE,UAAU,KAAK,GAA2B;AAC5E,QAAM,CAAC,MAAM,OAAO,IAAI,MAAM,SAAS,KAAK;AAE5C,QAAM,cAAc,MAAM,YAAY,MAAM;AAC1C,YAAQ,KAAK;AAAA,EACf,GAAG,CAAC,CAAC;AAEL,SACE,qBAAC,OAAO,MAAP,EAAY,MAAY,cAAc,SACrC;AAAA,wBAAC,OAAO,SAAP,EAAgB,UAAS;AAAA,IAE1B,oBAAC,OAAO,SAAP,EAAe,UAAS,SACvB,8BAAC,kBACC,8BAAC,WAAQ,MAAY,SAAS,aAAa,GAC7C,GACF;AAAA,KACF;AAEJ;AAYA,SAAS,QAAQ,EAAE,MAAM,QAAQ,GAAiB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AQ;AAAA,YACN,OACE,oBAAC,QAAK,QAAO,QAAO,cAAY,MAC7B,oBACH;AAAA,UAEJ;AAAA;AAAA,MACF,GACF;AAAA,MAEF,WAAW;AAAA,MACX,QACE,oBAAC,UAAO,SAAQ,aAAY,MAAK,UAAS,SAAS,QACjD;AAAA,QAAC;AAAA;AAAA,UACC,gBAAe;AAAA,UACf,IAAG;AAAA,UACH,aAAY;AAAA;AAAA,MACd,GACF;AAAA;AAAA,EAEJ;AAEJ;AAEA,SAAS,wBAAwB,OAAgB;AAC/C,MAAI,iBAAiB,OAAO;AAC1B,WAAO,MAAM;AAAA,EACf;AAEA,MACE,OAAO,UAAU,YACjB,UAAU,QACV,aAAa,SACb,OAAO,MAAM,YAAY,UACzB;AACA,WAAO,MAAM;AAAA,EACf;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,gBAAe;AAAA,MACf,IAAG;AAAA,MACH,aAAY;AAAA;AAAA,EACd;AAEJ;","names":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import { ReactNode } from 'react';
|
|
3
4
|
import { RootProps } from '@radix-ui/themes/components/dialog';
|
|
4
5
|
|
|
@@ -6,5 +7,11 @@ interface SetPasswordDialogProps extends RootProps {
|
|
|
6
7
|
children?: ReactNode;
|
|
7
8
|
}
|
|
8
9
|
declare function SetPasswordDialog({ children, ...props }: SetPasswordDialogProps): react_jsx_runtime.JSX.Element;
|
|
10
|
+
interface SetPasswordFormProps {
|
|
11
|
+
onSuccess?: () => void;
|
|
12
|
+
cancel?: React.ReactNode;
|
|
13
|
+
description?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
declare function SetPasswordForm({ onSuccess, cancel, description, }: SetPasswordFormProps): react_jsx_runtime.JSX.Element;
|
|
9
16
|
|
|
10
|
-
export { SetPasswordDialog };
|
|
17
|
+
export { SetPasswordDialog, SetPasswordForm };
|