forked from cerebral/overmind
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelements.tsx
More file actions
93 lines (86 loc) · 2.8 KB
/
elements.tsx
File metadata and controls
93 lines (86 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import styled from '../../styled-components'
export const Wrapper = styled.div`
position: relative;
display: flex;
align-items: center;
min-width: 200px;
margin: 0 ${({ theme }) => theme.padding.small};
`
export const Selector = styled<{ isOpen: boolean }, 'div'>('div')`
display: flex;
flex: 1;
align-items: center;
cursor: pointer;
background-color: ${({ theme }) =>
theme.color.lighten(theme.color.dark, -0.5)};
cursor: pointer;
padding: ${({ theme }) => theme.padding.smaller};
color: ${({ theme }) => theme.color.fade(theme.color.white, 0.25)};
font-size: ${({ theme }) => theme.fontSize.small};
border-top-right-radius: ${({ theme }) => theme.borderRadius.normal};
border-bottom-right-radius: ${({ theme }) => theme.borderRadius.normal};
text-transform: lowercase;
:hover {
background-color: ${({ isOpen, theme }) =>
theme.color.lighten(theme.color.dark, isOpen ? -0.5 : -0.4)};
}
`
export const Chevron = styled.span`
margin-left: auto;
font-size: ${({ theme }) => theme.fontSize.smallest};
`
export const Dropdown = styled<
{
above?: boolean
},
'div'
>('div')`
position: absolute;
width: 100%;
${({ above }) => `${above ? 'bottom' : 'top'}: calc(100% - 1px)`};
background-color: ${({ theme }) =>
theme.color.lighten(theme.color.dark, -0.5)};
border-bottom-left-radius: ${({ theme }) => theme.borderRadius.normal};
border-bottom-right-radius: ${({ theme }) => theme.borderRadius.normal};
`
export const Option = styled.div`
display: flex;
align-items: center;
padding: ${({ theme }) => theme.padding.smaller};
color: ${({ theme }) => theme.color.fade(theme.color.white, 0.25)};
font-size: ${({ theme }) => theme.fontSize.small};
text-transform: lowercase;
cursor: pointer;
:hover {
background-color: ${({ theme }) =>
theme.color.lighten(theme.color.dark, -0.4)};
}
:last-child {
border-bottom-left-radius: ${({ theme }) => theme.borderRadius.normal};
border-bottom-right-radius: ${({ theme }) => theme.borderRadius.normal};
}
`
export const TsImageWrapper = styled.div`
display: flex;
padding: 4px;
background-color: ${({ theme }) =>
theme.color.lighten(theme.color.dark, -0.5)};
align-items: center;
border-top-left-radius: ${({ theme }) => theme.borderRadius.normal};
border-bottom-left-radius: ${({ theme }) => theme.borderRadius.normal};
border-right: 1px solid
${({ theme }) => theme.color.lighten(theme.color.dark, -0.3)};
`
export const TSImage = styled<
{
grayscale?: boolean
},
'img'
>('img')`
border-radius: ${({ theme }) => theme.borderRadius.normal};
cursor: pointer;
margin: ${({ theme }) => theme.padding.smallerer};
box-shadow: ${({ grayscale }) =>
grayscale ? 'inset 0px 0px 20px 1px rgba(0,0,0,0.5)' : 'none'};
opacity: ${({ grayscale }) => (grayscale ? '0.5' : '1')};
`