jbx 1.5.0 → 1.7.2
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/.editorconfig +12 -0
- package/.prettierrc +13 -0
- package/CHANGELOG.md +14 -6
- package/README.md +7 -24
- package/index.js +186 -192
- package/package.json +3 -12
package/.editorconfig
ADDED
package/.prettierrc
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"singleQuote": true,
|
|
3
|
+
"printWidth": 100,
|
|
4
|
+
"editor.formatOnSave": true,
|
|
5
|
+
"proseWrap": "always",
|
|
6
|
+
"tabWidth": 2,
|
|
7
|
+
"requireConfig": false,
|
|
8
|
+
"useTabs": false,
|
|
9
|
+
"trailingComma": "none",
|
|
10
|
+
"bracketSpacing": true,
|
|
11
|
+
"jsxBracketSameLine": false,
|
|
12
|
+
"semi": true
|
|
13
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,25 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# v1.7.0
|
|
2
|
+
|
|
3
|
+
- Add `touch-action: pan-y;`.
|
|
4
|
+
|
|
5
|
+
# v1.6.0
|
|
6
|
+
|
|
7
|
+
- `Button` now moves when clicked.
|
|
8
|
+
|
|
9
|
+
# v1.5.0
|
|
2
10
|
|
|
3
11
|
- Add `SmallText`.
|
|
4
12
|
- Add `MainHeader`.
|
|
5
13
|
- Prevent `Checkbox` from resizing from responsive `size`.
|
|
6
14
|
|
|
7
|
-
#
|
|
15
|
+
# v1.3.0
|
|
8
16
|
|
|
9
17
|
- Add `Checkbox`.
|
|
10
18
|
|
|
11
|
-
#
|
|
19
|
+
# v1.3.0
|
|
12
20
|
|
|
13
21
|
- Add `CodeSnippet` component.
|
|
14
22
|
|
|
15
|
-
#
|
|
23
|
+
# v1.2.0
|
|
16
24
|
|
|
17
25
|
- Increase padding of `Container`.
|
|
18
26
|
|
|
19
|
-
#
|
|
27
|
+
# v1.1.0
|
|
20
28
|
|
|
21
29
|
- Add padding to `Container`.
|
|
22
30
|
|
|
23
|
-
#
|
|
31
|
+
# v1.0.0
|
|
24
32
|
|
|
25
33
|
- Initial release
|
package/README.md
CHANGED
|
@@ -5,38 +5,22 @@ npm i jbx@latest capsize@latest styled-components@latest
|
|
|
5
5
|
```
|
|
6
6
|
|
|
7
7
|
```jsx
|
|
8
|
-
import {
|
|
9
|
-
JBX,
|
|
10
|
-
HeaderH1,
|
|
11
|
-
Text,
|
|
12
|
-
Space,
|
|
13
|
-
Container,
|
|
14
|
-
} from 'jbx';
|
|
8
|
+
import { JBX, MainHeader, Text, Space, Container } from "jbx";
|
|
15
9
|
|
|
16
10
|
function App() {
|
|
17
11
|
return (
|
|
18
12
|
<Container>
|
|
19
|
-
<JBX accent={
|
|
20
|
-
<
|
|
21
|
-
style={{
|
|
22
|
-
fontWeight: 900,
|
|
23
|
-
display: 'inline-block',
|
|
24
|
-
width: 'auto',
|
|
25
|
-
padding: '6px',
|
|
26
|
-
backgroundColor: 'var(--accent-color)'
|
|
27
|
-
}}
|
|
28
|
-
>
|
|
29
|
-
React Blur
|
|
30
|
-
</HeaderH1>
|
|
13
|
+
<JBX accent={"#eb4d4b"} />
|
|
14
|
+
<MainHeader>React Blur</MainHeader>
|
|
31
15
|
<Space h={1} />
|
|
32
16
|
<Text>
|
|
33
|
-
Tool that creates animated CSS transitions. Add sprites and get the code
|
|
34
|
-
your site.
|
|
17
|
+
Tool that creates animated CSS transitions. Add sprites and get the code
|
|
18
|
+
ready to paste in your site.
|
|
35
19
|
</Text>
|
|
36
20
|
<Space h={2} />
|
|
37
21
|
<Text>
|
|
38
|
-
Tool that creates animated CSS transitions. Add sprites and get the code
|
|
39
|
-
your site.
|
|
22
|
+
Tool that creates animated CSS transitions. Add sprites and get the code
|
|
23
|
+
ready to paste in your site.
|
|
40
24
|
</Text>
|
|
41
25
|
</Container>
|
|
42
26
|
);
|
|
@@ -44,4 +28,3 @@ function App() {
|
|
|
44
28
|
|
|
45
29
|
export default App;
|
|
46
30
|
```
|
|
47
|
-
|
package/index.js
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
|
-
import React, { Fragment } from
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
2
|
|
|
3
|
-
import Styled from
|
|
4
|
-
import capsize from
|
|
3
|
+
import Styled from 'styled-components';
|
|
4
|
+
import capsize from 'capsize';
|
|
5
5
|
|
|
6
|
-
import { createGlobalStyle } from
|
|
6
|
+
import { createGlobalStyle } from 'styled-components';
|
|
7
|
+
|
|
8
|
+
const SIZE = window.innerWidth > 1280 ? 16 : window.innerWidth > 640 ? 14 : 12;
|
|
9
|
+
const BASE_SIZE = SIZE;
|
|
10
|
+
const BASE_RADIUS = SIZE / 2;
|
|
11
|
+
const SPACE = SIZE;
|
|
12
|
+
const BASE_FONT_SIZE = SIZE;
|
|
13
|
+
|
|
14
|
+
const fontMetrics = {
|
|
15
|
+
capHeight: 1364,
|
|
16
|
+
ascent: 1950,
|
|
17
|
+
descent: -494,
|
|
18
|
+
unitsPerEm: 2048
|
|
19
|
+
};
|
|
7
20
|
|
|
8
21
|
export const JBX = createGlobalStyle`
|
|
9
22
|
html {
|
|
@@ -23,13 +36,13 @@ export const JBX = createGlobalStyle`
|
|
|
23
36
|
|
|
24
37
|
body {
|
|
25
38
|
touch-action: manipulation;
|
|
39
|
+
touch-action: pan-y;
|
|
26
40
|
}
|
|
27
41
|
|
|
28
42
|
body,
|
|
29
43
|
input,
|
|
30
44
|
textarea {
|
|
31
45
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif;
|
|
32
|
-
font-size: 16px;
|
|
33
46
|
}
|
|
34
47
|
|
|
35
48
|
body {
|
|
@@ -42,120 +55,108 @@ export const JBX = createGlobalStyle`
|
|
|
42
55
|
}
|
|
43
56
|
`;
|
|
44
57
|
|
|
45
|
-
const BASE_SIZE = 16;
|
|
46
|
-
const SIZE = window.innerHeight > 640 ? 16 : 14;
|
|
47
|
-
const BASE_RADIUS = SIZE / 2;
|
|
48
|
-
const SPACE = SIZE;
|
|
49
|
-
const BASE_FONT_SIZE = SIZE;
|
|
50
|
-
|
|
51
|
-
const fontMetrics = {
|
|
52
|
-
capHeight: 1364,
|
|
53
|
-
ascent: 1950,
|
|
54
|
-
descent: -494,
|
|
55
|
-
unitsPerEm: 2048,
|
|
56
|
-
};
|
|
57
|
-
|
|
58
58
|
const BaseText = Styled.div({});
|
|
59
59
|
|
|
60
60
|
function textProps(capsizeConfig) {
|
|
61
61
|
const capsizeComputed = {
|
|
62
62
|
fontMetrics,
|
|
63
63
|
lineGap: BASE_FONT_SIZE * 0.618,
|
|
64
|
-
...capsizeConfig
|
|
64
|
+
...capsizeConfig
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
return capsize(capsizeComputed);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
export const Container = Styled.div({
|
|
71
|
-
maxWidth:
|
|
72
|
-
margin:
|
|
73
|
-
padding: `${SIZE * 2.5}px ${SIZE * 1.5}px ${SIZE * 4}px
|
|
71
|
+
maxWidth: '1080px',
|
|
72
|
+
margin: '0 auto',
|
|
73
|
+
padding: `${SIZE * 2.5}px ${SIZE * 1.5}px ${SIZE * 4}px`
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
export const Text = Styled(BaseText)({
|
|
77
77
|
...textProps({
|
|
78
|
-
capHeight: BASE_FONT_SIZE
|
|
79
|
-
})
|
|
78
|
+
capHeight: BASE_FONT_SIZE
|
|
79
|
+
})
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
export const SmallText = Styled(BaseText)({
|
|
83
83
|
...textProps({
|
|
84
84
|
capHeight: BASE_FONT_SIZE * 0.8,
|
|
85
|
-
lineGap: BASE_FONT_SIZE / 3
|
|
86
|
-
})
|
|
85
|
+
lineGap: BASE_FONT_SIZE / 3
|
|
86
|
+
})
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
export const ButtonContainer = Styled.button({
|
|
90
|
-
appearance:
|
|
91
|
-
userSelect:
|
|
92
|
-
cursor:
|
|
93
|
-
display:
|
|
94
|
-
backgroundColor:
|
|
95
|
-
boxShadow:
|
|
90
|
+
appearance: 'none',
|
|
91
|
+
userSelect: 'none',
|
|
92
|
+
cursor: 'pointer',
|
|
93
|
+
display: 'inline-block',
|
|
94
|
+
backgroundColor: '#eee',
|
|
95
|
+
boxShadow: '3px 3px 0 #ccc',
|
|
96
96
|
padding: `0 ${SPACE / 2}px`,
|
|
97
|
-
border:
|
|
97
|
+
border: 'none',
|
|
98
98
|
height: SPACE * 2.5,
|
|
99
|
+
'&:active': {
|
|
100
|
+
top: 1,
|
|
101
|
+
left: 1,
|
|
102
|
+
boxShadow: '2px 2px 0 #ccc'
|
|
103
|
+
}
|
|
99
104
|
});
|
|
100
105
|
|
|
101
106
|
export const Button = function Button(props) {
|
|
102
107
|
const { children, ...other } = props;
|
|
103
|
-
return React.createElement(
|
|
104
|
-
ButtonContainer,
|
|
105
|
-
other,
|
|
106
|
-
React.createElement(Text, {}, children)
|
|
107
|
-
);
|
|
108
|
+
return React.createElement(ButtonContainer, other, React.createElement(Text, {}, children));
|
|
108
109
|
};
|
|
109
110
|
|
|
110
111
|
export const Input = Styled.input({
|
|
111
|
-
|
|
112
|
+
'-webkit-text-fill-color': '#777',
|
|
112
113
|
opacity: 1,
|
|
113
114
|
flex: 1,
|
|
114
|
-
display:
|
|
115
|
-
appearance:
|
|
116
|
-
border:
|
|
115
|
+
display: 'block',
|
|
116
|
+
appearance: 'none',
|
|
117
|
+
border: 'none',
|
|
117
118
|
borderRadius: 0,
|
|
118
119
|
height: SPACE * 2.5,
|
|
119
|
-
backgroundColor:
|
|
120
|
+
backgroundColor: '#eee',
|
|
120
121
|
...textProps({
|
|
121
|
-
capHeight: (BASE_FONT_SIZE * 3) / 3
|
|
122
|
+
capHeight: (BASE_FONT_SIZE * 3) / 3
|
|
122
123
|
}),
|
|
123
124
|
padding: `0 ${SPACE / 2}px`,
|
|
124
125
|
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:
|
|
126
|
+
color: '#777'
|
|
126
127
|
});
|
|
127
128
|
|
|
128
129
|
export const Range = Styled.input({
|
|
129
130
|
flex: 1,
|
|
130
|
-
width:
|
|
131
|
-
appearance:
|
|
132
|
-
backgroundColor:
|
|
131
|
+
width: '100%',
|
|
132
|
+
appearance: 'none',
|
|
133
|
+
backgroundColor: 'var(--accent-color)',
|
|
133
134
|
height: SPACE,
|
|
134
135
|
borderRadius: 0,
|
|
135
|
-
|
|
136
|
-
appearance:
|
|
137
|
-
boxShadow:
|
|
136
|
+
'&::-webkit-slider-thumb': {
|
|
137
|
+
appearance: 'none',
|
|
138
|
+
boxShadow: 'none',
|
|
138
139
|
borderRadius: 0,
|
|
139
140
|
height: SPACE * 2,
|
|
140
141
|
width: SPACE,
|
|
141
|
-
backgroundColor:
|
|
142
|
-
border:
|
|
142
|
+
backgroundColor: '#000',
|
|
143
|
+
border: 'none'
|
|
143
144
|
},
|
|
144
|
-
|
|
145
|
-
appearance:
|
|
146
|
-
boxShadow:
|
|
145
|
+
'&::-moz-range-thumb': {
|
|
146
|
+
appearance: 'none',
|
|
147
|
+
boxShadow: 'none',
|
|
147
148
|
borderRadius: 0,
|
|
148
149
|
height: SPACE * 2,
|
|
149
150
|
width: SPACE,
|
|
150
|
-
backgroundColor:
|
|
151
|
-
border:
|
|
152
|
-
},
|
|
153
|
-
"&::-webkit-slider-runnable-track": {
|
|
154
|
-
appearance: "none",
|
|
151
|
+
backgroundColor: '#000',
|
|
152
|
+
border: 'none'
|
|
155
153
|
},
|
|
156
|
-
|
|
157
|
-
|
|
154
|
+
'&::-webkit-slider-runnable-track': {
|
|
155
|
+
appearance: 'none'
|
|
158
156
|
},
|
|
157
|
+
':focus': {
|
|
158
|
+
outline: 'none'
|
|
159
|
+
}
|
|
159
160
|
});
|
|
160
161
|
|
|
161
162
|
export const HeaderH4 = Styled.h4({
|
|
@@ -165,8 +166,8 @@ export const HeaderH4 = Styled.h4({
|
|
|
165
166
|
fontWeight: 700,
|
|
166
167
|
...textProps({
|
|
167
168
|
capHeight: BASE_FONT_SIZE,
|
|
168
|
-
lineGap: BASE_FONT_SIZE
|
|
169
|
-
})
|
|
169
|
+
lineGap: BASE_FONT_SIZE
|
|
170
|
+
})
|
|
170
171
|
});
|
|
171
172
|
export const HeaderH3 = Styled.h3({
|
|
172
173
|
margin: 0,
|
|
@@ -175,8 +176,8 @@ export const HeaderH3 = Styled.h3({
|
|
|
175
176
|
fontWeight: 500,
|
|
176
177
|
...textProps({
|
|
177
178
|
capHeight: BASE_FONT_SIZE * 1 * 1.25,
|
|
178
|
-
lineGap: BASE_FONT_SIZE
|
|
179
|
-
})
|
|
179
|
+
lineGap: BASE_FONT_SIZE
|
|
180
|
+
})
|
|
180
181
|
});
|
|
181
182
|
export const HeaderH2 = Styled.h2({
|
|
182
183
|
margin: 0,
|
|
@@ -185,21 +186,21 @@ export const HeaderH2 = Styled.h2({
|
|
|
185
186
|
fontWeight: 500,
|
|
186
187
|
...textProps({
|
|
187
188
|
capHeight: BASE_FONT_SIZE * 1.5,
|
|
188
|
-
lineGap: 12
|
|
189
|
-
})
|
|
189
|
+
lineGap: 12
|
|
190
|
+
})
|
|
190
191
|
});
|
|
191
192
|
export const HeaderH1 = Styled.h1({
|
|
192
193
|
letterSpacing: -1,
|
|
193
|
-
margin:
|
|
194
|
+
margin: '2px 0',
|
|
194
195
|
fontWeight: 700,
|
|
195
196
|
...textProps({
|
|
196
197
|
capHeight: BASE_FONT_SIZE * 3 - 4,
|
|
197
|
-
lineGap: BASE_FONT_SIZE
|
|
198
|
-
})
|
|
198
|
+
lineGap: BASE_FONT_SIZE
|
|
199
|
+
})
|
|
199
200
|
});
|
|
200
201
|
|
|
201
202
|
export const MainHeader = function MainHeader({ children }) {
|
|
202
|
-
const content = String(children).split(
|
|
203
|
+
const content = String(children).split(' ');
|
|
203
204
|
|
|
204
205
|
return React.createElement(
|
|
205
206
|
Fragment,
|
|
@@ -211,12 +212,12 @@ export const MainHeader = function MainHeader({ children }) {
|
|
|
211
212
|
key: word,
|
|
212
213
|
style: {
|
|
213
214
|
fontWeight: 900,
|
|
214
|
-
display:
|
|
215
|
-
width:
|
|
216
|
-
padding:
|
|
215
|
+
display: 'inline-block',
|
|
216
|
+
width: 'auto',
|
|
217
|
+
padding: '6px',
|
|
217
218
|
margin: 0,
|
|
218
|
-
backgroundColor:
|
|
219
|
-
}
|
|
219
|
+
backgroundColor: 'var(--accent-color)'
|
|
220
|
+
}
|
|
220
221
|
},
|
|
221
222
|
word
|
|
222
223
|
)
|
|
@@ -225,19 +226,19 @@ export const MainHeader = function MainHeader({ children }) {
|
|
|
225
226
|
};
|
|
226
227
|
|
|
227
228
|
export const A = Styled.a({
|
|
228
|
-
color:
|
|
229
|
-
boxShadow:
|
|
229
|
+
color: '#000',
|
|
230
|
+
boxShadow: 'var(--accent-color) 0 2px 0, inset var(--accent-color) 0 -2px 0',
|
|
230
231
|
fontWeight: 700,
|
|
231
|
-
textDecoration:
|
|
232
|
-
|
|
233
|
-
color:
|
|
234
|
-
}
|
|
232
|
+
textDecoration: 'none',
|
|
233
|
+
'&:hover': {
|
|
234
|
+
color: '#34495e'
|
|
235
|
+
}
|
|
235
236
|
});
|
|
236
237
|
|
|
237
238
|
export const Space = Styled.div({
|
|
238
|
-
display: (props) => (props.inline ?
|
|
239
|
+
display: (props) => (props.inline ? 'inline-block' : 'block'),
|
|
239
240
|
height: (props) => `${SPACE * props.h}px`,
|
|
240
|
-
width: (props) => `${SPACE * props.w}px
|
|
241
|
+
width: (props) => `${SPACE * props.w}px`
|
|
241
242
|
});
|
|
242
243
|
|
|
243
244
|
export const Box = Styled.div({
|
|
@@ -248,115 +249,112 @@ export const Box = Styled.div({
|
|
|
248
249
|
|
|
249
250
|
const paddingArr = [padding].flat();
|
|
250
251
|
|
|
251
|
-
return paddingArr
|
|
252
|
-
.map((paddingValue) => `${paddingValue * SPACE}px`)
|
|
253
|
-
.join(` `);
|
|
252
|
+
return paddingArr.map((paddingValue) => `${paddingValue * SPACE}px`).join(` `);
|
|
254
253
|
},
|
|
255
254
|
|
|
256
|
-
|
|
257
|
-
display: ({ hideOnSmall }) => (hideOnSmall ?
|
|
255
|
+
'@media (max-width: 768px)': {
|
|
256
|
+
display: ({ hideOnSmall }) => (hideOnSmall ? 'none' : undefined)
|
|
258
257
|
},
|
|
259
258
|
|
|
260
|
-
|
|
261
|
-
display: ({ hideOnMedium }) => (hideOnMedium ?
|
|
262
|
-
}
|
|
259
|
+
'@media (max-width: 1080px)': {
|
|
260
|
+
display: ({ hideOnMedium }) => (hideOnMedium ? 'none' : undefined)
|
|
261
|
+
}
|
|
263
262
|
});
|
|
264
263
|
|
|
265
264
|
export const Inline = Styled.div({
|
|
266
|
-
display:
|
|
267
|
-
flexWrap:
|
|
265
|
+
display: 'flex',
|
|
266
|
+
flexWrap: 'wrap',
|
|
268
267
|
marginLeft: ({ h }) => `${h * SPACE}px`,
|
|
269
268
|
marginRight: ({ h }) => `${h * SPACE}px`,
|
|
270
269
|
marginTop: ({ v }) => `${v * SPACE}px`,
|
|
271
|
-
marginBottom: ({ v }) => `${v * SPACE}px
|
|
270
|
+
marginBottom: ({ v }) => `${v * SPACE}px`
|
|
272
271
|
});
|
|
273
272
|
|
|
274
273
|
export const LinkButton = Styled.a({
|
|
275
274
|
capHeight: BASE_FONT_SIZE,
|
|
276
|
-
color:
|
|
277
|
-
cursor:
|
|
275
|
+
color: '#3498db',
|
|
276
|
+
cursor: 'pointer',
|
|
278
277
|
borderRadius: 5,
|
|
279
|
-
borderTop:
|
|
280
|
-
borderBottom:
|
|
281
|
-
backgroundColor:
|
|
278
|
+
borderTop: '1px solid #3498db10',
|
|
279
|
+
borderBottom: '1px solid #0000',
|
|
280
|
+
backgroundColor: '#3498db20',
|
|
282
281
|
height: BASE_FONT_SIZE * 2,
|
|
283
|
-
display:
|
|
284
|
-
alignItems:
|
|
285
|
-
alignContent:
|
|
286
|
-
justifyContent:
|
|
282
|
+
display: 'flex',
|
|
283
|
+
alignItems: 'center',
|
|
284
|
+
alignContent: 'center',
|
|
285
|
+
justifyContent: 'center',
|
|
287
286
|
padding: 0,
|
|
288
|
-
|
|
289
|
-
boxShadow: `rgba(0, 0, 0, 0.1) 0 1px 1px, rgba(0, 0, 0, 0.1) 0 3px 12px
|
|
290
|
-
}
|
|
287
|
+
'&:hover': {
|
|
288
|
+
boxShadow: `rgba(0, 0, 0, 0.1) 0 1px 1px, rgba(0, 0, 0, 0.1) 0 3px 12px`
|
|
289
|
+
}
|
|
291
290
|
});
|
|
292
291
|
|
|
293
292
|
export const Dropzone = Styled.div({
|
|
294
|
-
height:
|
|
293
|
+
height: '120px',
|
|
295
294
|
flex: 1,
|
|
296
|
-
|
|
297
|
-
display:
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
border:
|
|
304
|
-
color:
|
|
305
|
-
padding:
|
|
306
|
-
cursor:
|
|
307
|
-
|
|
308
|
-
width:
|
|
309
|
-
cursor:
|
|
295
|
+
'max-width': '320px',
|
|
296
|
+
display: 'flex',
|
|
297
|
+
'text-align': 'center',
|
|
298
|
+
'align-items': 'center',
|
|
299
|
+
'align-content': 'center',
|
|
300
|
+
'justify-content': 'center',
|
|
301
|
+
'flex-direction': 'column',
|
|
302
|
+
border: '2px dashed #000',
|
|
303
|
+
color: '#000',
|
|
304
|
+
padding: '0',
|
|
305
|
+
cursor: 'pointer',
|
|
306
|
+
'& span': {
|
|
307
|
+
width: '100%',
|
|
308
|
+
cursor: 'pointer'
|
|
310
309
|
},
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
},
|
|
314
|
-
"& input": {
|
|
315
|
-
position: "absolute",
|
|
316
|
-
top: "0",
|
|
317
|
-
left: "0",
|
|
318
|
-
height: "100%",
|
|
319
|
-
width: "100%",
|
|
320
|
-
opacity: "0",
|
|
321
|
-
cursor: "pointer",
|
|
310
|
+
'&:hover': {
|
|
311
|
+
'border-color': '#999'
|
|
322
312
|
},
|
|
313
|
+
'& input': {
|
|
314
|
+
position: 'absolute',
|
|
315
|
+
top: '0',
|
|
316
|
+
left: '0',
|
|
317
|
+
height: '100%',
|
|
318
|
+
width: '100%',
|
|
319
|
+
opacity: '0',
|
|
320
|
+
cursor: 'pointer'
|
|
321
|
+
}
|
|
323
322
|
});
|
|
324
323
|
|
|
325
324
|
export const Ul = Styled.ul({
|
|
326
325
|
margin: 0,
|
|
327
|
-
padding: `0 0 0 ${BASE_FONT_SIZE / 4}px
|
|
326
|
+
padding: `0 0 0 ${BASE_FONT_SIZE / 4}px`
|
|
328
327
|
});
|
|
329
328
|
|
|
330
329
|
export const Li = Styled.li({
|
|
331
330
|
margin: `0 0 0 ${SIZE}px`,
|
|
332
|
-
padding: `${SIZE / 4}px 0
|
|
331
|
+
padding: `${SIZE / 4}px 0`
|
|
333
332
|
});
|
|
334
333
|
|
|
335
334
|
export const Tabs = Styled.div({});
|
|
336
335
|
|
|
337
336
|
export const Tab = Styled.div({
|
|
338
|
-
userSelect:
|
|
337
|
+
userSelect: 'none',
|
|
339
338
|
padding: SIZE / 2,
|
|
340
|
-
cursor:
|
|
341
|
-
backgroundColor: (props) =>
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
paddingLeft: (props) => (props.info ? 0 : undefined),
|
|
339
|
+
cursor: 'pointer',
|
|
340
|
+
backgroundColor: (props) => (props.active ? '#000' : props.info ? '#fff' : '#ecf0f1'),
|
|
341
|
+
color: (props) => (props.active ? '#fff' : '#000'),
|
|
342
|
+
paddingLeft: (props) => (props.info ? 0 : undefined)
|
|
345
343
|
});
|
|
346
344
|
|
|
347
345
|
export const CodeSnippet = Styled.pre({
|
|
348
346
|
borderRadius: BASE_RADIUS,
|
|
349
|
-
|
|
350
|
-
border:
|
|
351
|
-
width:
|
|
352
|
-
|
|
353
|
-
|
|
347
|
+
'font-family': 'monaco, monospace',
|
|
348
|
+
border: 'none',
|
|
349
|
+
width: '100%',
|
|
350
|
+
'font-size': SIZE - 2,
|
|
351
|
+
'line-height': '1.5',
|
|
354
352
|
padding: SIZE,
|
|
355
|
-
background:
|
|
356
|
-
color:
|
|
357
|
-
|
|
358
|
-
outline:
|
|
359
|
-
}
|
|
353
|
+
background: '#ecf0f1',
|
|
354
|
+
color: '#34495e',
|
|
355
|
+
':focus': {
|
|
356
|
+
outline: 'none'
|
|
357
|
+
}
|
|
360
358
|
});
|
|
361
359
|
|
|
362
360
|
export const CheckboxHidden = Styled.div(({ checked }) => {
|
|
@@ -365,12 +363,12 @@ export const CheckboxHidden = Styled.div(({ checked }) => {
|
|
|
365
363
|
width: BASE_SIZE * 2 - 4,
|
|
366
364
|
paddingTop: 2,
|
|
367
365
|
paddingLeft: 2,
|
|
368
|
-
backgroundColor: checked ?
|
|
366
|
+
backgroundColor: checked ? 'var(--accent-color)' : 'white',
|
|
369
367
|
borderRadius: BASE_RADIUS,
|
|
370
368
|
boxShadow: checked
|
|
371
|
-
?
|
|
372
|
-
:
|
|
373
|
-
cursor:
|
|
369
|
+
? 'inset rgba(0, 0, 0, 0.07) 0 0 0 1px'
|
|
370
|
+
: 'inset rgba(0, 0, 0, 0.33) 0 0 0 1.5px',
|
|
371
|
+
cursor: 'pointer'
|
|
374
372
|
};
|
|
375
373
|
});
|
|
376
374
|
|
|
@@ -384,58 +382,54 @@ export const Checkbox = function Checkbox({ label, checked, onChange }) {
|
|
|
384
382
|
}
|
|
385
383
|
},
|
|
386
384
|
style: {
|
|
387
|
-
alignItems:
|
|
388
|
-
cursor:
|
|
389
|
-
}
|
|
385
|
+
alignItems: 'center',
|
|
386
|
+
cursor: 'pointer'
|
|
387
|
+
}
|
|
390
388
|
},
|
|
391
389
|
[
|
|
392
390
|
React.createElement(
|
|
393
391
|
CheckboxHidden,
|
|
394
392
|
{
|
|
395
393
|
key: 0,
|
|
396
|
-
checked
|
|
394
|
+
checked
|
|
397
395
|
},
|
|
398
396
|
React.createElement(
|
|
399
|
-
|
|
397
|
+
'svg',
|
|
400
398
|
{
|
|
401
|
-
xmlns:
|
|
402
|
-
width:
|
|
403
|
-
height:
|
|
404
|
-
fill:
|
|
405
|
-
stroke:
|
|
406
|
-
strokeLinecap:
|
|
407
|
-
strokeLinejoin:
|
|
408
|
-
strokeWidth:
|
|
409
|
-
className:
|
|
410
|
-
viewBox:
|
|
411
|
-
color: checked ?
|
|
399
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
400
|
+
width: '24',
|
|
401
|
+
height: '24',
|
|
402
|
+
fill: 'none',
|
|
403
|
+
stroke: 'currentColor',
|
|
404
|
+
strokeLinecap: 'round',
|
|
405
|
+
strokeLinejoin: 'round',
|
|
406
|
+
strokeWidth: '2',
|
|
407
|
+
className: 'feather feather-check',
|
|
408
|
+
viewBox: '0 0 24 24',
|
|
409
|
+
color: checked ? 'white' : '#ddd'
|
|
412
410
|
},
|
|
413
|
-
React.createElement(
|
|
414
|
-
d:
|
|
411
|
+
React.createElement('path', {
|
|
412
|
+
d: 'M20 6L9 17 4 12'
|
|
415
413
|
})
|
|
416
414
|
)
|
|
417
415
|
),
|
|
418
416
|
React.createElement(Space, { key: 1, w: 0.5 }),
|
|
419
|
-
React.createElement(
|
|
420
|
-
Text,
|
|
421
|
-
{ key: 2, style: { userSelect: "none" } },
|
|
422
|
-
label
|
|
423
|
-
),
|
|
417
|
+
React.createElement(Text, { key: 2, style: { userSelect: 'none' } }, label)
|
|
424
418
|
]
|
|
425
419
|
);
|
|
426
420
|
};
|
|
427
421
|
|
|
428
422
|
export const Code = Styled.textarea({
|
|
429
|
-
|
|
430
|
-
border:
|
|
431
|
-
width:
|
|
432
|
-
height:
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
padding:
|
|
436
|
-
background:
|
|
437
|
-
color:
|
|
438
|
-
|
|
439
|
-
outline:
|
|
440
|
-
}
|
|
423
|
+
'font-family': 'monaco, monospace',
|
|
424
|
+
border: 'none',
|
|
425
|
+
width: '100%',
|
|
426
|
+
height: '256px',
|
|
427
|
+
'font-size': '12px',
|
|
428
|
+
'line-height': '1.309',
|
|
429
|
+
padding: '16px 18px',
|
|
430
|
+
background: '#ecf0f1',
|
|
431
|
+
color: '#34495e',
|
|
432
|
+
':focus': {
|
|
433
|
+
outline: 'none'
|
|
434
|
+
}
|
|
441
435
|
});
|
package/package.json
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jbx",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
},
|
|
9
|
-
"peerDependencies": {
|
|
10
|
-
"capsize": "^1.1.0",
|
|
11
|
-
"react": "16.13.1",
|
|
12
|
-
"react-dom": "16.13.1",
|
|
13
|
-
"styled-components": "^5.2.0"
|
|
14
|
-
},
|
|
15
|
-
"author": "",
|
|
16
|
-
"license": "ISC"
|
|
6
|
+
"author": "hi@javier.xyz",
|
|
7
|
+
"license": "Unlicensed"
|
|
17
8
|
}
|