@alfalab/core-components-radio-group 2.1.0 → 2.4.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 +39 -0
- package/dist/Component.d.ts +1 -1
- package/dist/Component.js +4 -4
- package/dist/cssm/Component.d.ts +1 -1
- package/dist/cssm/Component.js +3 -3
- package/dist/esm/Component.d.ts +1 -1
- package/dist/esm/Component.js +4 -4
- 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 +4 -4
- package/dist/modern/index.css +17 -17
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,45 @@
|
|
|
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.4.0](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-radio-group@2.3.0...@alfalab/core-components-radio-group@2.4.0) (2022-03-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **radio-group:** add missing 'value' attribute to 'input' tag ([#1033](https://github.com/alfa-laboratory/core-components/issues/1033)) ([0f9cf0e](https://github.com/alfa-laboratory/core-components/commit/0f9cf0ecd74f4764ccd0b2839ba0cdf1b96e75cb)), closes [#1031](https://github.com/alfa-laboratory/core-components/issues/1031)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* Исправить импорты в сторях. ([#998](https://github.com/alfa-laboratory/core-components/issues/998)) ([e6a654a](https://github.com/alfa-laboratory/core-components/commit/e6a654a0599451c7d149484cb61d8067eed083b7))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [2.3.0](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-radio-group@2.2.0...@alfalab/core-components-radio-group@2.3.0) (2021-10-11)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* проставлен role=alert для ошибок ([#850](https://github.com/alfa-laboratory/core-components/issues/850)) ([dc634a3](https://github.com/alfa-laboratory/core-components/commit/dc634a3d008accfab10192ce234c12ef0ecc7fa9))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# [2.2.0](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-radio-group@2.1.0...@alfalab/core-components-radio-group@2.2.0) (2021-09-14)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* change error type to ReactNode ([#825](https://github.com/alfa-laboratory/core-components/issues/825)) ([c6d95c1](https://github.com/alfa-laboratory/core-components/commit/c6d95c1c6239f2b2a3bf2c1639554d8500e794f3))
|
|
39
|
+
* **tag:** add inverted colors ([#784](https://github.com/alfa-laboratory/core-components/issues/784)) ([d3681ae](https://github.com/alfa-laboratory/core-components/commit/d3681aeefe02e5f481d066013911a1877a165bb2))
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
6
45
|
# [2.1.0](https://github.com/alfa-laboratory/core-components/compare/@alfalab/core-components-radio-group@2.0.1...@alfalab/core-components-radio-group@2.1.0) (2021-07-23)
|
|
7
46
|
|
|
8
47
|
|
package/dist/Component.d.ts
CHANGED
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_m9mmb","error":"radio-group__error_m9mmb","radioList":"radio-group__radioList_m9mmb","vertical":"radio-group__vertical_m9mmb","radio":"radio-group__radio_m9mmb","horizontal":"radio-group__horizontal_m9mmb","tag":"radio-group__tag_m9mmb","tagLabel":"radio-group__tagLabel_m9mmb","label":"radio-group__label_m9mmb","sub":"radio-group__sub_m9mmb","errorMessage":"radio-group__errorMessage_m9mmb","hint":"radio-group__hint_m9mmb","hiddenInput":"radio-group__hiddenInput_m9mmb"};
|
|
41
41
|
require('./index.css')
|
|
42
42
|
|
|
43
43
|
var RadioGroup = React.forwardRef(function (_a, ref) {
|
|
@@ -70,9 +70,9 @@ var RadioGroup = React.forwardRef(function (_a, ref) {
|
|
|
70
70
|
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
71
71
|
React__default['default'].createElement("label", { className: cn__default['default'](styles.radio, styles.tagLabel) },
|
|
72
72
|
clone,
|
|
73
|
-
React__default['default'].createElement("input", { type: 'radio', autoComplete: 'off', onChange: handleChange, disabled: disabled || child.props.disabled, name: name, checked: checked, className: styles.hiddenInput })));
|
|
73
|
+
React__default['default'].createElement("input", { type: 'radio', autoComplete: 'off', onChange: handleChange, disabled: disabled || child.props.disabled, name: name, checked: checked, className: styles.hiddenInput, value: child.props.value })));
|
|
74
74
|
};
|
|
75
|
-
var errorMessage = typeof error === '
|
|
75
|
+
var errorMessage = typeof error === 'boolean' ? '' : error;
|
|
76
76
|
return (React__default['default'].createElement("div", { className: cn__default['default'](styles.component, styles[type], styles[direction], (_b = {}, _b[styles.error] = error, _b), className), "data-test-id": dataTestId, ref: ref },
|
|
77
77
|
label ? React__default['default'].createElement("span", { className: styles.label }, label) : null,
|
|
78
78
|
children ? (React__default['default'].createElement("div", { className: styles.radioList }, React.Children.map(children, function (child) {
|
|
@@ -81,7 +81,7 @@ var RadioGroup = React.forwardRef(function (_a, ref) {
|
|
|
81
81
|
}
|
|
82
82
|
return null;
|
|
83
83
|
}))) : null,
|
|
84
|
-
errorMessage && (React__default['default'].createElement("span", { className: cn__default['default'](styles.sub, styles.errorMessage) }, errorMessage)),
|
|
84
|
+
errorMessage && (React__default['default'].createElement("span", { className: cn__default['default'](styles.sub, styles.errorMessage), role: 'alert' }, errorMessage)),
|
|
85
85
|
hint && !errorMessage && (React__default['default'].createElement("span", { className: cn__default['default'](styles.sub, styles.hint) }, hint))));
|
|
86
86
|
});
|
|
87
87
|
/**
|
package/dist/cssm/Component.d.ts
CHANGED
package/dist/cssm/Component.js
CHANGED
|
@@ -69,9 +69,9 @@ var RadioGroup = React.forwardRef(function (_a, ref) {
|
|
|
69
69
|
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
70
70
|
React__default['default'].createElement("label", { className: cn__default['default'](styles__default['default'].radio, styles__default['default'].tagLabel) },
|
|
71
71
|
clone,
|
|
72
|
-
React__default['default'].createElement("input", { type: 'radio', autoComplete: 'off', onChange: handleChange, disabled: disabled || child.props.disabled, name: name, checked: checked, className: styles__default['default'].hiddenInput })));
|
|
72
|
+
React__default['default'].createElement("input", { type: 'radio', autoComplete: 'off', onChange: handleChange, disabled: disabled || child.props.disabled, name: name, checked: checked, className: styles__default['default'].hiddenInput, value: child.props.value })));
|
|
73
73
|
};
|
|
74
|
-
var errorMessage = typeof error === '
|
|
74
|
+
var errorMessage = typeof error === 'boolean' ? '' : error;
|
|
75
75
|
return (React__default['default'].createElement("div", { className: cn__default['default'](styles__default['default'].component, styles__default['default'][type], styles__default['default'][direction], (_b = {}, _b[styles__default['default'].error] = error, _b), className), "data-test-id": dataTestId, ref: ref },
|
|
76
76
|
label ? React__default['default'].createElement("span", { className: styles__default['default'].label }, label) : null,
|
|
77
77
|
children ? (React__default['default'].createElement("div", { className: styles__default['default'].radioList }, React.Children.map(children, function (child) {
|
|
@@ -80,7 +80,7 @@ var RadioGroup = React.forwardRef(function (_a, ref) {
|
|
|
80
80
|
}
|
|
81
81
|
return null;
|
|
82
82
|
}))) : null,
|
|
83
|
-
errorMessage && (React__default['default'].createElement("span", { className: cn__default['default'](styles__default['default'].sub, styles__default['default'].errorMessage) }, errorMessage)),
|
|
83
|
+
errorMessage && (React__default['default'].createElement("span", { className: cn__default['default'](styles__default['default'].sub, styles__default['default'].errorMessage), role: 'alert' }, errorMessage)),
|
|
84
84
|
hint && !errorMessage && (React__default['default'].createElement("span", { className: cn__default['default'](styles__default['default'].sub, styles__default['default'].hint) }, hint))));
|
|
85
85
|
});
|
|
86
86
|
/**
|
package/dist/esm/Component.d.ts
CHANGED
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_m9mmb","error":"radio-group__error_m9mmb","radioList":"radio-group__radioList_m9mmb","vertical":"radio-group__vertical_m9mmb","radio":"radio-group__radio_m9mmb","horizontal":"radio-group__horizontal_m9mmb","tag":"radio-group__tag_m9mmb","tagLabel":"radio-group__tagLabel_m9mmb","label":"radio-group__label_m9mmb","sub":"radio-group__sub_m9mmb","errorMessage":"radio-group__errorMessage_m9mmb","hint":"radio-group__hint_m9mmb","hiddenInput":"radio-group__hiddenInput_m9mmb"};
|
|
32
32
|
require('./index.css')
|
|
33
33
|
|
|
34
34
|
var RadioGroup = forwardRef(function (_a, ref) {
|
|
@@ -61,9 +61,9 @@ var RadioGroup = forwardRef(function (_a, ref) {
|
|
|
61
61
|
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
62
62
|
React.createElement("label", { className: cn(styles.radio, styles.tagLabel) },
|
|
63
63
|
clone,
|
|
64
|
-
React.createElement("input", { type: 'radio', autoComplete: 'off', onChange: handleChange, disabled: disabled || child.props.disabled, name: name, checked: checked, className: styles.hiddenInput })));
|
|
64
|
+
React.createElement("input", { type: 'radio', autoComplete: 'off', onChange: handleChange, disabled: disabled || child.props.disabled, name: name, checked: checked, className: styles.hiddenInput, value: child.props.value })));
|
|
65
65
|
};
|
|
66
|
-
var errorMessage = typeof error === '
|
|
66
|
+
var errorMessage = typeof error === 'boolean' ? '' : error;
|
|
67
67
|
return (React.createElement("div", { className: cn(styles.component, styles[type], styles[direction], (_b = {}, _b[styles.error] = error, _b), className), "data-test-id": dataTestId, ref: ref },
|
|
68
68
|
label ? React.createElement("span", { className: styles.label }, label) : null,
|
|
69
69
|
children ? (React.createElement("div", { className: styles.radioList }, Children.map(children, function (child) {
|
|
@@ -72,7 +72,7 @@ var RadioGroup = forwardRef(function (_a, ref) {
|
|
|
72
72
|
}
|
|
73
73
|
return null;
|
|
74
74
|
}))) : null,
|
|
75
|
-
errorMessage && (React.createElement("span", { className: cn(styles.sub, styles.errorMessage) }, errorMessage)),
|
|
75
|
+
errorMessage && (React.createElement("span", { className: cn(styles.sub, styles.errorMessage), role: 'alert' }, errorMessage)),
|
|
76
76
|
hint && !errorMessage && (React.createElement("span", { className: cn(styles.sub, styles.hint) }, hint))));
|
|
77
77
|
});
|
|
78
78
|
/**
|
package/dist/esm/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1diw5 */
|
|
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_m9mmb {
|
|
29
29
|
display: flex;
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
}
|
|
32
|
-
.radio-
|
|
32
|
+
.radio-group__error_m9mmb {
|
|
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_m9mmb {
|
|
37
37
|
display: flex;
|
|
38
38
|
}
|
|
39
|
-
.radio-
|
|
39
|
+
.radio-group__vertical_m9mmb .radio-group__radioList_m9mmb {
|
|
40
40
|
flex-direction: column;
|
|
41
41
|
align-items: flex-start;
|
|
42
42
|
}
|
|
43
|
-
.radio-
|
|
43
|
+
.radio-group__vertical_m9mmb .radio-group__radio_m9mmb {
|
|
44
44
|
margin-bottom: var(--gap-m)
|
|
45
45
|
}
|
|
46
|
-
.radio-
|
|
46
|
+
.radio-group__vertical_m9mmb .radio-group__radio_m9mmb:last-child {
|
|
47
47
|
margin-bottom: 0;
|
|
48
48
|
}
|
|
49
|
-
.radio-
|
|
49
|
+
.radio-group__horizontal_m9mmb .radio-group__radioList_m9mmb {
|
|
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_m9mmb.radio-group__horizontal_m9mmb .radio-group__radioList_m9mmb {
|
|
55
55
|
margin-right: var(--gap-xs-neg);
|
|
56
56
|
}
|
|
57
|
-
.radio-
|
|
57
|
+
.radio-group__horizontal_m9mmb .radio-group__radio_m9mmb {
|
|
58
58
|
margin-right: var(--gap-xl);
|
|
59
59
|
margin-bottom: var(--gap-xs);
|
|
60
60
|
}
|
|
61
|
-
.radio-
|
|
61
|
+
.radio-group__horizontal_m9mmb .radio-group__tagLabel_m9mmb {
|
|
62
62
|
margin-right: var(--gap-xs);
|
|
63
63
|
}
|
|
64
|
-
.radio-
|
|
64
|
+
.radio-group__label_m9mmb {
|
|
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_m9mmb {
|
|
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_m9mmb {
|
|
78
78
|
color: var(--radio-group-error-color);
|
|
79
79
|
}
|
|
80
|
-
.radio-
|
|
80
|
+
.radio-group__hint_m9mmb {
|
|
81
81
|
color: var(--radio-group-hint-color);
|
|
82
82
|
}
|
|
83
|
-
.radio-
|
|
83
|
+
.radio-group__hiddenInput_m9mmb {
|
|
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_m9mmb {
|
|
91
91
|
position: relative;
|
|
92
92
|
}
|
package/dist/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1diw5 */
|
|
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_m9mmb {
|
|
29
29
|
display: flex;
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
}
|
|
32
|
-
.radio-
|
|
32
|
+
.radio-group__error_m9mmb {
|
|
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_m9mmb {
|
|
37
37
|
display: flex;
|
|
38
38
|
}
|
|
39
|
-
.radio-
|
|
39
|
+
.radio-group__vertical_m9mmb .radio-group__radioList_m9mmb {
|
|
40
40
|
flex-direction: column;
|
|
41
41
|
align-items: flex-start;
|
|
42
42
|
}
|
|
43
|
-
.radio-
|
|
43
|
+
.radio-group__vertical_m9mmb .radio-group__radio_m9mmb {
|
|
44
44
|
margin-bottom: var(--gap-m)
|
|
45
45
|
}
|
|
46
|
-
.radio-
|
|
46
|
+
.radio-group__vertical_m9mmb .radio-group__radio_m9mmb:last-child {
|
|
47
47
|
margin-bottom: 0;
|
|
48
48
|
}
|
|
49
|
-
.radio-
|
|
49
|
+
.radio-group__horizontal_m9mmb .radio-group__radioList_m9mmb {
|
|
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_m9mmb.radio-group__horizontal_m9mmb .radio-group__radioList_m9mmb {
|
|
55
55
|
margin-right: var(--gap-xs-neg);
|
|
56
56
|
}
|
|
57
|
-
.radio-
|
|
57
|
+
.radio-group__horizontal_m9mmb .radio-group__radio_m9mmb {
|
|
58
58
|
margin-right: var(--gap-xl);
|
|
59
59
|
margin-bottom: var(--gap-xs);
|
|
60
60
|
}
|
|
61
|
-
.radio-
|
|
61
|
+
.radio-group__horizontal_m9mmb .radio-group__tagLabel_m9mmb {
|
|
62
62
|
margin-right: var(--gap-xs);
|
|
63
63
|
}
|
|
64
|
-
.radio-
|
|
64
|
+
.radio-group__label_m9mmb {
|
|
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_m9mmb {
|
|
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_m9mmb {
|
|
78
78
|
color: var(--radio-group-error-color);
|
|
79
79
|
}
|
|
80
|
-
.radio-
|
|
80
|
+
.radio-group__hint_m9mmb {
|
|
81
81
|
color: var(--radio-group-hint-color);
|
|
82
82
|
}
|
|
83
|
-
.radio-
|
|
83
|
+
.radio-group__hiddenInput_m9mmb {
|
|
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_m9mmb {
|
|
91
91
|
position: relative;
|
|
92
92
|
}
|
package/dist/modern/Component.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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_m9mmb","error":"radio-group__error_m9mmb","radioList":"radio-group__radioList_m9mmb","vertical":"radio-group__vertical_m9mmb","radio":"radio-group__radio_m9mmb","horizontal":"radio-group__horizontal_m9mmb","tag":"radio-group__tag_m9mmb","tagLabel":"radio-group__tagLabel_m9mmb","label":"radio-group__label_m9mmb","sub":"radio-group__sub_m9mmb","errorMessage":"radio-group__errorMessage_m9mmb","hint":"radio-group__hint_m9mmb","hiddenInput":"radio-group__hiddenInput_m9mmb"};
|
|
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) => {
|
|
@@ -43,9 +43,9 @@ const RadioGroup = forwardRef(({ children, className, direction = 'vertical', la
|
|
|
43
43
|
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
44
44
|
React.createElement("label", { className: cn(styles.radio, styles.tagLabel) },
|
|
45
45
|
clone,
|
|
46
|
-
React.createElement("input", { type: 'radio', autoComplete: 'off', onChange: handleChange, disabled: disabled || child.props.disabled, name: name, checked: checked, className: styles.hiddenInput })));
|
|
46
|
+
React.createElement("input", { type: 'radio', autoComplete: 'off', onChange: handleChange, disabled: disabled || child.props.disabled, name: name, checked: checked, className: styles.hiddenInput, value: child.props.value })));
|
|
47
47
|
};
|
|
48
|
-
const errorMessage = typeof error === '
|
|
48
|
+
const errorMessage = typeof error === 'boolean' ? '' : error;
|
|
49
49
|
return (React.createElement("div", { className: cn(styles.component, styles[type], styles[direction], { [styles.error]: error }, className), "data-test-id": dataTestId, ref: ref },
|
|
50
50
|
label ? React.createElement("span", { className: styles.label }, label) : null,
|
|
51
51
|
children ? (React.createElement("div", { className: styles.radioList }, Children.map(children, child => {
|
|
@@ -54,7 +54,7 @@ const RadioGroup = forwardRef(({ children, className, direction = 'vertical', la
|
|
|
54
54
|
}
|
|
55
55
|
return null;
|
|
56
56
|
}))) : null,
|
|
57
|
-
errorMessage && (React.createElement("span", { className: cn(styles.sub, styles.errorMessage) }, errorMessage)),
|
|
57
|
+
errorMessage && (React.createElement("span", { className: cn(styles.sub, styles.errorMessage), role: 'alert' }, errorMessage)),
|
|
58
58
|
hint && !errorMessage && (React.createElement("span", { className: cn(styles.sub, styles.hint) }, hint))));
|
|
59
59
|
});
|
|
60
60
|
/**
|
package/dist/modern/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1diw5 */
|
|
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_m9mmb {
|
|
29
29
|
display: flex;
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
}
|
|
32
|
-
.radio-
|
|
32
|
+
.radio-group__error_m9mmb {
|
|
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_m9mmb {
|
|
37
37
|
display: flex;
|
|
38
38
|
}
|
|
39
|
-
.radio-
|
|
39
|
+
.radio-group__vertical_m9mmb .radio-group__radioList_m9mmb {
|
|
40
40
|
flex-direction: column;
|
|
41
41
|
align-items: flex-start;
|
|
42
42
|
}
|
|
43
|
-
.radio-
|
|
43
|
+
.radio-group__vertical_m9mmb .radio-group__radio_m9mmb {
|
|
44
44
|
margin-bottom: var(--gap-m)
|
|
45
45
|
}
|
|
46
|
-
.radio-
|
|
46
|
+
.radio-group__vertical_m9mmb .radio-group__radio_m9mmb:last-child {
|
|
47
47
|
margin-bottom: 0;
|
|
48
48
|
}
|
|
49
|
-
.radio-
|
|
49
|
+
.radio-group__horizontal_m9mmb .radio-group__radioList_m9mmb {
|
|
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_m9mmb.radio-group__horizontal_m9mmb .radio-group__radioList_m9mmb {
|
|
55
55
|
margin-right: var(--gap-xs-neg);
|
|
56
56
|
}
|
|
57
|
-
.radio-
|
|
57
|
+
.radio-group__horizontal_m9mmb .radio-group__radio_m9mmb {
|
|
58
58
|
margin-right: var(--gap-xl);
|
|
59
59
|
margin-bottom: var(--gap-xs);
|
|
60
60
|
}
|
|
61
|
-
.radio-
|
|
61
|
+
.radio-group__horizontal_m9mmb .radio-group__tagLabel_m9mmb {
|
|
62
62
|
margin-right: var(--gap-xs);
|
|
63
63
|
}
|
|
64
|
-
.radio-
|
|
64
|
+
.radio-group__label_m9mmb {
|
|
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_m9mmb {
|
|
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_m9mmb {
|
|
78
78
|
color: var(--radio-group-error-color);
|
|
79
79
|
}
|
|
80
|
-
.radio-
|
|
80
|
+
.radio-group__hint_m9mmb {
|
|
81
81
|
color: var(--radio-group-hint-color);
|
|
82
82
|
}
|
|
83
|
-
.radio-
|
|
83
|
+
.radio-group__hiddenInput_m9mmb {
|
|
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_m9mmb {
|
|
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.4.0",
|
|
4
4
|
"description": "Radio group",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"classnames": "^2.2.6"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "7cae0fc3a5cd56dcb6468a786ba780cbb40d20fd"
|
|
26
26
|
}
|