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