@rescui/radio-button 0.10.6-RUI-297-Add-react-compiler-to-the-packages-build-dbbefd7b8.14 → 0.10.6-RUI-297-Add-react-compiler-to-the-packages-build-8aaaed4be.43
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/lib/index.css +65 -55
- package/lib/parts/radio-button-control.js +91 -45
- package/lib/parts/radio-button-list.js +214 -58
- package/lib/parts/radio-button-list.p.module.css.js +13 -13
- package/lib/parts/radio-button-manager.js +68 -33
- package/lib/parts/radio-button.p.module.css.js +13 -13
- package/lib/parts/use-safe-id.d.ts +4 -0
- package/lib/parts/use-safe-id.js +10 -0
- package/lib/public-api.p.css +5 -0
- package/lib/public-api.pcss +5 -0
- package/lib/radio-button.js +62 -17
- package/package.json +8 -7
- package/lib/parts/use-backward-compatible-id.d.ts +0 -4
- package/lib/parts/use-backward-compatible-id.js +0 -14
package/lib/index.css
CHANGED
|
@@ -1,35 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
@property --_rs-theme-dark-coefficient{
|
|
2
|
+
syntax:'<number>';
|
|
3
|
+
inherits:true;
|
|
4
|
+
initial-value:0;
|
|
5
|
+
}
|
|
6
|
+
._themeLight_13lk1j5_8{
|
|
2
7
|
--rs-theme-dark:0;
|
|
3
8
|
}
|
|
4
|
-
.
|
|
9
|
+
._themeDark_13lk1j5_11{
|
|
5
10
|
--rs-theme-dark:1;
|
|
6
11
|
}
|
|
7
|
-
.
|
|
12
|
+
._sizeS_13lk1j5_15{
|
|
8
13
|
--_rs-radio-button-size:20px;
|
|
9
14
|
--_rs-radio-button-box-shadow-size:3px;
|
|
10
15
|
--_rs-radio-button-active-icon-border-width:5px;
|
|
11
16
|
}
|
|
12
|
-
.
|
|
17
|
+
._sizeM_13lk1j5_18{
|
|
13
18
|
--_rs-radio-button-size:24px;
|
|
14
19
|
--_rs-radio-button-box-shadow-size:3px;
|
|
15
20
|
--_rs-radio-button-active-icon-border-width:6px;
|
|
16
21
|
}
|
|
17
|
-
.
|
|
22
|
+
._sizeL_13lk1j5_21{
|
|
18
23
|
--_rs-radio-button-size:28px;
|
|
19
24
|
--_rs-radio-button-box-shadow-size:4px;
|
|
20
25
|
--_rs-radio-button-active-icon-border-width:6px;
|
|
21
26
|
}
|
|
22
|
-
.
|
|
27
|
+
._classic_13lk1j5_25{
|
|
23
28
|
--_rs-radio-button-active-icon-border-color:var(--_rs-color-primary);
|
|
24
29
|
--_rs-radio-button-active-icon-background-color:#FFFFFF;
|
|
25
30
|
--_rs-radio-button-active-icon-hover-box-shadow-color:var(--_rs-color-primary-t-fog);
|
|
26
31
|
}
|
|
27
|
-
.
|
|
32
|
+
._rock_13lk1j5_28{
|
|
28
33
|
--_rs-radio-button-active-icon-border-color:rgb(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227));
|
|
29
34
|
--_rs-radio-button-active-icon-background-color:rgb(calc(255 - var(--_rs-theme-dark-coefficient, 0)*230), calc(255 - var(--_rs-theme-dark-coefficient, 0)*230), calc(255 - var(--_rs-theme-dark-coefficient, 0)*227));
|
|
30
35
|
--_rs-radio-button-active-icon-hover-box-shadow-color:rgba(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227), 0.1);
|
|
31
36
|
}
|
|
32
|
-
.
|
|
37
|
+
._main_13lk1j5_32{
|
|
33
38
|
--_rs-theme-dark:var(
|
|
34
39
|
--_rs-internal-force-theme-dark-consult-rescui-before-using,
|
|
35
40
|
var(--rs-theme-dark, 0)
|
|
@@ -39,7 +44,7 @@
|
|
|
39
44
|
--_rs-theme-light-coefficient:calc(1 - var(--_rs-theme-dark-coefficient));
|
|
40
45
|
}
|
|
41
46
|
@supports (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
42
|
-
.
|
|
47
|
+
._main_13lk1j5_32{
|
|
43
48
|
--_rs-color-primary:color-mix(in srgb, var(--rs-color-primary-light-theme, #6B57FF) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-dark-theme, #8473FF) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
44
49
|
--_rs-color-primary-dim:color-mix(in srgb, var(--rs-color-primary-dim-light-theme, #8979ff) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-dim-dark-theme, #6f61d2) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
45
50
|
--_rs-color-primary-fog:color-mix(in srgb, var(--rs-color-primary-fog-light-theme, #e1ddff) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-fog-dark-theme, #2e2b49) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
@@ -48,7 +53,7 @@
|
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
55
|
@supports not (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
51
|
-
.
|
|
56
|
+
._main_13lk1j5_32{
|
|
52
57
|
--_rs-color-primary:rgb(calc(var(--_rs-theme-light-coefficient, 1)*107 + var(--_rs-theme-dark-coefficient, 0)*132), calc(var(--_rs-theme-light-coefficient, 1)*87 + var(--_rs-theme-dark-coefficient, 0)*115), 255);
|
|
53
58
|
--_rs-color-primary-dim:rgb(calc(var(--_rs-theme-light-coefficient, 1)*137 + var(--_rs-theme-dark-coefficient, 0)*111), calc(var(--_rs-theme-light-coefficient, 1)*121 + var(--_rs-theme-dark-coefficient, 0)*97), calc(var(--_rs-theme-light-coefficient, 1)*255 + var(--_rs-theme-dark-coefficient, 0)*210));
|
|
54
59
|
--_rs-color-primary-fog:rgb(calc(var(--_rs-theme-light-coefficient, 1)*225 + var(--_rs-theme-dark-coefficient, 0)*46), calc(var(--_rs-theme-light-coefficient, 1)*221 + var(--_rs-theme-dark-coefficient, 0)*43), calc(var(--_rs-theme-light-coefficient, 1)*255 + var(--_rs-theme-dark-coefficient, 0)*73));
|
|
@@ -57,18 +62,18 @@
|
|
|
57
62
|
}
|
|
58
63
|
}
|
|
59
64
|
@supports (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
60
|
-
.
|
|
65
|
+
._main_13lk1j5_32{
|
|
61
66
|
--_rs-color-danger:color-mix(in srgb, #CC1400 calc(100%*var(--_rs-theme-light-coefficient, 1)), #FF6553 calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
62
67
|
--_rs-color-danger-bg:color-mix(in srgb, rgba(204,20,0, 0.2) calc(100%*var(--_rs-theme-light-coefficient, 1)), rgba(255,101,83, 0.2) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
63
68
|
}
|
|
64
69
|
}
|
|
65
70
|
@supports not (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
66
|
-
.
|
|
71
|
+
._main_13lk1j5_32{
|
|
67
72
|
--_rs-color-danger:rgb(calc(var(--_rs-theme-light-coefficient, 1)*204 + var(--_rs-theme-dark-coefficient, 0)*255), calc(var(--_rs-theme-light-coefficient, 1)*20 + var(--_rs-theme-dark-coefficient, 0)*101), calc(var(--_rs-theme-light-coefficient, 1)*0 + var(--_rs-theme-dark-coefficient, 0)*83));
|
|
68
73
|
--_rs-color-danger-bg:rgba(calc(var(--_rs-theme-light-coefficient, 1)*204 + var(--_rs-theme-dark-coefficient, 0)*255), calc(var(--_rs-theme-light-coefficient, 1)*20 + var(--_rs-theme-dark-coefficient, 0)*101), calc(var(--_rs-theme-light-coefficient, 1)*0 + var(--_rs-theme-dark-coefficient, 0)*83), 0.2);
|
|
69
74
|
}
|
|
70
75
|
}
|
|
71
|
-
.
|
|
76
|
+
._main_13lk1j5_32 {
|
|
72
77
|
|
|
73
78
|
display:inline-block;
|
|
74
79
|
|
|
@@ -77,7 +82,7 @@
|
|
|
77
82
|
|
|
78
83
|
vertical-align:middle;
|
|
79
84
|
}
|
|
80
|
-
.
|
|
85
|
+
._input_13lk1j5_45{
|
|
81
86
|
position:absolute;
|
|
82
87
|
-webkit-appearance:none;
|
|
83
88
|
-moz-appearance:none;
|
|
@@ -91,7 +96,7 @@
|
|
|
91
96
|
|
|
92
97
|
border:0;
|
|
93
98
|
}
|
|
94
|
-
.
|
|
99
|
+
._icon_13lk1j5_58{
|
|
95
100
|
position:relative;
|
|
96
101
|
|
|
97
102
|
display:inline-block;
|
|
@@ -108,16 +113,16 @@
|
|
|
108
113
|
|
|
109
114
|
background-color:rgb(calc(255 - var(--_rs-theme-dark-coefficient, 0)*207), calc(255 - var(--_rs-theme-dark-coefficient, 0)*207), calc(255 - var(--_rs-theme-dark-coefficient, 0)*204));
|
|
110
115
|
}
|
|
111
|
-
.
|
|
116
|
+
._enabled_13lk1j5_79 ._icon_13lk1j5_58{
|
|
112
117
|
cursor:pointer;
|
|
113
118
|
}
|
|
114
|
-
.
|
|
115
|
-
label:hover .
|
|
119
|
+
._enabled_13lk1j5_79:hover > ._icon_13lk1j5_58,
|
|
120
|
+
label:hover ._enabled_13lk1j5_79 > ._icon_13lk1j5_58{
|
|
116
121
|
background-color:rgb(calc(255 - var(--_rs-theme-dark-coefficient, 0)*184), calc(255 - var(--_rs-theme-dark-coefficient, 0)*184), calc(255 - var(--_rs-theme-dark-coefficient, 0)*182));
|
|
117
122
|
}
|
|
118
|
-
.
|
|
119
|
-
.
|
|
120
|
-
.
|
|
123
|
+
._disabled_13lk1j5_88 ._icon_13lk1j5_58._icon_13lk1j5_58,
|
|
124
|
+
._input_13lk1j5_45:disabled + ._icon_13lk1j5_58._icon_13lk1j5_58,
|
|
125
|
+
._input_13lk1j5_45:checked:disabled + ._icon_13lk1j5_58{
|
|
121
126
|
border-color:rgb(calc(186 - var(--_rs-theme-dark-coefficient, 0)*92), calc(186 - var(--_rs-theme-dark-coefficient, 0)*92), calc(187 - var(--_rs-theme-dark-coefficient, 0)*91));
|
|
122
127
|
|
|
123
128
|
cursor:not-allowed;
|
|
@@ -125,36 +130,41 @@
|
|
|
125
130
|
|
|
126
131
|
background-color:rgb(calc(244 - var(--_rs-theme-dark-coefficient, 0)*196), calc(244 - var(--_rs-theme-dark-coefficient, 0)*196), calc(244 - var(--_rs-theme-dark-coefficient, 0)*193));
|
|
127
132
|
}
|
|
128
|
-
.
|
|
129
|
-
.
|
|
133
|
+
._enabled_13lk1j5_79 ._input_13lk1j5_45:active + ._icon_13lk1j5_58,
|
|
134
|
+
._enabled_13lk1j5_79 ._input_13lk1j5_45:checked + ._icon_13lk1j5_58{
|
|
130
135
|
border-color:var(--_rs-radio-button-active-icon-border-color);
|
|
131
136
|
|
|
132
137
|
background-color:var(--_rs-radio-button-active-icon-background-color);
|
|
133
138
|
}
|
|
134
|
-
.
|
|
135
|
-
.
|
|
136
|
-
.
|
|
139
|
+
._enabled_13lk1j5_79 ._input_13lk1j5_45:active + ._icon_13lk1j5_58,
|
|
140
|
+
._enabled_13lk1j5_79 ._input_13lk1j5_45:checked + ._icon_13lk1j5_58,
|
|
141
|
+
._main_13lk1j5_32 ._input_13lk1j5_45:checked:disabled + ._icon_13lk1j5_58{
|
|
137
142
|
border-width:var(--_rs-radio-button-active-icon-border-width);
|
|
138
143
|
}
|
|
139
|
-
.
|
|
144
|
+
._error_13lk1j5_112 ._icon_13lk1j5_58._icon_13lk1j5_58._icon_13lk1j5_58{
|
|
140
145
|
border-color:var(--_rs-color-danger);
|
|
141
146
|
}
|
|
142
|
-
.
|
|
143
|
-
label:hover .
|
|
144
|
-
.
|
|
147
|
+
._enabled_13lk1j5_79:hover > ._icon_13lk1j5_58._icon_13lk1j5_58,
|
|
148
|
+
label:hover ._enabled_13lk1j5_79 > ._icon_13lk1j5_58._icon_13lk1j5_58,
|
|
149
|
+
._enabled_13lk1j5_79 ._input_13lk1j5_45:active:not(:checked) + ._icon_13lk1j5_58{
|
|
145
150
|
box-shadow:0 0 0 var(--_rs-radio-button-box-shadow-size) var(--_rs-radio-button-active-icon-hover-box-shadow-color);
|
|
146
151
|
}
|
|
147
|
-
.
|
|
152
|
+
._enabled_13lk1j5_79 ._input_13lk1j5_45:focus[data-focus-method='key'] + ._icon_13lk1j5_58{
|
|
148
153
|
box-shadow:0 0 0 1px rgb(calc(232 - var(--_rs-theme-dark-coefficient, 0)*184), calc(232 - var(--_rs-theme-dark-coefficient, 0)*184), calc(232 - var(--_rs-theme-dark-coefficient, 0)*181)), 0 0 0 var(--_rs-radio-button-box-shadow-size) var(--_rs-color-primary-t-dim);
|
|
149
154
|
}
|
|
150
155
|
|
|
151
|
-
|
|
156
|
+
@property --_rs-theme-dark-coefficient{
|
|
157
|
+
syntax:'<number>';
|
|
158
|
+
inherits:true;
|
|
159
|
+
initial-value:0;
|
|
160
|
+
}
|
|
161
|
+
._themeLight_6ey3py_6{
|
|
152
162
|
--rs-theme-dark:0;
|
|
153
163
|
}
|
|
154
|
-
.
|
|
164
|
+
._themeDark_6ey3py_9{
|
|
155
165
|
--rs-theme-dark:1;
|
|
156
166
|
}
|
|
157
|
-
.
|
|
167
|
+
._container_6ey3py_13{
|
|
158
168
|
--_rs-theme-dark:var(
|
|
159
169
|
--_rs-internal-force-theme-dark-consult-rescui-before-using,
|
|
160
170
|
var(--rs-theme-dark, 0)
|
|
@@ -164,7 +174,7 @@
|
|
|
164
174
|
--_rs-theme-light-coefficient:calc(1 - var(--_rs-theme-dark-coefficient));
|
|
165
175
|
}
|
|
166
176
|
@supports (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
167
|
-
.
|
|
177
|
+
._container_6ey3py_13{
|
|
168
178
|
--_rs-color-primary:color-mix(in srgb, var(--rs-color-primary-light-theme, #6B57FF) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-dark-theme, #8473FF) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
169
179
|
--_rs-color-primary-dim:color-mix(in srgb, var(--rs-color-primary-dim-light-theme, #8979ff) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-dim-dark-theme, #6f61d2) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
170
180
|
--_rs-color-primary-fog:color-mix(in srgb, var(--rs-color-primary-fog-light-theme, #e1ddff) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-fog-dark-theme, #2e2b49) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
@@ -173,7 +183,7 @@
|
|
|
173
183
|
}
|
|
174
184
|
}
|
|
175
185
|
@supports not (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
176
|
-
.
|
|
186
|
+
._container_6ey3py_13{
|
|
177
187
|
--_rs-color-primary:rgb(calc(var(--_rs-theme-light-coefficient, 1)*107 + var(--_rs-theme-dark-coefficient, 0)*132), calc(var(--_rs-theme-light-coefficient, 1)*87 + var(--_rs-theme-dark-coefficient, 0)*115), 255);
|
|
178
188
|
--_rs-color-primary-dim:rgb(calc(var(--_rs-theme-light-coefficient, 1)*137 + var(--_rs-theme-dark-coefficient, 0)*111), calc(var(--_rs-theme-light-coefficient, 1)*121 + var(--_rs-theme-dark-coefficient, 0)*97), calc(var(--_rs-theme-light-coefficient, 1)*255 + var(--_rs-theme-dark-coefficient, 0)*210));
|
|
179
189
|
--_rs-color-primary-fog:rgb(calc(var(--_rs-theme-light-coefficient, 1)*225 + var(--_rs-theme-dark-coefficient, 0)*46), calc(var(--_rs-theme-light-coefficient, 1)*221 + var(--_rs-theme-dark-coefficient, 0)*43), calc(var(--_rs-theme-light-coefficient, 1)*255 + var(--_rs-theme-dark-coefficient, 0)*73));
|
|
@@ -181,11 +191,11 @@
|
|
|
181
191
|
--_rs-color-primary-t-fog:rgba(calc(var(--_rs-theme-light-coefficient, 1)*107 + var(--_rs-theme-dark-coefficient, 0)*132), calc(var(--_rs-theme-light-coefficient, 1)*87 + var(--_rs-theme-dark-coefficient, 0)*115), 255, calc(var(--_rs-theme-light-coefficient, 1)*0.2 + var(--_rs-theme-dark-coefficient, 0)*0.3));
|
|
182
192
|
}
|
|
183
193
|
}
|
|
184
|
-
.
|
|
194
|
+
._sizeS_6ey3py_18{
|
|
185
195
|
--_rs-radio-button-list-label-offset:4px;
|
|
186
196
|
--_rs-radio-button-list-left-offset:28px;
|
|
187
197
|
}
|
|
188
|
-
.
|
|
198
|
+
._sizeS_6ey3py_18 [data-rs-internal='radio-button-list__label']{
|
|
189
199
|
--_rs-typography-letter-spacing:var(--rs-text-3-letter-spacing, 0.0045em);
|
|
190
200
|
--_rs-typography-text-transform:initial;
|
|
191
201
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -220,7 +230,7 @@
|
|
|
220
230
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
221
231
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
222
232
|
}
|
|
223
|
-
.
|
|
233
|
+
._sizeS_6ey3py_18 [data-rs-internal='radio-button-list__bold-label']{
|
|
224
234
|
--_rs-typography-letter-spacing:var(--rs-h5-letter-spacing, normal);
|
|
225
235
|
--_rs-typography-text-transform:initial;
|
|
226
236
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -252,11 +262,11 @@
|
|
|
252
262
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
253
263
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
254
264
|
}
|
|
255
|
-
.
|
|
265
|
+
._sizeM_6ey3py_21{
|
|
256
266
|
--_rs-radio-button-list-label-offset:8px;
|
|
257
267
|
--_rs-radio-button-list-left-offset:32px;
|
|
258
268
|
}
|
|
259
|
-
.
|
|
269
|
+
._sizeM_6ey3py_21 [data-rs-internal='radio-button-list__label']{
|
|
260
270
|
--_rs-typography-letter-spacing:var(--rs-text-2-letter-spacing, 0.0015em);
|
|
261
271
|
--_rs-typography-text-transform:initial;
|
|
262
272
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -295,11 +305,11 @@
|
|
|
295
305
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
296
306
|
}
|
|
297
307
|
@media screen and (max-width: 640px){
|
|
298
|
-
.
|
|
308
|
+
._sizeM_6ey3py_21 [data-rs-internal='radio-button-list__label']{
|
|
299
309
|
--_rs-typography-text-2-sm-list-li-margin-top-from-text:12px;
|
|
300
310
|
}
|
|
301
311
|
}
|
|
302
|
-
.
|
|
312
|
+
._sizeM_6ey3py_21 [data-rs-internal='radio-button-list__bold-label']{
|
|
303
313
|
--_rs-typography-letter-spacing:var(--rs-h4-letter-spacing, normal);
|
|
304
314
|
--_rs-typography-text-transform:initial;
|
|
305
315
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -331,11 +341,11 @@
|
|
|
331
341
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
332
342
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
333
343
|
}
|
|
334
|
-
.
|
|
344
|
+
._sizeL_6ey3py_24{
|
|
335
345
|
--_rs-radio-button-list-label-offset:12px;
|
|
336
346
|
--_rs-radio-button-list-left-offset:44px;
|
|
337
347
|
}
|
|
338
|
-
.
|
|
348
|
+
._sizeL_6ey3py_24 [data-rs-internal='radio-button-list__label']{
|
|
339
349
|
--_rs-typography-letter-spacing:var(--rs-text-1-letter-spacing, normal);
|
|
340
350
|
--_rs-typography-text-transform:initial;
|
|
341
351
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -374,11 +384,11 @@
|
|
|
374
384
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
375
385
|
}
|
|
376
386
|
@media screen and (max-width: 640px){
|
|
377
|
-
.
|
|
387
|
+
._sizeL_6ey3py_24 [data-rs-internal='radio-button-list__label']{
|
|
378
388
|
--_rs-typography-text-1-sm-list-li-margin-top-from-text:16px;
|
|
379
389
|
}
|
|
380
390
|
}
|
|
381
|
-
.
|
|
391
|
+
._sizeL_6ey3py_24 [data-rs-internal='radio-button-list__bold-label']{
|
|
382
392
|
--_rs-typography-letter-spacing:var(--rs-h3-letter-spacing, normal);
|
|
383
393
|
--_rs-typography-text-transform:initial;
|
|
384
394
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -410,10 +420,10 @@
|
|
|
410
420
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
411
421
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
412
422
|
}
|
|
413
|
-
.
|
|
423
|
+
._inner_6ey3py_28{
|
|
414
424
|
--rs-out-radio-button-list-left-offset:var(--_rs-radio-button-list-left-offset);
|
|
415
425
|
}
|
|
416
|
-
.
|
|
426
|
+
._label_6ey3py_32{
|
|
417
427
|
letter-spacing:var(
|
|
418
428
|
--rs-text-base-letter-spacing,
|
|
419
429
|
var(--_rs-typography-letter-spacing)
|
|
@@ -433,23 +443,23 @@
|
|
|
433
443
|
margin:0 0 var(--_rs-radio-button-list-label-offset) 0;
|
|
434
444
|
padding:0;
|
|
435
445
|
}
|
|
436
|
-
.
|
|
446
|
+
._disabled_6ey3py_39 ._label_6ey3py_32{
|
|
437
447
|
color:var(
|
|
438
448
|
--rs-color-pale,
|
|
439
449
|
rgba(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227), 0.5)
|
|
440
450
|
);
|
|
441
451
|
}
|
|
442
|
-
.
|
|
452
|
+
._footer_6ey3py_44{
|
|
443
453
|
display:flex;
|
|
444
454
|
flex-direction:column;
|
|
445
455
|
}
|
|
446
|
-
.
|
|
456
|
+
._errorMessage_6ey3py_49{
|
|
447
457
|
order:99;
|
|
448
458
|
}
|
|
449
|
-
.
|
|
459
|
+
._error_6ey3py_49 ._errorMessage_6ey3py_49{
|
|
450
460
|
order:0;
|
|
451
461
|
}
|
|
452
|
-
.
|
|
462
|
+
._note_6ey3py_58{
|
|
453
463
|
--_rs-typography-letter-spacing:var(--rs-text-3-letter-spacing, 0.0045em);
|
|
454
464
|
--_rs-typography-text-transform:initial;
|
|
455
465
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -509,7 +519,7 @@
|
|
|
509
519
|
|
|
510
520
|
order:1;
|
|
511
521
|
}
|
|
512
|
-
.
|
|
522
|
+
._disabled_6ey3py_39 ._note_6ey3py_58{
|
|
513
523
|
--_rs-typography-hardness-color:var(
|
|
514
524
|
--rs-color-pale,
|
|
515
525
|
rgba(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227), 0.5)
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
|
|
3
|
+
import { c } from 'react-compiler-runtime';
|
|
2
4
|
import React from 'react';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
4
6
|
import cn from 'classnames';
|
|
@@ -18,51 +20,95 @@ const MODE_STYLES = {
|
|
|
18
20
|
rock: styles.rock
|
|
19
21
|
};
|
|
20
22
|
const RadioButtonControl = /*#__PURE__*/React.forwardRef(function RadioButtonControl(props, ref) {
|
|
21
|
-
const
|
|
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
|
-
|
|
23
|
+
const $ = c(15);
|
|
24
|
+
let className;
|
|
25
|
+
let disabledFromProps;
|
|
26
|
+
let error;
|
|
27
|
+
let ownValue;
|
|
28
|
+
let restProps;
|
|
29
|
+
let t0;
|
|
30
|
+
|
|
31
|
+
if ($[0] !== props) {
|
|
32
|
+
const {
|
|
33
|
+
children,
|
|
34
|
+
disabled: t1,
|
|
35
|
+
onChange,
|
|
36
|
+
checked,
|
|
37
|
+
value: t2,
|
|
38
|
+
className: t3,
|
|
39
|
+
error: t4,
|
|
40
|
+
notUseLabelTag: t5,
|
|
41
|
+
...t6
|
|
42
|
+
} = props;
|
|
43
|
+
disabledFromProps = t1;
|
|
44
|
+
ownValue = t2;
|
|
45
|
+
className = t3;
|
|
46
|
+
error = t4;
|
|
47
|
+
t0 = t5;
|
|
48
|
+
restProps = t6;
|
|
49
|
+
$[0] = props;
|
|
50
|
+
$[1] = className;
|
|
51
|
+
$[2] = disabledFromProps;
|
|
52
|
+
$[3] = error;
|
|
53
|
+
$[4] = ownValue;
|
|
54
|
+
$[5] = restProps;
|
|
55
|
+
$[6] = t0;
|
|
56
|
+
} else {
|
|
57
|
+
className = $[1];
|
|
58
|
+
disabledFromProps = $[2];
|
|
59
|
+
error = $[3];
|
|
60
|
+
ownValue = $[4];
|
|
61
|
+
restProps = $[5];
|
|
62
|
+
t0 = $[6];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const notUseLabelTag = t0 === undefined ? false : t0;
|
|
66
|
+
const RootTag = notUseLabelTag ? "span" : "label";
|
|
67
|
+
let t1;
|
|
68
|
+
|
|
69
|
+
if ($[7] !== RootTag || $[8] !== className || $[9] !== disabledFromProps || $[10] !== error || $[11] !== ownValue || $[12] !== ref || $[13] !== restProps) {
|
|
70
|
+
t1 = /*#__PURE__*/React.createElement(RadioContext.Consumer, null, t2 => {
|
|
71
|
+
const {
|
|
72
|
+
value: groupValue,
|
|
73
|
+
theme,
|
|
74
|
+
setValue,
|
|
75
|
+
name,
|
|
76
|
+
error: errorFromContext,
|
|
77
|
+
size,
|
|
78
|
+
mode,
|
|
79
|
+
disabled
|
|
80
|
+
} = t2;
|
|
81
|
+
return /*#__PURE__*/React.createElement(RootTag, {
|
|
82
|
+
className: cn(styles.main, THEME_STYLES[theme], SIZE_STYLES[size], MODE_STYLES[mode], (error || errorFromContext) && styles.error, disabled || disabledFromProps ? styles.disabled : styles.enabled, className),
|
|
83
|
+
"data-test": "radio-button-control-root",
|
|
84
|
+
"data-rs-internal": "radio-button__control"
|
|
85
|
+
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
86
|
+
className: styles.input,
|
|
87
|
+
type: "radio",
|
|
88
|
+
onChange: () => setValue(ownValue),
|
|
89
|
+
disabled: disabled || disabledFromProps,
|
|
90
|
+
value: ownValue,
|
|
91
|
+
name: name,
|
|
92
|
+
checked: groupValue === ownValue,
|
|
93
|
+
ref: ref,
|
|
94
|
+
"data-test": "radio-button-control"
|
|
95
|
+
}, restProps)), /*#__PURE__*/React.createElement("span", {
|
|
96
|
+
className: cn(styles.icon, (error || errorFromContext) && styles.iconError)
|
|
97
|
+
}));
|
|
98
|
+
});
|
|
99
|
+
$[7] = RootTag;
|
|
100
|
+
$[8] = className;
|
|
101
|
+
$[9] = disabledFromProps;
|
|
102
|
+
$[10] = error;
|
|
103
|
+
$[11] = ownValue;
|
|
104
|
+
$[12] = ref;
|
|
105
|
+
$[13] = restProps;
|
|
106
|
+
$[14] = t1;
|
|
107
|
+
} else {
|
|
108
|
+
t1 = $[14];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return t1;
|
|
66
112
|
});
|
|
67
113
|
RadioButtonControl.propTypes = {
|
|
68
114
|
disabled: PropTypes.bool,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
|
|
3
|
+
import { c } from 'react-compiler-runtime';
|
|
2
4
|
import React from 'react';
|
|
3
5
|
import cn from 'classnames';
|
|
4
6
|
import PropTypes from 'prop-types';
|
|
@@ -6,7 +8,7 @@ import { Menu } from '@rescui/menu';
|
|
|
6
8
|
import { useThemeWithUndefined } from '@rescui/ui-contexts';
|
|
7
9
|
import { ErrorMessage, shouldRenderErrorMessage } from '@rescui/form-field';
|
|
8
10
|
import { RadioButtonManager } from './radio-button-manager.js';
|
|
9
|
-
import {
|
|
11
|
+
import { useSafeId } from './use-safe-id.js';
|
|
10
12
|
import styles from './radio-button-list.p.module.css.js';
|
|
11
13
|
const THEME_STYLES = {
|
|
12
14
|
light: styles.themeLight,
|
|
@@ -18,65 +20,219 @@ const SIZE_STYLES = {
|
|
|
18
20
|
l: styles.sizeL
|
|
19
21
|
}; // eslint-disable-next-line complexity
|
|
20
22
|
|
|
21
|
-
const RadioButtonList =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
const RadioButtonList = t0 => {
|
|
24
|
+
const $ = c(55);
|
|
25
|
+
let children;
|
|
26
|
+
let className;
|
|
27
|
+
let disabled;
|
|
28
|
+
let error;
|
|
29
|
+
let id;
|
|
30
|
+
let label;
|
|
31
|
+
let note;
|
|
32
|
+
let restProps;
|
|
33
|
+
let style;
|
|
34
|
+
let t1;
|
|
35
|
+
let t2;
|
|
36
|
+
let t3;
|
|
37
|
+
let t4;
|
|
38
|
+
let themeFromProps;
|
|
39
|
+
|
|
40
|
+
if ($[0] !== t0) {
|
|
41
|
+
({
|
|
42
|
+
children,
|
|
43
|
+
mode: t1,
|
|
44
|
+
disabled,
|
|
45
|
+
size: t2,
|
|
46
|
+
theme: themeFromProps,
|
|
47
|
+
label,
|
|
48
|
+
note,
|
|
49
|
+
error,
|
|
50
|
+
reserveErrorLine: t3,
|
|
51
|
+
className,
|
|
52
|
+
id,
|
|
53
|
+
style,
|
|
54
|
+
boldLabel: t4,
|
|
55
|
+
...restProps
|
|
56
|
+
} = t0);
|
|
57
|
+
$[0] = t0;
|
|
58
|
+
$[1] = children;
|
|
59
|
+
$[2] = className;
|
|
60
|
+
$[3] = disabled;
|
|
61
|
+
$[4] = error;
|
|
62
|
+
$[5] = id;
|
|
63
|
+
$[6] = label;
|
|
64
|
+
$[7] = note;
|
|
65
|
+
$[8] = restProps;
|
|
66
|
+
$[9] = style;
|
|
67
|
+
$[10] = t1;
|
|
68
|
+
$[11] = t2;
|
|
69
|
+
$[12] = t3;
|
|
70
|
+
$[13] = t4;
|
|
71
|
+
$[14] = themeFromProps;
|
|
72
|
+
} else {
|
|
73
|
+
children = $[1];
|
|
74
|
+
className = $[2];
|
|
75
|
+
disabled = $[3];
|
|
76
|
+
error = $[4];
|
|
77
|
+
id = $[5];
|
|
78
|
+
label = $[6];
|
|
79
|
+
note = $[7];
|
|
80
|
+
restProps = $[8];
|
|
81
|
+
style = $[9];
|
|
82
|
+
t1 = $[10];
|
|
83
|
+
t2 = $[11];
|
|
84
|
+
t3 = $[12];
|
|
85
|
+
t4 = $[13];
|
|
86
|
+
themeFromProps = $[14];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const mode = t1 === undefined ? "classic" : t1;
|
|
90
|
+
const size = t2 === undefined ? "m" : t2;
|
|
91
|
+
const reserveErrorLine = t3 === undefined ? false : t3;
|
|
92
|
+
const boldLabel = t4 === undefined ? true : t4;
|
|
38
93
|
const theme = useThemeWithUndefined(themeFromProps);
|
|
39
|
-
const uniqueId = `radio-button-list-${
|
|
94
|
+
const uniqueId = `radio-button-list-${useSafeId()}`;
|
|
40
95
|
const errorId = `${id ? id : uniqueId}-error`;
|
|
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
|
-
|
|
96
|
+
let t5;
|
|
97
|
+
|
|
98
|
+
if ($[15] !== error || $[16] !== note || $[17] !== reserveErrorLine) {
|
|
99
|
+
t5 = Boolean(note) || shouldRenderErrorMessage(error, reserveErrorLine);
|
|
100
|
+
$[15] = error;
|
|
101
|
+
$[16] = note;
|
|
102
|
+
$[17] = reserveErrorLine;
|
|
103
|
+
$[18] = t5;
|
|
104
|
+
} else {
|
|
105
|
+
t5 = $[18];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const hasFooter = t5;
|
|
109
|
+
const t6 = THEME_STYLES[theme];
|
|
110
|
+
const t7 = SIZE_STYLES[size];
|
|
111
|
+
const t8 = disabled && styles.disabled;
|
|
112
|
+
const t9 = Boolean(error) && styles.error;
|
|
113
|
+
let t10;
|
|
114
|
+
|
|
115
|
+
if ($[19] !== className || $[20] !== t6 || $[21] !== t7 || $[22] !== t8 || $[23] !== t9) {
|
|
116
|
+
t10 = cn(className, styles.container, t6, t7, t8, t9);
|
|
117
|
+
$[19] = className;
|
|
118
|
+
$[20] = t6;
|
|
119
|
+
$[21] = t7;
|
|
120
|
+
$[22] = t8;
|
|
121
|
+
$[23] = t9;
|
|
122
|
+
$[24] = t10;
|
|
123
|
+
} else {
|
|
124
|
+
t10 = $[24];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const t11 = error ? errorId : undefined;
|
|
128
|
+
const t12 = Boolean(error);
|
|
129
|
+
let t13;
|
|
130
|
+
|
|
131
|
+
if ($[25] !== boldLabel || $[26] !== label) {
|
|
132
|
+
t13 = label && /*#__PURE__*/React.createElement("legend", {
|
|
133
|
+
className: styles.label,
|
|
134
|
+
"data-test": "radio-button-list__label",
|
|
135
|
+
"data-rs-internal": boldLabel ? "radio-button-list__bold-label" : "radio-button-list__label"
|
|
136
|
+
}, label);
|
|
137
|
+
$[25] = boldLabel;
|
|
138
|
+
$[26] = label;
|
|
139
|
+
$[27] = t13;
|
|
140
|
+
} else {
|
|
141
|
+
t13 = $[27];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
let t14;
|
|
145
|
+
|
|
146
|
+
if ($[28] !== children || $[29] !== disabled || $[30] !== size || $[31] !== theme) {
|
|
147
|
+
t14 = /*#__PURE__*/React.createElement(Menu, {
|
|
148
|
+
disabled: disabled,
|
|
149
|
+
theme: theme,
|
|
150
|
+
size: size,
|
|
151
|
+
tag: "div",
|
|
152
|
+
itemTag: null,
|
|
153
|
+
mode: "clear",
|
|
154
|
+
className: styles.inner,
|
|
155
|
+
"data-rs-internal": "radio-button-list__menu"
|
|
156
|
+
}, children);
|
|
157
|
+
$[28] = children;
|
|
158
|
+
$[29] = disabled;
|
|
159
|
+
$[30] = size;
|
|
160
|
+
$[31] = theme;
|
|
161
|
+
$[32] = t14;
|
|
162
|
+
} else {
|
|
163
|
+
t14 = $[32];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
let t15;
|
|
167
|
+
|
|
168
|
+
if ($[33] !== error || $[34] !== errorId || $[35] !== hasFooter || $[36] !== note || $[37] !== reserveErrorLine) {
|
|
169
|
+
t15 = hasFooter && /*#__PURE__*/React.createElement("div", {
|
|
170
|
+
className: styles.footer
|
|
171
|
+
}, /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
172
|
+
id: errorId,
|
|
173
|
+
className: styles.errorMessage,
|
|
174
|
+
"data-test": "radio-button-list__error",
|
|
175
|
+
reserveLine: reserveErrorLine
|
|
176
|
+
}, error), note && /*#__PURE__*/React.createElement("div", {
|
|
177
|
+
className: styles.note,
|
|
178
|
+
"data-test": "radio-button-list__note",
|
|
179
|
+
"data-rs-internal": "radio-button-list__note"
|
|
180
|
+
}, note));
|
|
181
|
+
$[33] = error;
|
|
182
|
+
$[34] = errorId;
|
|
183
|
+
$[35] = hasFooter;
|
|
184
|
+
$[36] = note;
|
|
185
|
+
$[37] = reserveErrorLine;
|
|
186
|
+
$[38] = t15;
|
|
187
|
+
} else {
|
|
188
|
+
t15 = $[38];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
let t16;
|
|
192
|
+
|
|
193
|
+
if ($[39] !== id || $[40] !== style || $[41] !== t10 || $[42] !== t11 || $[43] !== t12 || $[44] !== t13 || $[45] !== t14 || $[46] !== t15) {
|
|
194
|
+
t16 = /*#__PURE__*/React.createElement("fieldset", {
|
|
195
|
+
className: t10,
|
|
196
|
+
id: id,
|
|
197
|
+
style: style,
|
|
198
|
+
"aria-errormessage": t11,
|
|
199
|
+
"aria-invalid": t12,
|
|
200
|
+
"data-test": "radio-button-list"
|
|
201
|
+
}, t13, t14, t15);
|
|
202
|
+
$[39] = id;
|
|
203
|
+
$[40] = style;
|
|
204
|
+
$[41] = t10;
|
|
205
|
+
$[42] = t11;
|
|
206
|
+
$[43] = t12;
|
|
207
|
+
$[44] = t13;
|
|
208
|
+
$[45] = t14;
|
|
209
|
+
$[46] = t15;
|
|
210
|
+
$[47] = t16;
|
|
211
|
+
} else {
|
|
212
|
+
t16 = $[47];
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
let t17;
|
|
216
|
+
|
|
217
|
+
if ($[48] !== disabled || $[49] !== mode || $[50] !== restProps || $[51] !== size || $[52] !== t16 || $[53] !== theme) {
|
|
218
|
+
t17 = /*#__PURE__*/React.createElement(RadioButtonManager, _extends({
|
|
219
|
+
disabled: disabled,
|
|
220
|
+
size: size,
|
|
221
|
+
mode: mode,
|
|
222
|
+
theme: theme
|
|
223
|
+
}, restProps), t16);
|
|
224
|
+
$[48] = disabled;
|
|
225
|
+
$[49] = mode;
|
|
226
|
+
$[50] = restProps;
|
|
227
|
+
$[51] = size;
|
|
228
|
+
$[52] = t16;
|
|
229
|
+
$[53] = theme;
|
|
230
|
+
$[54] = t17;
|
|
231
|
+
} else {
|
|
232
|
+
t17 = $[54];
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return t17;
|
|
80
236
|
};
|
|
81
237
|
|
|
82
238
|
RadioButtonList.propTypes = { ...RadioButtonManager.propTypes,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
var styles = {
|
|
2
|
-
"themeLight": "
|
|
3
|
-
"themeDark": "
|
|
4
|
-
"container": "
|
|
5
|
-
"sizeS": "
|
|
6
|
-
"sizeM": "
|
|
7
|
-
"sizeL": "
|
|
8
|
-
"inner": "
|
|
9
|
-
"label": "
|
|
10
|
-
"disabled": "
|
|
11
|
-
"footer": "
|
|
12
|
-
"errorMessage": "
|
|
13
|
-
"error": "
|
|
14
|
-
"note": "
|
|
2
|
+
"themeLight": "_themeLight_6ey3py_6",
|
|
3
|
+
"themeDark": "_themeDark_6ey3py_9",
|
|
4
|
+
"container": "_container_6ey3py_13",
|
|
5
|
+
"sizeS": "_sizeS_6ey3py_18",
|
|
6
|
+
"sizeM": "_sizeM_6ey3py_21",
|
|
7
|
+
"sizeL": "_sizeL_6ey3py_24",
|
|
8
|
+
"inner": "_inner_6ey3py_28",
|
|
9
|
+
"label": "_label_6ey3py_32",
|
|
10
|
+
"disabled": "_disabled_6ey3py_39",
|
|
11
|
+
"footer": "_footer_6ey3py_44",
|
|
12
|
+
"errorMessage": "_errorMessage_6ey3py_49",
|
|
13
|
+
"error": "_error_6ey3py_49",
|
|
14
|
+
"note": "_note_6ey3py_58"
|
|
15
15
|
};
|
|
16
16
|
export { styles as default };
|
|
@@ -1,48 +1,57 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import { c } from 'react-compiler-runtime';
|
|
3
|
+
import React, { useState } from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
5
|
import { useThemeWithUndefined } from '@rescui/ui-contexts';
|
|
5
6
|
import RadioContext from './radio-group-context.js';
|
|
7
|
+
import { useSafeId } from './use-safe-id.js';
|
|
6
8
|
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
if (id.current === null) {
|
|
11
|
-
id.current = useBackwardCompatibleId.counter++;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return (React.useId ? React.useId : () => id.current)();
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
useBackwardCompatibleId.counter = 0;
|
|
18
|
-
|
|
19
|
-
const RadioButtonManager = _ref => {
|
|
20
|
-
let {
|
|
9
|
+
const RadioButtonManager = t0 => {
|
|
10
|
+
const $ = c(14);
|
|
11
|
+
const {
|
|
21
12
|
defaultValue,
|
|
22
13
|
children,
|
|
23
14
|
value: valueFromProps,
|
|
24
|
-
disabled
|
|
25
|
-
error
|
|
15
|
+
disabled: t1,
|
|
16
|
+
error: t2,
|
|
26
17
|
name: nameFromProps,
|
|
27
18
|
onChange,
|
|
28
|
-
size
|
|
29
|
-
mode
|
|
19
|
+
size: t3,
|
|
20
|
+
mode: t4,
|
|
30
21
|
theme: themeFromProps
|
|
31
|
-
} =
|
|
22
|
+
} = t0;
|
|
23
|
+
const disabled = t1 === undefined ? false : t1;
|
|
24
|
+
const error = t2 === undefined ? false : t2;
|
|
25
|
+
const size = t3 === undefined ? "m" : t3;
|
|
26
|
+
const mode = t4 === undefined ? "classic" : t4;
|
|
32
27
|
const theme = useThemeWithUndefined(themeFromProps);
|
|
33
|
-
const isControlled = typeof valueFromProps !==
|
|
28
|
+
const isControlled = typeof valueFromProps !== "undefined";
|
|
34
29
|
const [value, setValue] = useState(isControlled ? valueFromProps : defaultValue);
|
|
35
|
-
const currentId =
|
|
30
|
+
const currentId = useSafeId();
|
|
36
31
|
const name = nameFromProps ?? `_placeholder-radio-name-${currentId}`;
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
let t5;
|
|
33
|
+
|
|
34
|
+
if ($[0] !== onChange) {
|
|
35
|
+
t5 = val => {
|
|
36
|
+
setValue(val);
|
|
37
|
+
|
|
38
|
+
if (onChange) {
|
|
39
|
+
onChange(val);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
39
42
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
$[0] = onChange;
|
|
44
|
+
$[1] = t5;
|
|
45
|
+
} else {
|
|
46
|
+
t5 = $[1];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const handleSetValue = t5;
|
|
50
|
+
const t6 = isControlled ? valueFromProps : value;
|
|
51
|
+
let t7;
|
|
52
|
+
|
|
53
|
+
if ($[2] !== disabled || $[3] !== error || $[4] !== handleSetValue || $[5] !== mode || $[6] !== name || $[7] !== size || $[8] !== t6 || $[9] !== theme) {
|
|
54
|
+
t7 = {
|
|
46
55
|
error,
|
|
47
56
|
theme,
|
|
48
57
|
size,
|
|
@@ -50,9 +59,35 @@ const RadioButtonManager = _ref => {
|
|
|
50
59
|
disabled,
|
|
51
60
|
name,
|
|
52
61
|
setValue: handleSetValue,
|
|
53
|
-
value:
|
|
54
|
-
}
|
|
55
|
-
|
|
62
|
+
value: t6
|
|
63
|
+
};
|
|
64
|
+
$[2] = disabled;
|
|
65
|
+
$[3] = error;
|
|
66
|
+
$[4] = handleSetValue;
|
|
67
|
+
$[5] = mode;
|
|
68
|
+
$[6] = name;
|
|
69
|
+
$[7] = size;
|
|
70
|
+
$[8] = t6;
|
|
71
|
+
$[9] = theme;
|
|
72
|
+
$[10] = t7;
|
|
73
|
+
} else {
|
|
74
|
+
t7 = $[10];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
let t8;
|
|
78
|
+
|
|
79
|
+
if ($[11] !== children || $[12] !== t7) {
|
|
80
|
+
t8 = /*#__PURE__*/React.createElement(RadioContext.Provider, {
|
|
81
|
+
value: t7
|
|
82
|
+
}, children);
|
|
83
|
+
$[11] = children;
|
|
84
|
+
$[12] = t7;
|
|
85
|
+
$[13] = t8;
|
|
86
|
+
} else {
|
|
87
|
+
t8 = $[13];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return t8;
|
|
56
91
|
};
|
|
57
92
|
|
|
58
93
|
RadioButtonManager.propTypes = {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
var styles = {
|
|
2
|
-
"themeLight": "
|
|
3
|
-
"themeDark": "
|
|
4
|
-
"sizeS": "
|
|
5
|
-
"sizeM": "
|
|
6
|
-
"sizeL": "
|
|
7
|
-
"classic": "
|
|
8
|
-
"rock": "
|
|
9
|
-
"main": "
|
|
10
|
-
"input": "
|
|
11
|
-
"icon": "
|
|
12
|
-
"enabled": "
|
|
13
|
-
"disabled": "
|
|
14
|
-
"error": "
|
|
2
|
+
"themeLight": "_themeLight_13lk1j5_8",
|
|
3
|
+
"themeDark": "_themeDark_13lk1j5_11",
|
|
4
|
+
"sizeS": "_sizeS_13lk1j5_15",
|
|
5
|
+
"sizeM": "_sizeM_13lk1j5_18",
|
|
6
|
+
"sizeL": "_sizeL_13lk1j5_21",
|
|
7
|
+
"classic": "_classic_13lk1j5_25",
|
|
8
|
+
"rock": "_rock_13lk1j5_28",
|
|
9
|
+
"main": "_main_13lk1j5_32",
|
|
10
|
+
"input": "_input_13lk1j5_45",
|
|
11
|
+
"icon": "_icon_13lk1j5_58",
|
|
12
|
+
"enabled": "_enabled_13lk1j5_79",
|
|
13
|
+
"disabled": "_disabled_13lk1j5_88",
|
|
14
|
+
"error": "_error_13lk1j5_112"
|
|
15
15
|
};
|
|
16
16
|
export { styles as default };
|
package/lib/public-api.p.css
CHANGED
package/lib/public-api.pcss
CHANGED
package/lib/radio-button.js
CHANGED
|
@@ -1,26 +1,71 @@
|
|
|
1
|
+
import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
|
|
2
|
+
import { c } from 'react-compiler-runtime';
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import PropTypes from 'prop-types';
|
|
3
5
|
import { MenuItem } from '@rescui/menu';
|
|
4
6
|
import { RadioButtonControl } from './parts/radio-button-control.js';
|
|
5
|
-
const RadioButton = /*#__PURE__*/React.forwardRef(function RadioButton(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
const RadioButton = /*#__PURE__*/React.forwardRef(function RadioButton(t0, ref) {
|
|
8
|
+
const $ = c(14);
|
|
9
|
+
let children;
|
|
10
|
+
let className;
|
|
11
|
+
let disabled;
|
|
12
|
+
let restProps;
|
|
13
|
+
|
|
14
|
+
if ($[0] !== t0) {
|
|
15
|
+
({
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
disabled,
|
|
19
|
+
...restProps
|
|
20
|
+
} = t0);
|
|
21
|
+
$[0] = t0;
|
|
22
|
+
$[1] = children;
|
|
23
|
+
$[2] = className;
|
|
24
|
+
$[3] = disabled;
|
|
25
|
+
$[4] = restProps;
|
|
26
|
+
} else {
|
|
27
|
+
children = $[1];
|
|
28
|
+
className = $[2];
|
|
29
|
+
disabled = $[3];
|
|
30
|
+
restProps = $[4];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let t1;
|
|
34
|
+
|
|
35
|
+
if ($[5] !== disabled || $[6] !== ref || $[7] !== restProps) {
|
|
36
|
+
t1 = /*#__PURE__*/React.createElement(RadioButtonControl, _extends({
|
|
18
37
|
ref: ref,
|
|
19
38
|
disabled: disabled,
|
|
20
|
-
notUseLabelTag: true
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
39
|
+
notUseLabelTag: true
|
|
40
|
+
}, restProps));
|
|
41
|
+
$[5] = disabled;
|
|
42
|
+
$[6] = ref;
|
|
43
|
+
$[7] = restProps;
|
|
44
|
+
$[8] = t1;
|
|
45
|
+
} else {
|
|
46
|
+
t1 = $[8];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
let t2;
|
|
50
|
+
|
|
51
|
+
if ($[9] !== children || $[10] !== className || $[11] !== disabled || $[12] !== t1) {
|
|
52
|
+
t2 = /*#__PURE__*/React.createElement(MenuItem, {
|
|
53
|
+
tag: "label",
|
|
54
|
+
disabled: disabled,
|
|
55
|
+
className: className,
|
|
56
|
+
tabIndex: null,
|
|
57
|
+
icon: t1
|
|
58
|
+
}, children);
|
|
59
|
+
$[9] = children;
|
|
60
|
+
$[10] = className;
|
|
61
|
+
$[11] = disabled;
|
|
62
|
+
$[12] = t1;
|
|
63
|
+
$[13] = t2;
|
|
64
|
+
} else {
|
|
65
|
+
t2 = $[13];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return t2;
|
|
24
69
|
});
|
|
25
70
|
RadioButton.propTypes = { ...RadioButtonControl.propTypes,
|
|
26
71
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rescui/radio-button",
|
|
3
|
-
"version": "0.10.6-RUI-297-Add-react-compiler-to-the-packages-build-
|
|
3
|
+
"version": "0.10.6-RUI-297-Add-react-compiler-to-the-packages-build-8aaaed4be.43+8aaaed4be",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "JetBrains",
|
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/runtime-corejs3": "^7.26.0",
|
|
20
|
-
"@rescui/form-field": "0.1.6-RUI-297-Add-react-compiler-to-the-packages-build-
|
|
21
|
-
"@rescui/menu": "0.13.8-RUI-297-Add-react-compiler-to-the-packages-build-
|
|
22
|
-
"classnames": "^2.2.6"
|
|
20
|
+
"@rescui/form-field": "0.1.6-RUI-297-Add-react-compiler-to-the-packages-build-8aaaed4be.43+8aaaed4be",
|
|
21
|
+
"@rescui/menu": "0.13.8-RUI-297-Add-react-compiler-to-the-packages-build-8aaaed4be.43+8aaaed4be",
|
|
22
|
+
"classnames": "^2.2.6",
|
|
23
|
+
"react-compiler-runtime": "^1.0.0"
|
|
23
24
|
},
|
|
24
25
|
"peerDependencies": {
|
|
25
26
|
"@rescui/ui-contexts": "^0.6.0",
|
|
@@ -27,14 +28,14 @@
|
|
|
27
28
|
"react": ">=17.0.0 <20"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
|
-
"@rescui/colors": "0.3.3-RUI-297-Add-react-compiler-to-the-packages-build-
|
|
31
|
+
"@rescui/colors": "0.3.3-RUI-297-Add-react-compiler-to-the-packages-build-8aaaed4be.43+8aaaed4be",
|
|
31
32
|
"@rescui/scripts": "0.5.2",
|
|
32
|
-
"@rescui/typography": "0.27.3-RUI-297-Add-react-compiler-to-the-packages-build-
|
|
33
|
+
"@rescui/typography": "0.27.3-RUI-297-Add-react-compiler-to-the-packages-build-8aaaed4be.43+8aaaed4be"
|
|
33
34
|
},
|
|
34
35
|
"scripts": {
|
|
35
36
|
"build": "rescui-scripts build && yarn run build-pcss-api",
|
|
36
37
|
"build-pcss-api": "rescui-scripts build-pcss-api --file public-api.p.css"
|
|
37
38
|
},
|
|
38
39
|
"nx": {},
|
|
39
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "8aaaed4bee650c002b7f195438380b70c31cc5a4"
|
|
40
41
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React, { useRef } from 'react';
|
|
2
|
-
|
|
3
|
-
const useBackwardCompatibleId = () => {
|
|
4
|
-
const id = useRef(null);
|
|
5
|
-
|
|
6
|
-
if (id.current === null) {
|
|
7
|
-
id.current = useBackwardCompatibleId.counter++;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
return (React.useId ? React.useId : () => id.current)();
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
useBackwardCompatibleId.counter = 0;
|
|
14
|
-
export { useBackwardCompatibleId };
|