@instructure/ui-table 10.2.3-snapshot-14 → 10.2.3-snapshot-16
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 +5 -2
- package/es/Table/Body/index.js +1 -1
- package/es/Table/ColHeader/index.js +10 -7
- package/es/Table/ColHeader/styles.js +8 -0
- package/es/Table/ColHeader/theme.js +4 -2
- package/es/Table/Row/index.js +1 -1
- package/es/Table/__new-tests__/Table.test.js +5 -5
- package/es/Table/index.js +1 -1
- package/lib/Table/Body/index.js +1 -1
- package/lib/Table/ColHeader/index.js +11 -8
- package/lib/Table/ColHeader/styles.js +8 -0
- package/lib/Table/ColHeader/theme.js +4 -2
- package/lib/Table/Row/index.js +1 -1
- package/lib/Table/__new-tests__/Table.test.js +5 -5
- package/lib/Table/index.js +1 -1
- package/package.json +20 -20
- package/src/Table/ColHeader/index.tsx +4 -4
- package/src/Table/ColHeader/props.ts +5 -1
- package/src/Table/ColHeader/styles.ts +8 -0
- package/src/Table/ColHeader/theme.ts +4 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Table/ColHeader/index.d.ts.map +1 -1
- package/types/Table/ColHeader/props.d.ts +1 -1
- package/types/Table/ColHeader/props.d.ts.map +1 -1
- package/types/Table/ColHeader/styles.d.ts.map +1 -1
- package/types/Table/ColHeader/theme.d.ts.map +1 -1
- package/types/Table/index.d.ts +4 -4
- package/types/Table/index.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
@@ -3,9 +3,12 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
-
## [10.2.3-snapshot-
|
6
|
+
## [10.2.3-snapshot-16](https://github.com/instructure/instructure-ui/compare/v10.2.2...v10.2.3-snapshot-16) (2024-10-03)
|
7
7
|
|
8
|
-
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* **shared-types,ui-table:** fix color contrast for table sorting icons ([b5a60bf](https://github.com/instructure/instructure-ui/commit/b5a60bf4b682e100912d686524a7c4c04f828ea9))
|
9
12
|
|
10
13
|
|
11
14
|
|
package/es/Table/Body/index.js
CHANGED
@@ -61,7 +61,7 @@ let Body = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
|
|
61
61
|
css: styles === null || styles === void 0 ? void 0 : styles.body,
|
62
62
|
role: isStacked ? 'rowgroup' : void 0
|
63
63
|
}), Children.map(children, child => {
|
64
|
-
if (
|
64
|
+
if (/*#__PURE__*/isValidElement(child)) {
|
65
65
|
return safeCloneElement(child, {
|
66
66
|
key: child.props.name,
|
67
67
|
// Sent down for compatibility with custom components
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var _dec, _class, _ColHeader
|
1
|
+
var _dec, _class, _ColHeader;
|
2
2
|
/*
|
3
3
|
* The MIT License (MIT)
|
4
4
|
*
|
@@ -61,18 +61,21 @@ let ColHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_
|
|
61
61
|
renderSortArrow() {
|
62
62
|
const _this$props4 = this.props,
|
63
63
|
sortDirection = _this$props4.sortDirection,
|
64
|
-
onRequestSort = _this$props4.onRequestSort
|
64
|
+
onRequestSort = _this$props4.onRequestSort,
|
65
|
+
styles = _this$props4.styles;
|
65
66
|
if (sortDirection === 'ascending') {
|
66
|
-
return
|
67
|
+
return jsx(IconMiniArrowUpLine, {
|
68
|
+
css: styles === null || styles === void 0 ? void 0 : styles.sortedIconColor
|
69
|
+
});
|
67
70
|
}
|
68
71
|
if (sortDirection === 'descending') {
|
69
|
-
return
|
72
|
+
return jsx(IconMiniArrowDownLine, {
|
73
|
+
css: styles === null || styles === void 0 ? void 0 : styles.sortedIconColor
|
74
|
+
});
|
70
75
|
}
|
71
76
|
if (onRequestSort) {
|
72
77
|
return jsx(IconMiniArrowDoubleLine, {
|
73
|
-
css:
|
74
|
-
opacity: '30%'
|
75
|
-
}
|
78
|
+
css: styles === null || styles === void 0 ? void 0 : styles.unSortedIconColor
|
76
79
|
});
|
77
80
|
}
|
78
81
|
return void 0;
|
@@ -86,6 +86,14 @@ const generateStyle = (componentTheme, props) => {
|
|
86
86
|
label: 'colHeader__buttonContent',
|
87
87
|
display: 'flex',
|
88
88
|
alignItems: 'center'
|
89
|
+
},
|
90
|
+
unSortedIconColor: {
|
91
|
+
label: 'colHeader__unSortedIconColor',
|
92
|
+
color: componentTheme.unSortedIconColor
|
93
|
+
},
|
94
|
+
sortedIconColor: {
|
95
|
+
label: 'colHeader__sortedIconColor',
|
96
|
+
color: componentTheme.sortedIconColor
|
89
97
|
}
|
90
98
|
};
|
91
99
|
};
|
@@ -28,7 +28,7 @@
|
|
28
28
|
* @return {Object} The final theme object with the overrides and component variables
|
29
29
|
*/
|
30
30
|
const generateComponentTheme = theme => {
|
31
|
-
var _colors$contrasts, _colors$contrasts2, _colors$contrasts3, _colors$contrasts4;
|
31
|
+
var _colors$contrasts, _colors$contrasts2, _colors$contrasts3, _colors$contrasts4, _colors$contrasts5, _colors$contrasts6;
|
32
32
|
const typography = theme.typography,
|
33
33
|
colors = theme.colors,
|
34
34
|
borders = theme.borders,
|
@@ -43,7 +43,9 @@ const generateComponentTheme = theme => {
|
|
43
43
|
padding: `${spacing === null || spacing === void 0 ? void 0 : spacing.xSmall} ${spacing === null || spacing === void 0 ? void 0 : spacing.small}`,
|
44
44
|
focusOutlineColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts4 = colors.contrasts) === null || _colors$contrasts4 === void 0 ? void 0 : _colors$contrasts4.blue4570,
|
45
45
|
focusOutlineWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
|
46
|
-
focusOutlineStyle: borders === null || borders === void 0 ? void 0 : borders.style
|
46
|
+
focusOutlineStyle: borders === null || borders === void 0 ? void 0 : borders.style,
|
47
|
+
unSortedIconColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts5 = colors.contrasts) === null || _colors$contrasts5 === void 0 ? void 0 : _colors$contrasts5.grey4570,
|
48
|
+
sortedIconColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts6 = colors.contrasts) === null || _colors$contrasts6 === void 0 ? void 0 : _colors$contrasts6.blue4570
|
47
49
|
};
|
48
50
|
return {
|
49
51
|
...componentVariables
|
package/es/Table/Row/index.js
CHANGED
@@ -65,7 +65,7 @@ let Row = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
|
|
65
65
|
css: styles === null || styles === void 0 ? void 0 : styles.row,
|
66
66
|
role: isStacked ? 'row' : void 0
|
67
67
|
}), Children.toArray(children).filter(Boolean).map((child, index) => {
|
68
|
-
if (
|
68
|
+
if (/*#__PURE__*/isValidElement(child)) {
|
69
69
|
return safeCloneElement(child, {
|
70
70
|
key: child.props.name,
|
71
71
|
// Sent down for compatibility with custom components
|
@@ -39,7 +39,7 @@ describe('<Table />', async () => {
|
|
39
39
|
afterEach(() => {
|
40
40
|
consoleErrorMock.mockRestore();
|
41
41
|
});
|
42
|
-
const renderTable = props => render(
|
42
|
+
const renderTable = props => render(/*#__PURE__*/React.createElement(Table, Object.assign({
|
43
43
|
caption: "Test table"
|
44
44
|
}, props), _Table$Head || (_Table$Head = /*#__PURE__*/React.createElement(Table.Head, null, /*#__PURE__*/React.createElement(Table.Row, null, /*#__PURE__*/React.createElement(Table.ColHeader, {
|
45
45
|
id: "foo"
|
@@ -128,7 +128,7 @@ describe('<Table />', async () => {
|
|
128
128
|
expect(stackedTable).not.toHaveTextContent('Foo');
|
129
129
|
});
|
130
130
|
it('does not crash for invalid children', async () => {
|
131
|
-
render(
|
131
|
+
render(/*#__PURE__*/React.createElement(Table, {
|
132
132
|
caption: "Test table",
|
133
133
|
layout: "stacked"
|
134
134
|
}, "test1", _span || (_span = /*#__PURE__*/React.createElement("span", null, "test")), /*#__PURE__*/React.createElement(Table.Head, null, _span2 || (_span2 = /*#__PURE__*/React.createElement("span", null, "test")), "test2", _Table$Row || (_Table$Row = /*#__PURE__*/React.createElement(Table.Row, null, "test3", /*#__PURE__*/React.createElement("span", null, "test"), /*#__PURE__*/React.createElement(Table.Cell, null, "Foo"))), "test4", _span3 || (_span3 = /*#__PURE__*/React.createElement("span", null, "test"))), "test5", /*#__PURE__*/React.createElement(Table.Body, null, "test", _span4 || (_span4 = /*#__PURE__*/React.createElement("span", null, "test")), _Table$Row2 || (_Table$Row2 = /*#__PURE__*/React.createElement(Table.Row, null, "test", /*#__PURE__*/React.createElement("span", null, "test"), /*#__PURE__*/React.createElement(Table.Cell, null, "Foo"), "test", /*#__PURE__*/React.createElement("span", null, "test"))))));
|
@@ -137,7 +137,7 @@ describe('<Table />', async () => {
|
|
137
137
|
expect(table).toHaveTextContent('Foo');
|
138
138
|
});
|
139
139
|
describe('when table is sortable', async () => {
|
140
|
-
const renderSortableTable = (props, handlers = {}, layout = 'auto') => render(
|
140
|
+
const renderSortableTable = (props, handlers = {}, layout = 'auto') => render(/*#__PURE__*/React.createElement(Table, {
|
141
141
|
caption: "Sortable table",
|
142
142
|
layout: layout
|
143
143
|
}, /*#__PURE__*/React.createElement(Table.Head, null, /*#__PURE__*/React.createElement(Table.Row, null, /*#__PURE__*/React.createElement(Table.ColHeader, Object.assign({
|
@@ -240,7 +240,7 @@ describe('<Table />', async () => {
|
|
240
240
|
}
|
241
241
|
}
|
242
242
|
CustomTableRow.displayName = "CustomTableRow";
|
243
|
-
const table = render(
|
243
|
+
const table = render(/*#__PURE__*/React.createElement(Table, {
|
244
244
|
caption: "Test custom table"
|
245
245
|
}, _Table$Head2 || (_Table$Head2 = /*#__PURE__*/React.createElement(Table.Head, null, /*#__PURE__*/React.createElement(Table.Row, null, /*#__PURE__*/React.createElement(Table.ColHeader, {
|
246
246
|
id: "foo"
|
@@ -269,7 +269,7 @@ describe('<Table />', async () => {
|
|
269
269
|
}
|
270
270
|
}
|
271
271
|
CustomTableRow.displayName = "CustomTableRow";
|
272
|
-
const table = render(
|
272
|
+
const table = render(/*#__PURE__*/React.createElement(Table, {
|
273
273
|
caption: "Test custom table"
|
274
274
|
}, /*#__PURE__*/React.createElement(Table.Head, null, /*#__PURE__*/React.createElement(CustomTableRow, null, /*#__PURE__*/React.createElement(CustomTableCell, {
|
275
275
|
id: "foo"
|
package/es/Table/index.js
CHANGED
@@ -104,7 +104,7 @@ let Table = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_clas
|
|
104
104
|
role: isStacked ? 'table' : void 0,
|
105
105
|
"aria-label": isStacked ? caption : void 0
|
106
106
|
}), !isStacked && jsx("caption", null, jsx(ScreenReaderContent, null, caption)), Children.map(children, child => {
|
107
|
-
if (
|
107
|
+
if (/*#__PURE__*/isValidElement(child)) {
|
108
108
|
return safeCloneElement(child, {
|
109
109
|
key: child.props.name
|
110
110
|
});
|
package/lib/Table/Body/index.js
CHANGED
@@ -67,7 +67,7 @@ let Body = exports.Body = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
67
67
|
css: styles === null || styles === void 0 ? void 0 : styles.body,
|
68
68
|
role: isStacked ? 'rowgroup' : void 0
|
69
69
|
}), _react.Children.map(children, child => {
|
70
|
-
if (
|
70
|
+
if (/*#__PURE__*/(0, _react.isValidElement)(child)) {
|
71
71
|
return (0, _safeCloneElement.safeCloneElement)(child, {
|
72
72
|
key: child.props.name,
|
73
73
|
// Sent down for compatibility with custom components
|
@@ -9,14 +9,14 @@ exports.default = exports.ColHeader = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
10
10
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
11
11
|
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
12
|
-
var
|
12
|
+
var _IconMiniArrowUpLine = require("@instructure/ui-icons/lib/IconMiniArrowUpLine.js");
|
13
13
|
var _IconMiniArrowDownLine = require("@instructure/ui-icons/lib/IconMiniArrowDownLine.js");
|
14
14
|
var _IconMiniArrowDoubleLine = require("@instructure/ui-icons/lib/IconMiniArrowDoubleLine.js");
|
15
15
|
var _emotion = require("@instructure/emotion");
|
16
16
|
var _styles = _interopRequireDefault(require("./styles"));
|
17
17
|
var _theme = _interopRequireDefault(require("./theme"));
|
18
18
|
var _props = require("./props");
|
19
|
-
var _dec, _class, _ColHeader
|
19
|
+
var _dec, _class, _ColHeader;
|
20
20
|
/*
|
21
21
|
* The MIT License (MIT)
|
22
22
|
*
|
@@ -70,18 +70,21 @@ let ColHeader = exports.ColHeader = (_dec = (0, _emotion.withStyle)(_styles.defa
|
|
70
70
|
renderSortArrow() {
|
71
71
|
const _this$props4 = this.props,
|
72
72
|
sortDirection = _this$props4.sortDirection,
|
73
|
-
onRequestSort = _this$props4.onRequestSort
|
73
|
+
onRequestSort = _this$props4.onRequestSort,
|
74
|
+
styles = _this$props4.styles;
|
74
75
|
if (sortDirection === 'ascending') {
|
75
|
-
return
|
76
|
+
return (0, _emotion.jsx)(_IconMiniArrowUpLine.IconMiniArrowUpLine, {
|
77
|
+
css: styles === null || styles === void 0 ? void 0 : styles.sortedIconColor
|
78
|
+
});
|
76
79
|
}
|
77
80
|
if (sortDirection === 'descending') {
|
78
|
-
return
|
81
|
+
return (0, _emotion.jsx)(_IconMiniArrowDownLine.IconMiniArrowDownLine, {
|
82
|
+
css: styles === null || styles === void 0 ? void 0 : styles.sortedIconColor
|
83
|
+
});
|
79
84
|
}
|
80
85
|
if (onRequestSort) {
|
81
86
|
return (0, _emotion.jsx)(_IconMiniArrowDoubleLine.IconMiniArrowDoubleLine, {
|
82
|
-
css:
|
83
|
-
opacity: '30%'
|
84
|
-
}
|
87
|
+
css: styles === null || styles === void 0 ? void 0 : styles.unSortedIconColor
|
85
88
|
});
|
86
89
|
}
|
87
90
|
return void 0;
|
@@ -92,6 +92,14 @@ const generateStyle = (componentTheme, props) => {
|
|
92
92
|
label: 'colHeader__buttonContent',
|
93
93
|
display: 'flex',
|
94
94
|
alignItems: 'center'
|
95
|
+
},
|
96
|
+
unSortedIconColor: {
|
97
|
+
label: 'colHeader__unSortedIconColor',
|
98
|
+
color: componentTheme.unSortedIconColor
|
99
|
+
},
|
100
|
+
sortedIconColor: {
|
101
|
+
label: 'colHeader__sortedIconColor',
|
102
|
+
color: componentTheme.sortedIconColor
|
95
103
|
}
|
96
104
|
};
|
97
105
|
};
|
@@ -34,7 +34,7 @@ exports.default = void 0;
|
|
34
34
|
* @return {Object} The final theme object with the overrides and component variables
|
35
35
|
*/
|
36
36
|
const generateComponentTheme = theme => {
|
37
|
-
var _colors$contrasts, _colors$contrasts2, _colors$contrasts3, _colors$contrasts4;
|
37
|
+
var _colors$contrasts, _colors$contrasts2, _colors$contrasts3, _colors$contrasts4, _colors$contrasts5, _colors$contrasts6;
|
38
38
|
const typography = theme.typography,
|
39
39
|
colors = theme.colors,
|
40
40
|
borders = theme.borders,
|
@@ -49,7 +49,9 @@ const generateComponentTheme = theme => {
|
|
49
49
|
padding: `${spacing === null || spacing === void 0 ? void 0 : spacing.xSmall} ${spacing === null || spacing === void 0 ? void 0 : spacing.small}`,
|
50
50
|
focusOutlineColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts4 = colors.contrasts) === null || _colors$contrasts4 === void 0 ? void 0 : _colors$contrasts4.blue4570,
|
51
51
|
focusOutlineWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
|
52
|
-
focusOutlineStyle: borders === null || borders === void 0 ? void 0 : borders.style
|
52
|
+
focusOutlineStyle: borders === null || borders === void 0 ? void 0 : borders.style,
|
53
|
+
unSortedIconColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts5 = colors.contrasts) === null || _colors$contrasts5 === void 0 ? void 0 : _colors$contrasts5.grey4570,
|
54
|
+
sortedIconColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts6 = colors.contrasts) === null || _colors$contrasts6 === void 0 ? void 0 : _colors$contrasts6.blue4570
|
53
55
|
};
|
54
56
|
return {
|
55
57
|
...componentVariables
|
package/lib/Table/Row/index.js
CHANGED
@@ -71,7 +71,7 @@ let Row = exports.Row = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.
|
|
71
71
|
css: styles === null || styles === void 0 ? void 0 : styles.row,
|
72
72
|
role: isStacked ? 'row' : void 0
|
73
73
|
}), _react.Children.toArray(children).filter(Boolean).map((child, index) => {
|
74
|
-
if (
|
74
|
+
if (/*#__PURE__*/(0, _react.isValidElement)(child)) {
|
75
75
|
return (0, _safeCloneElement.safeCloneElement)(child, {
|
76
76
|
key: child.props.name,
|
77
77
|
// Sent down for compatibility with custom components
|
@@ -41,7 +41,7 @@ describe('<Table />', async () => {
|
|
41
41
|
afterEach(() => {
|
42
42
|
consoleErrorMock.mockRestore();
|
43
43
|
});
|
44
|
-
const renderTable = props => (0, _react2.render)(
|
44
|
+
const renderTable = props => (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Table, Object.assign({
|
45
45
|
caption: "Test table"
|
46
46
|
}, props), _Table$Head || (_Table$Head = /*#__PURE__*/_react.default.createElement(_index.Table.Head, null, /*#__PURE__*/_react.default.createElement(_index.Table.Row, null, /*#__PURE__*/_react.default.createElement(_index.Table.ColHeader, {
|
47
47
|
id: "foo"
|
@@ -130,7 +130,7 @@ describe('<Table />', async () => {
|
|
130
130
|
expect(stackedTable).not.toHaveTextContent('Foo');
|
131
131
|
});
|
132
132
|
it('does not crash for invalid children', async () => {
|
133
|
-
(0, _react2.render)(
|
133
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Table, {
|
134
134
|
caption: "Test table",
|
135
135
|
layout: "stacked"
|
136
136
|
}, "test1", _span || (_span = /*#__PURE__*/_react.default.createElement("span", null, "test")), /*#__PURE__*/_react.default.createElement(_index.Table.Head, null, _span2 || (_span2 = /*#__PURE__*/_react.default.createElement("span", null, "test")), "test2", _Table$Row || (_Table$Row = /*#__PURE__*/_react.default.createElement(_index.Table.Row, null, "test3", /*#__PURE__*/_react.default.createElement("span", null, "test"), /*#__PURE__*/_react.default.createElement(_index.Table.Cell, null, "Foo"))), "test4", _span3 || (_span3 = /*#__PURE__*/_react.default.createElement("span", null, "test"))), "test5", /*#__PURE__*/_react.default.createElement(_index.Table.Body, null, "test", _span4 || (_span4 = /*#__PURE__*/_react.default.createElement("span", null, "test")), _Table$Row2 || (_Table$Row2 = /*#__PURE__*/_react.default.createElement(_index.Table.Row, null, "test", /*#__PURE__*/_react.default.createElement("span", null, "test"), /*#__PURE__*/_react.default.createElement(_index.Table.Cell, null, "Foo"), "test", /*#__PURE__*/_react.default.createElement("span", null, "test"))))));
|
@@ -139,7 +139,7 @@ describe('<Table />', async () => {
|
|
139
139
|
expect(table).toHaveTextContent('Foo');
|
140
140
|
});
|
141
141
|
describe('when table is sortable', async () => {
|
142
|
-
const renderSortableTable = (props, handlers = {}, layout = 'auto') => (0, _react2.render)(
|
142
|
+
const renderSortableTable = (props, handlers = {}, layout = 'auto') => (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Table, {
|
143
143
|
caption: "Sortable table",
|
144
144
|
layout: layout
|
145
145
|
}, /*#__PURE__*/_react.default.createElement(_index.Table.Head, null, /*#__PURE__*/_react.default.createElement(_index.Table.Row, null, /*#__PURE__*/_react.default.createElement(_index.Table.ColHeader, Object.assign({
|
@@ -242,7 +242,7 @@ describe('<Table />', async () => {
|
|
242
242
|
}
|
243
243
|
}
|
244
244
|
CustomTableRow.displayName = "CustomTableRow";
|
245
|
-
const table = (0, _react2.render)(
|
245
|
+
const table = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Table, {
|
246
246
|
caption: "Test custom table"
|
247
247
|
}, _Table$Head2 || (_Table$Head2 = /*#__PURE__*/_react.default.createElement(_index.Table.Head, null, /*#__PURE__*/_react.default.createElement(_index.Table.Row, null, /*#__PURE__*/_react.default.createElement(_index.Table.ColHeader, {
|
248
248
|
id: "foo"
|
@@ -271,7 +271,7 @@ describe('<Table />', async () => {
|
|
271
271
|
}
|
272
272
|
}
|
273
273
|
CustomTableRow.displayName = "CustomTableRow";
|
274
|
-
const table = (0, _react2.render)(
|
274
|
+
const table = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Table, {
|
275
275
|
caption: "Test custom table"
|
276
276
|
}, /*#__PURE__*/_react.default.createElement(_index.Table.Head, null, /*#__PURE__*/_react.default.createElement(CustomTableRow, null, /*#__PURE__*/_react.default.createElement(CustomTableCell, {
|
277
277
|
id: "foo"
|
package/lib/Table/index.js
CHANGED
@@ -110,7 +110,7 @@ let Table = exports.Table = (_dec = (0, _emotion.withStyle)(_styles.default, _th
|
|
110
110
|
role: isStacked ? 'table' : void 0,
|
111
111
|
"aria-label": isStacked ? caption : void 0
|
112
112
|
}), !isStacked && (0, _emotion.jsx)("caption", null, (0, _emotion.jsx)(_ScreenReaderContent.ScreenReaderContent, null, caption)), _react.Children.map(children, child => {
|
113
|
-
if (
|
113
|
+
if (/*#__PURE__*/(0, _react.isValidElement)(child)) {
|
114
114
|
return (0, _safeCloneElement.safeCloneElement)(child, {
|
115
115
|
key: child.props.name
|
116
116
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@instructure/ui-table",
|
3
|
-
"version": "10.2.3-snapshot-
|
3
|
+
"version": "10.2.3-snapshot-16",
|
4
4
|
"description": "A styled HTML table component",
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
6
6
|
"module": "./es/index.js",
|
@@ -23,29 +23,29 @@
|
|
23
23
|
},
|
24
24
|
"license": "MIT",
|
25
25
|
"devDependencies": {
|
26
|
-
"@instructure/ui-axe-check": "10.2.3-snapshot-
|
27
|
-
"@instructure/ui-babel-preset": "10.2.3-snapshot-
|
28
|
-
"@instructure/ui-color-utils": "10.2.3-snapshot-
|
29
|
-
"@instructure/ui-test-utils": "10.2.3-snapshot-
|
30
|
-
"@instructure/ui-themes": "10.2.3-snapshot-
|
26
|
+
"@instructure/ui-axe-check": "10.2.3-snapshot-16",
|
27
|
+
"@instructure/ui-babel-preset": "10.2.3-snapshot-16",
|
28
|
+
"@instructure/ui-color-utils": "10.2.3-snapshot-16",
|
29
|
+
"@instructure/ui-test-utils": "10.2.3-snapshot-16",
|
30
|
+
"@instructure/ui-themes": "10.2.3-snapshot-16",
|
31
31
|
"@testing-library/jest-dom": "^6.4.6",
|
32
|
-
"@testing-library/react": "^
|
32
|
+
"@testing-library/react": "^16.0.1",
|
33
33
|
"@testing-library/user-event": "^14.5.2",
|
34
|
-
"vitest": "^2.
|
34
|
+
"vitest": "^2.1.1"
|
35
35
|
},
|
36
36
|
"dependencies": {
|
37
|
-
"@babel/runtime": "^7.
|
38
|
-
"@instructure/console": "10.2.3-snapshot-
|
39
|
-
"@instructure/emotion": "10.2.3-snapshot-
|
40
|
-
"@instructure/shared-types": "10.2.3-snapshot-
|
41
|
-
"@instructure/ui-a11y-content": "10.2.3-snapshot-
|
42
|
-
"@instructure/ui-icons": "10.2.3-snapshot-
|
43
|
-
"@instructure/ui-prop-types": "10.2.3-snapshot-
|
44
|
-
"@instructure/ui-react-utils": "10.2.3-snapshot-
|
45
|
-
"@instructure/ui-simple-select": "10.2.3-snapshot-
|
46
|
-
"@instructure/ui-testable": "10.2.3-snapshot-
|
47
|
-
"@instructure/ui-utils": "10.2.3-snapshot-
|
48
|
-
"@instructure/ui-view": "10.2.3-snapshot-
|
37
|
+
"@babel/runtime": "^7.25.6",
|
38
|
+
"@instructure/console": "10.2.3-snapshot-16",
|
39
|
+
"@instructure/emotion": "10.2.3-snapshot-16",
|
40
|
+
"@instructure/shared-types": "10.2.3-snapshot-16",
|
41
|
+
"@instructure/ui-a11y-content": "10.2.3-snapshot-16",
|
42
|
+
"@instructure/ui-icons": "10.2.3-snapshot-16",
|
43
|
+
"@instructure/ui-prop-types": "10.2.3-snapshot-16",
|
44
|
+
"@instructure/ui-react-utils": "10.2.3-snapshot-16",
|
45
|
+
"@instructure/ui-simple-select": "10.2.3-snapshot-16",
|
46
|
+
"@instructure/ui-testable": "10.2.3-snapshot-16",
|
47
|
+
"@instructure/ui-utils": "10.2.3-snapshot-16",
|
48
|
+
"@instructure/ui-view": "10.2.3-snapshot-16",
|
49
49
|
"prop-types": "^15.8.1"
|
50
50
|
},
|
51
51
|
"peerDependencies": {
|
@@ -74,16 +74,16 @@ class ColHeader extends Component<TableColHeaderProps> {
|
|
74
74
|
}
|
75
75
|
|
76
76
|
renderSortArrow() {
|
77
|
-
const { sortDirection, onRequestSort } = this.props
|
77
|
+
const { sortDirection, onRequestSort, styles } = this.props
|
78
78
|
|
79
79
|
if (sortDirection === 'ascending') {
|
80
|
-
return <IconMiniArrowUpLine />
|
80
|
+
return <IconMiniArrowUpLine css={styles?.sortedIconColor} />
|
81
81
|
}
|
82
82
|
if (sortDirection === 'descending') {
|
83
|
-
return <IconMiniArrowDownLine />
|
83
|
+
return <IconMiniArrowDownLine css={styles?.sortedIconColor} />
|
84
84
|
}
|
85
85
|
if (onRequestSort) {
|
86
|
-
return <IconMiniArrowDoubleLine css={
|
86
|
+
return <IconMiniArrowDoubleLine css={styles?.unSortedIconColor} />
|
87
87
|
}
|
88
88
|
return undefined
|
89
89
|
}
|
@@ -85,7 +85,11 @@ type TableColHeaderProps = TableColHeaderOwnProps &
|
|
85
85
|
>
|
86
86
|
|
87
87
|
type TableColHeaderStyle = ComponentStyle<
|
88
|
-
|
88
|
+
| 'colHeader'
|
89
|
+
| 'button'
|
90
|
+
| 'buttonContent'
|
91
|
+
| 'unSortedIconColor'
|
92
|
+
| 'sortedIconColor'
|
89
93
|
>
|
90
94
|
|
91
95
|
const propTypes: PropValidators<PropKeys> = {
|
@@ -86,6 +86,14 @@ const generateStyle = (
|
|
86
86
|
label: 'colHeader__buttonContent',
|
87
87
|
display: 'flex',
|
88
88
|
alignItems: 'center'
|
89
|
+
},
|
90
|
+
unSortedIconColor: {
|
91
|
+
label: 'colHeader__unSortedIconColor',
|
92
|
+
color: componentTheme.unSortedIconColor
|
93
|
+
},
|
94
|
+
sortedIconColor: {
|
95
|
+
label: 'colHeader__sortedIconColor',
|
96
|
+
color: componentTheme.sortedIconColor
|
89
97
|
}
|
90
98
|
}
|
91
99
|
}
|
@@ -47,7 +47,10 @@ const generateComponentTheme = (theme: Theme): TableColHeaderTheme => {
|
|
47
47
|
|
48
48
|
focusOutlineColor: colors?.contrasts?.blue4570,
|
49
49
|
focusOutlineWidth: borders?.widthMedium,
|
50
|
-
focusOutlineStyle: borders?.style
|
50
|
+
focusOutlineStyle: borders?.style,
|
51
|
+
|
52
|
+
unSortedIconColor: colors?.contrasts?.grey4570,
|
53
|
+
sortedIconColor: colors?.contrasts?.blue4570
|
51
54
|
}
|
52
55
|
|
53
56
|
return {
|