@sb1/ffe-form-react 23.3.14 → 24.0.1
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/es/RadioBlock.js +2 -4
- package/es/RadioSwitch.js +2 -2
- package/lib/RadioBlock.js +2 -4
- package/lib/RadioSwitch.js +2 -2
- package/package.json +5 -5
package/es/RadioBlock.js
CHANGED
|
@@ -26,13 +26,11 @@ export var RadioBlock = React.forwardRef(function (_a, ref) {
|
|
|
26
26
|
var checked = _a.checked, children = _a.children, className = _a.className, label = _a.label, labelClass = _a.labelClass, name = _a.name, selectedValue = _a.selectedValue, showChildren = _a.showChildren, value = _a.value, inputProps = __rest(_a, ["checked", "children", "className", "label", "labelClass", "name", "selectedValue", "showChildren", "value"]);
|
|
27
27
|
var id = useId();
|
|
28
28
|
var isSelected = checked || selectedValue === value;
|
|
29
|
-
return (React.createElement("div", { className: classNames('ffe-radio-block', className) },
|
|
29
|
+
return (React.createElement("div", { className: classNames('ffe-radio-block', 'ffe-default-mode', className) },
|
|
30
30
|
React.createElement("input", __assign({ checked: isSelected, className: "ffe-radio-input", id: id, ref: ref, type: "radio", name: name, value: value, "aria-describedby": (children && showChildren) || (children && isSelected)
|
|
31
31
|
? "".concat(id, "-described")
|
|
32
32
|
: undefined }, inputProps)),
|
|
33
33
|
React.createElement("div", { className: "ffe-radio-block__content" },
|
|
34
34
|
React.createElement("label", { className: classNames('ffe-radio-block__header', labelClass), htmlFor: id }, label),
|
|
35
|
-
(isSelected || showChildren) && (React.createElement("div", { className: classNames('ffe-radio-block__wrapper',
|
|
36
|
-
'ffe-radio-block__wrapper--empty': !children,
|
|
37
|
-
}), id: "".concat(id, "-described") }, children)))));
|
|
35
|
+
(isSelected || showChildren) && children && (React.createElement("div", { className: classNames('ffe-radio-block__wrapper'), id: "".concat(id, "-described") }, children)))));
|
|
38
36
|
});
|
package/es/RadioSwitch.js
CHANGED
|
@@ -29,11 +29,11 @@ export var RadioSwitch = function (_a) {
|
|
|
29
29
|
selectedValue === undefined ||
|
|
30
30
|
selectedValue === '';
|
|
31
31
|
return (React.createElement(React.Fragment, null,
|
|
32
|
-
React.createElement(BaseRadioButton, __assign({ className: classNames('ffe-radio-switch', className, {
|
|
32
|
+
React.createElement(BaseRadioButton, __assign({ className: classNames('ffe-radio-switch', 'ffe-default-mode', className, {
|
|
33
33
|
'ffe-radio-switch--condensed': condensed,
|
|
34
34
|
}), value: leftValue, ref: leftInnerRef, "aria-invalid": ariaInvalid === 'true' &&
|
|
35
35
|
(selectedValue === leftValue || noneSelected), selectedValue: selectedValue }, rest), leftLabel),
|
|
36
|
-
React.createElement(BaseRadioButton, __assign({ className: classNames('ffe-radio-switch', className, {
|
|
36
|
+
React.createElement(BaseRadioButton, __assign({ className: classNames('ffe-radio-switch', 'ffe-default-mode', className, {
|
|
37
37
|
'ffe-radio-switch--condensed': condensed,
|
|
38
38
|
}), value: rightValue, ref: rightInnerRef, "aria-invalid": ariaInvalid === 'true' &&
|
|
39
39
|
(selectedValue === rightValue || noneSelected), selectedValue: selectedValue }, rest), rightLabel)));
|
package/lib/RadioBlock.js
CHANGED
|
@@ -65,13 +65,11 @@ exports.RadioBlock = react_1.default.forwardRef(function (_a, ref) {
|
|
|
65
65
|
var checked = _a.checked, children = _a.children, className = _a.className, label = _a.label, labelClass = _a.labelClass, name = _a.name, selectedValue = _a.selectedValue, showChildren = _a.showChildren, value = _a.value, inputProps = __rest(_a, ["checked", "children", "className", "label", "labelClass", "name", "selectedValue", "showChildren", "value"]);
|
|
66
66
|
var id = (0, react_1.useId)();
|
|
67
67
|
var isSelected = checked || selectedValue === value;
|
|
68
|
-
return (react_1.default.createElement("div", { className: (0, classnames_1.default)('ffe-radio-block', className) },
|
|
68
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)('ffe-radio-block', 'ffe-default-mode', className) },
|
|
69
69
|
react_1.default.createElement("input", __assign({ checked: isSelected, className: "ffe-radio-input", id: id, ref: ref, type: "radio", name: name, value: value, "aria-describedby": (children && showChildren) || (children && isSelected)
|
|
70
70
|
? "".concat(id, "-described")
|
|
71
71
|
: undefined }, inputProps)),
|
|
72
72
|
react_1.default.createElement("div", { className: "ffe-radio-block__content" },
|
|
73
73
|
react_1.default.createElement("label", { className: (0, classnames_1.default)('ffe-radio-block__header', labelClass), htmlFor: id }, label),
|
|
74
|
-
(isSelected || showChildren) && (react_1.default.createElement("div", { className: (0, classnames_1.default)('ffe-radio-block__wrapper',
|
|
75
|
-
'ffe-radio-block__wrapper--empty': !children,
|
|
76
|
-
}), id: "".concat(id, "-described") }, children)))));
|
|
74
|
+
(isSelected || showChildren) && children && (react_1.default.createElement("div", { className: (0, classnames_1.default)('ffe-radio-block__wrapper'), id: "".concat(id, "-described") }, children)))));
|
|
77
75
|
});
|
package/lib/RadioSwitch.js
CHANGED
|
@@ -35,11 +35,11 @@ var RadioSwitch = function (_a) {
|
|
|
35
35
|
selectedValue === undefined ||
|
|
36
36
|
selectedValue === '';
|
|
37
37
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
38
|
-
react_1.default.createElement(BaseRadioButton_1.BaseRadioButton, __assign({ className: (0, classnames_1.default)('ffe-radio-switch', className, {
|
|
38
|
+
react_1.default.createElement(BaseRadioButton_1.BaseRadioButton, __assign({ className: (0, classnames_1.default)('ffe-radio-switch', 'ffe-default-mode', className, {
|
|
39
39
|
'ffe-radio-switch--condensed': condensed,
|
|
40
40
|
}), value: leftValue, ref: leftInnerRef, "aria-invalid": ariaInvalid === 'true' &&
|
|
41
41
|
(selectedValue === leftValue || noneSelected), selectedValue: selectedValue }, rest), leftLabel),
|
|
42
|
-
react_1.default.createElement(BaseRadioButton_1.BaseRadioButton, __assign({ className: (0, classnames_1.default)('ffe-radio-switch', className, {
|
|
42
|
+
react_1.default.createElement(BaseRadioButton_1.BaseRadioButton, __assign({ className: (0, classnames_1.default)('ffe-radio-switch', 'ffe-default-mode', className, {
|
|
43
43
|
'ffe-radio-switch--condensed': condensed,
|
|
44
44
|
}), value: rightValue, ref: rightInnerRef, "aria-invalid": ariaInvalid === 'true' &&
|
|
45
45
|
(selectedValue === rightValue || noneSelected), selectedValue: selectedValue }, rest), rightLabel)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-form-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "24.0.1",
|
|
4
4
|
"description": "React component for form elements in ffe",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SpareBank 1",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"test:watch": "ffe-buildtool jest --watch"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@sb1/ffe-collapse-react": "^5.1.
|
|
29
|
-
"@sb1/ffe-form": "^
|
|
30
|
-
"@sb1/ffe-icons-react": "^12.0.
|
|
28
|
+
"@sb1/ffe-collapse-react": "^5.1.34",
|
|
29
|
+
"@sb1/ffe-form": "^33.0.1",
|
|
30
|
+
"@sb1/ffe-icons-react": "^12.0.6",
|
|
31
31
|
"classnames": "^2.3.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "05aefa08b5b370b2cd09e91cad288ff8c541a3f3"
|
|
46
46
|
}
|