@raketa-builder/ui 0.2.1-alpha → 0.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.
Files changed (50) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/.turbo/turbo-lint.log +10 -10
  3. package/dist/index.js +414 -721
  4. package/package.json +1 -2
  5. package/src/Button.jsx +33 -0
  6. package/src/Container.jsx +8 -0
  7. package/src/DataGrid.jsx +5 -54
  8. package/src/DefaultAvatar.jsx +31 -33
  9. package/src/FormGroup.jsx +8 -0
  10. package/src/Grid.jsx +47 -0
  11. package/src/H.jsx +7 -7
  12. package/src/Handle.jsx +8 -0
  13. package/src/Hint.jsx +16 -0
  14. package/src/ImageAvatar.jsx +20 -0
  15. package/src/Input.jsx +8 -0
  16. package/src/Label.jsx +11 -0
  17. package/src/LanguageSwitcher.jsx +19 -102
  18. package/src/Modal.jsx +68 -0
  19. package/src/Navigation.jsx +20 -0
  20. package/src/P.jsx +8 -0
  21. package/src/PageTitle.jsx +4 -7
  22. package/src/Pagination.jsx +4 -33
  23. package/src/Panel.jsx +11 -26
  24. package/src/Select.jsx +8 -0
  25. package/src/Stack.jsx +16 -0
  26. package/src/Tabs.jsx +41 -0
  27. package/src/Textarea.jsx +11 -0
  28. package/src/Toolbar.jsx +12 -0
  29. package/src/cn.js +3 -0
  30. package/src/index.js +1 -2
  31. package/src/styles.css +582 -5
  32. package/src/Button.js +0 -105
  33. package/src/Container.js +0 -16
  34. package/src/FormGroup.js +0 -8
  35. package/src/Grid.js +0 -38
  36. package/src/Handle.js +0 -12
  37. package/src/Hint.js +0 -12
  38. package/src/ImageAvatar.js +0 -16
  39. package/src/Input.js +0 -23
  40. package/src/Label.js +0 -12
  41. package/src/Modal.js +0 -112
  42. package/src/Navigation.js +0 -44
  43. package/src/P.js +0 -9
  44. package/src/Select.js +0 -29
  45. package/src/Stack.js +0 -8
  46. package/src/Tabs.js +0 -57
  47. package/src/Textarea.js +0 -24
  48. package/src/Toolbar.js +0 -11
  49. package/src/buttonReset.js +0 -12
  50. package/src/reset.js +0 -13
package/src/styles.css CHANGED
@@ -1,9 +1,36 @@
1
1
  @layer raketa-builder {
2
+ :root {
3
+ --r-true-black: #000;
4
+ --r-black: #2c2c2c;
5
+ --r-darker-gray: #4b4b4b;
6
+ --r-dark-gray: #6e6e6e;
7
+ --r-gray: #b3b3b3;
8
+ --r-light-gray: #e1e1e1;
9
+ --r-lighter-gray: #f5f5f5;
10
+ --r-white: #fafafa;
11
+ --r-true-white: #fff;
12
+ --r-primary-darker: #095aba;
13
+ --r-primary-dark: #0d66d0;
14
+ --r-primary: #1473e6;
15
+ --r-primaryRGB06: rgba(20, 115, 230, 0.6);
16
+ --r-primary-light: #2680eb;
17
+ --r-success-darker: #107154;
18
+ --r-success-dark: #12805c;
19
+ --r-success: #268e6c;
20
+ --r-success-light: #2d9d78;
21
+ --r-danger-darker: #bb121a;
22
+ --r-danger-dark: #c9252d;
23
+ --r-danger: #d7373f;
24
+ --r-danger-light: #e34850;
25
+ --r-dark-green: #0a0a;
26
+ }
27
+
28
+ /* Resets */
2
29
  .r-reset {
3
30
  box-sizing: border-box;
4
31
  margin: 0;
5
32
  padding: 0;
6
- color: black;
33
+ color: var(--r-black);
7
34
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
8
35
  Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue",
9
36
  sans-serif;
@@ -11,12 +38,14 @@
11
38
  line-height: 1;
12
39
  }
13
40
 
14
- .r-heading {
15
- padding-bottom: 0.5em;
16
- font-weight: 700;
17
- line-height: 1.2;
41
+ .r-reset-button {
42
+ appearance: none;
43
+ background: none;
44
+ border: none;
45
+ cursor: pointer;
18
46
  }
19
47
 
48
+ /* Design Tokens */
20
49
  .r-fs-tiny {
21
50
  font-size: 9px;
22
51
  }
@@ -48,4 +77,552 @@
48
77
  .r-fs-huge {
49
78
  font-size: 43px;
50
79
  }
80
+
81
+ /* Buttons */
82
+ .r-button {
83
+ margin-right: 0.25em;
84
+ padding: 0.5em 1em;
85
+ border-radius: 48px;
86
+ font-weight: 600;
87
+ line-height: 1;
88
+ transition: 0.2s ease-in-out all;
89
+
90
+ border: 2px solid var(--r-black);
91
+ background-color: transparent;
92
+ color: var(--r-black);
93
+ font-size: 14px;
94
+ }
95
+
96
+ .r-button:last-of-type {
97
+ margin-right: 0;
98
+ }
99
+
100
+ .r-button:hover {
101
+ border-color: var(--r-dark-gray);
102
+ color: var(--r-true-white);
103
+ background-color: var(--r-dark-gray);
104
+ }
105
+
106
+ .r-button:active {
107
+ border-color: var(--r-darker-gray);
108
+ color: var(--r-true-white);
109
+ background-color: var(--r-darker-gray);
110
+ }
111
+
112
+ .r-button:disabled {
113
+ opacity: 0.3;
114
+ cursor: not-allowed;
115
+ }
116
+
117
+ .r-button-sm {
118
+ font-size: 12px;
119
+ }
120
+
121
+ .r-button-lg {
122
+ font-size: 18px;
123
+ }
124
+
125
+ .r-button-primary {
126
+ border-color: var(--r-primary);
127
+ color: var(--r-true-white);
128
+ background-color: var(--r-primary);
129
+ }
130
+
131
+ .r-button-primary:hover {
132
+ border-color: var(--r-primary-dark);
133
+ background-color: var(--r-primary-dark);
134
+ }
135
+
136
+ .r-button-primary:active {
137
+ border-color: var(--r-primary-darker);
138
+ background-color: var(--r-primary-darker);
139
+ }
140
+
141
+ .r-button-secondary {
142
+ /* default behavior of the button */
143
+ }
144
+
145
+ .r-button-success {
146
+ border-color: var(--r-success);
147
+ color: var(--r-true-white);
148
+ background-color: var(--r-success);
149
+ }
150
+
151
+ .r-button-success:hover {
152
+ border-color: var(--r-success-dark);
153
+ background-color: var(--r-success-dark);
154
+ }
155
+
156
+ .r-button-success:active {
157
+ border-color: var(--r-success-darker);
158
+ background-color: var(--r-success-darker);
159
+ }
160
+
161
+ .r-button-danger {
162
+ border-color: var(--r-danger);
163
+ color: var(--r-true-white);
164
+ background-color: var(--r-danger);
165
+ }
166
+
167
+ .r-button-danger:hover {
168
+ border-color: var(--r-danger-dark);
169
+ color: var(--r-true-white);
170
+ background-color: var(--r-danger-dark);
171
+ }
172
+
173
+ .r-button-danger:active {
174
+ border-color: var(--r-danger-darker);
175
+ color: var(--r-true-white);
176
+ background-color: var(--r-danger-darker);
177
+ }
178
+
179
+ /* Tabs */
180
+ .r-tab-wrapper {
181
+ display: inline-flex;
182
+ margin-bottom: 1em;
183
+ border-bottom: 3px solid var(--r-light-gray);
184
+ }
185
+
186
+ .r-tab-button {
187
+ position: relative;
188
+ top: 3px;
189
+ margin-right: 2em;
190
+ padding-bottom: 0.5em;
191
+ border-bottom: 3px solid transparent;
192
+ font-weight: 500;
193
+ color: var(--r-dark-gray);
194
+ }
195
+
196
+ .r-tab-button:hover {
197
+ border-color: var(--r-true-black);
198
+ }
199
+
200
+ .r-tab-button-active {
201
+ border-bottom: 3px solid var(--r-true-black);
202
+ color: var(--r-true-black);
203
+ }
204
+
205
+ /* Navigation */
206
+
207
+ .r-navigation {
208
+ position: fixed;
209
+ top: 0;
210
+ bottom: 0;
211
+ left: 0;
212
+ display: flex;
213
+ gap: 8px;
214
+ flex-direction: column;
215
+ align-items: center;
216
+ width: 64px;
217
+ padding: 8px 0;
218
+ background-color: var(--r-true-black);
219
+ }
220
+
221
+ .r-navigation-item {
222
+ width: 48px;
223
+ height: 48px;
224
+ border-radius: 4px;
225
+ background-color: transparent;
226
+ transition: all 0.2s ease-in-out;
227
+ }
228
+
229
+ .r-navigation-item a,
230
+ .r-navigation-item .r-button {
231
+ display: flex;
232
+ justify-content: center;
233
+ align-items: center;
234
+ width: 100%;
235
+ height: 100%;
236
+ }
237
+ .r-navigation-item:hover {
238
+ background-color: var(--r-darker-gray);
239
+ }
240
+
241
+ .r-navigation-item-active {
242
+ background-color: var(--r-darker-gray);
243
+ }
244
+
245
+ /* Panels */
246
+
247
+ .r-panel {
248
+ margin-bottom: 0.5em;
249
+ border: 1px solid var(--r-lighter-gray);
250
+ border-radius: 3px;
251
+ background-color: var(--r-true-white);
252
+ }
253
+
254
+ .r-panel .sortable-selected {
255
+ background-color: var(--r-dark-green);
256
+ }
257
+ .r-panel-content {
258
+ padding: 1em;
259
+ }
260
+ .r-panel-title {
261
+ display: flex;
262
+ justify-content: space-between;
263
+ align-items: center;
264
+ padding: 0.25em 0.25em 0.25em;
265
+ border-bottom: 1px solid var(--r-light-gray);
266
+ background-color: var(--r-lighter-gray);
267
+ font-weight: 700;
268
+ }
269
+
270
+ /* Inputs */
271
+ .r-input {
272
+ appearance: none;
273
+ border: 0;
274
+ outline: 0;
275
+ border-radius: 4px;
276
+ border: 0;
277
+ width: 100%;
278
+ padding: 0.75em;
279
+ border: 1px solid var(--r-gray);
280
+ background-color: var(--r-true-white);
281
+ color: var(--r-true-black);
282
+ transition: all 0.2s ease-in-out;
283
+ }
284
+
285
+ .r-input:focus {
286
+ border-color: var(--r-primary);
287
+ }
288
+
289
+ .r-select {
290
+ background-size: 16px;
291
+ background-repeat: no-repeat;
292
+ background-position: center right 0.5em;
293
+ background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLWNoZXZyb24tZG93biI+PHBvbHlsaW5lIHBvaW50cz0iNiA5IDEyIDE1IDE4IDkiPjwvcG9seWxpbmU+PC9zdmc+);
294
+ }
295
+
296
+ .r-textarea {
297
+ height: 100px;
298
+ }
299
+
300
+ .r-label {
301
+ display: inline-block;
302
+ margin-bottom: 0.25em;
303
+ color: var(--r-dark-gray);
304
+ font-weight: 600;
305
+ cursor: pointer;
306
+ }
307
+
308
+ .r-hint {
309
+ padding-top: 0.5em;
310
+ opacity: 0.7;
311
+ }
312
+
313
+ .r-hint-error {
314
+ color: var(--r-danger);
315
+ }
316
+
317
+ .r-form-group {
318
+ width: 100%;
319
+ margin-bottom: 16px;
320
+ }
321
+
322
+ /* Table */
323
+
324
+ .r-table {
325
+ border-collapse: collapse;
326
+ width: 100%;
327
+ margin-bottom: 1em;
328
+ }
329
+
330
+ .r-table a {
331
+ color: var(--r-primary);
332
+ }
333
+
334
+ .r-table .actions {
335
+ width: 50px;
336
+ white-space: nowrap;
337
+ }
338
+
339
+ .r-table .actions div:first-of-type {
340
+ display: flex;
341
+ align-items: center;
342
+ }
343
+
344
+ .r-table .actions a,
345
+ .r-table .actions button {
346
+ margin-left: 0.5em;
347
+ }
348
+
349
+ .r-table th,
350
+ .r-table td {
351
+ padding: 0.5em;
352
+ text-align: left;
353
+ }
354
+
355
+ .r-table tr {
356
+ border-bottom: 1px solid var(--r-light-gray);
357
+ transition: all 0.3s ease-in-out;
358
+ }
359
+
360
+ .r-table tbody th:hover {
361
+ border-color: var(--r-gray);
362
+ }
363
+
364
+ .r-table tbody th:hover td {
365
+ background-color: var(--r-lighter-gray);
366
+ }
367
+
368
+ /* Base Blocks */
369
+
370
+ .r-container {
371
+ width: 100%;
372
+ padding: 0 calc(1em / 2);
373
+ }
374
+
375
+ @media (min-width: 1184px) {
376
+ .r-container {
377
+ width: 98%;
378
+ margin: 0 auto;
379
+ }
380
+ }
381
+
382
+ .r-row {
383
+ display: grid;
384
+ grid-template-columns: repeat(12, 1fr);
385
+ margin: 0;
386
+ }
387
+
388
+ .r-stack {
389
+ display: flex;
390
+ }
391
+
392
+ .r-heading {
393
+ padding-bottom: 0.5em;
394
+ font-weight: 700;
395
+ line-height: 1.2;
396
+ }
397
+
398
+ .r-paragraph {
399
+ padding-bottom: 1em;
400
+ }
401
+
402
+ .r-page-title {
403
+ margin: 1em 0;
404
+ }
405
+
406
+ /* Components */
407
+ .r-drag-handle {
408
+ width: 32px;
409
+ height: 32px;
410
+ background-size: 50%;
411
+ background-repeat: no-repeat;
412
+ background-position: center;
413
+ background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLW1vcmUtdmVydGljYWwiPjxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjEiPjwvY2lyY2xlPjxjaXJjbGUgY3g9IjEyIiBjeT0iNSIgcj0iMSI+PC9jaXJjbGU+PGNpcmNsZSBjeD0iMTIiIGN5PSIxOSIgcj0iMSI+PC9jaXJjbGU+PC9zdmc+);
414
+ cursor: grab;
415
+ }
416
+
417
+ .r-drag-handle:active {
418
+ cursor: grabbing;
419
+ }
420
+
421
+ .r-toolbar {
422
+ display: flex;
423
+ align-items: center;
424
+ gap: 0.5em;
425
+ }
426
+
427
+ .r-default-avatar {
428
+ display: flex;
429
+ justify-content: center;
430
+ align-items: center;
431
+ border-radius: 50%;
432
+ color: var(--r-true-white);
433
+ text-shadow: 1px 1px rgba(0, 0, 0, 0.1);
434
+ }
435
+
436
+ .r-image-avatar {
437
+ display: block;
438
+ border-radius: 50%;
439
+ }
440
+
441
+ /* Language Switcher */
442
+
443
+ .r-language-switcher {
444
+ position: relative;
445
+ display: flex;
446
+ flex-wrap: nowrap;
447
+ width: 100%;
448
+ height: 100%;
449
+ color: var(--r-true-white);
450
+ }
451
+
452
+ .r-language-switcher:hover [data-switcher] {
453
+ left: 48px;
454
+ opacity: 1;
455
+ }
456
+
457
+ .r-language-menu {
458
+ position: absolute;
459
+ z-index: 90;
460
+ left: -1000px;
461
+ display: flex;
462
+ flex-wrap: nowrap;
463
+ height: 100%;
464
+ background-color: var(--r-true-black);
465
+ opacity: 0;
466
+ transition: all ease-in-out 0.3s;
467
+ }
468
+ .r-language-item {
469
+ display: flex;
470
+ justify-content: center;
471
+ align-items: center;
472
+ width: 48px;
473
+ height: 48px;
474
+ background-color: var(--r-true-black);
475
+ text-transform: uppercase;
476
+ }
477
+ .r-language-item a:hover {
478
+ background-color: var(--r-primaryRGB06);
479
+ }
480
+ .r-language-item a {
481
+ color: var(--r-true-white);
482
+ font-weight: 500;
483
+ text-decoration: none;
484
+ }
485
+
486
+ .r-language-new-item {
487
+ position: relative;
488
+ width: 48px;
489
+ height: 48px;
490
+ background-color: var(--r-true-black);
491
+ text-transform: uppercase;
492
+ }
493
+
494
+ .r-language-new-item a {
495
+ position: absolute;
496
+ top: 0;
497
+ bottom: 0;
498
+ left: 0;
499
+ right: 0;
500
+ z-index: 30;
501
+ color: var(--r-true-white);
502
+ font-weight: 700;
503
+ text-decoration: none;
504
+ }
505
+ .r-language-new-item a:hover {
506
+ background-color: var(--r-primaryRGB06);
507
+ }
508
+
509
+ .r-language-new-item span {
510
+ display: flex;
511
+ justify-content: center;
512
+ align-items: center;
513
+ width: 100%;
514
+ height: 100%;
515
+ opacity: 0.6;
516
+ color: var(--r-true-white);
517
+ font-weight: 500;
518
+ text-decoration: none;
519
+ }
520
+ .r-language-current-item {
521
+ position: relative;
522
+ z-index: 100;
523
+ display: flex;
524
+ justify-content: center;
525
+ align-items: center;
526
+ width: 100%;
527
+ height: 100%;
528
+ border-radius: 4px;
529
+ background-color: var(--r-primary);
530
+ text-transform: uppercase;
531
+ cursor: pointer;
532
+ }
533
+
534
+ /* Modal */
535
+
536
+ .r-modal {
537
+ position: fixed;
538
+ top: 0;
539
+ right: 0;
540
+ bottom: 0;
541
+ left: 0;
542
+ z-index: 1200;
543
+ display: flex;
544
+ justify-content: center;
545
+ align-items: center;
546
+ pointer-events: none;
547
+ }
548
+ .r-modal-overlay {
549
+ position: fixed;
550
+ top: 0;
551
+ right: 0;
552
+ bottom: 0;
553
+ left: 0;
554
+ z-index: 1100;
555
+ background-color: rgba(0, 0, 0, 0.6);
556
+ cursor: pointer;
557
+ }
558
+ .r-modal-inner {
559
+ width: 80%;
560
+ border-radius: 5px;
561
+ background-color: var(--r-lighter-gray);
562
+ box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
563
+ pointer-events: all;
564
+ }
565
+ .r-modal-content {
566
+ padding: 0.5em 1em 1em 1em;
567
+ }
568
+ .r-modal-title {
569
+ font-size: 1.25em;
570
+ font-weight: 500;
571
+ }
572
+ .r-modal-title-bar {
573
+ display: flex;
574
+ justify-content: space-between;
575
+ align-items: center;
576
+ padding: 1em;
577
+ border-bottom: 2px solid var(--r-light-gray);
578
+ }
579
+ .r-modal-close-btn {
580
+ position: relative;
581
+ right: -4px;
582
+ z-index: 1300;
583
+ width: 2em;
584
+ height: 2em;
585
+ margin: 0;
586
+ padding: 0;
587
+ background-repeat: no-repeat;
588
+ background-size: 80%;
589
+ background-position: center;
590
+ background-image: var(--close-btn);
591
+ font-size: 1em;
592
+ overflow: hidden;
593
+ text-indent: -9999px;
594
+ }
595
+
596
+ /* Pagination */
597
+
598
+ .r-pagination a,
599
+ .r-pagination span {
600
+ display: block;
601
+ min-width: 1.25em;
602
+ padding: 0.5em 0.75em;
603
+ font-weight: 500;
604
+ text-align: center;
605
+ }
606
+ .r-pagination a {
607
+ color: var(--r-primary);
608
+ border: 1px solid var(--r-light-gray);
609
+ border-radius: 4px;
610
+ transition: all 0.2s ease-in-out;
611
+ }
612
+ .r-pagination a:hover {
613
+ border-color: var(--r-primary);
614
+ background-color: var(--r-primary);
615
+ color: var(--r-white);
616
+ }
617
+ .r-pagination {
618
+ display: flex;
619
+ justify-content: center;
620
+ flex-wrap: wrap;
621
+ gap: 0.25em;
622
+ padding: 1em 0 1em 0;
623
+ }
624
+ }
625
+
626
+ :root {
627
+ --close-btn: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLXgiPjxsaW5lIHgxPSIxOCIgeTE9IjYiIHgyPSI2IiB5Mj0iMTgiPjwvbGluZT48bGluZSB4MT0iNiIgeTE9IjYiIHgyPSIxOCIgeTI9IjE4Ij48L2xpbmU+PC9zdmc+);
51
628
  }
package/src/Button.js DELETED
@@ -1,105 +0,0 @@
1
- import styled from "styled-components";
2
- import buttonReset from "./buttonReset";
3
- import theme from "./theme";
4
-
5
- const variants = {
6
- primary: {
7
- border: "primary",
8
- background: "primary",
9
- color: "white",
10
- hoverBorder: "primaryDark",
11
- hoverBackground: "primaryDark",
12
- hoverColor: "white",
13
- activeBorder: "primaryDarker",
14
- activeBackground: "primaryDarker",
15
- activeColor: "white",
16
- },
17
- secondary: {
18
- border: "darkerGray",
19
- background: "white",
20
- color: "darkerGray",
21
- hoverBorder: "darkGray",
22
- hoverBackground: "darkGray",
23
- hoverColor: "white",
24
- activeBorder: "darkerGray",
25
- activeBackground: "darkerGray",
26
- activeColor: "white",
27
- },
28
- success: {
29
- border: "success",
30
- background: "success",
31
- color: "white",
32
- hoverBorder: "successDark",
33
- hoverBackground: "successDark",
34
- hoverColor: "white",
35
- activeBorder: "successDarker",
36
- activeBackground: "successDarker",
37
- activeColor: "white",
38
- },
39
- danger: {
40
- border: "danger",
41
- background: "danger",
42
- color: "white",
43
- hoverBorder: "dangerDark",
44
- hoverBackground: "dangerDark",
45
- hoverColor: "white",
46
- activeBorder: "dangerDarker",
47
- activeBackground: "dangerDarker",
48
- activeColor: "white",
49
- },
50
- };
51
-
52
- const getColor = (props, variant, key) =>
53
- props.theme.colors[variants[variant][key]];
54
-
55
- const Button = styled.button`
56
- ${buttonReset};
57
- padding: 0.5em 1em;
58
- margin-right: 0.25em;
59
- border: 2px solid ${(props) => getColor(props, props.variant, "border")};
60
- border-radius: 48px;
61
- background-color: ${(props) => getColor(props, props.variant, "background")};
62
- color: ${(props) => getColor(props, props.variant, "color")};
63
- font-size: ${(props) => Button.sizes[props.size]};
64
- font-weight: 700;
65
- line-height: 1;
66
- transition: 0.2s ease-in-out all;
67
-
68
- &:focus {
69
- border-color: ${(props) => getColor(props, props.variant, "activeBorder")};
70
- }
71
-
72
- &:hover {
73
- border-color: ${(props) => getColor(props, props.variant, "hoverBorder")};
74
- background-color: ${(props) =>
75
- getColor(props, props.variant, "hoverBackground")};
76
- color: ${(props) => getColor(props, props.variant, "hoverColor")};
77
- }
78
-
79
- &:active {
80
- border-color: ${(props) => getColor(props, props.variant, "activeBorder")};
81
- background-color: ${(props) =>
82
- getColor(props, props.variant, "activeBackground")};
83
- color: ${(props) => getColor(props, props.variant, "activeColor")};
84
- }
85
-
86
- &:last-of-type {
87
- margin-right: 0;
88
- }
89
- `;
90
-
91
- Button.defaultProps = {
92
- type: "button",
93
- size: "md",
94
- variant: "primary",
95
- };
96
-
97
- Button.variants = ["primary", "secondary", "success", "danger"];
98
-
99
- Button.sizes = {
100
- sm: theme.font.small,
101
- md: theme.font.base,
102
- lg: theme.font.medium,
103
- };
104
-
105
- export default Button;
package/src/Container.js DELETED
@@ -1,16 +0,0 @@
1
- import styled from "styled-components";
2
- import reset from "./reset";
3
-
4
- export default styled.div`
5
- ${reset};
6
- width: 100%;
7
- padding: 0 calc(1em / 2);
8
-
9
- padding-top: ${(props) => props.top && "1em"};
10
- padding-bottom: ${(props) => props.bottom && "1em"};
11
-
12
- @media (min-width: 1184px) {
13
- width: 98%;
14
- margin: 0 auto;
15
- }
16
- `;