@aristobyte-ui/radio 1.0.113 → 2.0.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.
@@ -0,0 +1,773 @@
1
+ @use '@aristobyte-ui/utils/aristobyte-ui.settings' as *;
2
+
3
+ .radio {
4
+ align-items: center;
5
+ cursor: pointer;
6
+ display: flex;
7
+ position: relative;
8
+
9
+ &-align-label {
10
+ &--top {
11
+ flex-direction: column;
12
+
13
+ .radio__control {
14
+ order: 2;
15
+ }
16
+ }
17
+
18
+ &--right {
19
+ flex-direction: row;
20
+ }
21
+
22
+ &--bottom {
23
+ flex-direction: column;
24
+ }
25
+
26
+ &--left {
27
+ flex-direction: row;
28
+
29
+ .radio__control {
30
+ order: 2;
31
+ }
32
+ }
33
+ }
34
+
35
+ &--disabled {
36
+ cursor: not-allowed;
37
+ opacity: 0.5;
38
+ pointer-events: none;
39
+ }
40
+
41
+ &-size {
42
+ &--xsm {
43
+ gap: 3px;
44
+
45
+ .radio {
46
+ &__control {
47
+ height: 12px;
48
+ width: 12px;
49
+
50
+ &::after {
51
+ height: 6px;
52
+ width: 6px;
53
+ }
54
+ }
55
+
56
+ &__label {
57
+ font-size: 12px;
58
+ line-height: 12px;
59
+ }
60
+ }
61
+ }
62
+
63
+ &--sm {
64
+ gap: 4px;
65
+
66
+ .radio {
67
+ &__control {
68
+ height: 16px;
69
+ width: 16px;
70
+
71
+ &::after {
72
+ height: 8px;
73
+ width: 8px;
74
+ }
75
+ }
76
+
77
+ &__label {
78
+ font-size: 14px;
79
+ line-height: 14px;
80
+ }
81
+ }
82
+ }
83
+
84
+ &--md {
85
+ gap: 5px;
86
+
87
+ .radio {
88
+ &__control {
89
+ height: 20px;
90
+ width: 20px;
91
+
92
+ &::after {
93
+ height: 10px;
94
+ width: 10px;
95
+ }
96
+ }
97
+
98
+ &__label {
99
+ font-size: 16px;
100
+ line-height: 16px;
101
+ }
102
+ }
103
+ }
104
+
105
+ &--lg {
106
+ gap: 6px;
107
+
108
+ .radio {
109
+ &__control {
110
+ height: 24px;
111
+ width: 24px;
112
+
113
+ &::after {
114
+ height: 14px;
115
+ width: 14px;
116
+ }
117
+ }
118
+
119
+ &__label {
120
+ font-size: 18px;
121
+ line-height: 18px;
122
+ }
123
+ }
124
+ }
125
+
126
+ &--xlg {
127
+ gap: 8px;
128
+
129
+ .radio {
130
+ &__control {
131
+ height: 28px;
132
+ width: 28px;
133
+
134
+ &::after {
135
+ height: 16px;
136
+ width: 16px;
137
+ }
138
+ }
139
+
140
+ &__label {
141
+ font-size: 20px;
142
+ line-height: 20px;
143
+ }
144
+ }
145
+ }
146
+ }
147
+
148
+ &-variant {
149
+ &--default {
150
+ &.radio-appearance {
151
+ &--outline {
152
+ .radio__control {
153
+ background-color: rgba($color-default, 0.3);
154
+ border: 2px solid $color-default;
155
+
156
+ &::after {
157
+ background-color: $color-default;
158
+ }
159
+ }
160
+
161
+ &:active .radio__control {
162
+ background-color: rgba($color-default, 0.4);
163
+ }
164
+ }
165
+
166
+ &--no-outline {
167
+ .radio__control {
168
+ background-color: rgba($color-default, 0.3);
169
+ border: 2px solid transparent;
170
+
171
+ &::after {
172
+ background-color: $color-default;
173
+ }
174
+ }
175
+
176
+ &:active .radio__control {
177
+ background-color: rgba($color-default, 0.4);
178
+ }
179
+ }
180
+
181
+ &--glowing {
182
+ .radio__control {
183
+ backdrop-filter: 8px;
184
+ background-color: rgba($color-default, 0.3);
185
+ border: 2px solid $color-default;
186
+ box-shadow:
187
+ 0 0 8px rgba($color-default, 0.5),
188
+ 0 0 16px rgba($color-default, 0.4),
189
+ 0 0 24px rgba($color-default, 0.3);
190
+
191
+ &::after {
192
+ background-color: $color-default;
193
+ }
194
+ }
195
+
196
+ &:active .radio__control {
197
+ background-color: rgba($color-default, 0.4);
198
+ }
199
+ }
200
+
201
+ &--solid {
202
+ .radio__control {
203
+ background-color: $color-default;
204
+ border: 2px solid $color-default;
205
+
206
+ &::after {
207
+ background-color: rgba($white, 0.5);
208
+ }
209
+ }
210
+
211
+ &:active .radio__control {
212
+ background-color: rgba($color-default, 0.9);
213
+ }
214
+ }
215
+ }
216
+
217
+ .radio__label {
218
+ color: $white;
219
+
220
+ &--highlight-label {
221
+ color: $color-default;
222
+ }
223
+ }
224
+ }
225
+
226
+ &--primary {
227
+ &.radio-appearance {
228
+ &--outline {
229
+ .radio {
230
+ &__control {
231
+ background-color: rgba($color-primary, 0.3);
232
+ border: 2px solid $color-primary;
233
+
234
+ &::after {
235
+ background-color: $color-primary;
236
+ }
237
+ }
238
+ }
239
+
240
+ &:active .radio__control {
241
+ background-color: rgba($color-primary, 0.4);
242
+ }
243
+ }
244
+
245
+ &--no-outline {
246
+ .radio__control {
247
+ background-color: rgba($color-primary, 0.3);
248
+ border: 2px solid transparent;
249
+
250
+ &::after {
251
+ background-color: $color-primary;
252
+ }
253
+ }
254
+
255
+ &:active .radio__control {
256
+ background-color: rgba($color-primary, 0.4);
257
+ }
258
+ }
259
+
260
+ &--glowing {
261
+ .radio {
262
+ &__control {
263
+ backdrop-filter: 8px;
264
+ background-color: rgba($color-primary, 0.3);
265
+ border: 2px solid $color-primary;
266
+ box-shadow:
267
+ 0 0 8px rgba($color-primary, 0.5),
268
+ 0 0 16px rgba($color-primary, 0.4),
269
+ 0 0 24px rgba($color-primary, 0.3);
270
+
271
+ &::after {
272
+ background-color: $color-primary;
273
+ box-shadow:
274
+ 0 0 8px rgba($color-primary, 0.5),
275
+ 0 0 16px rgba($color-primary, 0.4),
276
+ 0 0 24px rgba($color-primary, 0.3);
277
+ }
278
+ }
279
+ }
280
+
281
+ &:active .radio__control {
282
+ background-color: rgba($color-primary, 0.4);
283
+ }
284
+ }
285
+
286
+ &--outline-dashed {
287
+ .radio {
288
+ &__control {
289
+ background-color: rgba($color-primary, 0.3);
290
+ border: 2px dashed $color-primary;
291
+
292
+ &::after {
293
+ background-color: $color-primary;
294
+ }
295
+ }
296
+ }
297
+
298
+ &:active .radio__control {
299
+ background-color: rgba($color-primary, 0.4);
300
+ }
301
+ }
302
+
303
+ &--solid {
304
+ .radio__control {
305
+ background-color: $color-primary;
306
+ border: 2px solid $color-primary;
307
+
308
+ &::after {
309
+ background-color: rgba($white, 0.9);
310
+ }
311
+ }
312
+
313
+ &:active .radio__control {
314
+ background-color: rgba($color-primary, 0.9);
315
+ }
316
+ }
317
+ }
318
+
319
+ .radio__label {
320
+ color: $white;
321
+
322
+ &--highlight-label {
323
+ color: $color-primary;
324
+ }
325
+ }
326
+ }
327
+
328
+ &--secondary {
329
+ &.radio-appearance {
330
+ &--outline {
331
+ .radio {
332
+ &__control {
333
+ background-color: rgba($color-secondary, 0.3);
334
+ border: 2px solid $color-secondary;
335
+
336
+ &::after {
337
+ background-color: $color-secondary;
338
+ }
339
+ }
340
+ }
341
+
342
+ &:active .radio__control {
343
+ background-color: rgba($color-secondary, 0.4);
344
+ }
345
+ }
346
+
347
+ &--no-outline {
348
+ .radio__control {
349
+ background-color: rgba($color-secondary, 0.3);
350
+ border: 2px solid transparent;
351
+
352
+ &::after {
353
+ background-color: $color-secondary;
354
+ }
355
+ }
356
+
357
+ &:active .radio__control {
358
+ background-color: rgba($color-secondary, 0.4);
359
+ }
360
+ }
361
+
362
+ &--glowing {
363
+ .radio {
364
+ &__control {
365
+ backdrop-filter: 8px;
366
+ background-color: rgba($color-secondary, 0.3);
367
+ border: 2px solid $color-secondary;
368
+ box-shadow:
369
+ 0 0 8px rgba($color-secondary, 0.5),
370
+ 0 0 16px rgba($color-secondary, 0.4),
371
+ 0 0 24px rgba($color-secondary, 0.3);
372
+
373
+ &::after {
374
+ background-color: $color-secondary;
375
+ box-shadow:
376
+ 0 0 8px rgba($color-secondary, 0.5),
377
+ 0 0 16px rgba($color-secondary, 0.4),
378
+ 0 0 24px rgba($color-secondary, 0.3);
379
+ }
380
+ }
381
+ }
382
+
383
+ &:active .radio__control {
384
+ background-color: rgba($color-secondary, 0.4);
385
+ }
386
+ }
387
+
388
+ &--outline-dashed {
389
+ .radio {
390
+ &__control {
391
+ background-color: rgba($color-secondary, 0.3);
392
+ border: 2px dashed $color-secondary;
393
+
394
+ &::after {
395
+ background-color: $color-secondary;
396
+ }
397
+ }
398
+ }
399
+
400
+ &:active .radio__control {
401
+ background-color: rgba($color-secondary, 0.4);
402
+ }
403
+ }
404
+
405
+ &--solid {
406
+ .radio__control {
407
+ background-color: $color-secondary;
408
+ border: 2px solid $color-secondary;
409
+
410
+ &::after {
411
+ background-color: rgba($white, 0.9);
412
+ }
413
+ }
414
+
415
+ &:active .radio__control {
416
+ background-color: rgba($color-secondary, 0.9);
417
+ }
418
+ }
419
+ }
420
+
421
+ .radio__label {
422
+ color: $white;
423
+
424
+ &--highlight-label {
425
+ color: $color-secondary;
426
+ }
427
+ }
428
+ }
429
+
430
+ &--error {
431
+ &.radio-appearance {
432
+ &--outline {
433
+ .radio {
434
+ &__control {
435
+ background-color: rgba($color-error, 0.3);
436
+ border: 2px solid $color-error;
437
+
438
+ &::after {
439
+ background-color: $color-error;
440
+ }
441
+ }
442
+ }
443
+
444
+ &:active .radio__control {
445
+ background-color: rgba($color-error, 0.4);
446
+ }
447
+ }
448
+
449
+ &--no-outline {
450
+ .radio__control {
451
+ background-color: rgba($color-error, 0.3);
452
+ border: 2px solid transparent;
453
+
454
+ &::after {
455
+ background-color: $color-error;
456
+ }
457
+ }
458
+
459
+ &:active .radio__control {
460
+ background-color: rgba($color-error, 0.4);
461
+ }
462
+ }
463
+
464
+ &--glowing {
465
+ .radio {
466
+ &__control {
467
+ backdrop-filter: 8px;
468
+ background-color: rgba($color-error, 0.3);
469
+ border: 2px solid $color-error;
470
+ box-shadow:
471
+ 0 0 8px rgba($color-error, 0.5),
472
+ 0 0 16px rgba($color-error, 0.4),
473
+ 0 0 24px rgba($color-error, 0.3);
474
+
475
+ &::after {
476
+ background-color: $color-error;
477
+ box-shadow:
478
+ 0 0 8px rgba($color-error, 0.5),
479
+ 0 0 16px rgba($color-error, 0.4),
480
+ 0 0 24px rgba($color-error, 0.3);
481
+ }
482
+ }
483
+ }
484
+
485
+ &:active .radio__control {
486
+ background-color: rgba($color-error, 0.4);
487
+ }
488
+ }
489
+
490
+ &--outline-dashed {
491
+ .radio {
492
+ &__control {
493
+ background-color: rgba($color-error, 0.3);
494
+ border: 2px dashed $color-error;
495
+
496
+ &::after {
497
+ background-color: $color-error;
498
+ }
499
+ }
500
+ }
501
+
502
+ &:active .radio__control {
503
+ background-color: rgba($color-error, 0.4);
504
+ }
505
+ }
506
+
507
+ &--solid {
508
+ .radio__control {
509
+ background-color: $color-error;
510
+ border: 2px solid $color-error;
511
+
512
+ &::after {
513
+ background-color: rgba($white, 0.9);
514
+ }
515
+ }
516
+
517
+ &:active .radio__control {
518
+ background-color: rgba($color-error, 0.9);
519
+ }
520
+ }
521
+ }
522
+
523
+ .radio__label {
524
+ color: $white;
525
+
526
+ &--highlight-label {
527
+ color: $color-error;
528
+ }
529
+ }
530
+ }
531
+
532
+ &--warning {
533
+ &.radio-appearance {
534
+ &--outline {
535
+ .radio {
536
+ &__control {
537
+ background-color: rgba($color-warning, 0.3);
538
+ border: 2px solid $color-warning;
539
+
540
+ &::after {
541
+ background-color: $color-warning;
542
+ }
543
+ }
544
+ }
545
+
546
+ &:active .radio__control {
547
+ background-color: rgba($color-warning, 0.4);
548
+ }
549
+ }
550
+
551
+ &--no-outline {
552
+ .radio__control {
553
+ background-color: rgba($color-warning, 0.3);
554
+ border: 2px solid transparent;
555
+
556
+ &::after {
557
+ background-color: $color-warning;
558
+ }
559
+ }
560
+
561
+ &:active .radio__control {
562
+ background-color: rgba($color-warning, 0.4);
563
+ }
564
+ }
565
+
566
+ &--glowing {
567
+ .radio {
568
+ &__control {
569
+ backdrop-filter: 8px;
570
+ background-color: rgba($color-warning, 0.3);
571
+ border: 2px solid $color-warning;
572
+ box-shadow:
573
+ 0 0 8px rgba($color-warning, 0.5),
574
+ 0 0 16px rgba($color-warning, 0.4),
575
+ 0 0 24px rgba($color-warning, 0.3);
576
+
577
+ &::after {
578
+ background-color: $color-warning;
579
+ box-shadow:
580
+ 0 0 8px rgba($color-warning, 0.5),
581
+ 0 0 16px rgba($color-warning, 0.4),
582
+ 0 0 24px rgba($color-warning, 0.3);
583
+ }
584
+ }
585
+ }
586
+
587
+ &:active .radio__control {
588
+ background-color: rgba($color-warning, 0.4);
589
+ }
590
+ }
591
+
592
+ &--outline-dashed {
593
+ .radio {
594
+ &__control {
595
+ background-color: rgba($color-warning, 0.3);
596
+ border: 2px dashed $color-warning;
597
+
598
+ &::after {
599
+ background-color: $color-warning;
600
+ }
601
+ }
602
+ }
603
+
604
+ &:active .radio__control {
605
+ background-color: rgba($color-warning, 0.4);
606
+ }
607
+ }
608
+
609
+ &--solid {
610
+ .radio__control {
611
+ background-color: $color-warning;
612
+ border: 2px solid $color-warning;
613
+
614
+ &::after {
615
+ background-color: rgba($white, 0.9);
616
+ }
617
+ }
618
+
619
+ &:active .radio__control {
620
+ background-color: rgba($color-warning, 0.9);
621
+ }
622
+ }
623
+ }
624
+
625
+ .radio__label {
626
+ color: $white;
627
+
628
+ &--highlight-label {
629
+ color: $color-warning;
630
+ }
631
+ }
632
+ }
633
+
634
+ &--success {
635
+ &.radio-appearance {
636
+ &--outline {
637
+ .radio {
638
+ &__control {
639
+ background-color: rgba($color-success, 0.3);
640
+ border: 2px solid $color-success;
641
+
642
+ &::after {
643
+ background-color: $color-success;
644
+ }
645
+ }
646
+ }
647
+
648
+ &:active .radio__control {
649
+ background-color: rgba($color-success, 0.4);
650
+ }
651
+ }
652
+
653
+ &--no-outline {
654
+ .radio__control {
655
+ background-color: rgba($color-success, 0.3);
656
+ border: 2px solid transparent;
657
+
658
+ &::after {
659
+ background-color: $color-success;
660
+ }
661
+ }
662
+
663
+ &:active .radio__control {
664
+ background-color: rgba($color-success, 0.4);
665
+ }
666
+ }
667
+
668
+ &--glowing {
669
+ .radio {
670
+ &__control {
671
+ backdrop-filter: 8px;
672
+ background-color: rgba($color-success, 0.3);
673
+ border: 2px solid $color-success;
674
+ box-shadow:
675
+ 0 0 8px rgba($color-success, 0.5),
676
+ 0 0 16px rgba($color-success, 0.4),
677
+ 0 0 24px rgba($color-success, 0.3);
678
+
679
+ &::after {
680
+ background-color: $color-success;
681
+ box-shadow:
682
+ 0 0 8px rgba($color-success, 0.5),
683
+ 0 0 16px rgba($color-success, 0.4),
684
+ 0 0 24px rgba($color-success, 0.3);
685
+ }
686
+ }
687
+ }
688
+
689
+ &:active .radio__control {
690
+ background-color: rgba($color-success, 0.4);
691
+ }
692
+ }
693
+
694
+ &--outline-dashed {
695
+ .radio {
696
+ &__control {
697
+ background-color: rgba($color-success, 0.3);
698
+ border: 2px dashed $color-success;
699
+
700
+ &::after {
701
+ background-color: $color-success;
702
+ }
703
+ }
704
+ }
705
+
706
+ &:active .radio__control {
707
+ background-color: rgba($color-success, 0.4);
708
+ }
709
+ }
710
+
711
+ &--solid {
712
+ .radio__control {
713
+ background-color: $color-success;
714
+ border: 2px solid $color-success;
715
+
716
+ &::after {
717
+ background-color: rgba($white, 0.9);
718
+ }
719
+ }
720
+
721
+ &:active .radio__control {
722
+ background-color: rgba($color-success, 0.9);
723
+ }
724
+ }
725
+ }
726
+
727
+ .radio__label {
728
+ color: $white;
729
+
730
+ &--highlight-label {
731
+ color: $color-success;
732
+ }
733
+ }
734
+ }
735
+ }
736
+
737
+ &:active &__control {
738
+ transform: scale(0.95);
739
+ }
740
+
741
+ &__control {
742
+ align-items: center;
743
+ border-radius: 999px;
744
+ display: flex;
745
+ flex-shrink: 0;
746
+ justify-content: center;
747
+ position: relative;
748
+ transition:
749
+ border-color 0.2s ease,
750
+ background-color 0.2s ease,
751
+ transform 300ms ease;
752
+
753
+ &::after {
754
+ border-radius: 50%;
755
+ content: '';
756
+ display: flex;
757
+ transform: scale(0);
758
+ transition: transform 0.2s ease;
759
+ }
760
+ }
761
+
762
+ &__input {
763
+ appearance: none;
764
+ height: 0;
765
+ margin: 0;
766
+ outline: none;
767
+ width: 0;
768
+
769
+ &:checked + .radio__control::after {
770
+ transform: scale(1);
771
+ }
772
+ }
773
+ }