-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from deriv-com/aizad/FEQ-1560/password-input
Aizad/FEQ-1560/Password Input Field
- Loading branch information
Showing
15 changed files
with
552 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
$inactive_color: #999999; | ||
$success_color: #4bb4b3; | ||
$warning_color: #ffad3a; | ||
$error_field: #ec3f3f; | ||
|
||
.deriv-helper-message { | ||
font-size: 12px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 18px; | ||
&--general { | ||
color: $inactive_color; | ||
} | ||
&--success { | ||
color: $success_color; | ||
} | ||
&--warning { | ||
color: $warning_color; | ||
} | ||
&--error { | ||
color: $error_field; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
export type TScore = 0 | 1 | 2 | 3 | 4; | ||
|
||
export type passwordKeys = | ||
| "common" | ||
| "commonNames" | ||
| "dates" | ||
| "extendedRepeat" | ||
| "keyPattern" | ||
| "namesByThemselves" | ||
| "pwned" | ||
| "recentYears" | ||
| "sequences" | ||
| "similarToCommon" | ||
| "simpleRepeat" | ||
| "straightRow" | ||
| "topHundred" | ||
| "topTen" | ||
| "userInputs" | ||
| "wordByItself"; | ||
|
||
export const passwordRegex = { | ||
hasLowerCase: /[a-z]/, | ||
hasNumber: /\d/, | ||
hasSymbol: /\W/, | ||
hasUpperCase: /[A-Z]/, | ||
isLengthValid: /^.{8,25}$/, | ||
isPasswordValid: /^(?=.*[a-z])(?=.*\d)(?=.*[A-Z])[!-~]{8,25}$/, | ||
}; | ||
|
||
export const passwordValues = { | ||
longPassword: 12, | ||
maxLength: 25, | ||
minLength: 8, | ||
}; | ||
|
||
export const passwordErrorMessage = { | ||
invalidLength: "You should enter 8-25 characters.", | ||
missingCharacter: | ||
"Password should have lower and uppercase English letters with numbers.", | ||
PasswordError: "That password is incorrect. Please try again.", | ||
}; | ||
|
||
export const warningMessages: Record<passwordKeys, string> = { | ||
common: "This is a very common password.", | ||
commonNames: "Common names and surnames are easy to guess.", | ||
dates: "Dates are easy to guess.", | ||
extendedRepeat: | ||
'Repeated character patterns like "abcabcabc" are easy to guess.', | ||
keyPattern: "Short keyboard patterns are easy to guess.", | ||
namesByThemselves: "Single names or surnames are easy to guess.", | ||
pwned: "Your password was exposed by a data breach on the Internet.", | ||
recentYears: "Recent years are easy to guess.", | ||
sequences: 'Common character sequences like "abc" are easy to guess.', | ||
similarToCommon: "This is similar to a commonly used password.", | ||
simpleRepeat: 'Repeated characters like "aaa" are easy to guess.', | ||
straightRow: "Straight rows of keys on your keyboard are easy to guess.", | ||
topHundred: "This is a frequently used password.", | ||
topTen: "This is a heavily used password.", | ||
userInputs: "There should not be any personal or page related data.", | ||
wordByItself: "Single words are easy to guess.", | ||
}; |
Oops, something went wrong.