@pingux/astro 1.31.0-alpha.1 → 1.31.0-alpha.10
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/lib/cjs/components/Card/Card.stories.js +29 -2
- package/lib/cjs/components/Chip/Chip.js +37 -7
- package/lib/cjs/components/Chip/Chip.test.js +8 -0
- package/lib/cjs/components/DataTable/DataTable.test.js +0 -2
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +84 -2
- package/lib/cjs/components/ListView/ListView.stories.js +2 -1
- package/lib/cjs/components/ListViewItem/ListViewItem.js +5 -2
- package/lib/cjs/components/OverlayPanel/OverlayPanel.stories.js +14 -7
- package/lib/cjs/components/RequirementsList/RequirementsList.js +5 -1
- package/lib/cjs/components/RequirementsList/RequirementsList.test.js +2 -2
- package/lib/cjs/components/SearchField/SearchField.js +10 -0
- package/lib/cjs/components/SearchField/SearchField.test.js +27 -0
- package/lib/cjs/components/TabPicker/TabPicker.js +1 -0
- package/lib/cjs/components/Table/Table.stories.js +9 -27
- package/lib/cjs/components/Table/Table.test.js +9 -1
- package/lib/cjs/components/TableCaption/TableCaption.js +43 -0
- package/lib/cjs/components/TableCaption/index.js +18 -0
- package/lib/cjs/components/Tabs/Tabs.stories.js +4 -2
- package/lib/cjs/components/Tabs/Tabs.test.js +6 -4
- package/lib/cjs/recipes/LinkedListView.stories.js +424 -0
- package/lib/cjs/styles/variants/boxes.js +19 -1
- package/lib/cjs/styles/variants/table.js +6 -0
- package/lib/components/Card/Card.stories.js +29 -2
- package/lib/components/Chip/Chip.js +30 -4
- package/lib/components/Chip/Chip.test.js +8 -0
- package/lib/components/DataTable/DataTable.test.js +0 -2
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +79 -0
- package/lib/components/ListView/ListView.stories.js +2 -1
- package/lib/components/ListViewItem/ListViewItem.js +5 -2
- package/lib/components/OverlayPanel/OverlayPanel.stories.js +14 -7
- package/lib/components/RequirementsList/RequirementsList.js +5 -1
- package/lib/components/RequirementsList/RequirementsList.test.js +2 -2
- package/lib/components/SearchField/SearchField.js +10 -0
- package/lib/components/SearchField/SearchField.test.js +20 -1
- package/lib/components/TabPicker/TabPicker.js +1 -0
- package/lib/components/Table/Table.stories.js +7 -27
- package/lib/components/Table/Table.test.js +7 -1
- package/lib/components/TableCaption/TableCaption.js +27 -0
- package/lib/components/TableCaption/index.js +1 -0
- package/lib/components/Tabs/Tabs.stories.js +4 -2
- package/lib/components/Tabs/Tabs.test.js +6 -4
- package/lib/recipes/LinkedListView.stories.js +393 -0
- package/lib/styles/variants/boxes.js +19 -1
- package/lib/styles/variants/table.js +6 -0
- package/package.json +1 -1
@@ -359,4 +359,83 @@ export var ControlledMenu = function ControlledMenu() {
|
|
359
359
|
bg: "neutral.40"
|
360
360
|
}) : null);
|
361
361
|
});
|
362
|
+
};
|
363
|
+
export var RightAlignedChips = function RightAlignedChips(args) {
|
364
|
+
var _useState13 = useState({
|
365
|
+
name: 'Snail',
|
366
|
+
isSandbox: true
|
367
|
+
}),
|
368
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
369
|
+
selectedEnvironment = _useState14[0],
|
370
|
+
setSelectedEnvironment = _useState14[1];
|
371
|
+
|
372
|
+
var envNode = ___EmotionJSX(Box, {
|
373
|
+
isRow: true
|
374
|
+
}, ___EmotionJSX(Text, {
|
375
|
+
color: "inherit"
|
376
|
+
}, selectedEnvironment.name), selectedEnvironment.isSandbox ? ___EmotionJSX(Chip, {
|
377
|
+
label: "SANDBOX",
|
378
|
+
variant: "boxes.environmentChip",
|
379
|
+
bg: "neutral.40"
|
380
|
+
}) : null);
|
381
|
+
|
382
|
+
var findEnvObj = function findEnvObj(envName) {
|
383
|
+
return _findInstanceProperty(defaultEnvironments).call(defaultEnvironments, function (_ref9) {
|
384
|
+
var name = _ref9.name;
|
385
|
+
return name === envName;
|
386
|
+
});
|
387
|
+
};
|
388
|
+
|
389
|
+
var handleSelectionChange = function handleSelectionChange(newEnvName) {
|
390
|
+
var envObj = findEnvObj(newEnvName);
|
391
|
+
setSelectedEnvironment(_objectSpread({}, envObj));
|
392
|
+
};
|
393
|
+
|
394
|
+
var items = [{
|
395
|
+
name: 'Default'
|
396
|
+
}, {
|
397
|
+
name: 'Kangaroo',
|
398
|
+
isSandbox: true
|
399
|
+
}, {
|
400
|
+
name: 'Snake',
|
401
|
+
isSandbox: true
|
402
|
+
}, {
|
403
|
+
name: 'Snail'
|
404
|
+
}, {
|
405
|
+
name: 'Slug',
|
406
|
+
isSandbox: true
|
407
|
+
}, {
|
408
|
+
name: 'Crow'
|
409
|
+
}, {
|
410
|
+
name: 'Dog'
|
411
|
+
}, {
|
412
|
+
name: 'Crab',
|
413
|
+
isSandbox: true
|
414
|
+
}, {
|
415
|
+
name: 'Fish',
|
416
|
+
isSandbox: true
|
417
|
+
}, {
|
418
|
+
name: 'Turtle',
|
419
|
+
isSandbox: true
|
420
|
+
}, {
|
421
|
+
name: 'Mouse'
|
422
|
+
}];
|
423
|
+
return ___EmotionJSX(EnvironmentBreadcrumb, _extends({}, args, {
|
424
|
+
items: items,
|
425
|
+
name: "Globochem",
|
426
|
+
selectedItem: envNode,
|
427
|
+
onSelectionChange: handleSelectionChange
|
428
|
+
}), function (_ref10) {
|
429
|
+
var name = _ref10.name,
|
430
|
+
isSandbox = _ref10.isSandbox;
|
431
|
+
return ___EmotionJSX(Item, {
|
432
|
+
key: name,
|
433
|
+
textValue: name
|
434
|
+
}, name, isSandbox ? ___EmotionJSX(Chip, {
|
435
|
+
label: "SANDBOX",
|
436
|
+
variant: "boxes.environmentChip",
|
437
|
+
bg: "neutral.40",
|
438
|
+
align: "right"
|
439
|
+
}) : null);
|
440
|
+
});
|
362
441
|
};
|
@@ -17,6 +17,7 @@ var ListViewItem = function ListViewItem(props) {
|
|
17
17
|
rowProps = _props$item$props.rowProps,
|
18
18
|
_props$item$props$has = _props$item$props.hasSeparator,
|
19
19
|
hasSeparator = _props$item$props$has === void 0 ? true : _props$item$props$has,
|
20
|
+
hasInsetSeparator = _props$item$props.hasInsetSeparator,
|
20
21
|
className = props.className;
|
21
22
|
var dataId = item.props['data-id'];
|
22
23
|
|
@@ -56,7 +57,8 @@ var ListViewItem = function ListViewItem(props) {
|
|
56
57
|
isHovered: isSelectable && isHovered,
|
57
58
|
isSelected: isSelected,
|
58
59
|
isFocused: isDisabled ? false : isFocusVisible || isFocusVisibleWithin,
|
59
|
-
hasSeparator: hasSeparator
|
60
|
+
hasSeparator: hasSeparator,
|
61
|
+
hasInsetSeparator: hasInsetSeparator
|
60
62
|
}),
|
61
63
|
classNames = _useStatusClasses.classNames;
|
62
64
|
|
@@ -88,7 +90,8 @@ ListViewItem.propTypes = {
|
|
88
90
|
'data-id': PropTypes.string,
|
89
91
|
listItemProps: PropTypes.shape({}),
|
90
92
|
rowProps: PropTypes.shape({}),
|
91
|
-
hasSeparator: PropTypes.bool
|
93
|
+
hasSeparator: PropTypes.bool,
|
94
|
+
hasInsetSeparator: PropTypes.bool
|
92
95
|
})
|
93
96
|
})
|
94
97
|
};
|
@@ -46,7 +46,8 @@ export var Default = function Default(_ref) {
|
|
46
46
|
// readers when an overlay is open.
|
47
47
|
___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."), ___EmotionJSX("br", null), ___EmotionJSX(Button, {
|
48
48
|
ref: triggerRef,
|
49
|
-
onPress: state.open
|
49
|
+
onPress: state.open,
|
50
|
+
"aria-expanded": state.isOpen
|
50
51
|
}, "Open Panel"), state.isOpen && ___EmotionJSX(OverlayPanel, _extends({
|
51
52
|
isOpen: state.isOpen,
|
52
53
|
state: state
|
@@ -55,7 +56,8 @@ export var Default = function Default(_ref) {
|
|
55
56
|
}), ___EmotionJSX(Box, null, ___EmotionJSX(Button, {
|
56
57
|
onPress: function onPress() {
|
57
58
|
onClose(state, triggerRef);
|
58
|
-
}
|
59
|
+
},
|
60
|
+
"aria-expanded": state.isOpen
|
59
61
|
}, "Close Panel"), ___EmotionJSX(Text, {
|
60
62
|
pt: "md"
|
61
63
|
}, "Children render here."))))
|
@@ -123,7 +125,8 @@ export var InnerPanel = function InnerPanel(_ref2) {
|
|
123
125
|
p: '12px'
|
124
126
|
}
|
125
127
|
}, ___EmotionJSX(Button, {
|
126
|
-
onPress: closeOuterPanel
|
128
|
+
onPress: closeOuterPanel,
|
129
|
+
"aria-expanded": state.isOpen
|
127
130
|
}, "Close Panel"), ___EmotionJSX(Text, {
|
128
131
|
pt: "md",
|
129
132
|
mb: "24px"
|
@@ -145,14 +148,16 @@ export var InnerPanel = function InnerPanel(_ref2) {
|
|
145
148
|
onPress: toggleMessagesOpen
|
146
149
|
}, "Toggle Messages"), ___EmotionJSX("br", null), ___EmotionJSX(Button, {
|
147
150
|
ref: innerTriggerRef,
|
148
|
-
onPress: innerState.open
|
151
|
+
onPress: innerState.open,
|
152
|
+
"aria-expanded": innerState.isOpen
|
149
153
|
}, "Open Inner Panel"), inner)));
|
150
154
|
|
151
155
|
return (// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
152
156
|
// readers when an overlay opens.
|
153
157
|
___EmotionJSX(React.Fragment, null, ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Button, {
|
154
158
|
ref: outerTriggerRef,
|
155
|
-
onPress: state.open
|
159
|
+
onPress: state.open,
|
160
|
+
"aria-expanded": state.isOpen
|
156
161
|
}, "Open Panel"), outer), messagesOpen && ___EmotionJSX(Messages, {
|
157
162
|
sx: {
|
158
163
|
zIndex: 11
|
@@ -173,7 +178,8 @@ export var CustomWidth = function CustomWidth() {
|
|
173
178
|
// readers when an overlay opens.
|
174
179
|
___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."), ___EmotionJSX("br", null), ___EmotionJSX(Button, {
|
175
180
|
ref: triggerRef,
|
176
|
-
onPress: state.open
|
181
|
+
onPress: state.open,
|
182
|
+
"aria-expanded": state.isOpen
|
177
183
|
}, "Open Panel"), state.isOpen && ___EmotionJSX(OverlayPanel, {
|
178
184
|
isOpen: state.isOpen,
|
179
185
|
state: state,
|
@@ -184,7 +190,8 @@ export var CustomWidth = function CustomWidth() {
|
|
184
190
|
}, ___EmotionJSX(Box, null, ___EmotionJSX(Button, {
|
185
191
|
onPress: function onPress() {
|
186
192
|
onClose(state, triggerRef);
|
187
|
-
}
|
193
|
+
},
|
194
|
+
"aria-expanded": state.isOpen
|
188
195
|
}, "Close Panel"), ___EmotionJSX(Text, {
|
189
196
|
pt: "md"
|
190
197
|
}, "Children render here."))))
|
@@ -63,18 +63,22 @@ var RequirementsList = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
63
63
|
|
64
64
|
var buildRequirementsLine = function buildRequirementsLine(req) {
|
65
65
|
return ___EmotionJSX(Box, {
|
66
|
+
role: "listitem",
|
66
67
|
isRow: true,
|
67
68
|
key: req.name,
|
68
69
|
alignItems: "center",
|
69
|
-
width: "100%"
|
70
|
+
width: "100%",
|
71
|
+
as: "li"
|
70
72
|
}, statusIconRender(req.status), ___EmotionJSX(Text, {
|
71
73
|
variant: "bodyWeak"
|
72
74
|
}, req.name));
|
73
75
|
};
|
74
76
|
|
75
77
|
return ___EmotionJSX(Box, _extends({
|
78
|
+
role: "list",
|
76
79
|
p: "lg",
|
77
80
|
gap: "md",
|
81
|
+
as: "ul",
|
78
82
|
ref: ref
|
79
83
|
}, others), _mapInstanceProperty(requirements).call(requirements, function (req) {
|
80
84
|
return buildRequirementsLine(req);
|
@@ -51,7 +51,7 @@ axeTest(getComponent);
|
|
51
51
|
test('base case requirements list', function () {
|
52
52
|
getComponent();
|
53
53
|
var requirementsList = screen.getByTestId(testId);
|
54
|
-
expect(requirementsList).toBeInstanceOf(
|
54
|
+
expect(requirementsList).toBeInstanceOf(HTMLUListElement);
|
55
55
|
expect(requirementsList).toBeInTheDocument();
|
56
56
|
});
|
57
57
|
test('empty variables requirements list', function () {
|
@@ -59,7 +59,7 @@ test('empty variables requirements list', function () {
|
|
59
59
|
requirementsList: []
|
60
60
|
});
|
61
61
|
var requirementsList = screen.getByTestId(testId);
|
62
|
-
expect(requirementsList).toBeInstanceOf(
|
62
|
+
expect(requirementsList).toBeInstanceOf(HTMLUListElement);
|
63
63
|
expect(requirementsList).toBeInTheDocument();
|
64
64
|
});
|
65
65
|
test('should render default status icon if such passed in props', function () {
|
@@ -69,6 +69,14 @@ var SearchField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
69
69
|
fieldControlProps = _useField.fieldControlProps,
|
70
70
|
fieldLabelProps = _useField.fieldLabelProps;
|
71
71
|
|
72
|
+
var handleKeyDownEvent = function handleKeyDownEvent(e) {
|
73
|
+
var key = e.key;
|
74
|
+
|
75
|
+
if (key === 'Enter' || key === ' ') {
|
76
|
+
state.setValue('');
|
77
|
+
}
|
78
|
+
};
|
79
|
+
|
72
80
|
return ___EmotionJSX(Box, fieldContainerProps, label && ___EmotionJSX(Label, fieldLabelProps), ___EmotionJSX(Box, {
|
73
81
|
variant: "forms.search.container"
|
74
82
|
}, ___EmotionJSX(Input, _extends({
|
@@ -80,6 +88,8 @@ var SearchField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
80
88
|
variant: "forms.search.icon",
|
81
89
|
size: 22
|
82
90
|
}, iconProps)), !hasNoClearButton && state.value !== '' && ___EmotionJSX(IconButton, _extends({
|
91
|
+
tabIndex: 0,
|
92
|
+
onKeyDown: handleKeyDownEvent,
|
83
93
|
sx: {
|
84
94
|
position: 'absolute',
|
85
95
|
top: 8,
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
2
|
import React from 'react';
|
3
3
|
import userEvent from '@testing-library/user-event';
|
4
4
|
import axeTest from '../../utils/testUtils/testAxe';
|
5
|
-
import { render, screen } from '../../utils/testUtils/testWrapper';
|
5
|
+
import { act, fireEvent, render, screen } from '../../utils/testUtils/testWrapper';
|
6
6
|
import SearchField from '.';
|
7
7
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
8
8
|
var testId = 'test-radio-group';
|
@@ -179,6 +179,25 @@ test('clear button should be present by default ', function () {
|
|
179
179
|
});
|
180
180
|
expect(screen.getByRole('button')).toBeInTheDocument();
|
181
181
|
});
|
182
|
+
test('clear button should be keyboard accessible', function () {
|
183
|
+
getComponent();
|
184
|
+
var search = screen.getByLabelText(testLabel);
|
185
|
+
userEvent.type(search, 'clear');
|
186
|
+
expect(search).toHaveValue('clear');
|
187
|
+
var clearButton = screen.getByRole('button');
|
188
|
+
expect(clearButton).toHaveAttribute('tabindex', '0');
|
189
|
+
act(function () {
|
190
|
+
clearButton.focus();
|
191
|
+
});
|
192
|
+
expect(clearButton).toHaveFocus();
|
193
|
+
fireEvent.keyDown(clearButton, {
|
194
|
+
key: 'Enter'
|
195
|
+
});
|
196
|
+
fireEvent.keyUp(clearButton, {
|
197
|
+
key: 'Enter'
|
198
|
+
});
|
199
|
+
expect(search).toHaveValue('');
|
200
|
+
});
|
182
201
|
test('clear button should not be present is hasNoClearButton=true ', function () {
|
183
202
|
getComponent({
|
184
203
|
value: 'test-value',
|
@@ -6,11 +6,14 @@ import TableBody from '../TableBody';
|
|
6
6
|
import TableRow from '../TableRow';
|
7
7
|
import TableCell from '../TableCell';
|
8
8
|
import TableHead from '../TableHead';
|
9
|
+
import TableCaption from '../TableCaption';
|
10
|
+
import { Text } from '../../index';
|
9
11
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
10
12
|
export default {
|
11
13
|
title: 'Table',
|
12
14
|
component: Table
|
13
15
|
};
|
16
|
+
var caption = 'Populations of Countries';
|
14
17
|
var headers = ['Country', 'Population', 'Continent'];
|
15
18
|
var objects = [{
|
16
19
|
country: 'USA',
|
@@ -30,33 +33,10 @@ var objects = [{
|
|
30
33
|
continent: 'Europe'
|
31
34
|
}];
|
32
35
|
export var Default = function Default() {
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
// const objects = [
|
38
|
-
// {
|
39
|
-
// country: 'USA',
|
40
|
-
// population: '320,000,000',
|
41
|
-
// continent: 'North America',
|
42
|
-
// },
|
43
|
-
// {
|
44
|
-
// country: 'Canada',
|
45
|
-
// population: '37,000,000',
|
46
|
-
// continent: 'North America',
|
47
|
-
// },
|
48
|
-
// {
|
49
|
-
// country: 'China',
|
50
|
-
// population: '1,398,000,000',
|
51
|
-
// continent: 'Asia',
|
52
|
-
// },
|
53
|
-
// {
|
54
|
-
// country: 'France',
|
55
|
-
// population: '67,000,000',
|
56
|
-
// continent: 'Europe',
|
57
|
-
// },
|
58
|
-
// ];
|
59
|
-
return ___EmotionJSX(Table, null, ___EmotionJSX(TableHead, null, ___EmotionJSX(TableRow, {
|
36
|
+
return ___EmotionJSX(Table, null, ___EmotionJSX(TableCaption, null, ___EmotionJSX(Text, {
|
37
|
+
fontWeight: 3,
|
38
|
+
fontSize: "lg"
|
39
|
+
}, caption)), ___EmotionJSX(TableHead, null, ___EmotionJSX(TableRow, {
|
60
40
|
key: "head"
|
61
41
|
}, _mapInstanceProperty(headers).call(headers, function (head) {
|
62
42
|
return ___EmotionJSX(TableCell, {
|
@@ -7,12 +7,15 @@ import TableBody from '../TableBody';
|
|
7
7
|
import TableRow from '../TableRow';
|
8
8
|
import TableCell from '../TableCell';
|
9
9
|
import TableHead from '../TableHead';
|
10
|
+
import TableCaption from '../TableCaption';
|
11
|
+
import { Text } from '../../index';
|
10
12
|
import axeTest from '../../utils/testUtils/testAxe';
|
11
13
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
12
14
|
var testId = 'test-table';
|
13
15
|
var defaultProps = {
|
14
16
|
'data-testid': testId
|
15
17
|
};
|
18
|
+
var caption = 'Populations of Countries';
|
16
19
|
var headers = ['Country', 'Population', 'Continent'];
|
17
20
|
var objects = [{
|
18
21
|
country: 'USA',
|
@@ -33,7 +36,10 @@ var objects = [{
|
|
33
36
|
}];
|
34
37
|
|
35
38
|
var getComponent = function getComponent() {
|
36
|
-
return render(___EmotionJSX(Table, defaultProps, ___EmotionJSX(
|
39
|
+
return render(___EmotionJSX(Table, defaultProps, ___EmotionJSX(TableCaption, null, ___EmotionJSX(Text, {
|
40
|
+
fontWeight: 3,
|
41
|
+
fontSize: "lg"
|
42
|
+
}, caption)), ___EmotionJSX(TableHead, null, ___EmotionJSX(TableRow, {
|
37
43
|
key: "head"
|
38
44
|
}, _mapInstanceProperty(headers).call(headers, function (head) {
|
39
45
|
return ___EmotionJSX(TableCell, {
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
+
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
3
|
+
var _excluded = ["children"];
|
4
|
+
import React from 'react';
|
5
|
+
import Box from '../Box';
|
6
|
+
/**
|
7
|
+
* Basic TableCaption component.
|
8
|
+
*
|
9
|
+
* Renders HTML `<caption>`
|
10
|
+
*
|
11
|
+
* Needs to be a child of the `<Table>` component. Accepts text as children.
|
12
|
+
*
|
13
|
+
*/
|
14
|
+
|
15
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
16
|
+
|
17
|
+
var TableCaption = function TableCaption(props) {
|
18
|
+
var children = props.children,
|
19
|
+
others = _objectWithoutProperties(props, _excluded);
|
20
|
+
|
21
|
+
return ___EmotionJSX(Box, _extends({
|
22
|
+
variant: "table.tableCaption",
|
23
|
+
as: "caption"
|
24
|
+
}, others), children);
|
25
|
+
};
|
26
|
+
|
27
|
+
export default TableCaption;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './TableCaption';
|
@@ -235,11 +235,13 @@ export var WithList = function WithList() {
|
|
235
235
|
list: [{
|
236
236
|
key: 'tab1list',
|
237
237
|
name: 'Tab 1 list',
|
238
|
-
children: 'Tab 1 from list'
|
238
|
+
children: 'Tab 1 from list',
|
239
|
+
role: 'listitem'
|
239
240
|
}, {
|
240
241
|
key: 'tab2list',
|
241
242
|
name: 'Tab 2 list',
|
242
|
-
children: 'Tab 2 from list'
|
243
|
+
children: 'Tab 2 from list',
|
244
|
+
role: 'listitem'
|
243
245
|
}]
|
244
246
|
}]);
|
245
247
|
|
@@ -43,11 +43,13 @@ var tabsWithList = [{
|
|
43
43
|
list: [{
|
44
44
|
key: 'tab1list',
|
45
45
|
name: 'Tab 1 list',
|
46
|
-
children: 'Tab 1 from list'
|
46
|
+
children: 'Tab 1 from list',
|
47
|
+
role: 'listitem'
|
47
48
|
}, {
|
48
49
|
key: 'tab2list',
|
49
50
|
name: 'Tab 2 list',
|
50
|
-
children: 'Tab 2 from list'
|
51
|
+
children: 'Tab 2 from list',
|
52
|
+
role: 'listitem'
|
51
53
|
}]
|
52
54
|
}];
|
53
55
|
var defaultProps = {
|
@@ -495,7 +497,7 @@ test('will render tab with list if provided', /*#__PURE__*/_asyncToGenerator( /*
|
|
495
497
|
userEvent.click(menuBtn);
|
496
498
|
expect(screen.queryByRole('menu')).toBeInTheDocument();
|
497
499
|
testTabPanel(0);
|
498
|
-
menuItems = screen.queryAllByRole('
|
500
|
+
menuItems = screen.queryAllByRole('listitem');
|
499
501
|
expect(menuItems).toHaveLength(tabsWithList[1].list.length);
|
500
502
|
expect(menuItems[0]).not.toHaveFocus();
|
501
503
|
userEvent.click(menuItems[0]);
|
@@ -538,7 +540,7 @@ test('tab list is accessible via keyboard', function () {
|
|
538
540
|
});
|
539
541
|
expect(screen.queryByRole('menu')).toBeInTheDocument();
|
540
542
|
testTabPanel(0);
|
541
|
-
var menuItems = screen.queryAllByRole('
|
543
|
+
var menuItems = screen.queryAllByRole('listitem');
|
542
544
|
expect(menuItems).toHaveLength(tabsWithList[1].list.length);
|
543
545
|
expect(menuItems[0]).toHaveFocus();
|
544
546
|
fireEvent.keyDown(menuItems[0], {
|