@mesob/auth-react 0.3.4 → 0.3.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/dist/components/auth/auth-layout.d.ts +1 -1
- package/dist/components/auth/auth-layout.js +10 -2
- package/dist/components/auth/auth-layout.js.map +1 -1
- package/dist/components/auth/countdown.js +8 -6
- package/dist/components/auth/countdown.js.map +1 -1
- package/dist/components/auth/forgot-password.js +16 -18
- package/dist/components/auth/forgot-password.js.map +1 -1
- package/dist/components/auth/reset-password-form.js +17 -20
- package/dist/components/auth/reset-password-form.js.map +1 -1
- package/dist/components/auth/sign-in.js +23 -25
- package/dist/components/auth/sign-in.js.map +1 -1
- package/dist/components/auth/sign-up.js +18 -24
- package/dist/components/auth/sign-up.js.map +1 -1
- package/dist/components/auth/verification-form.js +24 -27
- package/dist/components/auth/verification-form.js.map +1 -1
- package/dist/components/auth/verify-email.js +35 -30
- package/dist/components/auth/verify-email.js.map +1 -1
- package/dist/components/auth/verify-phone.js +35 -30
- package/dist/components/auth/verify-phone.js.map +1 -1
- package/dist/components/error-boundary.d.ts +2 -2
- package/dist/components/iam/permissions.js +9 -2
- package/dist/components/iam/permissions.js.map +1 -1
- package/dist/components/iam/roles.js +9 -2
- package/dist/components/iam/roles.js.map +1 -1
- package/dist/components/iam/tenants.js +9 -2
- package/dist/components/iam/tenants.js.map +1 -1
- package/dist/components/iam/users.js +9 -2
- package/dist/components/iam/users.js.map +1 -1
- package/dist/components/profile/change-email-form.js +26 -29
- package/dist/components/profile/change-email-form.js.map +1 -1
- package/dist/components/profile/change-phone-form.js +26 -29
- package/dist/components/profile/change-phone-form.js.map +1 -1
- package/dist/components/profile/otp-verification-modal.js +24 -27
- package/dist/components/profile/otp-verification-modal.js.map +1 -1
- package/dist/components/profile/security.js +38 -41
- package/dist/components/profile/security.js.map +1 -1
- package/dist/components/profile/verify-change-email-form.js +24 -27
- package/dist/components/profile/verify-change-email-form.js.map +1 -1
- package/dist/components/profile/verify-change-phone-form.js +24 -27
- package/dist/components/profile/verify-change-phone-form.js.map +1 -1
- package/dist/index.js +147 -159
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// src/components/profile/change-email-form.tsx
|
|
4
4
|
import {
|
|
5
|
-
Button as
|
|
5
|
+
Button as Button3,
|
|
6
6
|
Collapsible,
|
|
7
7
|
CollapsibleContent,
|
|
8
8
|
CollapsibleTrigger
|
|
@@ -342,7 +342,7 @@ import {
|
|
|
342
342
|
// src/components/auth/verification-form.tsx
|
|
343
343
|
import { zodResolver as zodResolver2 } from "@hookform/resolvers/zod";
|
|
344
344
|
import {
|
|
345
|
-
Button as
|
|
345
|
+
Button as Button2,
|
|
346
346
|
Form,
|
|
347
347
|
FormControl,
|
|
348
348
|
FormField,
|
|
@@ -351,8 +351,7 @@ import {
|
|
|
351
351
|
FormMessage,
|
|
352
352
|
InputOTP,
|
|
353
353
|
InputOTPGroup,
|
|
354
|
-
InputOTPSlot
|
|
355
|
-
Spinner as Spinner3
|
|
354
|
+
InputOTPSlot
|
|
356
355
|
} from "@mesob/ui/components";
|
|
357
356
|
import { useForm as useForm2 } from "react-hook-form";
|
|
358
357
|
import { z as z2 } from "zod";
|
|
@@ -372,7 +371,7 @@ function useTranslator(namespace) {
|
|
|
372
371
|
}
|
|
373
372
|
|
|
374
373
|
// src/components/auth/countdown.tsx
|
|
375
|
-
import {
|
|
374
|
+
import { Spinner as Spinner2 } from "@mesob/ui/components";
|
|
376
375
|
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
377
376
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
378
377
|
var Countdown = ({
|
|
@@ -408,17 +407,19 @@ var Countdown = ({
|
|
|
408
407
|
setIsResending(false);
|
|
409
408
|
}
|
|
410
409
|
};
|
|
410
|
+
const busy = isResending || resending;
|
|
411
411
|
if (seconds > 0) {
|
|
412
|
-
return /* @__PURE__ */ jsx3(
|
|
412
|
+
return /* @__PURE__ */ jsx3("p", { className: "text-sm text-muted-foreground", children: t("resendIn", { seconds }) });
|
|
413
413
|
}
|
|
414
414
|
return /* @__PURE__ */ jsxs2(
|
|
415
|
-
|
|
415
|
+
"button",
|
|
416
416
|
{
|
|
417
|
-
|
|
417
|
+
type: "button",
|
|
418
418
|
onClick: handleResend,
|
|
419
|
-
disabled:
|
|
419
|
+
disabled: busy,
|
|
420
|
+
className: "text-sm text-primary hover:underline disabled:opacity-50 flex items-center gap-1",
|
|
420
421
|
children: [
|
|
421
|
-
|
|
422
|
+
busy && /* @__PURE__ */ jsx3(Spinner2, { className: "h-3 w-3" }),
|
|
422
423
|
t("resend")
|
|
423
424
|
]
|
|
424
425
|
}
|
|
@@ -438,13 +439,12 @@ var VerificationForm = ({
|
|
|
438
439
|
const t = useTranslator("Auth.verification");
|
|
439
440
|
const form = useForm2({
|
|
440
441
|
resolver: zodResolver2(verificationSchema(t)),
|
|
441
|
-
defaultValues: {
|
|
442
|
-
code: ""
|
|
443
|
-
}
|
|
442
|
+
defaultValues: { code: "" }
|
|
444
443
|
});
|
|
445
444
|
const handleSubmit = form.handleSubmit(async (values) => {
|
|
446
445
|
await onSubmit(values);
|
|
447
446
|
});
|
|
447
|
+
const codeLength = form.watch("code").length;
|
|
448
448
|
return /* @__PURE__ */ jsx4(Form, { ...form, children: /* @__PURE__ */ jsxs3(
|
|
449
449
|
"form",
|
|
450
450
|
{
|
|
@@ -482,21 +482,18 @@ var VerificationForm = ({
|
|
|
482
482
|
] })
|
|
483
483
|
}
|
|
484
484
|
),
|
|
485
|
-
/* @__PURE__ */
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
}
|
|
498
|
-
)
|
|
499
|
-
] })
|
|
485
|
+
/* @__PURE__ */ jsx4(
|
|
486
|
+
Button2,
|
|
487
|
+
{
|
|
488
|
+
type: "submit",
|
|
489
|
+
form: "verification-form",
|
|
490
|
+
className: "w-full",
|
|
491
|
+
disabled: isLoading || codeLength !== 6,
|
|
492
|
+
loading: isLoading,
|
|
493
|
+
children: t("form.confirm")
|
|
494
|
+
}
|
|
495
|
+
),
|
|
496
|
+
/* @__PURE__ */ jsx4("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx4(Countdown, { onResend, resending: isLoading }) })
|
|
500
497
|
]
|
|
501
498
|
}
|
|
502
499
|
) });
|
|
@@ -700,7 +697,7 @@ function ChangeEmailForm() {
|
|
|
700
697
|
CollapsibleTrigger,
|
|
701
698
|
{
|
|
702
699
|
render: /* @__PURE__ */ jsx7(
|
|
703
|
-
|
|
700
|
+
Button3,
|
|
704
701
|
{
|
|
705
702
|
variant: "ghost",
|
|
706
703
|
className: "w-full justify-between p-4 h-auto"
|
|
@@ -742,13 +739,13 @@ function ChangeEmailForm() {
|
|
|
742
739
|
// src/components/profile/change-password-form.tsx
|
|
743
740
|
import { zodResolver as zodResolver3 } from "@hookform/resolvers/zod";
|
|
744
741
|
import {
|
|
745
|
-
Button as
|
|
742
|
+
Button as Button4,
|
|
746
743
|
Collapsible as Collapsible2,
|
|
747
744
|
CollapsibleContent as CollapsibleContent2,
|
|
748
745
|
CollapsibleTrigger as CollapsibleTrigger2,
|
|
749
746
|
Input as Input2,
|
|
750
747
|
Label as Label2,
|
|
751
|
-
Spinner as
|
|
748
|
+
Spinner as Spinner3
|
|
752
749
|
} from "@mesob/ui/components";
|
|
753
750
|
import { IconChevronDown as IconChevronDown2, IconEye as IconEye2, IconEyeOff as IconEyeOff2 } from "@tabler/icons-react";
|
|
754
751
|
import { useState as useState6 } from "react";
|
|
@@ -844,7 +841,7 @@ function ChangePasswordForm() {
|
|
|
844
841
|
CollapsibleTrigger2,
|
|
845
842
|
{
|
|
846
843
|
render: /* @__PURE__ */ jsx8(
|
|
847
|
-
|
|
844
|
+
Button4,
|
|
848
845
|
{
|
|
849
846
|
variant: "ghost",
|
|
850
847
|
className: "w-full justify-between p-4 h-auto"
|
|
@@ -947,7 +944,7 @@ function ChangePasswordForm() {
|
|
|
947
944
|
] }),
|
|
948
945
|
/* @__PURE__ */ jsxs6("div", { className: "flex justify-end gap-2", children: [
|
|
949
946
|
/* @__PURE__ */ jsx8(
|
|
950
|
-
|
|
947
|
+
Button4,
|
|
951
948
|
{
|
|
952
949
|
type: "button",
|
|
953
950
|
variant: "outline",
|
|
@@ -959,8 +956,8 @@ function ChangePasswordForm() {
|
|
|
959
956
|
children: "Cancel"
|
|
960
957
|
}
|
|
961
958
|
),
|
|
962
|
-
/* @__PURE__ */ jsxs6(
|
|
963
|
-
isSubmitting && /* @__PURE__ */ jsx8(
|
|
959
|
+
/* @__PURE__ */ jsxs6(Button4, { type: "submit", disabled: isSubmitting, children: [
|
|
960
|
+
isSubmitting && /* @__PURE__ */ jsx8(Spinner3, { className: "mr-2 h-4 w-4" }),
|
|
964
961
|
"Change Password"
|
|
965
962
|
] })
|
|
966
963
|
] })
|
|
@@ -972,7 +969,7 @@ function ChangePasswordForm() {
|
|
|
972
969
|
|
|
973
970
|
// src/components/profile/change-phone-form.tsx
|
|
974
971
|
import {
|
|
975
|
-
Button as
|
|
972
|
+
Button as Button6,
|
|
976
973
|
Collapsible as Collapsible3,
|
|
977
974
|
CollapsibleContent as CollapsibleContent3,
|
|
978
975
|
CollapsibleTrigger as CollapsibleTrigger3
|
|
@@ -982,7 +979,7 @@ import { useState as useState9 } from "react";
|
|
|
982
979
|
|
|
983
980
|
// src/components/profile/request-change-phone-form.tsx
|
|
984
981
|
import { zodResolver as zodResolver4 } from "@hookform/resolvers/zod";
|
|
985
|
-
import { Button as
|
|
982
|
+
import { Button as Button5, Input as Input3, Label as Label3, Spinner as Spinner4 } from "@mesob/ui/components";
|
|
986
983
|
import { IconEye as IconEye3, IconEyeOff as IconEyeOff3 } from "@tabler/icons-react";
|
|
987
984
|
import { useEffect as useEffect3, useState as useState7 } from "react";
|
|
988
985
|
import { useForm as useForm4 } from "react-hook-form";
|
|
@@ -1240,7 +1237,7 @@ function RequestChangePhoneForm({
|
|
|
1240
1237
|
] }),
|
|
1241
1238
|
/* @__PURE__ */ jsxs7("div", { className: "flex justify-end gap-2", children: [
|
|
1242
1239
|
/* @__PURE__ */ jsx9(
|
|
1243
|
-
|
|
1240
|
+
Button5,
|
|
1244
1241
|
{
|
|
1245
1242
|
type: "button",
|
|
1246
1243
|
variant: "outline",
|
|
@@ -1249,8 +1246,8 @@ function RequestChangePhoneForm({
|
|
|
1249
1246
|
children: "Cancel"
|
|
1250
1247
|
}
|
|
1251
1248
|
),
|
|
1252
|
-
/* @__PURE__ */ jsxs7(
|
|
1253
|
-
isLoading && /* @__PURE__ */ jsx9(
|
|
1249
|
+
/* @__PURE__ */ jsxs7(Button5, { type: "submit", disabled: isLoading, children: [
|
|
1250
|
+
isLoading && /* @__PURE__ */ jsx9(Spinner4, { className: "mr-2 h-4 w-4" }),
|
|
1254
1251
|
isChecking ? "Checking\u2026" : buttonText
|
|
1255
1252
|
] })
|
|
1256
1253
|
] })
|
|
@@ -1423,7 +1420,7 @@ function ChangePhoneForm() {
|
|
|
1423
1420
|
CollapsibleTrigger3,
|
|
1424
1421
|
{
|
|
1425
1422
|
render: /* @__PURE__ */ jsx11(
|
|
1426
|
-
|
|
1423
|
+
Button6,
|
|
1427
1424
|
{
|
|
1428
1425
|
variant: "ghost",
|
|
1429
1426
|
className: "w-full justify-between p-4 h-auto"
|