@insforge/react 0.3.5 → 0.4.5
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/README.md +476 -604
- package/dist/atoms.cjs +837 -0
- package/dist/atoms.cjs.map +1 -0
- package/dist/atoms.d.cts +253 -0
- package/dist/atoms.d.ts +111 -245
- package/dist/atoms.js +412 -468
- package/dist/atoms.js.map +1 -1
- package/dist/components.cjs +2000 -0
- package/dist/components.cjs.map +1 -0
- package/dist/components.d.cts +258 -0
- package/dist/components.d.ts +71 -123
- package/dist/components.js +1040 -1428
- package/dist/components.js.map +1 -1
- package/dist/forms.cjs +1194 -0
- package/dist/forms.cjs.map +1 -0
- package/dist/forms.d.cts +135 -0
- package/dist/forms.d.ts +113 -163
- package/dist/forms.js +657 -943
- package/dist/forms.js.map +1 -1
- package/dist/{hooks.mjs → hooks.cjs} +15 -13
- package/dist/hooks.cjs.map +1 -0
- package/dist/{hooks.d.mts → hooks.d.cts} +1 -1
- package/dist/hooks.js +9 -15
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +2461 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{index.d.mts → index.d.cts} +37 -22
- package/dist/index.d.ts +34 -19
- package/dist/index.js +1142 -1497
- package/dist/index.js.map +1 -1
- package/dist/{lib.mjs → lib.cjs} +13 -11
- package/dist/lib.cjs.map +1 -0
- package/dist/{lib.d.mts → lib.d.cts} +1 -8
- package/dist/lib.d.ts +1 -8
- package/dist/lib.js +4 -17
- package/dist/lib.js.map +1 -1
- package/dist/{router.mjs → router.cjs} +14 -16
- package/dist/router.cjs.map +1 -0
- package/dist/{router.d.mts → router.d.cts} +0 -11
- package/dist/router.d.ts +0 -11
- package/dist/router.js +10 -16
- package/dist/router.js.map +1 -1
- package/dist/styles.css +864 -2
- package/dist/types.cjs +4 -0
- package/dist/{types.mjs.map → types.cjs.map} +1 -1
- package/dist/types.d.cts +32 -0
- package/dist/types.d.ts +11 -613
- package/dist/types.js +0 -1
- package/package.json +111 -98
- package/dist/atoms.d.mts +0 -387
- package/dist/atoms.mjs +0 -861
- package/dist/atoms.mjs.map +0 -1
- package/dist/components.d.mts +0 -310
- package/dist/components.mjs +0 -2327
- package/dist/components.mjs.map +0 -1
- package/dist/forms.d.mts +0 -185
- package/dist/forms.mjs +0 -1468
- package/dist/forms.mjs.map +0 -1
- package/dist/hooks.mjs.map +0 -1
- package/dist/index.mjs +0 -2724
- package/dist/index.mjs.map +0 -1
- package/dist/lib.mjs.map +0 -1
- package/dist/router.mjs.map +0 -1
- package/dist/types.d.mts +0 -634
- package/dist/types.mjs +0 -3
- package/src/styles.css +0 -15
package/dist/forms.js
CHANGED
|
@@ -1,236 +1,172 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var lucideReact = require('lucide-react');
|
|
7
|
-
var react = require('react');
|
|
8
|
-
var sdk = require('@insforge/sdk');
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { AlertTriangle, EyeOff, Eye, Loader2, CircleCheck, Check } from 'lucide-react';
|
|
3
|
+
import { createContext, useState, useEffect, useCallback, useContext, useRef } from 'react';
|
|
4
|
+
import { useSearchParams } from 'react-router-dom';
|
|
5
|
+
import '@insforge/sdk';
|
|
9
6
|
|
|
10
7
|
function AuthBranding() {
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
8
|
+
return /* @__PURE__ */ jsxs("div", { className: "if-authBranding if-internal-ab4k9w", children: [
|
|
9
|
+
/* @__PURE__ */ jsx("p", { className: "if-authBranding-text", children: "Secured by" }),
|
|
10
|
+
/* @__PURE__ */ jsx("a", { href: "https://insforge.dev", target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsxs(
|
|
11
|
+
"svg",
|
|
12
|
+
{
|
|
13
|
+
width: "83",
|
|
14
|
+
height: "20",
|
|
15
|
+
viewBox: "0 0 83 20",
|
|
16
|
+
fill: "none",
|
|
17
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
"path",
|
|
21
|
+
{
|
|
22
|
+
d: "M2.16783 8.46797C1.9334 8.23325 1.9334 7.85269 2.16783 7.61797L8.11049 1.66797L16.6 1.66797L6.41259 11.868C6.17815 12.1027 5.79807 12.1027 5.56363 11.868L2.16783 8.46797Z",
|
|
23
|
+
fill: "url(#paint0_linear_2976_9475)"
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
"path",
|
|
28
|
+
{
|
|
29
|
+
d: "M12.8858 6.44922L16.6 10.168V18.668L8.64108 10.6992L12.8858 6.44922Z",
|
|
30
|
+
fill: "url(#paint1_linear_2976_9475)"
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ jsx(
|
|
34
|
+
"path",
|
|
35
|
+
{
|
|
36
|
+
d: "M67.5439 6.48828C68.2894 6.48828 68.9145 6.67064 69.418 7.03516C69.5229 7.10943 69.6214 7.1907 69.7158 7.27637V6.70703H71.248V14.959C71.248 15.1583 71.2381 15.3485 71.2188 15.5283C71.2042 15.7129 71.1774 15.8925 71.1387 16.0674C71.0225 16.5776 70.7998 16.9957 70.4707 17.3213C70.1415 17.6518 69.7321 17.8972 69.2432 18.0576C68.7592 18.2179 68.2222 18.2988 67.6318 18.2988C67.1962 18.2988 66.7768 18.2308 66.375 18.0947C65.9782 17.9587 65.6202 17.7614 65.3008 17.5039C64.9813 17.2512 64.7199 16.9446 64.5166 16.585L66.1289 15.7832C66.2789 16.0698 66.4888 16.2819 66.7598 16.418C67.0356 16.5589 67.3289 16.6289 67.6387 16.6289C68.0016 16.6289 68.3258 16.5628 68.6113 16.4316C68.8969 16.3053 69.1176 16.116 69.2725 15.8633C69.4321 15.6155 69.5077 15.3047 69.498 14.9307V14.1797C69.4665 14.2037 69.4359 14.229 69.4033 14.252C68.8855 14.6164 68.2441 14.7988 67.4795 14.7988C66.7582 14.7988 66.1281 14.6165 65.5908 14.252C65.0537 13.8875 64.637 13.3915 64.3418 12.7646C64.0467 12.1378 63.8994 11.4307 63.8994 10.6436C63.8994 9.84651 64.0465 9.13673 64.3418 8.51465C64.6419 7.88768 65.0663 7.39481 65.6133 7.03516C66.1601 6.67077 66.8036 6.48836 67.5439 6.48828ZM37.5 6.48828C38.1099 6.48828 38.6496 6.58294 39.1191 6.77246C39.5935 6.96201 39.9762 7.2321 40.2666 7.58203C40.5569 7.93184 40.7359 8.34227 40.8037 8.81348L39.0176 9.13477C38.974 8.79951 38.8218 8.53424 38.5605 8.33984C38.304 8.14547 37.96 8.03605 37.5293 8.01172C37.1178 7.98742 36.7859 8.05051 36.5342 8.20117C36.2825 8.34698 36.1562 8.55398 36.1562 8.82129C36.1563 8.97184 36.208 9.10017 36.3096 9.20703C36.4112 9.31394 36.614 9.42141 36.9189 9.52832C37.2288 9.63524 37.6889 9.76635 38.2988 9.92188C38.9232 10.0823 39.4222 10.2666 39.7949 10.4756C40.1722 10.6796 40.4428 10.9254 40.6074 11.2119C40.7768 11.4987 40.8623 11.8466 40.8623 12.2549C40.8623 13.047 40.574 13.6691 39.998 14.1211C39.4268 14.5731 38.6348 14.7988 37.623 14.7988C36.6551 14.7988 35.8687 14.5799 35.2637 14.1426C34.6587 13.7052 34.2909 13.0908 34.1602 12.2988L35.9463 12.0215C36.0383 12.4102 36.2411 12.7169 36.5557 12.9404C36.8703 13.164 37.2678 13.2754 37.7471 13.2754C38.1681 13.2754 38.4922 13.1926 38.7197 13.0273C38.9521 12.8572 39.0684 12.6266 39.0684 12.335C39.0684 12.1552 39.0245 12.0122 38.9375 11.9053C38.8552 11.7935 38.6713 11.686 38.3857 11.584C38.1001 11.4819 37.6618 11.3528 37.0713 11.1973C36.4131 11.0223 35.8901 10.8359 35.5029 10.6367C35.1158 10.4327 34.8374 10.192 34.668 9.91504C34.4985 9.63801 34.4141 9.30188 34.4141 8.9082C34.4141 8.41746 34.5423 7.98943 34.7988 7.625C35.0553 7.26073 35.4135 6.98146 35.873 6.78711C36.3329 6.58784 36.8755 6.48828 37.5 6.48828ZM53.3047 6.48828C54.0937 6.48828 54.7815 6.66572 55.3672 7.02051C55.9527 7.37528 56.4072 7.86634 56.7314 8.49316C57.0558 9.11525 57.2187 9.83193 57.2188 10.6436C57.2188 11.46 57.0537 12.1817 56.7246 12.8086C56.4003 13.4307 55.9451 13.9196 55.3594 14.2744C54.7737 14.6242 54.0888 14.7988 53.3047 14.7988C52.5205 14.7988 51.8357 14.6214 51.25 14.2666C50.6643 13.9118 50.2091 13.4238 49.8848 12.8018C49.5653 12.1748 49.4053 11.4552 49.4053 10.6436C49.4053 9.81735 49.5703 9.09279 49.8994 8.4707C50.2286 7.8488 50.6859 7.36255 51.2715 7.0127C51.8572 6.66281 52.5351 6.48828 53.3047 6.48828ZM76.7471 6.48828C77.5603 6.48828 78.25 6.68053 78.8164 7.06445C79.3876 7.44351 79.812 7.97991 80.0879 8.6748C80.3638 9.36976 80.4672 10.189 80.3994 11.1318H74.7256C74.7843 11.6972 74.949 12.1516 75.2227 12.4951C75.5711 12.9325 76.0792 13.1513 76.7471 13.1514C77.1779 13.1514 77.5486 13.0567 77.8584 12.8672C78.173 12.6728 78.4146 12.3928 78.584 12.0283L80.3125 12.5537C80.0124 13.2633 79.5473 13.8153 78.918 14.209C78.2936 14.6025 77.6036 14.7988 76.8486 14.7988C76.0549 14.7988 75.358 14.6263 74.7578 14.2812C74.1576 13.9362 73.6875 13.458 73.3486 12.8457C73.0147 12.2334 72.8477 11.5284 72.8477 10.7314C72.8477 9.87126 73.0127 9.12495 73.3418 8.49316C73.671 7.85651 74.1282 7.36263 74.7139 7.0127C75.2995 6.6628 75.9775 6.48832 76.7471 6.48828ZM23.3301 14.5801H21.5801V4.08203H23.3301V14.5801ZM29.6152 6.48047C30.1959 6.48052 30.6753 6.5781 31.0527 6.77246C31.4301 6.96681 31.7305 7.21443 31.9531 7.51562C32.1758 7.81695 32.3398 8.13831 32.4463 8.47852C32.5528 8.81873 32.6213 9.14205 32.6504 9.44824C32.6843 9.74946 32.7012 9.99508 32.7012 10.1846V14.5801H30.9287V10.7891C30.9287 10.5413 30.9118 10.2669 30.8779 9.96582C30.844 9.66449 30.7645 9.37469 30.6387 9.09766C30.5177 8.81592 30.3337 8.58503 30.0869 8.40527C29.8449 8.22551 29.5157 8.13579 29.0996 8.13574C28.8769 8.13574 28.6563 8.17221 28.4385 8.24512C28.2206 8.31802 28.0219 8.4442 27.8428 8.62402C27.6685 8.79899 27.5284 9.04249 27.4219 9.35352C27.3154 9.65965 27.2617 10.0532 27.2617 10.5342V14.5801H25.4902V6.70703H27.0518V7.58301C27.2521 7.34675 27.486 7.14172 27.7559 6.96973C28.2593 6.64409 28.8794 6.48047 29.6152 6.48047ZM48.748 5.83887H44.2021V8.45605H47.876V10.2061H44.2021V14.5801H42.4521V4.08203H48.748V5.83887ZM62.5137 6.67773C62.7606 6.65829 63.001 6.66815 63.2334 6.70703V8.34766C63.001 8.27961 62.7317 8.25695 62.4268 8.28125C62.1267 8.30557 61.8553 8.39134 61.6133 8.53711C61.3715 8.66829 61.1733 8.83606 61.0186 9.04004C60.8686 9.24404 60.7572 9.47701 60.6846 9.73926C60.612 9.99685 60.5752 10.2768 60.5752 10.5781V14.5801H58.8184V6.70703H60.3652V7.96582C60.4243 7.85986 60.4888 7.75824 60.5605 7.66211C60.7251 7.4434 60.9219 7.26302 61.1494 7.12207C61.3429 6.99098 61.5559 6.88926 61.7881 6.81641C62.0251 6.73869 62.267 6.69235 62.5137 6.67773ZM67.8057 8.0625C67.3362 8.06252 66.9485 8.17982 66.6436 8.41309C66.3389 8.64144 66.1139 8.95232 65.9688 9.3457C65.8235 9.7345 65.751 10.1673 65.751 10.6436C65.751 11.1247 65.8215 11.5624 65.9619 11.9561C66.1071 12.3447 66.3269 12.6535 66.6221 12.8818C66.9174 13.1103 67.293 13.2246 67.748 13.2246C68.2174 13.2246 68.5953 13.1171 68.8809 12.9033C69.1711 12.6846 69.3811 12.3808 69.5117 11.9922C69.6473 11.6034 69.7158 11.1539 69.7158 10.6436C69.7158 10.1284 69.6473 9.67886 69.5117 9.29492C69.381 8.90617 69.1753 8.60445 68.8945 8.39062C68.6138 8.17213 68.2508 8.0625 67.8057 8.0625ZM53.3047 8.13574C52.8351 8.13574 52.4475 8.24222 52.1426 8.45605C51.8425 8.66504 51.6198 8.95977 51.4746 9.33887C51.3295 9.71303 51.2568 10.148 51.2568 10.6436C51.2568 11.4066 51.4288 12.0168 51.7725 12.4736C52.121 12.9256 52.6318 13.1514 53.3047 13.1514C54.0017 13.1514 54.5196 12.9177 54.8584 12.4512C55.1971 11.9846 55.3672 11.3822 55.3672 10.6436C55.3672 9.8807 55.1951 9.27324 54.8516 8.82129C54.5079 8.36444 53.9921 8.13575 53.3047 8.13574ZM76.8203 8.02637C76.1039 8.02637 75.5712 8.25013 75.2227 8.69727C74.9987 8.98144 74.8476 9.35094 74.7676 9.80566H78.6221C78.5589 9.29301 78.4236 8.89686 78.2139 8.61719C77.9186 8.22359 77.4543 8.02645 76.8203 8.02637Z",
|
|
37
|
+
fill: "black"
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
/* @__PURE__ */ jsxs("defs", { children: [
|
|
41
|
+
/* @__PURE__ */ jsxs(
|
|
42
|
+
"linearGradient",
|
|
43
|
+
{
|
|
44
|
+
id: "paint0_linear_2976_9475",
|
|
45
|
+
x1: "1.85883",
|
|
46
|
+
y1: "1.92425",
|
|
47
|
+
x2: "24.3072",
|
|
48
|
+
y2: "9.64016",
|
|
49
|
+
gradientUnits: "userSpaceOnUse",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx("stop", {}),
|
|
52
|
+
/* @__PURE__ */ jsx("stop", { offset: "1", stopOpacity: "0.4" })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ jsxs(
|
|
57
|
+
"linearGradient",
|
|
58
|
+
{
|
|
59
|
+
id: "paint1_linear_2976_9475",
|
|
60
|
+
x1: "25.6475",
|
|
61
|
+
y1: "8.65468",
|
|
62
|
+
x2: "10.7901",
|
|
63
|
+
y2: "8.65468",
|
|
64
|
+
gradientUnits: "userSpaceOnUse",
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsx("stop", {}),
|
|
67
|
+
/* @__PURE__ */ jsx("stop", { offset: "1", stopOpacity: "0.4" })
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] })
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
) })
|
|
68
75
|
] });
|
|
69
76
|
}
|
|
70
|
-
function
|
|
71
|
-
return
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"div",
|
|
76
|
-
{
|
|
77
|
-
className: cn(
|
|
78
|
-
"w-full max-w-[400px] rounded-xl overflow-hidden shadow-lg",
|
|
79
|
-
appearance.containerClassName
|
|
80
|
-
),
|
|
81
|
-
children: [
|
|
82
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
|
|
83
|
-
"bg-white p-6 flex flex-col justify-center items-stretch gap-6",
|
|
84
|
-
appearance.cardClassName
|
|
85
|
-
), children }),
|
|
86
|
-
/* @__PURE__ */ jsxRuntime.jsx(AuthBranding, {})
|
|
87
|
-
]
|
|
88
|
-
}
|
|
89
|
-
);
|
|
77
|
+
function AuthContainer({ children }) {
|
|
78
|
+
return /* @__PURE__ */ jsxs("div", { className: "if-authContainer if-internal-a8f3d2", children: [
|
|
79
|
+
/* @__PURE__ */ jsx("div", { className: "if-authCard if-internal-b2k9x1", children }),
|
|
80
|
+
/* @__PURE__ */ jsx(AuthBranding, {})
|
|
81
|
+
] });
|
|
90
82
|
}
|
|
91
|
-
function AuthHeader({
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}) {
|
|
96
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(
|
|
97
|
-
"flex flex-col justify-start items-start gap-2",
|
|
98
|
-
appearance.containerClassName
|
|
99
|
-
), children: [
|
|
100
|
-
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: cn(
|
|
101
|
-
"text-2xl font-semibold text-black leading-8",
|
|
102
|
-
appearance.titleClassName
|
|
103
|
-
), children: title }),
|
|
104
|
-
subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn(
|
|
105
|
-
"text-sm font-normal text-[#828282] leading-6",
|
|
106
|
-
appearance.subtitleClassName
|
|
107
|
-
), children: subtitle })
|
|
83
|
+
function AuthHeader({ title, subtitle }) {
|
|
84
|
+
return /* @__PURE__ */ jsxs("div", { className: "if-authHeader if-internal-h3m7w5", children: [
|
|
85
|
+
/* @__PURE__ */ jsx("h1", { className: "if-authHeader-title if-internal-t4p1k9", children: title }),
|
|
86
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "if-authHeader-subtitle if-internal-s7q2m3", children: subtitle })
|
|
108
87
|
] });
|
|
109
88
|
}
|
|
110
|
-
function AuthErrorBanner({ error
|
|
111
|
-
if (!error)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
),
|
|
119
|
-
children: [
|
|
120
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "w-6 h-6 text-red-500 shrink-0" }),
|
|
121
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-red-600 flex-1", children: error })
|
|
122
|
-
]
|
|
123
|
-
}
|
|
124
|
-
);
|
|
89
|
+
function AuthErrorBanner({ error }) {
|
|
90
|
+
if (!error) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
return /* @__PURE__ */ jsx("div", { className: "if-errorBanner if-internal-eb2m7k", children: /* @__PURE__ */ jsxs("div", { className: "if-errorBanner-content", children: [
|
|
94
|
+
/* @__PURE__ */ jsx(AlertTriangle, { className: "if-errorBanner-icon" }),
|
|
95
|
+
/* @__PURE__ */ jsx("span", { className: "if-errorBanner-text", children: error })
|
|
96
|
+
] }) });
|
|
125
97
|
}
|
|
126
|
-
function AuthFormField({
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
...props
|
|
131
|
-
}) {
|
|
132
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(
|
|
133
|
-
"flex flex-col justify-center items-stretch gap-1",
|
|
134
|
-
appearance.containerClassName
|
|
135
|
-
), children: [
|
|
136
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
137
|
-
"label",
|
|
138
|
-
{
|
|
139
|
-
htmlFor: id,
|
|
140
|
-
className: cn(
|
|
141
|
-
"text-sm font-normal text-black leading-6",
|
|
142
|
-
appearance.labelClassName
|
|
143
|
-
),
|
|
144
|
-
children: label
|
|
145
|
-
}
|
|
146
|
-
),
|
|
147
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
148
|
-
"input",
|
|
149
|
-
{
|
|
150
|
-
id,
|
|
151
|
-
className: cn(
|
|
152
|
-
"w-full flex items-center gap-2 self-stretch",
|
|
153
|
-
"pl-3 pr-2 py-2 rounded-sm border border-[#D4D4D4] bg-white",
|
|
154
|
-
"text-sm font-normal leading-5",
|
|
155
|
-
"placeholder:text-[#A3A3A3] placeholder:font-sm placeholder:font-normal",
|
|
156
|
-
"focus:outline-none focus:border-black",
|
|
157
|
-
appearance.inputClassName
|
|
158
|
-
),
|
|
159
|
-
...props
|
|
160
|
-
}
|
|
161
|
-
)
|
|
98
|
+
function AuthFormField({ label, id, ...props }) {
|
|
99
|
+
return /* @__PURE__ */ jsxs("div", { className: "if-formField if-internal-f9n6p2", children: [
|
|
100
|
+
/* @__PURE__ */ jsx("label", { htmlFor: id, className: "if-formField-label if-internal-l3k8m1", children: label }),
|
|
101
|
+
/* @__PURE__ */ jsx("input", { id, className: "if-formField-input if-internal-i2v8k4", ...props })
|
|
162
102
|
] });
|
|
163
103
|
}
|
|
164
104
|
function AuthPasswordStrengthIndicator({
|
|
165
105
|
password,
|
|
166
|
-
config
|
|
167
|
-
appearance = {}
|
|
106
|
+
config
|
|
168
107
|
}) {
|
|
169
108
|
const requirements = createRequirements(config);
|
|
170
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ jsx("div", { className: "if-passwordStrength if-internal-ps6w3k", children: /* @__PURE__ */ jsx("div", { className: "if-passwordStrength-requirements", children: requirements.map((req) => /* @__PURE__ */ jsxs(
|
|
171
110
|
"div",
|
|
172
111
|
{
|
|
173
|
-
className:
|
|
174
|
-
children:
|
|
175
|
-
/* @__PURE__ */
|
|
112
|
+
className: `if-passwordStrength-requirement ${req.test(password) ? "met" : "unmet"}`,
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ jsx(
|
|
176
115
|
"div",
|
|
177
116
|
{
|
|
178
|
-
|
|
179
|
-
"flex
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
117
|
+
style: {
|
|
118
|
+
display: "flex",
|
|
119
|
+
alignItems: "center",
|
|
120
|
+
justifyContent: "center",
|
|
121
|
+
width: "1rem",
|
|
122
|
+
height: "1rem",
|
|
123
|
+
borderRadius: "50%",
|
|
124
|
+
border: "2px solid",
|
|
125
|
+
borderColor: req.test(password) ? "transparent" : "#9ca3af",
|
|
126
|
+
backgroundColor: req.test(password) ? "#059669" : "white",
|
|
127
|
+
transition: "all 0.2s"
|
|
128
|
+
},
|
|
129
|
+
children: req.test(password) && /* @__PURE__ */ jsx(Check, { style: { width: "0.75rem", height: "0.75rem", color: "white" } })
|
|
183
130
|
}
|
|
184
131
|
),
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
appearance.requirementClassName
|
|
191
|
-
),
|
|
192
|
-
children: req.label
|
|
193
|
-
}
|
|
194
|
-
)
|
|
195
|
-
] }, req.label))
|
|
196
|
-
}
|
|
197
|
-
);
|
|
132
|
+
/* @__PURE__ */ jsx("span", { children: req.label })
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
req.label
|
|
136
|
+
)) }) });
|
|
198
137
|
}
|
|
199
138
|
function createRequirements(config) {
|
|
200
139
|
const requirements = [];
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
140
|
+
if (config.passwordMinLength) {
|
|
141
|
+
requirements.push({
|
|
142
|
+
label: `At least ${config.passwordMinLength} characters`,
|
|
143
|
+
test: (password) => password.length >= config.passwordMinLength
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
if (config.requireLowercase) {
|
|
207
147
|
requirements.push({
|
|
208
|
-
label: "
|
|
209
|
-
test: (
|
|
148
|
+
label: "Contains lowercase letter",
|
|
149
|
+
test: (password) => /[a-z]/.test(password)
|
|
210
150
|
});
|
|
211
151
|
}
|
|
212
|
-
if (
|
|
152
|
+
if (config.requireUppercase) {
|
|
213
153
|
requirements.push({
|
|
214
|
-
label: "
|
|
215
|
-
test: (
|
|
154
|
+
label: "Contains uppercase letter",
|
|
155
|
+
test: (password) => /[A-Z]/.test(password)
|
|
216
156
|
});
|
|
217
157
|
}
|
|
218
|
-
if (requireNumber) {
|
|
158
|
+
if (config.requireNumber) {
|
|
219
159
|
requirements.push({
|
|
220
|
-
label: "
|
|
221
|
-
test: (
|
|
160
|
+
label: "Contains number",
|
|
161
|
+
test: (password) => /\d/.test(password)
|
|
222
162
|
});
|
|
223
163
|
}
|
|
224
|
-
if (requireSpecialChar) {
|
|
164
|
+
if (config.requireSpecialChar) {
|
|
225
165
|
requirements.push({
|
|
226
|
-
label: "
|
|
227
|
-
test: (
|
|
166
|
+
label: "Contains special character",
|
|
167
|
+
test: (password) => /[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(password)
|
|
228
168
|
});
|
|
229
169
|
}
|
|
230
|
-
requirements.push({
|
|
231
|
-
label: `${minLength} characters or more`,
|
|
232
|
-
test: (pwd) => pwd.length >= minLength
|
|
233
|
-
});
|
|
234
170
|
return requirements;
|
|
235
171
|
}
|
|
236
172
|
function AuthPasswordField({
|
|
@@ -240,187 +176,125 @@ function AuthPasswordField({
|
|
|
240
176
|
authConfig,
|
|
241
177
|
forgotPasswordLink,
|
|
242
178
|
value,
|
|
243
|
-
appearance = {},
|
|
244
179
|
onFocus,
|
|
245
180
|
...props
|
|
246
181
|
}) {
|
|
247
|
-
const [showPassword, setShowPassword] =
|
|
248
|
-
const [showStrength, setShowStrength] =
|
|
182
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
183
|
+
const [showStrength, setShowStrength] = useState(false);
|
|
249
184
|
const handleFocus = (e) => {
|
|
250
185
|
if (showStrengthIndicator) {
|
|
251
186
|
setShowStrength(true);
|
|
252
187
|
}
|
|
253
188
|
onFocus?.(e);
|
|
254
189
|
};
|
|
255
|
-
return /* @__PURE__ */
|
|
256
|
-
"div",
|
|
257
|
-
|
|
258
|
-
className:
|
|
259
|
-
|
|
260
|
-
|
|
190
|
+
return /* @__PURE__ */ jsxs("div", { className: "if-passwordField if-internal-p5w9m7", children: [
|
|
191
|
+
(label || forgotPasswordLink) && /* @__PURE__ */ jsxs("div", { className: "if-passwordField-labelRow", children: [
|
|
192
|
+
/* @__PURE__ */ jsx("label", { htmlFor: id, className: "if-passwordField-label", children: label }),
|
|
193
|
+
forgotPasswordLink && /* @__PURE__ */ jsx("a", { href: forgotPasswordLink.href, className: "if-passwordField-forgotLink", children: forgotPasswordLink.text || "Forget Password?" })
|
|
194
|
+
] }),
|
|
195
|
+
/* @__PURE__ */ jsxs("div", { className: "if-passwordField-inputWrapper", children: [
|
|
196
|
+
/* @__PURE__ */ jsx(
|
|
197
|
+
"input",
|
|
198
|
+
{
|
|
199
|
+
id,
|
|
200
|
+
type: showPassword ? "text" : "password",
|
|
201
|
+
className: "if-passwordField-input",
|
|
202
|
+
value,
|
|
203
|
+
onFocus: handleFocus,
|
|
204
|
+
...props
|
|
205
|
+
}
|
|
261
206
|
),
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
forgotPasswordLink && /* @__PURE__ */ jsxRuntime.jsx(
|
|
276
|
-
"a",
|
|
277
|
-
{
|
|
278
|
-
href: forgotPasswordLink.href,
|
|
279
|
-
className: "text-right text-sm font-normal text-[#737373] leading-6",
|
|
280
|
-
children: forgotPasswordLink.text || "Forget Password?"
|
|
281
|
-
}
|
|
282
|
-
)
|
|
283
|
-
] }),
|
|
284
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
285
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
286
|
-
"input",
|
|
287
|
-
{
|
|
288
|
-
id,
|
|
289
|
-
type: showPassword ? "text" : "password",
|
|
290
|
-
className: cn(
|
|
291
|
-
"w-full flex items-center gap-2 self-stretch",
|
|
292
|
-
"pl-3 py-2 pr-8 rounded border border-[#D4D4D4] bg-white",
|
|
293
|
-
"text-sm font-normal leading-5",
|
|
294
|
-
"placeholder:text-[#A3A3A3] placeholder:font-sm placeholder:font-normal",
|
|
295
|
-
"focus:outline-none focus:border-black",
|
|
296
|
-
appearance.inputClassName
|
|
297
|
-
),
|
|
298
|
-
value,
|
|
299
|
-
onFocus: handleFocus,
|
|
300
|
-
...props
|
|
301
|
-
}
|
|
302
|
-
),
|
|
303
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
304
|
-
"button",
|
|
305
|
-
{
|
|
306
|
-
type: "button",
|
|
307
|
-
onClick: () => setShowPassword(!showPassword),
|
|
308
|
-
className: "absolute right-2 top-1/2 -translate-y-1/2 bg-transparent border-none text-[#A6A6A6] cursor-pointer transition-colors hover:text-gray-600 flex items-center justify-center",
|
|
309
|
-
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
310
|
-
children: showPassword ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeOff, { size: 20 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { size: 20 })
|
|
311
|
-
}
|
|
312
|
-
)
|
|
313
|
-
] }),
|
|
314
|
-
showStrengthIndicator && showStrength && /* @__PURE__ */ jsxRuntime.jsx(
|
|
315
|
-
AuthPasswordStrengthIndicator,
|
|
316
|
-
{
|
|
317
|
-
password: String(value || ""),
|
|
318
|
-
config: authConfig
|
|
319
|
-
}
|
|
320
|
-
)
|
|
321
|
-
]
|
|
322
|
-
}
|
|
323
|
-
);
|
|
207
|
+
/* @__PURE__ */ jsx(
|
|
208
|
+
"button",
|
|
209
|
+
{
|
|
210
|
+
type: "button",
|
|
211
|
+
onClick: () => setShowPassword(!showPassword),
|
|
212
|
+
className: "if-passwordField-toggleButton",
|
|
213
|
+
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
214
|
+
children: showPassword ? /* @__PURE__ */ jsx(EyeOff, { size: 20 }) : /* @__PURE__ */ jsx(Eye, { size: 20 })
|
|
215
|
+
}
|
|
216
|
+
)
|
|
217
|
+
] }),
|
|
218
|
+
showStrengthIndicator && showStrength && /* @__PURE__ */ jsx(AuthPasswordStrengthIndicator, { password: String(value || ""), config: authConfig })
|
|
219
|
+
] });
|
|
324
220
|
}
|
|
325
221
|
function AuthSubmitButton({
|
|
326
222
|
children,
|
|
327
223
|
isLoading = false,
|
|
328
224
|
confirmed = false,
|
|
329
225
|
disabled = false,
|
|
330
|
-
|
|
226
|
+
type = "submit",
|
|
227
|
+
onClick
|
|
331
228
|
}) {
|
|
332
|
-
return /* @__PURE__ */
|
|
229
|
+
return /* @__PURE__ */ jsxs(
|
|
333
230
|
"button",
|
|
334
231
|
{
|
|
335
|
-
type
|
|
336
|
-
className:
|
|
337
|
-
"rounded-sm bg-black w-full flex mt-4 px-4 py-2",
|
|
338
|
-
"justify-center items-center gap-2.5 self-stretch",
|
|
339
|
-
"text-white font-semibold font-manrope text-base leading-normal",
|
|
340
|
-
"border-none cursor-pointer transition-colors",
|
|
341
|
-
"hover:bg-gray-800",
|
|
342
|
-
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
343
|
-
className
|
|
344
|
-
),
|
|
232
|
+
type,
|
|
233
|
+
className: "if-submitButton if-internal-b8p3m4",
|
|
345
234
|
disabled: disabled || isLoading || confirmed,
|
|
235
|
+
onClick,
|
|
346
236
|
children: [
|
|
347
|
-
isLoading && /* @__PURE__ */
|
|
348
|
-
confirmed && /* @__PURE__ */
|
|
237
|
+
isLoading && /* @__PURE__ */ jsx(Loader2, { className: "if-submitButton-icon if-submitButton-spinner", size: 20 }),
|
|
238
|
+
confirmed && /* @__PURE__ */ jsx(CircleCheck, { className: "if-submitButton-icon", size: 20 }),
|
|
349
239
|
children
|
|
350
240
|
]
|
|
351
241
|
}
|
|
352
242
|
);
|
|
353
243
|
}
|
|
354
|
-
function AuthLink({ text, linkText, href
|
|
355
|
-
const
|
|
244
|
+
function AuthLink({ text, linkText, href }) {
|
|
245
|
+
const [searchParams] = useSearchParams();
|
|
246
|
+
const currentSearch = searchParams.toString();
|
|
356
247
|
const finalHref = (() => {
|
|
357
|
-
if (!currentSearch)
|
|
248
|
+
if (!currentSearch) {
|
|
249
|
+
return href;
|
|
250
|
+
}
|
|
358
251
|
try {
|
|
359
252
|
const url = new URL(href, window.location.origin);
|
|
360
|
-
|
|
361
|
-
currentParams.forEach((value, key) => {
|
|
362
|
-
if (!url.searchParams.has(key)) {
|
|
363
|
-
url.searchParams.set(key, value);
|
|
364
|
-
}
|
|
365
|
-
});
|
|
253
|
+
url.search = currentSearch;
|
|
366
254
|
return url.pathname + url.search;
|
|
367
255
|
} catch {
|
|
368
256
|
return href;
|
|
369
257
|
}
|
|
370
258
|
})();
|
|
371
|
-
return /* @__PURE__ */
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
text,
|
|
376
|
-
" ",
|
|
377
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
378
|
-
"a",
|
|
379
|
-
{
|
|
380
|
-
href: finalHref,
|
|
381
|
-
className: cn(
|
|
382
|
-
"text-sm font-medium text-black leading-6",
|
|
383
|
-
appearance.linkClassName
|
|
384
|
-
),
|
|
385
|
-
children: linkText
|
|
386
|
-
}
|
|
387
|
-
)
|
|
259
|
+
return /* @__PURE__ */ jsxs("p", { className: "if-authLink if-internal-al5w9p", children: [
|
|
260
|
+
text && /* @__PURE__ */ jsx("span", { className: "if-authLink-text", children: text }),
|
|
261
|
+
text && " ",
|
|
262
|
+
/* @__PURE__ */ jsx("a", { href: finalHref, className: "if-authLink-link", children: linkText })
|
|
388
263
|
] });
|
|
389
264
|
}
|
|
390
|
-
function AuthDivider({ text = "or"
|
|
391
|
-
return /* @__PURE__ */
|
|
392
|
-
"
|
|
393
|
-
"
|
|
394
|
-
"
|
|
395
|
-
|
|
396
|
-
), children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold font-manrope text-[#A3A3A3] leading-normal", children: text }) });
|
|
265
|
+
function AuthDivider({ text = "or" }) {
|
|
266
|
+
return /* @__PURE__ */ jsxs("div", { className: "if-authDivider if-internal-ad7k3m", children: [
|
|
267
|
+
/* @__PURE__ */ jsx("div", { className: "if-authDivider-line" }),
|
|
268
|
+
/* @__PURE__ */ jsx("span", { className: "if-authDivider-text", children: text }),
|
|
269
|
+
/* @__PURE__ */ jsx("div", { className: "if-authDivider-line" })
|
|
270
|
+
] });
|
|
397
271
|
}
|
|
398
272
|
var OAUTH_PROVIDER_CONFIG = {
|
|
399
273
|
google: {
|
|
400
274
|
name: "Google",
|
|
401
|
-
svg: /* @__PURE__ */
|
|
402
|
-
/* @__PURE__ */
|
|
275
|
+
svg: /* @__PURE__ */ jsxs("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", children: [
|
|
276
|
+
/* @__PURE__ */ jsx(
|
|
403
277
|
"path",
|
|
404
278
|
{
|
|
405
279
|
d: "M17.64 9.2c0-.637-.057-1.251-.164-1.84H9v3.481h4.844c-.209 1.125-.843 2.078-1.796 2.717v2.258h2.908c1.702-1.567 2.684-3.874 2.684-6.615z",
|
|
406
280
|
fill: "#4285F4"
|
|
407
281
|
}
|
|
408
282
|
),
|
|
409
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ jsx(
|
|
410
284
|
"path",
|
|
411
285
|
{
|
|
412
286
|
d: "M9 18c2.43 0 4.467-.806 5.956-2.184l-2.908-2.258c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H.957v2.332C2.438 15.983 5.482 18 9 18z",
|
|
413
287
|
fill: "#34A853"
|
|
414
288
|
}
|
|
415
289
|
),
|
|
416
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ jsx(
|
|
417
291
|
"path",
|
|
418
292
|
{
|
|
419
293
|
d: "M3.964 10.707c-.18-.54-.282-1.117-.282-1.707 0-.593.102-1.17.282-1.709V4.958H.957C.347 6.173 0 7.548 0 9c0 1.452.348 2.827.957 4.042l3.007-2.335z",
|
|
420
294
|
fill: "#FBBC05"
|
|
421
295
|
}
|
|
422
296
|
),
|
|
423
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ jsx(
|
|
424
298
|
"path",
|
|
425
299
|
{
|
|
426
300
|
d: "M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0 5.482 0 2.438 2.017.957 4.958L3.964 7.29C4.672 5.163 6.656 3.58 9 3.58z",
|
|
@@ -432,12 +306,12 @@ var OAUTH_PROVIDER_CONFIG = {
|
|
|
432
306
|
},
|
|
433
307
|
github: {
|
|
434
308
|
name: "GitHub",
|
|
435
|
-
svg: /* @__PURE__ */
|
|
309
|
+
svg: /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" }) }),
|
|
436
310
|
className: "insforge-oauth-github"
|
|
437
311
|
},
|
|
438
312
|
discord: {
|
|
439
313
|
name: "Discord",
|
|
440
|
-
svg: /* @__PURE__ */
|
|
314
|
+
svg: /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx(
|
|
441
315
|
"path",
|
|
442
316
|
{
|
|
443
317
|
d: "M20.317 4.37a19.791 19.791 0 00-4.885-1.515.074.074 0 00-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 00-5.487 0 12.64 12.64 0 00-.617-1.25.077.077 0 00-.079-.037A19.736 19.736 0 003.677 4.37a.07.07 0 00-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 00.031.057 19.9 19.9 0 005.993 3.03.078.078 0 00.084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 00-.041-.106 13.107 13.107 0 01-1.872-.892.077.077 0 01-.008-.128 10.2 10.2 0 00.372-.292.074.074 0 01.077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 01.078.01c.12.098.246.198.373.292a.077.077 0 01-.006.127 12.299 12.299 0 01-1.873.892.077.077 0 00-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 00.084.028 19.839 19.839 0 006.002-3.03.077.077 0 00.032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 00-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z",
|
|
@@ -448,7 +322,7 @@ var OAUTH_PROVIDER_CONFIG = {
|
|
|
448
322
|
},
|
|
449
323
|
facebook: {
|
|
450
324
|
name: "Facebook",
|
|
451
|
-
svg: /* @__PURE__ */
|
|
325
|
+
svg: /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx(
|
|
452
326
|
"path",
|
|
453
327
|
{
|
|
454
328
|
d: "M24 12.073C24 5.405 18.627 0 12 0S0 5.405 0 12.073C0 18.1 4.388 23.094 10.125 24v-8.437H7.078v-3.49h3.047v-2.66c0-3.025 1.792-4.697 4.533-4.697 1.312 0 2.686.236 2.686.236v2.971H15.83c-1.49 0-1.955.93-1.955 1.886v2.264h3.328l-.532 3.49h-2.796V24C19.612 23.094 24 18.1 24 12.073z",
|
|
@@ -459,7 +333,7 @@ var OAUTH_PROVIDER_CONFIG = {
|
|
|
459
333
|
},
|
|
460
334
|
linkedin: {
|
|
461
335
|
name: "LinkedIn",
|
|
462
|
-
svg: /* @__PURE__ */
|
|
336
|
+
svg: /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx(
|
|
463
337
|
"path",
|
|
464
338
|
{
|
|
465
339
|
d: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z",
|
|
@@ -470,45 +344,45 @@ var OAUTH_PROVIDER_CONFIG = {
|
|
|
470
344
|
},
|
|
471
345
|
microsoft: {
|
|
472
346
|
name: "Microsoft",
|
|
473
|
-
svg: /* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
/* @__PURE__ */
|
|
477
|
-
/* @__PURE__ */
|
|
347
|
+
svg: /* @__PURE__ */ jsxs("svg", { width: "18", height: "18", viewBox: "0 0 23 23", fill: "none", children: [
|
|
348
|
+
/* @__PURE__ */ jsx("path", { d: "M0 0h11v11H0z", fill: "#F25022" }),
|
|
349
|
+
/* @__PURE__ */ jsx("path", { d: "M12 0h11v11H12z", fill: "#7FBA00" }),
|
|
350
|
+
/* @__PURE__ */ jsx("path", { d: "M0 12h11v11H0z", fill: "#00A4EF" }),
|
|
351
|
+
/* @__PURE__ */ jsx("path", { d: "M12 12h11v11H12z", fill: "#FFB900" })
|
|
478
352
|
] }),
|
|
479
353
|
className: "insforge-oauth-microsoft"
|
|
480
354
|
},
|
|
481
355
|
apple: {
|
|
482
356
|
name: "Apple",
|
|
483
|
-
svg: /* @__PURE__ */
|
|
357
|
+
svg: /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09l.01-.01zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z" }) }),
|
|
484
358
|
className: "insforge-oauth-apple"
|
|
485
359
|
},
|
|
486
360
|
x: {
|
|
487
361
|
name: "X",
|
|
488
|
-
svg: /* @__PURE__ */
|
|
362
|
+
svg: /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" }) }),
|
|
489
363
|
className: "insforge-oauth-x"
|
|
490
364
|
},
|
|
491
365
|
instagram: {
|
|
492
366
|
name: "Instagram",
|
|
493
|
-
svg: /* @__PURE__ */
|
|
494
|
-
/* @__PURE__ */
|
|
367
|
+
svg: /* @__PURE__ */ jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", children: [
|
|
368
|
+
/* @__PURE__ */ jsx(
|
|
495
369
|
"path",
|
|
496
370
|
{
|
|
497
371
|
d: "M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z",
|
|
498
372
|
fill: "url(#instagram-gradient)"
|
|
499
373
|
}
|
|
500
374
|
),
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
/* @__PURE__ */
|
|
503
|
-
/* @__PURE__ */
|
|
504
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: "instagram-gradient", x1: "0%", y1: "100%", x2: "100%", y2: "0%", children: [
|
|
376
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "#FD5949" }),
|
|
377
|
+
/* @__PURE__ */ jsx("stop", { offset: "50%", stopColor: "#D6249F" }),
|
|
378
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "#285AEB" })
|
|
505
379
|
] }) })
|
|
506
380
|
] }),
|
|
507
381
|
className: "insforge-oauth-instagram"
|
|
508
382
|
},
|
|
509
383
|
tiktok: {
|
|
510
384
|
name: "TikTok",
|
|
511
|
-
svg: /* @__PURE__ */
|
|
385
|
+
svg: /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx(
|
|
512
386
|
"path",
|
|
513
387
|
{
|
|
514
388
|
d: "M19.589 6.686a4.793 4.793 0 01-3.77-4.245V2h-3.445v13.672a2.896 2.896 0 01-5.201 1.743l-.002-.001.002.001a2.895 2.895 0 013.183-4.51v-3.5a6.329 6.329 0 00-5.394 10.692 6.33 6.33 0 0010.857-4.424V8.687a8.182 8.182 0 004.773 1.526V6.79a4.831 4.831 0 01-1.003-.104z",
|
|
@@ -519,7 +393,7 @@ var OAUTH_PROVIDER_CONFIG = {
|
|
|
519
393
|
},
|
|
520
394
|
spotify: {
|
|
521
395
|
name: "Spotify",
|
|
522
|
-
svg: /* @__PURE__ */
|
|
396
|
+
svg: /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx(
|
|
523
397
|
"path",
|
|
524
398
|
{
|
|
525
399
|
d: "M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z",
|
|
@@ -538,43 +412,39 @@ function AuthOAuthButton({
|
|
|
538
412
|
disabled,
|
|
539
413
|
loading,
|
|
540
414
|
displayMode = "full",
|
|
541
|
-
style
|
|
542
|
-
className
|
|
415
|
+
style
|
|
543
416
|
}) {
|
|
544
417
|
const config = getProviderConfig(provider);
|
|
545
418
|
if (!config) {
|
|
546
419
|
return null;
|
|
547
420
|
}
|
|
548
421
|
const getButtonText = () => {
|
|
549
|
-
if (
|
|
550
|
-
|
|
551
|
-
|
|
422
|
+
if (displayMode === "full") {
|
|
423
|
+
return `Continue with ${config.name}`;
|
|
424
|
+
}
|
|
425
|
+
if (displayMode === "short") {
|
|
426
|
+
return config.name;
|
|
427
|
+
}
|
|
552
428
|
return "";
|
|
553
429
|
};
|
|
554
|
-
|
|
430
|
+
const className = [
|
|
431
|
+
"if-oauthButton",
|
|
432
|
+
"if-internal-o4k7w2",
|
|
433
|
+
displayMode === "full" && "if-oauthButton-full",
|
|
434
|
+
displayMode === "short" && "if-oauthButton-short",
|
|
435
|
+
displayMode === "icon" && "if-oauthButton-icon-only"
|
|
436
|
+
].filter(Boolean).join(" ");
|
|
437
|
+
return /* @__PURE__ */ jsxs(
|
|
555
438
|
"button",
|
|
556
439
|
{
|
|
557
440
|
type: "button",
|
|
558
441
|
onClick: () => onClick(provider),
|
|
559
|
-
className
|
|
560
|
-
"flex w-full h-9 px-3 py-2",
|
|
561
|
-
"flex-row justify-center items-center gap-3",
|
|
562
|
-
"rounded-md border border-[#E4E4E7] bg-white",
|
|
563
|
-
"shadow-[0_1px_2px_0_rgba(0,0,0,0.10)]",
|
|
564
|
-
"text-[#09090B] text-center text-sm font-medium leading-5",
|
|
565
|
-
"cursor-pointer transition-all duration-200",
|
|
566
|
-
"hover:bg-[#f9fafb] hover:border-[#9ca3af]",
|
|
567
|
-
"disabled:opacity-60 disabled:cursor-not-allowed",
|
|
568
|
-
displayMode === "full" && "justify-center",
|
|
569
|
-
displayMode === "short" && "justify-center px-2 gap-2",
|
|
570
|
-
displayMode === "icon" && "justify-center gap-0",
|
|
571
|
-
className
|
|
572
|
-
),
|
|
442
|
+
className,
|
|
573
443
|
disabled: disabled || loading,
|
|
574
444
|
style,
|
|
575
445
|
children: [
|
|
576
|
-
loading ? /* @__PURE__ */
|
|
577
|
-
getButtonText() && /* @__PURE__ */
|
|
446
|
+
loading ? /* @__PURE__ */ jsx(Loader2, { className: "if-oauthButton-icon if-submitButton-spinner", size: 18 }) : /* @__PURE__ */ jsx("span", { className: "if-oauthButton-icon", children: config.svg }),
|
|
447
|
+
getButtonText() && /* @__PURE__ */ jsx("span", { children: getButtonText() })
|
|
578
448
|
]
|
|
579
449
|
}
|
|
580
450
|
);
|
|
@@ -583,16 +453,19 @@ function AuthOAuthProviders({
|
|
|
583
453
|
providers,
|
|
584
454
|
onClick,
|
|
585
455
|
disabled,
|
|
586
|
-
loading
|
|
587
|
-
appearance = {}
|
|
456
|
+
loading
|
|
588
457
|
}) {
|
|
589
458
|
if (!providers || providers.length === 0) {
|
|
590
459
|
return null;
|
|
591
460
|
}
|
|
592
461
|
const count = providers.length;
|
|
593
462
|
const getDisplayMode = () => {
|
|
594
|
-
if (count === 1)
|
|
595
|
-
|
|
463
|
+
if (count === 1) {
|
|
464
|
+
return "full";
|
|
465
|
+
}
|
|
466
|
+
if (count === 2 || count === 4) {
|
|
467
|
+
return "short";
|
|
468
|
+
}
|
|
596
469
|
return "icon";
|
|
597
470
|
};
|
|
598
471
|
const getGridColumnStyle = (index) => {
|
|
@@ -628,22 +501,30 @@ function AuthOAuthProviders({
|
|
|
628
501
|
return { gridColumn: "span 2 / span 2" };
|
|
629
502
|
}
|
|
630
503
|
};
|
|
631
|
-
return /* @__PURE__ */
|
|
632
|
-
"
|
|
633
|
-
appearance.containerClassName
|
|
634
|
-
), children: providers.map((provider, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
635
|
-
AuthOAuthButton,
|
|
504
|
+
return /* @__PURE__ */ jsx(
|
|
505
|
+
"div",
|
|
636
506
|
{
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
507
|
+
className: "if-oauthProviders if-internal-op3m8k",
|
|
508
|
+
style: {
|
|
509
|
+
display: "grid",
|
|
510
|
+
gridTemplateColumns: "repeat(6, 1fr)",
|
|
511
|
+
gap: "0.75rem",
|
|
512
|
+
width: "100%"
|
|
513
|
+
},
|
|
514
|
+
children: providers.map((provider, index) => /* @__PURE__ */ jsx(
|
|
515
|
+
AuthOAuthButton,
|
|
516
|
+
{
|
|
517
|
+
provider,
|
|
518
|
+
onClick,
|
|
519
|
+
disabled,
|
|
520
|
+
loading: loading === provider,
|
|
521
|
+
displayMode: getDisplayMode(),
|
|
522
|
+
style: getGridColumnStyle(index)
|
|
523
|
+
},
|
|
524
|
+
provider
|
|
525
|
+
))
|
|
526
|
+
}
|
|
527
|
+
);
|
|
647
528
|
}
|
|
648
529
|
function AuthVerificationCodeInput({
|
|
649
530
|
length = 6,
|
|
@@ -651,13 +532,16 @@ function AuthVerificationCodeInput({
|
|
|
651
532
|
email,
|
|
652
533
|
onChange,
|
|
653
534
|
disabled = false,
|
|
654
|
-
onComplete
|
|
655
|
-
appearance = {}
|
|
535
|
+
onComplete
|
|
656
536
|
}) {
|
|
657
|
-
const inputRefs =
|
|
537
|
+
const inputRefs = useRef([]);
|
|
658
538
|
const handleChange = (index, digit) => {
|
|
659
|
-
if (digit.length > 1)
|
|
660
|
-
|
|
539
|
+
if (digit.length > 1) {
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
if (digit && !/^\d$/.test(digit)) {
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
661
545
|
const newValue = value.split("");
|
|
662
546
|
newValue[index] = digit;
|
|
663
547
|
const updatedValue = newValue.join("");
|
|
@@ -693,17 +577,14 @@ function AuthVerificationCodeInput({
|
|
|
693
577
|
}
|
|
694
578
|
}
|
|
695
579
|
};
|
|
696
|
-
return /* @__PURE__ */
|
|
697
|
-
"
|
|
698
|
-
appearance.containerClassName
|
|
699
|
-
), children: [
|
|
700
|
-
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm font-normal text-[#525252] leading-5", children: [
|
|
580
|
+
return /* @__PURE__ */ jsxs("div", { className: "if-verificationCode if-internal-vc8m4p", children: [
|
|
581
|
+
/* @__PURE__ */ jsxs("p", { className: "if-verificationCode-description", children: [
|
|
701
582
|
"We've sent a verification code to your inbox at",
|
|
702
583
|
" ",
|
|
703
|
-
/* @__PURE__ */
|
|
584
|
+
/* @__PURE__ */ jsx("span", { className: "if-verificationCode-email", children: email }),
|
|
704
585
|
". Enter it below to proceed."
|
|
705
586
|
] }),
|
|
706
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ jsx("div", { className: "if-verificationCode-inputContainer", children: Array.from({ length }).map((_, index) => /* @__PURE__ */ jsx(
|
|
707
588
|
"input",
|
|
708
589
|
{
|
|
709
590
|
ref: (el) => {
|
|
@@ -717,25 +598,16 @@ function AuthVerificationCodeInput({
|
|
|
717
598
|
onKeyDown: (e) => handleKeyDown(index, e),
|
|
718
599
|
onPaste: handlePaste,
|
|
719
600
|
disabled,
|
|
720
|
-
className:
|
|
721
|
-
"w-full h-12 px-3 py-2 rounded border border-[#E0E0E0] bg-white",
|
|
722
|
-
"text-center text-base font-semibold leading-5 text-black",
|
|
723
|
-
"transition-all duration-200 outline-none",
|
|
724
|
-
"focus:border-black focus:shadow-[0_0_0_2px_rgba(0,0,0,0.1)]",
|
|
725
|
-
"disabled:bg-[#F5F5F5] disabled:cursor-not-allowed disabled:opacity-60",
|
|
726
|
-
appearance.inputClassName
|
|
727
|
-
),
|
|
601
|
+
className: "if-verificationCode-input",
|
|
728
602
|
autoComplete: "one-time-code"
|
|
729
603
|
},
|
|
730
604
|
index
|
|
731
605
|
)) })
|
|
732
606
|
] });
|
|
733
607
|
}
|
|
734
|
-
var InsforgeContext =
|
|
735
|
-
void 0
|
|
736
|
-
);
|
|
608
|
+
var InsforgeContext = createContext(void 0);
|
|
737
609
|
function useInsforge() {
|
|
738
|
-
const context =
|
|
610
|
+
const context = useContext(InsforgeContext);
|
|
739
611
|
if (!context) {
|
|
740
612
|
throw new Error("useInsforge must be used within InsforgeProvider");
|
|
741
613
|
}
|
|
@@ -743,29 +615,27 @@ function useInsforge() {
|
|
|
743
615
|
}
|
|
744
616
|
function AuthEmailVerificationStep({
|
|
745
617
|
email,
|
|
746
|
-
description,
|
|
747
618
|
method = "code",
|
|
748
619
|
onVerifyCode
|
|
749
620
|
}) {
|
|
750
|
-
const {
|
|
751
|
-
const [
|
|
752
|
-
const [
|
|
753
|
-
const [
|
|
754
|
-
const [
|
|
755
|
-
const [
|
|
756
|
-
const [isVerifying, setIsVerifying] = react.useState(false);
|
|
757
|
-
const [verificationError, setVerificationError] = react.useState("");
|
|
621
|
+
const { sendVerificationEmail } = useInsforge();
|
|
622
|
+
const [resendDisabled, setResendDisabled] = useState(true);
|
|
623
|
+
const [resendCountdown, setResendCountdown] = useState(60);
|
|
624
|
+
const [isSending, setIsSending] = useState(false);
|
|
625
|
+
const [verificationCode, setVerificationCode] = useState("");
|
|
626
|
+
const [isVerifying, setIsVerifying] = useState(false);
|
|
758
627
|
const defaultDescription = method === "code" ? "We've sent a 6-digit verification code to {email}. Please enter it below to verify your account. The code will expire in 10 minutes." : "We've sent a verification link to {email}. Please check your email and click the link to verify your account. The link will expire in 10 minutes.";
|
|
759
|
-
|
|
628
|
+
useEffect(() => {
|
|
760
629
|
const sendInitialEmail = async () => {
|
|
761
630
|
try {
|
|
762
|
-
await
|
|
763
|
-
} catch {
|
|
631
|
+
await sendVerificationEmail(email);
|
|
632
|
+
} catch (error) {
|
|
633
|
+
console.error("Failed to send verification email:", error);
|
|
764
634
|
}
|
|
765
635
|
};
|
|
766
636
|
void sendInitialEmail();
|
|
767
|
-
}, [email,
|
|
768
|
-
|
|
637
|
+
}, [email, sendVerificationEmail]);
|
|
638
|
+
useEffect(() => {
|
|
769
639
|
if (resendCountdown > 0) {
|
|
770
640
|
const timer = setInterval(() => {
|
|
771
641
|
setResendCountdown((prev) => {
|
|
@@ -783,9 +653,8 @@ function AuthEmailVerificationStep({
|
|
|
783
653
|
setResendDisabled(true);
|
|
784
654
|
setResendCountdown(60);
|
|
785
655
|
setIsSending(true);
|
|
786
|
-
setVerificationError("");
|
|
787
656
|
try {
|
|
788
|
-
await
|
|
657
|
+
await sendVerificationEmail(email);
|
|
789
658
|
} catch {
|
|
790
659
|
setResendDisabled(false);
|
|
791
660
|
setResendCountdown(0);
|
|
@@ -793,59 +662,153 @@ function AuthEmailVerificationStep({
|
|
|
793
662
|
setIsSending(false);
|
|
794
663
|
}
|
|
795
664
|
};
|
|
796
|
-
const
|
|
797
|
-
if (!onVerifyCode) {
|
|
665
|
+
const handleSubmit = async () => {
|
|
666
|
+
if (!onVerifyCode || verificationCode.length !== 6) {
|
|
798
667
|
return;
|
|
799
668
|
}
|
|
800
669
|
setIsVerifying(true);
|
|
801
|
-
setVerificationError("");
|
|
802
670
|
try {
|
|
803
|
-
await onVerifyCode(
|
|
804
|
-
} catch (error) {
|
|
805
|
-
setVerificationError(
|
|
806
|
-
error instanceof Error ? error.message : "Invalid verification code. Please try again."
|
|
807
|
-
);
|
|
808
|
-
setVerificationCode("");
|
|
671
|
+
await onVerifyCode(verificationCode);
|
|
809
672
|
} finally {
|
|
810
673
|
setIsVerifying(false);
|
|
674
|
+
setVerificationCode("");
|
|
811
675
|
}
|
|
812
676
|
};
|
|
813
|
-
const displayDescription =
|
|
814
|
-
|
|
815
|
-
|
|
677
|
+
const displayDescription = defaultDescription;
|
|
678
|
+
const isLinkMethod = method === "link";
|
|
679
|
+
return /* @__PURE__ */ jsxs("div", { className: "if-verificationStep", children: [
|
|
680
|
+
/* @__PURE__ */ jsx("p", { className: "if-verificationStep-description", children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxs("span", { children: [
|
|
816
681
|
part,
|
|
817
|
-
index < array.length - 1 && /* @__PURE__ */
|
|
682
|
+
index < array.length - 1 && /* @__PURE__ */ jsx("span", { className: "if-verificationCode-email", children: email })
|
|
818
683
|
] }, index)) }),
|
|
819
|
-
|
|
820
|
-
/* @__PURE__ */
|
|
821
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-red-600 flex-1", children: verificationError })
|
|
822
|
-
] }) }),
|
|
823
|
-
method === "code" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full bg-neutral-100 dark:bg-neutral-800 rounded-lg px-4 pt-4 pb-6 flex flex-col gap-4", children: [
|
|
824
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
684
|
+
!isLinkMethod && /* @__PURE__ */ jsxs("div", { className: "if-verificationStep-codeContainer", children: [
|
|
685
|
+
/* @__PURE__ */ jsx("div", { className: "if-verificationStep-codeInputWrapper", children: /* @__PURE__ */ jsx(
|
|
825
686
|
AuthVerificationCodeInput,
|
|
826
687
|
{
|
|
827
688
|
value: verificationCode,
|
|
828
689
|
onChange: setVerificationCode,
|
|
829
690
|
email,
|
|
830
|
-
disabled: isVerifying
|
|
831
|
-
|
|
832
|
-
|
|
691
|
+
disabled: isVerifying
|
|
692
|
+
}
|
|
693
|
+
) }),
|
|
694
|
+
/* @__PURE__ */ jsx(
|
|
695
|
+
AuthSubmitButton,
|
|
696
|
+
{
|
|
697
|
+
type: "button",
|
|
698
|
+
isLoading: isVerifying,
|
|
699
|
+
disabled: isVerifying || verificationCode.length !== 6,
|
|
700
|
+
onClick: () => {
|
|
701
|
+
void handleSubmit();
|
|
702
|
+
},
|
|
703
|
+
children: isVerifying ? "Verifying..." : "Verify Code"
|
|
704
|
+
}
|
|
705
|
+
)
|
|
706
|
+
] }),
|
|
707
|
+
/* @__PURE__ */ jsxs("div", { className: "if-verificationStep-resendContainer", children: [
|
|
708
|
+
"Didn't receive the email?",
|
|
709
|
+
" ",
|
|
710
|
+
/* @__PURE__ */ jsx(
|
|
711
|
+
"button",
|
|
712
|
+
{
|
|
713
|
+
onClick: () => {
|
|
714
|
+
void handleResend();
|
|
715
|
+
},
|
|
716
|
+
disabled: resendDisabled || isSending,
|
|
717
|
+
className: "if-verificationStep-resendButton",
|
|
718
|
+
children: isSending ? "Sending..." : resendDisabled ? `Retry in (${resendCountdown}s)` : "Click to resend"
|
|
719
|
+
}
|
|
720
|
+
)
|
|
721
|
+
] })
|
|
722
|
+
] });
|
|
723
|
+
}
|
|
724
|
+
function AuthResetPasswordVerificationStep({
|
|
725
|
+
email,
|
|
726
|
+
method,
|
|
727
|
+
onVerifyCode,
|
|
728
|
+
onResendEmail
|
|
729
|
+
}) {
|
|
730
|
+
const [resendDisabled, setResendDisabled] = useState(true);
|
|
731
|
+
const [resendCountdown, setResendCountdown] = useState(60);
|
|
732
|
+
const [isSending, setIsSending] = useState(false);
|
|
733
|
+
const [verificationCode, setVerificationCode] = useState("");
|
|
734
|
+
const [isVerifying, setIsVerifying] = useState(false);
|
|
735
|
+
useEffect(() => {
|
|
736
|
+
if (resendCountdown > 0) {
|
|
737
|
+
const timer = setInterval(() => {
|
|
738
|
+
setResendCountdown((prev) => {
|
|
739
|
+
if (prev <= 1) {
|
|
740
|
+
setResendDisabled(false);
|
|
741
|
+
return 0;
|
|
833
742
|
}
|
|
743
|
+
return prev - 1;
|
|
744
|
+
});
|
|
745
|
+
}, 1e3);
|
|
746
|
+
return () => clearInterval(timer);
|
|
747
|
+
}
|
|
748
|
+
}, [resendCountdown]);
|
|
749
|
+
const handleResend = useCallback(async () => {
|
|
750
|
+
setResendDisabled(true);
|
|
751
|
+
setResendCountdown(60);
|
|
752
|
+
setIsSending(true);
|
|
753
|
+
try {
|
|
754
|
+
await onResendEmail();
|
|
755
|
+
} catch {
|
|
756
|
+
setResendDisabled(false);
|
|
757
|
+
setResendCountdown(0);
|
|
758
|
+
} finally {
|
|
759
|
+
setIsSending(false);
|
|
760
|
+
}
|
|
761
|
+
}, [onResendEmail]);
|
|
762
|
+
const handleSubmit = async () => {
|
|
763
|
+
if (!onVerifyCode || verificationCode.length !== 6) {
|
|
764
|
+
return;
|
|
765
|
+
}
|
|
766
|
+
setIsVerifying(true);
|
|
767
|
+
try {
|
|
768
|
+
await onVerifyCode(verificationCode);
|
|
769
|
+
} finally {
|
|
770
|
+
setIsVerifying(false);
|
|
771
|
+
setVerificationCode("");
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
const isLinkMethod = method === "link";
|
|
775
|
+
const description = isLinkMethod ? `We've sent a password reset link to ${email}. Please check your email and click the link to reset your password. The link will expire in 10 minutes.` : `We've sent a 6-digit verification code to ${email}. Please enter it below to reset your password. The code will expire in 10 minutes.`;
|
|
776
|
+
return /* @__PURE__ */ jsxs("div", { className: "if-verificationStep", children: [
|
|
777
|
+
/* @__PURE__ */ jsx("p", { className: "if-verificationStep-description", children: description }),
|
|
778
|
+
!isLinkMethod && /* @__PURE__ */ jsxs("div", { className: "if-verificationStep-codeContainer", children: [
|
|
779
|
+
/* @__PURE__ */ jsx("div", { className: "if-verificationStep-codeInputWrapper", children: /* @__PURE__ */ jsx(
|
|
780
|
+
AuthVerificationCodeInput,
|
|
781
|
+
{
|
|
782
|
+
value: verificationCode,
|
|
783
|
+
onChange: setVerificationCode,
|
|
784
|
+
email,
|
|
785
|
+
disabled: isVerifying
|
|
834
786
|
}
|
|
835
|
-
),
|
|
836
|
-
|
|
787
|
+
) }),
|
|
788
|
+
/* @__PURE__ */ jsx(
|
|
789
|
+
AuthSubmitButton,
|
|
790
|
+
{
|
|
791
|
+
type: "button",
|
|
792
|
+
isLoading: isVerifying,
|
|
793
|
+
disabled: isVerifying || verificationCode.length !== 6,
|
|
794
|
+
onClick: () => {
|
|
795
|
+
void handleSubmit();
|
|
796
|
+
},
|
|
797
|
+
children: isVerifying ? "Verifying..." : "Continue"
|
|
798
|
+
}
|
|
799
|
+
)
|
|
837
800
|
] }),
|
|
838
|
-
/* @__PURE__ */
|
|
801
|
+
/* @__PURE__ */ jsxs("div", { className: "if-verificationStep-resendContainer", children: [
|
|
839
802
|
"Didn't receive the email?",
|
|
840
803
|
" ",
|
|
841
|
-
/* @__PURE__ */
|
|
804
|
+
/* @__PURE__ */ jsx(
|
|
842
805
|
"button",
|
|
843
806
|
{
|
|
844
807
|
onClick: () => {
|
|
845
808
|
void handleResend();
|
|
846
809
|
},
|
|
847
810
|
disabled: resendDisabled || isSending,
|
|
848
|
-
className: "
|
|
811
|
+
className: "if-verificationStep-resendButton",
|
|
849
812
|
children: isSending ? "Sending..." : resendDisabled ? `Retry in (${resendCountdown}s)` : "Click to resend"
|
|
850
813
|
}
|
|
851
814
|
)
|
|
@@ -864,7 +827,6 @@ function SignInForm({
|
|
|
864
827
|
availableProviders = [],
|
|
865
828
|
onOAuthClick,
|
|
866
829
|
authConfig,
|
|
867
|
-
appearance = {},
|
|
868
830
|
title = "Welcome Back",
|
|
869
831
|
subtitle = "Login to your account",
|
|
870
832
|
emailLabel = "Email",
|
|
@@ -879,143 +841,67 @@ function SignInForm({
|
|
|
879
841
|
signUpLinkText = "Sign Up Now",
|
|
880
842
|
signUpUrl = "/sign-up",
|
|
881
843
|
dividerText = "or",
|
|
882
|
-
// Email verification step props
|
|
883
844
|
showVerificationStep = false,
|
|
884
|
-
onVerifyCode
|
|
885
|
-
verificationDescription
|
|
845
|
+
onVerifyCode
|
|
886
846
|
}) {
|
|
887
|
-
return /* @__PURE__ */
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
847
|
+
return /* @__PURE__ */ jsxs(AuthContainer, { children: [
|
|
848
|
+
/* @__PURE__ */ jsx(
|
|
849
|
+
AuthHeader,
|
|
850
|
+
{
|
|
851
|
+
title: showVerificationStep ? "Verify Your Email" : title,
|
|
852
|
+
subtitle: showVerificationStep ? "" : subtitle
|
|
853
|
+
}
|
|
854
|
+
),
|
|
855
|
+
/* @__PURE__ */ jsx(AuthErrorBanner, { error: error || "" }),
|
|
856
|
+
showVerificationStep ? /* @__PURE__ */ jsx(AuthEmailVerificationStep, { email, onVerifyCode }) : /* @__PURE__ */ jsxs("form", { onSubmit, noValidate: true, className: "if-form if-internal-fm9k2p", children: [
|
|
857
|
+
/* @__PURE__ */ jsx(
|
|
858
|
+
AuthFormField,
|
|
859
|
+
{
|
|
860
|
+
id: "email",
|
|
861
|
+
type: "email",
|
|
862
|
+
label: emailLabel,
|
|
863
|
+
placeholder: emailPlaceholder,
|
|
864
|
+
value: email,
|
|
865
|
+
onChange: (e) => onEmailChange(e.target.value),
|
|
866
|
+
required: true,
|
|
867
|
+
autoComplete: "email"
|
|
868
|
+
}
|
|
869
|
+
),
|
|
870
|
+
/* @__PURE__ */ jsx(
|
|
871
|
+
AuthPasswordField,
|
|
872
|
+
{
|
|
873
|
+
id: "password",
|
|
874
|
+
label: passwordLabel,
|
|
875
|
+
placeholder: passwordPlaceholder,
|
|
876
|
+
value: password,
|
|
877
|
+
onChange: (e) => onPasswordChange(e.target.value),
|
|
878
|
+
required: true,
|
|
879
|
+
autoComplete: "current-password",
|
|
880
|
+
authConfig,
|
|
881
|
+
forgotPasswordLink: forgotPasswordUrl ? {
|
|
882
|
+
href: forgotPasswordUrl,
|
|
883
|
+
text: forgotPasswordText
|
|
884
|
+
} : void 0
|
|
885
|
+
}
|
|
886
|
+
),
|
|
887
|
+
/* @__PURE__ */ jsx(AuthSubmitButton, { isLoading: loading, disabled: loading || oauthLoading !== null, children: loading ? loadingButtonText : submitButtonText })
|
|
888
|
+
] }),
|
|
889
|
+
!showVerificationStep && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
890
|
+
/* @__PURE__ */ jsx(AuthLink, { text: signUpText, linkText: signUpLinkText, href: signUpUrl }),
|
|
891
|
+
availableProviders.length > 0 && onOAuthClick && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
892
|
+
/* @__PURE__ */ jsx(AuthDivider, { text: dividerText }),
|
|
893
|
+
/* @__PURE__ */ jsx(
|
|
894
|
+
AuthOAuthProviders,
|
|
923
895
|
{
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
929
|
-
AuthFormField,
|
|
930
|
-
{
|
|
931
|
-
id: "email",
|
|
932
|
-
type: "email",
|
|
933
|
-
label: emailLabel,
|
|
934
|
-
placeholder: emailPlaceholder,
|
|
935
|
-
value: email,
|
|
936
|
-
onChange: (e) => onEmailChange(e.target.value),
|
|
937
|
-
required: true,
|
|
938
|
-
autoComplete: "email",
|
|
939
|
-
appearance: {
|
|
940
|
-
containerClassName: appearance.form?.emailField?.container,
|
|
941
|
-
labelClassName: appearance.form?.emailField?.label,
|
|
942
|
-
inputClassName: appearance.form?.emailField?.input
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
),
|
|
946
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
947
|
-
AuthPasswordField,
|
|
948
|
-
{
|
|
949
|
-
id: "password",
|
|
950
|
-
label: passwordLabel,
|
|
951
|
-
placeholder: passwordPlaceholder,
|
|
952
|
-
value: password,
|
|
953
|
-
onChange: (e) => onPasswordChange(e.target.value),
|
|
954
|
-
required: true,
|
|
955
|
-
autoComplete: "current-password",
|
|
956
|
-
authConfig,
|
|
957
|
-
forgotPasswordLink: forgotPasswordUrl ? {
|
|
958
|
-
href: forgotPasswordUrl,
|
|
959
|
-
text: forgotPasswordText
|
|
960
|
-
} : void 0,
|
|
961
|
-
appearance: {
|
|
962
|
-
containerClassName: appearance.form?.passwordField?.container,
|
|
963
|
-
labelClassName: appearance.form?.passwordField?.label,
|
|
964
|
-
inputClassName: appearance.form?.passwordField?.input
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
),
|
|
968
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
969
|
-
AuthSubmitButton,
|
|
970
|
-
{
|
|
971
|
-
isLoading: loading,
|
|
972
|
-
disabled: loading || oauthLoading !== null,
|
|
973
|
-
className: appearance.button,
|
|
974
|
-
children: loading ? loadingButtonText : submitButtonText
|
|
975
|
-
}
|
|
976
|
-
)
|
|
977
|
-
]
|
|
896
|
+
providers: availableProviders,
|
|
897
|
+
onClick: onOAuthClick,
|
|
898
|
+
disabled: loading || oauthLoading !== null,
|
|
899
|
+
loading: oauthLoading
|
|
978
900
|
}
|
|
979
|
-
)
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
{
|
|
984
|
-
text: signUpText,
|
|
985
|
-
linkText: signUpLinkText,
|
|
986
|
-
href: signUpUrl,
|
|
987
|
-
appearance: {
|
|
988
|
-
containerClassName: appearance.link?.container,
|
|
989
|
-
linkClassName: appearance.link?.link
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
),
|
|
993
|
-
availableProviders.length > 0 && onOAuthClick && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
994
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
995
|
-
AuthDivider,
|
|
996
|
-
{
|
|
997
|
-
text: dividerText,
|
|
998
|
-
className: appearance.divider
|
|
999
|
-
}
|
|
1000
|
-
),
|
|
1001
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1002
|
-
AuthOAuthProviders,
|
|
1003
|
-
{
|
|
1004
|
-
providers: availableProviders,
|
|
1005
|
-
onClick: onOAuthClick,
|
|
1006
|
-
disabled: loading || oauthLoading !== null,
|
|
1007
|
-
loading: oauthLoading,
|
|
1008
|
-
appearance: {
|
|
1009
|
-
containerClassName: appearance.oauth?.container,
|
|
1010
|
-
buttonClassName: appearance.oauth?.button
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
)
|
|
1014
|
-
] })
|
|
1015
|
-
] })
|
|
1016
|
-
]
|
|
1017
|
-
}
|
|
1018
|
-
);
|
|
901
|
+
)
|
|
902
|
+
] })
|
|
903
|
+
] })
|
|
904
|
+
] });
|
|
1019
905
|
}
|
|
1020
906
|
function SignUpForm({
|
|
1021
907
|
email,
|
|
@@ -1029,7 +915,6 @@ function SignUpForm({
|
|
|
1029
915
|
availableProviders = [],
|
|
1030
916
|
onOAuthClick,
|
|
1031
917
|
authConfig,
|
|
1032
|
-
appearance = {},
|
|
1033
918
|
title = "Get Started",
|
|
1034
919
|
subtitle = "Create your account",
|
|
1035
920
|
emailLabel = "Email",
|
|
@@ -1042,141 +927,65 @@ function SignUpForm({
|
|
|
1042
927
|
signInLinkText = "Login Now",
|
|
1043
928
|
signInUrl = "/sign-in",
|
|
1044
929
|
dividerText = "or",
|
|
1045
|
-
// Email verification step props
|
|
1046
930
|
showVerificationStep = false,
|
|
1047
|
-
onVerifyCode
|
|
1048
|
-
verificationDescription
|
|
931
|
+
onVerifyCode
|
|
1049
932
|
}) {
|
|
1050
|
-
return /* @__PURE__ */
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
933
|
+
return /* @__PURE__ */ jsxs(AuthContainer, { children: [
|
|
934
|
+
/* @__PURE__ */ jsx(
|
|
935
|
+
AuthHeader,
|
|
936
|
+
{
|
|
937
|
+
title: showVerificationStep ? "Verify Your Email" : title,
|
|
938
|
+
subtitle: showVerificationStep ? "" : subtitle
|
|
939
|
+
}
|
|
940
|
+
),
|
|
941
|
+
/* @__PURE__ */ jsx(AuthErrorBanner, { error: error || "" }),
|
|
942
|
+
showVerificationStep ? /* @__PURE__ */ jsx(AuthEmailVerificationStep, { email, onVerifyCode }) : /* @__PURE__ */ jsxs("form", { onSubmit, noValidate: true, className: "if-form if-internal-fm9k2p", children: [
|
|
943
|
+
/* @__PURE__ */ jsx(
|
|
944
|
+
AuthFormField,
|
|
945
|
+
{
|
|
946
|
+
id: "email",
|
|
947
|
+
type: "email",
|
|
948
|
+
label: emailLabel,
|
|
949
|
+
placeholder: emailPlaceholder,
|
|
950
|
+
value: email,
|
|
951
|
+
onChange: (e) => onEmailChange(e.target.value),
|
|
952
|
+
required: true,
|
|
953
|
+
autoComplete: "email"
|
|
954
|
+
}
|
|
955
|
+
),
|
|
956
|
+
/* @__PURE__ */ jsx(
|
|
957
|
+
AuthPasswordField,
|
|
958
|
+
{
|
|
959
|
+
id: "password",
|
|
960
|
+
label: passwordLabel,
|
|
961
|
+
placeholder: passwordPlaceholder,
|
|
962
|
+
value: password,
|
|
963
|
+
onChange: (e) => onPasswordChange(e.target.value),
|
|
964
|
+
required: true,
|
|
965
|
+
minLength: authConfig.passwordMinLength,
|
|
966
|
+
autoComplete: "new-password",
|
|
967
|
+
showStrengthIndicator: true,
|
|
968
|
+
authConfig
|
|
969
|
+
}
|
|
970
|
+
),
|
|
971
|
+
/* @__PURE__ */ jsx(AuthSubmitButton, { isLoading: loading, disabled: loading || oauthLoading !== null, children: loading ? loadingButtonText : submitButtonText })
|
|
972
|
+
] }),
|
|
973
|
+
!showVerificationStep && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
974
|
+
/* @__PURE__ */ jsx(AuthLink, { text: signInText, linkText: signInLinkText, href: signInUrl }),
|
|
975
|
+
availableProviders.length > 0 && onOAuthClick && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
976
|
+
/* @__PURE__ */ jsx(AuthDivider, { text: dividerText }),
|
|
977
|
+
/* @__PURE__ */ jsx(
|
|
978
|
+
AuthOAuthProviders,
|
|
1086
979
|
{
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1092
|
-
AuthFormField,
|
|
1093
|
-
{
|
|
1094
|
-
id: "email",
|
|
1095
|
-
type: "email",
|
|
1096
|
-
label: emailLabel,
|
|
1097
|
-
placeholder: emailPlaceholder,
|
|
1098
|
-
value: email,
|
|
1099
|
-
onChange: (e) => onEmailChange(e.target.value),
|
|
1100
|
-
required: true,
|
|
1101
|
-
autoComplete: "email",
|
|
1102
|
-
appearance: {
|
|
1103
|
-
containerClassName: appearance.form?.emailField?.container,
|
|
1104
|
-
labelClassName: appearance.form?.emailField?.label,
|
|
1105
|
-
inputClassName: appearance.form?.emailField?.input
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
),
|
|
1109
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1110
|
-
AuthPasswordField,
|
|
1111
|
-
{
|
|
1112
|
-
id: "password",
|
|
1113
|
-
label: passwordLabel,
|
|
1114
|
-
placeholder: passwordPlaceholder,
|
|
1115
|
-
value: password,
|
|
1116
|
-
onChange: (e) => onPasswordChange(e.target.value),
|
|
1117
|
-
required: true,
|
|
1118
|
-
minLength: authConfig.passwordMinLength,
|
|
1119
|
-
autoComplete: "new-password",
|
|
1120
|
-
showStrengthIndicator: true,
|
|
1121
|
-
authConfig,
|
|
1122
|
-
appearance: {
|
|
1123
|
-
containerClassName: appearance.form?.passwordField?.container,
|
|
1124
|
-
labelClassName: appearance.form?.passwordField?.label,
|
|
1125
|
-
inputClassName: appearance.form?.passwordField?.input
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
),
|
|
1129
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1130
|
-
AuthSubmitButton,
|
|
1131
|
-
{
|
|
1132
|
-
isLoading: loading,
|
|
1133
|
-
disabled: loading || oauthLoading !== null,
|
|
1134
|
-
className: appearance.button,
|
|
1135
|
-
children: loading ? loadingButtonText : submitButtonText
|
|
1136
|
-
}
|
|
1137
|
-
)
|
|
1138
|
-
]
|
|
980
|
+
providers: availableProviders,
|
|
981
|
+
onClick: onOAuthClick,
|
|
982
|
+
disabled: loading || oauthLoading !== null,
|
|
983
|
+
loading: oauthLoading
|
|
1139
984
|
}
|
|
1140
|
-
)
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
{
|
|
1145
|
-
text: signInText,
|
|
1146
|
-
linkText: signInLinkText,
|
|
1147
|
-
href: signInUrl,
|
|
1148
|
-
appearance: {
|
|
1149
|
-
containerClassName: appearance.link?.container,
|
|
1150
|
-
linkClassName: appearance.link?.link
|
|
1151
|
-
}
|
|
1152
|
-
}
|
|
1153
|
-
),
|
|
1154
|
-
availableProviders.length > 0 && onOAuthClick && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1155
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1156
|
-
AuthDivider,
|
|
1157
|
-
{
|
|
1158
|
-
text: dividerText,
|
|
1159
|
-
className: appearance.divider
|
|
1160
|
-
}
|
|
1161
|
-
),
|
|
1162
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1163
|
-
AuthOAuthProviders,
|
|
1164
|
-
{
|
|
1165
|
-
providers: availableProviders,
|
|
1166
|
-
onClick: onOAuthClick,
|
|
1167
|
-
disabled: loading || oauthLoading !== null,
|
|
1168
|
-
loading: oauthLoading,
|
|
1169
|
-
appearance: {
|
|
1170
|
-
containerClassName: appearance.oauth?.container,
|
|
1171
|
-
buttonClassName: appearance.oauth?.button
|
|
1172
|
-
}
|
|
1173
|
-
}
|
|
1174
|
-
)
|
|
1175
|
-
] })
|
|
1176
|
-
] })
|
|
1177
|
-
]
|
|
1178
|
-
}
|
|
1179
|
-
);
|
|
985
|
+
)
|
|
986
|
+
] })
|
|
987
|
+
] })
|
|
988
|
+
] });
|
|
1180
989
|
}
|
|
1181
990
|
function ForgotPasswordForm({
|
|
1182
991
|
email,
|
|
@@ -1184,8 +993,6 @@ function ForgotPasswordForm({
|
|
|
1184
993
|
onSubmit,
|
|
1185
994
|
error,
|
|
1186
995
|
loading = false,
|
|
1187
|
-
success = false,
|
|
1188
|
-
appearance = {},
|
|
1189
996
|
title = "Forgot Password?",
|
|
1190
997
|
subtitle = "Enter your email address and we'll send you a code to reset your password.",
|
|
1191
998
|
emailLabel = "Email",
|
|
@@ -1194,105 +1001,47 @@ function ForgotPasswordForm({
|
|
|
1194
1001
|
loadingButtonText = "Sending...",
|
|
1195
1002
|
backToSignInText = "Remember your password?",
|
|
1196
1003
|
backToSignInUrl = "/sign-in",
|
|
1197
|
-
|
|
1198
|
-
|
|
1004
|
+
showVerificationStep = false,
|
|
1005
|
+
resetPasswordMethod = "code",
|
|
1006
|
+
onVerifyCode,
|
|
1007
|
+
onResendEmail
|
|
1199
1008
|
}) {
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1009
|
+
return /* @__PURE__ */ jsxs(AuthContainer, { children: [
|
|
1010
|
+
/* @__PURE__ */ jsx(
|
|
1011
|
+
AuthHeader,
|
|
1203
1012
|
{
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
cardClassName: appearance.card
|
|
1207
|
-
},
|
|
1208
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-4", children: [
|
|
1209
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-16 h-16 rounded-full bg-green-100 dark:bg-green-900 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-8 h-8 text-green-600 dark:text-green-400", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 13l4 4L19 7" }) }) }),
|
|
1210
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-semibold text-black dark:text-white text-center", children: successTitle }),
|
|
1211
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-neutral-600 dark:text-neutral-400 text-center", children: successMessage || `We've sent a password reset link to ${email}. Please check your email and follow the instructions.` }),
|
|
1212
|
-
/* @__PURE__ */ jsxRuntime.jsx("a", { href: backToSignInUrl, className: "mt-4 text-black dark:text-white font-medium", children: "Back to Sign In" })
|
|
1213
|
-
] })
|
|
1013
|
+
title: showVerificationStep ? resetPasswordMethod === "link" ? "Check Your Email" : "Enter Reset Code" : title,
|
|
1014
|
+
subtitle: showVerificationStep ? "" : subtitle
|
|
1214
1015
|
}
|
|
1215
|
-
)
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1245
|
-
"form",
|
|
1246
|
-
{
|
|
1247
|
-
onSubmit,
|
|
1248
|
-
noValidate: true,
|
|
1249
|
-
className: appearance.form?.container || "flex flex-col items-stretch justify-center gap-6",
|
|
1250
|
-
children: [
|
|
1251
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1252
|
-
AuthFormField,
|
|
1253
|
-
{
|
|
1254
|
-
id: "email",
|
|
1255
|
-
type: "email",
|
|
1256
|
-
label: emailLabel,
|
|
1257
|
-
placeholder: emailPlaceholder,
|
|
1258
|
-
value: email,
|
|
1259
|
-
onChange: (e) => onEmailChange(e.target.value),
|
|
1260
|
-
required: true,
|
|
1261
|
-
autoComplete: "email",
|
|
1262
|
-
appearance: {
|
|
1263
|
-
containerClassName: appearance.form?.emailField?.container,
|
|
1264
|
-
labelClassName: appearance.form?.emailField?.label,
|
|
1265
|
-
inputClassName: appearance.form?.emailField?.input
|
|
1266
|
-
}
|
|
1267
|
-
}
|
|
1268
|
-
),
|
|
1269
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1270
|
-
AuthSubmitButton,
|
|
1271
|
-
{
|
|
1272
|
-
isLoading: loading,
|
|
1273
|
-
disabled: loading,
|
|
1274
|
-
className: appearance.button,
|
|
1275
|
-
children: loading ? loadingButtonText : submitButtonText
|
|
1276
|
-
}
|
|
1277
|
-
)
|
|
1278
|
-
]
|
|
1279
|
-
}
|
|
1280
|
-
),
|
|
1281
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1282
|
-
AuthLink,
|
|
1283
|
-
{
|
|
1284
|
-
text: backToSignInText,
|
|
1285
|
-
linkText: "Back to Sign In",
|
|
1286
|
-
href: backToSignInUrl,
|
|
1287
|
-
appearance: {
|
|
1288
|
-
containerClassName: appearance.link?.container,
|
|
1289
|
-
linkClassName: appearance.link?.link
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
)
|
|
1293
|
-
]
|
|
1294
|
-
}
|
|
1295
|
-
);
|
|
1016
|
+
),
|
|
1017
|
+
/* @__PURE__ */ jsx(AuthErrorBanner, { error: error || "" }),
|
|
1018
|
+
showVerificationStep ? /* @__PURE__ */ jsx(
|
|
1019
|
+
AuthResetPasswordVerificationStep,
|
|
1020
|
+
{
|
|
1021
|
+
email,
|
|
1022
|
+
method: resetPasswordMethod,
|
|
1023
|
+
onVerifyCode,
|
|
1024
|
+
onResendEmail: onResendEmail || (async () => {
|
|
1025
|
+
})
|
|
1026
|
+
}
|
|
1027
|
+
) : /* @__PURE__ */ jsxs("form", { onSubmit, noValidate: true, className: "if-form if-internal-fm9k2p", children: [
|
|
1028
|
+
/* @__PURE__ */ jsx(
|
|
1029
|
+
AuthFormField,
|
|
1030
|
+
{
|
|
1031
|
+
id: "email",
|
|
1032
|
+
type: "email",
|
|
1033
|
+
label: emailLabel,
|
|
1034
|
+
placeholder: emailPlaceholder,
|
|
1035
|
+
value: email,
|
|
1036
|
+
onChange: (e) => onEmailChange(e.target.value),
|
|
1037
|
+
required: true,
|
|
1038
|
+
autoComplete: "email"
|
|
1039
|
+
}
|
|
1040
|
+
),
|
|
1041
|
+
/* @__PURE__ */ jsx(AuthSubmitButton, { isLoading: loading, disabled: loading, children: loading ? loadingButtonText : submitButtonText })
|
|
1042
|
+
] }),
|
|
1043
|
+
!showVerificationStep && /* @__PURE__ */ jsx(AuthLink, { text: backToSignInText, linkText: "Back to Sign In", href: backToSignInUrl })
|
|
1044
|
+
] });
|
|
1296
1045
|
}
|
|
1297
1046
|
function ResetPasswordForm({
|
|
1298
1047
|
newPassword,
|
|
@@ -1304,7 +1053,6 @@ function ResetPasswordForm({
|
|
|
1304
1053
|
loading = false,
|
|
1305
1054
|
success = false,
|
|
1306
1055
|
authConfig,
|
|
1307
|
-
appearance = {},
|
|
1308
1056
|
title = "Reset Password",
|
|
1309
1057
|
subtitle = "Enter your new password below.",
|
|
1310
1058
|
newPasswordLabel = "New Password",
|
|
@@ -1313,162 +1061,128 @@ function ResetPasswordForm({
|
|
|
1313
1061
|
confirmPasswordPlaceholder = "\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
1314
1062
|
submitButtonText = "Reset Password",
|
|
1315
1063
|
loadingButtonText = "Resetting...",
|
|
1316
|
-
|
|
1317
|
-
backToSignInUrl = "/sign-in",
|
|
1318
|
-
successTitle = "Password Reset Successful!",
|
|
1319
|
-
successMessage = "Your password has been successfully reset. You can now sign in with your new password."
|
|
1064
|
+
successTitle = "Password Reset Successful!"
|
|
1320
1065
|
}) {
|
|
1066
|
+
let successMessage = "Your password has been successfully reset. You can close this page and sign in with your new password.";
|
|
1067
|
+
if (authConfig && authConfig.verifyEmailMethod === "code") {
|
|
1068
|
+
successMessage = "Your password has been successfully reset. You can wait for redirect to sign in with your new password.";
|
|
1069
|
+
}
|
|
1321
1070
|
if (success) {
|
|
1322
|
-
return /* @__PURE__ */
|
|
1323
|
-
|
|
1071
|
+
return /* @__PURE__ */ jsx(AuthContainer, { children: /* @__PURE__ */ jsxs(
|
|
1072
|
+
"div",
|
|
1324
1073
|
{
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
appearance: {
|
|
1342
|
-
containerClassName: appearance.container,
|
|
1343
|
-
cardClassName: appearance.card
|
|
1344
|
-
},
|
|
1345
|
-
children: [
|
|
1346
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1347
|
-
AuthHeader,
|
|
1348
|
-
{
|
|
1349
|
-
title,
|
|
1350
|
-
subtitle,
|
|
1351
|
-
appearance: {
|
|
1352
|
-
containerClassName: appearance.header?.container,
|
|
1353
|
-
titleClassName: appearance.header?.title,
|
|
1354
|
-
subtitleClassName: appearance.header?.subtitle
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
),
|
|
1358
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1359
|
-
AuthErrorBanner,
|
|
1360
|
-
{
|
|
1361
|
-
error: error || "",
|
|
1362
|
-
className: appearance.errorBanner
|
|
1363
|
-
}
|
|
1364
|
-
),
|
|
1365
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1366
|
-
"form",
|
|
1367
|
-
{
|
|
1368
|
-
onSubmit,
|
|
1369
|
-
noValidate: true,
|
|
1370
|
-
className: appearance.form?.container || "flex flex-col items-stretch justify-center gap-6",
|
|
1371
|
-
children: [
|
|
1372
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1373
|
-
AuthPasswordField,
|
|
1374
|
-
{
|
|
1375
|
-
id: "newPassword",
|
|
1376
|
-
label: newPasswordLabel,
|
|
1377
|
-
placeholder: newPasswordPlaceholder,
|
|
1378
|
-
value: newPassword,
|
|
1379
|
-
onChange: (e) => onNewPasswordChange(e.target.value),
|
|
1380
|
-
required: true,
|
|
1381
|
-
autoComplete: "new-password",
|
|
1382
|
-
showStrengthIndicator: true,
|
|
1383
|
-
authConfig,
|
|
1384
|
-
appearance: {
|
|
1385
|
-
containerClassName: appearance.form?.newPasswordField?.container,
|
|
1386
|
-
labelClassName: appearance.form?.newPasswordField?.label,
|
|
1387
|
-
inputClassName: appearance.form?.newPasswordField?.input
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
),
|
|
1391
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1392
|
-
AuthPasswordField,
|
|
1393
|
-
{
|
|
1394
|
-
id: "confirmPassword",
|
|
1395
|
-
label: confirmPasswordLabel,
|
|
1396
|
-
placeholder: confirmPasswordPlaceholder,
|
|
1397
|
-
value: confirmPassword,
|
|
1398
|
-
onChange: (e) => onConfirmPasswordChange(e.target.value),
|
|
1399
|
-
required: true,
|
|
1400
|
-
autoComplete: "new-password",
|
|
1401
|
-
authConfig,
|
|
1402
|
-
appearance: {
|
|
1403
|
-
containerClassName: appearance.form?.confirmPasswordField?.container,
|
|
1404
|
-
labelClassName: appearance.form?.confirmPasswordField?.label,
|
|
1405
|
-
inputClassName: appearance.form?.confirmPasswordField?.input
|
|
1406
|
-
}
|
|
1407
|
-
}
|
|
1408
|
-
),
|
|
1409
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1410
|
-
AuthSubmitButton,
|
|
1074
|
+
style: { display: "flex", flexDirection: "column", alignItems: "center", gap: "1rem" },
|
|
1075
|
+
children: [
|
|
1076
|
+
/* @__PURE__ */ jsx(
|
|
1077
|
+
"div",
|
|
1078
|
+
{
|
|
1079
|
+
style: {
|
|
1080
|
+
width: "4rem",
|
|
1081
|
+
height: "4rem",
|
|
1082
|
+
borderRadius: "50%",
|
|
1083
|
+
backgroundColor: "#D1FAE5",
|
|
1084
|
+
display: "flex",
|
|
1085
|
+
alignItems: "center",
|
|
1086
|
+
justifyContent: "center"
|
|
1087
|
+
},
|
|
1088
|
+
children: /* @__PURE__ */ jsx(
|
|
1089
|
+
"svg",
|
|
1411
1090
|
{
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1091
|
+
style: { width: "2rem", height: "2rem", color: "#059669" },
|
|
1092
|
+
fill: "none",
|
|
1093
|
+
strokeLinecap: "round",
|
|
1094
|
+
strokeLinejoin: "round",
|
|
1095
|
+
strokeWidth: "2",
|
|
1096
|
+
viewBox: "0 0 24 24",
|
|
1097
|
+
stroke: "currentColor",
|
|
1098
|
+
children: /* @__PURE__ */ jsx("path", { d: "M5 13l4 4L19 7" })
|
|
1416
1099
|
}
|
|
1417
1100
|
)
|
|
1418
|
-
]
|
|
1419
|
-
}
|
|
1420
|
-
),
|
|
1421
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1422
|
-
AuthLink,
|
|
1423
|
-
{
|
|
1424
|
-
text: backToSignInText,
|
|
1425
|
-
linkText: "Back to Sign In",
|
|
1426
|
-
href: backToSignInUrl,
|
|
1427
|
-
appearance: {
|
|
1428
|
-
containerClassName: appearance.link?.container,
|
|
1429
|
-
linkClassName: appearance.link?.link
|
|
1430
1101
|
}
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1102
|
+
),
|
|
1103
|
+
/* @__PURE__ */ jsx("h2", { className: "if-authHeader-title", style: { textAlign: "center" }, children: successTitle }),
|
|
1104
|
+
/* @__PURE__ */ jsx("p", { className: "if-authHeader-subtitle", style: { textAlign: "center" }, children: successMessage })
|
|
1105
|
+
]
|
|
1106
|
+
}
|
|
1107
|
+
) });
|
|
1108
|
+
}
|
|
1109
|
+
return /* @__PURE__ */ jsxs(AuthContainer, { children: [
|
|
1110
|
+
/* @__PURE__ */ jsx(AuthHeader, { title, subtitle }),
|
|
1111
|
+
/* @__PURE__ */ jsx(AuthErrorBanner, { error: error || "" }),
|
|
1112
|
+
/* @__PURE__ */ jsxs("form", { onSubmit, noValidate: true, className: "if-form if-internal-fm9k2p", children: [
|
|
1113
|
+
/* @__PURE__ */ jsx(
|
|
1114
|
+
AuthPasswordField,
|
|
1115
|
+
{
|
|
1116
|
+
id: "newPassword",
|
|
1117
|
+
label: newPasswordLabel,
|
|
1118
|
+
placeholder: newPasswordPlaceholder,
|
|
1119
|
+
value: newPassword,
|
|
1120
|
+
onChange: (e) => onNewPasswordChange(e.target.value),
|
|
1121
|
+
required: true,
|
|
1122
|
+
autoComplete: "new-password",
|
|
1123
|
+
showStrengthIndicator: true,
|
|
1124
|
+
authConfig
|
|
1125
|
+
}
|
|
1126
|
+
),
|
|
1127
|
+
/* @__PURE__ */ jsx(
|
|
1128
|
+
AuthPasswordField,
|
|
1129
|
+
{
|
|
1130
|
+
id: "confirmPassword",
|
|
1131
|
+
label: confirmPasswordLabel,
|
|
1132
|
+
placeholder: confirmPasswordPlaceholder,
|
|
1133
|
+
value: confirmPassword,
|
|
1134
|
+
onChange: (e) => onConfirmPasswordChange(e.target.value),
|
|
1135
|
+
required: true,
|
|
1136
|
+
autoComplete: "new-password",
|
|
1137
|
+
authConfig
|
|
1138
|
+
}
|
|
1139
|
+
),
|
|
1140
|
+
/* @__PURE__ */ jsx(AuthSubmitButton, { isLoading: loading, disabled: loading, children: loading ? loadingButtonText : submitButtonText })
|
|
1141
|
+
] })
|
|
1142
|
+
] });
|
|
1436
1143
|
}
|
|
1437
1144
|
function VerifyEmailStatus({
|
|
1438
1145
|
status,
|
|
1439
1146
|
error,
|
|
1440
|
-
appearance = {},
|
|
1441
1147
|
verifyingTitle = "Verifying your email...",
|
|
1442
1148
|
successTitle = "Email Verified!",
|
|
1443
|
-
successMessage = "Your email has been verified successfully. You can close this page and
|
|
1149
|
+
successMessage = "Your email has been verified successfully. You can close this page and sign in to your app.",
|
|
1444
1150
|
errorTitle = "Verification Failed"
|
|
1445
1151
|
}) {
|
|
1446
1152
|
if (status === "verifying") {
|
|
1447
|
-
return /* @__PURE__ */
|
|
1448
|
-
/* @__PURE__ */
|
|
1449
|
-
/* @__PURE__ */
|
|
1153
|
+
return /* @__PURE__ */ jsx(AuthContainer, { children: /* @__PURE__ */ jsxs("div", { className: "if-verifyStatus-container", children: [
|
|
1154
|
+
/* @__PURE__ */ jsx("h2", { className: "if-authHeader-title", children: verifyingTitle }),
|
|
1155
|
+
/* @__PURE__ */ jsx("div", { className: "if-submitButton-spinner if-verifyStatus-spinner" })
|
|
1450
1156
|
] }) });
|
|
1451
1157
|
}
|
|
1452
1158
|
if (status === "error") {
|
|
1453
|
-
return /* @__PURE__ */
|
|
1454
|
-
/* @__PURE__ */
|
|
1455
|
-
/* @__PURE__ */
|
|
1159
|
+
return /* @__PURE__ */ jsx(AuthContainer, { children: /* @__PURE__ */ jsx("div", { className: "if-verifyStatus-container-stretch", children: /* @__PURE__ */ jsxs("div", { className: "if-authHeader if-internal-h3m7w5", children: [
|
|
1160
|
+
/* @__PURE__ */ jsx("h1", { className: "if-authHeader-title if-internal-t4p1k9", children: errorTitle }),
|
|
1161
|
+
/* @__PURE__ */ jsxs("p", { className: "if-authHeader-subtitle if-internal-s7q2m3", children: [
|
|
1456
1162
|
error || "The verification link is invalid or has expired.",
|
|
1457
1163
|
" Please try again or contact support if the problem persists. You can close this page and return to your app."
|
|
1458
1164
|
] })
|
|
1459
1165
|
] }) }) });
|
|
1460
1166
|
}
|
|
1461
|
-
return /* @__PURE__ */
|
|
1462
|
-
/* @__PURE__ */
|
|
1463
|
-
|
|
1464
|
-
|
|
1167
|
+
return /* @__PURE__ */ jsx(AuthContainer, { children: /* @__PURE__ */ jsx("div", { className: "if-verifyStatus-container-stretch", children: /* @__PURE__ */ jsxs("div", { className: "if-verifyStatus-successContent", children: [
|
|
1168
|
+
/* @__PURE__ */ jsx("div", { className: "if-verifyStatus-successIcon", children: /* @__PURE__ */ jsx(
|
|
1169
|
+
"svg",
|
|
1170
|
+
{
|
|
1171
|
+
className: "if-verifyStatus-successIconSvg",
|
|
1172
|
+
fill: "none",
|
|
1173
|
+
strokeLinecap: "round",
|
|
1174
|
+
strokeLinejoin: "round",
|
|
1175
|
+
strokeWidth: "2",
|
|
1176
|
+
viewBox: "0 0 24 24",
|
|
1177
|
+
stroke: "currentColor",
|
|
1178
|
+
children: /* @__PURE__ */ jsx("path", { d: "M5 13l4 4L19 7" })
|
|
1179
|
+
}
|
|
1180
|
+
) }),
|
|
1181
|
+
/* @__PURE__ */ jsx("h2", { className: "if-authHeader-title if-verifyStatus-textCenter", children: successTitle }),
|
|
1182
|
+
/* @__PURE__ */ jsx("p", { className: "if-authHeader-subtitle if-verifyStatus-textCenter", children: successMessage })
|
|
1465
1183
|
] }) }) });
|
|
1466
1184
|
}
|
|
1467
1185
|
|
|
1468
|
-
|
|
1469
|
-
exports.ResetPasswordForm = ResetPasswordForm;
|
|
1470
|
-
exports.SignInForm = SignInForm;
|
|
1471
|
-
exports.SignUpForm = SignUpForm;
|
|
1472
|
-
exports.VerifyEmailStatus = VerifyEmailStatus;
|
|
1186
|
+
export { ForgotPasswordForm, ResetPasswordForm, SignInForm, SignUpForm, VerifyEmailStatus };
|
|
1473
1187
|
//# sourceMappingURL=forms.js.map
|
|
1474
1188
|
//# sourceMappingURL=forms.js.map
|