@dxc-technology/halstack-react 11.0.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BackgroundColorContext.d.ts +1 -10
- package/BackgroundColorContext.js +3 -8
- package/HalstackContext.d.ts +32 -142
- package/HalstackContext.js +2 -2
- package/accordion/Accordion.accessibility.test.js +71 -0
- package/accordion/Accordion.js +13 -27
- package/accordion/Accordion.stories.tsx +7 -49
- package/accordion/types.d.ts +1 -1
- package/accordion-group/AccordionGroup.accessibility.test.js +88 -0
- package/accordion-group/AccordionGroup.d.ts +2 -3
- package/accordion-group/AccordionGroup.js +4 -4
- package/accordion-group/AccordionGroup.stories.tsx +23 -23
- package/accordion-group/AccordionGroupAccordion.js +3 -3
- package/accordion-group/AccordionGroupContext.d.ts +3 -0
- package/accordion-group/AccordionGroupContext.js +8 -0
- package/accordion-group/types.d.ts +1 -1
- package/action-icon/ActionIcon.accessibility.test.js +63 -0
- package/action-icon/ActionIcon.d.ts +4 -0
- package/action-icon/ActionIcon.js +48 -0
- package/action-icon/ActionIcon.stories.tsx +41 -0
- package/action-icon/ActionIcon.test.js +64 -0
- package/action-icon/types.d.ts +26 -0
- package/action-icon/types.js +5 -0
- package/alert/Alert.accessibility.test.js +95 -0
- package/alert/Alert.js +21 -75
- package/badge/Badge.accessibility.test.js +129 -0
- package/badge/Badge.d.ts +1 -1
- package/badge/Badge.js +141 -28
- package/badge/Badge.stories.tsx +210 -0
- package/badge/Badge.test.js +30 -0
- package/badge/types.d.ts +52 -3
- package/box/Box.accessibility.test.js +33 -0
- package/box/Box.js +2 -5
- 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 +169 -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.js +119 -0
- package/bulleted-list/BulletedList.js +16 -23
- package/bulleted-list/BulletedList.stories.tsx +1 -2
- package/button/Button.accessibility.test.js +127 -0
- package/button/Button.js +16 -16
- package/button/Button.stories.tsx +34 -53
- package/button/Button.test.js +3 -1
- package/button/types.d.ts +1 -1
- package/card/Card.accessibility.test.js +36 -0
- package/card/Card.js +3 -2
- package/checkbox/Checkbox.accessibility.test.js +87 -0
- package/checkbox/Checkbox.js +31 -36
- package/chip/Chip.accessibility.test.js +67 -0
- package/chip/Chip.js +11 -6
- package/chip/Chip.stories.tsx +10 -25
- package/chip/Chip.test.js +4 -4
- package/common/coreTokens.d.ts +105 -14
- package/common/coreTokens.js +40 -22
- package/common/variables.d.ts +31 -138
- package/common/variables.js +103 -210
- package/container/Container.d.ts +4 -0
- package/container/Container.js +194 -0
- package/container/Container.stories.tsx +214 -0
- package/container/types.d.ts +74 -0
- package/container/types.js +5 -0
- package/contextual-menu/ContextualMenu.accessibility.test.js +97 -0
- package/contextual-menu/ContextualMenu.d.ts +5 -0
- package/contextual-menu/ContextualMenu.js +88 -0
- package/contextual-menu/ContextualMenu.stories.tsx +232 -0
- package/contextual-menu/ContextualMenu.test.js +205 -0
- 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 +51 -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 +58 -0
- package/contextual-menu/types.js +5 -0
- package/date-input/Calendar.js +1 -1
- package/date-input/DateInput.accessibility.test.js +228 -0
- package/date-input/DateInput.js +4 -5
- package/date-input/DateInput.stories.tsx +15 -8
- package/date-input/DatePicker.js +13 -7
- package/date-input/YearPicker.js +1 -1
- package/date-input/types.d.ts +2 -2
- package/dialog/Dialog.accessibility.test.js +69 -0
- package/dialog/Dialog.js +11 -25
- package/dialog/Dialog.stories.tsx +176 -0
- package/dialog/Dialog.test.js +1 -1
- package/divider/Divider.accessibility.test.js +33 -0
- package/divider/Divider.d.ts +4 -0
- package/divider/Divider.js +36 -0
- package/divider/Divider.stories.tsx +223 -0
- package/divider/Divider.test.js +38 -0
- package/divider/types.d.ts +21 -0
- package/divider/types.js +5 -0
- package/dropdown/Dropdown.accessibility.test.js +180 -0
- package/dropdown/Dropdown.js +26 -39
- package/dropdown/Dropdown.stories.tsx +15 -26
- package/dropdown/Dropdown.test.js +18 -18
- package/dropdown/DropdownMenu.js +4 -4
- package/dropdown/DropdownMenuItem.js +8 -4
- package/dropdown/types.d.ts +3 -5
- package/file-input/FileInput.accessibility.test.js +160 -0
- package/file-input/FileInput.js +126 -141
- package/file-input/FileInput.test.js +84 -110
- package/file-input/FileItem.js +18 -28
- package/file-input/types.d.ts +1 -1
- package/footer/Footer.accessibility.test.js +125 -0
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +36 -31
- package/footer/Footer.stories.tsx +58 -2
- package/footer/Icons.d.ts +1 -0
- package/footer/Icons.js +52 -16
- package/footer/types.d.ts +8 -8
- package/header/Header.accessibility.test.js +93 -0
- package/header/Header.js +20 -41
- package/header/Header.stories.tsx +16 -0
- package/header/Icons.js +1 -6
- package/header/types.d.ts +4 -3
- package/heading/Heading.accessibility.test.js +33 -0
- package/heading/Heading.js +1 -1
- package/icon/Icon.accessibility.test.js +30 -0
- package/icon/Icon.d.ts +4 -0
- package/icon/Icon.js +33 -0
- package/icon/Icon.stories.tsx +28 -0
- package/icon/types.d.ts +4 -0
- package/icon/types.js +5 -0
- package/image/Image.accessibility.test.js +56 -0
- package/image/Image.js +1 -1
- package/image/Image.stories.tsx +3 -1
- package/layout/ApplicationLayout.d.ts +1 -1
- package/layout/ApplicationLayout.js +10 -7
- package/layout/Icons.d.ts +0 -1
- package/layout/Icons.js +1 -11
- package/link/Link.accessibility.test.js +108 -0
- package/link/Link.js +8 -6
- package/link/Link.stories.tsx +4 -4
- package/link/types.d.ts +1 -1
- package/main.d.ts +7 -3
- package/main.js +37 -9
- package/nav-tabs/NavTabs.accessibility.test.js +44 -0
- package/nav-tabs/NavTabs.d.ts +1 -2
- package/nav-tabs/NavTabs.js +10 -7
- package/nav-tabs/NavTabs.stories.tsx +29 -24
- package/nav-tabs/NavTabs.test.js +11 -9
- package/nav-tabs/NavTabsContext.d.ts +3 -0
- package/nav-tabs/NavTabsContext.js +8 -0
- package/nav-tabs/Tab.js +23 -23
- package/nav-tabs/types.d.ts +1 -1
- package/number-input/NumberInput.accessibility.test.js +228 -0
- package/number-input/NumberInput.d.ts +0 -7
- package/number-input/NumberInput.js +24 -5
- package/number-input/NumberInput.test.js +165 -6
- package/number-input/NumberInputContext.d.ts +3 -0
- package/number-input/NumberInputContext.js +8 -0
- package/number-input/types.d.ts +6 -0
- package/package.json +16 -14
- package/paginator/Paginator.accessibility.test.js +79 -0
- package/paginator/Paginator.js +14 -14
- package/paragraph/Paragraph.accessibility.test.js +28 -0
- package/paragraph/Paragraph.js +2 -7
- package/password-input/PasswordInput.accessibility.test.js +153 -0
- package/password-input/PasswordInput.js +7 -7
- package/password-input/PasswordInput.stories.tsx +0 -1
- package/password-input/PasswordInput.test.js +4 -4
- package/progress-bar/ProgressBar.accessibility.test.js +35 -0
- package/progress-bar/ProgressBar.js +11 -15
- package/quick-nav/QuickNav.accessibility.test.js +57 -0
- package/quick-nav/QuickNav.js +1 -1
- package/radio-group/Radio.js +1 -1
- package/radio-group/RadioGroup.accessibility.test.js +97 -0
- package/radio-group/RadioGroup.js +3 -2
- package/resultset-table/ResultsetTable.accessibility.test.js +285 -0
- package/resultset-table/ResultsetTable.d.ts +4 -1
- package/resultset-table/ResultsetTable.js +25 -13
- package/resultset-table/ResultsetTable.stories.tsx +118 -5
- package/resultset-table/ResultsetTable.test.js +76 -0
- package/resultset-table/types.d.ts +40 -7
- package/select/Listbox.js +28 -16
- package/select/Option.js +19 -10
- package/select/Select.accessibility.test.js +228 -0
- package/select/Select.js +57 -37
- package/select/Select.stories.tsx +59 -111
- package/select/Select.test.js +387 -456
- package/select/types.d.ts +3 -3
- package/sidenav/Sidenav.accessibility.test.js +59 -0
- package/sidenav/Sidenav.js +21 -19
- package/sidenav/Sidenav.stories.tsx +4 -9
- package/sidenav/types.d.ts +2 -2
- package/slider/Slider.accessibility.test.js +104 -0
- package/slider/Slider.js +40 -48
- package/spinner/Spinner.accessibility.test.js +96 -0
- package/spinner/Spinner.js +12 -16
- package/status-light/StatusLight.accessibility.test.js +157 -0
- package/status-light/StatusLight.d.ts +4 -0
- package/status-light/StatusLight.js +51 -0
- package/status-light/StatusLight.stories.tsx +74 -0
- package/status-light/StatusLight.test.js +25 -0
- package/status-light/types.d.ts +17 -0
- package/status-light/types.js +5 -0
- package/switch/Switch.accessibility.test.js +98 -0
- package/switch/Switch.js +24 -29
- package/switch/Switch.stories.tsx +12 -0
- package/table/DropdownTheme.js +62 -0
- package/table/Table.accessibility.test.js +93 -0
- package/table/Table.d.ts +6 -2
- package/table/Table.js +74 -12
- package/table/Table.stories.tsx +309 -2
- package/table/Table.test.js +92 -0
- package/table/types.d.ts +28 -0
- package/tabs/Tab.js +13 -9
- package/tabs/Tabs.accessibility.test.js +56 -0
- package/tabs/Tabs.js +12 -24
- package/tabs/Tabs.stories.tsx +8 -4
- package/tabs/Tabs.test.js +19 -37
- package/tabs/types.d.ts +2 -2
- package/tag/Tag.accessibility.test.js +69 -0
- package/tag/Tag.js +7 -7
- package/tag/Tag.stories.tsx +4 -7
- package/tag/Tag.test.js +4 -12
- package/tag/types.d.ts +2 -2
- package/text-input/Suggestion.js +1 -1
- package/text-input/Suggestions.js +19 -14
- package/text-input/TextInput.accessibility.test.js +321 -0
- package/text-input/TextInput.js +84 -105
- package/text-input/TextInput.stories.tsx +17 -8
- package/text-input/TextInput.test.js +96 -79
- package/textarea/Textarea.accessibility.test.js +155 -0
- package/textarea/Textarea.js +12 -17
- package/textarea/Textarea.stories.tsx +0 -1
- package/toggle-group/ToggleGroup.accessibility.test.js +107 -0
- package/toggle-group/ToggleGroup.js +6 -8
- package/toggle-group/ToggleGroup.stories.tsx +3 -3
- package/toggle-group/types.d.ts +2 -2
- package/typography/Typography.accessibility.test.js +339 -0
- package/useTheme.d.ts +31 -138
- package/utils/BaseTypography.js +1 -1
- package/utils/FocusLock.js +16 -6
- package/wizard/Wizard.accessibility.test.js +55 -0
- package/wizard/Wizard.js +14 -25
- package/wizard/Wizard.stories.tsx +19 -0
- package/wizard/types.d.ts +2 -2
- package/common/OpenSans.css +0 -69
- package/common/fonts/OpenSans-Bold.ttf +0 -0
- package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-Italic.ttf +0 -0
- package/common/fonts/OpenSans-Light.ttf +0 -0
- package/common/fonts/OpenSans-LightItalic.ttf +0 -0
- package/common/fonts/OpenSans-Regular.ttf +0 -0
- package/common/fonts/OpenSans-SemiBold.ttf +0 -0
- package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
- package/date-input/Icons.d.ts +0 -6
- package/date-input/Icons.js +0 -58
- package/paginator/Icons.d.ts +0 -5
- package/paginator/Icons.js +0 -40
- package/password-input/Icons.d.ts +0 -6
- package/password-input/Icons.js +0 -35
- package/select/Icons.d.ts +0 -10
- package/select/Icons.js +0 -89
- package/sidenav/Icons.d.ts +0 -7
- package/sidenav/Icons.js +0 -47
- package/text-input/Icons.d.ts +0 -8
- package/text-input/Icons.js +0 -56
- /package/{layout → sidenav}/SidenavContext.d.ts +0 -0
- /package/{layout → sidenav}/SidenavContext.js +0 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
5
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
var _react2 = require("@testing-library/react");
|
|
8
|
+
var _axeHelper = require("../../test/accessibility/axe-helper.js");
|
|
9
|
+
var _Textarea = _interopRequireDefault(require("./Textarea.tsx"));
|
|
10
|
+
describe("Textarea component accessibility tests", function () {
|
|
11
|
+
it("Should not have basic accessibility issues", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
12
|
+
var _render, container, results;
|
|
13
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
14
|
+
while (1) switch (_context.prev = _context.next) {
|
|
15
|
+
case 0:
|
|
16
|
+
_render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Textarea["default"], {
|
|
17
|
+
label: "Example label",
|
|
18
|
+
helperText: "Helper Text",
|
|
19
|
+
defaultValue: "Value",
|
|
20
|
+
margin: "medium",
|
|
21
|
+
placeholder: "Placeholder",
|
|
22
|
+
verticalGrow: "manual",
|
|
23
|
+
name: "Name",
|
|
24
|
+
autocomplete: "on",
|
|
25
|
+
minLength: 0,
|
|
26
|
+
maxLength: 100,
|
|
27
|
+
optional: true
|
|
28
|
+
})), container = _render.container;
|
|
29
|
+
_context.next = 3;
|
|
30
|
+
return (0, _axeHelper.axe)(container);
|
|
31
|
+
case 3:
|
|
32
|
+
results = _context.sent;
|
|
33
|
+
expect(results).toHaveNoViolations();
|
|
34
|
+
case 5:
|
|
35
|
+
case "end":
|
|
36
|
+
return _context.stop();
|
|
37
|
+
}
|
|
38
|
+
}, _callee);
|
|
39
|
+
})));
|
|
40
|
+
it("Should not have basic accessibility issues for pattern mode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
41
|
+
var _render2, container, results;
|
|
42
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
43
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
44
|
+
case 0:
|
|
45
|
+
_render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Textarea["default"], {
|
|
46
|
+
label: "Example label",
|
|
47
|
+
helperText: "Helper Text",
|
|
48
|
+
defaultValue: "Value",
|
|
49
|
+
margin: "medium",
|
|
50
|
+
placeholder: "Placeholder",
|
|
51
|
+
verticalGrow: "manual",
|
|
52
|
+
name: "Name",
|
|
53
|
+
autocomplete: "on",
|
|
54
|
+
minLength: 0,
|
|
55
|
+
maxLength: 100,
|
|
56
|
+
pattern: "^.*(?=.*[a-zA-Z])(?=.*)(?=.*[!&$%&? \"]).*$"
|
|
57
|
+
})), container = _render2.container;
|
|
58
|
+
_context2.next = 3;
|
|
59
|
+
return (0, _axeHelper.axe)(container);
|
|
60
|
+
case 3:
|
|
61
|
+
results = _context2.sent;
|
|
62
|
+
expect(results).toHaveNoViolations();
|
|
63
|
+
case 5:
|
|
64
|
+
case "end":
|
|
65
|
+
return _context2.stop();
|
|
66
|
+
}
|
|
67
|
+
}, _callee2);
|
|
68
|
+
})));
|
|
69
|
+
it("Should not have basic accessibility issues for error mode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
70
|
+
var _render3, container, results;
|
|
71
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
72
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
73
|
+
case 0:
|
|
74
|
+
_render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Textarea["default"], {
|
|
75
|
+
label: "Example label",
|
|
76
|
+
helperText: "Helper Text",
|
|
77
|
+
defaultValue: "Value",
|
|
78
|
+
margin: "medium",
|
|
79
|
+
placeholder: "Placeholder",
|
|
80
|
+
verticalGrow: "manual",
|
|
81
|
+
name: "Name",
|
|
82
|
+
error: "Error message.",
|
|
83
|
+
minLength: 0,
|
|
84
|
+
maxLength: 100
|
|
85
|
+
})), container = _render3.container;
|
|
86
|
+
_context3.next = 3;
|
|
87
|
+
return (0, _axeHelper.axe)(container);
|
|
88
|
+
case 3:
|
|
89
|
+
results = _context3.sent;
|
|
90
|
+
expect(results).toHaveNoViolations();
|
|
91
|
+
case 5:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context3.stop();
|
|
94
|
+
}
|
|
95
|
+
}, _callee3);
|
|
96
|
+
})));
|
|
97
|
+
it("Should not have basic accessibility issues for disabled mode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
98
|
+
var _render4, container, results;
|
|
99
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
100
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
101
|
+
case 0:
|
|
102
|
+
_render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Textarea["default"], {
|
|
103
|
+
label: "Example label",
|
|
104
|
+
helperText: "Helper Text",
|
|
105
|
+
defaultValue: "Value",
|
|
106
|
+
margin: "medium",
|
|
107
|
+
placeholder: "Placeholder",
|
|
108
|
+
verticalGrow: "manual",
|
|
109
|
+
name: "Name",
|
|
110
|
+
autocomplete: "on",
|
|
111
|
+
minLength: 0,
|
|
112
|
+
maxLength: 100,
|
|
113
|
+
disabled: true
|
|
114
|
+
})), container = _render4.container;
|
|
115
|
+
_context4.next = 3;
|
|
116
|
+
return (0, _axeHelper.axe)(container);
|
|
117
|
+
case 3:
|
|
118
|
+
results = _context4.sent;
|
|
119
|
+
expect(results).toHaveNoViolations();
|
|
120
|
+
case 5:
|
|
121
|
+
case "end":
|
|
122
|
+
return _context4.stop();
|
|
123
|
+
}
|
|
124
|
+
}, _callee4);
|
|
125
|
+
})));
|
|
126
|
+
it("Should not have basic accessibility issues for read-only mode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
|
127
|
+
var _render5, container, results;
|
|
128
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
129
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
130
|
+
case 0:
|
|
131
|
+
_render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Textarea["default"], {
|
|
132
|
+
label: "Example label",
|
|
133
|
+
helperText: "Helper Text",
|
|
134
|
+
defaultValue: "Value",
|
|
135
|
+
margin: "medium",
|
|
136
|
+
placeholder: "Placeholder",
|
|
137
|
+
verticalGrow: "manual",
|
|
138
|
+
name: "Name",
|
|
139
|
+
autocomplete: "on",
|
|
140
|
+
minLength: 0,
|
|
141
|
+
maxLength: 100,
|
|
142
|
+
readOnly: true
|
|
143
|
+
})), container = _render5.container;
|
|
144
|
+
_context5.next = 3;
|
|
145
|
+
return (0, _axeHelper.axe)(container);
|
|
146
|
+
case 3:
|
|
147
|
+
results = _context5.sent;
|
|
148
|
+
expect(results).toHaveNoViolations();
|
|
149
|
+
case 5:
|
|
150
|
+
case "end":
|
|
151
|
+
return _context5.stop();
|
|
152
|
+
}
|
|
153
|
+
}, _callee5);
|
|
154
|
+
})));
|
|
155
|
+
});
|
package/textarea/Textarea.js
CHANGED
|
@@ -16,10 +16,9 @@ var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
|
16
16
|
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
17
17
|
var _variables = require("../common/variables");
|
|
18
18
|
var _uuid = require("uuid");
|
|
19
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
20
19
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
21
20
|
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); }
|
|
22
|
-
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 &&
|
|
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 && {}.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; }
|
|
23
22
|
var patternMatch = function patternMatch(pattern, value) {
|
|
24
23
|
return new RegExp(pattern).test(value);
|
|
25
24
|
};
|
|
@@ -64,7 +63,6 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
64
63
|
_useState4 = (0, _slicedToArray2["default"])(_useState3, 1),
|
|
65
64
|
textareaId = _useState4[0];
|
|
66
65
|
var colorsTheme = (0, _useTheme["default"])();
|
|
67
|
-
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
68
66
|
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
69
67
|
var textareaRef = (0, _react.useRef)(null);
|
|
70
68
|
var errorId = "error-".concat(textareaId);
|
|
@@ -123,11 +121,9 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
123
121
|
}, label && /*#__PURE__*/_react["default"].createElement(Label, {
|
|
124
122
|
htmlFor: textareaId,
|
|
125
123
|
disabled: disabled,
|
|
126
|
-
backgroundType: backgroundType,
|
|
127
124
|
helperText: helperText
|
|
128
125
|
}, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, translatedLabels.formFields.optionalLabel)), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
129
|
-
disabled: disabled
|
|
130
|
-
backgroundType: backgroundType
|
|
126
|
+
disabled: disabled
|
|
131
127
|
}, helperText), /*#__PURE__*/_react["default"].createElement(Textarea, {
|
|
132
128
|
id: textareaId,
|
|
133
129
|
name: name,
|
|
@@ -143,7 +139,6 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
143
139
|
minLength: minLength,
|
|
144
140
|
maxLength: maxLength,
|
|
145
141
|
autoComplete: autocomplete,
|
|
146
|
-
backgroundType: backgroundType,
|
|
147
142
|
ref: textareaRef,
|
|
148
143
|
tabIndex: tabIndex,
|
|
149
144
|
"aria-invalid": error ? true : false,
|
|
@@ -151,7 +146,7 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
151
146
|
"aria-required": !disabled && !optional
|
|
152
147
|
}), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
|
|
153
148
|
id: errorId,
|
|
154
|
-
|
|
149
|
+
role: "alert",
|
|
155
150
|
"aria-live": error ? "assertive" : "off"
|
|
156
151
|
}, error)));
|
|
157
152
|
});
|
|
@@ -178,7 +173,7 @@ var TextareaContainer = _styledComponents["default"].div(_templateObject || (_te
|
|
|
178
173
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
179
174
|
});
|
|
180
175
|
var Label = _styledComponents["default"].label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n ", "\n"])), function (props) {
|
|
181
|
-
return props.disabled ? props.
|
|
176
|
+
return props.disabled ? props.theme.disabledLabelFontColor : props.theme.labelFontColor;
|
|
182
177
|
}, function (props) {
|
|
183
178
|
return props.theme.fontFamily;
|
|
184
179
|
}, function (props) {
|
|
@@ -196,7 +191,7 @@ var OptionalLabel = _styledComponents["default"].span(_templateObject3 || (_temp
|
|
|
196
191
|
return props.theme.optionalLabelFontWeight;
|
|
197
192
|
});
|
|
198
193
|
var HelperText = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-bottom: 0.25rem;\n"])), function (props) {
|
|
199
|
-
return props.disabled ? props.
|
|
194
|
+
return props.disabled ? props.theme.disabledHelperTextFontColor : props.theme.helperTextFontColor;
|
|
200
195
|
}, function (props) {
|
|
201
196
|
return props.theme.fontFamily;
|
|
202
197
|
}, function (props) {
|
|
@@ -212,15 +207,15 @@ var Textarea = _styledComponents["default"].textarea(_templateObject5 || (_templ
|
|
|
212
207
|
var verticalGrow = _ref2.verticalGrow;
|
|
213
208
|
if (verticalGrow === "none") return "resize: none;";else if (verticalGrow === "auto") return "resize: none; overflow: hidden;";else if (verticalGrow === "manual") return "resize: vertical;";else return "resize: none;";
|
|
214
209
|
}, function (props) {
|
|
215
|
-
|
|
210
|
+
return props.disabled ? "background-color: ".concat(props.theme.disabledContainerFillColor, ";") : "background-color: transparent;";
|
|
216
211
|
}, function (props) {
|
|
217
|
-
if (props.disabled) return props.
|
|
212
|
+
if (props.disabled) return props.theme.disabledBorderColor;else if (props.error) return "transparent";else if (props.readOnly) return props.theme.readOnlyBorderColor;else props.theme.enabledBorderColor;
|
|
218
213
|
}, function (props) {
|
|
219
|
-
return props.error && !props.disabled && "box-shadow: 0 0 0 2px ".concat(props.
|
|
214
|
+
return props.error && !props.disabled && "box-shadow: 0 0 0 2px ".concat(props.theme.errorBorderColor, ";\n ");
|
|
220
215
|
}, function (props) {
|
|
221
|
-
return !props.disabled ? "&:hover {\n border-color: ".concat(props.error ? "transparent" : props.readOnly ? props.theme.hoverReadOnlyBorderColor : props.
|
|
216
|
+
return !props.disabled ? "&:hover {\n border-color: ".concat(props.error ? "transparent" : props.readOnly ? props.theme.hoverReadOnlyBorderColor : props.theme.hoverBorderColor, ";\n ").concat(props.error && "box-shadow: 0 0 0 2px ".concat(props.theme.hoverErrorBorderColor, ";"), "\n }\n &:focus, &:focus-within {\n outline: none;\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(props.theme.focusBorderColor, ";\n }") : "cursor: not-allowed;";
|
|
222
217
|
}, function (props) {
|
|
223
|
-
return props.disabled ? props.
|
|
218
|
+
return props.disabled ? props.theme.disabledValueFontColor : props.theme.valueFontColor;
|
|
224
219
|
}, function (props) {
|
|
225
220
|
return props.theme.fontFamily;
|
|
226
221
|
}, function (props) {
|
|
@@ -230,10 +225,10 @@ var Textarea = _styledComponents["default"].textarea(_templateObject5 || (_templ
|
|
|
230
225
|
}, function (props) {
|
|
231
226
|
return props.theme.valueFontWeight;
|
|
232
227
|
}, function (props) {
|
|
233
|
-
return props.disabled ? props.
|
|
228
|
+
return props.disabled ? props.theme.disabledPlaceholderFontColor : props.theme.placeholderFontColor;
|
|
234
229
|
});
|
|
235
230
|
var Error = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: 0.75rem;\n font-weight: 400;\n min-height: 1.5em;\n line-height: 1.5em;\n margin-top: 0.25rem;\n"])), function (props) {
|
|
236
|
-
return props.
|
|
231
|
+
return props.theme.errorMessageColor;
|
|
237
232
|
}, function (props) {
|
|
238
233
|
return props.theme.fontFamily;
|
|
239
234
|
});
|
|
@@ -2,7 +2,6 @@ import React from "react";
|
|
|
2
2
|
import DxcTextarea from "./Textarea";
|
|
3
3
|
import Title from "../../.storybook/components/Title";
|
|
4
4
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
|
-
import { BackgroundColorProvider } from "../BackgroundColorContext";
|
|
6
5
|
import { HalstackProvider } from "../HalstackContext";
|
|
7
6
|
|
|
8
7
|
export default {
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
5
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
var _react2 = require("@testing-library/react");
|
|
8
|
+
var _axeHelper = require("../../test/accessibility/axe-helper.js");
|
|
9
|
+
var _ToggleGroup = _interopRequireDefault(require("./ToggleGroup.tsx"));
|
|
10
|
+
var ethernetSVG = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
+
height: "24px",
|
|
13
|
+
viewBox: "0 0 24 24",
|
|
14
|
+
width: "24px",
|
|
15
|
+
fill: "currentColor"
|
|
16
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
17
|
+
d: "M0 0h24v24H0V0z",
|
|
18
|
+
fill: "none"
|
|
19
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
20
|
+
d: "M7.77 6.76L6.23 5.48.82 12l5.41 6.52 1.54-1.28L3.42 12l4.35-5.24zM7 13h2v-2H7v2zm10-2h-2v2h2v-2zm-6 2h2v-2h-2v2zm6.77-7.52l-1.54 1.28L20.58 12l-4.35 5.24 1.54 1.28L23.18 12l-5.41-6.52z"
|
|
21
|
+
}));
|
|
22
|
+
var gMobileSVG = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
23
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
24
|
+
height: "24px",
|
|
25
|
+
viewBox: "0 0 24 24",
|
|
26
|
+
width: "24px",
|
|
27
|
+
fill: "currentColor"
|
|
28
|
+
}, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("path", {
|
|
29
|
+
d: "M0,0h24v24H0V0z",
|
|
30
|
+
fill: "none"
|
|
31
|
+
})), /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("path", {
|
|
32
|
+
d: "M3,7v2h5v2H4v2h4v2H3v2h5c1.1,0,2-0.9,2-2v-1.5c0-0.83-0.67-1.5-1.5-1.5c0.83,0,1.5-0.67,1.5-1.5V9c0-1.1-0.9-2-2-2H3z M21,11v4c0,1.1-0.9,2-2,2h-5c-1.1,0-2-0.9-2-2V9c0-1.1,0.9-2,2-2h5c1.1,0,2,0.9,2,2h-7v6h5v-2h-2.5v-2H21z"
|
|
33
|
+
}))));
|
|
34
|
+
var wifiSVG = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
35
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
36
|
+
height: "24px",
|
|
37
|
+
viewBox: "0 0 24 24",
|
|
38
|
+
width: "24px",
|
|
39
|
+
fill: "currentColor"
|
|
40
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
41
|
+
d: "M0 0h24v24H0V0zm0 0h24v24H0V0z",
|
|
42
|
+
fill: "none"
|
|
43
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
44
|
+
d: "M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3c-1.65-1.66-4.34-1.66-6 0zm-4-4l2 2c2.76-2.76 7.24-2.76 10 0l2-2C15.14 9.14 8.87 9.14 5 13z"
|
|
45
|
+
}));
|
|
46
|
+
var options = [{
|
|
47
|
+
value: 1,
|
|
48
|
+
icon: wifiSVG,
|
|
49
|
+
title: "WiFi connection"
|
|
50
|
+
}, {
|
|
51
|
+
value: 2,
|
|
52
|
+
icon: ethernetSVG,
|
|
53
|
+
title: "Ethernet connection"
|
|
54
|
+
}, {
|
|
55
|
+
value: 3,
|
|
56
|
+
icon: gMobileSVG,
|
|
57
|
+
title: "3G Mobile data connection"
|
|
58
|
+
}];
|
|
59
|
+
describe("Toggle group component accessibility tests", function () {
|
|
60
|
+
it("Should not have basic accessibility issues", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
61
|
+
var _render, container, results;
|
|
62
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
63
|
+
while (1) switch (_context.prev = _context.next) {
|
|
64
|
+
case 0:
|
|
65
|
+
_render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ToggleGroup["default"], {
|
|
66
|
+
label: "Toggle group label",
|
|
67
|
+
helperText: "Toggle group helper text",
|
|
68
|
+
options: options,
|
|
69
|
+
margin: "medium",
|
|
70
|
+
defaultValue: 2,
|
|
71
|
+
multiple: true
|
|
72
|
+
})), container = _render.container;
|
|
73
|
+
_context.next = 3;
|
|
74
|
+
return (0, _axeHelper.axe)(container);
|
|
75
|
+
case 3:
|
|
76
|
+
results = _context.sent;
|
|
77
|
+
expect(results).toHaveNoViolations();
|
|
78
|
+
case 5:
|
|
79
|
+
case "end":
|
|
80
|
+
return _context.stop();
|
|
81
|
+
}
|
|
82
|
+
}, _callee);
|
|
83
|
+
})));
|
|
84
|
+
it("Should not have basic accessibility issues for disabled mode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
85
|
+
var _render2, container, results;
|
|
86
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
87
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
88
|
+
case 0:
|
|
89
|
+
_render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ToggleGroup["default"], {
|
|
90
|
+
label: "Toggle group label",
|
|
91
|
+
helperText: "Toggle group helper text",
|
|
92
|
+
options: options,
|
|
93
|
+
margin: "medium",
|
|
94
|
+
disabled: true
|
|
95
|
+
})), container = _render2.container;
|
|
96
|
+
_context2.next = 3;
|
|
97
|
+
return (0, _axeHelper.axe)(container);
|
|
98
|
+
case 3:
|
|
99
|
+
results = _context2.sent;
|
|
100
|
+
expect(results).toHaveNoViolations();
|
|
101
|
+
case 5:
|
|
102
|
+
case "end":
|
|
103
|
+
return _context2.stop();
|
|
104
|
+
}
|
|
105
|
+
}, _callee2);
|
|
106
|
+
})));
|
|
107
|
+
});
|
|
@@ -14,11 +14,11 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
14
14
|
var _uuid = require("uuid");
|
|
15
15
|
var _variables = require("../common/variables");
|
|
16
16
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
17
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
18
17
|
var _Flex = _interopRequireDefault(require("../flex/Flex"));
|
|
18
|
+
var _Icon = _interopRequireDefault(require("../icon/Icon"));
|
|
19
19
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
20
20
|
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 &&
|
|
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 && {}.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
22
|
var DxcToggleGroup = function DxcToggleGroup(_ref) {
|
|
23
23
|
var label = _ref.label,
|
|
24
24
|
helperText = _ref.helperText,
|
|
@@ -41,7 +41,6 @@ var DxcToggleGroup = function DxcToggleGroup(_ref) {
|
|
|
41
41
|
selectedValue = _useState4[0],
|
|
42
42
|
setSelectedValue = _useState4[1];
|
|
43
43
|
var colorsTheme = (0, _useTheme["default"])();
|
|
44
|
-
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
45
44
|
var handleToggleChange = function handleToggleChange(selectedOption) {
|
|
46
45
|
var newSelectedOptions;
|
|
47
46
|
if (value == null) {
|
|
@@ -101,7 +100,6 @@ var DxcToggleGroup = function DxcToggleGroup(_ref) {
|
|
|
101
100
|
},
|
|
102
101
|
tabIndex: !disabled ? tabIndex : -1,
|
|
103
102
|
title: option.title,
|
|
104
|
-
backgroundType: backgroundType,
|
|
105
103
|
hasIcon: option.icon,
|
|
106
104
|
optionLabel: option.label,
|
|
107
105
|
selected: multiple ? value ? Array.isArray(value) && value.includes(option.value) : Array.isArray(selectedValue) && selectedValue.includes(option.value) : value ? option.value === value : option.value === selectedValue
|
|
@@ -109,8 +107,8 @@ var DxcToggleGroup = function DxcToggleGroup(_ref) {
|
|
|
109
107
|
alignItems: "center"
|
|
110
108
|
}, option.icon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
111
109
|
optionLabel: option.label
|
|
112
|
-
}, typeof option.icon === "string" ? /*#__PURE__*/_react["default"].createElement("
|
|
113
|
-
|
|
110
|
+
}, typeof option.icon === "string" ? /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
111
|
+
icon: option.icon
|
|
114
112
|
}) : option.icon), option.label && /*#__PURE__*/_react["default"].createElement(LabelContainer, null, option.label)));
|
|
115
113
|
}))));
|
|
116
114
|
};
|
|
@@ -183,7 +181,7 @@ var ToggleButton = _styledComponents["default"].button(_templateObject5 || (_tem
|
|
|
183
181
|
}, function (props) {
|
|
184
182
|
return props.selected ? props.theme.selectedActiveBackgroundColor : props.theme.unselectedActiveBackgroundColor;
|
|
185
183
|
}, function (props) {
|
|
186
|
-
return "0 0 0 ".concat(props.theme.optionFocusBorderThickness, " ").concat(props.
|
|
184
|
+
return "0 0 0 ".concat(props.theme.optionFocusBorderThickness, " ").concat(props.theme.focusColor);
|
|
187
185
|
}, function (props) {
|
|
188
186
|
return props.selected ? props.theme.selectedDisabledBackgroundColor : props.theme.unselectedDisabledBackgroundColor;
|
|
189
187
|
}, function (props) {
|
|
@@ -198,7 +196,7 @@ var LabelContainer = _styledComponents["default"].span(_templateObject6 || (_tem
|
|
|
198
196
|
}, function (props) {
|
|
199
197
|
return props.theme.optionLabelFontWeight;
|
|
200
198
|
});
|
|
201
|
-
var IconContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n
|
|
199
|
+
var IconContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n margin-right: ", ";\n overflow: hidden;\n font-size: 24px;\n svg {\n height: 24px;\n width: 24px;\n }\n"])), function (props) {
|
|
202
200
|
return props.optionLabel && props.theme.iconMarginRight;
|
|
203
201
|
});
|
|
204
202
|
var _default = exports["default"] = DxcToggleGroup;
|
|
@@ -52,17 +52,17 @@ const options = [
|
|
|
52
52
|
const optionsWithIcon = [
|
|
53
53
|
{
|
|
54
54
|
value: 1,
|
|
55
|
-
icon:
|
|
55
|
+
icon: "wifi",
|
|
56
56
|
title: "WiFi connection",
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
value: 2,
|
|
60
|
-
icon:
|
|
60
|
+
icon: "filled_lan",
|
|
61
61
|
title: "Ethernet connection",
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
value: 3,
|
|
65
|
-
icon:
|
|
65
|
+
icon: "5g",
|
|
66
66
|
title: "3G Mobile data connection",
|
|
67
67
|
},
|
|
68
68
|
];
|
package/toggle-group/types.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ type OptionIcon = {
|
|
|
13
13
|
*/
|
|
14
14
|
label?: never;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Material Symbols icon or SVG element. Icon and label can't be used at same time.
|
|
17
17
|
*/
|
|
18
18
|
icon: string | SVG;
|
|
19
19
|
/**
|
|
@@ -28,7 +28,7 @@ export type OptionLabel = {
|
|
|
28
28
|
*/
|
|
29
29
|
label: string;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* Material Symbols icon or SVG element. Icon and label can't be used at same time.
|
|
32
32
|
*/
|
|
33
33
|
icon?: string | SVG;
|
|
34
34
|
/**
|