jbx 1.7.6 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/index.js +150 -340
- package/package.json +1 -1
- package/style.css +199 -0
package/CHANGELOG.md
CHANGED
package/index.js
CHANGED
|
@@ -1,202 +1,51 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import Styled from 'styled-components';
|
|
4
|
-
import capsize from 'capsize';
|
|
1
|
+
import './style.css';
|
|
5
2
|
|
|
6
|
-
import {
|
|
3
|
+
import React, { Fragment } from 'react';
|
|
7
4
|
|
|
8
5
|
const SIZE = window.innerWidth > 1280 ? 16 : window.innerWidth > 640 ? 14 : 12;
|
|
9
|
-
const BASE_SIZE = SIZE;
|
|
10
6
|
const BASE_RADIUS = SIZE / 2;
|
|
11
|
-
const SPACE = SIZE;
|
|
12
7
|
const BASE_FONT_SIZE = SIZE;
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
body {
|
|
38
|
-
touch-action: pan-y;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
body,
|
|
42
|
-
input,
|
|
43
|
-
textarea {
|
|
44
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
body {
|
|
48
|
-
background: #fcfcfd;
|
|
49
|
-
color: #000;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
:root {
|
|
53
|
-
--accent-color: ${(props) => props.accent};
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
|
-
|
|
57
|
-
const BaseText = Styled.div({});
|
|
58
|
-
|
|
59
|
-
function textProps(capsizeConfig) {
|
|
60
|
-
const capsizeComputed = {
|
|
61
|
-
fontMetrics,
|
|
62
|
-
lineGap: BASE_FONT_SIZE * 0.618,
|
|
63
|
-
...capsizeConfig
|
|
9
|
+
export function Component(className, styleSrc, config = {}) {
|
|
10
|
+
const { element = `div`, styleProps } = config;
|
|
11
|
+
|
|
12
|
+
return function MakeComponent({ children, ...props }) {
|
|
13
|
+
const passProps = styleProps
|
|
14
|
+
? Object.keys(props)
|
|
15
|
+
.filter((e) => !styleProps.includes(e))
|
|
16
|
+
.reduce((acc, p) => {
|
|
17
|
+
acc[p] = props[p];
|
|
18
|
+
return acc;
|
|
19
|
+
}, {})
|
|
20
|
+
: props;
|
|
21
|
+
|
|
22
|
+
return React.createElement(
|
|
23
|
+
element,
|
|
24
|
+
{
|
|
25
|
+
className,
|
|
26
|
+
style: typeof styleSrc === 'function' ? styleSrc(props) : styleSrc,
|
|
27
|
+
...passProps
|
|
28
|
+
},
|
|
29
|
+
children
|
|
30
|
+
);
|
|
64
31
|
};
|
|
65
|
-
|
|
66
|
-
return capsize(capsizeComputed);
|
|
67
32
|
}
|
|
68
33
|
|
|
69
|
-
export const Container =
|
|
70
|
-
maxWidth: '1080px',
|
|
71
|
-
margin: '0 auto',
|
|
72
|
-
padding: `${SIZE * 2.5}px ${SIZE * 1.5}px ${SIZE * 4}px`
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
export const Text = Styled(BaseText)({
|
|
76
|
-
...textProps({
|
|
77
|
-
capHeight: BASE_FONT_SIZE
|
|
78
|
-
})
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
export const SmallText = Styled(BaseText)({
|
|
82
|
-
...textProps({
|
|
83
|
-
capHeight: BASE_FONT_SIZE * 0.8,
|
|
84
|
-
lineGap: BASE_FONT_SIZE / 3
|
|
85
|
-
})
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
export const ButtonContainer = Styled.button({
|
|
89
|
-
appearance: 'none',
|
|
90
|
-
userSelect: 'none',
|
|
91
|
-
cursor: 'pointer',
|
|
92
|
-
display: 'inline-block',
|
|
93
|
-
backgroundColor: '#eee',
|
|
94
|
-
boxShadow: '3px 3px 0 #ccc',
|
|
95
|
-
padding: `0 ${SPACE / 2}px`,
|
|
96
|
-
border: 'none',
|
|
97
|
-
height: SPACE * 2.5,
|
|
98
|
-
'&:active': {
|
|
99
|
-
top: 1,
|
|
100
|
-
left: 1,
|
|
101
|
-
boxShadow: '2px 2px 0 #ccc'
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
export const Button = function Button(props) {
|
|
106
|
-
const { children, ...other } = props;
|
|
107
|
-
return React.createElement(ButtonContainer, other, React.createElement(Text, {}, children));
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
export const Input = Styled.input({
|
|
111
|
-
'-webkit-text-fill-color': '#777',
|
|
112
|
-
opacity: 1,
|
|
113
|
-
flex: 1,
|
|
114
|
-
display: 'block',
|
|
115
|
-
appearance: 'none',
|
|
116
|
-
border: 'none',
|
|
117
|
-
borderRadius: 0,
|
|
118
|
-
height: SPACE * 2.5,
|
|
119
|
-
backgroundColor: '#eee',
|
|
120
|
-
...textProps({
|
|
121
|
-
capHeight: (BASE_FONT_SIZE * 3) / 3
|
|
122
|
-
}),
|
|
123
|
-
padding: `0 ${SPACE / 2}px`,
|
|
124
|
-
boxShadow: `inset rgba(0, 0, 0, 0.04) 3px 3px 0, inset rgba(0, 0, 0, 0.03) 0.5px 0.5px 0`,
|
|
125
|
-
color: '#777'
|
|
126
|
-
});
|
|
34
|
+
export const Container = Component(`jbx-container`);
|
|
127
35
|
|
|
128
|
-
export const
|
|
129
|
-
flex: 1,
|
|
130
|
-
width: '100%',
|
|
131
|
-
appearance: 'none',
|
|
132
|
-
backgroundColor: 'var(--accent-color)',
|
|
133
|
-
height: SPACE,
|
|
134
|
-
borderRadius: 0,
|
|
135
|
-
'&::-webkit-slider-thumb': {
|
|
136
|
-
appearance: 'none',
|
|
137
|
-
boxShadow: 'none',
|
|
138
|
-
borderRadius: 0,
|
|
139
|
-
height: SPACE * 2,
|
|
140
|
-
width: SPACE,
|
|
141
|
-
backgroundColor: '#000',
|
|
142
|
-
border: 'none'
|
|
143
|
-
},
|
|
144
|
-
'&::-moz-range-thumb': {
|
|
145
|
-
appearance: 'none',
|
|
146
|
-
boxShadow: 'none',
|
|
147
|
-
borderRadius: 0,
|
|
148
|
-
height: SPACE * 2,
|
|
149
|
-
width: SPACE,
|
|
150
|
-
backgroundColor: '#000',
|
|
151
|
-
border: 'none'
|
|
152
|
-
},
|
|
153
|
-
'&::-webkit-slider-runnable-track': {
|
|
154
|
-
appearance: 'none'
|
|
155
|
-
},
|
|
156
|
-
':focus': {
|
|
157
|
-
outline: 'none'
|
|
158
|
-
}
|
|
159
|
-
});
|
|
36
|
+
export const Text = Component(`jbx-text`);
|
|
160
37
|
|
|
161
|
-
export const
|
|
162
|
-
margin: 0,
|
|
38
|
+
export const SmallText = Component(`jbx-small-text`);
|
|
163
39
|
|
|
164
|
-
|
|
165
|
-
fontWeight: 700,
|
|
166
|
-
...textProps({
|
|
167
|
-
capHeight: BASE_FONT_SIZE,
|
|
168
|
-
lineGap: BASE_FONT_SIZE
|
|
169
|
-
})
|
|
170
|
-
});
|
|
171
|
-
export const HeaderH3 = Styled.h3({
|
|
172
|
-
margin: 0,
|
|
40
|
+
export const Button = Component(`jbx-button`, {}, { element: 'button' });
|
|
173
41
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
...textProps({
|
|
177
|
-
capHeight: BASE_FONT_SIZE * 1 * 1.25,
|
|
178
|
-
lineGap: BASE_FONT_SIZE
|
|
179
|
-
})
|
|
180
|
-
});
|
|
181
|
-
export const HeaderH2 = Styled.h2({
|
|
182
|
-
margin: 0,
|
|
42
|
+
export const Input = Component(`jbx-input`, null, { element: 'input' });
|
|
43
|
+
export const Range = Component(`jbx-range`, null, { element: 'input' });
|
|
183
44
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
lineGap: 12
|
|
189
|
-
})
|
|
190
|
-
});
|
|
191
|
-
export const HeaderH1 = Styled.h1({
|
|
192
|
-
letterSpacing: -1,
|
|
193
|
-
margin: '2px 0',
|
|
194
|
-
fontWeight: 700,
|
|
195
|
-
...textProps({
|
|
196
|
-
capHeight: BASE_FONT_SIZE * 3 - 4,
|
|
197
|
-
lineGap: BASE_FONT_SIZE
|
|
198
|
-
})
|
|
199
|
-
});
|
|
45
|
+
export const HeaderH1 = Component(`jbx-h${1}`, null, { element: 'h1' });
|
|
46
|
+
export const HeaderH2 = Component(`jbx-h${2}`, null, { element: 'h2' });
|
|
47
|
+
export const HeaderH3 = Component(`jbx-h${3}`, null, { element: 'h3' });
|
|
48
|
+
export const HeaderH4 = Component(`jbx-h${4}`, null, { element: 'h4' });
|
|
200
49
|
|
|
201
50
|
export const MainHeader = function MainHeader({ children, style }) {
|
|
202
51
|
const content = String(children).split(' ');
|
|
@@ -225,154 +74,130 @@ export const MainHeader = function MainHeader({ children, style }) {
|
|
|
225
74
|
);
|
|
226
75
|
};
|
|
227
76
|
|
|
228
|
-
export const A =
|
|
229
|
-
color: '#000',
|
|
230
|
-
boxShadow: 'var(--accent-color) 0 2px 0, inset var(--accent-color) 0 -2px 0',
|
|
231
|
-
fontWeight: 700,
|
|
232
|
-
textDecoration: 'none',
|
|
233
|
-
'&:hover': {
|
|
234
|
-
color: '#34495e'
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
export const Space = Styled.div({
|
|
239
|
-
display: (props) => (props.inline ? 'inline-block' : 'block'),
|
|
240
|
-
height: (props) => `${SPACE * props.h}px`,
|
|
241
|
-
width: (props) => `${SPACE * props.w}px`
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
export const Box = Styled.div({
|
|
245
|
-
flex: (props) => props.flex,
|
|
246
|
-
minWidth: (props) => props.minWidth,
|
|
247
|
-
padding: ({ padding }) => {
|
|
248
|
-
if (!padding) return `0`;
|
|
249
|
-
|
|
250
|
-
const paddingArr = [padding].flat();
|
|
251
|
-
|
|
252
|
-
return paddingArr.map((paddingValue) => `${paddingValue * SPACE}px`).join(` `);
|
|
253
|
-
},
|
|
254
|
-
|
|
255
|
-
'@media (max-width: 768px)': {
|
|
256
|
-
display: ({ hideOnSmall }) => (hideOnSmall ? 'none' : undefined)
|
|
257
|
-
},
|
|
258
|
-
|
|
259
|
-
'@media (max-width: 1080px)': {
|
|
260
|
-
display: ({ hideOnMedium }) => (hideOnMedium ? 'none' : undefined)
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
export const Inline = Styled.div({
|
|
265
|
-
flex: 1,
|
|
266
|
-
display: 'flex',
|
|
267
|
-
flexWrap: 'wrap',
|
|
268
|
-
flexDirection: `row`,
|
|
269
|
-
marginLeft: ({ h }) => `${h * SPACE}px`,
|
|
270
|
-
marginRight: ({ h }) => `${h * SPACE}px`,
|
|
271
|
-
marginTop: ({ v }) => `${v * SPACE}px`,
|
|
272
|
-
marginBottom: ({ v }) => `${v * SPACE}px`,
|
|
273
|
-
gap: ({ gap }) => `${gap * SPACE}px`
|
|
274
|
-
});
|
|
77
|
+
export const A = Component(`jbx-a`, null, { element: 'a' });
|
|
275
78
|
|
|
276
|
-
export const
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
marginLeft: ({ h }) => `${h * SPACE}px`,
|
|
282
|
-
marginRight: ({ h }) => `${h * SPACE}px`,
|
|
283
|
-
marginTop: ({ v }) => `${v * SPACE}px`,
|
|
284
|
-
marginBottom: ({ v }) => `${v * SPACE}px`,
|
|
285
|
-
gap: ({ gap }) => `${gap * SPACE}px`
|
|
286
|
-
});
|
|
79
|
+
export const Space = Component(`jbx-space`, (props) => ({
|
|
80
|
+
display: props.inline ? 'inline-block' : 'block',
|
|
81
|
+
height: `${SIZE * props.h}px`,
|
|
82
|
+
width: `${SIZE * props.w}px`
|
|
83
|
+
}));
|
|
287
84
|
|
|
288
|
-
export const
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
alignContent: 'center',
|
|
300
|
-
justifyContent: 'center',
|
|
301
|
-
padding: 0,
|
|
302
|
-
'&:hover': {
|
|
303
|
-
boxShadow: `rgba(0, 0, 0, 0.1) 0 1px 1px, rgba(0, 0, 0, 0.1) 0 3px 12px`
|
|
304
|
-
}
|
|
85
|
+
export const Box = Component(`jbx-box`, ({ padding, hideOnSmall, flex, minWidth }) => {
|
|
86
|
+
return {
|
|
87
|
+
flex,
|
|
88
|
+
minWidth,
|
|
89
|
+
padding: padding
|
|
90
|
+
? [padding]
|
|
91
|
+
.flat()
|
|
92
|
+
.map((paddingValue) => `${paddingValue * SIZE}px`)
|
|
93
|
+
.join(` `)
|
|
94
|
+
: null
|
|
95
|
+
};
|
|
305
96
|
});
|
|
306
97
|
|
|
307
|
-
export const
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
98
|
+
export const Inline = Component(`jbx-inline`, ({ v, h, gap }) => ({
|
|
99
|
+
marginLeft: `${h * SIZE}px`,
|
|
100
|
+
marginRight: `${h * SIZE}px`,
|
|
101
|
+
marginTop: `${v * SIZE}px`,
|
|
102
|
+
marginBottom: `${v * SIZE}px`,
|
|
103
|
+
gap: `${gap * SIZE}px`
|
|
104
|
+
}));
|
|
105
|
+
|
|
106
|
+
export const Stack = Component(`jbx-stack`, ({ v, h, gap }) => ({
|
|
107
|
+
marginLeft: `${h * SIZE}px`,
|
|
108
|
+
marginRight: `${h * SIZE}px`,
|
|
109
|
+
marginTop: `${v * SIZE}px`,
|
|
110
|
+
marginBottom: `${v * SIZE}px`,
|
|
111
|
+
gap: `${gap * SIZE}px`
|
|
112
|
+
}));
|
|
113
|
+
|
|
114
|
+
// export const LinkButton = Styled.a({
|
|
115
|
+
// capHeight: BASE_FONT_SIZE,
|
|
116
|
+
// color: '#3498db',
|
|
117
|
+
// cursor: 'pointer',
|
|
118
|
+
// borderRadius: 5,
|
|
119
|
+
// borderTop: '1px solid #3498db10',
|
|
120
|
+
// borderBottom: '1px solid #0000',
|
|
121
|
+
// backgroundColor: '#3498db20',
|
|
122
|
+
// height: BASE_FONT_SIZE * 2,
|
|
123
|
+
// display: 'flex',
|
|
124
|
+
// alignItems: 'center',
|
|
125
|
+
// alignContent: 'center',
|
|
126
|
+
// justifyContent: 'center',
|
|
127
|
+
// padding: 0,
|
|
128
|
+
// '&:hover': {
|
|
129
|
+
// boxShadow: `rgba(0, 0, 0, 0.1) 0 1px 1px, rgba(0, 0, 0, 0.1) 0 3px 12px`
|
|
130
|
+
// }
|
|
131
|
+
// });
|
|
132
|
+
|
|
133
|
+
// export const Dropzone = Styled.div({
|
|
134
|
+
// height: '120px',
|
|
135
|
+
// flex: 1,
|
|
136
|
+
// 'max-width': '320px',
|
|
137
|
+
// display: 'flex',
|
|
138
|
+
// 'text-align': 'center',
|
|
139
|
+
// 'align-items': 'center',
|
|
140
|
+
// 'align-content': 'center',
|
|
141
|
+
// 'justify-content': 'center',
|
|
142
|
+
// 'flex-direction': 'column',
|
|
143
|
+
// border: '2px dashed #000',
|
|
144
|
+
// color: '#000',
|
|
145
|
+
// padding: '0',
|
|
146
|
+
// cursor: 'pointer',
|
|
147
|
+
// '& span': {
|
|
148
|
+
// width: '100%',
|
|
149
|
+
// cursor: 'pointer'
|
|
150
|
+
// },
|
|
151
|
+
// '&:hover': {
|
|
152
|
+
// 'border-color': '#999'
|
|
153
|
+
// },
|
|
154
|
+
// '& input': {
|
|
155
|
+
// position: 'absolute',
|
|
156
|
+
// top: '0',
|
|
157
|
+
// left: '0',
|
|
158
|
+
// height: '100%',
|
|
159
|
+
// width: '100%',
|
|
160
|
+
// opacity: '0',
|
|
161
|
+
// cursor: 'pointer'
|
|
162
|
+
// }
|
|
163
|
+
// });
|
|
164
|
+
|
|
165
|
+
export const Ul = Component(
|
|
166
|
+
`jbx-ul`,
|
|
167
|
+
{
|
|
168
|
+
margin: 0,
|
|
169
|
+
padding: `0 0 0 ${BASE_FONT_SIZE / 4}px`
|
|
324
170
|
},
|
|
325
|
-
'
|
|
326
|
-
|
|
171
|
+
{ element: 'ul' }
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
export const Li = Component(
|
|
175
|
+
`jbx-li`,
|
|
176
|
+
{
|
|
177
|
+
margin: `0 0 0 ${SIZE}px`,
|
|
178
|
+
padding: `${SIZE / 4}px 0`
|
|
327
179
|
},
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
})
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
margin: `0 0 0 ${SIZE}px`,
|
|
346
|
-
padding: `${SIZE / 4}px 0`
|
|
347
|
-
});
|
|
348
|
-
|
|
349
|
-
export const Tabs = Styled.div({});
|
|
350
|
-
|
|
351
|
-
export const Tab = Styled.div({
|
|
352
|
-
userSelect: 'none',
|
|
353
|
-
padding: SIZE / 2,
|
|
354
|
-
cursor: 'pointer',
|
|
355
|
-
backgroundColor: (props) => (props.active ? '#000' : props.info ? '#fff' : '#ecf0f1'),
|
|
356
|
-
color: (props) => (props.active ? '#fff' : '#000'),
|
|
357
|
-
paddingLeft: (props) => (props.info ? 0 : undefined)
|
|
358
|
-
});
|
|
180
|
+
{ element: 'li' }
|
|
181
|
+
);
|
|
182
|
+
|
|
183
|
+
export const Tabs = Component(`jbx-tabs`);
|
|
184
|
+
|
|
185
|
+
export const Tab = Component(
|
|
186
|
+
`jbx-tabs--tab`,
|
|
187
|
+
({ info, active }) => ({
|
|
188
|
+
userSelect: 'none',
|
|
189
|
+
cursor: 'pointer',
|
|
190
|
+
backgroundColor: active ? '#000' : info ? '#fff' : '#ecf0f1',
|
|
191
|
+
color: active ? '#fff' : '#000',
|
|
192
|
+
padding: SIZE / 2,
|
|
193
|
+
paddingLeft: info ? 0 : SIZE / 2
|
|
194
|
+
}),
|
|
195
|
+
{ styleProps: ['info', 'active'] }
|
|
196
|
+
);
|
|
359
197
|
|
|
360
|
-
export const CodeSnippet =
|
|
361
|
-
borderRadius: BASE_RADIUS,
|
|
362
|
-
'font-family': 'monaco, monospace',
|
|
363
|
-
border: 'none',
|
|
364
|
-
width: '100%',
|
|
365
|
-
'font-size': SIZE - 2,
|
|
366
|
-
'line-height': '1.5',
|
|
367
|
-
padding: SIZE,
|
|
368
|
-
background: '#ecf0f1',
|
|
369
|
-
color: '#34495e',
|
|
370
|
-
':focus': {
|
|
371
|
-
outline: 'none'
|
|
372
|
-
}
|
|
373
|
-
});
|
|
198
|
+
export const CodeSnippet = Component(`jbx-code-snippet`, null, { element: 'pre' });
|
|
374
199
|
|
|
375
|
-
export const CheckboxHidden =
|
|
200
|
+
export const CheckboxHidden = Component(`jbx-checkbox-hidden`, ({ checked }) => {
|
|
376
201
|
return {
|
|
377
202
|
height: BASE_SIZE * 2 - 4,
|
|
378
203
|
width: BASE_SIZE * 2 - 4,
|
|
@@ -433,18 +258,3 @@ export const Checkbox = function Checkbox({ label, checked, onChange }) {
|
|
|
433
258
|
]
|
|
434
259
|
);
|
|
435
260
|
};
|
|
436
|
-
|
|
437
|
-
export const Code = Styled.textarea({
|
|
438
|
-
'font-family': 'monaco, monospace',
|
|
439
|
-
border: 'none',
|
|
440
|
-
width: '100%',
|
|
441
|
-
height: '256px',
|
|
442
|
-
'font-size': '12px',
|
|
443
|
-
'line-height': '1.309',
|
|
444
|
-
padding: '16px 18px',
|
|
445
|
-
background: '#ecf0f1',
|
|
446
|
-
color: '#34495e',
|
|
447
|
-
':focus': {
|
|
448
|
-
outline: 'none'
|
|
449
|
-
}
|
|
450
|
-
});
|
package/package.json
CHANGED
package/style.css
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
html {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
*,
|
|
5
|
+
*:before,
|
|
6
|
+
*:after {
|
|
7
|
+
box-sizing: inherit;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:root {
|
|
11
|
+
--size: 16px;
|
|
12
|
+
--base-font-size: 24px;
|
|
13
|
+
--base-radius: #95a5a6;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@media screen and (max-width: 1200px) {
|
|
17
|
+
:root {
|
|
18
|
+
--base-font-size: 21px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@media screen and (max-width: 600px) {
|
|
23
|
+
:root {
|
|
24
|
+
--base-font-size: 18px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
* {
|
|
29
|
+
padding: 0;
|
|
30
|
+
margin: 0;
|
|
31
|
+
position: relative;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
body {
|
|
35
|
+
touch-action: pan-y;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
body,
|
|
39
|
+
input,
|
|
40
|
+
textarea {
|
|
41
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
body {
|
|
45
|
+
background: #fcfcfd;
|
|
46
|
+
color: #000;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* base text */
|
|
50
|
+
html,
|
|
51
|
+
body,
|
|
52
|
+
.jbx-button,
|
|
53
|
+
.jbx-input {
|
|
54
|
+
font-size: var(--base-font-size);
|
|
55
|
+
line-height: 1;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.jbx-code-snippet {
|
|
59
|
+
border-radius: var(--size);
|
|
60
|
+
font-family: monaco, monospace;
|
|
61
|
+
border: none;
|
|
62
|
+
width: 100%;
|
|
63
|
+
font-size: calc(var(--size) - 2px);
|
|
64
|
+
line-height: 1.5;
|
|
65
|
+
padding: var(--size);
|
|
66
|
+
background: #ecf0f1;
|
|
67
|
+
color: #34495e;
|
|
68
|
+
}
|
|
69
|
+
.jbx-code-snippet:focus {
|
|
70
|
+
outline: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.jbx-button {
|
|
74
|
+
appearance: none;
|
|
75
|
+
user-select: none;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
display: inline-block;
|
|
78
|
+
background-color: #eee;
|
|
79
|
+
box-shadow: 3px 3px 0 #ccc;
|
|
80
|
+
padding: 0 calc(var(--size) / 2);
|
|
81
|
+
border: none;
|
|
82
|
+
height: calc(var(--size) * 2.5);
|
|
83
|
+
}
|
|
84
|
+
.jbx-button:active {
|
|
85
|
+
top: 1;
|
|
86
|
+
left: 1;
|
|
87
|
+
box-shadow: 2px 2px 0 #ccc;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.jbx-a {
|
|
91
|
+
color: #000;
|
|
92
|
+
box-shadow: var(--accent-color) 0 2px 0, inset var(--accent-color) 0 -2px 0;
|
|
93
|
+
font-weight: 700;
|
|
94
|
+
text-decoration: none;
|
|
95
|
+
}
|
|
96
|
+
.jbx-a:hover {
|
|
97
|
+
color: '#34495e';
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.jbx-h1,
|
|
101
|
+
.jbx-h2,
|
|
102
|
+
.jbx-h3,
|
|
103
|
+
.jbx-h4 {
|
|
104
|
+
line-height: 1;
|
|
105
|
+
padding: 0;
|
|
106
|
+
margin: 0;
|
|
107
|
+
font-weight: 600;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.jbx-h4 {
|
|
111
|
+
font-size: calc(var(--base-font-size));
|
|
112
|
+
letter-spacing: -0.11px;
|
|
113
|
+
}
|
|
114
|
+
.jbx-h3 {
|
|
115
|
+
font-size: calc(var(--base-font-size) * 1.25);
|
|
116
|
+
letter-spacing: -0.22px;
|
|
117
|
+
}
|
|
118
|
+
.jbx-h2 {
|
|
119
|
+
font-size: calc(var(--base-font-size) * 1.5);
|
|
120
|
+
letter-spacing: -0.33px;
|
|
121
|
+
}
|
|
122
|
+
.jbx-h1 {
|
|
123
|
+
font-size: calc(var(--base-font-size) * 2.5);
|
|
124
|
+
letter-spacing: -1px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.jbx-small-text {
|
|
128
|
+
font-size: calc(var(--base-font-size) * 0.8);
|
|
129
|
+
line-height: calc(var(--base-font-size) * 0.6);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.jbx-container {
|
|
133
|
+
max-width: 1080px;
|
|
134
|
+
margin: 0 auto;
|
|
135
|
+
padding: calc(var(--size) * 2.5) calc(var(--size) * 1.5) calc(var(--size) * 4);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.jbx-inline {
|
|
139
|
+
flex: 1;
|
|
140
|
+
display: flex;
|
|
141
|
+
flex-wrap: wrap;
|
|
142
|
+
flex-direction: row;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.jbx-stack {
|
|
146
|
+
flex: 1;
|
|
147
|
+
display: flex;
|
|
148
|
+
flex-wrap: wrap;
|
|
149
|
+
flex-direction: column;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.jbx-input {
|
|
153
|
+
color: #777;
|
|
154
|
+
-webkit-text-fill-color: #777;
|
|
155
|
+
opacity: 1;
|
|
156
|
+
flex: 1;
|
|
157
|
+
display: block;
|
|
158
|
+
appearance: none;
|
|
159
|
+
border: none;
|
|
160
|
+
border-radius: 0;
|
|
161
|
+
height: calc(var(--size) * 2.5);
|
|
162
|
+
background-color: #eee;
|
|
163
|
+
padding: 0 calc(var(--size) * 0.5);
|
|
164
|
+
box-shadow: inset rgba(0, 0, 0, 0.04) 3px 3px 0, inset rgba(0, 0, 0, 0.03) 0.5px 0.5px 0;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.jbx-range {
|
|
168
|
+
flex: 1;
|
|
169
|
+
width: 100%;
|
|
170
|
+
appearance: none;
|
|
171
|
+
background-color: var(--accent-color);
|
|
172
|
+
height: var(--size);
|
|
173
|
+
border-radius: 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.jbx-range::-webkit-slider-thumb {
|
|
177
|
+
appearance: none;
|
|
178
|
+
box-shadow: none;
|
|
179
|
+
border-radius: 0;
|
|
180
|
+
height: calc(var(--size) * 2);
|
|
181
|
+
width: var(--size);
|
|
182
|
+
background-color: #000;
|
|
183
|
+
border: none;
|
|
184
|
+
}
|
|
185
|
+
.jbx-range::-moz-range-thumb {
|
|
186
|
+
appearance: none;
|
|
187
|
+
box-shadow: none;
|
|
188
|
+
border-radius: 0;
|
|
189
|
+
height: calc(var(--size) * 2);
|
|
190
|
+
width: var(--size);
|
|
191
|
+
background-color: #000;
|
|
192
|
+
border: none;
|
|
193
|
+
}
|
|
194
|
+
.jbx-range::-webkit-slider-runnable-track {
|
|
195
|
+
appearance: none;
|
|
196
|
+
}
|
|
197
|
+
.jbx-range:focus {
|
|
198
|
+
outline: none;
|
|
199
|
+
}
|