-
Notifications
You must be signed in to change notification settings - Fork 889
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Imported from brave-ui: Welcome - ✨New welcome flow for importing set…
…tings
- Loading branch information
Showing
6 changed files
with
97 additions
and
14 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,60 @@ | ||
/* 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 http://mozilla.org/MPL/2.0/. */ | ||
|
||
import styled, { css } from '../../../theme' | ||
import palette from '../../../theme/colors' | ||
import caratUrl from './carat.svg' | ||
|
||
export interface SelectBoxProps { | ||
id?: string | ||
multiple?: boolean | ||
autoFocus?: boolean | ||
disabled?: boolean | ||
value?: string | ||
onChange?: (e: any) => void | ||
children: React.ReactNode | ||
} | ||
|
||
export const SelectBox = styled<SelectBoxProps, 'select'>('select')` | ||
box-sizing: border-box; | ||
position: relative; | ||
-webkit-font-smoothing: antialiased; | ||
border-radius: 4px; | ||
display: flex; | ||
align-items: center; | ||
width: 100%; | ||
appearance: none; | ||
height: 32px; | ||
color: ${p => p.theme.color.text}; | ||
font-size: 12px; | ||
font-weight: 500; | ||
line-height: 18px; | ||
font-family: ${p => p.theme.fontFamily.heading}; | ||
border: 1px solid ${p => p.theme.color.inputBorder}; | ||
background: url(${caratUrl}) 97% / 16px no-repeat transparent; | ||
/* avoid text overflow w/ carat */ | ||
-webkit-padding-start: 10px; | ||
-webkit-padding-end: 32px; | ||
outline-width: 2px; | ||
outline-color: ${p => p.theme.color.brandBrave}; | ||
cursor: pointer; | ||
> option { | ||
/* see https://github.com/brave/brave-browser/issues/4213 for info */ | ||
color: ${palette.black}; | ||
} | ||
${(p: SelectBoxProps) => p.disabled | ||
? css` | ||
user-select: none; | ||
opacity: 0.6; | ||
` : '' | ||
} | ||
${(p: SelectBoxProps) => p.multiple | ||
? css` | ||
padding: 6px; | ||
background: none; | ||
` : '' | ||
} | ||
` |
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