Bin
2025-12-16 9e0b2ba2c317b1a86212f24cbae3195ad1f3dbfa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
.radio-group-ls {
  --radius: 8px;
  --padding: 4px;
  --font-size: 16px;
  --button-padding: 0 10px;
  --button-checked-shadow: 0 1px 0 rgb(0 0 0 / 10%), 0 0 0 1px rgb(0 0 0 / 2%), 0 5px 10px rgb(0 0 0 / 15%);
 
  border-radius: var(--radius);
  padding: var(--padding);
  background: var(--color-neutral-surface);
  border: 1px solid var(--color-neutral-border);
  box-sizing: border-box;
 
  &__buttons {
    height: calc(var(--height) - calc(var(--padding) * 2));
    display: grid;
    grid-auto-columns: 1fr; 
    grid-auto-flow: column;
    gap: 2px;
  }
 
  .radio-group-ls_horizontal &__buttons {
    display: grid;
    grid-auto-columns: min-content;
    column-gap: 16px;
    align-items: center;
    grid-auto-flow: column;
    margin: 0;
  }
 
  .radio-group-ls_simple &__buttons {
    all: unset;
    display: inline-block;
    margin-bottom: 16px;
  }
 
  & .label-ls__text {
    font-weight: 500;
 
    &::before {
      content: '';
      background: var(--color-neutral-background);
      border-radius: 100%;
      border: 1px solid var(--color-neutral-border);
      display: inline-block;
      width: 1.4em;
      height: 1.4em;
      position: relative;
      top: -10px;
      margin-right: 0.25rem;
      vertical-align: top;
      cursor: pointer;
      text-align: center;
      transition: all 300ms ease-out;
      box-shadow: inset 0 0 0 8px var(--color-neutral-background);
    }
 
    &:hover {
      &::before {
        border-color: var(--color-neutral-border-bold);
      }
    }
  }
 
  & input[type="radio"] {
    display: none;
  }
 
  &__button {
    display: flex;
    opacity: 0.6;
    padding: var(--button-padding);
    cursor: pointer;
    font-weight: 500;
    position: relative;
    text-align: center;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size);
    border-radius: 4px;
    height: calc(var(--height) - calc(var(--padding) * 2));
    transition: all 150ms ease-out;
 
    &:hover {
      opacity: 1;
 
      & .label-ls__text {
        &::before {
          box-shadow: inset 0 0 0 4px var(--color-neutral-background);
        }
      }
    }
 
    &_checked {
      opacity: 1;
      background-color: var(--color-neutral-surface-hover);
      box-shadow: var(--button-checked-shadow);
 
      & .label-ls__text {
        &::before {
          background-color: var(--color-primary-surface);
          box-shadow: inset 0 0 0 4px var(--color-neutral-background);
        }
      }
    }
 
    &_disabled {
      opacity: 0.3;
      cursor: not-allowed;
    }
  }
 
  .radio-group-ls_horizontal &__button {
    margin: 0;
  }
 
  .radio-group-ls_simple &__button {
    all: unset;
    display: block;
    margin-bottom: 0.5rem !important;
  }
 
  &__input {
    top: 0;
    left: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    position: absolute;
  }
 
  &_size {
    &_large {
      --height: 40px;
      --radius: 8px;
    }
 
    &_compact {
      --height: 32px;
      --radius: 8px;
    }
 
    &_small {
      --height: 24px;
      --radius: 4px;
      --padding: 2px;
      --font-size: 12px;
      --button-padding: 0 5px;
      --button-checked-shadow: 0 1px 0 rgb(0 0 0 / 10%), 0 0 0 1px rgb(0 0 0 / 2%), 0 2px 4px rgb(0 0 0 / 15%);
    }
  }
 
  &_simple {
    --height: auto;
 
    all: unset;
    display: block;
  }
}