@dxc-technology/halstack-react 0.0.0-c293b72 → 0.0.0-c2b6ec9
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.js +1 -1
- package/HalstackContext.d.ts +2 -5
- package/HalstackContext.js +6 -6
- package/accordion/Accordion.accessibility.test.d.ts +1 -0
- package/accordion/Accordion.accessibility.test.js +4 -4
- package/accordion/Accordion.js +9 -10
- package/accordion/Accordion.stories.tsx +4 -14
- package/accordion/Accordion.test.d.ts +1 -0
- package/accordion/Accordion.test.js +3 -3
- package/accordion-group/AccordionGroup.accessibility.test.d.ts +1 -0
- package/accordion-group/AccordionGroup.accessibility.test.js +11 -17
- package/accordion-group/AccordionGroup.js +1 -1
- package/accordion-group/AccordionGroup.stories.tsx +23 -23
- package/accordion-group/AccordionGroup.test.d.ts +1 -0
- package/accordion-group/AccordionGroup.test.js +5 -9
- package/accordion-group/AccordionGroupAccordion.js +1 -1
- package/action-icon/ActionIcon.accessibility.test.d.ts +1 -0
- package/action-icon/ActionIcon.accessibility.test.js +4 -4
- package/action-icon/ActionIcon.test.d.ts +1 -0
- package/action-icon/ActionIcon.test.js +1 -1
- package/alert/Alert.accessibility.test.d.ts +1 -0
- package/alert/Alert.accessibility.test.js +6 -6
- package/alert/Alert.js +6 -3
- package/alert/Alert.test.d.ts +1 -0
- package/alert/Alert.test.js +1 -1
- package/badge/Badge.accessibility.test.d.ts +1 -0
- package/badge/Badge.accessibility.test.js +5 -5
- package/badge/Badge.test.d.ts +1 -0
- package/badge/Badge.test.js +2 -2
- package/box/Box.accessibility.test.d.ts +1 -0
- package/box/Box.accessibility.test.js +3 -3
- package/box/Box.js +1 -1
- package/box/Box.test.d.ts +1 -0
- package/box/Box.test.js +1 -1
- package/breadcrumbs/Breadcrumbs.accessibility.test.d.ts +1 -0
- package/breadcrumbs/Breadcrumbs.accessibility.test.js +96 -0
- package/breadcrumbs/Breadcrumbs.d.ts +4 -0
- package/breadcrumbs/Breadcrumbs.js +79 -0
- package/breadcrumbs/Breadcrumbs.stories.tsx +194 -0
- package/breadcrumbs/Breadcrumbs.test.d.ts +1 -0
- package/breadcrumbs/Breadcrumbs.test.js +168 -0
- package/breadcrumbs/Item.d.ts +4 -0
- package/breadcrumbs/Item.js +52 -0
- package/breadcrumbs/dropdownTheme.d.ts +53 -0
- package/breadcrumbs/dropdownTheme.js +62 -0
- package/breadcrumbs/types.d.ts +16 -0
- package/breadcrumbs/types.js +5 -0
- package/bulleted-list/BulletedList.accessibility.test.d.ts +1 -0
- package/bulleted-list/BulletedList.accessibility.test.js +18 -6
- package/bulleted-list/BulletedList.js +2 -2
- package/button/Button.accessibility.test.d.ts +1 -0
- package/button/Button.accessibility.test.js +6 -6
- package/button/Button.js +1 -1
- package/button/Button.stories.tsx +3 -3
- package/button/Button.test.d.ts +1 -0
- package/button/Button.test.js +1 -1
- package/card/Card.accessibility.test.d.ts +1 -0
- package/card/Card.accessibility.test.js +3 -3
- package/card/Card.js +3 -2
- package/card/Card.stories.tsx +1 -1
- package/card/Card.test.d.ts +1 -0
- package/card/Card.test.js +1 -1
- package/checkbox/Checkbox.accessibility.test.d.ts +1 -0
- package/checkbox/Checkbox.accessibility.test.js +5 -5
- package/checkbox/Checkbox.js +10 -13
- package/checkbox/Checkbox.test.d.ts +1 -0
- package/checkbox/Checkbox.test.js +1 -1
- package/chip/Chip.accessibility.test.d.ts +1 -0
- package/chip/Chip.accessibility.test.js +4 -4
- package/chip/Chip.js +3 -1
- package/chip/Chip.stories.tsx +1 -1
- package/chip/Chip.test.d.ts +1 -0
- package/chip/Chip.test.js +1 -1
- package/common/coreTokens.js +3 -3
- package/common/variables.d.ts +2 -5
- package/common/variables.js +68 -71
- package/container/Container.stories.tsx +3 -3
- package/contextual-menu/ContextualMenu.accessibility.test.d.ts +1 -0
- package/contextual-menu/ContextualMenu.accessibility.test.js +15 -3
- package/contextual-menu/ContextualMenu.d.ts +3 -5
- package/contextual-menu/ContextualMenu.js +89 -52
- package/contextual-menu/ContextualMenu.stories.tsx +115 -74
- package/contextual-menu/ContextualMenu.test.d.ts +1 -0
- package/contextual-menu/ContextualMenu.test.js +200 -24
- package/contextual-menu/GroupItem.d.ts +4 -0
- package/contextual-menu/GroupItem.js +67 -0
- package/contextual-menu/ItemAction.d.ts +4 -0
- package/contextual-menu/ItemAction.js +50 -0
- package/contextual-menu/MenuItem.d.ts +4 -0
- package/contextual-menu/MenuItem.js +29 -0
- package/contextual-menu/SingleItem.d.ts +4 -0
- package/contextual-menu/SingleItem.js +38 -0
- package/contextual-menu/types.d.ts +50 -11
- package/date-input/Calendar.js +47 -31
- package/date-input/DateInput.accessibility.test.d.ts +1 -0
- package/date-input/DateInput.accessibility.test.js +24 -11
- package/date-input/DateInput.js +27 -21
- package/date-input/DateInput.stories.tsx +18 -12
- package/date-input/DateInput.test.d.ts +1 -0
- package/date-input/DateInput.test.js +39 -39
- package/date-input/DatePicker.js +1 -1
- package/date-input/YearPicker.js +10 -5
- package/dialog/Dialog.accessibility.test.d.ts +1 -0
- package/dialog/Dialog.accessibility.test.js +5 -5
- package/dialog/Dialog.js +9 -20
- package/dialog/Dialog.stories.tsx +8 -4
- package/dialog/Dialog.test.d.ts +1 -0
- package/dialog/Dialog.test.js +111 -48
- package/divider/Divider.accessibility.test.d.ts +1 -0
- package/divider/Divider.accessibility.test.js +2 -2
- package/divider/Divider.test.d.ts +1 -0
- package/dropdown/Dropdown.accessibility.test.d.ts +1 -0
- package/dropdown/Dropdown.accessibility.test.js +12 -9
- package/dropdown/Dropdown.js +16 -15
- package/dropdown/Dropdown.stories.tsx +11 -11
- package/dropdown/Dropdown.test.d.ts +1 -0
- package/dropdown/Dropdown.test.js +101 -72
- package/dropdown/DropdownMenu.js +4 -4
- package/dropdown/DropdownMenuItem.js +2 -1
- package/file-input/FileInput.accessibility.test.d.ts +1 -0
- package/file-input/FileInput.accessibility.test.js +30 -23
- package/file-input/FileInput.js +3 -8
- package/file-input/FileInput.test.d.ts +1 -0
- package/file-input/FileInput.test.js +44 -22
- package/file-input/FileItem.js +6 -2
- package/file-input/types.d.ts +0 -4
- package/footer/Footer.accessibility.test.d.ts +1 -0
- package/footer/Footer.accessibility.test.js +13 -5
- package/footer/Footer.js +1 -1
- package/footer/Footer.stories.tsx +12 -0
- package/footer/Footer.test.d.ts +1 -0
- package/footer/Footer.test.js +1 -1
- package/footer/Icons.js +2 -30
- package/grid/Grid.stories.tsx +3 -1
- package/header/Header.accessibility.test.d.ts +1 -0
- package/header/Header.accessibility.test.js +16 -6
- package/header/Header.js +3 -2
- package/header/Header.stories.tsx +17 -1
- package/header/Header.test.d.ts +1 -0
- package/header/Header.test.js +1 -1
- package/header/Icons.js +1 -6
- package/heading/Heading.accessibility.test.d.ts +1 -0
- package/heading/Heading.accessibility.test.js +3 -3
- package/heading/Heading.js +1 -1
- package/heading/Heading.test.d.ts +1 -0
- package/heading/Heading.test.js +1 -14
- package/icon/Icon.accessibility.test.d.ts +1 -0
- package/icon/Icon.accessibility.test.js +2 -2
- package/icon/Icon.js +1 -1
- package/image/Image.accessibility.test.d.ts +1 -0
- package/image/Image.accessibility.test.js +3 -3
- package/image/Image.js +1 -1
- package/layout/ApplicationLayout.js +9 -6
- package/layout/Icons.d.ts +0 -1
- package/layout/Icons.js +1 -9
- package/link/Link.accessibility.test.d.ts +1 -0
- package/link/Link.accessibility.test.js +8 -12
- package/link/Link.js +1 -1
- package/link/Link.stories.tsx +2 -2
- package/link/Link.test.d.ts +1 -0
- package/link/Link.test.js +1 -1
- package/main.d.ts +2 -1
- package/main.js +8 -1
- package/nav-tabs/NavTabs.accessibility.test.d.ts +1 -0
- package/nav-tabs/NavTabs.accessibility.test.js +3 -3
- package/nav-tabs/NavTabs.js +19 -4
- package/nav-tabs/NavTabs.stories.tsx +18 -3
- package/nav-tabs/NavTabs.test.d.ts +1 -0
- package/nav-tabs/NavTabs.test.js +9 -7
- package/nav-tabs/Tab.js +7 -7
- package/number-input/NumberInput.accessibility.test.d.ts +1 -0
- package/number-input/NumberInput.accessibility.test.js +9 -10
- package/number-input/NumberInput.js +6 -3
- package/number-input/NumberInput.stories.tsx +11 -16
- package/number-input/NumberInput.test.d.ts +1 -0
- package/number-input/NumberInput.test.js +6 -7
- package/package.json +25 -20
- package/paginator/Paginator.accessibility.test.d.ts +1 -0
- package/paginator/Paginator.accessibility.test.js +4 -5
- package/paginator/Paginator.js +13 -10
- package/paginator/Paginator.test.d.ts +1 -0
- package/paginator/Paginator.test.js +2 -3
- package/paragraph/Paragraph.accessibility.test.d.ts +1 -0
- package/paragraph/Paragraph.accessibility.test.js +2 -2
- package/password-input/PasswordInput.accessibility.test.d.ts +1 -0
- package/password-input/PasswordInput.accessibility.test.js +7 -8
- package/password-input/PasswordInput.js +11 -7
- package/password-input/PasswordInput.stories.tsx +10 -1
- package/password-input/PasswordInput.test.d.ts +1 -0
- package/password-input/PasswordInput.test.js +6 -7
- package/progress-bar/ProgressBar.accessibility.test.d.ts +1 -0
- package/progress-bar/ProgressBar.accessibility.test.js +3 -3
- package/progress-bar/ProgressBar.js +6 -4
- package/progress-bar/ProgressBar.test.d.ts +1 -0
- package/progress-bar/ProgressBar.test.js +1 -1
- package/quick-nav/QuickNav.accessibility.test.d.ts +1 -0
- package/quick-nav/QuickNav.accessibility.test.js +2 -2
- package/quick-nav/QuickNav.js +1 -1
- package/radio-group/Radio.js +6 -9
- package/radio-group/RadioGroup.accessibility.test.d.ts +1 -0
- package/radio-group/RadioGroup.accessibility.test.js +4 -4
- package/radio-group/RadioGroup.js +14 -16
- package/radio-group/RadioGroup.test.d.ts +1 -0
- package/radio-group/RadioGroup.test.js +3 -5
- package/resultset-table/ResultsetTable.accessibility.test.d.ts +1 -0
- package/resultset-table/ResultsetTable.accessibility.test.js +16 -6
- package/resultset-table/ResultsetTable.js +3 -2
- package/resultset-table/ResultsetTable.stories.tsx +13 -1
- package/resultset-table/ResultsetTable.test.d.ts +1 -0
- package/resultset-table/ResultsetTable.test.js +2 -4
- package/select/Listbox.js +19 -13
- package/select/Option.js +2 -1
- package/select/Select.accessibility.test.d.ts +1 -0
- package/select/Select.accessibility.test.js +18 -8
- package/select/Select.js +25 -21
- package/select/Select.stories.tsx +36 -15
- package/select/Select.test.d.ts +1 -0
- package/select/Select.test.js +42 -51
- package/sidenav/Sidenav.accessibility.test.d.ts +1 -0
- package/sidenav/Sidenav.accessibility.test.js +3 -3
- package/sidenav/Sidenav.js +1 -1
- package/sidenav/Sidenav.stories.tsx +1 -1
- package/sidenav/Sidenav.test.d.ts +1 -0
- package/sidenav/Sidenav.test.js +1 -1
- package/slider/Slider.accessibility.test.d.ts +1 -0
- package/slider/Slider.accessibility.test.js +5 -6
- package/slider/Slider.js +11 -13
- package/slider/Slider.stories.tsx +180 -0
- package/slider/Slider.test.d.ts +1 -0
- package/slider/Slider.test.js +13 -11
- package/spinner/Spinner.accessibility.test.d.ts +1 -0
- package/spinner/Spinner.accessibility.test.js +6 -6
- package/spinner/Spinner.js +6 -2
- package/spinner/Spinner.test.d.ts +1 -0
- package/spinner/Spinner.test.js +1 -1
- package/status-light/StatusLight.accessibility.test.d.ts +1 -0
- package/status-light/StatusLight.accessibility.test.js +8 -8
- package/status-light/StatusLight.test.d.ts +1 -0
- package/status-light/StatusLight.test.js +1 -1
- package/switch/Switch.accessibility.test.d.ts +1 -0
- package/switch/Switch.accessibility.test.js +14 -5
- package/switch/Switch.js +6 -9
- package/switch/Switch.stories.tsx +12 -0
- package/switch/Switch.test.d.ts +1 -0
- package/switch/Switch.test.js +1 -1
- package/table/Table.accessibility.test.d.ts +1 -0
- package/table/Table.accessibility.test.js +16 -6
- package/table/Table.js +1 -1
- package/table/Table.stories.tsx +13 -1
- package/table/Table.test.d.ts +1 -0
- package/table/Table.test.js +2 -4
- package/tabs/Tab.js +1 -1
- package/tabs/Tabs.accessibility.test.d.ts +1 -0
- package/tabs/Tabs.accessibility.test.js +3 -3
- package/tabs/Tabs.js +1 -1
- package/tabs/Tabs.stories.tsx +7 -1
- package/tabs/Tabs.test.d.ts +1 -0
- package/tabs/Tabs.test.js +1 -1
- package/tag/Tag.accessibility.test.d.ts +1 -0
- package/tag/Tag.accessibility.test.js +4 -4
- package/tag/Tag.js +1 -1
- package/tag/Tag.stories.tsx +1 -1
- package/tag/Tag.test.d.ts +1 -0
- package/tag/Tag.test.js +1 -1
- package/text-input/Suggestion.js +1 -1
- package/text-input/Suggestions.js +14 -6
- package/text-input/TextInput.accessibility.test.d.ts +1 -0
- package/text-input/TextInput.accessibility.test.js +11 -12
- package/text-input/TextInput.js +29 -25
- package/text-input/TextInput.stories.tsx +19 -7
- package/text-input/TextInput.test.d.ts +1 -0
- package/text-input/TextInput.test.js +2 -3
- package/textarea/Textarea.accessibility.test.d.ts +1 -0
- package/textarea/Textarea.accessibility.test.js +7 -7
- package/textarea/Textarea.js +14 -13
- package/textarea/Textarea.test.d.ts +1 -0
- package/textarea/Textarea.test.js +1 -1
- package/toggle-group/ToggleGroup.accessibility.test.d.ts +1 -0
- package/toggle-group/ToggleGroup.accessibility.test.js +5 -5
- package/toggle-group/ToggleGroup.js +6 -9
- package/toggle-group/ToggleGroup.stories.tsx +1 -1
- package/toggle-group/ToggleGroup.test.d.ts +1 -0
- package/toggle-group/ToggleGroup.test.js +1 -1
- package/tooltip/Tooltip.accessibility.test.d.ts +1 -0
- package/tooltip/Tooltip.accessibility.test.js +144 -0
- package/tooltip/Tooltip.d.ts +4 -0
- package/tooltip/Tooltip.js +50 -0
- package/tooltip/Tooltip.stories.tsx +111 -0
- package/tooltip/Tooltip.test.d.ts +1 -0
- package/tooltip/Tooltip.test.js +112 -0
- package/tooltip/types.d.ts +16 -0
- package/tooltip/types.js +5 -0
- package/typography/Typography.accessibility.test.d.ts +1 -0
- package/typography/Typography.accessibility.test.js +12 -12
- package/typography/Typography.stories.tsx +1 -3
- package/useTheme.d.ts +2 -5
- package/utils/BaseTypography.js +1 -1
- package/utils/FocusLock.js +3 -2
- package/wizard/Wizard.accessibility.test.d.ts +1 -0
- package/wizard/Wizard.accessibility.test.js +3 -3
- package/wizard/Wizard.js +1 -9
- package/wizard/Wizard.stories.tsx +1 -1
- package/wizard/Wizard.test.d.ts +1 -0
- package/wizard/Wizard.test.js +1 -1
- package/contextual-menu/MenuItemAction.d.ts +0 -4
- package/contextual-menu/MenuItemAction.js +0 -46
- package/paginator/Icons.d.ts +0 -5
- package/paginator/Icons.js +0 -40
|
@@ -5,8 +5,8 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
5
5
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
6
6
|
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
var _react2 = require("@testing-library/react");
|
|
8
|
-
var
|
|
9
|
-
var _Checkbox = _interopRequireDefault(require("./Checkbox
|
|
8
|
+
var _axeHelper = require("../../test/accessibility/axe-helper.js");
|
|
9
|
+
var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
10
10
|
describe("Checkbox component accessibility tests", function () {
|
|
11
11
|
it("Should not have basic accessibility issues", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
12
12
|
var _render, container, results;
|
|
@@ -24,7 +24,7 @@ describe("Checkbox component accessibility tests", function () {
|
|
|
24
24
|
optional: true
|
|
25
25
|
})), container = _render.container;
|
|
26
26
|
_context.next = 3;
|
|
27
|
-
return (0,
|
|
27
|
+
return (0, _axeHelper.axe)(container);
|
|
28
28
|
case 3:
|
|
29
29
|
results = _context.sent;
|
|
30
30
|
expect(results).toHaveNoViolations();
|
|
@@ -49,7 +49,7 @@ describe("Checkbox component accessibility tests", function () {
|
|
|
49
49
|
readOnly: true
|
|
50
50
|
})), container = _render2.container;
|
|
51
51
|
_context2.next = 3;
|
|
52
|
-
return (0,
|
|
52
|
+
return (0, _axeHelper.axe)(container);
|
|
53
53
|
case 3:
|
|
54
54
|
results = _context2.sent;
|
|
55
55
|
expect(results).toHaveNoViolations();
|
|
@@ -74,7 +74,7 @@ describe("Checkbox component accessibility tests", function () {
|
|
|
74
74
|
disabled: true
|
|
75
75
|
})), container = _render3.container;
|
|
76
76
|
_context3.next = 3;
|
|
77
|
-
return (0,
|
|
77
|
+
return (0, _axeHelper.axe)(container);
|
|
78
78
|
case 3:
|
|
79
79
|
results = _context3.sent;
|
|
80
80
|
expect(results).toHaveNoViolations();
|
package/checkbox/Checkbox.js
CHANGED
|
@@ -13,16 +13,14 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
14
14
|
var _variables = require("../common/variables");
|
|
15
15
|
var _utils = require("../common/utils");
|
|
16
|
-
var _uuid = require("uuid");
|
|
17
16
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
18
17
|
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
19
18
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
20
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
21
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
20
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
22
21
|
var checkedIcon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
23
22
|
fill: "currentColor",
|
|
24
23
|
focusable: "false",
|
|
25
|
-
"aria-hidden": "true",
|
|
26
24
|
viewBox: "0 0 24 24"
|
|
27
25
|
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
28
26
|
d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
|
@@ -50,13 +48,11 @@ var DxcCheckbox = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
50
48
|
size = _ref$size === void 0 ? "fitContent" : _ref$size,
|
|
51
49
|
_ref$tabIndex = _ref.tabIndex,
|
|
52
50
|
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
innerChecked = _useState4[0],
|
|
59
|
-
setInnerChecked = _useState4[1];
|
|
51
|
+
var labelId = "label-checkbox-".concat((0, _react.useId)());
|
|
52
|
+
var _useState = (0, _react.useState)(defaultChecked),
|
|
53
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
54
|
+
innerChecked = _useState2[0],
|
|
55
|
+
setInnerChecked = _useState2[1];
|
|
60
56
|
var checkboxRef = (0, _react.useRef)(null);
|
|
61
57
|
var colorsTheme = (0, _useTheme["default"])();
|
|
62
58
|
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
@@ -91,12 +87,12 @@ var DxcCheckbox = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
91
87
|
}, label && /*#__PURE__*/_react["default"].createElement(LabelContainer, {
|
|
92
88
|
id: labelId,
|
|
93
89
|
disabled: disabled,
|
|
94
|
-
labelPosition: labelPosition
|
|
90
|
+
labelPosition: labelPosition,
|
|
91
|
+
"aria-label": label
|
|
95
92
|
}, label, optional && " ".concat(translatedLabels.formFields.optionalLabel)), /*#__PURE__*/_react["default"].createElement(ValueInput, {
|
|
96
93
|
type: "checkbox",
|
|
97
94
|
checked: checked !== null && checked !== void 0 ? checked : innerChecked,
|
|
98
95
|
name: name,
|
|
99
|
-
"aria-hidden": "true",
|
|
100
96
|
value: value,
|
|
101
97
|
disabled: disabled,
|
|
102
98
|
readOnly: true
|
|
@@ -108,7 +104,8 @@ var DxcCheckbox = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
108
104
|
"aria-disabled": disabled,
|
|
109
105
|
"aria-readonly": readOnly,
|
|
110
106
|
"aria-required": !disabled && !optional,
|
|
111
|
-
"aria-labelledby": labelId,
|
|
107
|
+
"aria-labelledby": label ? labelId : undefined,
|
|
108
|
+
"aria-label": label ? undefined : "Checkbox",
|
|
112
109
|
checked: checked !== null && checked !== void 0 ? checked : innerChecked,
|
|
113
110
|
disabled: disabled,
|
|
114
111
|
readOnly: readOnly,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,7 +6,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
6
6
|
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
var _react2 = require("@testing-library/react");
|
|
8
8
|
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
9
|
-
var _Checkbox = _interopRequireDefault(require("./Checkbox
|
|
9
|
+
var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
10
10
|
describe("Checkbox component tests", function () {
|
|
11
11
|
test("Checkbox renders with correct aria-labelledby and aria-required", function () {
|
|
12
12
|
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,8 +5,8 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
5
5
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
6
6
|
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
var _react2 = require("@testing-library/react");
|
|
8
|
-
var
|
|
9
|
-
var _Chip = _interopRequireDefault(require("./Chip
|
|
8
|
+
var _axeHelper = require("../../test/accessibility/axe-helper.js");
|
|
9
|
+
var _Chip = _interopRequireDefault(require("./Chip"));
|
|
10
10
|
var iconSVG = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
11
11
|
version: "1.1",
|
|
12
12
|
x: "0px",
|
|
@@ -31,7 +31,7 @@ describe("Chip component accessibility tests", function () {
|
|
|
31
31
|
label: "Chip"
|
|
32
32
|
})), container = _render.container;
|
|
33
33
|
_context.next = 3;
|
|
34
|
-
return (0,
|
|
34
|
+
return (0, _axeHelper.axe)(container);
|
|
35
35
|
case 3:
|
|
36
36
|
results = _context.sent;
|
|
37
37
|
expect(results).toHaveNoViolations();
|
|
@@ -54,7 +54,7 @@ describe("Chip component accessibility tests", function () {
|
|
|
54
54
|
disabled: true
|
|
55
55
|
})), container = _render2.container;
|
|
56
56
|
_context2.next = 3;
|
|
57
|
-
return (0,
|
|
57
|
+
return (0, _axeHelper.axe)(container);
|
|
58
58
|
case 3:
|
|
59
59
|
results = _context2.sent;
|
|
60
60
|
expect(results).toHaveNoViolations();
|
package/chip/Chip.js
CHANGED
|
@@ -16,7 +16,7 @@ var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
|
16
16
|
var _Icon = _interopRequireDefault(require("../icon/Icon"));
|
|
17
17
|
var _templateObject, _templateObject2, _templateObject3;
|
|
18
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
20
20
|
var DxcChip = function DxcChip(_ref) {
|
|
21
21
|
var label = _ref.label,
|
|
22
22
|
suffixIcon = _ref.suffixIcon,
|
|
@@ -35,6 +35,7 @@ var DxcChip = function DxcChip(_ref) {
|
|
|
35
35
|
margin: margin
|
|
36
36
|
}, prefixIcon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
37
37
|
role: typeof onClickPrefix === "function" ? "button" : undefined,
|
|
38
|
+
"aria-label": typeof onClickPrefix === "function" ? "Prefix Action" : undefined,
|
|
38
39
|
disabled: disabled,
|
|
39
40
|
interactuable: typeof onClickPrefix === "function" && !disabled,
|
|
40
41
|
tabIndex: typeof onClickPrefix === "function" && !disabled ? tabIndex : -1,
|
|
@@ -47,6 +48,7 @@ var DxcChip = function DxcChip(_ref) {
|
|
|
47
48
|
disabled: disabled
|
|
48
49
|
}, label), suffixIcon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
49
50
|
role: typeof onClickSuffix === "function" ? "button" : undefined,
|
|
51
|
+
"aria-label": typeof onClickSuffix === "function" ? "Suffix Action" : undefined,
|
|
50
52
|
disabled: disabled,
|
|
51
53
|
interactuable: typeof onClickSuffix === "function" && !disabled,
|
|
52
54
|
tabIndex: typeof onClickSuffix === "function" && !disabled ? tabIndex : -1,
|
package/chip/Chip.stories.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { userEvent, within } from "@storybook/
|
|
2
|
+
import { userEvent, within } from "@storybook/test";
|
|
3
3
|
import DxcChip from "./Chip";
|
|
4
4
|
import Title from "../../.storybook/components/Title";
|
|
5
5
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/chip/Chip.test.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
var _react = _interopRequireDefault(require("react"));
|
|
5
5
|
var _react2 = require("@testing-library/react");
|
|
6
|
-
var _Chip = _interopRequireDefault(require("./Chip
|
|
6
|
+
var _Chip = _interopRequireDefault(require("./Chip"));
|
|
7
7
|
describe("Chip component tests", function () {
|
|
8
8
|
test("Chip renders with correct text", function () {
|
|
9
9
|
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Chip["default"], {
|
package/common/coreTokens.js
CHANGED
|
@@ -112,10 +112,10 @@ var getCoreColorToken = exports.getCoreColorToken = function getCoreColorToken(k
|
|
|
112
112
|
return CoreColorTokens[key];
|
|
113
113
|
};
|
|
114
114
|
/**
|
|
115
|
-
* Halstack Spacing
|
|
115
|
+
* Halstack Spacing Values
|
|
116
116
|
* @link https://developer.dxc.com/halstack/next/principles/spacing/
|
|
117
117
|
*/
|
|
118
|
-
var
|
|
118
|
+
var CoreSpacingTokens = {
|
|
119
119
|
spacing_0: "0rem",
|
|
120
120
|
spacing_2: "0.125rem",
|
|
121
121
|
spacing_4: "0.25rem",
|
|
@@ -132,7 +132,7 @@ var SpacingTokens = {
|
|
|
132
132
|
spacing_96: "6rem",
|
|
133
133
|
spacing_112: "7rem"
|
|
134
134
|
};
|
|
135
|
-
var CoreTokens = _objectSpread(_objectSpread(_objectSpread({}, CoreColorTokens),
|
|
135
|
+
var CoreTokens = _objectSpread(_objectSpread(_objectSpread({}, CoreColorTokens), CoreSpacingTokens), {}, {
|
|
136
136
|
inherit: "inherit",
|
|
137
137
|
// Typography
|
|
138
138
|
type_sans: "Open Sans, sans-serif",
|
package/common/variables.d.ts
CHANGED
|
@@ -251,8 +251,7 @@ export declare const componentTokens: {
|
|
|
251
251
|
dialog: {
|
|
252
252
|
overlayColor: string;
|
|
253
253
|
backgroundColor: string;
|
|
254
|
-
|
|
255
|
-
closeIconHeight: string;
|
|
254
|
+
closeIconSize: string;
|
|
256
255
|
closeIconTopPosition: string;
|
|
257
256
|
closeIconRightPosition: string;
|
|
258
257
|
closeIconBackgroundColor: string;
|
|
@@ -290,7 +289,6 @@ export declare const componentTokens: {
|
|
|
290
289
|
disabledColor: string;
|
|
291
290
|
disabledButtonBackgroundColor: string;
|
|
292
291
|
disabledButtonBorderColor: string;
|
|
293
|
-
disabledBorderColor: string;
|
|
294
292
|
optionBackgroundColor: string;
|
|
295
293
|
hoverOptionBackgroundColor: string;
|
|
296
294
|
activeOptionBackgroundColor: string;
|
|
@@ -330,7 +328,6 @@ export declare const componentTokens: {
|
|
|
330
328
|
focusDropBorderColor: string;
|
|
331
329
|
disabledDropBorderColor: string;
|
|
332
330
|
dragoverDropBackgroundColor: string;
|
|
333
|
-
activeFileItemIconBackgrounColor: string;
|
|
334
331
|
errorFileItemBorderColor: string;
|
|
335
332
|
errorFileItemBackgroundColor: string;
|
|
336
333
|
errorFilePreviewBackgroundColor: string;
|
|
@@ -531,8 +528,8 @@ export declare const componentTokens: {
|
|
|
531
528
|
totalItemsContainerMarginLeft: string;
|
|
532
529
|
};
|
|
533
530
|
paragraph: {
|
|
534
|
-
fontColor: string;
|
|
535
531
|
display: string;
|
|
532
|
+
fontColor: string;
|
|
536
533
|
fontSize: string;
|
|
537
534
|
fontWeight: string;
|
|
538
535
|
};
|
package/common/variables.js
CHANGED
|
@@ -20,18 +20,18 @@ var componentTokens = exports.componentTokens = {
|
|
|
20
20
|
assistiveTextFontColor: _coreTokens["default"].color_grey_700,
|
|
21
21
|
disabledAssistiveTextFontColor: _coreTokens["default"].color_grey_500,
|
|
22
22
|
assistiveTextMinWidth: "100px",
|
|
23
|
-
assistiveTextPaddingRight: "
|
|
24
|
-
assistiveTextPaddingLeft: "
|
|
23
|
+
assistiveTextPaddingRight: _coreTokens["default"].spacing_24,
|
|
24
|
+
assistiveTextPaddingLeft: _coreTokens["default"].spacing_0,
|
|
25
25
|
titleLabelFontFamily: _coreTokens["default"].type_sans,
|
|
26
26
|
titleLabelFontSize: _coreTokens["default"].type_scale_03,
|
|
27
27
|
titleLabelFontWeight: _coreTokens["default"].type_regular,
|
|
28
28
|
titleLabelFontStyle: _coreTokens["default"].type_normal,
|
|
29
29
|
titleLabelFontColor: _coreTokens["default"].color_black,
|
|
30
30
|
disabledTitleLabelFontColor: _coreTokens["default"].color_grey_500,
|
|
31
|
-
titleLabelPaddingTop: "
|
|
32
|
-
titleLabelPaddingBottom: "
|
|
33
|
-
titleLabelPaddingLeft: "
|
|
34
|
-
titleLabelPaddingRight: "
|
|
31
|
+
titleLabelPaddingTop: _coreTokens["default"].spacing_0,
|
|
32
|
+
titleLabelPaddingBottom: _coreTokens["default"].spacing_0,
|
|
33
|
+
titleLabelPaddingLeft: _coreTokens["default"].spacing_0,
|
|
34
|
+
titleLabelPaddingRight: _coreTokens["default"].spacing_16,
|
|
35
35
|
focusBorderColor: _coreTokens["default"].color_blue_600,
|
|
36
36
|
focusBorderStyle: _coreTokens["default"].border_solid,
|
|
37
37
|
focusBorderThickness: "2px",
|
|
@@ -43,8 +43,8 @@ var componentTokens = exports.componentTokens = {
|
|
|
43
43
|
iconColor: _coreTokens["default"].color_purple_700,
|
|
44
44
|
disabledIconColor: _coreTokens["default"].color_grey_500,
|
|
45
45
|
iconSize: "24px",
|
|
46
|
-
iconMarginLeft: "
|
|
47
|
-
iconMarginRight: "
|
|
46
|
+
iconMarginLeft: _coreTokens["default"].spacing_0,
|
|
47
|
+
iconMarginRight: _coreTokens["default"].spacing_12,
|
|
48
48
|
accordionGroupSeparatorBorderColor: _coreTokens["default"].color_grey_200_a,
|
|
49
49
|
accordionGroupSeparatorBorderThickness: "1px",
|
|
50
50
|
accordionGroupSeparatorBorderRadius: "0px",
|
|
@@ -57,17 +57,17 @@ var componentTokens = exports.componentTokens = {
|
|
|
57
57
|
titleFontStyle: _coreTokens["default"].type_normal,
|
|
58
58
|
titleFontWeight: _coreTokens["default"].type_bold,
|
|
59
59
|
titleTextTransform: _coreTokens["default"].type_uppercase,
|
|
60
|
-
titlePaddingRight: "
|
|
61
|
-
titlePaddingLeft: "
|
|
60
|
+
titlePaddingRight: _coreTokens["default"].spacing_0,
|
|
61
|
+
titlePaddingLeft: _coreTokens["default"].spacing_0,
|
|
62
62
|
inlineTextFontFamily: _coreTokens["default"].type_sans,
|
|
63
63
|
inlineTextFontColor: _coreTokens["default"].color_black,
|
|
64
64
|
inlineTextFontSize: _coreTokens["default"].type_scale_01,
|
|
65
65
|
inlineTextFontStyle: _coreTokens["default"].type_normal,
|
|
66
66
|
inlineTextFontWeight: _coreTokens["default"].type_regular,
|
|
67
|
-
inlineTextPaddingLeft: "
|
|
68
|
-
inlineTextPaddingRight: "
|
|
69
|
-
contentPaddingLeft: "
|
|
70
|
-
contentPaddingRight: "
|
|
67
|
+
inlineTextPaddingLeft: _coreTokens["default"].spacing_0,
|
|
68
|
+
inlineTextPaddingRight: _coreTokens["default"].spacing_0,
|
|
69
|
+
contentPaddingLeft: _coreTokens["default"].spacing_0,
|
|
70
|
+
contentPaddingRight: _coreTokens["default"].spacing_0,
|
|
71
71
|
contentPaddingTop: "20px",
|
|
72
72
|
contentPaddingBottom: "30px",
|
|
73
73
|
borderRadius: "4px",
|
|
@@ -78,8 +78,8 @@ var componentTokens = exports.componentTokens = {
|
|
|
78
78
|
warningBorderColor: _coreTokens["default"].color_yellow_700,
|
|
79
79
|
errorBorderColor: _coreTokens["default"].color_red_700,
|
|
80
80
|
iconSize: "24px",
|
|
81
|
-
iconPaddingLeft: "
|
|
82
|
-
iconPaddingRight: "
|
|
81
|
+
iconPaddingLeft: _coreTokens["default"].spacing_0,
|
|
82
|
+
iconPaddingRight: _coreTokens["default"].spacing_0,
|
|
83
83
|
infoIconColor: _coreTokens["default"].color_blue_800,
|
|
84
84
|
successIconColor: _coreTokens["default"].color_green_700,
|
|
85
85
|
warningIconColor: _coreTokens["default"].color_yellow_700,
|
|
@@ -121,7 +121,7 @@ var componentTokens = exports.componentTokens = {
|
|
|
121
121
|
bulletIconWidth: "1.5rem",
|
|
122
122
|
bulletHeight: "5px",
|
|
123
123
|
bulletWidth: "5px",
|
|
124
|
-
bulletMarginRight: "
|
|
124
|
+
bulletMarginRight: _coreTokens["default"].spacing_8
|
|
125
125
|
},
|
|
126
126
|
button: {
|
|
127
127
|
labelFontLineHeight: _coreTokens["default"].type_leading_normal,
|
|
@@ -195,7 +195,7 @@ var componentTokens = exports.componentTokens = {
|
|
|
195
195
|
fontColor: _coreTokens["default"].color_black,
|
|
196
196
|
disabledFontColor: _coreTokens["default"].color_grey_500,
|
|
197
197
|
focusColor: _coreTokens["default"].color_blue_600,
|
|
198
|
-
checkLabelSpacing: "
|
|
198
|
+
checkLabelSpacing: _coreTokens["default"].spacing_8
|
|
199
199
|
},
|
|
200
200
|
chip: {
|
|
201
201
|
backgroundColor: _coreTokens["default"].color_grey_200,
|
|
@@ -210,12 +210,12 @@ var componentTokens = exports.componentTokens = {
|
|
|
210
210
|
borderRadius: "80px",
|
|
211
211
|
borderThickness: _coreTokens["default"].border_width_0,
|
|
212
212
|
borderStyle: _coreTokens["default"].border_solid,
|
|
213
|
-
contentPaddingLeft: "
|
|
214
|
-
contentPaddingRight: "
|
|
215
|
-
contentPaddingTop: "
|
|
216
|
-
contentPaddingBottom: "
|
|
213
|
+
contentPaddingLeft: _coreTokens["default"].spacing_16,
|
|
214
|
+
contentPaddingRight: _coreTokens["default"].spacing_16,
|
|
215
|
+
contentPaddingTop: _coreTokens["default"].spacing_0,
|
|
216
|
+
contentPaddingBottom: _coreTokens["default"].spacing_0,
|
|
217
217
|
iconSize: "24px",
|
|
218
|
-
iconSpacing: "
|
|
218
|
+
iconSpacing: _coreTokens["default"].spacing_8,
|
|
219
219
|
iconColor: _coreTokens["default"].color_grey_800,
|
|
220
220
|
hoverIconColor: _coreTokens["default"].color_grey_900,
|
|
221
221
|
activeIconColor: _coreTokens["default"].color_black,
|
|
@@ -259,8 +259,7 @@ var componentTokens = exports.componentTokens = {
|
|
|
259
259
|
dialog: {
|
|
260
260
|
overlayColor: _coreTokens["default"].color_grey_800_a,
|
|
261
261
|
backgroundColor: _coreTokens["default"].color_white,
|
|
262
|
-
|
|
263
|
-
closeIconHeight: "24px",
|
|
262
|
+
closeIconSize: "24px",
|
|
264
263
|
closeIconTopPosition: "20px",
|
|
265
264
|
closeIconRightPosition: "20px",
|
|
266
265
|
closeIconBackgroundColor: _coreTokens["default"].color_transparent,
|
|
@@ -286,10 +285,10 @@ var componentTokens = exports.componentTokens = {
|
|
|
286
285
|
buttonIconSize: "20px",
|
|
287
286
|
buttonIconSpacing: "10px",
|
|
288
287
|
buttonIconColor: _coreTokens["default"].color_black,
|
|
289
|
-
buttonPaddingTop: "
|
|
290
|
-
buttonPaddingBottom: "
|
|
291
|
-
buttonPaddingLeft: "
|
|
292
|
-
buttonPaddingRight: "
|
|
288
|
+
buttonPaddingTop: _coreTokens["default"].spacing_0,
|
|
289
|
+
buttonPaddingBottom: _coreTokens["default"].spacing_0,
|
|
290
|
+
buttonPaddingLeft: _coreTokens["default"].spacing_16,
|
|
291
|
+
buttonPaddingRight: _coreTokens["default"].spacing_16,
|
|
293
292
|
buttonHeight: "40px",
|
|
294
293
|
buttonBorderRadius: "4px",
|
|
295
294
|
buttonBorderStyle: _coreTokens["default"].border_none,
|
|
@@ -298,7 +297,6 @@ var componentTokens = exports.componentTokens = {
|
|
|
298
297
|
disabledColor: _coreTokens["default"].color_grey_500,
|
|
299
298
|
disabledButtonBackgroundColor: _coreTokens["default"].color_transparent,
|
|
300
299
|
disabledButtonBorderColor: _coreTokens["default"].color_transparent,
|
|
301
|
-
disabledBorderColor: _coreTokens["default"].color_transparent,
|
|
302
300
|
optionBackgroundColor: _coreTokens["default"].color_white,
|
|
303
301
|
hoverOptionBackgroundColor: _coreTokens["default"].color_grey_100,
|
|
304
302
|
activeOptionBackgroundColor: _coreTokens["default"].color_grey_300,
|
|
@@ -312,11 +310,11 @@ var componentTokens = exports.componentTokens = {
|
|
|
312
310
|
optionIconColor: _coreTokens["default"].color_black,
|
|
313
311
|
optionPaddingTop: "6px",
|
|
314
312
|
optionPaddingBottom: "6px",
|
|
315
|
-
optionPaddingLeft: "
|
|
316
|
-
optionPaddingRight: "
|
|
313
|
+
optionPaddingLeft: _coreTokens["default"].spacing_16,
|
|
314
|
+
optionPaddingRight: _coreTokens["default"].spacing_16,
|
|
317
315
|
caretIconSize: "24px",
|
|
318
316
|
caretIconColor: _coreTokens["default"].color_black,
|
|
319
|
-
caretIconSpacing: "
|
|
317
|
+
caretIconSpacing: _coreTokens["default"].spacing_12,
|
|
320
318
|
borderRadius: "4px",
|
|
321
319
|
borderStyle: _coreTokens["default"].border_none,
|
|
322
320
|
borderThickness: _coreTokens["default"].border_width_0,
|
|
@@ -338,7 +336,6 @@ var componentTokens = exports.componentTokens = {
|
|
|
338
336
|
focusDropBorderColor: _coreTokens["default"].color_blue_600,
|
|
339
337
|
disabledDropBorderColor: _coreTokens["default"].color_grey_500,
|
|
340
338
|
dragoverDropBackgroundColor: _coreTokens["default"].color_blue_50,
|
|
341
|
-
activeFileItemIconBackgrounColor: _coreTokens["default"].color_grey_300,
|
|
342
339
|
errorFileItemBorderColor: _coreTokens["default"].color_red_700,
|
|
343
340
|
errorFileItemBackgroundColor: _coreTokens["default"].color_red_50,
|
|
344
341
|
errorFilePreviewBackgroundColor: _coreTokens["default"].color_red_200,
|
|
@@ -384,7 +381,7 @@ var componentTokens = exports.componentTokens = {
|
|
|
384
381
|
bottomLinksDividerColor: _coreTokens["default"].color_blue_600,
|
|
385
382
|
bottomLinksDividerThickness: "1px",
|
|
386
383
|
bottomLinksDividerStyle: _coreTokens["default"].border_solid,
|
|
387
|
-
bottomLinksDividerSpacing: "
|
|
384
|
+
bottomLinksDividerSpacing: _coreTokens["default"].spacing_8,
|
|
388
385
|
bottomLinksFontFamily: _coreTokens["default"].type_sans,
|
|
389
386
|
bottomLinksFontSize: _coreTokens["default"].type_scale_01,
|
|
390
387
|
bottomLinksFontStyle: _coreTokens["default"].type_normal,
|
|
@@ -400,7 +397,7 @@ var componentTokens = exports.componentTokens = {
|
|
|
400
397
|
logoHeight: "32px",
|
|
401
398
|
logoWidth: "auto",
|
|
402
399
|
socialLinksSize: "24px",
|
|
403
|
-
socialLinksGutter: "
|
|
400
|
+
socialLinksGutter: _coreTokens["default"].spacing_16,
|
|
404
401
|
socialLinksColor: _coreTokens["default"].color_white
|
|
405
402
|
},
|
|
406
403
|
header: {
|
|
@@ -426,10 +423,10 @@ var componentTokens = exports.componentTokens = {
|
|
|
426
423
|
overlayColor: _coreTokens["default"].color_grey_800_a,
|
|
427
424
|
overlayOpacity: "0.7",
|
|
428
425
|
overlayZindex: "1600",
|
|
429
|
-
paddingTop: "
|
|
430
|
-
paddingBottom: "
|
|
431
|
-
paddingRight: "
|
|
432
|
-
paddingLeft: "
|
|
426
|
+
paddingTop: _coreTokens["default"].spacing_0,
|
|
427
|
+
paddingBottom: _coreTokens["default"].spacing_0,
|
|
428
|
+
paddingRight: _coreTokens["default"].spacing_24,
|
|
429
|
+
paddingLeft: _coreTokens["default"].spacing_24,
|
|
433
430
|
underlinedColor: _coreTokens["default"].color_black,
|
|
434
431
|
underlinedThickness: "2px",
|
|
435
432
|
underlinedStyle: _coreTokens["default"].border_solid,
|
|
@@ -487,8 +484,8 @@ var componentTokens = exports.componentTokens = {
|
|
|
487
484
|
fontStyle: _coreTokens["default"].type_normal,
|
|
488
485
|
fontWeight: _coreTokens["default"].type_regular,
|
|
489
486
|
iconSize: "16px",
|
|
490
|
-
iconSpacing: "
|
|
491
|
-
underlineSpacing: "
|
|
487
|
+
iconSpacing: _coreTokens["default"].spacing_4,
|
|
488
|
+
underlineSpacing: _coreTokens["default"].spacing_0,
|
|
492
489
|
underlineStyle: _coreTokens["default"].border_solid,
|
|
493
490
|
underlineThickness: "1px",
|
|
494
491
|
disabledFontColor: _coreTokens["default"].color_grey_500,
|
|
@@ -527,20 +524,20 @@ var componentTokens = exports.componentTokens = {
|
|
|
527
524
|
fontStyle: _coreTokens["default"].type_normal,
|
|
528
525
|
fontWeight: _coreTokens["default"].type_regular,
|
|
529
526
|
fontTextTransform: "none",
|
|
530
|
-
verticalPadding: "
|
|
531
|
-
horizontalPadding: "
|
|
532
|
-
marginRight: "
|
|
527
|
+
verticalPadding: _coreTokens["default"].spacing_12,
|
|
528
|
+
horizontalPadding: _coreTokens["default"].spacing_32,
|
|
529
|
+
marginRight: _coreTokens["default"].spacing_40,
|
|
533
530
|
marginLeft: "20px",
|
|
534
|
-
itemsPerPageSelectorMarginLeft: "
|
|
535
|
-
itemsPerPageSelectorMarginRight: "
|
|
531
|
+
itemsPerPageSelectorMarginLeft: _coreTokens["default"].spacing_0,
|
|
532
|
+
itemsPerPageSelectorMarginRight: _coreTokens["default"].spacing_8,
|
|
536
533
|
pageSelectorMarginRight: "30px",
|
|
537
|
-
pageSelectorMarginLeft: "
|
|
538
|
-
totalItemsContainerMarginRight: "
|
|
539
|
-
totalItemsContainerMarginLeft: "
|
|
534
|
+
pageSelectorMarginLeft: _coreTokens["default"].spacing_0,
|
|
535
|
+
totalItemsContainerMarginRight: _coreTokens["default"].spacing_40,
|
|
536
|
+
totalItemsContainerMarginLeft: _coreTokens["default"].spacing_0
|
|
540
537
|
},
|
|
541
538
|
paragraph: {
|
|
542
|
-
fontColor: _coreTokens["default"].color_black,
|
|
543
539
|
display: "block",
|
|
540
|
+
fontColor: _coreTokens["default"].color_black,
|
|
544
541
|
fontSize: _coreTokens["default"].type_scale_03,
|
|
545
542
|
fontWeight: _coreTokens["default"].type_regular
|
|
546
543
|
},
|
|
@@ -726,10 +723,10 @@ var componentTokens = exports.componentTokens = {
|
|
|
726
723
|
linkFontTextTransform: "none",
|
|
727
724
|
linkFontLetterSpacing: _coreTokens["default"].type_spacing_wide_01,
|
|
728
725
|
linkTextDecoration: _coreTokens["default"].type_no_line,
|
|
729
|
-
linkMarginTop: "
|
|
730
|
-
linkMarginBottom: "
|
|
731
|
-
linkMarginRight: "
|
|
732
|
-
linkMarginLeft: "
|
|
726
|
+
linkMarginTop: _coreTokens["default"].spacing_4,
|
|
727
|
+
linkMarginBottom: _coreTokens["default"].spacing_4,
|
|
728
|
+
linkMarginRight: _coreTokens["default"].spacing_16,
|
|
729
|
+
linkMarginLeft: _coreTokens["default"].spacing_16,
|
|
733
730
|
linkFocusColor: _coreTokens["default"].color_blue_600,
|
|
734
731
|
scrollBarThumbColor: _coreTokens["default"].color_grey_200_a,
|
|
735
732
|
scrollBarTrackColor: _coreTokens["default"].color_transparent
|
|
@@ -843,7 +840,7 @@ var componentTokens = exports.componentTokens = {
|
|
|
843
840
|
thumbShift: "1.25rem",
|
|
844
841
|
trackHeight: "12px",
|
|
845
842
|
trackWidth: "36px",
|
|
846
|
-
spaceBetweenLabelSwitch: "
|
|
843
|
+
spaceBetweenLabelSwitch: _coreTokens["default"].spacing_8
|
|
847
844
|
},
|
|
848
845
|
table: {
|
|
849
846
|
rowSeparatorThickness: "1px",
|
|
@@ -856,8 +853,8 @@ var componentTokens = exports.componentTokens = {
|
|
|
856
853
|
dataFontWeight: _coreTokens["default"].type_regular,
|
|
857
854
|
dataFontColor: _coreTokens["default"].color_black,
|
|
858
855
|
dataFontTextTransform: "none",
|
|
859
|
-
dataPaddingTop: "
|
|
860
|
-
dataPaddingBottom: "
|
|
856
|
+
dataPaddingTop: _coreTokens["default"].spacing_16,
|
|
857
|
+
dataPaddingBottom: _coreTokens["default"].spacing_16,
|
|
861
858
|
dataPaddingRight: "20px",
|
|
862
859
|
dataPaddingLeft: "20px",
|
|
863
860
|
dataPaddingTopReduced: _coreTokens["default"].spacing_8,
|
|
@@ -878,8 +875,8 @@ var componentTokens = exports.componentTokens = {
|
|
|
878
875
|
headerFontWeight: _coreTokens["default"].type_regular,
|
|
879
876
|
headerFontColor: _coreTokens["default"].color_white,
|
|
880
877
|
headerFontTextTransform: "none",
|
|
881
|
-
headerPaddingTop: "
|
|
882
|
-
headerPaddingBottom: "
|
|
878
|
+
headerPaddingTop: _coreTokens["default"].spacing_16,
|
|
879
|
+
headerPaddingBottom: _coreTokens["default"].spacing_16,
|
|
883
880
|
headerPaddingRight: "20px",
|
|
884
881
|
headerPaddingLeft: "20px",
|
|
885
882
|
headerPaddingTopReduced: _coreTokens["default"].spacing_8,
|
|
@@ -933,10 +930,10 @@ var componentTokens = exports.componentTokens = {
|
|
|
933
930
|
fontSize: _coreTokens["default"].type_scale_02,
|
|
934
931
|
fontStyle: _coreTokens["default"].type_normal,
|
|
935
932
|
fontWeight: _coreTokens["default"].type_regular,
|
|
936
|
-
labelPaddingTop: "
|
|
937
|
-
labelPaddingBottom: "
|
|
938
|
-
labelPaddingLeft: "
|
|
939
|
-
labelPaddingRight: "
|
|
933
|
+
labelPaddingTop: _coreTokens["default"].spacing_0,
|
|
934
|
+
labelPaddingBottom: _coreTokens["default"].spacing_0,
|
|
935
|
+
labelPaddingLeft: _coreTokens["default"].spacing_16,
|
|
936
|
+
labelPaddingRight: _coreTokens["default"].spacing_16,
|
|
940
937
|
height: "40px",
|
|
941
938
|
iconColor: _coreTokens["default"].color_white,
|
|
942
939
|
iconSectionWidth: "40px",
|
|
@@ -1154,13 +1151,13 @@ var componentTokens = exports.componentTokens = {
|
|
|
1154
1151
|
}
|
|
1155
1152
|
};
|
|
1156
1153
|
var spaces = exports.spaces = {
|
|
1157
|
-
xxsmall: "
|
|
1158
|
-
xsmall: "
|
|
1159
|
-
small: "
|
|
1160
|
-
medium: "
|
|
1161
|
-
large: "
|
|
1162
|
-
xlarge: "
|
|
1163
|
-
xxlarge: "
|
|
1154
|
+
xxsmall: _coreTokens["default"].spacing_4,
|
|
1155
|
+
xsmall: _coreTokens["default"].spacing_8,
|
|
1156
|
+
small: _coreTokens["default"].spacing_12,
|
|
1157
|
+
medium: _coreTokens["default"].spacing_16,
|
|
1158
|
+
large: _coreTokens["default"].spacing_24,
|
|
1159
|
+
xlarge: _coreTokens["default"].spacing_32,
|
|
1160
|
+
xxlarge: _coreTokens["default"].spacing_48
|
|
1164
1161
|
};
|
|
1165
1162
|
var responsiveSizes = exports.responsiveSizes = {
|
|
1166
1163
|
xsmall: "20",
|
|
@@ -108,7 +108,7 @@ export const Chromatic = () => (
|
|
|
108
108
|
width="50px"
|
|
109
109
|
height="50px"
|
|
110
110
|
>
|
|
111
|
-
<b>1</b>
|
|
111
|
+
<b tabIndex={0}>1</b>
|
|
112
112
|
</DxcContainer>
|
|
113
113
|
<DxcContainer
|
|
114
114
|
border={{ width: "1px", style: "solid", color: "color_black" }}
|
|
@@ -116,7 +116,7 @@ export const Chromatic = () => (
|
|
|
116
116
|
width="50px"
|
|
117
117
|
height="50px"
|
|
118
118
|
>
|
|
119
|
-
<b>2</b>
|
|
119
|
+
<b tabIndex={0}>2</b>
|
|
120
120
|
</DxcContainer>
|
|
121
121
|
<DxcContainer
|
|
122
122
|
border={{ width: "1px", style: "solid", color: "color_black" }}
|
|
@@ -124,7 +124,7 @@ export const Chromatic = () => (
|
|
|
124
124
|
width="50px"
|
|
125
125
|
height="50px"
|
|
126
126
|
>
|
|
127
|
-
<b>3</b>
|
|
127
|
+
<b tabIndex={0}>3</b>
|
|
128
128
|
</DxcContainer>
|
|
129
129
|
</DxcContainer>
|
|
130
130
|
</ExampleContainer>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,8 +5,20 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
5
5
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
6
6
|
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
var _react2 = require("@testing-library/react");
|
|
8
|
-
var
|
|
8
|
+
var _axeHelper = require("../../test/accessibility/axe-helper.js");
|
|
9
9
|
var _ContextualMenu = _interopRequireDefault(require("./ContextualMenu"));
|
|
10
|
+
var _Badge = _interopRequireDefault(require("../badge/Badge"));
|
|
11
|
+
var _disabledRules = require("../../test/accessibility/rules/specific/contextual-menu/disabledRules.js");
|
|
12
|
+
// TODO: REMOVE
|
|
13
|
+
|
|
14
|
+
var disabledRules = {
|
|
15
|
+
rules: _disabledRules.disabledRules.reduce(function (rulesObj, rule) {
|
|
16
|
+
rulesObj[rule] = {
|
|
17
|
+
enabled: false
|
|
18
|
+
};
|
|
19
|
+
return rulesObj;
|
|
20
|
+
}, {})
|
|
21
|
+
};
|
|
10
22
|
var badge_icon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
11
23
|
width: "24",
|
|
12
24
|
height: "24",
|
|
@@ -40,7 +52,7 @@ var fav_icon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
|
40
52
|
}));
|
|
41
53
|
var itemsWithTruncatedText = [{
|
|
42
54
|
label: "Item with a very long label that should be truncated",
|
|
43
|
-
slot: /*#__PURE__*/_react["default"].createElement(
|
|
55
|
+
slot: /*#__PURE__*/_react["default"].createElement(_Badge["default"], {
|
|
44
56
|
color: "blue",
|
|
45
57
|
mode: "contextual",
|
|
46
58
|
label: "Label",
|
|
@@ -73,7 +85,7 @@ describe("Context menu accessibility tests", function () {
|
|
|
73
85
|
items: itemsWithTruncatedText
|
|
74
86
|
})), container = _render.container;
|
|
75
87
|
_context.next = 3;
|
|
76
|
-
return (0,
|
|
88
|
+
return (0, _axeHelper.axe)(container, disabledRules);
|
|
77
89
|
case 3:
|
|
78
90
|
results = _context.sent;
|
|
79
91
|
expect(results).toHaveNoViolations();
|