@instructure/ui-list 10.16.1-snapshot-0 → 10.16.1
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/CHANGELOG.md +1 -1
- package/es/InlineList/InlineListItem/__new-tests__/InlineListItem.test.js +12 -8
- package/es/InlineList/InlineListItem/index.js +11 -8
- package/es/InlineList/__examples__/InlineList.examples.js +8 -8
- package/es/InlineList/__new-tests__/InlineList.test.js +59 -12
- package/es/InlineList/index.js +7 -4
- package/es/List/ListItem/__new-tests__/ListItem.test.js +8 -5
- package/es/List/ListItem/index.js +7 -5
- package/es/List/__examples__/List.examples.js +8 -8
- package/es/List/__new-tests__/List.test.js +47 -9
- package/es/List/index.js +7 -5
- package/lib/InlineList/InlineListItem/__new-tests__/InlineListItem.test.js +15 -12
- package/lib/InlineList/InlineListItem/index.js +9 -7
- package/lib/InlineList/__examples__/InlineList.examples.js +8 -9
- package/lib/InlineList/__new-tests__/InlineList.test.js +62 -16
- package/lib/InlineList/index.js +7 -5
- package/lib/List/ListItem/__new-tests__/ListItem.test.js +11 -9
- package/lib/List/ListItem/index.js +6 -4
- package/lib/List/__examples__/List.examples.js +8 -9
- package/lib/List/__new-tests__/List.test.js +50 -13
- package/lib/List/index.js +6 -4
- package/package.json +13 -13
- package/src/InlineList/InlineListItem/__new-tests__/InlineListItem.test.tsx +0 -1
- package/src/InlineList/InlineListItem/index.tsx +2 -2
- package/src/InlineList/__examples__/InlineList.examples.tsx +0 -2
- package/src/InlineList/__new-tests__/InlineList.test.tsx +0 -1
- package/src/InlineList/index.tsx +1 -1
- package/src/List/ListItem/__new-tests__/ListItem.test.tsx +0 -1
- package/src/List/ListItem/index.tsx +1 -2
- package/src/List/__examples__/List.examples.tsx +0 -2
- package/src/List/__new-tests__/List.test.tsx +0 -1
- package/src/List/index.tsx +1 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/InlineList/InlineListItem/__new-tests__/InlineListItem.test.d.ts.map +1 -1
- package/types/InlineList/InlineListItem/index.d.ts +1 -3
- package/types/InlineList/InlineListItem/index.d.ts.map +1 -1
- package/types/InlineList/__examples__/InlineList.examples.d.ts.map +1 -1
- package/types/InlineList/__new-tests__/InlineList.test.d.ts.map +1 -1
- package/types/InlineList/index.d.ts +3 -3
- package/types/InlineList/index.d.ts.map +1 -1
- package/types/List/ListItem/__new-tests__/ListItem.test.d.ts.map +1 -1
- package/types/List/ListItem/index.d.ts +1 -3
- package/types/List/ListItem/index.d.ts.map +1 -1
- package/types/List/__examples__/List.examples.d.ts.map +1 -1
- package/types/List/__new-tests__/List.test.d.ts.map +1 -1
- package/types/List/index.d.ts +1 -3
- package/types/List/index.d.ts.map +1 -1
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _react = _interopRequireDefault(require("react"));
|
|
5
3
|
require("@testing-library/jest-dom");
|
|
6
|
-
var
|
|
4
|
+
var _react = require("@testing-library/react");
|
|
7
5
|
var _vitest = require("vitest");
|
|
8
6
|
var _index = require("../index");
|
|
9
7
|
var _runAxeCheck = require("@instructure/ui-axe-check/lib/runAxeCheck.js");
|
|
8
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
9
|
var _InlineList, _InlineList2, _InlineList3, _InlineList4, _InlineList5;
|
|
11
10
|
/*
|
|
12
11
|
* The MIT License (MIT)
|
|
@@ -44,14 +43,33 @@ describe('<InlineList />', () => {
|
|
|
44
43
|
consoleErrorMock.mockRestore();
|
|
45
44
|
});
|
|
46
45
|
it('should render list items and filter out null/falsy children', async () => {
|
|
47
|
-
(0,
|
|
48
|
-
|
|
46
|
+
(0, _react.render)(_InlineList || (_InlineList = (0, _jsxRuntime.jsxs)(_index.InlineList, {
|
|
47
|
+
children: [(0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
48
|
+
children: "List item 1"
|
|
49
|
+
}), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
50
|
+
children: "List item 2"
|
|
51
|
+
}), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
52
|
+
children: "List item 3"
|
|
53
|
+
}), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
54
|
+
children: "List item 4"
|
|
55
|
+
}), null, false]
|
|
56
|
+
})));
|
|
57
|
+
const listItems = _react.screen.getAllByRole('listitem');
|
|
49
58
|
expect(listItems.length).toEqual(4);
|
|
50
59
|
});
|
|
51
60
|
it('should render a delimiter when delimiter="pipe"', async () => {
|
|
52
|
-
const _render = (0,
|
|
53
|
-
delimiter: "pipe"
|
|
54
|
-
|
|
61
|
+
const _render = (0, _react.render)(_InlineList2 || (_InlineList2 = (0, _jsxRuntime.jsxs)(_index.InlineList, {
|
|
62
|
+
delimiter: "pipe",
|
|
63
|
+
children: [(0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
64
|
+
children: "List item 1"
|
|
65
|
+
}), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
66
|
+
children: "List item 2"
|
|
67
|
+
}), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
68
|
+
children: "List item 3"
|
|
69
|
+
}), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
70
|
+
children: "List item 4"
|
|
71
|
+
})]
|
|
72
|
+
}))),
|
|
55
73
|
container = _render.container;
|
|
56
74
|
const delimiters = container.querySelectorAll('span[aria-hidden="true"]');
|
|
57
75
|
expect(delimiters.length).toEqual(4);
|
|
@@ -60,22 +78,50 @@ describe('<InlineList />', () => {
|
|
|
60
78
|
});
|
|
61
79
|
});
|
|
62
80
|
it('should warn when itemSpacing is set when delimiter is set to anything other than none', async () => {
|
|
63
|
-
(0,
|
|
81
|
+
(0, _react.render)(_InlineList3 || (_InlineList3 = (0, _jsxRuntime.jsxs)(_index.InlineList, {
|
|
64
82
|
delimiter: "pipe",
|
|
65
|
-
itemSpacing: "large"
|
|
66
|
-
|
|
83
|
+
itemSpacing: "large",
|
|
84
|
+
children: [(0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
85
|
+
children: "List item 1"
|
|
86
|
+
}), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
87
|
+
children: "List item 2"
|
|
88
|
+
}), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
89
|
+
children: "List item 3"
|
|
90
|
+
}), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
91
|
+
children: "List item 4"
|
|
92
|
+
})]
|
|
93
|
+
})));
|
|
67
94
|
const warning = `Warning: [InlineList] \`itemSpacing\` has no effect inside Lists with the \`delimiter\` prop set to anything other than \`none\`.`;
|
|
68
95
|
expect(consoleErrorMock.mock.calls[0][0]).toBe(warning);
|
|
69
96
|
});
|
|
70
97
|
it('should render an ordered list', async () => {
|
|
71
|
-
(0,
|
|
72
|
-
as: "ol"
|
|
73
|
-
|
|
74
|
-
|
|
98
|
+
(0, _react.render)(_InlineList4 || (_InlineList4 = (0, _jsxRuntime.jsxs)(_index.InlineList, {
|
|
99
|
+
as: "ol",
|
|
100
|
+
children: [(0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
101
|
+
children: "List item 1"
|
|
102
|
+
}), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
103
|
+
children: "List item 2"
|
|
104
|
+
}), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
105
|
+
children: "List item 3"
|
|
106
|
+
}), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
107
|
+
children: "List item 4"
|
|
108
|
+
})]
|
|
109
|
+
})));
|
|
110
|
+
const list = _react.screen.getByRole('list');
|
|
75
111
|
expect(list.tagName).toBe('OL');
|
|
76
112
|
});
|
|
77
113
|
it('should meet a11y standards', async () => {
|
|
78
|
-
const _render2 = (0,
|
|
114
|
+
const _render2 = (0, _react.render)(_InlineList5 || (_InlineList5 = (0, _jsxRuntime.jsxs)(_index.InlineList, {
|
|
115
|
+
children: [(0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
116
|
+
children: "List item 1"
|
|
117
|
+
}), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
118
|
+
children: "List item 2"
|
|
119
|
+
}), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
120
|
+
children: "List item 3"
|
|
121
|
+
}), (0, _jsxRuntime.jsx)(_index.InlineList.Item, {
|
|
122
|
+
children: "List item 4"
|
|
123
|
+
})]
|
|
124
|
+
}))),
|
|
79
125
|
container = _render2.container;
|
|
80
126
|
const axeCheck = await (0, _runAxeCheck.runAxeCheck)(container);
|
|
81
127
|
expect(axeCheck).toBe(true);
|
package/lib/InlineList/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = exports.InlineList = void 0;
|
|
9
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react =
|
|
9
|
+
var _react = require("react");
|
|
11
10
|
var _View = require("@instructure/ui-view/lib/View");
|
|
12
11
|
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
13
12
|
var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
|
|
14
13
|
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
15
14
|
var _InlineListItem = require("./InlineListItem");
|
|
16
15
|
var _props = require("./props");
|
|
16
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
17
17
|
const _excluded = ["as", "margin", "elementRef"];
|
|
18
18
|
var _dec, _class, _InlineList;
|
|
19
19
|
/*
|
|
@@ -74,13 +74,15 @@ let InlineList = exports.InlineList = (_dec = (0, _testable.testable)(), _dec(_c
|
|
|
74
74
|
margin = _this$props.margin,
|
|
75
75
|
elementRef = _this$props.elementRef,
|
|
76
76
|
rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
77
|
-
return
|
|
77
|
+
return (0, _jsxRuntime.jsx)(_View.View, {
|
|
78
|
+
...(0, _passthroughProps.passthroughProps)(rest),
|
|
78
79
|
as: as,
|
|
79
80
|
margin: margin,
|
|
80
81
|
padding: "0",
|
|
81
82
|
elementRef: this.handleRef,
|
|
82
|
-
display: "block"
|
|
83
|
-
|
|
83
|
+
display: "block",
|
|
84
|
+
children: this.renderChildren()
|
|
85
|
+
});
|
|
84
86
|
}
|
|
85
87
|
}, _InlineList.displayName = "InlineList", _InlineList.propTypes = _props.propTypes, _InlineList.allowedProps = _props.allowedProps, _InlineList.defaultProps = {
|
|
86
88
|
itemSpacing: 'none',
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _react = _interopRequireDefault(require("react"));
|
|
5
3
|
require("@testing-library/jest-dom");
|
|
6
|
-
var
|
|
4
|
+
var _react = require("@testing-library/react");
|
|
7
5
|
var _vitest = require("vitest");
|
|
8
6
|
var _index = require("../index");
|
|
7
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
9
8
|
var _ListItem;
|
|
10
9
|
/*
|
|
11
10
|
* The MIT License (MIT)
|
|
@@ -32,16 +31,19 @@ var _ListItem;
|
|
|
32
31
|
*/
|
|
33
32
|
describe('<ListItem />', () => {
|
|
34
33
|
it('should render children', async () => {
|
|
35
|
-
(0,
|
|
36
|
-
|
|
34
|
+
(0, _react.render)(_ListItem || (_ListItem = (0, _jsxRuntime.jsx)(_index.ListItem, {
|
|
35
|
+
children: "hello"
|
|
36
|
+
})));
|
|
37
|
+
const listItem = _react.screen.getByRole('listitem');
|
|
37
38
|
expect(listItem).toHaveTextContent('hello');
|
|
38
39
|
});
|
|
39
40
|
it('should call elementRef', async () => {
|
|
40
41
|
const elementRef = _vitest.vi.fn();
|
|
41
|
-
(0,
|
|
42
|
-
elementRef: elementRef
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
(0, _react.render)((0, _jsxRuntime.jsx)(_index.ListItem, {
|
|
43
|
+
elementRef: elementRef,
|
|
44
|
+
children: "List item"
|
|
45
|
+
}));
|
|
46
|
+
const listItem = _react.screen.getByRole('listitem');
|
|
45
47
|
expect(elementRef).toHaveBeenCalledWith(listItem);
|
|
46
48
|
});
|
|
47
49
|
});
|
|
@@ -14,6 +14,7 @@ var _emotion = require("@instructure/emotion");
|
|
|
14
14
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
15
15
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
16
16
|
var _props = require("./props");
|
|
17
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
17
18
|
const _excluded = ["delimiter", "spacing", "size", "margin", "padding", "elementRef", "children", "styles"];
|
|
18
19
|
var _dec, _dec2, _class, _ListItem;
|
|
19
20
|
/*
|
|
@@ -39,7 +40,6 @@ var _dec, _dec2, _class, _ListItem;
|
|
|
39
40
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
40
41
|
* SOFTWARE.
|
|
41
42
|
*/
|
|
42
|
-
/** @jsx jsx */
|
|
43
43
|
/**
|
|
44
44
|
---
|
|
45
45
|
parent: List
|
|
@@ -77,14 +77,16 @@ let ListItem = exports.ListItem = (_dec = (0, _emotion.withStyle)(_styles.defaul
|
|
|
77
77
|
children = _this$props3.children,
|
|
78
78
|
styles = _this$props3.styles,
|
|
79
79
|
rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
|
|
80
|
-
return (0,
|
|
80
|
+
return (0, _jsxRuntime.jsx)(_View.View, {
|
|
81
|
+
...(0, _passthroughProps.passthroughProps)(rest),
|
|
81
82
|
css: styles === null || styles === void 0 ? void 0 : styles.listItem,
|
|
82
83
|
as: "li",
|
|
83
84
|
margin: margin,
|
|
84
85
|
padding: padding,
|
|
85
86
|
maxWidth: "100%",
|
|
86
|
-
elementRef: this.handleRef
|
|
87
|
-
|
|
87
|
+
elementRef: this.handleRef,
|
|
88
|
+
children: children
|
|
89
|
+
});
|
|
88
90
|
}
|
|
89
91
|
}, _ListItem.displayName = "ListItem", _ListItem.componentId = 'List.Item', _ListItem.propTypes = _props.propTypes, _ListItem.allowedProps = _props.allowedProps, _ListItem.defaultProps = {
|
|
90
92
|
padding: 'none',
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
7
|
var _index = require("../index");
|
|
8
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
9
|
var _List$Item, _List$Item2, _List$Item3;
|
|
11
10
|
/*
|
|
12
11
|
* The MIT License (MIT)
|
|
@@ -35,13 +34,13 @@ var _default = exports.default = {
|
|
|
35
34
|
sectionProp: 'size',
|
|
36
35
|
getComponentProps: () => {
|
|
37
36
|
return {
|
|
38
|
-
children: [_List$Item || (_List$Item =
|
|
39
|
-
|
|
40
|
-
}, "
|
|
41
|
-
|
|
42
|
-
}, "
|
|
43
|
-
|
|
44
|
-
}, "
|
|
37
|
+
children: [_List$Item || (_List$Item = (0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
38
|
+
children: "Oranges"
|
|
39
|
+
}, "1")), _List$Item2 || (_List$Item2 = (0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
40
|
+
children: "Pineapples"
|
|
41
|
+
}, "2")), _List$Item3 || (_List$Item3 = (0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
42
|
+
children: "Bananas"
|
|
43
|
+
}, "3"))]
|
|
45
44
|
};
|
|
46
45
|
},
|
|
47
46
|
filter: props => {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _react = _interopRequireDefault(require("react"));
|
|
5
3
|
require("@testing-library/jest-dom");
|
|
6
|
-
var
|
|
4
|
+
var _react = require("@testing-library/react");
|
|
7
5
|
var _vitest = require("vitest");
|
|
8
6
|
var _index = require("../index");
|
|
9
7
|
var _runAxeCheck = require("@instructure/ui-axe-check/lib/runAxeCheck.js");
|
|
8
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
9
|
var _List, _List2, _List3, _List4;
|
|
11
10
|
/*
|
|
12
11
|
* The MIT License (MIT)
|
|
@@ -44,27 +43,65 @@ describe('<List />', () => {
|
|
|
44
43
|
consoleErrorMock.mockRestore();
|
|
45
44
|
});
|
|
46
45
|
it('should render list items and filter out null/falsy children', async () => {
|
|
47
|
-
(0,
|
|
48
|
-
|
|
46
|
+
(0, _react.render)(_List || (_List = (0, _jsxRuntime.jsxs)(_index.List, {
|
|
47
|
+
children: [(0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
48
|
+
children: "List item 1"
|
|
49
|
+
}), (0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
50
|
+
children: "List item 2"
|
|
51
|
+
}), (0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
52
|
+
children: "List item 3"
|
|
53
|
+
}), (0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
54
|
+
children: "List item 4"
|
|
55
|
+
}), null, false]
|
|
56
|
+
})));
|
|
57
|
+
const listItems = _react.screen.getAllByRole('listitem');
|
|
49
58
|
expect(listItems.length).toEqual(4);
|
|
50
59
|
});
|
|
51
60
|
it('should warn when itemSpacing is set when delimiter is set to anything other than none', async () => {
|
|
52
|
-
(0,
|
|
61
|
+
(0, _react.render)(_List2 || (_List2 = (0, _jsxRuntime.jsxs)(_index.List, {
|
|
53
62
|
delimiter: "dashed",
|
|
54
|
-
itemSpacing: "large"
|
|
55
|
-
|
|
63
|
+
itemSpacing: "large",
|
|
64
|
+
children: [(0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
65
|
+
children: "List item 1"
|
|
66
|
+
}), (0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
67
|
+
children: "List item 2"
|
|
68
|
+
}), (0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
69
|
+
children: "List item 3"
|
|
70
|
+
}), (0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
71
|
+
children: "List item 4"
|
|
72
|
+
})]
|
|
73
|
+
})));
|
|
56
74
|
const warning = `Warning: [List] \`itemSpacing\` has no effect inside Lists with the \`delimiter\` prop set to anything other than \`none\`.`;
|
|
57
75
|
expect(consoleErrorMock.mock.calls[0][0]).toBe(warning);
|
|
58
76
|
});
|
|
59
77
|
it('should render an ordered list', async () => {
|
|
60
|
-
(0,
|
|
61
|
-
as: "ol"
|
|
62
|
-
|
|
63
|
-
|
|
78
|
+
(0, _react.render)(_List3 || (_List3 = (0, _jsxRuntime.jsxs)(_index.List, {
|
|
79
|
+
as: "ol",
|
|
80
|
+
children: [(0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
81
|
+
children: "List item 1"
|
|
82
|
+
}), (0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
83
|
+
children: "List item 2"
|
|
84
|
+
}), (0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
85
|
+
children: "List item 3"
|
|
86
|
+
}), (0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
87
|
+
children: "List item 4"
|
|
88
|
+
})]
|
|
89
|
+
})));
|
|
90
|
+
const list = _react.screen.getByRole('list');
|
|
64
91
|
expect(list.tagName).toBe('OL');
|
|
65
92
|
});
|
|
66
93
|
it('should meet a11y standards', async () => {
|
|
67
|
-
const _render = (0,
|
|
94
|
+
const _render = (0, _react.render)(_List4 || (_List4 = (0, _jsxRuntime.jsxs)(_index.List, {
|
|
95
|
+
children: [(0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
96
|
+
children: "List item 1"
|
|
97
|
+
}), (0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
98
|
+
children: "List item 2"
|
|
99
|
+
}), (0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
100
|
+
children: "List item 3"
|
|
101
|
+
}), (0, _jsxRuntime.jsx)(_index.List.Item, {
|
|
102
|
+
children: "List item 4"
|
|
103
|
+
})]
|
|
104
|
+
}))),
|
|
68
105
|
container = _render.container;
|
|
69
106
|
const axeCheck = await (0, _runAxeCheck.runAxeCheck)(container);
|
|
70
107
|
expect(axeCheck).toBe(true);
|
package/lib/List/index.js
CHANGED
|
@@ -23,6 +23,7 @@ var _emotion = require("@instructure/emotion");
|
|
|
23
23
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
24
24
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
25
25
|
var _props = require("./props");
|
|
26
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
26
27
|
const _excluded = ["as", "margin", "isUnstyled", "elementRef", "styles"];
|
|
27
28
|
var _dec, _dec2, _class, _List;
|
|
28
29
|
/*
|
|
@@ -48,7 +49,6 @@ var _dec, _dec2, _class, _List;
|
|
|
48
49
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
49
50
|
* SOFTWARE.
|
|
50
51
|
*/
|
|
51
|
-
/** @jsx jsx */
|
|
52
52
|
/**
|
|
53
53
|
---
|
|
54
54
|
category: components
|
|
@@ -94,13 +94,15 @@ let List = exports.List = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
94
94
|
elementRef = _this$props3.elementRef,
|
|
95
95
|
styles = _this$props3.styles,
|
|
96
96
|
rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
|
|
97
|
-
return (0,
|
|
97
|
+
return (0, _jsxRuntime.jsx)(_View.View, {
|
|
98
|
+
...(0, _passthroughProps.passthroughProps)(rest),
|
|
98
99
|
css: styles === null || styles === void 0 ? void 0 : styles.list,
|
|
99
100
|
as: as,
|
|
100
101
|
margin: margin,
|
|
101
102
|
elementRef: this.handleRef,
|
|
102
|
-
display: "block"
|
|
103
|
-
|
|
103
|
+
display: "block",
|
|
104
|
+
children: this.renderChildren()
|
|
105
|
+
});
|
|
104
106
|
}
|
|
105
107
|
}, _List.displayName = "List", _List.componentId = 'List', _List.propTypes = _props.propTypes, _List.allowedProps = _props.allowedProps, _List.defaultProps = {
|
|
106
108
|
as: 'ul',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-list",
|
|
3
|
-
"version": "10.16.1
|
|
3
|
+
"version": "10.16.1",
|
|
4
4
|
"description": "Components for displaying vertical or horizontal lists.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -24,21 +24,21 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.26.0",
|
|
27
|
-
"@instructure/console": "10.16.1
|
|
28
|
-
"@instructure/emotion": "10.16.1
|
|
29
|
-
"@instructure/shared-types": "10.16.1
|
|
30
|
-
"@instructure/ui-prop-types": "10.16.1
|
|
31
|
-
"@instructure/ui-react-utils": "10.16.1
|
|
32
|
-
"@instructure/ui-testable": "10.16.1
|
|
33
|
-
"@instructure/ui-view": "10.16.1
|
|
27
|
+
"@instructure/console": "10.16.1",
|
|
28
|
+
"@instructure/emotion": "10.16.1",
|
|
29
|
+
"@instructure/shared-types": "10.16.1",
|
|
30
|
+
"@instructure/ui-prop-types": "10.16.1",
|
|
31
|
+
"@instructure/ui-react-utils": "10.16.1",
|
|
32
|
+
"@instructure/ui-testable": "10.16.1",
|
|
33
|
+
"@instructure/ui-view": "10.16.1",
|
|
34
34
|
"prop-types": "^15.8.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@instructure/ui-axe-check": "10.16.1
|
|
38
|
-
"@instructure/ui-babel-preset": "10.16.1
|
|
39
|
-
"@instructure/ui-color-utils": "10.16.1
|
|
40
|
-
"@instructure/ui-test-utils": "10.16.1
|
|
41
|
-
"@instructure/ui-themes": "10.16.1
|
|
37
|
+
"@instructure/ui-axe-check": "10.16.1",
|
|
38
|
+
"@instructure/ui-babel-preset": "10.16.1",
|
|
39
|
+
"@instructure/ui-color-utils": "10.16.1",
|
|
40
|
+
"@instructure/ui-test-utils": "10.16.1",
|
|
41
|
+
"@instructure/ui-themes": "10.16.1",
|
|
42
42
|
"@testing-library/jest-dom": "^6.6.3",
|
|
43
43
|
"@testing-library/react": "^16.0.1",
|
|
44
44
|
"vitest": "^2.1.8"
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
import { Component } from 'react'
|
|
26
26
|
|
|
27
27
|
import { View } from '@instructure/ui-view'
|
|
28
28
|
import { testable } from '@instructure/ui-testable'
|
|
29
29
|
import { passthroughProps } from '@instructure/ui-react-utils'
|
|
30
30
|
|
|
31
|
-
import { withStyle
|
|
31
|
+
import { withStyle } from '@instructure/emotion'
|
|
32
32
|
|
|
33
33
|
import generateStyle from './styles'
|
|
34
34
|
import generateComponentTheme from './theme'
|
package/src/InlineList/index.tsx
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
-
import
|
|
24
|
+
import { Children, Component, ReactElement } from 'react'
|
|
25
25
|
|
|
26
26
|
import { View } from '@instructure/ui-view'
|
|
27
27
|
import { passthroughProps, safeCloneElement } from '@instructure/ui-react-utils'
|
|
@@ -22,14 +22,13 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
/** @jsx jsx */
|
|
26
25
|
import { Component } from 'react'
|
|
27
26
|
|
|
28
27
|
import { View } from '@instructure/ui-view'
|
|
29
28
|
import { testable } from '@instructure/ui-testable'
|
|
30
29
|
import { passthroughProps } from '@instructure/ui-react-utils'
|
|
31
30
|
|
|
32
|
-
import { withStyle
|
|
31
|
+
import { withStyle } from '@instructure/emotion'
|
|
33
32
|
|
|
34
33
|
import generateStyle from './styles'
|
|
35
34
|
import generateComponentTheme from './theme'
|
package/src/List/index.tsx
CHANGED
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
/** @jsx jsx */
|
|
26
25
|
import { Children, Component, ReactElement } from 'react'
|
|
27
26
|
|
|
28
27
|
import { View } from '@instructure/ui-view'
|
|
@@ -31,7 +30,7 @@ import { testable } from '@instructure/ui-testable'
|
|
|
31
30
|
|
|
32
31
|
import { ListItem } from './ListItem'
|
|
33
32
|
|
|
34
|
-
import { withStyle
|
|
33
|
+
import { withStyle } from '@instructure/emotion'
|
|
35
34
|
|
|
36
35
|
import generateStyle from './styles'
|
|
37
36
|
import generateComponentTheme from './theme'
|