-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update based on design team's feedback
- Loading branch information
Showing
11 changed files
with
484 additions
and
142 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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 @@ | ||
export { default } from './OrganizationSelector'; |
185 changes: 185 additions & 0 deletions
185
src/ui/TopBar/components/FancyUserMenu/UserMenu.styles.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,185 @@ | ||
import { css } from '@emotion/react'; | ||
import styled from '@emotion/styled'; | ||
import { Theme } from '@orfium/ictinus'; | ||
import { getFocus } from '@orfium/ictinus/dist/theme/states'; | ||
import { rem } from 'polished'; | ||
|
||
const AVATAR_SIZE_COLLAPSED = 36; | ||
const AVATAR_SIZE_EXPANDED = 46; | ||
|
||
export const Anchor = styled.div` | ||
position: relative; | ||
height: ${rem(AVATAR_SIZE_COLLAPSED)}; | ||
`; | ||
|
||
export const MenuOuterWrapper = styled.div` | ||
--max-width: auto; | ||
--max-height: auto; | ||
--min-width: ${rem(AVATAR_SIZE_COLLAPSED)}; | ||
--min-height: ${rem(AVATAR_SIZE_COLLAPSED)}; | ||
border: ${rem(1)} solid ${({ theme }) => theme.utils.getColor('lightGrey', 200)}; | ||
border-radius: ${rem(8)}; | ||
box-shadow: ${({ theme }) => theme.elevation['04']}; | ||
background-color: #fff; | ||
padding: ${({ theme }) => theme.spacing.md}; | ||
transition: padding 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease, | ||
border-color 0.25s ease, width 0.25s ease, height 0.25s ease; | ||
width: var(--max-width); | ||
height: var(--max-height); | ||
overflow: hidden; | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
[data-menu-header] { | ||
transition: padding 0.25s ease; | ||
} | ||
[data-menu-header] > div, | ||
[data-menu-options] { | ||
transition: opacity 0.15s ease; | ||
opacity: 1; | ||
visibility: visible; | ||
} | ||
&.collapsed { | ||
width: var(--min-width); | ||
height: var(--min-height); | ||
padding: 1px; // fixes weird 1px clipping issue between this and the img | ||
background-color: transparent; | ||
box-shadow: none; | ||
border-color: transparent; | ||
cursor: pointer; | ||
&:focus-visible { | ||
outline: ${({ theme }) => getFocus({ theme }).styleOutline}; | ||
} | ||
[data-menu-header] { | ||
padding: 0; | ||
} | ||
[data-menu-header] > div, | ||
[data-menu-options] { | ||
opacity: 0; | ||
visibility: hidden; | ||
} | ||
} | ||
`; | ||
|
||
export const MenuInnerWrapper = styled.div` | ||
min-width: ${rem(310)}; | ||
display: flex; | ||
flex-direction: column; | ||
gap: ${({ theme }) => theme.spacing.md}; | ||
`; | ||
|
||
export const Header = styled.div` | ||
display: flex; | ||
gap: ${({ theme }) => theme.spacing.sm}; | ||
padding: 0 ${({ theme }) => theme.spacing.sm}; | ||
align-items: center; | ||
> img { | ||
width: ${rem(AVATAR_SIZE_EXPANDED)}; | ||
height: ${rem(AVATAR_SIZE_EXPANDED)}; | ||
border-radius: 50%; | ||
} | ||
> div { | ||
display: flex; | ||
flex-direction: column; | ||
gap: ${rem(4)}; | ||
} | ||
&.collapsed { | ||
img { | ||
width: ${rem(AVATAR_SIZE_COLLAPSED)}; | ||
height: ${rem(AVATAR_SIZE_COLLAPSED)}; | ||
} | ||
} | ||
`; | ||
|
||
export const UsernameWrapper = styled.div` | ||
display: flex; | ||
gap: ${rem(4)}; | ||
justify-content: flex-start; | ||
align-items: center; | ||
`; | ||
|
||
export const Tag = styled.span` | ||
font-size: ${({ theme }) => theme.typography.fontSizes[12]}; | ||
font-weight: ${({ theme }) => theme.typography.weights.medium}; | ||
padding: ${({ theme }) => theme.spacing.xsm}; | ||
background-color: ${({ theme }) => theme.utils.getColor('blue', 100)}; | ||
color: ${({ theme }) => theme.utils.getColor('blue', 600)}; | ||
border-radius: ${rem(2)}; | ||
align-self: start; | ||
`; | ||
|
||
export const Username = styled.div` | ||
font-weight: ${({ theme }) => theme.typography.weights.bold}; | ||
font-size: ${({ theme }) => theme.typography.fontSizes['18']}; | ||
`; | ||
|
||
export const Email = styled.div` | ||
color: ${({ theme }) => theme.utils.getColor('lightGrey', 650)}; | ||
font-weight: ${({ theme }) => theme.typography.weights.medium}; | ||
font-size: ${({ theme }) => theme.typography.fontSizes['12']}; | ||
`; | ||
|
||
const listColumn = css` | ||
display: flex; | ||
flex-direction: column; | ||
gap: ${rem(8)}; | ||
`; | ||
|
||
export const MenuList = styled.div` | ||
${listColumn}; | ||
`; | ||
|
||
export const PrimarySection = styled.div` | ||
${listColumn}; | ||
`; | ||
|
||
const menuItemStyles = (theme: Theme) => css` | ||
padding: ${theme.spacing.md}; | ||
display: flex; | ||
justify-content: space-between; | ||
background-color: transparent; | ||
border-radius: ${rem(4)}; | ||
cursor: pointer; | ||
transform: scale(1); | ||
transition: transform 0.15s ease, background-color 0.15s ease; | ||
user-select: none; | ||
color: #0e0e17 !important; | ||
&:active { | ||
transform: scale(0.95); | ||
} | ||
&:hover { | ||
background-color: ${theme.utils.getColor('darkBlue', null, 'pale')}; | ||
} | ||
&:focus-visible { | ||
outline: ${getFocus({ theme }).styleOutline}; | ||
} | ||
`; | ||
|
||
export const MenuItem = styled.a` | ||
${({ theme }) => menuItemStyles(theme)}; | ||
text-decoration: none; | ||
`; | ||
|
||
export const SecondarySection = styled.div` | ||
${listColumn}; | ||
border-top: 1px solid ${({ theme }) => theme.utils.getColor('lightGrey', 200)}; | ||
padding-top: ${({ theme }) => theme.spacing.md}}; | ||
`; | ||
|
||
export const LogoutButton = styled.button` | ||
border: none; | ||
width: 100%; | ||
${({ theme }) => menuItemStyles(theme)}; | ||
`; |
Oops, something went wrong.