-
Notifications
You must be signed in to change notification settings - Fork 887
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dda7577
commit 51d11ab
Showing
34 changed files
with
1,564 additions
and
12 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
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
22 changes: 22 additions & 0 deletions
22
browser/resources/settings/getting_started_page/brave_account_browser_proxy.ts
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,22 @@ | ||
/* Copyright (c) 2024 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
import { sendWithPromise } from '//resources/js/cr.js' | ||
|
||
export interface BraveAccountBrowserProxy { | ||
getPasswordStrength(password: string): Promise<number> | ||
} | ||
|
||
export class BraveAccountBrowserProxyImpl implements BraveAccountBrowserProxy { | ||
getPasswordStrength (password: string) { | ||
return sendWithPromise('getPasswordStrength', password) | ||
} | ||
|
||
static getInstance() { | ||
return instance || (instance = new BraveAccountBrowserProxyImpl()) | ||
} | ||
} | ||
|
||
let instance: BraveAccountBrowserProxy | null = null |
26 changes: 26 additions & 0 deletions
26
browser/resources/settings/getting_started_page/brave_account_common.css
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,26 @@ | ||
/* Copyright (c) 2024 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
/* #css_wrapper_metadata_start | ||
* #type=style-lit | ||
* #css_wrapper_metadata_end */ | ||
|
||
.label { | ||
color: var(--leo-color-text-primary); | ||
font: var(--leo-font-small-semibold); | ||
margin: 0px 0px 0px var(--leo-spacing-s); | ||
} | ||
|
||
.label.error { | ||
color: var(--leo-color-systemfeedback-error-text); | ||
} | ||
|
||
leo-input { | ||
--leo-control-border-color: var(--leo-color-divider-strong); | ||
} | ||
|
||
leo-input:not(:focus):has(> .error) { | ||
--leo-control-border-color: var(--leo-color-systemfeedback-error-icon); | ||
} |
40 changes: 40 additions & 0 deletions
40
browser/resources/settings/getting_started_page/brave_account_common.ts
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,40 @@ | ||
/* Copyright (c) 2024 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
export function onEyeIconClicked(event: Event) { | ||
event.preventDefault() | ||
let type = 'password' | ||
const target = event.target as Element | ||
target.setAttribute('name', | ||
target.getAttribute('name') === 'eye-off' | ||
? (type = 'text', 'eye-on') | ||
: 'eye-off') | ||
target.parentElement!.setAttribute('type', type) | ||
} | ||
|
||
export function isEmailValid(input: string) { | ||
if (!input) { | ||
// input is falsy | ||
return false | ||
} | ||
|
||
if (!/^[\x00-\x7F]+$/.test(input)) { | ||
// input contains non-ASCII | ||
return false | ||
} | ||
|
||
const index = input.lastIndexOf('@') | ||
if (index === -1) { | ||
// there's no @ sign in input | ||
return false | ||
} | ||
|
||
if (input.substring(0, index) === "" || input.substring(index + 1) === "") { | ||
// there are no characters either before or after the last @ sign | ||
return false | ||
} | ||
|
||
return true | ||
} |
68 changes: 68 additions & 0 deletions
68
browser/resources/settings/getting_started_page/brave_account_create_dialog.css
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,68 @@ | ||
/* Copyright (c) 2024 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
/* #css_wrapper_metadata_start | ||
* #type=style-lit | ||
* #scheme=relative | ||
* #import=./brave_account_common.css.js | ||
* #include=brave-account-common | ||
* #css_wrapper_metadata_end */ | ||
|
||
.dropdown { | ||
height: var(--height); | ||
margin: calc(-1 * var(--height)) var(--leo-spacing-s) 0px var(--leo-spacing-s); | ||
position: relative; | ||
transition: all 750ms; | ||
z-index: -1; | ||
} | ||
|
||
.dropdown.visible { | ||
margin-top: var(--leo-spacing-s); | ||
} | ||
|
||
#brave-alias-dropdown { | ||
--height: 36px; | ||
--leo-icon-size: var(--leo-icon-xs); | ||
display: flex; | ||
font: var(--leo-font-small-regular); | ||
gap: var(--leo-spacing-s); | ||
} | ||
|
||
#password-dropdown { | ||
--height: 18px; | ||
display: flex; | ||
} | ||
|
||
#password-confirmation-dropdown { | ||
--height: 18px; | ||
--leo-icon-size: var(--leo-icon-xs); | ||
align-items: center; | ||
display: flex; | ||
font: var(--leo-font-small-regular); | ||
gap: var(--leo-spacing-s); | ||
} | ||
|
||
leo-icon[name=check-circle-filled] { | ||
--leo-icon-color: var(--leo-color-text-interactive); | ||
} | ||
|
||
leo-icon[name=check-circle-filled] + div { | ||
color: var(--leo-color-text-interactive); | ||
} | ||
|
||
leo-icon[name=warning-triangle-filled] { | ||
--leo-icon-color: var(--leo-color-systemfeedback-error-icon); | ||
} | ||
|
||
leo-icon[name=warning-triangle-filled] + div { | ||
color: var(--leo-color-systemfeedback-error-text); | ||
} | ||
|
||
leo-checkbox a { | ||
color: var(--leo-color-text-interactive); | ||
font: var(--leo-font-default-link); | ||
text-decoration-skip-ink: none; | ||
text-underline-offset: 2.8px; | ||
} |
Oops, something went wrong.