forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelements.ts
More file actions
104 lines (92 loc) · 2.32 KB
/
elements.ts
File metadata and controls
104 lines (92 loc) · 2.32 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
94
95
96
97
98
99
100
101
102
103
104
import { ComponentProps } from 'react';
import { Button as ReakitButton } from 'reakit/Button';
import { Group } from 'reakit/Group';
import { Menu, MenuItem, MenuDisclosure } from 'reakit/Menu';
import styled, { css } from 'styled-components';
import { Button, buttonStyles } from '../Button';
export const Container = styled(Group)`
position: relative;
display: flex;
`;
export const PrimaryAction = styled(ReakitButton)<
ComponentProps<typeof Button>
>`
${({ block }) => css`
${buttonStyles};
justify-content: center;
width: ${block ? '100%' : 'inherit'};
border-radius: 0;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
border-right-width: 1px;
`}
`;
export const ToggleActionsList = styled(MenuDisclosure)<
ComponentProps<typeof Button>
>`
${buttonStyles};
justify-content: center;
width: 32px;
height: 32px;
border-radius: 0;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
border-left-width: 1px;
&:focus {
outline: 0 !important;
}
`;
export const ActionsList = styled(Menu).attrs({
modal: false,
style: {
zIndex: 1,
top: '32px',
left: 'inherit',
right: '0px',
transform: 'none',
},
})`
display: flex;
flex-direction: column;
width: max-content;
min-width: 100%;
margin-top: -2px;
border-radius: 2px;
background-color: ${props =>
props.theme['menu.background'] || props.theme.background4};
box-shadow: rgba(0, 0, 0, 0.75) 0px 3px 8px;
&:focus {
outline: none !important;
}
`;
export const SecondaryAction = styled(MenuItem)<{ disabled?: boolean }>`
${({ disabled, theme }) => css`
display: inline-flex;
padding: 0.5rem 1rem;
border: none;
background: none;
color: ${theme['menu.foreground'] || 'rgba(255, 255, 255, 0.8)'};
text-align: initial;
${!disabled &&
css`
cursor: pointer;
`};
&:focus {
outline: none !important;
}
&:focus {
border-color: rgb(64, 169, 243);
background-color: ${theme['menu.selectionBackground'] ||
theme.background3};
color: ${theme['menu.selectionForeground'] || 'white'};
}
&:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
&:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
`}
`;