@insforge/react 0.3.0 → 0.3.1
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/dist/atoms.d.mts +3 -3
- package/dist/atoms.d.ts +3 -3
- package/dist/atoms.js +22 -23
- package/dist/atoms.js.map +1 -1
- package/dist/atoms.mjs +22 -23
- package/dist/atoms.mjs.map +1 -1
- package/dist/components.js +130 -108
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +130 -108
- package/dist/components.mjs.map +1 -1
- package/dist/forms.d.mts +2 -2
- package/dist/forms.d.ts +2 -2
- package/dist/forms.js +316 -73
- package/dist/forms.js.map +1 -1
- package/dist/forms.mjs +317 -74
- package/dist/forms.mjs.map +1 -1
- package/dist/index.js +131 -109
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +131 -109
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types.d.mts +11 -1
- package/dist/types.d.ts +11 -1
- package/package.json +1 -1
package/dist/components.mjs
CHANGED
|
@@ -766,7 +766,6 @@ function AuthVerificationCodeInput({
|
|
|
766
766
|
}
|
|
767
767
|
function AuthEmailVerificationStep({
|
|
768
768
|
email,
|
|
769
|
-
title = "Verify Your Email",
|
|
770
769
|
description,
|
|
771
770
|
method = "code",
|
|
772
771
|
onVerifyCode
|
|
@@ -843,29 +842,29 @@ function AuthEmailVerificationStep({
|
|
|
843
842
|
}
|
|
844
843
|
};
|
|
845
844
|
const displayDescription = description || defaultDescription;
|
|
846
|
-
return /* @__PURE__ */ jsxs("div", { className: "
|
|
847
|
-
/* @__PURE__ */
|
|
848
|
-
|
|
849
|
-
/* @__PURE__ */ jsx("
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
845
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 items-stretch", children: [
|
|
846
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-neutral-600 dark:text-neutral-400 leading-relaxed", children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxs("span", { children: [
|
|
847
|
+
part,
|
|
848
|
+
index < array.length - 1 && /* @__PURE__ */ jsx("span", { className: "font-medium text-black dark:text-white", children: email })
|
|
849
|
+
] }, index)) }),
|
|
850
|
+
verificationError && /* @__PURE__ */ jsx("div", { className: "pl-3 py-2 pr-2 bg-red-50 border-2 border-red-600 rounded", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
851
|
+
/* @__PURE__ */ jsx("svg", { className: "w-6 h-6 text-red-500 shrink-0", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
|
|
852
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-red-600 flex-1", children: verificationError })
|
|
853
|
+
] }) }),
|
|
854
|
+
method === "code" && /* @__PURE__ */ 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: [
|
|
855
|
+
/* @__PURE__ */ jsx(
|
|
856
|
+
AuthVerificationCodeInput,
|
|
857
|
+
{
|
|
858
|
+
value: verificationCode,
|
|
859
|
+
onChange: setVerificationCode,
|
|
860
|
+
email,
|
|
861
|
+
disabled: isVerifying,
|
|
862
|
+
onComplete: (code) => {
|
|
863
|
+
void handleVerifyCode(code);
|
|
864
864
|
}
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
] })
|
|
865
|
+
}
|
|
866
|
+
),
|
|
867
|
+
isVerifying && /* @__PURE__ */ jsx("p", { className: "text-sm text-neutral-600 dark:text-neutral-400 text-center", children: "Verifying..." })
|
|
869
868
|
] }),
|
|
870
869
|
/* @__PURE__ */ jsxs("div", { className: "w-full text-sm text-center text-neutral-600 dark:text-neutral-400", children: [
|
|
871
870
|
"Didn't receive the email?",
|
|
@@ -910,7 +909,11 @@ function SignInForm({
|
|
|
910
909
|
signUpText = "Don't have an account?",
|
|
911
910
|
signUpLinkText = "Sign Up Now",
|
|
912
911
|
signUpUrl = "/sign-up",
|
|
913
|
-
dividerText = "or"
|
|
912
|
+
dividerText = "or",
|
|
913
|
+
// Email verification step props
|
|
914
|
+
showVerificationStep = false,
|
|
915
|
+
onVerifyCode,
|
|
916
|
+
verificationDescription
|
|
914
917
|
}) {
|
|
915
918
|
return /* @__PURE__ */ jsxs(
|
|
916
919
|
AuthContainer,
|
|
@@ -923,8 +926,8 @@ function SignInForm({
|
|
|
923
926
|
/* @__PURE__ */ jsx(
|
|
924
927
|
AuthHeader,
|
|
925
928
|
{
|
|
926
|
-
title,
|
|
927
|
-
subtitle,
|
|
929
|
+
title: showVerificationStep ? "Verify Your Email" : title,
|
|
930
|
+
subtitle: showVerificationStep ? "" : subtitle,
|
|
928
931
|
appearance: {
|
|
929
932
|
containerClassName: appearance.header?.container,
|
|
930
933
|
titleClassName: appearance.header?.title,
|
|
@@ -939,7 +942,14 @@ function SignInForm({
|
|
|
939
942
|
className: appearance.errorBanner
|
|
940
943
|
}
|
|
941
944
|
),
|
|
942
|
-
/* @__PURE__ */
|
|
945
|
+
showVerificationStep ? /* @__PURE__ */ jsx(
|
|
946
|
+
AuthEmailVerificationStep,
|
|
947
|
+
{
|
|
948
|
+
email,
|
|
949
|
+
description: verificationDescription,
|
|
950
|
+
onVerifyCode
|
|
951
|
+
}
|
|
952
|
+
) : /* @__PURE__ */ jsxs(
|
|
943
953
|
"form",
|
|
944
954
|
{
|
|
945
955
|
onSubmit,
|
|
@@ -998,39 +1008,41 @@ function SignInForm({
|
|
|
998
1008
|
]
|
|
999
1009
|
}
|
|
1000
1010
|
),
|
|
1001
|
-
/* @__PURE__ */
|
|
1002
|
-
AuthLink,
|
|
1003
|
-
{
|
|
1004
|
-
text: signUpText,
|
|
1005
|
-
linkText: signUpLinkText,
|
|
1006
|
-
href: signUpUrl,
|
|
1007
|
-
appearance: {
|
|
1008
|
-
containerClassName: appearance.link?.container,
|
|
1009
|
-
linkClassName: appearance.link?.link
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1012
|
-
),
|
|
1013
|
-
availableProviders.length > 0 && onOAuthClick && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1011
|
+
!showVerificationStep && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1014
1012
|
/* @__PURE__ */ jsx(
|
|
1015
|
-
|
|
1013
|
+
AuthLink,
|
|
1016
1014
|
{
|
|
1017
|
-
text:
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
),
|
|
1021
|
-
/* @__PURE__ */ jsx(
|
|
1022
|
-
AuthOAuthProviders,
|
|
1023
|
-
{
|
|
1024
|
-
providers: availableProviders,
|
|
1025
|
-
onClick: onOAuthClick,
|
|
1026
|
-
disabled: loading || oauthLoading !== null,
|
|
1027
|
-
loading: oauthLoading,
|
|
1015
|
+
text: signUpText,
|
|
1016
|
+
linkText: signUpLinkText,
|
|
1017
|
+
href: signUpUrl,
|
|
1028
1018
|
appearance: {
|
|
1029
|
-
containerClassName: appearance.
|
|
1030
|
-
|
|
1019
|
+
containerClassName: appearance.link?.container,
|
|
1020
|
+
linkClassName: appearance.link?.link
|
|
1031
1021
|
}
|
|
1032
1022
|
}
|
|
1033
|
-
)
|
|
1023
|
+
),
|
|
1024
|
+
availableProviders.length > 0 && onOAuthClick && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1025
|
+
/* @__PURE__ */ jsx(
|
|
1026
|
+
AuthDivider,
|
|
1027
|
+
{
|
|
1028
|
+
text: dividerText,
|
|
1029
|
+
className: appearance.divider
|
|
1030
|
+
}
|
|
1031
|
+
),
|
|
1032
|
+
/* @__PURE__ */ jsx(
|
|
1033
|
+
AuthOAuthProviders,
|
|
1034
|
+
{
|
|
1035
|
+
providers: availableProviders,
|
|
1036
|
+
onClick: onOAuthClick,
|
|
1037
|
+
disabled: loading || oauthLoading !== null,
|
|
1038
|
+
loading: oauthLoading,
|
|
1039
|
+
appearance: {
|
|
1040
|
+
containerClassName: appearance.oauth?.container,
|
|
1041
|
+
buttonClassName: appearance.oauth?.button
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
)
|
|
1045
|
+
] })
|
|
1034
1046
|
] })
|
|
1035
1047
|
]
|
|
1036
1048
|
}
|
|
@@ -1112,7 +1124,7 @@ function SignIn({
|
|
|
1112
1124
|
if (!emailConfig) {
|
|
1113
1125
|
return null;
|
|
1114
1126
|
}
|
|
1115
|
-
return
|
|
1127
|
+
return /* @__PURE__ */ jsx(
|
|
1116
1128
|
SignInForm,
|
|
1117
1129
|
{
|
|
1118
1130
|
email,
|
|
@@ -1126,14 +1138,10 @@ function SignIn({
|
|
|
1126
1138
|
availableProviders: emailConfig?.oAuthProviders || [],
|
|
1127
1139
|
onOAuthClick: handleOAuth,
|
|
1128
1140
|
emailAuthConfig: emailConfig,
|
|
1141
|
+
showVerificationStep: step === "awaiting-verification",
|
|
1142
|
+
onVerifyCode: handleVerifyCode,
|
|
1129
1143
|
...uiProps
|
|
1130
1144
|
}
|
|
1131
|
-
) : /* @__PURE__ */ jsx(
|
|
1132
|
-
AuthEmailVerificationStep,
|
|
1133
|
-
{
|
|
1134
|
-
email,
|
|
1135
|
-
onVerifyCode: handleVerifyCode
|
|
1136
|
-
}
|
|
1137
1145
|
);
|
|
1138
1146
|
}
|
|
1139
1147
|
function SignUpForm({
|
|
@@ -1160,7 +1168,11 @@ function SignUpForm({
|
|
|
1160
1168
|
signInText = "Already have an account?",
|
|
1161
1169
|
signInLinkText = "Login Now",
|
|
1162
1170
|
signInUrl = "/sign-in",
|
|
1163
|
-
dividerText = "or"
|
|
1171
|
+
dividerText = "or",
|
|
1172
|
+
// Email verification step props
|
|
1173
|
+
showVerificationStep = false,
|
|
1174
|
+
onVerifyCode,
|
|
1175
|
+
verificationDescription
|
|
1164
1176
|
}) {
|
|
1165
1177
|
return /* @__PURE__ */ jsxs(
|
|
1166
1178
|
AuthContainer,
|
|
@@ -1173,8 +1185,8 @@ function SignUpForm({
|
|
|
1173
1185
|
/* @__PURE__ */ jsx(
|
|
1174
1186
|
AuthHeader,
|
|
1175
1187
|
{
|
|
1176
|
-
title,
|
|
1177
|
-
subtitle,
|
|
1188
|
+
title: showVerificationStep ? "Verify Your Email" : title,
|
|
1189
|
+
subtitle: showVerificationStep ? "" : subtitle,
|
|
1178
1190
|
appearance: {
|
|
1179
1191
|
containerClassName: appearance.header?.container,
|
|
1180
1192
|
titleClassName: appearance.header?.title,
|
|
@@ -1189,7 +1201,14 @@ function SignUpForm({
|
|
|
1189
1201
|
className: appearance.errorBanner
|
|
1190
1202
|
}
|
|
1191
1203
|
),
|
|
1192
|
-
/* @__PURE__ */
|
|
1204
|
+
showVerificationStep ? /* @__PURE__ */ jsx(
|
|
1205
|
+
AuthEmailVerificationStep,
|
|
1206
|
+
{
|
|
1207
|
+
email,
|
|
1208
|
+
description: verificationDescription,
|
|
1209
|
+
onVerifyCode
|
|
1210
|
+
}
|
|
1211
|
+
) : /* @__PURE__ */ jsxs(
|
|
1193
1212
|
"form",
|
|
1194
1213
|
{
|
|
1195
1214
|
onSubmit,
|
|
@@ -1246,39 +1265,41 @@ function SignUpForm({
|
|
|
1246
1265
|
]
|
|
1247
1266
|
}
|
|
1248
1267
|
),
|
|
1249
|
-
/* @__PURE__ */
|
|
1250
|
-
AuthLink,
|
|
1251
|
-
{
|
|
1252
|
-
text: signInText,
|
|
1253
|
-
linkText: signInLinkText,
|
|
1254
|
-
href: signInUrl,
|
|
1255
|
-
appearance: {
|
|
1256
|
-
containerClassName: appearance.link?.container,
|
|
1257
|
-
linkClassName: appearance.link?.link
|
|
1258
|
-
}
|
|
1259
|
-
}
|
|
1260
|
-
),
|
|
1261
|
-
availableProviders.length > 0 && onOAuthClick && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1262
|
-
/* @__PURE__ */ jsx(
|
|
1263
|
-
AuthDivider,
|
|
1264
|
-
{
|
|
1265
|
-
text: dividerText,
|
|
1266
|
-
className: appearance.divider
|
|
1267
|
-
}
|
|
1268
|
-
),
|
|
1268
|
+
!showVerificationStep && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1269
1269
|
/* @__PURE__ */ jsx(
|
|
1270
|
-
|
|
1270
|
+
AuthLink,
|
|
1271
1271
|
{
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
loading: oauthLoading,
|
|
1272
|
+
text: signInText,
|
|
1273
|
+
linkText: signInLinkText,
|
|
1274
|
+
href: signInUrl,
|
|
1276
1275
|
appearance: {
|
|
1277
|
-
containerClassName: appearance.
|
|
1278
|
-
|
|
1276
|
+
containerClassName: appearance.link?.container,
|
|
1277
|
+
linkClassName: appearance.link?.link
|
|
1279
1278
|
}
|
|
1280
1279
|
}
|
|
1281
|
-
)
|
|
1280
|
+
),
|
|
1281
|
+
availableProviders.length > 0 && onOAuthClick && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1282
|
+
/* @__PURE__ */ jsx(
|
|
1283
|
+
AuthDivider,
|
|
1284
|
+
{
|
|
1285
|
+
text: dividerText,
|
|
1286
|
+
className: appearance.divider
|
|
1287
|
+
}
|
|
1288
|
+
),
|
|
1289
|
+
/* @__PURE__ */ jsx(
|
|
1290
|
+
AuthOAuthProviders,
|
|
1291
|
+
{
|
|
1292
|
+
providers: availableProviders,
|
|
1293
|
+
onClick: onOAuthClick,
|
|
1294
|
+
disabled: loading || oauthLoading !== null,
|
|
1295
|
+
loading: oauthLoading,
|
|
1296
|
+
appearance: {
|
|
1297
|
+
containerClassName: appearance.oauth?.container,
|
|
1298
|
+
buttonClassName: appearance.oauth?.button
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
)
|
|
1302
|
+
] })
|
|
1282
1303
|
] })
|
|
1283
1304
|
]
|
|
1284
1305
|
}
|
|
@@ -1415,7 +1436,7 @@ function SignUp({
|
|
|
1415
1436
|
if (!emailConfig) {
|
|
1416
1437
|
return null;
|
|
1417
1438
|
}
|
|
1418
|
-
return
|
|
1439
|
+
return /* @__PURE__ */ jsx(
|
|
1419
1440
|
SignUpForm,
|
|
1420
1441
|
{
|
|
1421
1442
|
email,
|
|
@@ -1429,14 +1450,10 @@ function SignUp({
|
|
|
1429
1450
|
availableProviders: emailConfig?.oAuthProviders || [],
|
|
1430
1451
|
onOAuthClick: handleOAuth,
|
|
1431
1452
|
emailAuthConfig: emailConfig,
|
|
1453
|
+
showVerificationStep: step === "awaiting-verification",
|
|
1454
|
+
onVerifyCode: handleVerifyCode,
|
|
1432
1455
|
...uiProps
|
|
1433
1456
|
}
|
|
1434
|
-
) : /* @__PURE__ */ jsx(
|
|
1435
|
-
AuthEmailVerificationStep,
|
|
1436
|
-
{
|
|
1437
|
-
email,
|
|
1438
|
-
onVerifyCode: handleVerifyCode
|
|
1439
|
-
}
|
|
1440
1457
|
);
|
|
1441
1458
|
}
|
|
1442
1459
|
function ForgotPasswordForm({
|
|
@@ -1659,13 +1676,18 @@ function ResetPasswordForm({
|
|
|
1659
1676
|
]
|
|
1660
1677
|
}
|
|
1661
1678
|
),
|
|
1662
|
-
/* @__PURE__ */
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1679
|
+
/* @__PURE__ */ jsx(
|
|
1680
|
+
AuthLink,
|
|
1681
|
+
{
|
|
1682
|
+
text: backToSignInText,
|
|
1683
|
+
linkText: "Back to Sign In",
|
|
1684
|
+
href: backToSignInUrl,
|
|
1685
|
+
appearance: {
|
|
1686
|
+
containerClassName: appearance.link?.container,
|
|
1687
|
+
linkClassName: appearance.link?.link
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
)
|
|
1669
1691
|
]
|
|
1670
1692
|
}
|
|
1671
1693
|
);
|