jbx 2.0.0 → 2.2.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 +5 -83
- package/package.json +1 -1
- package/style.css +114 -2
package/CHANGELOG.md
CHANGED
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@ const SIZE = window.innerWidth > 1280 ? 16 : window.innerWidth > 640 ? 14 : 12;
|
|
|
6
6
|
const BASE_RADIUS = SIZE / 2;
|
|
7
7
|
const BASE_FONT_SIZE = SIZE;
|
|
8
8
|
|
|
9
|
-
function Component(className, styleSrc, config = {}) {
|
|
9
|
+
export function Component(className, styleSrc, config = {}) {
|
|
10
10
|
const { element = `div`, styleProps } = config;
|
|
11
11
|
|
|
12
12
|
return function MakeComponent({ children, ...props }) {
|
|
@@ -39,56 +39,8 @@ export const SmallText = Component(`jbx-small-text`);
|
|
|
39
39
|
|
|
40
40
|
export const Button = Component(`jbx-button`, {}, { element: 'button' });
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
// opacity: 1,
|
|
45
|
-
// flex: 1,
|
|
46
|
-
// display: 'block',
|
|
47
|
-
// appearance: 'none',
|
|
48
|
-
// border: 'none',
|
|
49
|
-
// borderRadius: 0,
|
|
50
|
-
// height: SPACE * 2.5,
|
|
51
|
-
// backgroundColor: '#eee',
|
|
52
|
-
// ...textProps({
|
|
53
|
-
// capHeight: (BASE_FONT_SIZE * 3) / 3
|
|
54
|
-
// }),
|
|
55
|
-
// padding: `0 ${SPACE / 2}px`,
|
|
56
|
-
// boxShadow: `inset rgba(0, 0, 0, 0.04) 3px 3px 0, inset rgba(0, 0, 0, 0.03) 0.5px 0.5px 0`,
|
|
57
|
-
// color: '#777'
|
|
58
|
-
// });
|
|
59
|
-
|
|
60
|
-
// export const Range = Styled.input({
|
|
61
|
-
// flex: 1,
|
|
62
|
-
// width: '100%',
|
|
63
|
-
// appearance: 'none',
|
|
64
|
-
// backgroundColor: 'var(--accent-color)',
|
|
65
|
-
// height: SPACE,
|
|
66
|
-
// borderRadius: 0,
|
|
67
|
-
// '&::-webkit-slider-thumb': {
|
|
68
|
-
// appearance: 'none',
|
|
69
|
-
// boxShadow: 'none',
|
|
70
|
-
// borderRadius: 0,
|
|
71
|
-
// height: SPACE * 2,
|
|
72
|
-
// width: SPACE,
|
|
73
|
-
// backgroundColor: '#000',
|
|
74
|
-
// border: 'none'
|
|
75
|
-
// },
|
|
76
|
-
// '&::-moz-range-thumb': {
|
|
77
|
-
// appearance: 'none',
|
|
78
|
-
// boxShadow: 'none',
|
|
79
|
-
// borderRadius: 0,
|
|
80
|
-
// height: SPACE * 2,
|
|
81
|
-
// width: SPACE,
|
|
82
|
-
// backgroundColor: '#000',
|
|
83
|
-
// border: 'none'
|
|
84
|
-
// },
|
|
85
|
-
// '&::-webkit-slider-runnable-track': {
|
|
86
|
-
// appearance: 'none'
|
|
87
|
-
// },
|
|
88
|
-
// ':focus': {
|
|
89
|
-
// outline: 'none'
|
|
90
|
-
// }
|
|
91
|
-
// });
|
|
42
|
+
export const Input = Component(`jbx-input`, null, { element: 'input' });
|
|
43
|
+
export const Range = Component(`jbx-range`, null, { element: 'input' });
|
|
92
44
|
|
|
93
45
|
export const HeaderH1 = Component(`jbx-h${1}`, null, { element: 'h1' });
|
|
94
46
|
export const HeaderH2 = Component(`jbx-h${2}`, null, { element: 'h2' });
|
|
@@ -130,7 +82,7 @@ export const Space = Component(`jbx-space`, (props) => ({
|
|
|
130
82
|
width: `${SIZE * props.w}px`
|
|
131
83
|
}));
|
|
132
84
|
|
|
133
|
-
export const Box = Component(`jbx-box`, ({ hideOnSmall, flex, minWidth }) => {
|
|
85
|
+
export const Box = Component(`jbx-box`, ({ padding, hideOnSmall, flex, minWidth }) => {
|
|
134
86
|
return {
|
|
135
87
|
flex,
|
|
136
88
|
minWidth,
|
|
@@ -178,37 +130,7 @@ export const Stack = Component(`jbx-stack`, ({ v, h, gap }) => ({
|
|
|
178
130
|
// }
|
|
179
131
|
// });
|
|
180
132
|
|
|
181
|
-
|
|
182
|
-
// height: '120px',
|
|
183
|
-
// flex: 1,
|
|
184
|
-
// 'max-width': '320px',
|
|
185
|
-
// display: 'flex',
|
|
186
|
-
// 'text-align': 'center',
|
|
187
|
-
// 'align-items': 'center',
|
|
188
|
-
// 'align-content': 'center',
|
|
189
|
-
// 'justify-content': 'center',
|
|
190
|
-
// 'flex-direction': 'column',
|
|
191
|
-
// border: '2px dashed #000',
|
|
192
|
-
// color: '#000',
|
|
193
|
-
// padding: '0',
|
|
194
|
-
// cursor: 'pointer',
|
|
195
|
-
// '& span': {
|
|
196
|
-
// width: '100%',
|
|
197
|
-
// cursor: 'pointer'
|
|
198
|
-
// },
|
|
199
|
-
// '&:hover': {
|
|
200
|
-
// 'border-color': '#999'
|
|
201
|
-
// },
|
|
202
|
-
// '& input': {
|
|
203
|
-
// position: 'absolute',
|
|
204
|
-
// top: '0',
|
|
205
|
-
// left: '0',
|
|
206
|
-
// height: '100%',
|
|
207
|
-
// width: '100%',
|
|
208
|
-
// opacity: '0',
|
|
209
|
-
// cursor: 'pointer'
|
|
210
|
-
// }
|
|
211
|
-
// });
|
|
133
|
+
export const Dropzone = Component(`jbx-dropzone`);
|
|
212
134
|
|
|
213
135
|
export const Ul = Component(
|
|
214
136
|
`jbx-ul`,
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -13,6 +13,18 @@ html {
|
|
|
13
13
|
--base-radius: #95a5a6;
|
|
14
14
|
}
|
|
15
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
|
+
|
|
16
28
|
* {
|
|
17
29
|
padding: 0;
|
|
18
30
|
margin: 0;
|
|
@@ -35,8 +47,10 @@ body {
|
|
|
35
47
|
}
|
|
36
48
|
|
|
37
49
|
/* base text */
|
|
50
|
+
html,
|
|
38
51
|
body,
|
|
39
|
-
.jbx-button
|
|
52
|
+
.jbx-button,
|
|
53
|
+
.jbx-input {
|
|
40
54
|
font-size: var(--base-font-size);
|
|
41
55
|
line-height: 1;
|
|
42
56
|
}
|
|
@@ -90,7 +104,7 @@ body,
|
|
|
90
104
|
line-height: 1;
|
|
91
105
|
padding: 0;
|
|
92
106
|
margin: 0;
|
|
93
|
-
font-weight:
|
|
107
|
+
font-weight: 600;
|
|
94
108
|
}
|
|
95
109
|
|
|
96
110
|
.jbx-h4 {
|
|
@@ -134,3 +148,101 @@ body,
|
|
|
134
148
|
flex-wrap: wrap;
|
|
135
149
|
flex-direction: column;
|
|
136
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-dropzone {
|
|
168
|
+
height: 120px;
|
|
169
|
+
flex: 1;
|
|
170
|
+
max-width: 320px;
|
|
171
|
+
display: flex;
|
|
172
|
+
text-align: center;
|
|
173
|
+
align-items: center;
|
|
174
|
+
align-content: center;
|
|
175
|
+
justify-content: center;
|
|
176
|
+
flex-direction: column;
|
|
177
|
+
border: 2px dashed #000;
|
|
178
|
+
color: #000;
|
|
179
|
+
padding: 0;
|
|
180
|
+
cursor: pointer;
|
|
181
|
+
}
|
|
182
|
+
.jbx-dropzone:hover {
|
|
183
|
+
border-color: #999;
|
|
184
|
+
}
|
|
185
|
+
.jbx-dropzone span {
|
|
186
|
+
width: 100%;
|
|
187
|
+
cursor: pointer;
|
|
188
|
+
}
|
|
189
|
+
.jbx-dropzone input {
|
|
190
|
+
position: absolute;
|
|
191
|
+
top: 0;
|
|
192
|
+
left: 0;
|
|
193
|
+
height: 100%;
|
|
194
|
+
width: 100%;
|
|
195
|
+
opacity: 0;
|
|
196
|
+
cursor: pointer;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/*export const Dropzone = Styled.div({
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
},
|
|
204
|
+
'& input': {
|
|
205
|
+
position: 'absolute',
|
|
206
|
+
top: '0',
|
|
207
|
+
left: '0',
|
|
208
|
+
height: '100%',
|
|
209
|
+
width: '100%',
|
|
210
|
+
opacity: '0',
|
|
211
|
+
cursor: 'pointer'
|
|
212
|
+
}
|
|
213
|
+
});*/
|
|
214
|
+
|
|
215
|
+
.jbx-range {
|
|
216
|
+
flex: 1;
|
|
217
|
+
width: 100%;
|
|
218
|
+
appearance: none;
|
|
219
|
+
background-color: var(--accent-color);
|
|
220
|
+
height: var(--size);
|
|
221
|
+
border-radius: 0;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.jbx-range::-webkit-slider-thumb {
|
|
225
|
+
-webkit-appearance: none;
|
|
226
|
+
appearance: none;
|
|
227
|
+
box-shadow: none;
|
|
228
|
+
border-radius: 0;
|
|
229
|
+
height: calc(var(--size) * 2);
|
|
230
|
+
width: var(--size);
|
|
231
|
+
background-color: #000;
|
|
232
|
+
border: none;
|
|
233
|
+
}
|
|
234
|
+
.jbx-range::-moz-range-thumb {
|
|
235
|
+
appearance: none;
|
|
236
|
+
box-shadow: none;
|
|
237
|
+
border-radius: 0;
|
|
238
|
+
height: calc(var(--size) * 2);
|
|
239
|
+
width: var(--size);
|
|
240
|
+
background-color: #000;
|
|
241
|
+
border: none;
|
|
242
|
+
}
|
|
243
|
+
.jbx-range::-webkit-slider-runnable-track {
|
|
244
|
+
appearance: none;
|
|
245
|
+
}
|
|
246
|
+
.jbx-range:focus {
|
|
247
|
+
outline: none;
|
|
248
|
+
}
|