jbx 2.0.1 → 2.3.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 +6 -83
- package/package.json +1 -1
- package/style.css +122 -5
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`,
|
|
@@ -244,6 +166,7 @@ export const Tab = Component(
|
|
|
244
166
|
);
|
|
245
167
|
|
|
246
168
|
export const CodeSnippet = Component(`jbx-code-snippet`, null, { element: 'pre' });
|
|
169
|
+
export const CodeTextarea = Component(`jbx-code-area`, null, { element: 'textarea' });
|
|
247
170
|
|
|
248
171
|
export const CheckboxHidden = Component(`jbx-checkbox-hidden`, ({ checked }) => {
|
|
249
172
|
return {
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -49,7 +49,8 @@ body {
|
|
|
49
49
|
/* base text */
|
|
50
50
|
html,
|
|
51
51
|
body,
|
|
52
|
-
.jbx-button
|
|
52
|
+
.jbx-button,
|
|
53
|
+
.jbx-input {
|
|
53
54
|
font-size: var(--base-font-size);
|
|
54
55
|
line-height: 1;
|
|
55
56
|
}
|
|
@@ -59,16 +60,34 @@ body,
|
|
|
59
60
|
font-family: monaco, monospace;
|
|
60
61
|
border: none;
|
|
61
62
|
width: 100%;
|
|
62
|
-
font-size: calc(var(--size) -
|
|
63
|
-
line-height: 1.
|
|
64
|
-
padding: var(--size);
|
|
63
|
+
font-size: calc(var(--size) - 3px);
|
|
64
|
+
line-height: 1.33;
|
|
65
|
+
padding: var(--size) calc(var(--size) * 1.2);
|
|
65
66
|
background: #ecf0f1;
|
|
66
67
|
color: #34495e;
|
|
68
|
+
resize: none;
|
|
67
69
|
}
|
|
68
70
|
.jbx-code-snippet:focus {
|
|
69
71
|
outline: none;
|
|
70
72
|
}
|
|
71
73
|
|
|
74
|
+
.jbx-code-area {
|
|
75
|
+
border-radius: var(--size);
|
|
76
|
+
font-family: monaco, monospace;
|
|
77
|
+
border: none;
|
|
78
|
+
width: 100%;
|
|
79
|
+
font-size: calc(var(--size) - 3px);
|
|
80
|
+
line-height: 1.33;
|
|
81
|
+
padding: var(--size) calc(var(--size) * 1.2);
|
|
82
|
+
background: #ecf0f1;
|
|
83
|
+
color: #34495e;
|
|
84
|
+
resize: none;
|
|
85
|
+
min-height: 120px;
|
|
86
|
+
}
|
|
87
|
+
.jbx-code-area:focus {
|
|
88
|
+
outline: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
72
91
|
.jbx-button {
|
|
73
92
|
appearance: none;
|
|
74
93
|
user-select: none;
|
|
@@ -103,7 +122,7 @@ body,
|
|
|
103
122
|
line-height: 1;
|
|
104
123
|
padding: 0;
|
|
105
124
|
margin: 0;
|
|
106
|
-
font-weight:
|
|
125
|
+
font-weight: 600;
|
|
107
126
|
}
|
|
108
127
|
|
|
109
128
|
.jbx-h4 {
|
|
@@ -147,3 +166,101 @@ body,
|
|
|
147
166
|
flex-wrap: wrap;
|
|
148
167
|
flex-direction: column;
|
|
149
168
|
}
|
|
169
|
+
|
|
170
|
+
.jbx-input {
|
|
171
|
+
color: #777;
|
|
172
|
+
-webkit-text-fill-color: #777;
|
|
173
|
+
opacity: 1;
|
|
174
|
+
flex: 1;
|
|
175
|
+
display: block;
|
|
176
|
+
appearance: none;
|
|
177
|
+
border: none;
|
|
178
|
+
border-radius: 0;
|
|
179
|
+
height: calc(var(--size) * 2.5);
|
|
180
|
+
background-color: #eee;
|
|
181
|
+
padding: 0 calc(var(--size) * 0.5);
|
|
182
|
+
box-shadow: inset rgba(0, 0, 0, 0.04) 3px 3px 0, inset rgba(0, 0, 0, 0.03) 0.5px 0.5px 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.jbx-dropzone {
|
|
186
|
+
height: 120px;
|
|
187
|
+
flex: 1;
|
|
188
|
+
max-width: 320px;
|
|
189
|
+
display: flex;
|
|
190
|
+
text-align: center;
|
|
191
|
+
align-items: center;
|
|
192
|
+
align-content: center;
|
|
193
|
+
justify-content: center;
|
|
194
|
+
flex-direction: column;
|
|
195
|
+
border: 2px dashed #000;
|
|
196
|
+
color: #000;
|
|
197
|
+
padding: 0;
|
|
198
|
+
cursor: pointer;
|
|
199
|
+
}
|
|
200
|
+
.jbx-dropzone:hover {
|
|
201
|
+
border-color: #999;
|
|
202
|
+
}
|
|
203
|
+
.jbx-dropzone span {
|
|
204
|
+
width: 100%;
|
|
205
|
+
cursor: pointer;
|
|
206
|
+
}
|
|
207
|
+
.jbx-dropzone input {
|
|
208
|
+
position: absolute;
|
|
209
|
+
top: 0;
|
|
210
|
+
left: 0;
|
|
211
|
+
height: 100%;
|
|
212
|
+
width: 100%;
|
|
213
|
+
opacity: 0;
|
|
214
|
+
cursor: pointer;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/*export const Dropzone = Styled.div({
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
},
|
|
222
|
+
'& input': {
|
|
223
|
+
position: 'absolute',
|
|
224
|
+
top: '0',
|
|
225
|
+
left: '0',
|
|
226
|
+
height: '100%',
|
|
227
|
+
width: '100%',
|
|
228
|
+
opacity: '0',
|
|
229
|
+
cursor: 'pointer'
|
|
230
|
+
}
|
|
231
|
+
});*/
|
|
232
|
+
|
|
233
|
+
.jbx-range {
|
|
234
|
+
flex: 1;
|
|
235
|
+
width: 100%;
|
|
236
|
+
appearance: none;
|
|
237
|
+
background-color: var(--accent-color);
|
|
238
|
+
height: var(--size);
|
|
239
|
+
border-radius: 0;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.jbx-range::-webkit-slider-thumb {
|
|
243
|
+
-webkit-appearance: none;
|
|
244
|
+
appearance: none;
|
|
245
|
+
box-shadow: none;
|
|
246
|
+
border-radius: 0;
|
|
247
|
+
height: calc(var(--size) * 2);
|
|
248
|
+
width: var(--size);
|
|
249
|
+
background-color: #000;
|
|
250
|
+
border: none;
|
|
251
|
+
}
|
|
252
|
+
.jbx-range::-moz-range-thumb {
|
|
253
|
+
appearance: none;
|
|
254
|
+
box-shadow: none;
|
|
255
|
+
border-radius: 0;
|
|
256
|
+
height: calc(var(--size) * 2);
|
|
257
|
+
width: var(--size);
|
|
258
|
+
background-color: #000;
|
|
259
|
+
border: none;
|
|
260
|
+
}
|
|
261
|
+
.jbx-range::-webkit-slider-runnable-track {
|
|
262
|
+
appearance: none;
|
|
263
|
+
}
|
|
264
|
+
.jbx-range:focus {
|
|
265
|
+
outline: none;
|
|
266
|
+
}
|