@instructure/ui-table 11.7.3-snapshot-25 → 11.7.3-snapshot-26

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.
Files changed (65) hide show
  1. package/CHANGELOG.md +5 -2
  2. package/es/Table/v1/Body/index.js +21 -15
  3. package/es/Table/v1/Body/theme.js +9 -8
  4. package/es/Table/v1/Cell/index.js +20 -16
  5. package/es/Table/v1/Cell/styles.js +3 -1
  6. package/es/Table/v1/Cell/theme.js +13 -12
  7. package/es/Table/v1/ColHeader/index.js +43 -41
  8. package/es/Table/v1/ColHeader/styles.js +4 -2
  9. package/es/Table/v1/ColHeader/theme.js +19 -18
  10. package/es/Table/v1/Head/index.js +34 -34
  11. package/es/Table/v1/Head/theme.js +9 -8
  12. package/es/Table/v1/Row/index.js +18 -14
  13. package/es/Table/v1/Row/styles.js +4 -2
  14. package/es/Table/v1/Row/theme.js +14 -13
  15. package/es/Table/v1/RowHeader/index.js +19 -15
  16. package/es/Table/v1/RowHeader/styles.js +3 -1
  17. package/es/Table/v1/RowHeader/theme.js +13 -12
  18. package/es/Table/v1/index.js +50 -55
  19. package/es/Table/v1/styles.js +3 -1
  20. package/es/Table/v1/theme.js +10 -9
  21. package/es/Table/v2/Body/index.js +21 -15
  22. package/es/Table/v2/Cell/index.js +20 -16
  23. package/es/Table/v2/Cell/styles.js +3 -1
  24. package/es/Table/v2/ColHeader/index.js +45 -43
  25. package/es/Table/v2/ColHeader/styles.js +4 -2
  26. package/es/Table/v2/Head/index.js +37 -37
  27. package/es/Table/v2/Row/index.js +18 -14
  28. package/es/Table/v2/Row/styles.js +4 -2
  29. package/es/Table/v2/RowHeader/index.js +19 -15
  30. package/es/Table/v2/RowHeader/styles.js +3 -1
  31. package/es/Table/v2/index.js +50 -55
  32. package/es/Table/v2/styles.js +3 -1
  33. package/lib/Table/v1/Body/index.js +21 -15
  34. package/lib/Table/v1/Body/theme.js +9 -8
  35. package/lib/Table/v1/Cell/index.js +20 -16
  36. package/lib/Table/v1/Cell/styles.js +3 -1
  37. package/lib/Table/v1/Cell/theme.js +13 -12
  38. package/lib/Table/v1/ColHeader/index.js +43 -41
  39. package/lib/Table/v1/ColHeader/styles.js +4 -2
  40. package/lib/Table/v1/ColHeader/theme.js +19 -18
  41. package/lib/Table/v1/Head/index.js +35 -35
  42. package/lib/Table/v1/Head/theme.js +9 -8
  43. package/lib/Table/v1/Row/index.js +18 -14
  44. package/lib/Table/v1/Row/styles.js +4 -2
  45. package/lib/Table/v1/Row/theme.js +14 -13
  46. package/lib/Table/v1/RowHeader/index.js +19 -15
  47. package/lib/Table/v1/RowHeader/styles.js +3 -1
  48. package/lib/Table/v1/RowHeader/theme.js +13 -12
  49. package/lib/Table/v1/index.js +50 -55
  50. package/lib/Table/v1/styles.js +3 -1
  51. package/lib/Table/v1/theme.js +10 -9
  52. package/lib/Table/v2/Body/index.js +21 -15
  53. package/lib/Table/v2/Cell/index.js +20 -16
  54. package/lib/Table/v2/Cell/styles.js +3 -1
  55. package/lib/Table/v2/ColHeader/index.js +45 -43
  56. package/lib/Table/v2/ColHeader/styles.js +4 -2
  57. package/lib/Table/v2/Head/index.js +38 -38
  58. package/lib/Table/v2/Row/index.js +18 -14
  59. package/lib/Table/v2/Row/styles.js +4 -2
  60. package/lib/Table/v2/RowHeader/index.js +19 -15
  61. package/lib/Table/v2/RowHeader/styles.js +3 -1
  62. package/lib/Table/v2/index.js +50 -55
  63. package/lib/Table/v2/styles.js +3 -1
  64. package/package.json +15 -15
  65. package/tsconfig.build.tsbuildinfo +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
- ## [11.7.3-snapshot-25](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-25) (2026-04-30)
6
+ ## [11.7.3-snapshot-26](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-26) (2026-05-05)
7
7
 
8
- **Note:** Version bump only for package @instructure/ui-table
8
+
9
+ ### Bug Fixes
10
+
11
+ * **many:** update dependencies, remove lots of Babel plugins, remove Webpack 4 support ([f916fca](https://github.com/instructure/instructure-ui/commit/f916fcafdddcb2d7de401f93e8ff92cfdfa47bba))
9
12
 
10
13
 
11
14
 
@@ -1,4 +1,4 @@
1
- var _dec, _class, _Body;
1
+ var _dec, _class;
2
2
  /*
3
3
  * The MIT License (MIT)
4
4
  *
@@ -38,25 +38,33 @@ id: Table.Body
38
38
  ---
39
39
  **/
40
40
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
41
- let Body = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_Body = class Body extends Component {
41
+ let Body = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class Body extends Component {
42
+ static displayName = "Body";
43
+ static componentId = 'Table.Body';
44
+ static contextType = TableContext;
45
+ static allowedProps = allowedProps;
46
+ static defaultProps = {
47
+ children: null
48
+ };
42
49
  componentDidMount() {
43
- var _this$props$makeStyle, _this$props;
44
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
50
+ this.props.makeStyles?.();
45
51
  }
46
52
  componentDidUpdate() {
47
- var _this$props$makeStyle2, _this$props2;
48
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
53
+ this.props.makeStyles?.();
49
54
  }
50
55
  render() {
51
- const _this$props3 = this.props,
52
- children = _this$props3.children,
53
- styles = _this$props3.styles;
54
- const isStacked = this.context.isStacked;
56
+ const {
57
+ children,
58
+ styles
59
+ } = this.props;
60
+ const {
61
+ isStacked
62
+ } = this.context;
55
63
  return _jsx(View, {
56
64
  ...View.omitViewProps(omitProps(this.props, Body.allowedProps), Body),
57
65
  as: isStacked ? 'div' : 'tbody',
58
- css: styles === null || styles === void 0 ? void 0 : styles.body,
59
- role: isStacked ? 'rowgroup' : void 0,
66
+ css: styles?.body,
67
+ role: isStacked ? 'rowgroup' : undefined,
60
68
  children: Children.map(children, child => {
61
69
  if (/*#__PURE__*/isValidElement(child)) {
62
70
  return safeCloneElement(child, {
@@ -67,8 +75,6 @@ let Body = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
67
75
  })
68
76
  });
69
77
  }
70
- }, _Body.displayName = "Body", _Body.componentId = 'Table.Body', _Body.contextType = TableContext, _Body.allowedProps = allowedProps, _Body.defaultProps = {
71
- children: null
72
- }, _Body)) || _class);
78
+ }) || _class);
73
79
  export default Body;
74
80
  export { Body };
@@ -28,15 +28,16 @@
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;
32
- const colors = theme.colors,
33
- typography = theme.typography;
31
+ const {
32
+ colors,
33
+ typography
34
+ } = theme;
34
35
  const componentVariables = {
35
- fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
36
- fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
37
- fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
38
- color: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey125125,
39
- background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.white1010
36
+ fontSize: typography?.fontSizeMedium,
37
+ fontFamily: typography?.fontFamily,
38
+ fontWeight: typography?.fontWeightNormal,
39
+ color: colors?.contrasts?.grey125125,
40
+ background: colors?.contrasts?.white1010
40
41
  };
41
42
  return {
42
43
  ...componentVariables
@@ -1,4 +1,4 @@
1
- var _dec, _class, _Cell;
1
+ var _dec, _class;
2
2
  /*
3
3
  * The MIT License (MIT)
4
4
  *
@@ -38,32 +38,36 @@ id: Table.Cell
38
38
  ---
39
39
  **/
40
40
  import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
41
- let Cell = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_Cell = class Cell extends Component {
41
+ let Cell = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class Cell extends Component {
42
+ static displayName = "Cell";
43
+ static componentId = 'Table.Cell';
44
+ static contextType = TableContext;
45
+ static allowedProps = allowedProps;
46
+ static defaultProps = {
47
+ textAlign: 'start',
48
+ children: null
49
+ };
42
50
  componentDidMount() {
43
- var _this$props$makeStyle, _this$props;
44
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
51
+ this.props.makeStyles?.();
45
52
  }
46
53
  componentDidUpdate() {
47
- var _this$props$makeStyle2, _this$props2;
48
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
54
+ this.props.makeStyles?.();
49
55
  }
50
56
  render() {
51
- const _this$props3 = this.props,
52
- children = _this$props3.children,
53
- styles = _this$props3.styles,
54
- header = _this$props3.header;
57
+ const {
58
+ children,
59
+ styles,
60
+ header
61
+ } = this.props;
55
62
  const isStacked = this.context.isStacked;
56
63
  return _jsxs(View, {
57
64
  ...View.omitViewProps(omitProps(this.props, Cell.allowedProps), Cell),
58
65
  as: isStacked ? 'div' : 'td',
59
- css: styles === null || styles === void 0 ? void 0 : styles.cell,
60
- role: isStacked ? 'cell' : void 0,
66
+ css: styles?.cell,
67
+ role: isStacked ? 'cell' : undefined,
61
68
  children: [header && callRenderProp(header), header && ': ', callRenderProp(children)]
62
69
  });
63
70
  }
64
- }, _Cell.displayName = "Cell", _Cell.componentId = 'Table.Cell', _Cell.contextType = TableContext, _Cell.allowedProps = allowedProps, _Cell.defaultProps = {
65
- textAlign: 'start',
66
- children: null
67
- }, _Cell)) || _class);
71
+ }) || _class);
68
72
  export default Cell;
69
73
  export { Cell };
@@ -33,7 +33,9 @@
33
33
  * @return {Object} The final style object, which will be used in the component
34
34
  */
35
35
  const generateStyle = (componentTheme, props) => {
36
- const textAlign = props.textAlign;
36
+ const {
37
+ textAlign
38
+ } = props;
37
39
  return {
38
40
  cell: {
39
41
  label: 'cell',
@@ -28,19 +28,20 @@
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;
32
- const colors = theme.colors,
33
- typography = theme.typography,
34
- spacing = theme.spacing;
31
+ const {
32
+ colors,
33
+ typography,
34
+ spacing
35
+ } = theme;
35
36
  const componentVariables = {
36
- fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
37
- fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
38
- fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
39
- color: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey125125,
40
- background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.white1010,
41
- borderColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.grey3045,
42
- lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
43
- padding: `${spacing === null || spacing === void 0 ? void 0 : spacing.xSmall} ${spacing === null || spacing === void 0 ? void 0 : spacing.small}`
37
+ fontSize: typography?.fontSizeMedium,
38
+ fontFamily: typography?.fontFamily,
39
+ fontWeight: typography?.fontWeightNormal,
40
+ color: colors?.contrasts?.grey125125,
41
+ background: colors?.contrasts?.white1010,
42
+ borderColor: colors?.contrasts?.grey3045,
43
+ lineHeight: typography?.lineHeightCondensed,
44
+ padding: `${spacing?.xSmall} ${spacing?.small}`
44
45
  };
45
46
  return {
46
47
  ...componentVariables
@@ -1,4 +1,4 @@
1
- var _dec, _class, _ColHeader;
1
+ var _dec, _class;
2
2
  /*
3
3
  * The MIT License (MIT)
4
4
  *
@@ -37,59 +37,66 @@ id: Table.ColHeader
37
37
  ---
38
38
  **/
39
39
  import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
40
- let ColHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_ColHeader = class ColHeader extends Component {
41
- constructor(...args) {
42
- super(...args);
43
- this.handleClick = event => {
44
- const _this$props = this.props,
45
- id = _this$props.id,
46
- onRequestSort = _this$props.onRequestSort;
47
- onRequestSort && onRequestSort(event, {
48
- id
49
- });
50
- };
51
- }
40
+ let ColHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class ColHeader extends Component {
41
+ static displayName = "ColHeader";
42
+ static componentId = 'Table.ColHeader';
43
+ static allowedProps = allowedProps;
44
+ static defaultProps = {
45
+ textAlign: 'start',
46
+ sortDirection: 'none',
47
+ children: null,
48
+ scope: 'col'
49
+ };
52
50
  componentDidMount() {
53
- var _this$props$makeStyle, _this$props2;
54
- (_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
51
+ this.props.makeStyles?.();
55
52
  }
56
53
  componentDidUpdate() {
57
- var _this$props$makeStyle2, _this$props3;
58
- (_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
54
+ this.props.makeStyles?.();
59
55
  }
56
+ handleClick = event => {
57
+ const {
58
+ id,
59
+ onRequestSort
60
+ } = this.props;
61
+ onRequestSort && onRequestSort(event, {
62
+ id
63
+ });
64
+ };
60
65
  renderSortArrow() {
61
- const _this$props4 = this.props,
62
- sortDirection = _this$props4.sortDirection,
63
- onRequestSort = _this$props4.onRequestSort,
64
- styles = _this$props4.styles;
66
+ const {
67
+ sortDirection,
68
+ onRequestSort,
69
+ styles
70
+ } = this.props;
65
71
  if (sortDirection === 'ascending') {
66
72
  return _jsx(IconMiniArrowUpLine, {
67
- css: styles === null || styles === void 0 ? void 0 : styles.sortedIconColor
73
+ css: styles?.sortedIconColor
68
74
  });
69
75
  }
70
76
  if (sortDirection === 'descending') {
71
77
  return _jsx(IconMiniArrowDownLine, {
72
- css: styles === null || styles === void 0 ? void 0 : styles.sortedIconColor
78
+ css: styles?.sortedIconColor
73
79
  });
74
80
  }
75
81
  if (onRequestSort) {
76
82
  return _jsx(IconMiniArrowDoubleLine, {
77
- css: styles === null || styles === void 0 ? void 0 : styles.unSortedIconColor
83
+ css: styles?.unSortedIconColor
78
84
  });
79
85
  }
80
- return void 0;
86
+ return undefined;
81
87
  }
82
88
  render() {
83
- const _this$props5 = this.props,
84
- onRequestSort = _this$props5.onRequestSort,
85
- width = _this$props5.width,
86
- children = _this$props5.children,
87
- sortDirection = _this$props5.sortDirection,
88
- scope = _this$props5.scope,
89
- styles = _this$props5.styles;
89
+ const {
90
+ onRequestSort,
91
+ width,
92
+ children,
93
+ sortDirection,
94
+ scope,
95
+ styles
96
+ } = this.props;
90
97
  return _jsxs("th", {
91
98
  ...omitProps(this.props, ColHeader.allowedProps),
92
- css: styles === null || styles === void 0 ? void 0 : styles.colHeader,
99
+ css: styles?.colHeader,
93
100
  style: {
94
101
  width
95
102
  },
@@ -97,19 +104,14 @@ let ColHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_
97
104
  "aria-sort": sortDirection,
98
105
  children: [onRequestSort && _jsx("button", {
99
106
  onClick: this.handleClick,
100
- css: styles === null || styles === void 0 ? void 0 : styles.button,
107
+ css: styles?.button,
101
108
  children: _jsxs("div", {
102
- css: styles === null || styles === void 0 ? void 0 : styles.buttonContent,
109
+ css: styles?.buttonContent,
103
110
  children: [callRenderProp(children), this.renderSortArrow()]
104
111
  })
105
112
  }), !onRequestSort && children, !onRequestSort && this.renderSortArrow()]
106
113
  });
107
114
  }
108
- }, _ColHeader.displayName = "ColHeader", _ColHeader.componentId = 'Table.ColHeader', _ColHeader.allowedProps = allowedProps, _ColHeader.defaultProps = {
109
- textAlign: 'start',
110
- sortDirection: 'none',
111
- children: null,
112
- scope: 'col'
113
- }, _ColHeader)) || _class);
115
+ }) || _class);
114
116
  export default ColHeader;
115
117
  export { ColHeader };
@@ -32,8 +32,10 @@
32
32
  * @return {Object} The final style object, which will be used in the component
33
33
  */
34
34
  const generateStyle = (componentTheme, props) => {
35
- const onRequestSort = props.onRequestSort,
36
- textAlign = props.textAlign;
35
+ const {
36
+ onRequestSort,
37
+ textAlign
38
+ } = props;
37
39
  const headerStyle = {
38
40
  color: componentTheme.color,
39
41
  fontSize: componentTheme.fontSize,
@@ -28,12 +28,13 @@
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, _colors$contrasts5, _colors$contrasts6;
32
- const typography = theme.typography,
33
- colors = theme.colors,
34
- borders = theme.borders,
35
- spacing = theme.spacing,
36
- themeName = theme.key;
31
+ const {
32
+ typography,
33
+ colors,
34
+ borders,
35
+ spacing,
36
+ key: themeName
37
+ } = theme;
37
38
  const themeSpecificStyle = {
38
39
  canvas: {
39
40
  focusOutlineColor: theme['ic-brand-primary'],
@@ -41,18 +42,18 @@ const generateComponentTheme = theme => {
41
42
  }
42
43
  };
43
44
  const componentVariables = {
44
- fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
45
- fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
46
- color: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey125125,
47
- background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.white1010,
48
- borderColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.grey1214,
49
- lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
50
- padding: `${spacing === null || spacing === void 0 ? void 0 : spacing.xSmall} ${spacing === null || spacing === void 0 ? void 0 : spacing.small}`,
51
- focusOutlineColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts4 = colors.contrasts) === null || _colors$contrasts4 === void 0 ? void 0 : _colors$contrasts4.blue4570,
52
- focusOutlineWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
53
- focusOutlineStyle: borders === null || borders === void 0 ? void 0 : borders.style,
54
- unSortedIconColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts5 = colors.contrasts) === null || _colors$contrasts5 === void 0 ? void 0 : _colors$contrasts5.grey3045,
55
- sortedIconColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts6 = colors.contrasts) === null || _colors$contrasts6 === void 0 ? void 0 : _colors$contrasts6.blue4570
45
+ fontSize: typography?.fontSizeMedium,
46
+ fontFamily: typography?.fontFamily,
47
+ color: colors?.contrasts?.grey125125,
48
+ background: colors?.contrasts?.white1010,
49
+ borderColor: colors?.contrasts?.grey1214,
50
+ lineHeight: typography?.lineHeightCondensed,
51
+ padding: `${spacing?.xSmall} ${spacing?.small}`,
52
+ focusOutlineColor: colors?.contrasts?.blue4570,
53
+ focusOutlineWidth: borders?.widthMedium,
54
+ focusOutlineStyle: borders?.style,
55
+ unSortedIconColor: colors?.contrasts?.grey3045,
56
+ sortedIconColor: colors?.contrasts?.blue4570
56
57
  };
57
58
  return {
58
59
  ...componentVariables,
@@ -1,5 +1,4 @@
1
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- var _dec, _class, _Head, _ScreenReaderContent;
1
+ var _dec, _class;
3
2
  /*
4
3
  * The MIT License (MIT)
5
4
  *
@@ -42,19 +41,24 @@ id: Table.Head
42
41
  ---
43
42
  **/
44
43
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
45
- let Head = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_Head = class Head extends Component {
44
+ let Head = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class Head extends Component {
45
+ static displayName = "Head";
46
+ static componentId = 'Table.Head';
47
+ static contextType = TableContext;
48
+ static allowedProps = allowedProps;
49
+ static defaultProps = {
50
+ children: null
51
+ };
52
+
46
53
  /**
47
54
  * Returns `true` if the first child's children have a `onRequestSort` prop
48
55
  */
49
56
  get isSortable() {
50
- const _ref = Children.toArray(this.props.children),
51
- _ref2 = _slicedToArray(_ref, 1),
52
- firstRow = _ref2[0];
57
+ const [firstRow] = Children.toArray(this.props.children);
53
58
  let sortable = false;
54
59
  if (firstRow && firstRow.props && firstRow.props.children) {
55
60
  Children.forEach(firstRow.props.children, grandchild => {
56
- var _grandchild$props;
57
- if (grandchild !== null && grandchild !== void 0 && (_grandchild$props = grandchild.props) !== null && _grandchild$props !== void 0 && _grandchild$props.onRequestSort) {
61
+ if (grandchild?.props?.onRequestSort) {
58
62
  sortable = true;
59
63
  return;
60
64
  }
@@ -63,15 +67,13 @@ let Head = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
63
67
  return sortable;
64
68
  }
65
69
  componentDidMount() {
66
- var _this$props$makeStyle, _this$props;
67
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
70
+ this.props.makeStyles?.();
68
71
  }
69
72
  componentDidUpdate() {
70
- var _this$props$makeStyle2, _this$props2;
71
73
  if (this.isSortable && typeof this.props.renderSortLabel === 'undefined') {
72
74
  warn(false, '[Table.Head] The `renderSortLabel` prop should be provided when Table is sortable.');
73
75
  }
74
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
76
+ this.props.makeStyles?.();
75
77
  }
76
78
 
77
79
  /**
@@ -80,14 +82,12 @@ let Head = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
80
82
  * there the `id`, `stackedSortByLabel`, `sortDirection`, `onRequestSort` props
81
83
  */
82
84
  renderSelect() {
83
- var _firstRow$props;
84
- const _this$props3 = this.props,
85
- children = _this$props3.children,
86
- renderSortLabel = _this$props3.renderSortLabel;
87
- const _ref3 = Children.toArray(children),
88
- _ref4 = _slicedToArray(_ref3, 1),
89
- firstRow = _ref4[0];
90
- if (!(firstRow !== null && firstRow !== void 0 && (_firstRow$props = firstRow.props) !== null && _firstRow$props !== void 0 && _firstRow$props.children)) {
85
+ const {
86
+ children,
87
+ renderSortLabel
88
+ } = this.props;
89
+ const [firstRow] = Children.toArray(children);
90
+ if (!firstRow?.props?.children) {
91
91
  return null;
92
92
  }
93
93
  const options = [];
@@ -96,12 +96,13 @@ let Head = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
96
96
  let count = 0;
97
97
  Children.forEach(firstRow.props.children, grandchild => {
98
98
  count += 1;
99
- if (!(grandchild !== null && grandchild !== void 0 && grandchild.props)) return; // grandchild can be false
100
- const _grandchild$props2 = grandchild.props,
101
- id = _grandchild$props2.id,
102
- stackedSortByLabel = _grandchild$props2.stackedSortByLabel,
103
- sortDirection = _grandchild$props2.sortDirection,
104
- onRequestSort = _grandchild$props2.onRequestSort;
99
+ if (!grandchild?.props) return; // grandchild can be false
100
+ const {
101
+ id,
102
+ stackedSortByLabel,
103
+ sortDirection,
104
+ onRequestSort
105
+ } = grandchild.props;
105
106
  if (id && onRequestSort) {
106
107
  const label = stackedSortByLabel || id;
107
108
  options.push({
@@ -134,7 +135,7 @@ let Head = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
134
135
  role: "cell",
135
136
  "aria-colspan": count,
136
137
  children: _jsx(SimpleSelect, {
137
- renderLabel: renderSortLabel ? callRenderProp(renderSortLabel) : _ScreenReaderContent || (_ScreenReaderContent = _jsx(ScreenReaderContent, {})),
138
+ renderLabel: renderSortLabel ? callRenderProp(renderSortLabel) : _jsx(ScreenReaderContent, {}),
138
139
  renderBeforeInput: selectedOption && IconCheckLine,
139
140
  value: selectedOption,
140
141
  onChange: handleSelect,
@@ -157,17 +158,16 @@ let Head = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
157
158
  });
158
159
  }
159
160
  render() {
160
- const _this$props4 = this.props,
161
- children = _this$props4.children,
162
- styles = _this$props4.styles;
161
+ const {
162
+ children,
163
+ styles
164
+ } = this.props;
163
165
  return this.context.isStacked ? this.renderSelect() : _jsx("thead", {
164
166
  ...omitProps(this.props, Head.allowedProps),
165
- css: styles === null || styles === void 0 ? void 0 : styles.head,
167
+ css: styles?.head,
166
168
  children: children
167
169
  });
168
170
  }
169
- }, _Head.displayName = "Head", _Head.componentId = 'Table.Head', _Head.contextType = TableContext, _Head.allowedProps = allowedProps, _Head.defaultProps = {
170
- children: null
171
- }, _Head)) || _class);
171
+ }) || _class);
172
172
  export default Head;
173
173
  export { Head };
@@ -28,15 +28,16 @@
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;
32
- const colors = theme.colors,
33
- typography = theme.typography;
31
+ const {
32
+ colors,
33
+ typography
34
+ } = theme;
34
35
  const componentVariables = {
35
- fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
36
- fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
37
- fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
38
- color: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey125125,
39
- background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.white1010
36
+ fontSize: typography?.fontSizeMedium,
37
+ fontFamily: typography?.fontFamily,
38
+ fontWeight: typography?.fontWeightNormal,
39
+ color: colors?.contrasts?.grey125125,
40
+ background: colors?.contrasts?.white1010
40
41
  };
41
42
  return {
42
43
  ...componentVariables
@@ -1,4 +1,4 @@
1
- var _dec, _class, _Row;
1
+ var _dec, _class;
2
2
  /*
3
3
  * The MIT License (MIT)
4
4
  *
@@ -38,32 +38,38 @@ id: Table.Row
38
38
  ---
39
39
  **/
40
40
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
41
- let Row = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_Row = class Row extends Component {
41
+ let Row = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class Row extends Component {
42
+ static displayName = "Row";
43
+ static componentId = 'Table.Row';
44
+ static contextType = TableContext;
45
+ static allowedProps = allowedProps;
46
+ static defaultProps = {
47
+ children: null
48
+ };
42
49
  componentDidMount() {
43
- var _this$props$makeStyle, _this$props;
44
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, {
50
+ this.props.makeStyles?.({
45
51
  isStacked: this.context.isStacked,
46
52
  hover: this.context.hover
47
53
  });
48
54
  }
49
55
  componentDidUpdate() {
50
- var _this$props$makeStyle2, _this$props2;
51
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, {
56
+ this.props.makeStyles?.({
52
57
  isStacked: this.context.isStacked,
53
58
  hover: this.context.hover
54
59
  });
55
60
  }
56
61
  render() {
57
- const _this$props3 = this.props,
58
- children = _this$props3.children,
59
- styles = _this$props3.styles;
62
+ const {
63
+ children,
64
+ styles
65
+ } = this.props;
60
66
  const isStacked = this.context.isStacked;
61
67
  const headers = this.context.headers;
62
68
  return _jsx(View, {
63
69
  ...View.omitViewProps(omitProps(this.props, Row.allowedProps), Row),
64
70
  as: isStacked ? 'div' : 'tr',
65
- css: styles === null || styles === void 0 ? void 0 : styles.row,
66
- role: isStacked ? 'row' : void 0,
71
+ css: styles?.row,
72
+ role: isStacked ? 'row' : undefined,
67
73
  children: Children.toArray(children).filter(Boolean).map((child, index) => {
68
74
  if (/*#__PURE__*/isValidElement(child)) {
69
75
  return safeCloneElement(child, {
@@ -76,8 +82,6 @@ let Row = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
76
82
  })
77
83
  });
78
84
  }
79
- }, _Row.displayName = "Row", _Row.componentId = 'Table.Row', _Row.contextType = TableContext, _Row.allowedProps = allowedProps, _Row.defaultProps = {
80
- children: null
81
- }, _Row)) || _class);
85
+ }) || _class);
82
86
  export default Row;
83
87
  export { Row };
@@ -33,7 +33,9 @@
33
33
  * @return {Object} The final style object, which will be used in the component
34
34
  */
35
35
  const generateStyle = (componentTheme, props, extraArgs) => {
36
- const setHoverStateTo = props.setHoverStateTo;
36
+ const {
37
+ setHoverStateTo
38
+ } = props;
37
39
  const hoverStyles = {
38
40
  borderLeftColor: componentTheme.hoverBorderColor,
39
41
  borderRightColor: componentTheme.hoverBorderColor
@@ -50,7 +52,7 @@ const generateStyle = (componentTheme, props, extraArgs) => {
50
52
  borderBottomStyle: 'solid',
51
53
  borderBottomWidth: '0.0625rem',
52
54
  borderBottomColor: componentTheme.borderColor,
53
- ...((setHoverStateTo !== null && setHoverStateTo !== void 0 ? setHoverStateTo : extraArgs.hover) && {
55
+ ...((setHoverStateTo ?? extraArgs.hover) && {
54
56
  borderLeft: '0.1875rem solid transparent',
55
57
  borderRight: '0.1875rem solid transparent',
56
58
  ...(setHoverStateTo === true ? hoverStyles : {