@dxc-technology/halstack-react 0.0.0-c593452 → 0.0.0-c680086
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/BackgroundColorContext.d.ts +10 -0
- package/BackgroundColorContext.js +1 -4
- package/ThemeContext.d.ts +15 -0
- package/ThemeContext.js +5 -8
- package/V3Select/V3Select.js +2 -2
- package/V3Textarea/V3Textarea.js +2 -2
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +11 -22
- package/accordion/Accordion.stories.tsx +307 -0
- package/accordion/types.d.ts +4 -8
- package/accordion-group/AccordionGroup.js +2 -2
- package/accordion-group/AccordionGroup.stories.tsx +225 -0
- package/accordion-group/types.d.ts +4 -8
- package/alert/Alert.js +2 -2
- package/alert/Alert.stories.tsx +170 -0
- package/alert/types.d.ts +1 -1
- package/badge/Badge.js +1 -1
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +84 -0
- package/bleed/Bleed.stories.tsx +342 -0
- package/bleed/types.d.ts +13 -0
- package/bleed/types.js +5 -0
- package/box/Box.d.ts +4 -0
- package/box/Box.js +6 -32
- package/box/Box.stories.tsx +132 -0
- package/box/types.d.ts +43 -0
- package/box/types.js +5 -0
- package/button/Button.d.ts +1 -1
- package/button/Button.js +15 -26
- package/button/Button.stories.tsx +223 -242
- package/button/types.d.ts +9 -13
- package/card/Card.js +5 -6
- package/card/Card.stories.tsx +201 -0
- package/card/ice-cream.jpg +0 -0
- package/card/types.d.ts +4 -6
- package/checkbox/Checkbox.js +2 -2
- package/checkbox/Checkbox.stories.tsx +192 -0
- package/checkbox/types.d.ts +2 -2
- package/chip/Chip.d.ts +4 -0
- package/chip/Chip.js +16 -76
- package/chip/Chip.stories.tsx +119 -0
- package/chip/types.d.ts +45 -0
- package/chip/types.js +5 -0
- package/common/variables.js +86 -44
- package/date/Date.js +1 -1
- package/date-input/DateInput.js +10 -13
- package/date-input/DateInput.stories.tsx +138 -0
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +8 -26
- package/dialog/Dialog.stories.tsx +212 -0
- package/dialog/types.d.ts +43 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +1 -1
- package/dropdown/Dropdown.js +13 -35
- package/dropdown/Dropdown.stories.tsx +249 -0
- package/dropdown/types.d.ts +6 -15
- package/file-input/FileInput.d.ts +4 -0
- package/file-input/FileInput.js +167 -109
- package/file-input/FileInput.stories.tsx +507 -0
- package/file-input/FileItem.d.ts +14 -0
- package/file-input/FileItem.js +12 -21
- package/file-input/types.d.ts +112 -0
- package/file-input/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +31 -70
- package/footer/Footer.stories.tsx +130 -0
- package/footer/Icons.d.ts +2 -0
- package/footer/Icons.js +3 -3
- package/footer/types.d.ts +65 -0
- package/footer/types.js +5 -0
- package/header/Header.d.ts +7 -0
- package/header/Header.js +28 -30
- package/header/Header.stories.tsx +162 -0
- package/header/Icons.d.ts +2 -0
- package/header/Icons.js +2 -27
- package/header/types.d.ts +47 -0
- package/header/types.js +5 -0
- package/heading/Heading.d.ts +4 -0
- package/heading/Heading.js +7 -24
- package/heading/Heading.stories.tsx +54 -0
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -0
- package/input-text/InputText.js +2 -2
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +84 -0
- package/inset/Inset.stories.tsx +229 -0
- package/inset/types.d.ts +13 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.d.ts +10 -0
- package/layout/ApplicationLayout.js +9 -19
- package/layout/ApplicationLayout.stories.tsx +171 -0
- package/layout/types.d.ts +57 -0
- package/layout/types.js +5 -0
- package/link/Link.d.ts +3 -0
- package/link/Link.js +10 -40
- package/link/Link.stories.tsx +151 -0
- package/link/types.d.ts +70 -0
- package/link/types.js +5 -0
- package/list/List.d.ts +4 -0
- package/list/List.js +47 -0
- package/list/List.stories.tsx +95 -0
- package/list/types.d.ts +7 -0
- package/list/types.js +5 -0
- package/main.d.ts +8 -3
- package/main.js +42 -2
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +5 -50
- package/number-input/NumberInput.stories.tsx +115 -0
- package/number-input/NumberInputContext.d.ts +4 -0
- package/number-input/NumberInputContext.js +5 -2
- package/number-input/numberInputContextTypes.d.ts +19 -0
- package/number-input/numberInputContextTypes.js +5 -0
- package/number-input/types.d.ts +117 -0
- package/number-input/types.js +5 -0
- package/package.json +4 -2
- package/paginator/Paginator.js +2 -8
- package/paginator/Paginator.stories.tsx +63 -0
- package/password-input/PasswordInput.d.ts +4 -0
- package/password-input/PasswordInput.js +19 -55
- package/password-input/{PasswordInput.stories.jsx → PasswordInput.stories.tsx} +4 -4
- package/password-input/types.d.ts +107 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.js +5 -5
- package/progress-bar/ProgressBar.stories.jsx +58 -0
- package/radio/Radio.js +2 -2
- package/radio/Radio.stories.tsx +192 -0
- package/radio/types.d.ts +2 -2
- package/radio-group/Radio.d.ts +4 -0
- package/radio-group/Radio.js +140 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +273 -0
- package/radio-group/RadioGroup.stories.tsx +79 -0
- package/radio-group/RadioGroup.test.js +248 -0
- package/radio-group/types.d.ts +36 -0
- package/radio-group/types.js +5 -0
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/resultsetTable/ResultsetTable.js +9 -29
- package/resultsetTable/ResultsetTable.stories.tsx +275 -0
- package/resultsetTable/types.d.ts +67 -0
- package/resultsetTable/types.js +5 -0
- package/row/Row.d.ts +3 -0
- package/row/Row.js +127 -0
- package/row/Row.stories.tsx +237 -0
- package/row/types.d.ts +10 -0
- package/row/types.js +5 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +20 -22
- package/select/Select.stories.tsx +572 -0
- package/select/types.d.ts +170 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.d.ts +9 -0
- package/sidenav/Sidenav.js +6 -15
- package/sidenav/Sidenav.stories.tsx +182 -0
- package/sidenav/types.d.ts +50 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +1 -1
- package/slider/Slider.js +43 -32
- package/slider/Slider.stories.tsx +177 -0
- package/slider/types.d.ts +2 -7
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +8 -25
- package/spinner/Spinner.stories.jsx +103 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/stack/Stack.d.ts +3 -0
- package/stack/Stack.js +97 -0
- package/stack/Stack.stories.tsx +164 -0
- package/stack/types.d.ts +9 -0
- package/stack/types.js +5 -0
- package/switch/Switch.js +4 -4
- package/switch/Switch.stories.tsx +160 -0
- package/table/Table.d.ts +4 -0
- package/table/Table.js +3 -3
- package/table/Table.stories.jsx +277 -0
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tabs/Tabs.js +11 -9
- package/tabs/Tabs.stories.tsx +120 -0
- package/tabs/types.d.ts +25 -18
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +26 -46
- package/tag/Tag.stories.tsx +138 -0
- package/tag/types.d.ts +69 -0
- package/tag/types.js +5 -0
- package/text/Text.d.ts +7 -0
- package/text/Text.js +30 -0
- package/text/Text.stories.tsx +19 -0
- package/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +54 -85
- package/text-input/TextInput.stories.tsx +456 -0
- package/text-input/types.d.ts +159 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.d.ts +4 -0
- package/textarea/Textarea.js +27 -60
- package/textarea/Textarea.stories.jsx +4 -3
- package/textarea/types.d.ts +130 -0
- package/textarea/types.js +5 -0
- package/toggle/Toggle.js +1 -1
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/toggle-group/ToggleGroup.js +16 -45
- package/toggle-group/ToggleGroup.stories.tsx +173 -0
- package/toggle-group/types.d.ts +97 -0
- package/toggle-group/types.js +5 -0
- package/upload/buttons-upload/ButtonsUpload.js +2 -2
- package/upload/dragAndDropArea/DragAndDropArea.js +2 -2
- package/upload/file-upload/FileToUpload.js +1 -1
- package/upload/files-upload/FilesToUpload.js +1 -1
- package/upload/transaction/Transaction.js +2 -2
- package/upload/transactions/Transactions.js +1 -1
- package/useTheme.d.ts +2 -0
- package/useTheme.js +1 -1
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +69 -59
- package/wizard/Wizard.stories.tsx +224 -0
- package/wizard/types.d.ts +60 -0
- package/wizard/types.js +5 -0
- package/box/index.d.ts +0 -25
- package/chip/index.d.ts +0 -22
- package/dialog/index.d.ts +0 -18
- package/file-input/index.d.ts +0 -81
- package/footer/index.d.ts +0 -25
- package/header/index.d.ts +0 -25
- package/heading/index.d.ts +0 -17
- package/link/index.d.ts +0 -23
- package/number-input/index.d.ts +0 -113
- package/password-input/index.d.ts +0 -94
- package/resultsetTable/index.d.ts +0 -19
- package/select/index.d.ts +0 -131
- package/sidenav/index.d.ts +0 -13
- package/spinner/index.d.ts +0 -17
- package/table/index.d.ts +0 -13
- package/tag/index.d.ts +0 -24
- package/text-input/index.d.ts +0 -135
- package/textarea/index.d.ts +0 -117
- package/toggle-group/index.d.ts +0 -21
- package/wizard/Icons.js +0 -65
- package/wizard/index.d.ts +0 -18
|
@@ -9,8 +9,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports["default"] = void 0;
|
|
11
11
|
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
13
|
|
|
16
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -19,12 +17,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
19
17
|
|
|
20
18
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
21
19
|
|
|
22
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
|
-
|
|
24
20
|
var _TextInput = _interopRequireDefault(require("../text-input/TextInput"));
|
|
25
21
|
|
|
26
|
-
var _variables = require("../common/variables.js");
|
|
27
|
-
|
|
28
22
|
var _templateObject;
|
|
29
23
|
|
|
30
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -32,21 +26,19 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
32
26
|
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; }
|
|
33
27
|
|
|
34
28
|
var DxcPasswordInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
35
|
-
var
|
|
36
|
-
label = _ref$label === void 0 ? "" : _ref$label,
|
|
29
|
+
var label = _ref.label,
|
|
37
30
|
_ref$name = _ref.name,
|
|
38
31
|
name = _ref$name === void 0 ? "" : _ref$name,
|
|
39
32
|
value = _ref.value,
|
|
40
|
-
|
|
41
|
-
helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
|
|
33
|
+
helperText = _ref.helperText,
|
|
42
34
|
_ref$clearable = _ref.clearable,
|
|
43
35
|
clearable = _ref$clearable === void 0 ? false : _ref$clearable,
|
|
44
36
|
onChange = _ref.onChange,
|
|
45
37
|
onBlur = _ref.onBlur,
|
|
46
|
-
|
|
47
|
-
error = _ref$error === void 0 ? "" : _ref$error,
|
|
38
|
+
error = _ref.error,
|
|
48
39
|
pattern = _ref.pattern,
|
|
49
|
-
|
|
40
|
+
minLength = _ref.minLength,
|
|
41
|
+
maxLength = _ref.maxLength,
|
|
50
42
|
_ref$autocomplete = _ref.autocomplete,
|
|
51
43
|
autocomplete = _ref$autocomplete === void 0 ? "off" : _ref$autocomplete,
|
|
52
44
|
margin = _ref.margin,
|
|
@@ -65,25 +57,27 @@ var DxcPasswordInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref,
|
|
|
65
57
|
var setInputType = function setInputType(type) {
|
|
66
58
|
var _inputRef$current, _inputRef$current$chi;
|
|
67
59
|
|
|
68
|
-
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : (_inputRef$current$chi = _inputRef$current.children[2]) === null || _inputRef$current$chi === void 0 ? void 0 : _inputRef$current$chi.children[0].setAttribute("type", type);
|
|
60
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : (_inputRef$current$chi = _inputRef$current.children[label && helperText ? 2 : label || helperText ? 1 : 0]) === null || _inputRef$current$chi === void 0 ? void 0 : _inputRef$current$chi.children[0].setAttribute("type", type);
|
|
69
61
|
};
|
|
70
62
|
|
|
71
63
|
var setAriaAttributes = function setAriaAttributes(ariaExpanded, ariaLabel) {
|
|
64
|
+
var inputIndex = label && helperText ? 2 : label || helperText ? 1 : 0;
|
|
65
|
+
|
|
72
66
|
if (error && clearable && value) {
|
|
73
67
|
var _inputRef$current2, _inputRef$current2$ch, _inputRef$current2$ch2, _inputRef$current3, _inputRef$current3$ch, _inputRef$current3$ch2;
|
|
74
68
|
|
|
75
|
-
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : (_inputRef$current2$ch = _inputRef$current2.children[
|
|
76
|
-
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : (_inputRef$current3$ch = _inputRef$current3.children[
|
|
69
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : (_inputRef$current2$ch = _inputRef$current2.children[inputIndex]) === null || _inputRef$current2$ch === void 0 ? void 0 : (_inputRef$current2$ch2 = _inputRef$current2$ch.children[3]) === null || _inputRef$current2$ch2 === void 0 ? void 0 : _inputRef$current2$ch2.setAttribute("aria-expanded", ariaExpanded);
|
|
70
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : (_inputRef$current3$ch = _inputRef$current3.children[inputIndex]) === null || _inputRef$current3$ch === void 0 ? void 0 : (_inputRef$current3$ch2 = _inputRef$current3$ch.children[3]) === null || _inputRef$current3$ch2 === void 0 ? void 0 : _inputRef$current3$ch2.setAttribute("aria-label", ariaLabel);
|
|
77
71
|
} else if (error || clearable && !value) {
|
|
78
72
|
var _inputRef$current4, _inputRef$current4$ch, _inputRef$current4$ch2, _inputRef$current5, _inputRef$current5$ch, _inputRef$current5$ch2;
|
|
79
73
|
|
|
80
|
-
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : (_inputRef$current4$ch = _inputRef$current4.children[
|
|
81
|
-
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 ? void 0 : (_inputRef$current5$ch = _inputRef$current5.children[
|
|
74
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : (_inputRef$current4$ch = _inputRef$current4.children[inputIndex]) === null || _inputRef$current4$ch === void 0 ? void 0 : (_inputRef$current4$ch2 = _inputRef$current4$ch.children[2]) === null || _inputRef$current4$ch2 === void 0 ? void 0 : _inputRef$current4$ch2.setAttribute("aria-expanded", ariaExpanded);
|
|
75
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 ? void 0 : (_inputRef$current5$ch = _inputRef$current5.children[inputIndex]) === null || _inputRef$current5$ch === void 0 ? void 0 : (_inputRef$current5$ch2 = _inputRef$current5$ch.children[2]) === null || _inputRef$current5$ch2 === void 0 ? void 0 : _inputRef$current5$ch2.setAttribute("aria-label", ariaLabel);
|
|
82
76
|
} else {
|
|
83
77
|
var _inputRef$current6, _inputRef$current6$ch, _inputRef$current6$ch2, _inputRef$current7, _inputRef$current7$ch, _inputRef$current7$ch2;
|
|
84
78
|
|
|
85
|
-
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current6 = inputRef.current) === null || _inputRef$current6 === void 0 ? void 0 : (_inputRef$current6$ch = _inputRef$current6.children[
|
|
86
|
-
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current7 = inputRef.current) === null || _inputRef$current7 === void 0 ? void 0 : (_inputRef$current7$ch = _inputRef$current7.children[
|
|
79
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current6 = inputRef.current) === null || _inputRef$current6 === void 0 ? void 0 : (_inputRef$current6$ch = _inputRef$current6.children[inputIndex]) === null || _inputRef$current6$ch === void 0 ? void 0 : (_inputRef$current6$ch2 = _inputRef$current6$ch.children[1]) === null || _inputRef$current6$ch2 === void 0 ? void 0 : _inputRef$current6$ch2.setAttribute("aria-expanded", ariaExpanded);
|
|
80
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current7 = inputRef.current) === null || _inputRef$current7 === void 0 ? void 0 : (_inputRef$current7$ch = _inputRef$current7.children[inputIndex]) === null || _inputRef$current7$ch === void 0 ? void 0 : (_inputRef$current7$ch2 = _inputRef$current7$ch.children[1]) === null || _inputRef$current7$ch2 === void 0 ? void 0 : _inputRef$current7$ch2.setAttribute("aria-label", ariaLabel);
|
|
87
81
|
}
|
|
88
82
|
};
|
|
89
83
|
|
|
@@ -92,14 +86,14 @@ var DxcPasswordInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref,
|
|
|
92
86
|
};
|
|
93
87
|
|
|
94
88
|
(0, _react.useEffect)(function () {
|
|
95
|
-
setAriaAttributes(false, "Show");
|
|
89
|
+
setAriaAttributes(false, "Show password");
|
|
96
90
|
|
|
97
91
|
if (isPasswordVisible) {
|
|
98
92
|
setInputType("text");
|
|
99
|
-
setAriaAttributes(true, "Hide");
|
|
93
|
+
setAriaAttributes(true, "Hide password");
|
|
100
94
|
} else {
|
|
101
95
|
setInputType("password");
|
|
102
|
-
setAriaAttributes(false, "Show");
|
|
96
|
+
setAriaAttributes(false, "Show password");
|
|
103
97
|
}
|
|
104
98
|
}, [isPasswordVisible]);
|
|
105
99
|
|
|
@@ -156,44 +150,14 @@ var DxcPasswordInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref,
|
|
|
156
150
|
margin: margin,
|
|
157
151
|
size: size,
|
|
158
152
|
pattern: pattern,
|
|
159
|
-
|
|
153
|
+
minLength: minLength,
|
|
154
|
+
maxLength: maxLength,
|
|
160
155
|
autocomplete: autocomplete,
|
|
161
156
|
tabIndex: tabIndex
|
|
162
157
|
}));
|
|
163
158
|
});
|
|
164
159
|
|
|
165
|
-
var sizes = {
|
|
166
|
-
small: "240px",
|
|
167
|
-
medium: "360px",
|
|
168
|
-
large: "480px",
|
|
169
|
-
fillParent: "100%"
|
|
170
|
-
};
|
|
171
|
-
|
|
172
160
|
var PasswordInput = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n & ::-ms-reveal {\n display: none;\n }\n"])));
|
|
173
161
|
|
|
174
|
-
DxcPasswordInput.propTypes = {
|
|
175
|
-
label: _propTypes["default"].string,
|
|
176
|
-
name: _propTypes["default"].string,
|
|
177
|
-
value: _propTypes["default"].string,
|
|
178
|
-
helperText: _propTypes["default"].string,
|
|
179
|
-
error: _propTypes["default"].string,
|
|
180
|
-
clearable: _propTypes["default"].bool,
|
|
181
|
-
onChange: _propTypes["default"].func,
|
|
182
|
-
onBlur: _propTypes["default"].func,
|
|
183
|
-
autocomplete: _propTypes["default"].string,
|
|
184
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
185
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
186
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
187
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
188
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
189
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
190
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
191
|
-
pattern: _propTypes["default"].string,
|
|
192
|
-
length: _propTypes["default"].shape({
|
|
193
|
-
min: _propTypes["default"].number,
|
|
194
|
-
max: _propTypes["default"].number
|
|
195
|
-
}),
|
|
196
|
-
tabIndex: _propTypes["default"].number
|
|
197
|
-
};
|
|
198
162
|
var _default = DxcPasswordInput;
|
|
199
163
|
exports["default"] = _default;
|
|
@@ -7,7 +7,7 @@ import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
|
7
7
|
import DarkContainer from "../../.storybook/components/DarkSection";
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
|
-
title: "Password input
|
|
10
|
+
title: "Password input",
|
|
11
11
|
component: DxcPasswordInput,
|
|
12
12
|
};
|
|
13
13
|
|
|
@@ -53,7 +53,7 @@ export const Chromatic = () => (
|
|
|
53
53
|
<Title title="Margins" theme="light" level={2} />
|
|
54
54
|
<ExampleContainer>
|
|
55
55
|
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
56
|
-
<DxcPasswordInput label="
|
|
56
|
+
<DxcPasswordInput label="Xxsmall" margin="xxsmall" />
|
|
57
57
|
</ExampleContainer>
|
|
58
58
|
<ExampleContainer>
|
|
59
59
|
<Title title="Xsmall margin" theme="light" level={4} />
|
|
@@ -100,7 +100,7 @@ export const Chromatic = () => (
|
|
|
100
100
|
);
|
|
101
101
|
|
|
102
102
|
const Password = () => (
|
|
103
|
-
<ExampleContainer>
|
|
103
|
+
<ExampleContainer expanded>
|
|
104
104
|
<Title title="Show password" theme="light" level={4} />
|
|
105
105
|
<DxcPasswordInput label="Password input" value="Password" />
|
|
106
106
|
</ExampleContainer>
|
|
@@ -108,7 +108,7 @@ const Password = () => (
|
|
|
108
108
|
const PasswordDark = () => (
|
|
109
109
|
<BackgroundColorProvider color="#333333">
|
|
110
110
|
<DarkContainer>
|
|
111
|
-
<ExampleContainer>
|
|
111
|
+
<ExampleContainer expanded>
|
|
112
112
|
<Title title="Show password" theme="dark" level={4} />
|
|
113
113
|
<DxcPasswordInput label="Password input" value="Password" />
|
|
114
114
|
</ExampleContainer>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
+
declare type Margin = {
|
|
3
|
+
top?: Space;
|
|
4
|
+
bottom?: Space;
|
|
5
|
+
left?: Space;
|
|
6
|
+
right?: Space;
|
|
7
|
+
};
|
|
8
|
+
declare type Props = {
|
|
9
|
+
/**
|
|
10
|
+
* Text to be placed above the password.
|
|
11
|
+
*/
|
|
12
|
+
label?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Name attribute of the input element.
|
|
15
|
+
*/
|
|
16
|
+
name?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Value of the input element. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
|
|
19
|
+
*/
|
|
20
|
+
value?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Helper text to be placed above the password.
|
|
23
|
+
*/
|
|
24
|
+
helperText?: string;
|
|
25
|
+
/**
|
|
26
|
+
* If true, the password input will have an action to clear the entered value.
|
|
27
|
+
*/
|
|
28
|
+
clearable?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* This function will be called when the user types within the input
|
|
31
|
+
* element of the component. An object including the current value and
|
|
32
|
+
* the error (if the value entered is not valid) will be passed to this
|
|
33
|
+
* function. If there is no error, error will be null.
|
|
34
|
+
* */
|
|
35
|
+
onChange?: (val: {
|
|
36
|
+
value: string;
|
|
37
|
+
error: string | null;
|
|
38
|
+
}) => void;
|
|
39
|
+
/**
|
|
40
|
+
* This function will be called when the input element loses the focus.
|
|
41
|
+
* An object including the input value and the error (if the value entered is
|
|
42
|
+
* not valid) will be passed to this function. If there is no error, error will be null.
|
|
43
|
+
*/
|
|
44
|
+
onBlur?: (val: {
|
|
45
|
+
value: string;
|
|
46
|
+
error: string | null;
|
|
47
|
+
}) => void;
|
|
48
|
+
/**
|
|
49
|
+
* If it is defined, the component will change its appearance, showing
|
|
50
|
+
* the error below the password input component. If it is not defined, the
|
|
51
|
+
* error messages will be managed internally, but never displayed on its own.
|
|
52
|
+
*/
|
|
53
|
+
error?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Regular expression that defines the valid format allowed by the
|
|
56
|
+
* password input. This will be checked both when the input element loses the
|
|
57
|
+
* focus and while typing within it. If the string entered does not match
|
|
58
|
+
* the pattern, the onBlur and onChange functions will be called with the
|
|
59
|
+
* current value and an internal error informing that this value does not
|
|
60
|
+
* match the pattern. If the pattern is met, the error parameter of both
|
|
61
|
+
* events will be null.
|
|
62
|
+
*/
|
|
63
|
+
pattern?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Specifies the minimun length allowed by the password input.
|
|
66
|
+
* This will be checked both when the input element loses the
|
|
67
|
+
* focus and while typing within it. If the string entered does not
|
|
68
|
+
* comply the minimum length, the onBlur and onChange functions will be called
|
|
69
|
+
* with the current value and an internal error informing that the value
|
|
70
|
+
* length does not comply the specified range. If a valid length is
|
|
71
|
+
* reached, the error parameter of both events will be null.
|
|
72
|
+
*/
|
|
73
|
+
minLength?: number;
|
|
74
|
+
/**
|
|
75
|
+
* Specifies the maximum length allowed by the password input.
|
|
76
|
+
* This will be checked both when the input element loses the
|
|
77
|
+
* focus and while typing within it. If the string entered does not
|
|
78
|
+
* comply the maximum length, the onBlur and onChange functions will be called
|
|
79
|
+
* with the current value and an internal error informing that the value
|
|
80
|
+
* length does not comply the specified range. If a valid length is
|
|
81
|
+
* reached, the error parameter of both events will be null.
|
|
82
|
+
*/
|
|
83
|
+
maxLength?: number;
|
|
84
|
+
/**
|
|
85
|
+
* HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the input value.
|
|
86
|
+
* Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
|
|
87
|
+
*/
|
|
88
|
+
autocomplete?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
91
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
92
|
+
*/
|
|
93
|
+
margin?: Space | Margin;
|
|
94
|
+
/**
|
|
95
|
+
* Size of the component ('small' | 'medium' | 'large' | 'fillParent').
|
|
96
|
+
*/
|
|
97
|
+
size?: "small" | "medium" | "large" | "fillParent";
|
|
98
|
+
/**
|
|
99
|
+
* Value of the tabindex attribute.
|
|
100
|
+
*/
|
|
101
|
+
tabIndex?: number;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Reference to the component.
|
|
105
|
+
*/
|
|
106
|
+
export declare type RefType = HTMLDivElement;
|
|
107
|
+
export default Props;
|
|
@@ -21,9 +21,9 @@ var _LinearProgress = _interopRequireDefault(require("@material-ui/core/LinearPr
|
|
|
21
21
|
|
|
22
22
|
var _variables = require("../common/variables.js");
|
|
23
23
|
|
|
24
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
24
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
25
25
|
|
|
26
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext
|
|
26
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
27
27
|
|
|
28
28
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
29
29
|
|
|
@@ -59,9 +59,9 @@ var DxcProgressBar = function DxcProgressBar(_ref) {
|
|
|
59
59
|
overlay: overlay,
|
|
60
60
|
showValue: showValue,
|
|
61
61
|
backgroundType: backgroundType
|
|
62
|
-
}, value === null ? 0 : value >= 0 && value <= 100 ? value : value < 0 ? 0 : 100, " %")), /*#__PURE__*/_react["default"].createElement(_LinearProgress["default"], {
|
|
62
|
+
}, value === null || value === undefined ? 0 : value >= 0 && value <= 100 ? value : value < 0 ? 0 : 100, " %")), /*#__PURE__*/_react["default"].createElement(_LinearProgress["default"], {
|
|
63
63
|
variant: showValue ? "determinate" : "indeterminate",
|
|
64
|
-
value: value === null ? 0 : value >= 0 && value <= 100 ? value : value < 0 ? 0 : 100
|
|
64
|
+
value: value === null || value === undefined ? 0 : value >= 0 && value <= 100 ? value : value < 0 ? 0 : 100
|
|
65
65
|
}), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
66
66
|
overlay: overlay,
|
|
67
67
|
backgroundType: backgroundType
|
|
@@ -157,7 +157,7 @@ var ProgressBarProgress = _styledComponents["default"].div(_templateObject5 || (
|
|
|
157
157
|
var HelperText = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n"])), function (props) {
|
|
158
158
|
return props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.overlay === true ? "#FFFFFF" : props.theme.helperTextFontColor;
|
|
159
159
|
}, function (props) {
|
|
160
|
-
return props.theme.
|
|
160
|
+
return props.theme.helperTextFontFamily;
|
|
161
161
|
}, function (props) {
|
|
162
162
|
return props.theme.helperTextFontSize;
|
|
163
163
|
}, function (props) {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import DxcProgressBar from "./ProgressBar";
|
|
3
|
+
import Title from "../../.storybook/components/Title";
|
|
4
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "ProgressBar",
|
|
8
|
+
component: DxcProgressBar,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Chromatic = () => (
|
|
12
|
+
<>
|
|
13
|
+
<ExampleContainer>
|
|
14
|
+
<Title title="Without labels" theme="light" level={4} />
|
|
15
|
+
<DxcProgressBar overlay={false} value={50} showValue />
|
|
16
|
+
<Title title="With helperText" theme="light" level={4} />
|
|
17
|
+
<DxcProgressBar helperText="Helper text" value={50} overlay={false} showValue />
|
|
18
|
+
<Title title="Without default value" theme="light" level={4} />
|
|
19
|
+
<DxcProgressBar label="Loading..." overlay={false} showValue />
|
|
20
|
+
</ExampleContainer>
|
|
21
|
+
<Title title="Margins" theme="light" level={2} />
|
|
22
|
+
<ExampleContainer>
|
|
23
|
+
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
24
|
+
<DxcProgressBar label="Margin xxsmall" margin="xxsmall" overlay={false} value={50} showValue />
|
|
25
|
+
</ExampleContainer>
|
|
26
|
+
<ExampleContainer>
|
|
27
|
+
<Title title="Xsmall margin" theme="light" level={4} />
|
|
28
|
+
<DxcProgressBar label="Margin xsmall" margin="xsmall" overlay={false} value={50} showValue />
|
|
29
|
+
</ExampleContainer>
|
|
30
|
+
<ExampleContainer>
|
|
31
|
+
<Title title="Small margin" theme="light" level={4} />
|
|
32
|
+
<DxcProgressBar label="Margin small" margin="small" overlay={false} value={50} showValue />
|
|
33
|
+
</ExampleContainer>
|
|
34
|
+
<ExampleContainer>
|
|
35
|
+
<Title title="Medium margin" theme="light" level={4} />
|
|
36
|
+
<DxcProgressBar label="Margin medium" margin="medium" overlay={false} value={50} showValue />
|
|
37
|
+
</ExampleContainer>
|
|
38
|
+
<ExampleContainer>
|
|
39
|
+
<Title title="Large margin" theme="light" level={4} />
|
|
40
|
+
<DxcProgressBar label="Margin large" margin="large" overlay={false} value={50} showValue />
|
|
41
|
+
</ExampleContainer>
|
|
42
|
+
<ExampleContainer>
|
|
43
|
+
<Title title="Xlarge margin" theme="light" level={4} />
|
|
44
|
+
<DxcProgressBar label="Margin xlarge" margin="xlarge" overlay={false} value={50} showValue />
|
|
45
|
+
</ExampleContainer>
|
|
46
|
+
<ExampleContainer>
|
|
47
|
+
<Title title="XxLarge margin" theme="light" level={4} />
|
|
48
|
+
<DxcProgressBar label="Margin xxlarge" margin="xxlarge" overlay={false} value={50} showValue />
|
|
49
|
+
</ExampleContainer>
|
|
50
|
+
</>
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
export const ProgressBarOverlay = () => (
|
|
54
|
+
<ExampleContainer>
|
|
55
|
+
<Title title="Overlay" theme="dark" level={4} />
|
|
56
|
+
<DxcProgressBar label="Overlay" helperText="Helper text" showValue value={50} />
|
|
57
|
+
</ExampleContainer>
|
|
58
|
+
);
|
package/radio/Radio.js
CHANGED
|
@@ -27,9 +27,9 @@ var _variables = require("../common/variables.js");
|
|
|
27
27
|
|
|
28
28
|
var _utils = require("../common/utils.js");
|
|
29
29
|
|
|
30
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
30
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
31
31
|
|
|
32
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext
|
|
32
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
33
33
|
|
|
34
34
|
var _templateObject, _templateObject2;
|
|
35
35
|
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import DxcRadio from "./Radio";
|
|
3
|
+
import { BackgroundColorProvider } from "../BackgroundColorContext";
|
|
4
|
+
import Title from "../../.storybook/components/Title";
|
|
5
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
6
|
+
import DarkContainer from "../../.storybook/components/DarkSection";
|
|
7
|
+
import { userEvent, within } from "@storybook/testing-library";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: "Radio",
|
|
11
|
+
component: DxcRadio,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const Radio = () => (
|
|
15
|
+
<>
|
|
16
|
+
<>
|
|
17
|
+
<ExampleContainer>
|
|
18
|
+
<Title title="Default" theme="light" level={4} />
|
|
19
|
+
<DxcRadio label="Radio" />
|
|
20
|
+
</ExampleContainer>
|
|
21
|
+
<ExampleContainer>
|
|
22
|
+
<Title title="Focused" theme="light" level={4} />
|
|
23
|
+
<DxcRadio label="Focused" />
|
|
24
|
+
</ExampleContainer>
|
|
25
|
+
<ExampleContainer>
|
|
26
|
+
<Title title="Checked" theme="light" level={4} />
|
|
27
|
+
<DxcRadio label="Radio" checked />
|
|
28
|
+
</ExampleContainer>
|
|
29
|
+
<ExampleContainer>
|
|
30
|
+
<Title title="Required" theme="light" level={4} />
|
|
31
|
+
<DxcRadio label="Radio" required />
|
|
32
|
+
</ExampleContainer>
|
|
33
|
+
<ExampleContainer>
|
|
34
|
+
<Title title="Disabled and checked" theme="light" level={4} />
|
|
35
|
+
<DxcRadio label="Radio" disabled checked />
|
|
36
|
+
</ExampleContainer>
|
|
37
|
+
<ExampleContainer>
|
|
38
|
+
<Title title="Disabled and required" theme="light" level={4} />
|
|
39
|
+
<DxcRadio label="Radio" disabled required />
|
|
40
|
+
</ExampleContainer>
|
|
41
|
+
<ExampleContainer>
|
|
42
|
+
<Title title="Disabled, required and checked" theme="light" level={4} />
|
|
43
|
+
<DxcRadio label="Radio" disabled required checked />
|
|
44
|
+
</ExampleContainer>
|
|
45
|
+
<ExampleContainer>
|
|
46
|
+
<Title title="Label after" theme="light" level={4} />
|
|
47
|
+
<DxcRadio label="Radio" labelPosition="after" />
|
|
48
|
+
</ExampleContainer>
|
|
49
|
+
<ExampleContainer>
|
|
50
|
+
<Title title="Checked with label after" theme="light" level={4} />
|
|
51
|
+
<DxcRadio label="Radio" checked labelPosition="after" />
|
|
52
|
+
</ExampleContainer>
|
|
53
|
+
<ExampleContainer>
|
|
54
|
+
<Title title="Required with label after" theme="light" level={4} />
|
|
55
|
+
<DxcRadio label="Radio" required labelPosition="after" />
|
|
56
|
+
</ExampleContainer>
|
|
57
|
+
<ExampleContainer>
|
|
58
|
+
<Title title="Disabled and checked with label after" theme="light" level={4} />
|
|
59
|
+
<DxcRadio label="Radio" disabled checked labelPosition="after" />
|
|
60
|
+
</ExampleContainer>
|
|
61
|
+
<ExampleContainer>
|
|
62
|
+
<Title title="Disabled and required with label after" theme="light" level={4} />
|
|
63
|
+
<DxcRadio label="Radio" disabled required labelPosition="after" />
|
|
64
|
+
</ExampleContainer>
|
|
65
|
+
<ExampleContainer>
|
|
66
|
+
<Title title="Disabled, required and checked with label after" theme="light" level={4} />
|
|
67
|
+
<DxcRadio label="Radio" disabled required checked labelPosition="after" />
|
|
68
|
+
</ExampleContainer>
|
|
69
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
70
|
+
<Title title="Hovered" theme="light" level={4} />
|
|
71
|
+
<DxcRadio label="Hovered" />
|
|
72
|
+
</ExampleContainer>
|
|
73
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
74
|
+
<Title title="Hovered and checked" theme="light" level={4} />
|
|
75
|
+
<DxcRadio label="Hovered" checked />
|
|
76
|
+
</ExampleContainer>
|
|
77
|
+
</>
|
|
78
|
+
<BackgroundColorProvider color="#333333">
|
|
79
|
+
<DarkContainer>
|
|
80
|
+
<>
|
|
81
|
+
<ExampleContainer>
|
|
82
|
+
<Title title="Default" theme="dark" level={4} />
|
|
83
|
+
<DxcRadio label="Radio" />
|
|
84
|
+
</ExampleContainer>
|
|
85
|
+
<ExampleContainer>
|
|
86
|
+
<Title title="Checked" theme="dark" level={4} />
|
|
87
|
+
<DxcRadio label="Radio" checked />
|
|
88
|
+
</ExampleContainer>
|
|
89
|
+
<ExampleContainer>
|
|
90
|
+
<Title title="Required" theme="dark" level={4} />
|
|
91
|
+
<DxcRadio label="Radio" required />
|
|
92
|
+
</ExampleContainer>
|
|
93
|
+
<ExampleContainer>
|
|
94
|
+
<Title title="Disabled and checked" theme="dark" level={4} />
|
|
95
|
+
<DxcRadio label="Radio" disabled checked />
|
|
96
|
+
</ExampleContainer>
|
|
97
|
+
<ExampleContainer>
|
|
98
|
+
<Title title="Disabled and required" theme="dark" level={4} />
|
|
99
|
+
<DxcRadio label="Radio" disabled required />
|
|
100
|
+
</ExampleContainer>
|
|
101
|
+
<ExampleContainer>
|
|
102
|
+
<Title title="Disabled, required and checked" theme="dark" level={4} />
|
|
103
|
+
<DxcRadio label="Radio" disabled required checked />
|
|
104
|
+
</ExampleContainer>
|
|
105
|
+
<ExampleContainer>
|
|
106
|
+
<Title title="Label after" theme="dark" level={4} />
|
|
107
|
+
<DxcRadio label="Radio" labelPosition="after" />
|
|
108
|
+
</ExampleContainer>
|
|
109
|
+
<ExampleContainer>
|
|
110
|
+
<Title title="Checked with label after" theme="dark" level={4} />
|
|
111
|
+
<DxcRadio label="Radio" checked labelPosition="after" />
|
|
112
|
+
</ExampleContainer>
|
|
113
|
+
<ExampleContainer>
|
|
114
|
+
<Title title="Required with label after" theme="dark" level={4} />
|
|
115
|
+
<DxcRadio label="Radio" required labelPosition="after" />
|
|
116
|
+
</ExampleContainer>
|
|
117
|
+
<ExampleContainer>
|
|
118
|
+
<Title title="Disabled and checked with label after" theme="dark" level={4} />
|
|
119
|
+
<DxcRadio label="Radio" disabled checked labelPosition="after" />
|
|
120
|
+
</ExampleContainer>
|
|
121
|
+
<ExampleContainer>
|
|
122
|
+
<Title title="Disabled and required with label after" theme="dark" level={4} />
|
|
123
|
+
<DxcRadio label="Radio" disabled required labelPosition="after" />
|
|
124
|
+
</ExampleContainer>
|
|
125
|
+
<ExampleContainer>
|
|
126
|
+
<Title title="Disabled, required and checked with label after" theme="dark" level={4} />
|
|
127
|
+
<DxcRadio label="Radio" disabled required checked labelPosition="after" />
|
|
128
|
+
</ExampleContainer>
|
|
129
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
130
|
+
<Title title="Hovered" theme="dark" level={4} />
|
|
131
|
+
<DxcRadio label="Hovered" />
|
|
132
|
+
</ExampleContainer>
|
|
133
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
134
|
+
<Title title="Hovered and checked" theme="dark" level={4} />
|
|
135
|
+
<DxcRadio label="Hovered" checked />
|
|
136
|
+
</ExampleContainer>
|
|
137
|
+
</>
|
|
138
|
+
</DarkContainer>
|
|
139
|
+
</BackgroundColorProvider>
|
|
140
|
+
<Title title="Sizes" theme="light" level={2} />
|
|
141
|
+
<ExampleContainer>
|
|
142
|
+
<DxcRadio label="Small" size="small" />
|
|
143
|
+
</ExampleContainer>
|
|
144
|
+
<ExampleContainer>
|
|
145
|
+
<DxcRadio label="Medium" size="medium" />
|
|
146
|
+
</ExampleContainer>
|
|
147
|
+
<ExampleContainer>
|
|
148
|
+
<DxcRadio label="Large" size="large" />
|
|
149
|
+
</ExampleContainer>
|
|
150
|
+
<ExampleContainer>
|
|
151
|
+
<DxcRadio label="FitContent" size="fitContent" />
|
|
152
|
+
</ExampleContainer>
|
|
153
|
+
<ExampleContainer>
|
|
154
|
+
<DxcRadio label="FillParent" size="fillParent" />
|
|
155
|
+
</ExampleContainer>
|
|
156
|
+
<Title title="Margins" theme="light" level={2} />
|
|
157
|
+
<ExampleContainer>
|
|
158
|
+
<Title title="Xxsmall" theme="light" level={4} />
|
|
159
|
+
<DxcRadio label="Xxsmall" margin={"xxsmall"} />
|
|
160
|
+
</ExampleContainer>
|
|
161
|
+
<ExampleContainer>
|
|
162
|
+
<Title title="Xsmall" theme="light" level={4} />
|
|
163
|
+
<DxcRadio label="Xsmall" margin={"xsmall"} />
|
|
164
|
+
</ExampleContainer>
|
|
165
|
+
<ExampleContainer>
|
|
166
|
+
<Title title="Small" theme="light" level={4} />
|
|
167
|
+
<DxcRadio label="Small" margin={"small"} />
|
|
168
|
+
</ExampleContainer>
|
|
169
|
+
<ExampleContainer>
|
|
170
|
+
<Title title="Medium" theme="light" level={4} />
|
|
171
|
+
<DxcRadio label="Medium" margin={"medium"} />
|
|
172
|
+
</ExampleContainer>
|
|
173
|
+
<ExampleContainer>
|
|
174
|
+
<Title title="Large" theme="light" level={4} />
|
|
175
|
+
<DxcRadio label="Large" margin={"large"} />
|
|
176
|
+
</ExampleContainer>
|
|
177
|
+
<ExampleContainer>
|
|
178
|
+
<Title title="Xlarge" theme="light" level={4} />
|
|
179
|
+
<DxcRadio label="Xlarge" margin={"xlarge"} />
|
|
180
|
+
</ExampleContainer>
|
|
181
|
+
<ExampleContainer>
|
|
182
|
+
<Title title="Xxlarge" theme="light" level={4} />
|
|
183
|
+
<DxcRadio label="Xxlarge" margin={"xxlarge"} />
|
|
184
|
+
</ExampleContainer>
|
|
185
|
+
</>
|
|
186
|
+
);
|
|
187
|
+
|
|
188
|
+
export const Chromatic = Radio.bind({});
|
|
189
|
+
Chromatic.play = async () => {
|
|
190
|
+
await userEvent.tab();
|
|
191
|
+
await userEvent.tab();
|
|
192
|
+
};
|
package/radio/types.d.ts
CHANGED
|
@@ -42,8 +42,8 @@ declare type Props = {
|
|
|
42
42
|
*/
|
|
43
43
|
onClick?: (val: boolean) => void;
|
|
44
44
|
/**
|
|
45
|
-
* Size of the margin to be applied to the component
|
|
46
|
-
* 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
45
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
46
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
47
47
|
*/
|
|
48
48
|
margin?: Space | Margin;
|
|
49
49
|
/**
|