File size: 4,289 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
import { globalStyle, style } from '@vanilla-extract/css'
import { vars } from '../../styles/theme-contract.css'
import { recipe } from '@vanilla-extract/recipes'
import { BREAKPOINTS } from '../../styles/breakpoints.css'
import { darkThemeClass } from '../../styles/dark-theme.css'

export const heading = style({
  color: vars.colors.steel40,
})

export const stack = style({
  display: 'flex',
  justifyContent: 'flex-start',
  alignItems: 'center',
  gap: vars.space['20'],
  marginTop: vars.space['15'],
  marginBottom: vars.space['40'],
})

export const trigger = recipe({
  base: {
    display: 'flex',
    justifyContent: 'center',
    alignItems: 'center',
    background: 'transparent',
    border: `solid 1px ${vars.colors.steel40}`,
    borderRadius: vars.radii.r8,
    padding: vars.space['10'],
    color: vars.colors.steel40,
    cursor: 'pointer',
    transition:
      'color 200ms ease-out, border-color 200ms ease-out, opacity 200ms ease-out',
    selectors: {
      '&:disabled': {
        pointerEvents: 'none',
        opacity: 0.5,
      },
    },
  },
  variants: {
    selected: {
      false: {
        selectors: {
          '&:hover': {
            borderColor: vars.colors.steel80,
            color: vars.colors.steel80,
          },
        },
      },
      true: {
        pointerEvents: 'none',
        borderColor: vars.colors.red100,
        color: vars.colors.red100,
      },
    },
  },
})

export const popoverContent = style({
  display: 'none',
  background: vars.colors.codeBackground,
  color: vars.colors.black,
  fontSize: vars.fontSizes.XXS,
  lineHeight: vars.lineHeights.XXS,
  overflow: 'hidden',
  boxShadow:
    'rgba(27,31,36,0.12) 0px 1px 3px, rgba(66,74,83,0.12) 0px 8px 24px',

  '@media': {
    [`screen and ${BREAKPOINTS.tabletUp}`]: {
      display: 'block',
      padding: vars.space['20'],
      borderRadius: vars.radii.r8,
      width: 320,
      fontSize: vars.fontSizes.XS,
      lineHeight: vars.lineHeights.XS,
    },
  },

  selectors: {
    [`${darkThemeClass} &`]: {
      boxShadow:
        'rgba(27,31,36,0.5) 0px 1px 3px, rgba(18 21 23 / 40%) 0px 8px 24px',
    },
  },
})

export const popoverHeader = style({
  display: 'flex',
  justifyContent: 'space-between',
  alignItems: 'flex-start',
  marginBottom: vars.space['10'],
  gap: vars.space['10'],
})

globalStyle(`${popoverHeader} > h2`, {
  lineHeight: vars.lineHeights.code,
})

export const popoverClose = style({
  border: 'none',
  background: 'transparent',
  cursor: 'pointer',
  padding: vars.space['5'],
  display: 'flex',
  justifyContent: 'center',
  alignItems: 'center',

  '@supports': {
    '(hover:hover)': {
      selectors: {
        '&:hover': {
          color: vars.colors.red100,
        },
      },
    },
  },
})

export const popoverInputLabel = style({
  display: 'block',
  marginBottom: vars.space['15'],
})

export const popoverInput = style({
  borderRadius: vars.radii.r8,
  margin: 0,
  padding: `${vars.space['5']} ${vars.space['10']}`,
  width: '100%',
  backgroundColor: 'transparent',
  border: `1px solid ${vars.colors.steel40}`,
  alignItems: 'center',
  transition: 'border-color 200ms ease-out',
  color: vars.colors.black,
  fontSize: 12,
  fontWeight: 400,
  lineHeight: '140%',

  '@supports': {
    '(hover:hover)': {
      selectors: {
        '&:hover': {
          borderColor: vars.colors.red100,
        },
      },
    },
  },

  selectors: {
    '&:disabled': {
      opacity: 0.5,
      pointerEvents: 'none',
    },
    '&:disabled:hover': {
      borderColor: vars.colors.steel40,
    },
  },
})

export const popoverFormFooter = style({
  display: 'flex',
  justifyContent: 'space-between',
  alignItems: 'center',
})

export const popoverButton = style({
  cursor: 'pointer',

  selectors: {
    '&[aria-disabled="true"]': {
      opacity: 0.5,
      pointerEvents: 'none',
    },
  },
})

globalStyle(`${popoverButton} > span`, {
  background: vars.colors.codeBackground,
})

export const outbound = style({
  selectors: {
    [`.${darkThemeClass} &::before`]: {
      background: vars.colors.redYellowGradient100,
    },

    [`.${darkThemeClass} &:hover:before`]: {
      filter: 'brightness(120%)',
    },
  },
})

globalStyle(`${popoverButton} > span`, {
  background: vars.colors.codeBackground,
})