@stackframe/stack 2.4.13 → 2.4.16
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 +25 -0
- package/dist/components/credential-sign-in.js +45 -65
- package/dist/components/credential-sign-in.js.map +1 -1
- package/dist/components/credential-sign-up.js +74 -98
- package/dist/components/credential-sign-up.js.map +1 -1
- package/dist/components/forgot-password.js +41 -38
- package/dist/components/forgot-password.js.map +1 -1
- package/dist/components/magic-link-sign-in.js +37 -41
- package/dist/components/magic-link-sign-in.js.map +1 -1
- package/dist/components/maybe-full-page.d.mts +9 -0
- package/dist/components/maybe-full-page.d.ts +9 -0
- package/dist/components/maybe-full-page.js +70 -0
- package/dist/components/maybe-full-page.js.map +1 -0
- package/dist/components/message-card.js +2 -2
- package/dist/components/message-card.js.map +1 -1
- package/dist/components/oauth-button.js +47 -53
- package/dist/components/oauth-button.js.map +1 -1
- package/dist/components/password-field.js +6 -8
- package/dist/components/password-field.js.map +1 -1
- package/dist/components/password-reset-inner.js +63 -58
- package/dist/components/password-reset-inner.js.map +1 -1
- package/dist/components/redirect-message-card.js +1 -2
- package/dist/components/redirect-message-card.js.map +1 -1
- package/dist/components/user-avatar.d.mts +1 -0
- package/dist/components/user-avatar.d.ts +1 -0
- package/dist/components/user-avatar.js +7 -5
- package/dist/components/user-avatar.js.map +1 -1
- package/dist/components/user-button.js +14 -18
- package/dist/components/user-button.js.map +1 -1
- package/dist/components-core/button.d.mts +1 -0
- package/dist/components-core/button.d.ts +1 -0
- package/dist/components-core/button.js +31 -14
- package/dist/components-core/button.js.map +1 -1
- package/dist/components-core/card.js +3 -3
- package/dist/components-core/card.js.map +1 -1
- package/dist/components-core/input.js +10 -6
- package/dist/components-core/input.js.map +1 -1
- package/dist/components-core/label.js +2 -3
- package/dist/components-core/label.js.map +1 -1
- package/dist/components-core/tabs.js +9 -5
- package/dist/components-core/tabs.js.map +1 -1
- package/dist/components-page/account-settings.js +8 -8
- package/dist/components-page/account-settings.js.map +1 -1
- package/dist/components-page/auth-page.js +5 -4
- package/dist/components-page/auth-page.js.map +1 -1
- package/dist/components-page/forgot-password.js +2 -2
- package/dist/components-page/forgot-password.js.map +1 -1
- package/dist/components-page/oauth-callback.d.mts +3 -1
- package/dist/components-page/oauth-callback.d.ts +3 -1
- package/dist/components-page/oauth-callback.js +2 -2
- package/dist/components-page/oauth-callback.js.map +1 -1
- package/dist/components-page/password-reset.js.map +1 -1
- package/dist/components-page/sign-in.js +0 -2
- package/dist/components-page/sign-in.js.map +1 -1
- package/dist/components-page/sign-out.d.mts +4 -2
- package/dist/components-page/sign-out.d.ts +4 -2
- package/dist/components-page/sign-out.js +3 -3
- package/dist/components-page/sign-out.js.map +1 -1
- package/dist/components-page/stack-handler.d.mts +3 -1
- package/dist/components-page/stack-handler.d.ts +3 -1
- package/dist/components-page/stack-handler.js +17 -11
- package/dist/components-page/stack-handler.js.map +1 -1
- package/dist/esm/components/credential-sign-in.js +45 -65
- package/dist/esm/components/credential-sign-in.js.map +1 -1
- package/dist/esm/components/credential-sign-up.js +74 -98
- package/dist/esm/components/credential-sign-up.js.map +1 -1
- package/dist/esm/components/forgot-password.js +41 -38
- package/dist/esm/components/forgot-password.js.map +1 -1
- package/dist/esm/components/magic-link-sign-in.js +37 -41
- package/dist/esm/components/magic-link-sign-in.js.map +1 -1
- package/dist/esm/components/maybe-full-page.js +50 -0
- package/dist/esm/components/maybe-full-page.js.map +1 -0
- package/dist/esm/components/message-card.js +2 -2
- package/dist/esm/components/message-card.js.map +1 -1
- package/dist/esm/components/oauth-button.js +47 -53
- package/dist/esm/components/oauth-button.js.map +1 -1
- package/dist/esm/components/password-field.js +6 -8
- package/dist/esm/components/password-field.js.map +1 -1
- package/dist/esm/components/password-reset-inner.js +63 -58
- package/dist/esm/components/password-reset-inner.js.map +1 -1
- package/dist/esm/components/redirect-message-card.js +1 -2
- package/dist/esm/components/redirect-message-card.js.map +1 -1
- package/dist/esm/components/user-avatar.js +7 -5
- package/dist/esm/components/user-avatar.js.map +1 -1
- package/dist/esm/components/user-button.js +26 -19
- package/dist/esm/components/user-button.js.map +1 -1
- package/dist/esm/components-core/button.js +33 -16
- package/dist/esm/components-core/button.js.map +1 -1
- package/dist/esm/components-core/card.js +3 -3
- package/dist/esm/components-core/card.js.map +1 -1
- package/dist/esm/components-core/input.js +11 -7
- package/dist/esm/components-core/input.js.map +1 -1
- package/dist/esm/components-core/label.js +2 -3
- package/dist/esm/components-core/label.js.map +1 -1
- package/dist/esm/components-core/tabs.js +10 -6
- package/dist/esm/components-core/tabs.js.map +1 -1
- package/dist/esm/components-page/account-settings.js +8 -8
- package/dist/esm/components-page/account-settings.js.map +1 -1
- package/dist/esm/components-page/auth-page.js +5 -4
- package/dist/esm/components-page/auth-page.js.map +1 -1
- package/dist/esm/components-page/forgot-password.js +2 -2
- package/dist/esm/components-page/forgot-password.js.map +1 -1
- package/dist/esm/components-page/oauth-callback.js +2 -2
- package/dist/esm/components-page/oauth-callback.js.map +1 -1
- package/dist/esm/components-page/password-reset.js.map +1 -1
- package/dist/esm/components-page/sign-in.js +0 -3
- package/dist/esm/components-page/sign-in.js.map +1 -1
- package/dist/esm/components-page/sign-out.js +3 -3
- package/dist/esm/components-page/sign-out.js.map +1 -1
- package/dist/esm/components-page/stack-handler.js +17 -11
- package/dist/esm/components-page/stack-handler.js.map +1 -1
- package/dist/esm/lib/stack-app.js +18 -1
- package/dist/esm/lib/stack-app.js.map +1 -1
- package/dist/esm/utils/constants.js +10 -10
- package/dist/esm/utils/constants.js.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/lib/hooks.d.mts +1 -0
- package/dist/lib/hooks.d.ts +1 -0
- package/dist/lib/stack-app.d.mts +6 -1
- package/dist/lib/stack-app.d.ts +6 -1
- package/dist/lib/stack-app.js +18 -1
- package/dist/lib/stack-app.js.map +1 -1
- package/dist/providers/stack-provider-client.d.mts +1 -0
- package/dist/providers/stack-provider-client.d.ts +1 -0
- package/dist/providers/stack-provider.d.mts +1 -0
- package/dist/providers/stack-provider.d.ts +1 -0
- package/dist/utils/constants.d.mts +26 -26
- package/dist/utils/constants.d.ts +26 -26
- package/dist/utils/constants.js +12 -12
- package/dist/utils/constants.js.map +1 -1
- package/package.json +10 -6
- package/dist/components/card-frame.d.mts +0 -9
- package/dist/components/card-frame.d.ts +0 -9
- package/dist/components/card-frame.js +0 -60
- package/dist/components/card-frame.js.map +0 -1
- package/dist/components-core/loading-indicator.d.mts +0 -11
- package/dist/components-core/loading-indicator.d.ts +0 -11
- package/dist/components-core/loading-indicator.js +0 -62
- package/dist/components-core/loading-indicator.js.map +0 -1
- package/dist/esm/components/card-frame.js +0 -40
- package/dist/esm/components/card-frame.js.map +0 -1
- package/dist/esm/components-core/loading-indicator.js +0 -31
- package/dist/esm/components-core/loading-indicator.js.map +0 -1
|
@@ -2,112 +2,88 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
|
|
4
4
|
// src/components/credential-sign-up.tsx
|
|
5
|
-
import {
|
|
5
|
+
import { useForm } from "react-hook-form";
|
|
6
|
+
import { yupResolver } from "@hookform/resolvers/yup";
|
|
7
|
+
import * as yup from "yup";
|
|
6
8
|
import PasswordField from "./password-field";
|
|
7
9
|
import FormWarningText from "./form-warning";
|
|
8
|
-
import { validateEmail } from "../utils/email";
|
|
9
|
-
import { getPasswordError } from "@stackframe/stack-shared/dist/helpers/password";
|
|
10
10
|
import { useStackApp } from "..";
|
|
11
11
|
import { Label, Input, Button } from "../components-core";
|
|
12
|
-
import {
|
|
12
|
+
import { runAsynchronously } from "@stackframe/stack-shared/dist/utils/promises";
|
|
13
|
+
import { getPasswordError } from "@stackframe/stack-shared/dist/helpers/password";
|
|
13
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var schema = yup.object().shape({
|
|
16
|
+
email: yup.string().email("Please enter a valid email").required("Please enter your email"),
|
|
17
|
+
password: yup.string().required("Please enter your password").test({
|
|
18
|
+
name: "is-valid-password",
|
|
19
|
+
test: (value, ctx) => {
|
|
20
|
+
const error = getPasswordError(value);
|
|
21
|
+
if (error) {
|
|
22
|
+
return ctx.createError({ message: error.message });
|
|
23
|
+
} else {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}),
|
|
28
|
+
passwordRepeat: yup.string().nullable().oneOf([yup.ref("password"), null], "Passwords do not match").required("Please repeat your password")
|
|
29
|
+
});
|
|
14
30
|
function CredentialSignUp() {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const [passwordError, setPasswordError] = useState("");
|
|
19
|
-
const [passwordRepeat, setPasswordRepeat] = useState("");
|
|
20
|
-
const [passwordRepeatError, setPasswordRepeatError] = useState("");
|
|
31
|
+
const { register, handleSubmit, setError, formState: { errors }, clearErrors } = useForm({
|
|
32
|
+
resolver: yupResolver(schema)
|
|
33
|
+
});
|
|
21
34
|
const app = useStackApp();
|
|
22
|
-
const onSubmit = async () => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
if (!validateEmail(email)) {
|
|
28
|
-
setEmailError("Please enter a valid email");
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (!password) {
|
|
32
|
-
setPasswordError("Please enter your password");
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (!passwordRepeat) {
|
|
36
|
-
setPasswordRepeatError("Please repeat your password");
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
if (password !== passwordRepeat) {
|
|
40
|
-
setPasswordRepeatError("Passwords do not match");
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const passwordError2 = getPasswordError(password);
|
|
44
|
-
if (passwordError2) {
|
|
45
|
-
setPasswordError(passwordError2.message);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
let error;
|
|
49
|
-
error = await app.signUpWithCredential({ email, password });
|
|
50
|
-
if (error instanceof KnownErrors.UserEmailAlreadyExists) {
|
|
51
|
-
setEmailError("User already exists");
|
|
52
|
-
} else if (error) {
|
|
53
|
-
setEmailError(`An error occurred. ${error.message}`);
|
|
54
|
-
}
|
|
35
|
+
const onSubmit = async (data) => {
|
|
36
|
+
const { email, password } = data;
|
|
37
|
+
const error = await app.signUpWithCredential({ email, password });
|
|
38
|
+
setError("email", { type: "manual", message: error?.message });
|
|
55
39
|
};
|
|
56
|
-
return /* @__PURE__ */ jsxs(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
Button,
|
|
104
|
-
{
|
|
105
|
-
style: { marginTop: "1.5rem" },
|
|
106
|
-
onClick: onSubmit,
|
|
107
|
-
children: "Sign Up"
|
|
108
|
-
}
|
|
109
|
-
)
|
|
110
|
-
] });
|
|
40
|
+
return /* @__PURE__ */ jsxs(
|
|
41
|
+
"form",
|
|
42
|
+
{
|
|
43
|
+
style: { display: "flex", flexDirection: "column", alignItems: "stretch" },
|
|
44
|
+
onSubmit: (e) => runAsynchronously(handleSubmit(onSubmit)(e)),
|
|
45
|
+
noValidate: true,
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "email", children: "Email" }),
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
Input,
|
|
50
|
+
{
|
|
51
|
+
id: "email",
|
|
52
|
+
type: "email",
|
|
53
|
+
...register("email")
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ jsx(FormWarningText, { text: errors.email?.message?.toString() }),
|
|
57
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "password", style: { marginTop: "1rem" }, children: "Password" }),
|
|
58
|
+
/* @__PURE__ */ jsx(
|
|
59
|
+
PasswordField,
|
|
60
|
+
{
|
|
61
|
+
id: "password",
|
|
62
|
+
...register("password"),
|
|
63
|
+
onChange: (e) => {
|
|
64
|
+
clearErrors("password");
|
|
65
|
+
clearErrors("passwordRepeat");
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ jsx(FormWarningText, { text: errors.password?.message?.toString() }),
|
|
70
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "repeat-password", style: { marginTop: "1rem" }, children: "Repeat Password" }),
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
PasswordField,
|
|
73
|
+
{
|
|
74
|
+
id: "repeat-password",
|
|
75
|
+
...register("passwordRepeat"),
|
|
76
|
+
onChange: (e) => {
|
|
77
|
+
clearErrors("password");
|
|
78
|
+
clearErrors("passwordRepeat");
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ jsx(FormWarningText, { text: errors.passwordRepeat?.message?.toString() }),
|
|
83
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", style: { marginTop: "1.5rem" }, children: "Sign Up" })
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
);
|
|
111
87
|
}
|
|
112
88
|
export {
|
|
113
89
|
CredentialSignUp as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/credential-sign-up.tsx"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/components/credential-sign-up.tsx"],"sourcesContent":["'use client';\n\nimport { useForm } from \"react-hook-form\";\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as yup from \"yup\";\nimport PasswordField from \"./password-field\";\nimport FormWarningText from \"./form-warning\";\nimport { useStackApp } from \"..\";\nimport { Label, Input, Button } from \"../components-core\";\nimport { runAsynchronously } from \"@stackframe/stack-shared/dist/utils/promises\";\nimport { getPasswordError } from \"@stackframe/stack-shared/dist/helpers/password\";\n\nconst schema = yup.object().shape({\n email: yup.string().email('Please enter a valid email').required('Please enter your email'),\n password: yup.string().required('Please enter your password').test({\n name: 'is-valid-password',\n test: (value, ctx) => {\n const error = getPasswordError(value);\n if (error) {\n return ctx.createError({ message: error.message });\n } else {\n return true;\n }\n }\n }),\n passwordRepeat: yup.string().nullable().oneOf([yup.ref('password'), null], 'Passwords do not match').required('Please repeat your password')\n});\n\nexport default function CredentialSignUp() {\n const { register, handleSubmit, setError, formState: { errors }, clearErrors } = useForm({\n resolver: yupResolver(schema)\n });\n const app = useStackApp();\n\n const onSubmit = async (data: yup.InferType<typeof schema>) => {\n const { email, password } = data;\n const error = await app.signUpWithCredential({ email, password });\n setError('email', { type: 'manual', message: error?.message });\n };\n\n return (\n <form \n style={{ display: 'flex', flexDirection: 'column', alignItems: 'stretch' }} \n onSubmit={e => runAsynchronously(handleSubmit(onSubmit)(e))}\n noValidate\n >\n <Label htmlFor=\"email\">Email</Label>\n <Input\n id=\"email\"\n type=\"email\"\n {...register('email')}\n />\n <FormWarningText text={errors.email?.message?.toString()} />\n\n <Label htmlFor=\"password\" style={{ marginTop: '1rem' }}>Password</Label>\n <PasswordField\n id=\"password\"\n {...register('password')}\n onChange={(e) => {\n clearErrors('password');\n clearErrors('passwordRepeat');\n }}\n />\n <FormWarningText text={errors.password?.message?.toString()} />\n \n <Label htmlFor=\"repeat-password\" style={{ marginTop: '1rem' }}>Repeat Password</Label>\n <PasswordField\n id=\"repeat-password\"\n {...register('passwordRepeat')}\n onChange={(e) => {\n clearErrors('password');\n clearErrors('passwordRepeat');\n }}\n />\n <FormWarningText text={errors.passwordRepeat?.message?.toString()} />\n\n <Button type=\"submit\" style={{ marginTop: '1.5rem' }}>\n Sign Up\n </Button>\n </form>\n );\n}\n"],"mappings":";;;AAEA,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,YAAY,SAAS;AACrB,OAAO,mBAAmB;AAC1B,OAAO,qBAAqB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,OAAO,OAAO,cAAc;AACrC,SAAS,yBAAyB;AAClC,SAAS,wBAAwB;AA+B7B,SAKE,KALF;AA7BJ,IAAM,SAAa,WAAO,EAAE,MAAM;AAAA,EAChC,OAAW,WAAO,EAAE,MAAM,4BAA4B,EAAE,SAAS,yBAAyB;AAAA,EAC1F,UAAc,WAAO,EAAE,SAAS,4BAA4B,EAAE,KAAK;AAAA,IACjE,MAAM;AAAA,IACN,MAAM,CAAC,OAAO,QAAQ;AACpB,YAAM,QAAQ,iBAAiB,KAAK;AACpC,UAAI,OAAO;AACT,eAAO,IAAI,YAAY,EAAE,SAAS,MAAM,QAAQ,CAAC;AAAA,MACnD,OAAO;AACL,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF,CAAC;AAAA,EACD,gBAAoB,WAAO,EAAE,SAAS,EAAE,MAAM,CAAK,QAAI,UAAU,GAAG,IAAI,GAAG,wBAAwB,EAAE,SAAS,6BAA6B;AAC7I,CAAC;AAEc,SAAR,mBAAoC;AACzC,QAAM,EAAE,UAAU,cAAc,UAAU,WAAW,EAAE,OAAO,GAAG,YAAY,IAAI,QAAQ;AAAA,IACvF,UAAU,YAAY,MAAM;AAAA,EAC9B,CAAC;AACD,QAAM,MAAM,YAAY;AAExB,QAAM,WAAW,OAAO,SAAuC;AAC7D,UAAM,EAAE,OAAO,SAAS,IAAI;AAC5B,UAAM,QAAQ,MAAM,IAAI,qBAAqB,EAAE,OAAO,SAAS,CAAC;AAChE,aAAS,SAAS,EAAE,MAAM,UAAU,SAAS,OAAO,QAAQ,CAAC;AAAA,EAC/D;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,EAAE,SAAS,QAAQ,eAAe,UAAU,YAAY,UAAU;AAAA,MACzE,UAAU,OAAK,kBAAkB,aAAa,QAAQ,EAAE,CAAC,CAAC;AAAA,MAC1D,YAAU;AAAA,MAEV;AAAA,4BAAC,SAAM,SAAQ,SAAQ,mBAAK;AAAA,QAC5B;AAAA,UAAC;AAAA;AAAA,YACC,IAAG;AAAA,YACH,MAAK;AAAA,YACJ,GAAG,SAAS,OAAO;AAAA;AAAA,QACtB;AAAA,QACA,oBAAC,mBAAgB,MAAM,OAAO,OAAO,SAAS,SAAS,GAAG;AAAA,QAE1D,oBAAC,SAAM,SAAQ,YAAW,OAAO,EAAE,WAAW,OAAO,GAAG,sBAAQ;AAAA,QAChE;AAAA,UAAC;AAAA;AAAA,YACC,IAAG;AAAA,YACF,GAAG,SAAS,UAAU;AAAA,YACvB,UAAU,CAAC,MAAM;AACf,0BAAY,UAAU;AACtB,0BAAY,gBAAgB;AAAA,YAC9B;AAAA;AAAA,QACF;AAAA,QACA,oBAAC,mBAAgB,MAAM,OAAO,UAAU,SAAS,SAAS,GAAG;AAAA,QAE7D,oBAAC,SAAM,SAAQ,mBAAkB,OAAO,EAAE,WAAW,OAAO,GAAG,6BAAe;AAAA,QAC9E;AAAA,UAAC;AAAA;AAAA,YACC,IAAG;AAAA,YACF,GAAG,SAAS,gBAAgB;AAAA,YAC7B,UAAU,CAAC,MAAM;AACf,0BAAY,UAAU;AACtB,0BAAY,gBAAgB;AAAA,YAC9B;AAAA;AAAA,QACF;AAAA,QACA,oBAAC,mBAAgB,MAAM,OAAO,gBAAgB,SAAS,SAAS,GAAG;AAAA,QAEnE,oBAAC,UAAO,MAAK,UAAS,OAAO,EAAE,WAAW,SAAS,GAAG,qBAEtD;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -2,53 +2,56 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
|
|
4
4
|
// src/components/forgot-password.tsx
|
|
5
|
-
import {
|
|
5
|
+
import { useForm } from "react-hook-form";
|
|
6
|
+
import { yupResolver } from "@hookform/resolvers/yup";
|
|
7
|
+
import * as yup from "yup";
|
|
6
8
|
import FormWarningText from "./form-warning";
|
|
7
|
-
import { validateEmail } from "../utils/email";
|
|
8
9
|
import { useStackApp } from "..";
|
|
9
10
|
import { Button, Input, Label } from "../components-core";
|
|
11
|
+
import { runAsynchronously } from "@stackframe/stack-shared/dist/utils/promises";
|
|
10
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
var schema = yup.object().shape({
|
|
14
|
+
email: yup.string().email("Please enter a valid email").required("Please enter your email")
|
|
15
|
+
});
|
|
11
16
|
function ForgotPassword({ onSent }) {
|
|
12
|
-
const
|
|
13
|
-
|
|
17
|
+
const { register, handleSubmit, formState: { errors }, clearErrors } = useForm({
|
|
18
|
+
resolver: yupResolver(schema)
|
|
19
|
+
});
|
|
14
20
|
const stackApp = useStackApp();
|
|
15
|
-
const onSubmit = async () => {
|
|
16
|
-
|
|
17
|
-
setEmailError("Please enter your email");
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
if (!validateEmail(email)) {
|
|
21
|
-
setEmailError("Please enter a valid email");
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
21
|
+
const onSubmit = async (data) => {
|
|
22
|
+
const { email } = data;
|
|
24
23
|
await stackApp.sendForgotPasswordEmail(email);
|
|
25
24
|
onSent?.();
|
|
26
25
|
};
|
|
27
|
-
return /* @__PURE__ */ jsxs(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
26
|
+
return /* @__PURE__ */ jsxs(
|
|
27
|
+
"form",
|
|
28
|
+
{
|
|
29
|
+
style: { display: "flex", flexDirection: "column", alignItems: "stretch" },
|
|
30
|
+
onSubmit: (e) => runAsynchronously(handleSubmit(onSubmit)(e)),
|
|
31
|
+
noValidate: true,
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "email", children: "Your Email" }),
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
Input,
|
|
36
|
+
{
|
|
37
|
+
id: "email",
|
|
38
|
+
type: "email",
|
|
39
|
+
...register("email"),
|
|
40
|
+
onChange: () => clearErrors("email")
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsx(FormWarningText, { text: errors.email?.message?.toString() }),
|
|
44
|
+
/* @__PURE__ */ jsx(
|
|
45
|
+
Button,
|
|
46
|
+
{
|
|
47
|
+
type: "submit",
|
|
48
|
+
style: { marginTop: "1.5rem" },
|
|
49
|
+
children: "Send Email"
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
);
|
|
52
55
|
}
|
|
53
56
|
export {
|
|
54
57
|
ForgotPassword as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/forgot-password.tsx"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/components/forgot-password.tsx"],"sourcesContent":["'use client';\n\nimport { useForm } from \"react-hook-form\";\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as yup from \"yup\";\nimport FormWarningText from \"./form-warning\";\nimport { useStackApp } from \"..\";\nimport { Button, Input, Label } from \"../components-core\";\nimport { runAsynchronously } from \"@stackframe/stack-shared/dist/utils/promises\";\n\nconst schema = yup.object().shape({\n email: yup.string().email('Please enter a valid email').required('Please enter your email')\n});\n\nexport default function ForgotPassword({ onSent }: { onSent?: () => void }) {\n const { register, handleSubmit, formState: { errors }, clearErrors } = useForm({\n resolver: yupResolver(schema)\n });\n const stackApp = useStackApp();\n\n const onSubmit = async (data: yup.InferType<typeof schema>) => {\n const { email } = data;\n await stackApp.sendForgotPasswordEmail(email);\n onSent?.();\n };\n\n return (\n <form\n style={{ display: 'flex', flexDirection: 'column', alignItems: 'stretch' }} \n onSubmit={e => runAsynchronously(handleSubmit(onSubmit)(e))}\n noValidate\n >\n <Label htmlFor=\"email\">Your Email</Label>\n <Input\n id=\"email\"\n type=\"email\"\n {...register('email')}\n onChange={() => clearErrors('email')}\n />\n <FormWarningText text={errors.email?.message?.toString()} />\n\n <Button\n type=\"submit\"\n style={{ marginTop: '1.5rem' }}\n >\n Send Email\n </Button>\n </form>\n );\n}\n"],"mappings":";;;AAEA,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,YAAY,SAAS;AACrB,OAAO,qBAAqB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,QAAQ,OAAO,aAAa;AACrC,SAAS,yBAAyB;AAmB9B,SAKE,KALF;AAjBJ,IAAM,SAAa,WAAO,EAAE,MAAM;AAAA,EAChC,OAAW,WAAO,EAAE,MAAM,4BAA4B,EAAE,SAAS,yBAAyB;AAC5F,CAAC;AAEc,SAAR,eAAgC,EAAE,OAAO,GAA4B;AAC1E,QAAM,EAAE,UAAU,cAAc,WAAW,EAAE,OAAO,GAAG,YAAY,IAAI,QAAQ;AAAA,IAC7E,UAAU,YAAY,MAAM;AAAA,EAC9B,CAAC;AACD,QAAM,WAAW,YAAY;AAE7B,QAAM,WAAW,OAAO,SAAuC;AAC7D,UAAM,EAAE,MAAM,IAAI;AAClB,UAAM,SAAS,wBAAwB,KAAK;AAC5C,aAAS;AAAA,EACX;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,EAAE,SAAS,QAAQ,eAAe,UAAU,YAAY,UAAU;AAAA,MACzE,UAAU,OAAK,kBAAkB,aAAa,QAAQ,EAAE,CAAC,CAAC;AAAA,MAC1D,YAAU;AAAA,MAEV;AAAA,4BAAC,SAAM,SAAQ,SAAQ,wBAAU;AAAA,QACjC;AAAA,UAAC;AAAA;AAAA,YACC,IAAG;AAAA,YACH,MAAK;AAAA,YACJ,GAAG,SAAS,OAAO;AAAA,YACpB,UAAU,MAAM,YAAY,OAAO;AAAA;AAAA,QACrC;AAAA,QACA,oBAAC,mBAAgB,MAAM,OAAO,OAAO,SAAS,SAAS,GAAG;AAAA,QAE1D;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,OAAO,EAAE,WAAW,SAAS;AAAA,YAC9B;AAAA;AAAA,QAED;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -3,58 +3,54 @@
|
|
|
3
3
|
|
|
4
4
|
// src/components/magic-link-sign-in.tsx
|
|
5
5
|
import { useState } from "react";
|
|
6
|
+
import { useForm } from "react-hook-form";
|
|
7
|
+
import { yupResolver } from "@hookform/resolvers/yup";
|
|
8
|
+
import * as yup from "yup";
|
|
6
9
|
import FormWarningText from "./form-warning";
|
|
7
|
-
import { validateEmail } from "../utils/email";
|
|
8
10
|
import { useStackApp } from "..";
|
|
9
11
|
import { Button, Input, Label } from "../components-core";
|
|
12
|
+
import { runAsynchronously } from "@stackframe/stack-shared/dist/utils/promises";
|
|
10
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
var schema = yup.object().shape({
|
|
15
|
+
email: yup.string().email("Please enter a valid email").required("Please enter your email")
|
|
16
|
+
});
|
|
11
17
|
function MagicLinkSignIn() {
|
|
12
|
-
const
|
|
18
|
+
const { register, handleSubmit, setError, formState: { errors }, clearErrors } = useForm({
|
|
19
|
+
resolver: yupResolver(schema)
|
|
20
|
+
});
|
|
13
21
|
const [sent, setSent] = useState(false);
|
|
14
|
-
const [error, setError] = useState("");
|
|
15
22
|
const app = useStackApp();
|
|
16
|
-
const onSubmit = async () => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (!validateEmail(email)) {
|
|
22
|
-
setError("Please enter a valid email");
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
const error2 = await app.sendMagicLinkEmail(email);
|
|
26
|
-
if (error2) {
|
|
27
|
-
setError(error2.message);
|
|
23
|
+
const onSubmit = async (data) => {
|
|
24
|
+
const { email } = data;
|
|
25
|
+
const error = await app.sendMagicLinkEmail(email);
|
|
26
|
+
if (error) {
|
|
27
|
+
setError("email", { type: "manual", message: error.message });
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
setSent(true);
|
|
31
31
|
};
|
|
32
|
-
return /* @__PURE__ */ jsxs(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
children: sent ? "Email sent" : "Send magic link"
|
|
55
|
-
}
|
|
56
|
-
)
|
|
57
|
-
] });
|
|
32
|
+
return /* @__PURE__ */ jsxs(
|
|
33
|
+
"form",
|
|
34
|
+
{
|
|
35
|
+
style: { display: "flex", flexDirection: "column", alignItems: "stretch" },
|
|
36
|
+
onSubmit: (e) => runAsynchronously(handleSubmit(onSubmit)(e)),
|
|
37
|
+
noValidate: true,
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "email", children: "Email" }),
|
|
40
|
+
/* @__PURE__ */ jsx(
|
|
41
|
+
Input,
|
|
42
|
+
{
|
|
43
|
+
id: "email",
|
|
44
|
+
type: "email",
|
|
45
|
+
...register("email"),
|
|
46
|
+
disabled: sent
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
/* @__PURE__ */ jsx(FormWarningText, { text: errors.email?.message?.toString() }),
|
|
50
|
+
/* @__PURE__ */ jsx(Button, { disabled: sent, style: { marginTop: "1.5rem" }, type: "submit", children: sent ? "Email sent" : "Send magic link" })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
);
|
|
58
54
|
}
|
|
59
55
|
export {
|
|
60
56
|
MagicLinkSignIn as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/magic-link-sign-in.tsx"],"sourcesContent":["'use client'
|
|
1
|
+
{"version":3,"sources":["../../../src/components/magic-link-sign-in.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as yup from \"yup\";\nimport FormWarningText from \"./form-warning\";\nimport { useStackApp } from \"..\";\nimport { Button, Input, Label } from \"../components-core\";\nimport { runAsynchronously } from \"@stackframe/stack-shared/dist/utils/promises\";\n\nconst schema = yup.object().shape({\n email: yup.string().email('Please enter a valid email').required('Please enter your email')\n});\n\nexport default function MagicLinkSignIn() {\n const { register, handleSubmit, setError, formState: { errors }, clearErrors } = useForm({\n resolver: yupResolver(schema)\n });\n const [sent, setSent] = useState(false);\n const app = useStackApp();\n\n const onSubmit = async (data: yup.InferType<typeof schema>) => {\n const { email } = data;\n\n const error = await app.sendMagicLinkEmail(email);\n if (error) {\n setError('email', { type: 'manual', message: error.message });\n return;\n }\n setSent(true);\n };\n\n return (\n <form \n style={{ display: 'flex', flexDirection: 'column', alignItems: 'stretch' }} \n onSubmit={e => runAsynchronously(handleSubmit(onSubmit)(e))}\n noValidate\n >\n <Label htmlFor=\"email\">Email</Label>\n <Input\n id=\"email\"\n type=\"email\"\n {...register('email')}\n disabled={sent}\n />\n <FormWarningText text={errors.email?.message?.toString()} />\n\n <Button disabled={sent} style={{ marginTop: '1.5rem' }} type=\"submit\">\n {sent ? 'Email sent' : 'Send magic link'}\n </Button>\n </form>\n );\n}\n"],"mappings":";;;AAEA,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,YAAY,SAAS;AACrB,OAAO,qBAAqB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,QAAQ,OAAO,aAAa;AACrC,SAAS,yBAAyB;AAyB9B,SAKE,KALF;AAvBJ,IAAM,SAAa,WAAO,EAAE,MAAM;AAAA,EAChC,OAAW,WAAO,EAAE,MAAM,4BAA4B,EAAE,SAAS,yBAAyB;AAC5F,CAAC;AAEc,SAAR,kBAAmC;AACxC,QAAM,EAAE,UAAU,cAAc,UAAU,WAAW,EAAE,OAAO,GAAG,YAAY,IAAI,QAAQ;AAAA,IACvF,UAAU,YAAY,MAAM;AAAA,EAC9B,CAAC;AACD,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,QAAM,MAAM,YAAY;AAExB,QAAM,WAAW,OAAO,SAAuC;AAC7D,UAAM,EAAE,MAAM,IAAI;AAElB,UAAM,QAAQ,MAAM,IAAI,mBAAmB,KAAK;AAChD,QAAI,OAAO;AACT,eAAS,SAAS,EAAE,MAAM,UAAU,SAAS,MAAM,QAAQ,CAAC;AAC5D;AAAA,IACF;AACA,YAAQ,IAAI;AAAA,EACd;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,EAAE,SAAS,QAAQ,eAAe,UAAU,YAAY,UAAU;AAAA,MACzE,UAAU,OAAK,kBAAkB,aAAa,QAAQ,EAAE,CAAC,CAAC;AAAA,MAC1D,YAAU;AAAA,MAEV;AAAA,4BAAC,SAAM,SAAQ,SAAQ,mBAAK;AAAA,QAC5B;AAAA,UAAC;AAAA;AAAA,YACC,IAAG;AAAA,YACH,MAAK;AAAA,YACJ,GAAG,SAAS,OAAO;AAAA,YACpB,UAAU;AAAA;AAAA,QACZ;AAAA,QACA,oBAAC,mBAAgB,MAAM,OAAO,OAAO,SAAS,SAAS,GAAG;AAAA,QAE1D,oBAAC,UAAO,UAAU,MAAM,OAAO,EAAE,WAAW,SAAS,GAAG,MAAK,UAC1D,iBAAO,eAAe,mBACzB;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
|
|
4
|
+
// src/components/maybe-full-page.tsx
|
|
5
|
+
import { Container } from "../components-core";
|
|
6
|
+
import { useEffect, useId } from "react";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
function MaybeFullPage({
|
|
9
|
+
children,
|
|
10
|
+
fullPage = true
|
|
11
|
+
}) {
|
|
12
|
+
const uniqueId = useId();
|
|
13
|
+
const id = `stack-card-frame-${uniqueId}`;
|
|
14
|
+
const scriptString = `(([id]) => {
|
|
15
|
+
const el = document.getElementById(id);
|
|
16
|
+
const offset = el.getBoundingClientRect().top + document.documentElement.scrollTop;
|
|
17
|
+
el.style.minHeight = \`calc(100vh - \${offset}px)\`;
|
|
18
|
+
})(${JSON.stringify([id])})`;
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
eval(scriptString);
|
|
21
|
+
}, []);
|
|
22
|
+
if (fullPage) {
|
|
23
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
|
+
/* @__PURE__ */ jsx(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
id,
|
|
28
|
+
suppressHydrationWarning: true,
|
|
29
|
+
style: {
|
|
30
|
+
minHeight: "100vh",
|
|
31
|
+
alignSelf: "stretch",
|
|
32
|
+
display: "flex",
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
justifyContent: "center"
|
|
35
|
+
},
|
|
36
|
+
children: /* @__PURE__ */ jsx(Container, { size: 380, style: { padding: "1rem 1rem" }, children })
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ jsx("script", { dangerouslySetInnerHTML: {
|
|
40
|
+
__html: scriptString
|
|
41
|
+
} })
|
|
42
|
+
] });
|
|
43
|
+
} else {
|
|
44
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
MaybeFullPage as default
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=maybe-full-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/maybe-full-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { Container } from \"../components-core\";\nimport React, { useEffect, useId } from \"react\";\n\nexport default function MaybeFullPage({ \n children, \n fullPage=true\n}: { \n children: React.ReactNode, \n fullPage?: boolean, \n}) {\n const uniqueId = useId();\n const id = `stack-card-frame-${uniqueId}`;\n\n const scriptString = `(([id]) => {\n const el = document.getElementById(id);\n const offset = el.getBoundingClientRect().top + document.documentElement.scrollTop;\n el.style.minHeight = \\`calc(100vh - \\${offset}px)\\`;\n })(${JSON.stringify([id])})`;\n\n useEffect(() => {\n // TODO fix workaround: React has a bug where it doesn't run the script on the first CSR render if SSR has been skipped due to suspense\n // As a workaround, we run the script in the <script> tag again after the first render\n eval(scriptString);\n }, []);\n\n if (fullPage) {\n return (\n <>\n <div \n id={id}\n suppressHydrationWarning\n style={{ \n minHeight: '100vh',\n alignSelf: 'stretch',\n display: 'flex', \n alignItems: 'center', \n justifyContent: 'center',\n }}\n >\n <Container size={380} style={{ padding: '1rem 1rem' }}>\n {children}\n </Container>\n </div>\n <script dangerouslySetInnerHTML={{\n __html: scriptString,\n }} />\n </>\n );\n } else {\n return <>\n {children}\n </>;\n }\n \n}\n"],"mappings":";;;AAEA,SAAS,iBAAiB;AAC1B,SAAgB,WAAW,aAAa;AA0BlC,mBAYI,KAZJ;AAxBS,SAAR,cAA+B;AAAA,EACpC;AAAA,EACA,WAAS;AACX,GAGG;AACD,QAAM,WAAW,MAAM;AACvB,QAAM,KAAK,oBAAoB,QAAQ;AAEvC,QAAM,eAAe;AAAA;AAAA;AAAA;AAAA,OAIhB,KAAK,UAAU,CAAC,EAAE,CAAC,CAAC;AAEzB,YAAU,MAAM;AAGd,SAAK,YAAY;AAAA,EACnB,GAAG,CAAC,CAAC;AAEL,MAAI,UAAU;AACZ,WACE,iCACE;AAAA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,0BAAwB;AAAA,UACxB,OAAO;AAAA,YACL,WAAW;AAAA,YACX,WAAW;AAAA,YACX,SAAS;AAAA,YACT,YAAY;AAAA,YACZ,gBAAgB;AAAA,UAClB;AAAA,UAEA,8BAAC,aAAU,MAAM,KAAK,OAAO,EAAE,SAAS,YAAY,GACjD,UACH;AAAA;AAAA,MACF;AAAA,MACA,oBAAC,YAAO,yBAAyB;AAAA,QAC/B,QAAQ;AAAA,MACV,GAAG;AAAA,OACL;AAAA,EAEJ,OAAO;AACL,WAAO,gCACJ,UACH;AAAA,EACF;AAEF;","names":[]}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
|
|
4
4
|
// src/components/message-card.tsx
|
|
5
|
-
import
|
|
5
|
+
import MaybeFullPage from "./maybe-full-page";
|
|
6
6
|
import { Text } from "../components-core";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
function MessageCard({ children, title, fullPage = false }) {
|
|
9
|
-
return /* @__PURE__ */ jsx(
|
|
9
|
+
return /* @__PURE__ */ jsx(MaybeFullPage, { fullPage, children: /* @__PURE__ */ jsxs("div", { style: { textAlign: "center" }, children: [
|
|
10
10
|
/* @__PURE__ */ jsx(Text, { size: "xl", as: "h2", style: { marginBottom: "24px" }, children: title }),
|
|
11
11
|
children
|
|
12
12
|
] }) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/message-card.tsx"],"sourcesContent":["'use client';\n\nimport React from \"react\";\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/components/message-card.tsx"],"sourcesContent":["'use client';\n\nimport React from \"react\";\nimport MaybeFullPage from \"./maybe-full-page\";\nimport { Text } from \"../components-core\";\n\nexport default function MessageCard(\n { children, title, fullPage=false }: \n { children?: React.ReactNode, title: string, fullPage?: boolean}\n) {\n return (\n <MaybeFullPage fullPage={fullPage}>\n <div style={{ textAlign: 'center' }}>\n <Text size=\"xl\" as='h2' style={{ marginBottom: '24px' }}>{title}</Text>\n {children}\n </div>\n </MaybeFullPage>\n );\n}\n"],"mappings":";;;AAGA,OAAO,mBAAmB;AAC1B,SAAS,YAAY;AAQf,SACE,KADF;AANS,SAAR,YACL,EAAE,UAAU,OAAO,WAAS,MAAM,GAElC;AACA,SACE,oBAAC,iBAAc,UACb,+BAAC,SAAI,OAAO,EAAE,WAAW,SAAS,GAChC;AAAA,wBAAC,QAAK,MAAK,MAAK,IAAG,MAAK,OAAO,EAAE,cAAc,OAAO,GAAI,iBAAM;AAAA,IAC/D;AAAA,KACH,GACF;AAEJ;","names":[]}
|