blob: 9d9b7c402cc2528c1c80a1c6c24d98349be121a8 (
plain)
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
import { Tooltip } from "react-tooltip";
import styled, { keyframes } from "styled-components";
import { getFontSize } from "../util";
export const defaultBorderRadius = "5px";
export const lightGray = "#646464";
// export const secondaryDark = "rgb(45 45 45)";
// export const vscBackground = "rgb(30 30 30)";
export const vscBackgroundTransparent = "#1e1e1ede";
export const buttonColor = "#1bbe84";
export const buttonColorHover = "#1bbe84a8";
export const secondaryDark = "var(--vscode-list-hoverBackground)";
export const vscBackground = "var(--vscode-editor-background)";
export const vscForeground = "var(--vscode-editor-foreground)";
export const Button = styled.button`
padding: 10px 12px;
margin: 8px 0;
border-radius: ${defaultBorderRadius};
border: none;
color: white;
background-color: ${buttonColor};
&:disabled {
color: gray;
}
&:hover:enabled {
cursor: pointer;
}
`;
export const StyledTooltip = styled(Tooltip)`
font-size: 12px;
background-color: rgb(60 60 60);
border-radius: ${defaultBorderRadius};
padding: 6px;
padding-left: 12px;
padding-right: 12px;
z-index: 1000;
max-width: 80vw;
`;
export const TextArea = styled.textarea`
padding: 8px;
font-family: inherit;
border-radius: ${defaultBorderRadius};
margin: 16px auto;
height: auto;
width: calc(100% - 32px);
background-color: ${secondaryDark};
color: ${vscForeground};
z-index: 1;
border: 1px solid transparent;
resize: vertical;
&:focus {
outline: 1px solid ${lightGray};
border: 1px solid transparent;
}
&::placeholder {
color: ${lightGray}80;
}
`;
export const Pre = styled.pre`
border-radius: ${defaultBorderRadius};
padding: 8px;
max-height: 150px;
overflow-y: scroll;
margin: 0;
background-color: ${vscBackground};
border: none;
/* text wrapping */
white-space: pre-wrap; /* Since CSS 2.1 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
`;
export const H3 = styled.h3`
background-color: ${secondaryDark};
border-radius: ${defaultBorderRadius};
padding: 4px 8px;
width: fit-content;
`;
export const TextInput = styled.input.attrs({ type: "text" })`
width: 100%;
padding: 8px 12px;
margin: 8px 0;
box-sizing: border-box;
border-radius: ${defaultBorderRadius};
outline: 1px solid ${lightGray};
border: none;
background-color: ${vscBackground};
color: ${vscForeground};
&:focus {
background: ${secondaryDark};
}
`;
export const NumberInput = styled.input.attrs({ type: "number" })`
padding: 8px 12px;
margin: 8px 4px;
box-sizing: border-box;
border-radius: ${defaultBorderRadius};
outline: 1px solid ${lightGray};
border: none;
background-color: ${vscBackground};
color: ${vscForeground};
&:focus {
background: ${secondaryDark};
}
`;
export const Select = styled.select`
padding: 8px 12px;
margin: 8px 0;
box-sizing: border-box;
border-radius: ${defaultBorderRadius};
outline: 1px solid ${lightGray};
border: none;
background-color: ${vscBackground};
color: ${vscForeground};
`;
export const Label = styled.label<{ fontSize?: number }>`
font-size: ${(props) => props.fontSize || getFontSize()}px;
`;
const spin = keyframes`
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
`;
export const Loader = styled.div`
border: 4px solid transparent;
border-radius: 50%;
border-top: 4px solid white;
width: 36px;
height: 36px;
-webkit-animation: ${spin} 1s ease-in-out infinite;
animation: ${spin} 1s ease-in-out infinite;
margin: auto;
`;
export const MainContainerWithBorder = styled.div<{ borderWidth?: string }>`
border-radius: ${defaultBorderRadius};
padding: ${(props) => props.borderWidth || "1px"};
background-color: white;
`;
export const MainTextInput = styled.textarea`
padding: 8px;
font-size: 16px;
border-radius: ${defaultBorderRadius};
border: 1px solid #ccc;
margin: 8px 8px;
background-color: ${vscBackground};
color: ${vscForeground};
outline: 1px solid orange;
resize: none;
`;
export const appear = keyframes`
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0px);
}
`;
export const HeaderButton = styled.button<{ inverted: boolean | undefined }>`
background-color: ${({ inverted }) =>
inverted ? vscForeground : "transparent"};
color: ${({ inverted }) => (inverted ? vscBackground : vscForeground)};
border: none;
border-radius: ${defaultBorderRadius};
cursor: ${({ disabled }) => (disabled ? "default" : "pointer")};
&:focus {
outline: none;
border: none;
}
&:hover {
background-color: ${({ inverted }) =>
typeof inverted === "undefined" || inverted
? secondaryDark
: "transparent"};
}
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
padding: 2px;
`;
|