jbx 2.7.0 → 2.9.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/dist/index.d.ts CHANGED
@@ -131,11 +131,18 @@ declare const CodeTextarea: (props: {
131
131
  style?: React.CSSProperties | undefined;
132
132
  }) => JSX.Element;
133
133
  declare const CheckboxHidden: (props: {
134
+ isChecked: boolean;
135
+ } & {
134
136
  children?: ReactNode;
135
137
  style?: React.CSSProperties | undefined;
136
138
  }) => JSX.Element;
139
+ declare const Checkbox: ({ label, checked, onChange }: {
140
+ label: string;
141
+ checked: boolean;
142
+ onChange?: ((value: boolean) => void) | undefined;
143
+ }) => React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
137
144
  declare function Bullet({ value }: {
138
145
  value: number;
139
146
  }): React.JSX.Element;
140
147
 
141
- export { A, Box, Bullet, Button, CheckboxHidden, CodeSnippet, CodeTextarea, Component, Container, Dropzone, HR, HeaderH1, HeaderH2, HeaderH3, HeaderH4, Inline, Input, Li, MainHeader, Range, SmallText, Space, Stack, Tab, Tabs, Text, Ul };
148
+ export { A, Box, Bullet, Button, Checkbox, CheckboxHidden, CodeSnippet, CodeTextarea, Component, Container, Dropzone, HR, HeaderH1, HeaderH2, HeaderH3, HeaderH4, Inline, Input, Li, MainHeader, Range, SmallText, Space, Stack, Tab, Tabs, Text, Ul };
package/dist/index.js CHANGED
@@ -2726,72 +2726,61 @@ const CodeSnippet = Component(`jbx-code-snippet`, {}, {
2726
2726
  const CodeTextarea = Component(`jbx-code-area`, {}, {
2727
2727
  element: 'textarea'
2728
2728
  });
2729
- const CheckboxHidden = Component(`jbx-checkbox-hidden`, ({ checked })=>{
2729
+ const CheckboxHidden = Component(`jbx-checkbox-hidden`, ({ isChecked })=>{
2730
2730
  return {
2731
2731
  height: SIZE * 2 - 4,
2732
2732
  width: SIZE * 2 - 4,
2733
2733
  paddingTop: 2,
2734
2734
  paddingLeft: 2,
2735
- backgroundColor: checked ? 'var(--accent-color)' : 'white',
2735
+ backgroundColor: isChecked ? 'var(--accent-color)' : 'white',
2736
2736
  borderRadius: BASE_RADIUS,
2737
- boxShadow: checked ? 'inset rgba(0, 0, 0, 0.07) 0 0 0 1px' : 'inset rgba(0, 0, 0, 0.33) 0 0 0 1.5px',
2737
+ boxShadow: isChecked ? 'inset rgba(0, 0, 0, 0.07) 0 0 0 1px' : 'inset rgba(0, 0, 0, 0.33) 0 0 0 1.5px',
2738
2738
  cursor: 'pointer'
2739
2739
  };
2740
2740
  });
2741
- // export const Checkbox = function Checkbox({
2742
- // label,
2743
- // checked,
2744
- // onChange
2745
- // }: {
2746
- // label: string;
2747
- // checked: boolean;
2748
- // onChange?: (value: boolean) => void;
2749
- // }) {
2750
- // return React.createElement(
2751
- // Inline,
2752
- // {
2753
- // onClick: () => {
2754
- // if (onChange) {
2755
- // onChange(!checked);
2756
- // }
2757
- // },
2758
- // style: {
2759
- // alignItems: 'center',
2760
- // cursor: 'pointer'
2761
- // }
2762
- // },
2763
- // [
2764
- // React.createElement(
2765
- // CheckboxHidden,
2766
- // {
2767
- // key: 0,
2768
- // checked
2769
- // },
2770
- // React.createElement(
2771
- // 'svg',
2772
- // {
2773
- // xmlns: 'http://www.w3.org/2000/svg',
2774
- // width: SIZE * 2 - 8,
2775
- // height: SIZE * 2 - 8,
2776
- // fill: 'none',
2777
- // stroke: 'currentColor',
2778
- // strokeLinecap: 'round',
2779
- // strokeLinejoin: 'round',
2780
- // strokeWidth: '2',
2781
- // className: 'feather feather-check',
2782
- // viewBox: '0 0 24 24',
2783
- // color: checked ? 'white' : '#ddd'
2784
- // },
2785
- // React.createElement('path', {
2786
- // d: 'M20 6L9 17 4 12'
2787
- // })
2788
- // )
2789
- // ),
2790
- // React.createElement(Space, { key: 1, w: 0.5 }),
2791
- // React.createElement(Text, { key: 2, style: { userSelect: 'none' } }, label)
2792
- // ]
2793
- // );
2794
- // };
2741
+ const Checkbox = function Checkbox({ label, checked, onChange }) {
2742
+ return /*#__PURE__*/ React.createElement(Inline, {
2743
+ // @ts-ignore
2744
+ onClick: ()=>{
2745
+ if (onChange) {
2746
+ onChange(!checked);
2747
+ }
2748
+ },
2749
+ style: {
2750
+ alignItems: 'center',
2751
+ cursor: 'pointer'
2752
+ }
2753
+ }, [
2754
+ /*#__PURE__*/ React.createElement(CheckboxHidden, {
2755
+ key: 0,
2756
+ isChecked: checked
2757
+ }, /*#__PURE__*/ React.createElement('svg', {
2758
+ xmlns: 'http://www.w3.org/2000/svg',
2759
+ width: SIZE * 2 - 8,
2760
+ height: SIZE * 2 - 8,
2761
+ fill: 'none',
2762
+ stroke: 'currentColor',
2763
+ strokeLinecap: 'round',
2764
+ strokeLinejoin: 'round',
2765
+ strokeWidth: '2',
2766
+ className: 'feather feather-check',
2767
+ viewBox: '0 0 24 24',
2768
+ color: checked ? 'white' : '#ddd'
2769
+ }, /*#__PURE__*/ React.createElement('path', {
2770
+ d: 'M20 6L9 17 4 12'
2771
+ }))),
2772
+ /*#__PURE__*/ React.createElement(Space, {
2773
+ key: 1,
2774
+ w: 0.5
2775
+ }),
2776
+ /*#__PURE__*/ React.createElement(Text, {
2777
+ key: 2,
2778
+ style: {
2779
+ userSelect: 'none'
2780
+ }
2781
+ }, label)
2782
+ ]);
2783
+ };
2795
2784
  function Bullet({ value }) {
2796
2785
  return /*#__PURE__*/ React.createElement("div", {
2797
2786
  className: "jbx-bullet-container"
@@ -2800,4 +2789,4 @@ function Bullet({ value }) {
2800
2789
  }, value));
2801
2790
  }
2802
2791
 
2803
- export { A, Box, Bullet, Button, CheckboxHidden, CodeSnippet, CodeTextarea, Component, Container, Dropzone, HR, HeaderH1, HeaderH2, HeaderH3, HeaderH4, Inline, Input, Li, MainHeader, Range, SmallText, Space, Stack, Tab, Tabs, Text, Ul };
2792
+ export { A, Box, Bullet, Button, Checkbox, CheckboxHidden, CodeSnippet, CodeTextarea, Component, Container, Dropzone, HR, HeaderH1, HeaderH2, HeaderH3, HeaderH4, Inline, Input, Li, MainHeader, Range, SmallText, Space, Stack, Tab, Tabs, Text, Ul };
package/dist/main.css ADDED
@@ -0,0 +1,369 @@
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
+ --font-size: 16px;
13
+ --font-size-small: 17px;
14
+ --radius-small: 2px;
15
+ }
16
+
17
+ @media screen and (max-width: 1200px) {
18
+ :root {
19
+ --font-size: 18px;
20
+ --font-size-small: 16px;
21
+ --size: 14px;
22
+ }
23
+ }
24
+
25
+ @media screen and (max-width: 600px) {
26
+ :root {
27
+ --font-size: 16px;
28
+ --font-size-small: 14px;
29
+ }
30
+ }
31
+
32
+ * {
33
+ padding: 0;
34
+ margin: 0;
35
+ position: relative;
36
+ }
37
+
38
+ body {
39
+ touch-action: pan-y;
40
+ }
41
+
42
+ body,
43
+ input,
44
+ textarea {
45
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
46
+ }
47
+
48
+ body {
49
+ background: #fcfcfd;
50
+ color: #000;
51
+ }
52
+
53
+ h1,
54
+ h2,
55
+ h3,
56
+ h4 {
57
+ line-height: 1;
58
+ padding: 0;
59
+ font-variation-settings: 'wght' 600;
60
+ font-weight: 600;
61
+ color: var(--base-font-color-bright);
62
+ }
63
+ h1 {
64
+ font-variation-settings: 'wdth' 107, 'wght' 650;
65
+ font-weight: 650;
66
+ }
67
+
68
+ strong,
69
+ b {
70
+ font-weight: 500;
71
+ }
72
+
73
+ .jbx-main-h1 {
74
+ display: inline-block;
75
+ background-color: var(--accent-color);
76
+ font-size: calc(var(--font-size) * 2);
77
+ padding: 8px;
78
+ }
79
+
80
+ .jbx-h1 {
81
+ font-size: calc(var(--font-size) * 2);
82
+ font-weight: 700;
83
+ }
84
+ .jbx-h2 {
85
+ font-size: calc(var(--font-size) * 1.25);
86
+ }
87
+ .jbx-h3 {
88
+ font-size: calc(var(--font-size) * 1.125);
89
+ }
90
+ .jbx-h4 {
91
+ font-size: var(--font-size-small);
92
+ text-transform: uppercase;
93
+ }
94
+
95
+ /* base text */
96
+ html,
97
+ body,
98
+ .jbx-button,
99
+ .jbx-input {
100
+ font-size: var(--font-size);
101
+ line-height: 1;
102
+ }
103
+
104
+ .jbx-code-snippet {
105
+ border-radius: var(--size);
106
+ font-family: monaco, monospace;
107
+ border: none;
108
+ width: 100%;
109
+ font-size: calc(var(--size) - 3px);
110
+ line-height: 1.33;
111
+ padding: var(--size) calc(var(--size) * 1.2);
112
+ background: #ecf0f1;
113
+ color: #34495e;
114
+ resize: none;
115
+ }
116
+ .jbx-code-snippet:focus {
117
+ outline: none;
118
+ }
119
+
120
+ .jbx-code-area {
121
+ border-radius: var(--size);
122
+ font-family: monaco, monospace;
123
+ border: none;
124
+ width: 100%;
125
+ font-size: calc(var(--size) - 3px);
126
+ line-height: 1.33;
127
+ padding: var(--size) calc(var(--size) * 1.2);
128
+ background: #ecf0f1;
129
+ color: #34495e;
130
+ resize: none;
131
+ min-height: 120px;
132
+ }
133
+ .jbx-code-area:focus {
134
+ outline: none;
135
+ }
136
+
137
+ .jbx-button {
138
+ color: #000;
139
+ border-radius: var(--radius-small);
140
+ appearance: none;
141
+ user-select: none;
142
+ cursor: pointer;
143
+ display: inline-block;
144
+ background-color: #eee;
145
+ box-shadow: 3px 3px 0 #ccc;
146
+ padding: 0 calc(var(--size) / 2);
147
+ border: none;
148
+ height: calc(var(--size) * 2.5);
149
+ transition: top 0.1s, left 0.1s, box-shadow 0.05s;
150
+ }
151
+ .jbx-button:active {
152
+ top: 1px;
153
+ left: 1px;
154
+ box-shadow: 1px 1px 0 #ccc;
155
+ }
156
+
157
+ /* LINKS */
158
+ .jbx-a {
159
+ cursor: pointer;
160
+ color: #000;
161
+ box-shadow: #0002 0 2px 0;
162
+ font-weight: 500;
163
+ text-decoration: none;
164
+ }
165
+ .jbx-a::after {
166
+ content: '↗';
167
+ color: #0004;
168
+ font-size: var(--font-size-small);
169
+ position: relative;
170
+ top: -1px;
171
+ right: -1px;
172
+ transition: top 0.3s, right 0.3s, color 0.3s;
173
+ }
174
+ .jbx-a:hover,
175
+ .jbx-block-link:hover .jbx-a {
176
+ box-shadow: var(--accent-color) 0 2px 0;
177
+ }
178
+ .jbx-a:hover::after,
179
+ .jbx-block-link:hover .jbx-a::after {
180
+ top: -3px;
181
+ right: -3px;
182
+ color: var(--accent-color);
183
+ }
184
+
185
+ .jbx-block-link {
186
+ min-width: 300px;
187
+ flex: 1;
188
+ text-decoration: none;
189
+ color: #000;
190
+ display: inline-block;
191
+ padding: var(--size);
192
+ }
193
+ a.jbx-a::before,
194
+ .jbx-block-link::before {
195
+ content: '';
196
+ display: block;
197
+ position: absolute;
198
+ background-color: #ecf0f1;
199
+ z-index: -1;
200
+ transition: transform 0.2s, opacity 0.2s;
201
+ transform: scale(0.98) translatey(4px);
202
+ opacity: 0;
203
+ top: -4px;
204
+ left: -6px;
205
+ right: -6px;
206
+ bottom: -4px;
207
+ }
208
+ .jbx-block-link::before {
209
+ border-radius: 16px;
210
+ }
211
+ a.jbx-a::before {
212
+ border-radius: 8px;
213
+ }
214
+ a.jbx-a:hover::before,
215
+ .jbx-block-link:hover::before {
216
+ transform: scale(1) translatey(0);
217
+ opacity: 1;
218
+ }
219
+
220
+ .jbx-a {
221
+ display: inline-block;
222
+ }
223
+
224
+ /* /LINKS */
225
+
226
+ .jbx-small-text {
227
+ font-size: var(--font-size-small);
228
+ }
229
+
230
+ .jbx-container {
231
+ max-width: 1080px;
232
+ margin: 0 auto;
233
+ padding: calc(var(--size) * 2.5) calc(var(--size) * 1.5) calc(var(--size) * 4);
234
+ }
235
+
236
+ .jbx-box {
237
+ flex: 1;
238
+ }
239
+
240
+ .jbx-inline {
241
+ flex: 1;
242
+ display: flex;
243
+ flex-wrap: wrap;
244
+ flex-direction: row;
245
+ }
246
+
247
+ .jbx-stack {
248
+ flex: 1;
249
+ display: flex;
250
+ flex-wrap: wrap;
251
+ flex-direction: column;
252
+ }
253
+
254
+ .jbx-text {
255
+ line-height: 1.4;
256
+ }
257
+
258
+ .jbx-input {
259
+ color: #777;
260
+ -webkit-text-fill-color: #777;
261
+ opacity: 1;
262
+ flex: 1;
263
+ display: block;
264
+ appearance: none;
265
+ border: none;
266
+ border-radius: var(--radius-small);
267
+ height: calc(var(--size) * 2.5);
268
+ background-color: #eee;
269
+ padding: 0 calc(var(--size) * 0.5);
270
+ box-shadow: inset rgba(0, 0, 0, 0.04) 3px 3px 0, inset rgba(0, 0, 0, 0.03) 0.5px 0.5px 0;
271
+ }
272
+
273
+ .jbx-dropzone {
274
+ height: 120px;
275
+ flex: 1;
276
+ display: flex;
277
+ text-align: center;
278
+ align-items: center;
279
+ align-content: center;
280
+ justify-content: center;
281
+ flex-direction: column;
282
+ border: 2px dashed #000;
283
+ color: #000;
284
+ padding: 0;
285
+ cursor: pointer;
286
+ }
287
+ .jbx-dropzone:hover {
288
+ border-color: #999;
289
+ }
290
+ .jbx-dropzone span {
291
+ width: 100%;
292
+ cursor: pointer;
293
+ }
294
+ .jbx-dropzone input {
295
+ position: absolute;
296
+ top: 0;
297
+ left: 0;
298
+ height: 100%;
299
+ width: 100%;
300
+ opacity: 0;
301
+ cursor: pointer;
302
+ }
303
+
304
+ .jbx-range {
305
+ flex: 1;
306
+ width: 100%;
307
+ appearance: none;
308
+ background-color: #bdc3c780;
309
+ height: var(--size);
310
+ border-radius: 0;
311
+ border-radius: var(--radius-small);
312
+ }
313
+
314
+ .jbx-range::-webkit-slider-thumb {
315
+ -webkit-appearance: none;
316
+ appearance: none;
317
+ box-shadow: none;
318
+ border-radius: 0;
319
+ height: calc(var(--size) * 2);
320
+ width: var(--size);
321
+ background-color: #000;
322
+ border: none;
323
+ border-radius: var(--radius-small);
324
+ }
325
+ .jbx-range::-moz-range-thumb {
326
+ appearance: none;
327
+ box-shadow: none;
328
+ border-radius: 0;
329
+ height: calc(var(--size) * 2);
330
+ width: var(--size);
331
+ background-color: #000;
332
+ border: none;
333
+ border-radius: var(--radius-small);
334
+ }
335
+ .jbx-range::-webkit-slider-runnable-track {
336
+ appearance: none;
337
+ }
338
+ .jbx-range:focus {
339
+ outline: none;
340
+ }
341
+
342
+ .jbx-bullet-container {
343
+ display: inline-block;
344
+ margin: -8px 4px -8px 0;
345
+ }
346
+
347
+ .jbx-bullet {
348
+ border: 1px solid #0001;
349
+ color: #000;
350
+ background-color: #0001;
351
+ text-align: center;
352
+ display: flex;
353
+ align-items: center;
354
+ justify-content: center;
355
+ font-size: calc(var(--font-size-small) - 3px);
356
+ height: calc(var(--size) * 1.25);
357
+ width: calc(var(--size) * 1.25);
358
+ border-radius: 100%;
359
+ top: -4px;
360
+ margin-right: 4px;
361
+ }
362
+
363
+ .jbx-hr {
364
+ margin: calc(var(--size) * 2) auto;
365
+ width: 38.2%;
366
+ border-radius: 0;
367
+ border: none;
368
+ border-top: 2px solid #ecf0f1;
369
+ }
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "jbx",
3
- "version": "2.7.0",
3
+ "version": "2.9.0",
4
4
  "author": "hi@javier.xyz",
5
5
  "license": "Unlicensed",
6
6
  "main": "./dist/index.js",
7
7
  "type": "module",
8
8
  "files": [
9
+ "./dist/main.css",
9
10
  "./dist/index.d.ts",
10
11
  "./dist/index.js"
11
12
  ],