@alfalab/core-components-radio-group 2.4.1 → 2.6.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/CHANGELOG.md +36 -25
- package/dist/Component.d.ts +1 -1
- package/dist/Component.js +3 -3
- package/dist/cssm/Component.d.ts +1 -1
- package/dist/cssm/Component.js +2 -2
- package/dist/esm/Component.d.ts +1 -1
- package/dist/esm/Component.js +3 -3
- package/dist/esm/index.css +17 -17
- package/dist/index.css +17 -17
- package/dist/modern/Component.d.ts +1 -1
- package/dist/modern/Component.js +3 -3
- package/dist/modern/index.css +17 -17
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,57 +3,68 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# [2.
|
|
6
|
+
# [2.6.0](https://github.com/core-ds/core-components/compare/@alfalab/core-components-radio-group@2.5.0...@alfalab/core-components-radio-group@2.6.0) (2022-06-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* circumflexus retrieval ([#57](https://github.com/core-ds/core-components/issues/57)) ([3820da8](https://github.com/core-ds/core-components/commit/3820da818bcdcbee6904c648b3e29c3c828fe202))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [2.4.0](https://github.com/core-ds/core-components/compare/@alfalab/core-components-radio-group@2.3.0...@alfalab/core-components-radio-group@2.4.0) (2022-03-22)
|
|
7
18
|
|
|
8
19
|
|
|
9
20
|
### Bug Fixes
|
|
10
21
|
|
|
11
|
-
* **radio-group:** add missing 'value' attribute to 'input' tag ([#1033](https://github.com/
|
|
22
|
+
* **radio-group:** add missing 'value' attribute to 'input' tag ([#1033](https://github.com/core-ds/core-components/issues/1033)) ([0f9cf0e](https://github.com/core-ds/core-components/commit/0f9cf0ecd74f4764ccd0b2839ba0cdf1b96e75cb)), closes [#1031](https://github.com/core-ds/core-components/issues/1031)
|
|
12
23
|
|
|
13
24
|
|
|
14
25
|
### Features
|
|
15
26
|
|
|
16
|
-
* Исправить импорты в сторях. ([#998](https://github.com/
|
|
27
|
+
* Исправить импорты в сторях. ([#998](https://github.com/core-ds/core-components/issues/998)) ([e6a654a](https://github.com/core-ds/core-components/commit/e6a654a0599451c7d149484cb61d8067eed083b7))
|
|
17
28
|
|
|
18
29
|
|
|
19
30
|
|
|
20
31
|
|
|
21
32
|
|
|
22
|
-
# [2.3.0](https://github.com/
|
|
33
|
+
# [2.3.0](https://github.com/core-ds/core-components/compare/@alfalab/core-components-radio-group@2.2.0...@alfalab/core-components-radio-group@2.3.0) (2021-10-11)
|
|
23
34
|
|
|
24
35
|
|
|
25
36
|
### Features
|
|
26
37
|
|
|
27
|
-
* проставлен role=alert для ошибок ([#850](https://github.com/
|
|
38
|
+
* проставлен role=alert для ошибок ([#850](https://github.com/core-ds/core-components/issues/850)) ([dc634a3](https://github.com/core-ds/core-components/commit/dc634a3d008accfab10192ce234c12ef0ecc7fa9))
|
|
28
39
|
|
|
29
40
|
|
|
30
41
|
|
|
31
42
|
|
|
32
43
|
|
|
33
|
-
# [2.2.0](https://github.com/
|
|
44
|
+
# [2.2.0](https://github.com/core-ds/core-components/compare/@alfalab/core-components-radio-group@2.1.0...@alfalab/core-components-radio-group@2.2.0) (2021-09-14)
|
|
34
45
|
|
|
35
46
|
|
|
36
47
|
### Features
|
|
37
48
|
|
|
38
|
-
* change error type to ReactNode ([#825](https://github.com/
|
|
39
|
-
* **tag:** add inverted colors ([#784](https://github.com/
|
|
49
|
+
* change error type to ReactNode ([#825](https://github.com/core-ds/core-components/issues/825)) ([c6d95c1](https://github.com/core-ds/core-components/commit/c6d95c1c6239f2b2a3bf2c1639554d8500e794f3))
|
|
50
|
+
* **tag:** add inverted colors ([#784](https://github.com/core-ds/core-components/issues/784)) ([d3681ae](https://github.com/core-ds/core-components/commit/d3681aeefe02e5f481d066013911a1877a165bb2))
|
|
40
51
|
|
|
41
52
|
|
|
42
53
|
|
|
43
54
|
|
|
44
55
|
|
|
45
|
-
# [2.1.0](https://github.com/
|
|
56
|
+
# [2.1.0](https://github.com/core-ds/core-components/compare/@alfalab/core-components-radio-group@2.0.1...@alfalab/core-components-radio-group@2.1.0) (2021-07-23)
|
|
46
57
|
|
|
47
58
|
|
|
48
59
|
### Features
|
|
49
60
|
|
|
50
|
-
* checkbox/radio/switch design updates (PDS-252) ([#735](https://github.com/
|
|
61
|
+
* checkbox/radio/switch design updates (PDS-252) ([#735](https://github.com/core-ds/core-components/issues/735)) ([62f3c63](https://github.com/core-ds/core-components/commit/62f3c63279872a80ffb1c018b08addf897597b26))
|
|
51
62
|
|
|
52
63
|
|
|
53
64
|
|
|
54
65
|
|
|
55
66
|
|
|
56
|
-
## [2.0.1](https://github.com/
|
|
67
|
+
## [2.0.1](https://github.com/core-ds/core-components/compare/@alfalab/core-components-radio-group@2.0.0...@alfalab/core-components-radio-group@2.0.1) (2021-07-09)
|
|
57
68
|
|
|
58
69
|
**Note:** Version bump only for package @alfalab/core-components-radio-group
|
|
59
70
|
|
|
@@ -61,14 +72,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
61
72
|
|
|
62
73
|
|
|
63
74
|
|
|
64
|
-
# [2.0.0](https://github.com/
|
|
75
|
+
# [2.0.0](https://github.com/core-ds/core-components/compare/@alfalab/core-components-radio-group@1.1.11...@alfalab/core-components-radio-group@2.0.0) (2021-07-08)
|
|
65
76
|
|
|
66
77
|
|
|
67
78
|
### Features
|
|
68
79
|
|
|
69
|
-
* upgrade storybook ([#696](https://github.com/
|
|
80
|
+
* upgrade storybook ([#696](https://github.com/core-ds/core-components/issues/696))
|
|
70
81
|
|
|
71
|
-
## [1.1.11](https://github.com/
|
|
82
|
+
## [1.1.11](https://github.com/core-ds/core-components/compare/@alfalab/core-components-radio-group@1.1.10...@alfalab/core-components-radio-group@1.1.11) (2021-04-26)
|
|
72
83
|
|
|
73
84
|
**Note:** Version bump only for package @alfalab/core-components-radio-group
|
|
74
85
|
|
|
@@ -76,7 +87,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
76
87
|
|
|
77
88
|
|
|
78
89
|
|
|
79
|
-
## [1.1.10](https://github.com/
|
|
90
|
+
## [1.1.10](https://github.com/core-ds/core-components/compare/@alfalab/core-components-radio-group@1.1.9...@alfalab/core-components-radio-group@1.1.10) (2021-04-01)
|
|
80
91
|
|
|
81
92
|
**Note:** Version bump only for package @alfalab/core-components-radio-group
|
|
82
93
|
|
|
@@ -84,29 +95,29 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
84
95
|
|
|
85
96
|
|
|
86
97
|
|
|
87
|
-
## [1.1.9](https://github.com/
|
|
98
|
+
## [1.1.9](https://github.com/core-ds/core-components/compare/@alfalab/core-components-radio-group@1.1.7...@alfalab/core-components-radio-group@1.1.9) (2021-03-18)
|
|
88
99
|
|
|
89
100
|
|
|
90
101
|
### Bug Fixes
|
|
91
102
|
|
|
92
|
-
* one more sborka bug ([#579](https://github.com/
|
|
103
|
+
* one more sborka bug ([#579](https://github.com/core-ds/core-components/issues/579)) ([9fbe0be](https://github.com/core-ds/core-components/commit/9fbe0beca56ec5971de78b3f6cda25305b260efc))
|
|
93
104
|
|
|
94
105
|
|
|
95
106
|
|
|
96
107
|
|
|
97
108
|
|
|
98
|
-
## [1.1.7](https://github.com/
|
|
109
|
+
## [1.1.7](https://github.com/core-ds/core-components/compare/@alfalab/core-components-radio-group@1.1.5...@alfalab/core-components-radio-group@1.1.7) (2021-03-16)
|
|
99
110
|
|
|
100
111
|
|
|
101
112
|
### Bug Fixes
|
|
102
113
|
|
|
103
|
-
* border-radius in packages ([781749e](https://github.com/
|
|
114
|
+
* border-radius in packages ([781749e](https://github.com/core-ds/core-components/commit/781749ef38aefd5a6707ac56d2e297dce9f3e073))
|
|
104
115
|
|
|
105
116
|
|
|
106
117
|
|
|
107
118
|
|
|
108
119
|
|
|
109
|
-
## [1.1.5](https://github.com/
|
|
120
|
+
## [1.1.5](https://github.com/core-ds/core-components/compare/@alfalab/core-components-radio-group@1.1.4...@alfalab/core-components-radio-group@1.1.5) (2021-03-14)
|
|
110
121
|
|
|
111
122
|
**Note:** Version bump only for package @alfalab/core-components-radio-group
|
|
112
123
|
|
|
@@ -114,7 +125,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
114
125
|
|
|
115
126
|
|
|
116
127
|
|
|
117
|
-
## [1.1.4](https://github.com/
|
|
128
|
+
## [1.1.4](https://github.com/core-ds/core-components/compare/@alfalab/core-components-radio-group@1.1.3...@alfalab/core-components-radio-group@1.1.4) (2021-03-04)
|
|
118
129
|
|
|
119
130
|
**Note:** Version bump only for package @alfalab/core-components-radio-group
|
|
120
131
|
|
|
@@ -122,7 +133,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
122
133
|
|
|
123
134
|
|
|
124
135
|
|
|
125
|
-
## [1.1.3](https://github.com/
|
|
136
|
+
## [1.1.3](https://github.com/core-ds/core-components/compare/@alfalab/core-components-radio-group@1.1.2...@alfalab/core-components-radio-group@1.1.3) (2021-03-03)
|
|
126
137
|
|
|
127
138
|
**Note:** Version bump only for package @alfalab/core-components-radio-group
|
|
128
139
|
|
|
@@ -130,7 +141,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
130
141
|
|
|
131
142
|
|
|
132
143
|
|
|
133
|
-
## [1.1.2](https://github.com/
|
|
144
|
+
## [1.1.2](https://github.com/core-ds/core-components/compare/@alfalab/core-components-radio-group@1.1.1...@alfalab/core-components-radio-group@1.1.2) (2021-02-20)
|
|
134
145
|
|
|
135
146
|
**Note:** Version bump only for package @alfalab/core-components-radio-group
|
|
136
147
|
|
|
@@ -138,9 +149,9 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
138
149
|
|
|
139
150
|
|
|
140
151
|
|
|
141
|
-
## [1.1.1](https://github.com/
|
|
152
|
+
## [1.1.1](https://github.com/core-ds/core-components/compare/@alfalab/core-components-radio-group@1.1.0...@alfalab/core-components-radio-group@1.1.1) (2021-02-18)
|
|
142
153
|
|
|
143
154
|
|
|
144
155
|
### Bug Fixes
|
|
145
156
|
|
|
146
|
-
* update versions ([#525](https://github.com/
|
|
157
|
+
* update versions ([#525](https://github.com/core-ds/core-components/issues/525)) ([31b2e4c](https://github.com/core-ds/core-components/commit/31b2e4c92fde6e2b63a3391a4e053cd328e93e70))
|
package/dist/Component.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ type RadioGroupProps = {
|
|
|
54
54
|
/**
|
|
55
55
|
* Value выбранного дочернего элемента
|
|
56
56
|
*/
|
|
57
|
-
value?: string;
|
|
57
|
+
value?: string | null;
|
|
58
58
|
};
|
|
59
59
|
declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
60
|
export { Direction, RadioGroupType, RadioGroupProps, RadioGroup };
|
package/dist/Component.js
CHANGED
|
@@ -37,7 +37,7 @@ var __assign = function () {
|
|
|
37
37
|
return __assign.apply(this, arguments);
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
var styles = {"component":"radio-
|
|
40
|
+
var styles = {"component":"radio-group__component_1j22q","error":"radio-group__error_1j22q","radioList":"radio-group__radioList_1j22q","vertical":"radio-group__vertical_1j22q","radio":"radio-group__radio_1j22q","horizontal":"radio-group__horizontal_1j22q","tag":"radio-group__tag_1j22q","tagLabel":"radio-group__tagLabel_1j22q","label":"radio-group__label_1j22q","sub":"radio-group__sub_1j22q","errorMessage":"radio-group__errorMessage_1j22q","hint":"radio-group__hint_1j22q","hiddenInput":"radio-group__hiddenInput_1j22q"};
|
|
41
41
|
require('./index.css')
|
|
42
42
|
|
|
43
43
|
var RadioGroup = React.forwardRef(function (_a, ref) {
|
|
@@ -46,7 +46,7 @@ var RadioGroup = React.forwardRef(function (_a, ref) {
|
|
|
46
46
|
var _f = React.useState(''), stateValue = _f[0], setStateValue = _f[1];
|
|
47
47
|
var renderRadio = function (child) {
|
|
48
48
|
var childClassName = child.props.className;
|
|
49
|
-
var checked = (value || stateValue) === child.props.value;
|
|
49
|
+
var checked = value !== null && (value || stateValue) === child.props.value;
|
|
50
50
|
var handleChange = function (event) {
|
|
51
51
|
setStateValue(child.props.value);
|
|
52
52
|
if (onChange) {
|
|
@@ -57,7 +57,7 @@ var RadioGroup = React.forwardRef(function (_a, ref) {
|
|
|
57
57
|
name: name, className: cn__default['default'](childClassName, styles.radio) }));
|
|
58
58
|
};
|
|
59
59
|
var renderTag = function (child) {
|
|
60
|
-
var checked = (value || stateValue) === child.props.value;
|
|
60
|
+
var checked = value !== null && (value || stateValue) === child.props.value;
|
|
61
61
|
var handleChange = function (event) {
|
|
62
62
|
setStateValue(child.props.value);
|
|
63
63
|
if (onChange) {
|
package/dist/cssm/Component.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ type RadioGroupProps = {
|
|
|
54
54
|
/**
|
|
55
55
|
* Value выбранного дочернего элемента
|
|
56
56
|
*/
|
|
57
|
-
value?: string;
|
|
57
|
+
value?: string | null;
|
|
58
58
|
};
|
|
59
59
|
declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
60
|
export { Direction, RadioGroupType, RadioGroupProps, RadioGroup };
|
package/dist/cssm/Component.js
CHANGED
|
@@ -45,7 +45,7 @@ var RadioGroup = React.forwardRef(function (_a, ref) {
|
|
|
45
45
|
var _f = React.useState(''), stateValue = _f[0], setStateValue = _f[1];
|
|
46
46
|
var renderRadio = function (child) {
|
|
47
47
|
var childClassName = child.props.className;
|
|
48
|
-
var checked = (value || stateValue) === child.props.value;
|
|
48
|
+
var checked = value !== null && (value || stateValue) === child.props.value;
|
|
49
49
|
var handleChange = function (event) {
|
|
50
50
|
setStateValue(child.props.value);
|
|
51
51
|
if (onChange) {
|
|
@@ -56,7 +56,7 @@ var RadioGroup = React.forwardRef(function (_a, ref) {
|
|
|
56
56
|
name: name, className: cn__default['default'](childClassName, styles__default['default'].radio) }));
|
|
57
57
|
};
|
|
58
58
|
var renderTag = function (child) {
|
|
59
|
-
var checked = (value || stateValue) === child.props.value;
|
|
59
|
+
var checked = value !== null && (value || stateValue) === child.props.value;
|
|
60
60
|
var handleChange = function (event) {
|
|
61
61
|
setStateValue(child.props.value);
|
|
62
62
|
if (onChange) {
|
package/dist/esm/Component.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ type RadioGroupProps = {
|
|
|
54
54
|
/**
|
|
55
55
|
* Value выбранного дочернего элемента
|
|
56
56
|
*/
|
|
57
|
-
value?: string;
|
|
57
|
+
value?: string | null;
|
|
58
58
|
};
|
|
59
59
|
declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
60
|
export { Direction, RadioGroupType, RadioGroupProps, RadioGroup };
|
package/dist/esm/Component.js
CHANGED
|
@@ -28,7 +28,7 @@ var __assign = function () {
|
|
|
28
28
|
return __assign.apply(this, arguments);
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
var styles = {"component":"radio-
|
|
31
|
+
var styles = {"component":"radio-group__component_1j22q","error":"radio-group__error_1j22q","radioList":"radio-group__radioList_1j22q","vertical":"radio-group__vertical_1j22q","radio":"radio-group__radio_1j22q","horizontal":"radio-group__horizontal_1j22q","tag":"radio-group__tag_1j22q","tagLabel":"radio-group__tagLabel_1j22q","label":"radio-group__label_1j22q","sub":"radio-group__sub_1j22q","errorMessage":"radio-group__errorMessage_1j22q","hint":"radio-group__hint_1j22q","hiddenInput":"radio-group__hiddenInput_1j22q"};
|
|
32
32
|
require('./index.css')
|
|
33
33
|
|
|
34
34
|
var RadioGroup = forwardRef(function (_a, ref) {
|
|
@@ -37,7 +37,7 @@ var RadioGroup = forwardRef(function (_a, ref) {
|
|
|
37
37
|
var _f = useState(''), stateValue = _f[0], setStateValue = _f[1];
|
|
38
38
|
var renderRadio = function (child) {
|
|
39
39
|
var childClassName = child.props.className;
|
|
40
|
-
var checked = (value || stateValue) === child.props.value;
|
|
40
|
+
var checked = value !== null && (value || stateValue) === child.props.value;
|
|
41
41
|
var handleChange = function (event) {
|
|
42
42
|
setStateValue(child.props.value);
|
|
43
43
|
if (onChange) {
|
|
@@ -48,7 +48,7 @@ var RadioGroup = forwardRef(function (_a, ref) {
|
|
|
48
48
|
name: name, className: cn(childClassName, styles.radio) }));
|
|
49
49
|
};
|
|
50
50
|
var renderTag = function (child) {
|
|
51
|
-
var checked = (value || stateValue) === child.props.value;
|
|
51
|
+
var checked = value !== null && (value || stateValue) === child.props.value;
|
|
52
52
|
var handleChange = function (event) {
|
|
53
53
|
setStateValue(child.props.value);
|
|
54
54
|
if (onChange) {
|
package/dist/esm/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: thg7w */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-text-negative: #d91d0b;
|
|
4
4
|
--color-light-text-primary: #0b1f35;
|
|
@@ -25,68 +25,68 @@
|
|
|
25
25
|
--radio-group-hint-color: var(--color-light-text-secondary);
|
|
26
26
|
--radio-group-label-color: var(--color-light-text-primary);
|
|
27
27
|
}
|
|
28
|
-
.radio-
|
|
28
|
+
.radio-group__component_1j22q {
|
|
29
29
|
display: flex;
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
}
|
|
32
|
-
.radio-
|
|
32
|
+
.radio-group__error_1j22q {
|
|
33
33
|
padding-left: var(--gap-xs);
|
|
34
34
|
border-left: 1px solid var(--radio-group-error-color);
|
|
35
35
|
}
|
|
36
|
-
.radio-
|
|
36
|
+
.radio-group__radioList_1j22q {
|
|
37
37
|
display: flex;
|
|
38
38
|
}
|
|
39
|
-
.radio-
|
|
39
|
+
.radio-group__vertical_1j22q .radio-group__radioList_1j22q {
|
|
40
40
|
flex-direction: column;
|
|
41
41
|
align-items: flex-start;
|
|
42
42
|
}
|
|
43
|
-
.radio-
|
|
43
|
+
.radio-group__vertical_1j22q .radio-group__radio_1j22q {
|
|
44
44
|
margin-bottom: var(--gap-m)
|
|
45
45
|
}
|
|
46
|
-
.radio-
|
|
46
|
+
.radio-group__vertical_1j22q .radio-group__radio_1j22q:last-child {
|
|
47
47
|
margin-bottom: 0;
|
|
48
48
|
}
|
|
49
|
-
.radio-
|
|
49
|
+
.radio-group__horizontal_1j22q .radio-group__radioList_1j22q {
|
|
50
50
|
flex-wrap: wrap;
|
|
51
51
|
margin-right: var(--gap-xl-neg);
|
|
52
52
|
margin-bottom: var(--gap-xs-neg);
|
|
53
53
|
}
|
|
54
|
-
.radio-
|
|
54
|
+
.radio-group__tag_1j22q.radio-group__horizontal_1j22q .radio-group__radioList_1j22q {
|
|
55
55
|
margin-right: var(--gap-xs-neg);
|
|
56
56
|
}
|
|
57
|
-
.radio-
|
|
57
|
+
.radio-group__horizontal_1j22q .radio-group__radio_1j22q {
|
|
58
58
|
margin-right: var(--gap-xl);
|
|
59
59
|
margin-bottom: var(--gap-xs);
|
|
60
60
|
}
|
|
61
|
-
.radio-
|
|
61
|
+
.radio-group__horizontal_1j22q .radio-group__tagLabel_1j22q {
|
|
62
62
|
margin-right: var(--gap-xs);
|
|
63
63
|
}
|
|
64
|
-
.radio-
|
|
64
|
+
.radio-group__label_1j22q {
|
|
65
65
|
font-size: 16px;
|
|
66
66
|
line-height: 24px;
|
|
67
67
|
font-weight: 400;
|
|
68
68
|
margin-bottom: var(--gap-s);
|
|
69
69
|
color: var(--radio-group-label-color);
|
|
70
70
|
}
|
|
71
|
-
.radio-
|
|
71
|
+
.radio-group__sub_1j22q {
|
|
72
72
|
font-size: 14px;
|
|
73
73
|
line-height: 18px;
|
|
74
74
|
font-weight: 400;
|
|
75
75
|
margin-top: var(--gap-s);
|
|
76
76
|
}
|
|
77
|
-
.radio-
|
|
77
|
+
.radio-group__errorMessage_1j22q {
|
|
78
78
|
color: var(--radio-group-error-color);
|
|
79
79
|
}
|
|
80
|
-
.radio-
|
|
80
|
+
.radio-group__hint_1j22q {
|
|
81
81
|
color: var(--radio-group-hint-color);
|
|
82
82
|
}
|
|
83
|
-
.radio-
|
|
83
|
+
.radio-group__hiddenInput_1j22q {
|
|
84
84
|
position: absolute;
|
|
85
85
|
z-index: -1;
|
|
86
86
|
top: 0;
|
|
87
87
|
left: 0;
|
|
88
88
|
opacity: 0;
|
|
89
89
|
}
|
|
90
|
-
.radio-
|
|
90
|
+
.radio-group__tagLabel_1j22q {
|
|
91
91
|
position: relative;
|
|
92
92
|
}
|
package/dist/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: thg7w */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-text-negative: #d91d0b;
|
|
4
4
|
--color-light-text-primary: #0b1f35;
|
|
@@ -25,68 +25,68 @@
|
|
|
25
25
|
--radio-group-hint-color: var(--color-light-text-secondary);
|
|
26
26
|
--radio-group-label-color: var(--color-light-text-primary);
|
|
27
27
|
}
|
|
28
|
-
.radio-
|
|
28
|
+
.radio-group__component_1j22q {
|
|
29
29
|
display: flex;
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
}
|
|
32
|
-
.radio-
|
|
32
|
+
.radio-group__error_1j22q {
|
|
33
33
|
padding-left: var(--gap-xs);
|
|
34
34
|
border-left: 1px solid var(--radio-group-error-color);
|
|
35
35
|
}
|
|
36
|
-
.radio-
|
|
36
|
+
.radio-group__radioList_1j22q {
|
|
37
37
|
display: flex;
|
|
38
38
|
}
|
|
39
|
-
.radio-
|
|
39
|
+
.radio-group__vertical_1j22q .radio-group__radioList_1j22q {
|
|
40
40
|
flex-direction: column;
|
|
41
41
|
align-items: flex-start;
|
|
42
42
|
}
|
|
43
|
-
.radio-
|
|
43
|
+
.radio-group__vertical_1j22q .radio-group__radio_1j22q {
|
|
44
44
|
margin-bottom: var(--gap-m)
|
|
45
45
|
}
|
|
46
|
-
.radio-
|
|
46
|
+
.radio-group__vertical_1j22q .radio-group__radio_1j22q:last-child {
|
|
47
47
|
margin-bottom: 0;
|
|
48
48
|
}
|
|
49
|
-
.radio-
|
|
49
|
+
.radio-group__horizontal_1j22q .radio-group__radioList_1j22q {
|
|
50
50
|
flex-wrap: wrap;
|
|
51
51
|
margin-right: var(--gap-xl-neg);
|
|
52
52
|
margin-bottom: var(--gap-xs-neg);
|
|
53
53
|
}
|
|
54
|
-
.radio-
|
|
54
|
+
.radio-group__tag_1j22q.radio-group__horizontal_1j22q .radio-group__radioList_1j22q {
|
|
55
55
|
margin-right: var(--gap-xs-neg);
|
|
56
56
|
}
|
|
57
|
-
.radio-
|
|
57
|
+
.radio-group__horizontal_1j22q .radio-group__radio_1j22q {
|
|
58
58
|
margin-right: var(--gap-xl);
|
|
59
59
|
margin-bottom: var(--gap-xs);
|
|
60
60
|
}
|
|
61
|
-
.radio-
|
|
61
|
+
.radio-group__horizontal_1j22q .radio-group__tagLabel_1j22q {
|
|
62
62
|
margin-right: var(--gap-xs);
|
|
63
63
|
}
|
|
64
|
-
.radio-
|
|
64
|
+
.radio-group__label_1j22q {
|
|
65
65
|
font-size: 16px;
|
|
66
66
|
line-height: 24px;
|
|
67
67
|
font-weight: 400;
|
|
68
68
|
margin-bottom: var(--gap-s);
|
|
69
69
|
color: var(--radio-group-label-color);
|
|
70
70
|
}
|
|
71
|
-
.radio-
|
|
71
|
+
.radio-group__sub_1j22q {
|
|
72
72
|
font-size: 14px;
|
|
73
73
|
line-height: 18px;
|
|
74
74
|
font-weight: 400;
|
|
75
75
|
margin-top: var(--gap-s);
|
|
76
76
|
}
|
|
77
|
-
.radio-
|
|
77
|
+
.radio-group__errorMessage_1j22q {
|
|
78
78
|
color: var(--radio-group-error-color);
|
|
79
79
|
}
|
|
80
|
-
.radio-
|
|
80
|
+
.radio-group__hint_1j22q {
|
|
81
81
|
color: var(--radio-group-hint-color);
|
|
82
82
|
}
|
|
83
|
-
.radio-
|
|
83
|
+
.radio-group__hiddenInput_1j22q {
|
|
84
84
|
position: absolute;
|
|
85
85
|
z-index: -1;
|
|
86
86
|
top: 0;
|
|
87
87
|
left: 0;
|
|
88
88
|
opacity: 0;
|
|
89
89
|
}
|
|
90
|
-
.radio-
|
|
90
|
+
.radio-group__tagLabel_1j22q {
|
|
91
91
|
position: relative;
|
|
92
92
|
}
|
|
@@ -54,7 +54,7 @@ type RadioGroupProps = {
|
|
|
54
54
|
/**
|
|
55
55
|
* Value выбранного дочернего элемента
|
|
56
56
|
*/
|
|
57
|
-
value?: string;
|
|
57
|
+
value?: string | null;
|
|
58
58
|
};
|
|
59
59
|
declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
60
|
export { Direction, RadioGroupType, RadioGroupProps, RadioGroup };
|
package/dist/modern/Component.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React, { forwardRef, useState, Children, isValidElement, cloneElement } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
|
|
4
|
-
var styles = {"component":"radio-
|
|
4
|
+
var styles = {"component":"radio-group__component_1j22q","error":"radio-group__error_1j22q","radioList":"radio-group__radioList_1j22q","vertical":"radio-group__vertical_1j22q","radio":"radio-group__radio_1j22q","horizontal":"radio-group__horizontal_1j22q","tag":"radio-group__tag_1j22q","tagLabel":"radio-group__tagLabel_1j22q","label":"radio-group__label_1j22q","sub":"radio-group__sub_1j22q","errorMessage":"radio-group__errorMessage_1j22q","hint":"radio-group__hint_1j22q","hiddenInput":"radio-group__hiddenInput_1j22q"};
|
|
5
5
|
require('./index.css')
|
|
6
6
|
|
|
7
7
|
const RadioGroup = forwardRef(({ children, className, direction = 'vertical', label, error, hint, onChange, type = 'radio', dataTestId, disabled = false, name, value, }, ref) => {
|
|
8
8
|
const [stateValue, setStateValue] = useState('');
|
|
9
9
|
const renderRadio = (child) => {
|
|
10
10
|
const { className: childClassName } = child.props;
|
|
11
|
-
const checked = (value || stateValue) === child.props.value;
|
|
11
|
+
const checked = value !== null && (value || stateValue) === child.props.value;
|
|
12
12
|
const handleChange = (event) => {
|
|
13
13
|
setStateValue(child.props.value);
|
|
14
14
|
if (onChange) {
|
|
@@ -25,7 +25,7 @@ const RadioGroup = forwardRef(({ children, className, direction = 'vertical', la
|
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
27
|
const renderTag = (child) => {
|
|
28
|
-
const checked = (value || stateValue) === child.props.value;
|
|
28
|
+
const checked = value !== null && (value || stateValue) === child.props.value;
|
|
29
29
|
const handleChange = (event) => {
|
|
30
30
|
setStateValue(child.props.value);
|
|
31
31
|
if (onChange) {
|
package/dist/modern/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: thg7w */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-text-negative: #d91d0b;
|
|
4
4
|
--color-light-text-primary: #0b1f35;
|
|
@@ -25,68 +25,68 @@
|
|
|
25
25
|
--radio-group-hint-color: var(--color-light-text-secondary);
|
|
26
26
|
--radio-group-label-color: var(--color-light-text-primary);
|
|
27
27
|
}
|
|
28
|
-
.radio-
|
|
28
|
+
.radio-group__component_1j22q {
|
|
29
29
|
display: flex;
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
}
|
|
32
|
-
.radio-
|
|
32
|
+
.radio-group__error_1j22q {
|
|
33
33
|
padding-left: var(--gap-xs);
|
|
34
34
|
border-left: 1px solid var(--radio-group-error-color);
|
|
35
35
|
}
|
|
36
|
-
.radio-
|
|
36
|
+
.radio-group__radioList_1j22q {
|
|
37
37
|
display: flex;
|
|
38
38
|
}
|
|
39
|
-
.radio-
|
|
39
|
+
.radio-group__vertical_1j22q .radio-group__radioList_1j22q {
|
|
40
40
|
flex-direction: column;
|
|
41
41
|
align-items: flex-start;
|
|
42
42
|
}
|
|
43
|
-
.radio-
|
|
43
|
+
.radio-group__vertical_1j22q .radio-group__radio_1j22q {
|
|
44
44
|
margin-bottom: var(--gap-m)
|
|
45
45
|
}
|
|
46
|
-
.radio-
|
|
46
|
+
.radio-group__vertical_1j22q .radio-group__radio_1j22q:last-child {
|
|
47
47
|
margin-bottom: 0;
|
|
48
48
|
}
|
|
49
|
-
.radio-
|
|
49
|
+
.radio-group__horizontal_1j22q .radio-group__radioList_1j22q {
|
|
50
50
|
flex-wrap: wrap;
|
|
51
51
|
margin-right: var(--gap-xl-neg);
|
|
52
52
|
margin-bottom: var(--gap-xs-neg);
|
|
53
53
|
}
|
|
54
|
-
.radio-
|
|
54
|
+
.radio-group__tag_1j22q.radio-group__horizontal_1j22q .radio-group__radioList_1j22q {
|
|
55
55
|
margin-right: var(--gap-xs-neg);
|
|
56
56
|
}
|
|
57
|
-
.radio-
|
|
57
|
+
.radio-group__horizontal_1j22q .radio-group__radio_1j22q {
|
|
58
58
|
margin-right: var(--gap-xl);
|
|
59
59
|
margin-bottom: var(--gap-xs);
|
|
60
60
|
}
|
|
61
|
-
.radio-
|
|
61
|
+
.radio-group__horizontal_1j22q .radio-group__tagLabel_1j22q {
|
|
62
62
|
margin-right: var(--gap-xs);
|
|
63
63
|
}
|
|
64
|
-
.radio-
|
|
64
|
+
.radio-group__label_1j22q {
|
|
65
65
|
font-size: 16px;
|
|
66
66
|
line-height: 24px;
|
|
67
67
|
font-weight: 400;
|
|
68
68
|
margin-bottom: var(--gap-s);
|
|
69
69
|
color: var(--radio-group-label-color);
|
|
70
70
|
}
|
|
71
|
-
.radio-
|
|
71
|
+
.radio-group__sub_1j22q {
|
|
72
72
|
font-size: 14px;
|
|
73
73
|
line-height: 18px;
|
|
74
74
|
font-weight: 400;
|
|
75
75
|
margin-top: var(--gap-s);
|
|
76
76
|
}
|
|
77
|
-
.radio-
|
|
77
|
+
.radio-group__errorMessage_1j22q {
|
|
78
78
|
color: var(--radio-group-error-color);
|
|
79
79
|
}
|
|
80
|
-
.radio-
|
|
80
|
+
.radio-group__hint_1j22q {
|
|
81
81
|
color: var(--radio-group-hint-color);
|
|
82
82
|
}
|
|
83
|
-
.radio-
|
|
83
|
+
.radio-group__hiddenInput_1j22q {
|
|
84
84
|
position: absolute;
|
|
85
85
|
z-index: -1;
|
|
86
86
|
top: 0;
|
|
87
87
|
left: 0;
|
|
88
88
|
opacity: 0;
|
|
89
89
|
}
|
|
90
|
-
.radio-
|
|
90
|
+
.radio-group__tagLabel_1j22q {
|
|
91
91
|
position: relative;
|
|
92
92
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-radio-group",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Radio group",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"react-dom": "^16.9.0 || ^17.0.1"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"classnames": "2.2.6"
|
|
23
|
+
"classnames": "^2.2.6"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "dcd5c0c8e25b7c374ff9311505ccf738a82e22c0"
|
|
26
26
|
}
|