@dxc-technology/halstack-react 0.0.0-d30020b → 0.0.0-d3554d7
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/ThemeContext.d.ts +4 -9
- package/ThemeContext.js +32 -32
- package/accordion/Accordion.test.js +57 -0
- package/accordion-group/AccordionGroup.test.js +133 -0
- package/alert/Alert.test.js +92 -0
- package/badge/Badge.d.ts +4 -0
- package/badge/types.d.ts +4 -0
- package/badge/types.js +5 -0
- package/box/Box.test.js +18 -0
- package/button/Button.test.js +35 -0
- package/card/Card.test.js +50 -0
- package/checkbox/Checkbox.test.js +65 -0
- package/chip/Chip.test.js +56 -0
- package/common/variables.js +0 -238
- package/date-input/DateInput.test.js +469 -0
- package/dialog/Dialog.test.js +40 -0
- package/dropdown/Dropdown.test.js +189 -0
- package/file-input/FileInput.test.js +457 -0
- package/footer/Footer.test.js +109 -0
- package/header/Header.test.js +63 -0
- package/heading/Heading.test.js +186 -0
- package/link/Link.test.js +91 -0
- package/main.d.ts +3 -6
- package/main.js +12 -36
- package/number-input/NumberInput.test.js +508 -0
- package/package.json +1 -1
- package/paginator/Paginator.test.js +266 -0
- package/password-input/PasswordInput.test.js +183 -0
- package/progress-bar/ProgressBar.test.js +65 -0
- package/radio/Radio.test.js +71 -0
- package/radio-group/Radio.d.ts +1 -1
- package/radio-group/Radio.js +24 -23
- package/radio-group/RadioGroup.js +38 -32
- package/radio-group/RadioGroup.stories.tsx +57 -40
- package/radio-group/RadioGroup.test.js +518 -72
- package/radio-group/types.d.ts +3 -2
- package/resultsetTable/ResultsetTable.test.js +306 -0
- package/select/Select.js +7 -1
- package/select/Select.stories.tsx +72 -62
- package/select/Select.test.js +1900 -0
- package/sidenav/Sidenav.test.js +56 -0
- package/slider/Slider.test.js +129 -0
- package/spinner/Spinner.test.js +64 -0
- package/switch/Switch.test.js +73 -0
- package/table/Table.test.js +26 -0
- package/tabs/Tabs.test.js +123 -0
- package/tag/Tag.test.js +60 -0
- package/text-input/TextInput.js +5 -3
- package/text-input/TextInput.stories.tsx +20 -2
- package/text-input/TextInput.test.js +1691 -0
- package/textarea/Textarea.js +5 -3
- package/textarea/Textarea.stories.jsx +30 -9
- package/textarea/Textarea.test.js +436 -0
- package/toggle-group/ToggleGroup.test.js +125 -0
- package/wizard/Wizard.test.js +128 -0
- package/V3Select/V3Select.js +0 -455
- package/V3Select/index.d.ts +0 -27
- package/V3Textarea/V3Textarea.js +0 -260
- package/V3Textarea/index.d.ts +0 -27
- package/date/Date.js +0 -373
- package/date/index.d.ts +0 -27
- package/input-text/Icons.js +0 -22
- package/input-text/InputText.js +0 -611
- package/input-text/index.d.ts +0 -36
- package/toggle/Toggle.js +0 -186
- package/toggle/index.d.ts +0 -21
- package/upload/Upload.js +0 -201
- package/upload/buttons-upload/ButtonsUpload.js +0 -111
- package/upload/buttons-upload/Icons.js +0 -40
- package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
- package/upload/dragAndDropArea/Icons.js +0 -39
- package/upload/file-upload/FileToUpload.js +0 -115
- package/upload/file-upload/Icons.js +0 -66
- package/upload/files-upload/FilesToUpload.js +0 -109
- package/upload/index.d.ts +0 -15
- package/upload/transaction/Icons.js +0 -160
- package/upload/transaction/Transaction.js +0 -104
- package/upload/transactions/Transactions.js +0 -94
package/radio-group/Radio.js
CHANGED
|
@@ -28,14 +28,16 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
28
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
29
|
|
|
30
30
|
var DxcRadio = function DxcRadio(_ref) {
|
|
31
|
+
var _option$disabled;
|
|
32
|
+
|
|
31
33
|
var option = _ref.option,
|
|
32
34
|
currentValue = _ref.currentValue,
|
|
33
|
-
|
|
34
|
-
onFocus = _ref.onFocus,
|
|
35
|
+
onClick = _ref.onClick,
|
|
35
36
|
error = _ref.error,
|
|
36
37
|
disabled = _ref.disabled,
|
|
37
38
|
focused = _ref.focused,
|
|
38
|
-
readonly = _ref.readonly
|
|
39
|
+
readonly = _ref.readonly,
|
|
40
|
+
tabIndex = _ref.tabIndex;
|
|
39
41
|
|
|
40
42
|
var _useState = (0, _react.useState)("radio-".concat((0, _uuid.v4)())),
|
|
41
43
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 1),
|
|
@@ -43,7 +45,13 @@ var DxcRadio = function DxcRadio(_ref) {
|
|
|
43
45
|
|
|
44
46
|
var ref = (0, _react.useRef)(null);
|
|
45
47
|
var colorsTheme = (0, _useTheme["default"])();
|
|
46
|
-
|
|
48
|
+
|
|
49
|
+
var handleOnClick = function handleOnClick() {
|
|
50
|
+
var _ref$current;
|
|
51
|
+
|
|
52
|
+
onClick();
|
|
53
|
+
focused && document.activeElement !== (ref === null || ref === void 0 ? void 0 : ref.current) && (ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus());
|
|
54
|
+
};
|
|
47
55
|
|
|
48
56
|
var _useState3 = (0, _react.useState)(true),
|
|
49
57
|
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
@@ -51,7 +59,7 @@ var DxcRadio = function DxcRadio(_ref) {
|
|
|
51
59
|
setFirstUpdate = _useState4[1];
|
|
52
60
|
|
|
53
61
|
(0, _react.useLayoutEffect)(function () {
|
|
54
|
-
var _ref$
|
|
62
|
+
var _ref$current2;
|
|
55
63
|
|
|
56
64
|
// Don't apply in the first render
|
|
57
65
|
if (firstUpdate) {
|
|
@@ -59,7 +67,7 @@ var DxcRadio = function DxcRadio(_ref) {
|
|
|
59
67
|
return;
|
|
60
68
|
}
|
|
61
69
|
|
|
62
|
-
focused && (ref === null || ref === void 0 ? void 0 : (_ref$
|
|
70
|
+
focused && (ref === null || ref === void 0 ? void 0 : (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.focus());
|
|
63
71
|
}, [focused]);
|
|
64
72
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
65
73
|
theme: colorsTheme.radioGroup
|
|
@@ -68,28 +76,21 @@ var DxcRadio = function DxcRadio(_ref) {
|
|
|
68
76
|
disabled: disabled,
|
|
69
77
|
readonly: readonly,
|
|
70
78
|
onMouseDown: function onMouseDown(event) {
|
|
71
|
-
// Prevents div's
|
|
79
|
+
// Prevents div's onClick from stealing the radio input's focus
|
|
72
80
|
event.preventDefault();
|
|
73
81
|
},
|
|
74
|
-
onClick:
|
|
75
|
-
var _ref$current2;
|
|
76
|
-
|
|
77
|
-
ref === null || ref === void 0 ? void 0 : (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.focus();
|
|
78
|
-
|
|
79
|
-
_onClick();
|
|
80
|
-
}
|
|
82
|
+
onClick: handleOnClick
|
|
81
83
|
}, /*#__PURE__*/_react["default"].createElement(RadioInputContainer, null, /*#__PURE__*/_react["default"].createElement(RadioInput, {
|
|
82
84
|
error: error,
|
|
83
85
|
disabled: disabled,
|
|
84
86
|
readonly: readonly,
|
|
85
|
-
onFocus: onFocus,
|
|
86
87
|
role: "radio",
|
|
87
|
-
"aria-checked":
|
|
88
|
-
"aria-disabled": option.disabled,
|
|
88
|
+
"aria-checked": option.value === currentValue,
|
|
89
|
+
"aria-disabled": (_option$disabled = option.disabled) !== null && _option$disabled !== void 0 ? _option$disabled : false,
|
|
89
90
|
"aria-labelledby": radioLabelId,
|
|
90
|
-
tabIndex: disabled ? -1 : focused ?
|
|
91
|
+
tabIndex: disabled ? -1 : focused ? tabIndex : -1,
|
|
91
92
|
ref: ref
|
|
92
|
-
},
|
|
93
|
+
}, option.value === currentValue && /*#__PURE__*/_react["default"].createElement(Dot, {
|
|
93
94
|
disabled: disabled,
|
|
94
95
|
readonly: readonly,
|
|
95
96
|
error: error
|
|
@@ -101,18 +102,18 @@ var DxcRadio = function DxcRadio(_ref) {
|
|
|
101
102
|
|
|
102
103
|
var RadioMainContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n"])));
|
|
103
104
|
|
|
104
|
-
var RadioContainer = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: center;\n cursor: ", ";\n
|
|
105
|
+
var RadioContainer = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: center;\n cursor: ", ";\n\n ", "\n"])), function (props) {
|
|
105
106
|
return props.disabled ? "not-allowed" : props.readonly ? "default" : "pointer";
|
|
106
107
|
}, function (props) {
|
|
107
|
-
return !props.disabled
|
|
108
|
+
return !props.disabled ? "\n &:hover {\n & > div > div { \n border-color: ".concat(props.error ? props.theme.hoverErrorRadioInputColor : props.readonly ? props.theme.hoverReadonlyRadioInputColor : props.theme.hoverRadioInputColor, ";\n & > span {\n background-color: ").concat(props.error ? props.theme.hoverErrorRadioInputColor : props.readonly ? props.theme.hoverReadonlyRadioInputColor : props.theme.hoverRadioInputColor, ";\n }\n };\n }\n &:active {\n & > div > div {\n border-color: ").concat(props.error ? props.theme.activeErrorRadioInputColor : props.readonly ? props.theme.activeReadonlyRadioInputColor : props.theme.activeRadioInputColor, ";\n & > span {\n background-color: ").concat(props.error ? props.theme.activeErrorRadioInputColor : props.readonly ? props.theme.activeReadonlyRadioInputColor : props.theme.activeRadioInputColor, ";\n }\n }\n }\n ") : "pointer-events: none;";
|
|
108
109
|
});
|
|
109
110
|
|
|
110
111
|
var RadioInputContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: 24px;\n width: 24px;\n"])));
|
|
111
112
|
|
|
112
|
-
var RadioInput = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: 18px;\n height: 18px;\n border: 2px solid\n ", ";\n border-radius: 50%;\n
|
|
113
|
+
var RadioInput = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: 18px;\n height: 18px;\n border: 2px solid\n ", ";\n border-radius: 50%;\n\n ", "\n"])), function (props) {
|
|
113
114
|
if (props.disabled) return props.theme.disabledRadioInputColor;else if (props.error) return props.theme.errorRadioInputColor;else if (props.readonly) return props.theme.readonlyRadioInputColor;else return props.theme.radioInputColor;
|
|
114
115
|
}, function (props) {
|
|
115
|
-
return !props.disabled ? "&:focus {\n outline: 2px solid ".concat(props.theme.focusBorderColor, ";\n outline-offset: 1px;\n }\n &:focus-visible {\n outline: 2px solid ").concat(props.theme.focusBorderColor, ";\n outline-offset: 1px;\n }\n ") : "\n
|
|
116
|
+
return !props.disabled ? "&:focus {\n outline: 2px solid ".concat(props.theme.focusBorderColor, ";\n outline-offset: 1px;\n }\n &:focus-visible {\n outline: 2px solid ").concat(props.theme.focusBorderColor, ";\n outline-offset: 1px;\n }\n ") : "\n :focus-visible {\n outline: none;\n }\n ";
|
|
116
117
|
});
|
|
117
118
|
|
|
118
119
|
var Dot = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n height: 10px;\n width: 10px;\n border-radius: 50%;\n background-color: ", ";\n"])), function (props) {
|
|
@@ -57,7 +57,9 @@ var DxcRadioGroup = /*#__PURE__*/_react["default"].forwardRef(function (_ref, re
|
|
|
57
57
|
value = _ref.value,
|
|
58
58
|
onChange = _ref.onChange,
|
|
59
59
|
onBlur = _ref.onBlur,
|
|
60
|
-
error = _ref.error
|
|
60
|
+
error = _ref.error,
|
|
61
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
62
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
61
63
|
|
|
62
64
|
var _useState = (0, _react.useState)("radio-group-".concat((0, _uuid.v4)())),
|
|
63
65
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 1),
|
|
@@ -102,42 +104,46 @@ var DxcRadioGroup = /*#__PURE__*/_react["default"].forwardRef(function (_ref, re
|
|
|
102
104
|
|
|
103
105
|
var handleOnBlur = function handleOnBlur(e) {
|
|
104
106
|
// If the radio group loses the focus to an element not contained inside it...
|
|
105
|
-
!e.currentTarget.contains(e.relatedTarget)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
108
|
+
setFirstTimeFocus(true);
|
|
109
|
+
var currentValue = value !== null && value !== void 0 ? value : innerValue;
|
|
110
|
+
!optional && !Boolean(currentValue) ? onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
111
|
+
value: currentValue,
|
|
112
|
+
error: "This field is required. Please, choose an option."
|
|
113
|
+
}) : onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
114
|
+
value: currentValue
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
var handleOnFocus = function handleOnFocus() {
|
|
120
|
+
firstTimeFocus && setFirstTimeFocus(false);
|
|
113
121
|
};
|
|
114
122
|
|
|
115
123
|
var setPreviousRadioChecked = function setPreviousRadioChecked() {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
var index = currentFocusIndex === 0 ? innerOptions.length - 1 : currentFocusIndex - 1;
|
|
124
|
+
setCurrentFocusIndex(function (currentFocusIndex) {
|
|
125
|
+
var index = currentFocusIndex === 0 ? innerOptions.length - 1 : currentFocusIndex - 1;
|
|
119
126
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
127
|
+
while (innerOptions[index].disabled) {
|
|
128
|
+
index = index === 0 ? innerOptions.length - 1 : index - 1;
|
|
129
|
+
}
|
|
123
130
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
131
|
+
handleOnChange(innerOptions[index].value);
|
|
132
|
+
return index;
|
|
133
|
+
});
|
|
127
134
|
};
|
|
128
135
|
|
|
129
136
|
var setNextRadioChecked = function setNextRadioChecked() {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
var index = currentFocusIndex === innerOptions.length - 1 ? 0 : currentFocusIndex + 1;
|
|
137
|
+
setCurrentFocusIndex(function (currentFocusIndex) {
|
|
138
|
+
var index = currentFocusIndex === innerOptions.length - 1 ? 0 : currentFocusIndex + 1;
|
|
133
139
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
140
|
+
while (innerOptions[index].disabled) {
|
|
141
|
+
index = index === innerOptions.length - 1 ? 0 : index + 1;
|
|
142
|
+
}
|
|
137
143
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
144
|
+
handleOnChange(innerOptions[index].value);
|
|
145
|
+
return index;
|
|
146
|
+
});
|
|
141
147
|
};
|
|
142
148
|
|
|
143
149
|
var handleOnKeyDown = function handleOnKeyDown(event) {
|
|
@@ -180,6 +186,7 @@ var DxcRadioGroup = /*#__PURE__*/_react["default"].forwardRef(function (_ref, re
|
|
|
180
186
|
disabled: disabled
|
|
181
187
|
}, helperText), /*#__PURE__*/_react["default"].createElement(RadioGroup, {
|
|
182
188
|
onBlur: handleOnBlur,
|
|
189
|
+
onFocus: handleOnFocus,
|
|
183
190
|
onKeyDown: handleOnKeyDown,
|
|
184
191
|
stacking: stacking,
|
|
185
192
|
role: "radiogroup",
|
|
@@ -187,7 +194,8 @@ var DxcRadioGroup = /*#__PURE__*/_react["default"].forwardRef(function (_ref, re
|
|
|
187
194
|
"aria-labelledby": radioGroupLabelId,
|
|
188
195
|
"aria-invalid": error ? "true" : "false",
|
|
189
196
|
"aria-errormessage": error ? errorId : undefined,
|
|
190
|
-
"aria-required": !optional
|
|
197
|
+
"aria-required": !disabled && !readonly && !optional,
|
|
198
|
+
"aria-readonly": readonly
|
|
191
199
|
}, /*#__PURE__*/_react["default"].createElement(ValueInput, {
|
|
192
200
|
name: name,
|
|
193
201
|
value: value !== null && value !== void 0 ? value : innerValue,
|
|
@@ -201,13 +209,11 @@ var DxcRadioGroup = /*#__PURE__*/_react["default"].forwardRef(function (_ref, re
|
|
|
201
209
|
handleOnChange(option.value);
|
|
202
210
|
setCurrentFocusIndex(index);
|
|
203
211
|
},
|
|
204
|
-
onFocus: function onFocus() {
|
|
205
|
-
!firstTimeFocus ? handleOnChange(option.value) : setFirstTimeFocus(false);
|
|
206
|
-
},
|
|
207
212
|
error: error,
|
|
208
213
|
disabled: option.disabled || disabled,
|
|
209
214
|
focused: currentFocusIndex === index,
|
|
210
|
-
readonly: readonly
|
|
215
|
+
readonly: readonly,
|
|
216
|
+
tabIndex: tabIndex
|
|
211
217
|
});
|
|
212
218
|
})), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
|
|
213
219
|
id: errorId,
|
|
@@ -7,6 +7,8 @@ export default {
|
|
|
7
7
|
component: DxcRadioGroup,
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
+
const single_option = [{ label: "Option A", value: "A" }];
|
|
11
|
+
|
|
10
12
|
const options = [
|
|
11
13
|
{ label: "Option 1", value: "1" },
|
|
12
14
|
{ label: "Option 2", value: "2" },
|
|
@@ -14,66 +16,81 @@ const options = [
|
|
|
14
16
|
{ label: "Option 4", value: "4" },
|
|
15
17
|
];
|
|
16
18
|
|
|
17
|
-
const single_disabled_options = [
|
|
18
|
-
{ label: "Option 1", value: "1" },
|
|
19
|
-
{ label: "Option 2", value: "2", disabled: true },
|
|
20
|
-
{ label: "Option 3", value: "3" },
|
|
21
|
-
];
|
|
19
|
+
const single_disabled_options = [{ label: "Option A", value: "A", disabled: true }];
|
|
22
20
|
|
|
23
21
|
export const Chromatic = () => (
|
|
24
22
|
<>
|
|
23
|
+
<Title title="Radio input states" theme="light" level={2} />
|
|
25
24
|
<ExampleContainer>
|
|
26
|
-
<Title title="
|
|
27
|
-
<DxcRadioGroup label="Example
|
|
25
|
+
<Title title="Enabled" theme="light" level={4} />
|
|
26
|
+
<DxcRadioGroup label="Example" defaultValue="A" options={single_option} />
|
|
27
|
+
</ExampleContainer>
|
|
28
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
29
|
+
<Title title="Hovered" theme="light" level={4} />
|
|
30
|
+
<DxcRadioGroup label="Example" defaultValue="A" options={single_option} />
|
|
31
|
+
</ExampleContainer>
|
|
32
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
33
|
+
<Title title="Active" theme="light" level={4} />
|
|
34
|
+
<DxcRadioGroup label="Example" defaultValue="A" options={single_option} />
|
|
35
|
+
</ExampleContainer>
|
|
36
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
37
|
+
<Title title="Focused" theme="light" level={4} />
|
|
38
|
+
<DxcRadioGroup label="Example" defaultValue="A" options={single_option} />
|
|
28
39
|
</ExampleContainer>
|
|
29
40
|
<ExampleContainer>
|
|
30
|
-
<Title title="
|
|
31
|
-
<DxcRadioGroup label="Example"
|
|
41
|
+
<Title title="Disabled" theme="light" level={4} />
|
|
42
|
+
<DxcRadioGroup label="Example" options={single_disabled_options} defaultValue="A" />
|
|
32
43
|
</ExampleContainer>
|
|
44
|
+
<Title title="Readonly radio input sub-states" theme="light" level={3} />
|
|
33
45
|
<ExampleContainer>
|
|
34
|
-
<Title title="
|
|
35
|
-
<DxcRadioGroup label="Example"
|
|
46
|
+
<Title title="Enabled" theme="light" level={4} />
|
|
47
|
+
<DxcRadioGroup label="Example" options={single_option} defaultValue="A" readonly />
|
|
48
|
+
</ExampleContainer>
|
|
49
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
50
|
+
<Title title="Hovered" theme="light" level={4} />
|
|
51
|
+
<DxcRadioGroup label="Example" options={single_option} defaultValue="A" readonly />
|
|
52
|
+
</ExampleContainer>
|
|
53
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
54
|
+
<Title title="Active" theme="light" level={4} />
|
|
55
|
+
<DxcRadioGroup label="Example" options={single_option} defaultValue="A" readonly />
|
|
36
56
|
</ExampleContainer>
|
|
57
|
+
<Title title="Error radio input sub-states" theme="light" level={3} />
|
|
37
58
|
<ExampleContainer>
|
|
38
|
-
<Title title="
|
|
39
|
-
<DxcRadioGroup
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
disabled
|
|
45
|
-
optional
|
|
46
|
-
defaultValue="2"
|
|
47
|
-
/>
|
|
59
|
+
<Title title="Enabled" theme="light" level={4} />
|
|
60
|
+
<DxcRadioGroup label="Example" options={single_option} defaultValue="A" error="Error message" />
|
|
61
|
+
</ExampleContainer>
|
|
62
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
63
|
+
<Title title="Hovered" theme="light" level={4} />
|
|
64
|
+
<DxcRadioGroup label="Example" options={single_option} defaultValue="A" readonly error="Error message" />
|
|
48
65
|
</ExampleContainer>
|
|
66
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
67
|
+
<Title title="Active" theme="light" level={4} />
|
|
68
|
+
<DxcRadioGroup label="Example" options={single_option} defaultValue="A" readonly error="Error message" />
|
|
69
|
+
</ExampleContainer>
|
|
70
|
+
<Title title="Variants" theme="light" level={2} />
|
|
49
71
|
<ExampleContainer>
|
|
50
|
-
<Title title="
|
|
51
|
-
<DxcRadioGroup label="
|
|
72
|
+
<Title title="Column" theme="light" level={4} />
|
|
73
|
+
<DxcRadioGroup label="Example" helperText="Helper text" options={options} />
|
|
74
|
+
</ExampleContainer>
|
|
75
|
+
<ExampleContainer>
|
|
76
|
+
<Title title="Row" theme="light" level={4} />
|
|
77
|
+
<DxcRadioGroup label="Example" helperText="Helper text" options={options} stacking="row" />
|
|
52
78
|
</ExampleContainer>
|
|
53
79
|
<ExampleContainer>
|
|
54
80
|
<Title title="Optional" theme="light" level={4} />
|
|
55
|
-
<DxcRadioGroup
|
|
56
|
-
label="Example"
|
|
57
|
-
optionalItemLabel="No selection"
|
|
58
|
-
optional
|
|
59
|
-
helperText="Helper text"
|
|
60
|
-
options={options}
|
|
61
|
-
stacking="row"
|
|
62
|
-
/>
|
|
81
|
+
<DxcRadioGroup label="Example" optional helperText="Helper text" options={options} stacking="row" />
|
|
63
82
|
</ExampleContainer>
|
|
64
83
|
<ExampleContainer>
|
|
65
|
-
<Title title="
|
|
66
|
-
<DxcRadioGroup
|
|
67
|
-
label="Example"
|
|
68
|
-
error="Error message"
|
|
69
|
-
helperText="Helper text"
|
|
70
|
-
options={options}
|
|
71
|
-
defaultValue="2"
|
|
72
|
-
/>
|
|
84
|
+
<Title title="Disabled" theme="light" level={4} />
|
|
85
|
+
<DxcRadioGroup label="Example" helperText="Helper text" options={options} disabled />
|
|
73
86
|
</ExampleContainer>
|
|
74
87
|
<ExampleContainer>
|
|
75
88
|
<Title title="Readonly" theme="light" level={4} />
|
|
76
|
-
<DxcRadioGroup label="Example" readonly helperText="Helper text" options={options}
|
|
89
|
+
<DxcRadioGroup label="Example" readonly helperText="Helper text" options={options} />
|
|
90
|
+
</ExampleContainer>
|
|
91
|
+
<ExampleContainer>
|
|
92
|
+
<Title title="Error" theme="light" level={4} />
|
|
93
|
+
<DxcRadioGroup label="Example" error="Error message" helperText="Helper text" options={options} />
|
|
77
94
|
</ExampleContainer>
|
|
78
95
|
</>
|
|
79
96
|
);
|