@greatapps/common 1.1.24 → 1.1.26
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/account/ConfigurationsMyAccountModal.mjs +121 -0
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +1 -0
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +45 -0
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +1 -0
- package/dist/components/account/DisableTwoFactorAuthModal.mjs +67 -0
- package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +1 -0
- package/dist/components/account/TwoFactorAuthModal.mjs +190 -0
- package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -0
- package/dist/components/account/constants.mjs +32 -0
- package/dist/components/account/constants.mjs.map +1 -0
- package/dist/components/account/hooks/useChangeEmailForm.mjs +53 -0
- package/dist/components/account/hooks/useChangeEmailForm.mjs.map +1 -0
- package/dist/components/account/hooks/useChangePasswordForm.mjs +47 -0
- package/dist/components/account/hooks/useChangePasswordForm.mjs.map +1 -0
- package/dist/components/account/hooks/useChangePhoneForm.mjs +64 -0
- package/dist/components/account/hooks/useChangePhoneForm.mjs.map +1 -0
- package/dist/components/account/hooks/useConfigurationsModal.mjs +33 -0
- package/dist/components/account/hooks/useConfigurationsModal.mjs.map +1 -0
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs +54 -0
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs.map +1 -0
- package/dist/components/account/hooks/useOtpVerification.mjs +94 -0
- package/dist/components/account/hooks/useOtpVerification.mjs.map +1 -0
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs +88 -0
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +1 -0
- package/dist/components/account/sections/ChangeEmailModal.mjs +180 -0
- package/dist/components/account/sections/ChangeEmailModal.mjs.map +1 -0
- package/dist/components/account/sections/ChangePasswordSection.mjs +64 -0
- package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -0
- package/dist/components/account/sections/ChangePhoneModal.mjs +182 -0
- package/dist/components/account/sections/ChangePhoneModal.mjs.map +1 -0
- package/dist/components/account/sections/MyProfileSection.mjs +312 -0
- package/dist/components/account/sections/MyProfileSection.mjs.map +1 -0
- package/dist/components/account/sections/PreferencesSection.mjs +246 -0
- package/dist/components/account/sections/PreferencesSection.mjs.map +1 -0
- package/dist/components/account/sections/SecuritySection.mjs +147 -0
- package/dist/components/account/sections/SecuritySection.mjs.map +1 -0
- package/dist/components/ui/form/ComboboxField.mjs +130 -0
- package/dist/components/ui/form/ComboboxField.mjs.map +1 -0
- package/dist/components/ui/form/FormField.mjs +103 -0
- package/dist/components/ui/form/FormField.mjs.map +1 -0
- package/dist/components/ui/form/PhoneInput.mjs +78 -0
- package/dist/components/ui/form/PhoneInput.mjs.map +1 -0
- package/dist/components/ui/form/SelectField.mjs +80 -0
- package/dist/components/ui/form/SelectField.mjs.map +1 -0
- package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs +40 -0
- package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs.map +1 -0
- package/dist/components/ui/form/TextAreaField.mjs +56 -0
- package/dist/components/ui/form/TextAreaField.mjs.map +1 -0
- package/dist/enums/AccountSectionType.mjs +11 -0
- package/dist/enums/AccountSectionType.mjs.map +1 -0
- package/dist/hooks/useCountdownTimer.mjs +29 -0
- package/dist/hooks/useCountdownTimer.mjs.map +1 -0
- package/dist/hooks/useIsMobile.mjs +18 -0
- package/dist/hooks/useIsMobile.mjs.map +1 -0
- package/dist/hooks/usePasswordVisibility.mjs +13 -0
- package/dist/hooks/usePasswordVisibility.mjs.map +1 -0
- package/dist/index.mjs +80 -0
- package/dist/index.mjs.map +1 -1
- package/dist/modules/accounts/actions/account-management.action.mjs +163 -0
- package/dist/modules/accounts/actions/account-management.action.mjs.map +1 -0
- package/dist/modules/accounts/hooks/useAccountManagement.mjs +64 -0
- package/dist/modules/accounts/hooks/useAccountManagement.mjs.map +1 -0
- package/dist/modules/accounts/services/account.service.mjs +162 -25
- package/dist/modules/accounts/services/account.service.mjs.map +1 -1
- package/dist/modules/accounts/services/two-factor.service.mjs +77 -0
- package/dist/modules/accounts/services/two-factor.service.mjs.map +1 -0
- package/dist/modules/auth/services/auth.service.mjs +7 -4
- package/dist/modules/auth/services/auth.service.mjs.map +1 -1
- package/dist/server.mjs +36 -0
- package/dist/server.mjs.map +1 -1
- package/dist/utils/browser/clipboard.mjs +36 -0
- package/dist/utils/browser/clipboard.mjs.map +1 -0
- package/dist/utils/file/index.mjs +9 -0
- package/dist/utils/file/index.mjs.map +1 -0
- package/dist/utils/format/masks.mjs +56 -0
- package/dist/utils/format/masks.mjs.map +1 -0
- package/dist/utils/intl/locales.mjs +12 -0
- package/dist/utils/intl/locales.mjs.map +1 -0
- package/dist/utils/intl/timezones.mjs +41 -0
- package/dist/utils/intl/timezones.mjs.map +1 -0
- package/dist/utils/validators/account.mjs +26 -0
- package/dist/utils/validators/account.mjs.map +1 -0
- package/dist/utils/validators/common.mjs +47 -0
- package/dist/utils/validators/common.mjs.map +1 -0
- package/package.json +5 -1
- package/src/components/account/ConfigurationsMyAccountModal.tsx +147 -0
- package/src/components/account/ConfirmGlobalPreferencesModal.tsx +66 -0
- package/src/components/account/DisableTwoFactorAuthModal.tsx +86 -0
- package/src/components/account/TwoFactorAuthModal.tsx +221 -0
- package/src/components/account/constants.ts +29 -0
- package/src/components/account/hooks/useChangeEmailForm.tsx +56 -0
- package/src/components/account/hooks/useChangePasswordForm.tsx +59 -0
- package/src/components/account/hooks/useChangePhoneForm.tsx +69 -0
- package/src/components/account/hooks/useConfigurationsModal.ts +40 -0
- package/src/components/account/hooks/useDisableTwoFactorAuthForm.tsx +69 -0
- package/src/components/account/hooks/useOtpVerification.tsx +116 -0
- package/src/components/account/hooks/useTwoFactorAuthForm.tsx +114 -0
- package/src/components/account/sections/ChangeEmailModal.tsx +224 -0
- package/src/components/account/sections/ChangePasswordSection.tsx +64 -0
- package/src/components/account/sections/ChangePhoneModal.tsx +229 -0
- package/src/components/account/sections/MyProfileSection.tsx +337 -0
- package/src/components/account/sections/PreferencesSection.tsx +277 -0
- package/src/components/account/sections/SecuritySection.tsx +160 -0
- package/src/components/ui/form/ComboboxField.tsx +154 -0
- package/src/components/ui/form/FormField.tsx +130 -0
- package/src/components/ui/form/PhoneInput.tsx +98 -0
- package/src/components/ui/form/SelectField.tsx +118 -0
- package/src/components/ui/form/SwitchOptionFieldWithIcon.tsx +47 -0
- package/src/components/ui/form/TextAreaField.tsx +70 -0
- package/src/enums/AccountSectionType.ts +6 -0
- package/src/hooks/useCountdownTimer.ts +41 -0
- package/src/hooks/useIsMobile.ts +19 -0
- package/src/hooks/usePasswordVisibility.ts +13 -0
- package/src/index.ts +70 -0
- package/src/modules/accounts/actions/account-management.action.ts +197 -0
- package/src/modules/accounts/hooks/useAccountManagement.ts +79 -0
- package/src/modules/accounts/services/account.service.ts +229 -50
- package/src/modules/accounts/services/two-factor.service.ts +98 -0
- package/src/modules/accounts/types.ts +157 -0
- package/src/modules/auth/services/auth.service.ts +9 -5
- package/src/server.ts +21 -0
- package/src/utils/browser/clipboard.ts +34 -0
- package/src/utils/file/index.ts +5 -0
- package/src/utils/format/masks.ts +52 -0
- package/src/utils/intl/locales.ts +15 -0
- package/src/utils/intl/timezones.ts +53 -0
- package/src/utils/validators/account.ts +36 -0
- package/src/utils/validators/common.ts +43 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
function parseOffsetMinutes(offsetStr) {
|
|
2
|
+
const match = offsetStr.match(/GMT([+-])(\d+)(?::(\d+))?/);
|
|
3
|
+
if (!match) return 0;
|
|
4
|
+
const sign = match[1] === "+" ? 1 : -1;
|
|
5
|
+
return sign * (parseInt(match[2], 10) * 60 + parseInt(match[3] ?? "0", 10));
|
|
6
|
+
}
|
|
7
|
+
const FALLBACK_TIMEZONES = [
|
|
8
|
+
{ value: "America/Noronha", label: "(GMT-2) America/Noronha", displayValue: "(GMT-2) Noronha" },
|
|
9
|
+
{ value: "America/Sao_Paulo", label: "(GMT-3) America/Sao Paulo", displayValue: "(GMT-3) Sao Paulo" },
|
|
10
|
+
{ value: "America/Manaus", label: "(GMT-4) America/Manaus", displayValue: "(GMT-4) Manaus" },
|
|
11
|
+
{ value: "America/Rio_Branco", label: "(GMT-5) America/Rio Branco", displayValue: "(GMT-5) Rio Branco" },
|
|
12
|
+
{ value: "America/New_York", label: "(GMT-5) America/New York", displayValue: "(GMT-5) New York" },
|
|
13
|
+
{ value: "America/Los_Angeles", label: "(GMT-8) America/Los Angeles", displayValue: "(GMT-8) Los Angeles" },
|
|
14
|
+
{ value: "Europe/London", label: "(GMT+0) Europe/London", displayValue: "(GMT+0) London" },
|
|
15
|
+
{ value: "Europe/Paris", label: "(GMT+1) Europe/Paris", displayValue: "(GMT+1) Paris" },
|
|
16
|
+
{ value: "Asia/Tokyo", label: "(GMT+9) Asia/Tokyo", displayValue: "(GMT+9) Tokyo" }
|
|
17
|
+
];
|
|
18
|
+
function buildTimezoneOptions() {
|
|
19
|
+
try {
|
|
20
|
+
const zones = Intl.supportedValuesOf("timeZone");
|
|
21
|
+
const now = /* @__PURE__ */ new Date();
|
|
22
|
+
const items = zones.map((tz) => {
|
|
23
|
+
const offsetStr = new Intl.DateTimeFormat("en", { timeZone: tz, timeZoneName: "shortOffset" }).formatToParts(now).find((p) => p.type === "timeZoneName")?.value ?? "GMT";
|
|
24
|
+
const city = tz.split("/").slice(1).join("/").replace(/_/g, " ") || tz;
|
|
25
|
+
return {
|
|
26
|
+
value: tz,
|
|
27
|
+
label: `(${offsetStr}) ${tz.replace(/_/g, " ")}`,
|
|
28
|
+
displayValue: `(${offsetStr}) ${city}`,
|
|
29
|
+
sort: parseOffsetMinutes(offsetStr)
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
items.sort((a, b) => a.sort - b.sort || a.label.localeCompare(b.label));
|
|
33
|
+
return items.map(({ value, label, displayValue }) => ({ value, label, displayValue }));
|
|
34
|
+
} catch {
|
|
35
|
+
return FALLBACK_TIMEZONES;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
buildTimezoneOptions
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=timezones.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/intl/timezones.ts"],"sourcesContent":["export type TimezoneOption = {\r\n value: string;\r\n label: string;\r\n displayValue: string;\r\n};\r\n\r\nfunction parseOffsetMinutes(offsetStr: string): number {\r\n const match = offsetStr.match(/GMT([+-])(\\d+)(?::(\\d+))?/);\r\n if (!match) return 0;\r\n const sign = match[1] === '+' ? 1 : -1;\r\n return sign * (parseInt(match[2], 10) * 60 + parseInt(match[3] ?? '0', 10));\r\n}\r\n\r\nconst FALLBACK_TIMEZONES: TimezoneOption[] = [\r\n { value: 'America/Noronha', label: '(GMT-2) America/Noronha', displayValue: '(GMT-2) Noronha' },\r\n { value: 'America/Sao_Paulo', label: '(GMT-3) America/Sao Paulo', displayValue: '(GMT-3) Sao Paulo' },\r\n { value: 'America/Manaus', label: '(GMT-4) America/Manaus', displayValue: '(GMT-4) Manaus' },\r\n { value: 'America/Rio_Branco', label: '(GMT-5) America/Rio Branco', displayValue: '(GMT-5) Rio Branco' },\r\n { value: 'America/New_York', label: '(GMT-5) America/New York', displayValue: '(GMT-5) New York' },\r\n { value: 'America/Los_Angeles', label: '(GMT-8) America/Los Angeles', displayValue: '(GMT-8) Los Angeles' },\r\n { value: 'Europe/London', label: '(GMT+0) Europe/London', displayValue: '(GMT+0) London' },\r\n { value: 'Europe/Paris', label: '(GMT+1) Europe/Paris', displayValue: '(GMT+1) Paris' },\r\n { value: 'Asia/Tokyo', label: '(GMT+9) Asia/Tokyo', displayValue: '(GMT+9) Tokyo' },\r\n];\r\n\r\nexport function buildTimezoneOptions(): TimezoneOption[] {\r\n try {\r\n const zones = Intl.supportedValuesOf('timeZone');\r\n const now = new Date();\r\n\r\n const items = zones.map((tz) => {\r\n const offsetStr =\r\n new Intl.DateTimeFormat('en', { timeZone: tz, timeZoneName: 'shortOffset' })\r\n .formatToParts(now)\r\n .find((p) => p.type === 'timeZoneName')?.value ?? 'GMT';\r\n\r\n const city = tz.split('/').slice(1).join('/').replace(/_/g, ' ') || tz;\r\n\r\n return {\r\n value: tz,\r\n label: `(${offsetStr}) ${tz.replace(/_/g, ' ')}`,\r\n displayValue: `(${offsetStr}) ${city}`,\r\n sort: parseOffsetMinutes(offsetStr),\r\n };\r\n });\r\n\r\n items.sort((a, b) => a.sort - b.sort || a.label.localeCompare(b.label));\r\n\r\n return items.map(({ value, label, displayValue }) => ({ value, label, displayValue }));\r\n } catch {\r\n return FALLBACK_TIMEZONES;\r\n }\r\n}\r\n"],"mappings":"AAMA,SAAS,mBAAmB,WAA2B;AACrD,QAAM,QAAQ,UAAU,MAAM,2BAA2B;AACzD,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,OAAO,MAAM,CAAC,MAAM,MAAM,IAAI;AACpC,SAAO,QAAQ,SAAS,MAAM,CAAC,GAAG,EAAE,IAAI,KAAK,SAAS,MAAM,CAAC,KAAK,KAAK,EAAE;AAC3E;AAEA,MAAM,qBAAuC;AAAA,EAC3C,EAAE,OAAO,mBAAmB,OAAO,2BAA2B,cAAc,kBAAkB;AAAA,EAC9F,EAAE,OAAO,qBAAqB,OAAO,6BAA6B,cAAc,oBAAoB;AAAA,EACpG,EAAE,OAAO,kBAAkB,OAAO,0BAA0B,cAAc,iBAAiB;AAAA,EAC3F,EAAE,OAAO,sBAAsB,OAAO,8BAA8B,cAAc,qBAAqB;AAAA,EACvG,EAAE,OAAO,oBAAoB,OAAO,4BAA4B,cAAc,mBAAmB;AAAA,EACjG,EAAE,OAAO,uBAAuB,OAAO,+BAA+B,cAAc,sBAAsB;AAAA,EAC1G,EAAE,OAAO,iBAAiB,OAAO,yBAAyB,cAAc,iBAAiB;AAAA,EACzF,EAAE,OAAO,gBAAgB,OAAO,wBAAwB,cAAc,gBAAgB;AAAA,EACtF,EAAE,OAAO,cAAc,OAAO,sBAAsB,cAAc,gBAAgB;AACpF;AAEO,SAAS,uBAAyC;AACvD,MAAI;AACF,UAAM,QAAQ,KAAK,kBAAkB,UAAU;AAC/C,UAAM,MAAM,oBAAI,KAAK;AAErB,UAAM,QAAQ,MAAM,IAAI,CAAC,OAAO;AAC9B,YAAM,YACJ,IAAI,KAAK,eAAe,MAAM,EAAE,UAAU,IAAI,cAAc,cAAc,CAAC,EACxE,cAAc,GAAG,EACjB,KAAK,CAAC,MAAM,EAAE,SAAS,cAAc,GAAG,SAAS;AAEtD,YAAM,OAAO,GAAG,MAAM,GAAG,EAAE,MAAM,CAAC,EAAE,KAAK,GAAG,EAAE,QAAQ,MAAM,GAAG,KAAK;AAEpE,aAAO;AAAA,QACL,OAAO;AAAA,QACP,OAAO,IAAI,SAAS,KAAK,GAAG,QAAQ,MAAM,GAAG,CAAC;AAAA,QAC9C,cAAc,IAAI,SAAS,KAAK,IAAI;AAAA,QACpC,MAAM,mBAAmB,SAAS;AAAA,MACpC;AAAA,IACF,CAAC;AAED,UAAM,KAAK,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,EAAE,KAAK,CAAC;AAEtE,WAAO,MAAM,IAAI,CAAC,EAAE,OAAO,OAAO,aAAa,OAAO,EAAE,OAAO,OAAO,aAAa,EAAE;AAAA,EACvF,QAAQ;AACN,WAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const myProfileSchema = z.object({
|
|
3
|
+
name: z.string().min(1, "Nome \xE9 obrigat\xF3rio"),
|
|
4
|
+
gender: z.string().optional()
|
|
5
|
+
});
|
|
6
|
+
const changePasswordSchema = z.object({
|
|
7
|
+
currentPassword: z.string().min(1, "Senha atual \xE9 obrigat\xF3ria"),
|
|
8
|
+
newPassword: z.string().min(1, "Nova senha \xE9 obrigat\xF3ria").min(8, "Nova senha deve ter no m\xEDnimo 8 caracteres")
|
|
9
|
+
});
|
|
10
|
+
const changePhoneSchema = z.object({
|
|
11
|
+
phone: z.string().min(1, "N\xFAmero de telefone \xE9 obrigat\xF3rio").regex(/^\(\d{2}\) (\d \d{4}|\d{4})-\d{4}$/, "N\xFAmero de telefone inv\xE1lido")
|
|
12
|
+
});
|
|
13
|
+
const changeEmailSchema = z.object({
|
|
14
|
+
email: z.string().min(1, "E-mail \xE9 obrigat\xF3rio").email("E-mail inv\xE1lido")
|
|
15
|
+
});
|
|
16
|
+
const OTP_CODE_LENGTH = 5;
|
|
17
|
+
const VALID_OTP_CODE = "12345";
|
|
18
|
+
export {
|
|
19
|
+
OTP_CODE_LENGTH,
|
|
20
|
+
VALID_OTP_CODE,
|
|
21
|
+
changeEmailSchema,
|
|
22
|
+
changePasswordSchema,
|
|
23
|
+
changePhoneSchema,
|
|
24
|
+
myProfileSchema
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=account.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/validators/account.ts"],"sourcesContent":["import { z } from 'zod';\r\n\r\nexport const myProfileSchema = z.object({\r\n name: z.string().min(1, 'Nome é obrigatório'),\r\n gender: z.string().optional(),\r\n});\r\n\r\nexport type MyProfileFormData = z.infer<typeof myProfileSchema>;\r\n\r\nexport const changePasswordSchema = z.object({\r\n currentPassword: z.string().min(1, 'Senha atual é obrigatória'),\r\n newPassword: z\r\n .string()\r\n .min(1, 'Nova senha é obrigatória')\r\n .min(8, 'Nova senha deve ter no mínimo 8 caracteres'),\r\n});\r\n\r\nexport type ChangePasswordFormData = z.infer<typeof changePasswordSchema>;\r\n\r\nexport const changePhoneSchema = z.object({\r\n phone: z\r\n .string()\r\n .min(1, 'Número de telefone é obrigatório')\r\n .regex(/^\\(\\d{2}\\) (\\d \\d{4}|\\d{4})-\\d{4}$/, 'Número de telefone inválido'),\r\n});\r\n\r\nexport type ChangePhoneFormData = z.infer<typeof changePhoneSchema>;\r\n\r\nexport const changeEmailSchema = z.object({\r\n email: z.string().min(1, 'E-mail é obrigatório').email('E-mail inválido'),\r\n});\r\n\r\nexport type ChangeEmailFormData = z.infer<typeof changeEmailSchema>;\r\n\r\nexport const OTP_CODE_LENGTH = 5;\r\nexport const VALID_OTP_CODE = '12345';\r\n"],"mappings":"AAAA,SAAS,SAAS;AAEX,MAAM,kBAAkB,EAAE,OAAO;AAAA,EACtC,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,0BAAoB;AAAA,EAC5C,QAAQ,EAAE,OAAO,EAAE,SAAS;AAC9B,CAAC;AAIM,MAAM,uBAAuB,EAAE,OAAO;AAAA,EAC3C,iBAAiB,EAAE,OAAO,EAAE,IAAI,GAAG,iCAA2B;AAAA,EAC9D,aAAa,EACV,OAAO,EACP,IAAI,GAAG,gCAA0B,EACjC,IAAI,GAAG,+CAA4C;AACxD,CAAC;AAIM,MAAM,oBAAoB,EAAE,OAAO;AAAA,EACxC,OAAO,EACJ,OAAO,EACP,IAAI,GAAG,2CAAkC,EACzC,MAAM,sCAAsC,mCAA6B;AAC9E,CAAC;AAIM,MAAM,oBAAoB,EAAE,OAAO;AAAA,EACxC,OAAO,EAAE,OAAO,EAAE,IAAI,GAAG,4BAAsB,EAAE,MAAM,oBAAiB;AAC1E,CAAC;AAIM,MAAM,kBAAkB;AACxB,MAAM,iBAAiB;","names":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
function isValidEmail(value) {
|
|
2
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
3
|
+
return emailRegex.test(value.trim());
|
|
4
|
+
}
|
|
5
|
+
function isNumericString(value) {
|
|
6
|
+
return /^\d+$/.test(value);
|
|
7
|
+
}
|
|
8
|
+
function clampNumber(value, min, max) {
|
|
9
|
+
return Math.min(Math.max(value, min), max);
|
|
10
|
+
}
|
|
11
|
+
function isInRange(value, min, max) {
|
|
12
|
+
return !isNaN(value) && value >= min && value <= max;
|
|
13
|
+
}
|
|
14
|
+
function isConfirmationMatch(input, expected) {
|
|
15
|
+
return input === expected;
|
|
16
|
+
}
|
|
17
|
+
function hasExactLength(value, length) {
|
|
18
|
+
return value.length === length;
|
|
19
|
+
}
|
|
20
|
+
function hasMinLength(value, minLength) {
|
|
21
|
+
return value.length >= minLength;
|
|
22
|
+
}
|
|
23
|
+
function areFieldsRequired(...values) {
|
|
24
|
+
return values.every((v) => v.trim().length > 0);
|
|
25
|
+
}
|
|
26
|
+
const MIN_PHONE_LENGTH = 14;
|
|
27
|
+
function isNonEmptyString(value) {
|
|
28
|
+
return value.trim().length > 0;
|
|
29
|
+
}
|
|
30
|
+
function trimOrDefault(value, fallback) {
|
|
31
|
+
const trimmed = value.trim();
|
|
32
|
+
return trimmed.length > 0 ? trimmed : fallback;
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
MIN_PHONE_LENGTH,
|
|
36
|
+
areFieldsRequired,
|
|
37
|
+
clampNumber,
|
|
38
|
+
hasExactLength,
|
|
39
|
+
hasMinLength,
|
|
40
|
+
isConfirmationMatch,
|
|
41
|
+
isInRange,
|
|
42
|
+
isNonEmptyString,
|
|
43
|
+
isNumericString,
|
|
44
|
+
isValidEmail,
|
|
45
|
+
trimOrDefault
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=common.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/validators/common.ts"],"sourcesContent":["export function isValidEmail(value: string): boolean {\r\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\r\n return emailRegex.test(value.trim());\r\n}\r\n\r\nexport function isNumericString(value: string): boolean {\r\n return /^\\d+$/.test(value);\r\n}\r\n\r\nexport function clampNumber(value: number, min: number, max: number): number {\r\n return Math.min(Math.max(value, min), max);\r\n}\r\n\r\nexport function isInRange(value: number, min: number, max: number): boolean {\r\n return !isNaN(value) && value >= min && value <= max;\r\n}\r\n\r\nexport function isConfirmationMatch(input: string, expected: string): boolean {\r\n return input === expected;\r\n}\r\n\r\nexport function hasExactLength(value: string, length: number): boolean {\r\n return value.length === length;\r\n}\r\n\r\nexport function hasMinLength(value: string, minLength: number): boolean {\r\n return value.length >= minLength;\r\n}\r\n\r\nexport function areFieldsRequired(...values: string[]): boolean {\r\n return values.every((v) => v.trim().length > 0);\r\n}\r\n\r\nexport const MIN_PHONE_LENGTH = 14;\r\n\r\nexport function isNonEmptyString(value: string): boolean {\r\n return value.trim().length > 0;\r\n}\r\n\r\nexport function trimOrDefault(value: string, fallback: string): string {\r\n const trimmed = value.trim();\r\n return trimmed.length > 0 ? trimmed : fallback;\r\n}\r\n"],"mappings":"AAAO,SAAS,aAAa,OAAwB;AACnD,QAAM,aAAa;AACnB,SAAO,WAAW,KAAK,MAAM,KAAK,CAAC;AACrC;AAEO,SAAS,gBAAgB,OAAwB;AACtD,SAAO,QAAQ,KAAK,KAAK;AAC3B;AAEO,SAAS,YAAY,OAAe,KAAa,KAAqB;AAC3E,SAAO,KAAK,IAAI,KAAK,IAAI,OAAO,GAAG,GAAG,GAAG;AAC3C;AAEO,SAAS,UAAU,OAAe,KAAa,KAAsB;AAC1E,SAAO,CAAC,MAAM,KAAK,KAAK,SAAS,OAAO,SAAS;AACnD;AAEO,SAAS,oBAAoB,OAAe,UAA2B;AAC5E,SAAO,UAAU;AACnB;AAEO,SAAS,eAAe,OAAe,QAAyB;AACrE,SAAO,MAAM,WAAW;AAC1B;AAEO,SAAS,aAAa,OAAe,WAA4B;AACtE,SAAO,MAAM,UAAU;AACzB;AAEO,SAAS,qBAAqB,QAA2B;AAC9D,SAAO,OAAO,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC;AAChD;AAEO,MAAM,mBAAmB;AAEzB,SAAS,iBAAiB,OAAwB;AACvD,SAAO,MAAM,KAAK,EAAE,SAAS;AAC/B;AAEO,SAAS,cAAc,OAAe,UAA0B;AACrE,QAAM,UAAU,MAAM,KAAK;AAC3B,SAAO,QAAQ,SAAS,IAAI,UAAU;AACxC;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@greatapps/common",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.26",
|
|
4
4
|
"description": "Shared library for GreatApps frontend applications",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"zod": "^4.3.6"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
+
"@hookform/resolvers": "^5.2.2",
|
|
56
57
|
"@tanstack/react-query": "^5.90.5",
|
|
57
58
|
"@tanstack/react-query-devtools": "^5.90.2",
|
|
58
59
|
"@types/node": "^25.3.2",
|
|
@@ -62,15 +63,18 @@
|
|
|
62
63
|
"next": "15.5.9",
|
|
63
64
|
"react": "19.1.4",
|
|
64
65
|
"react-dom": "19.1.4",
|
|
66
|
+
"react-hook-form": "^7.71.2",
|
|
65
67
|
"tsup": "^8.5.1",
|
|
66
68
|
"typescript": "^5.9.3",
|
|
67
69
|
"zustand": "^5.0.11"
|
|
68
70
|
},
|
|
69
71
|
"peerDependencies": {
|
|
72
|
+
"@hookform/resolvers": ">=3.0.0",
|
|
70
73
|
"@tanstack/react-query": ">=5.0.0",
|
|
71
74
|
"next": ">=15.0.0",
|
|
72
75
|
"react": ">=19.0.0",
|
|
73
76
|
"react-dom": ">=19.0.0",
|
|
77
|
+
"react-hook-form": ">=7.0.0",
|
|
74
78
|
"sonner": ">=2.0.0",
|
|
75
79
|
"zustand": ">=4.0.0"
|
|
76
80
|
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Lock, Settings2, User, X } from 'lucide-react';
|
|
4
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';
|
|
5
|
+
import { Tabs, TabsList, TabsTrigger, TabsContent } from '../ui/data-display/Tabs';
|
|
6
|
+
import { Button } from '../ui/buttons/Button';
|
|
7
|
+
import { cn } from '../../infra/utils/clsx';
|
|
8
|
+
import { AccountSectionType } from '../../enums/AccountSectionType';
|
|
9
|
+
import { MyProfileSection } from './sections/MyProfileSection';
|
|
10
|
+
import { PreferencesSection } from './sections/PreferencesSection';
|
|
11
|
+
import { ChangePasswordSection } from './sections/ChangePasswordSection';
|
|
12
|
+
import { SecuritySection } from './sections/SecuritySection';
|
|
13
|
+
import useConfigurationsModal from './hooks/useConfigurationsModal';
|
|
14
|
+
import useIsMobile from '../../hooks/useIsMobile';
|
|
15
|
+
import type { ComboboxOption } from '../ui/form/ComboboxField';
|
|
16
|
+
|
|
17
|
+
interface ConfigurationsMyAccountModalProps {
|
|
18
|
+
open: boolean;
|
|
19
|
+
onClose: () => void;
|
|
20
|
+
initialSection?: AccountSectionType;
|
|
21
|
+
hasActiveSubscription?: boolean;
|
|
22
|
+
currencies?: ComboboxOption[];
|
|
23
|
+
storageUrl?: string;
|
|
24
|
+
onDeleteAccount?: () => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default function ConfigurationsMyAccountModal({
|
|
28
|
+
open,
|
|
29
|
+
onClose,
|
|
30
|
+
initialSection,
|
|
31
|
+
hasActiveSubscription,
|
|
32
|
+
currencies = [],
|
|
33
|
+
storageUrl,
|
|
34
|
+
onDeleteAccount,
|
|
35
|
+
}: ConfigurationsMyAccountModalProps) {
|
|
36
|
+
const isMobile = useIsMobile();
|
|
37
|
+
const { activeSection, setActiveSection } = useConfigurationsModal({
|
|
38
|
+
isOpen: open,
|
|
39
|
+
initialSection,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const tabTriggerClasses = cn(
|
|
43
|
+
'border-0! px-0 py-0',
|
|
44
|
+
|
|
45
|
+
'lg:rounded-md lg:flex lg:items-center lg:gap-2 lg:p-3 lg:justify-start lg:w-full',
|
|
46
|
+
'lg:bg-white lg:hover:bg-gray-100 lg:active:bg-gray-50 lg:border-0',
|
|
47
|
+
'lg:data-[state=active]:bg-gray-50',
|
|
48
|
+
|
|
49
|
+
'flex items-center gap-1.5 px-3 py-3 justify-center whitespace-nowrap',
|
|
50
|
+
'border-b-2 border-transparent',
|
|
51
|
+
'data-[state=active]:bg-gray-50 rounded-lg',
|
|
52
|
+
|
|
53
|
+
'text-gray-500 data-[state=active]:text-gray-950',
|
|
54
|
+
'hover:text-gray-900 transition-colors'
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Dialog open={open} onOpenChange={onClose}>
|
|
59
|
+
<DialogContent
|
|
60
|
+
showCloseButton={!isMobile}
|
|
61
|
+
overlayClassName="bg-black/20 lg:bg-black/50"
|
|
62
|
+
className="
|
|
63
|
+
flex flex-col p-0 gap-0 max-w-full! overflow-x-hidden border-0
|
|
64
|
+
rounded-t-2xl rounded-b-none h-[100dvh] top-0! bottom-0! left-0! right-0! translate-x-0! translate-y-0!
|
|
65
|
+
lg:flex-row lg:w-[892px]! lg:max-w-[892px]! lg:h-[626px]! lg:rounded-lg lg:border
|
|
66
|
+
lg:top-[50%]! lg:bottom-auto! lg:left-[50%]! lg:right-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!"
|
|
67
|
+
>
|
|
68
|
+
<DialogHeader className="sr-only">
|
|
69
|
+
<DialogTitle>Configurações</DialogTitle>
|
|
70
|
+
</DialogHeader>
|
|
71
|
+
<div className="md:hidden flex items-center justify-between px-5 py-3 border-b border-gray-200">
|
|
72
|
+
<span className="text-gray-950 paragraph-medium-semibold">Configurações</span>
|
|
73
|
+
<button
|
|
74
|
+
type="button"
|
|
75
|
+
className="size-8 flex items-center justify-center text-gray-500 cursor-pointer"
|
|
76
|
+
onClick={onClose}
|
|
77
|
+
>
|
|
78
|
+
<X size={18} />
|
|
79
|
+
</button>
|
|
80
|
+
</div>
|
|
81
|
+
<Tabs
|
|
82
|
+
value={activeSection}
|
|
83
|
+
onValueChange={(value) => setActiveSection(value as AccountSectionType)}
|
|
84
|
+
orientation="vertical"
|
|
85
|
+
className="flex lg:flex-row flex-col w-full h-full flex-1 lg:h-full lg:pt-0 lg:gap-0"
|
|
86
|
+
>
|
|
87
|
+
<TabsList
|
|
88
|
+
className={cn(
|
|
89
|
+
'flex gap-0 bg-transparent border-b-0',
|
|
90
|
+
|
|
91
|
+
'lg:flex-col lg:items-stretch lg:justify-start lg:w-auto lg:min-w-60',
|
|
92
|
+
'lg:border-r lg:border-gray-200 lg:pl-5 lg:pr-5 lg:pt-5 lg:gap-5 lg:overflow-x-visible lg:self-stretch',
|
|
93
|
+
|
|
94
|
+
'flex-row items-center justify-start w-full overflow-x-auto scrollbar-hide shrink-0',
|
|
95
|
+
'px-4 py-3',
|
|
96
|
+
'[mask-image:linear-gradient(to_right,transparent,black_16px,black_calc(100%-24px),transparent)] lg:[mask-image:none]'
|
|
97
|
+
)}
|
|
98
|
+
>
|
|
99
|
+
<span className="hidden lg:block paragraph-medium-semibold text-gray-950 mb-0">
|
|
100
|
+
Configurações
|
|
101
|
+
</span>
|
|
102
|
+
|
|
103
|
+
<div className="lg:flex lg:flex-col flex flex-row lg:gap-0 gap-0 lg:w-full">
|
|
104
|
+
<TabsTrigger value={AccountSectionType.MY_PROFILE} className={tabTriggerClasses}>
|
|
105
|
+
<User size={20} className="shrink-0" />
|
|
106
|
+
<span className="paragraph-small-medium">Meu perfil</span>
|
|
107
|
+
</TabsTrigger>
|
|
108
|
+
|
|
109
|
+
<TabsTrigger value={AccountSectionType.PREFERENCES} className={tabTriggerClasses}>
|
|
110
|
+
<Settings2 size={20} className="shrink-0" />
|
|
111
|
+
<span className="paragraph-small-medium">Preferências</span>
|
|
112
|
+
</TabsTrigger>
|
|
113
|
+
|
|
114
|
+
<TabsTrigger value={AccountSectionType.SECURITY} className={tabTriggerClasses}>
|
|
115
|
+
<Lock size={20} className="shrink-0" />
|
|
116
|
+
<span className="paragraph-small-medium">Segurança</span>
|
|
117
|
+
</TabsTrigger>
|
|
118
|
+
</div>
|
|
119
|
+
</TabsList>
|
|
120
|
+
|
|
121
|
+
<div className="w-full flex-1 min-h-0 lg:h-full overflow-hidden lg:overflow-visible relative">
|
|
122
|
+
<TabsContent value={AccountSectionType.MY_PROFILE} className="h-full! relative overflow-hidden">
|
|
123
|
+
<MyProfileSection onClose={onClose} storageUrl={storageUrl} />
|
|
124
|
+
</TabsContent>
|
|
125
|
+
|
|
126
|
+
<TabsContent value={AccountSectionType.SECURITY} className="h-full! relative overflow-hidden">
|
|
127
|
+
<SecuritySection
|
|
128
|
+
setActiveSection={setActiveSection}
|
|
129
|
+
onClose={onClose}
|
|
130
|
+
hasActiveSubscription={hasActiveSubscription}
|
|
131
|
+
onDeleteAccount={onDeleteAccount}
|
|
132
|
+
/>
|
|
133
|
+
</TabsContent>
|
|
134
|
+
|
|
135
|
+
<TabsContent value={AccountSectionType.CHANGE_PASSWORD} className="h-full! relative overflow-hidden">
|
|
136
|
+
<ChangePasswordSection onBack={() => setActiveSection(AccountSectionType.SECURITY)} />
|
|
137
|
+
</TabsContent>
|
|
138
|
+
|
|
139
|
+
<TabsContent value={AccountSectionType.PREFERENCES} className="h-full! relative overflow-hidden">
|
|
140
|
+
<PreferencesSection onClose={onClose} currencies={currencies} />
|
|
141
|
+
</TabsContent>
|
|
142
|
+
</div>
|
|
143
|
+
</Tabs>
|
|
144
|
+
</DialogContent>
|
|
145
|
+
</Dialog>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { TriangleAlert } from 'lucide-react';
|
|
4
|
+
import { Button } from '../ui/buttons/Button';
|
|
5
|
+
import {
|
|
6
|
+
Dialog,
|
|
7
|
+
DialogContent,
|
|
8
|
+
DialogHeader,
|
|
9
|
+
DialogTitle,
|
|
10
|
+
DialogDescription,
|
|
11
|
+
} from '../ui/overlay/Dialog';
|
|
12
|
+
import { Separator } from '../ui/data-display/Separator';
|
|
13
|
+
|
|
14
|
+
interface ConfirmGlobalPreferencesModalProps {
|
|
15
|
+
open: boolean;
|
|
16
|
+
onConfirm: () => void;
|
|
17
|
+
onCancel: () => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default function ConfirmGlobalPreferencesModal({
|
|
21
|
+
open,
|
|
22
|
+
onConfirm,
|
|
23
|
+
onCancel,
|
|
24
|
+
}: ConfirmGlobalPreferencesModalProps) {
|
|
25
|
+
return (
|
|
26
|
+
<Dialog open={open} onOpenChange={onCancel}>
|
|
27
|
+
<DialogContent className="flex flex-col p-0 gap-0 md:w-[386px]! lg:w-[386px]! max-w-[386px]! max-[386px]:w-[calc(100%-32px)]">
|
|
28
|
+
<DialogHeader className="sr-only">
|
|
29
|
+
<DialogTitle>Alterar preferências globais</DialogTitle>
|
|
30
|
+
<DialogDescription>
|
|
31
|
+
Confirmação de alteração de preferências globais da conta
|
|
32
|
+
</DialogDescription>
|
|
33
|
+
</DialogHeader>
|
|
34
|
+
|
|
35
|
+
<div className="flex flex-col gap-3 p-5">
|
|
36
|
+
<div className="flex items-center justify-center bg-gray-50 rounded-lg size-10">
|
|
37
|
+
<TriangleAlert size={24} className="text-gray-950" />
|
|
38
|
+
</div>
|
|
39
|
+
<div className="flex flex-col gap-2">
|
|
40
|
+
<span className="paragraph-medium-semibold text-gray-950">
|
|
41
|
+
Alterar preferências globais
|
|
42
|
+
</span>
|
|
43
|
+
<span className="paragraph-small-regular text-gray-600">
|
|
44
|
+
Você está alterando configurações que impactam{' '}
|
|
45
|
+
<span className="paragraph-small-semibold text-gray-950">
|
|
46
|
+
todos os usuários da conta
|
|
47
|
+
</span>
|
|
48
|
+
. Deseja confirmar?
|
|
49
|
+
</span>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<Separator className="w-full" />
|
|
54
|
+
|
|
55
|
+
<div className="flex items-center gap-2 p-5">
|
|
56
|
+
<Button onClick={onConfirm} className="h-10!">
|
|
57
|
+
Confirmar
|
|
58
|
+
</Button>
|
|
59
|
+
<Button variant="secondary" onClick={onCancel} className="h-10!">
|
|
60
|
+
Cancelar
|
|
61
|
+
</Button>
|
|
62
|
+
</div>
|
|
63
|
+
</DialogContent>
|
|
64
|
+
</Dialog>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { ShieldCheck } from 'lucide-react';
|
|
4
|
+
import { Button } from '../ui/buttons/Button';
|
|
5
|
+
import {
|
|
6
|
+
Dialog,
|
|
7
|
+
DialogContent,
|
|
8
|
+
DialogDescription,
|
|
9
|
+
DialogHeader,
|
|
10
|
+
DialogTitle,
|
|
11
|
+
} from '../ui/overlay/Dialog';
|
|
12
|
+
import { InputOTP, InputOTPGroup, InputOTPSlot } from '../ui/form/InputOtp';
|
|
13
|
+
import useDisableTwoFactorAuthForm from './hooks/useDisableTwoFactorAuthForm';
|
|
14
|
+
|
|
15
|
+
interface DisableTwoFactorAuthModalProps {
|
|
16
|
+
open: boolean;
|
|
17
|
+
onClose: () => void;
|
|
18
|
+
onSuccess?: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default function DisableTwoFactorAuthModal({
|
|
22
|
+
open,
|
|
23
|
+
onClose,
|
|
24
|
+
onSuccess,
|
|
25
|
+
}: DisableTwoFactorAuthModalProps) {
|
|
26
|
+
const { code, setCode, isValid, isLoading, handleClose, handleSubmit } =
|
|
27
|
+
useDisableTwoFactorAuthForm({ onClose, onSuccess });
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<Dialog open={open} onOpenChange={handleClose}>
|
|
31
|
+
<DialogContent className="flex flex-col p-0 gap-0 max-w-full! border-0 rounded-t-2xl rounded-b-none h-dvh top-0! bottom-0! left-0! right-0! translate-x-0! translate-y-0! lg:max-w-117.5! lg:h-auto! lg:rounded-lg lg:border lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!">
|
|
32
|
+
<form
|
|
33
|
+
onSubmit={(e) => {
|
|
34
|
+
e.preventDefault();
|
|
35
|
+
handleSubmit();
|
|
36
|
+
}}
|
|
37
|
+
className="flex flex-col flex-1 lg:flex-none"
|
|
38
|
+
>
|
|
39
|
+
<div className="flex flex-col gap-4 lg:gap-5 p-4 lg:p-5 flex-1 lg:flex-none">
|
|
40
|
+
<div className="flex items-center justify-center w-fit bg-gray-50 rounded-lg p-2">
|
|
41
|
+
<ShieldCheck size={20} className="text-gray-600" />
|
|
42
|
+
</div>
|
|
43
|
+
<DialogHeader className="p-0 gap-2">
|
|
44
|
+
<DialogTitle className="paragraph-medium-semibold text-gray-950">
|
|
45
|
+
Desabilitar autenticação 2FA
|
|
46
|
+
</DialogTitle>
|
|
47
|
+
<DialogDescription className="paragraph-small-regular text-gray-600">
|
|
48
|
+
Informe o código de 6 dígitos do seu aplicativo autenticador para confirmar a
|
|
49
|
+
desativação.
|
|
50
|
+
</DialogDescription>
|
|
51
|
+
</DialogHeader>
|
|
52
|
+
|
|
53
|
+
<div className="flex flex-col gap-2">
|
|
54
|
+
<span className="paragraph-small-medium text-gray-700">Código do autenticador</span>
|
|
55
|
+
<InputOTP maxLength={6} value={code} onChange={setCode}>
|
|
56
|
+
<InputOTPGroup className="gap-2">
|
|
57
|
+
{Array.from({ length: 6 }).map((_, i) => (
|
|
58
|
+
<InputOTPSlot
|
|
59
|
+
key={i}
|
|
60
|
+
index={i}
|
|
61
|
+
className="w-11! lg:w-12! h-13! lg:h-14! rounded-lg! text-lg border-gray-200"
|
|
62
|
+
/>
|
|
63
|
+
))}
|
|
64
|
+
</InputOTPGroup>
|
|
65
|
+
</InputOTP>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div className="flex flex-row items-center gap-2 p-4 lg:p-5 border-t border-gray-200 mt-auto lg:mt-0">
|
|
70
|
+
<Button className="h-10! flex-1" disabled={!isValid || isLoading} type="submit">
|
|
71
|
+
{isLoading ? 'Desabilitando...' : 'Desabilitar 2FA'}
|
|
72
|
+
</Button>
|
|
73
|
+
<Button
|
|
74
|
+
variant="secondary"
|
|
75
|
+
className="h-10! flex-1"
|
|
76
|
+
type="button"
|
|
77
|
+
onClick={handleClose}
|
|
78
|
+
>
|
|
79
|
+
Cancelar
|
|
80
|
+
</Button>
|
|
81
|
+
</div>
|
|
82
|
+
</form>
|
|
83
|
+
</DialogContent>
|
|
84
|
+
</Dialog>
|
|
85
|
+
);
|
|
86
|
+
}
|