-
Notifications
You must be signed in to change notification settings - Fork 114
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 #1378 from newrelic/clang/responsive-landing
Make o11y pack landing more responsive
- Loading branch information
Showing
2 changed files
with
189 additions
and
122 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,93 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { css } from '@emotion/react'; | ||
|
||
const Select = ({ disabled, ...props }) => ( | ||
<div | ||
css={css` | ||
height: 1.75rem; | ||
display: grid; | ||
grid-template-areas: 'select'; | ||
align-items: center; | ||
width: 100%; | ||
border: 1px solid var(--color-neutrals-500); | ||
border-radius: 0.25rem; | ||
padding: 0.25rem 0.5rem; | ||
cursor: pointer; | ||
position: relative; | ||
${disabled && | ||
css` | ||
cursor: not-allowed; | ||
opacity: 0.5; | ||
.light-mode & { | ||
background-color: var(--color-neutrals-100); | ||
} | ||
`} | ||
.dark-mode & { | ||
border: 1px solid var(--color-dark-300); | ||
background-color: var(--color-dark-300); | ||
} | ||
&::after { | ||
content: ''; | ||
grid-area: select; | ||
justify-self: end; | ||
width: 0.5rem; | ||
height: 0.25rem; | ||
clip-path: polygon(100% 0%, 0 0%, 50% 100%); | ||
background-color: var(--color-neutrals-700); | ||
.dark-mode & { | ||
background-color: var(--color-dark-700); | ||
} | ||
} | ||
`} | ||
> | ||
<select | ||
disabled={disabled} | ||
css={css` | ||
grid-area: select; | ||
appearance: none; | ||
background-color: transparent; | ||
border: none; | ||
padding: 0 1em 0 0; | ||
margin: 0; | ||
width: 100%; | ||
font-family: inherit; | ||
font-size: 14px; | ||
cursor: inherit; | ||
line-height: inherit; | ||
outline: none; | ||
&:focus + .focus-ring { | ||
position: absolute; | ||
top: -1px; | ||
left: -1px; | ||
right: -1px; | ||
bottom: -1px; | ||
outline: 2px solid var(--color-brand-500); | ||
border-radius: inherit; | ||
} | ||
.dark-mode & { | ||
color: var(--color-dark-900); | ||
option { | ||
color: var(--color-dark-050); | ||
} | ||
} | ||
`} | ||
{...props} | ||
/> | ||
<span className="focus-ring" /> | ||
</div> | ||
); | ||
|
||
Select.propTypes = { | ||
disabled: PropTypes.bool, | ||
}; | ||
|
||
export default Select; |
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