From e3df8ea64f4978dfb8d0b9bae964387692780757 Mon Sep 17 00:00:00 2001 From: Chuma McPhoy Date: Wed, 9 Oct 2024 13:58:31 +0200 Subject: [PATCH] chore(SW-360): move password form types --- components/TempDesignSystem/Form/NewPassword/index.tsx | 7 +++---- types/components/form/newPassword.ts | 3 +++ utils/passwordValidator.ts | 2 -- 3 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 types/components/form/newPassword.ts diff --git a/components/TempDesignSystem/Form/NewPassword/index.tsx b/components/TempDesignSystem/Form/NewPassword/index.tsx index 3cd9ac2f2..070a282af 100644 --- a/components/TempDesignSystem/Form/NewPassword/index.tsx +++ b/components/TempDesignSystem/Form/NewPassword/index.tsx @@ -14,16 +14,15 @@ import { } from "@/components/Icons" import AriaInputWithLabel from "@/components/TempDesignSystem/Form/Input/AriaInputWithLabel" import Caption from "@/components/TempDesignSystem/Text/Caption" -import { - PasswordValidatorKey, - passwordValidators, -} from "@/utils/passwordValidator" +import { passwordValidators } from "@/utils/passwordValidator" import Button from "../../Button" import { IconProps, type NewPasswordProps } from "./newPassword" import styles from "./newPassword.module.css" +import { PasswordValidatorKey } from "@/types/components/form/newPassword" + export default function NewPassword({ name = "newPassword", "aria-label": ariaLabel, diff --git a/types/components/form/newPassword.ts b/types/components/form/newPassword.ts new file mode 100644 index 000000000..cd6aa0c50 --- /dev/null +++ b/types/components/form/newPassword.ts @@ -0,0 +1,3 @@ +import { passwordValidators } from "@/utils/passwordValidator" + +export type PasswordValidatorKey = keyof typeof passwordValidators diff --git a/utils/passwordValidator.ts b/utils/passwordValidator.ts index 8a8d74778..a3a1fcd3d 100644 --- a/utils/passwordValidator.ts +++ b/utils/passwordValidator.ts @@ -25,8 +25,6 @@ export const passwordValidators = { }, } -export type PasswordValidatorKey = keyof typeof passwordValidators - export const passwordValidator = (msg = "Required field") => z .string()