@instructure/ui-table 11.7.3-snapshot-7 → 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
@@ -34,19 +34,20 @@ 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;
38
- const colors = theme.colors,
39
- typography = theme.typography,
40
- spacing = theme.spacing;
37
+ const {
38
+ colors,
39
+ typography,
40
+ spacing
41
+ } = theme;
41
42
  const componentVariables = {
42
- fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
43
- fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
44
- fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
45
- color: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey125125,
46
- background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.white1010,
47
- borderColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.grey3045,
48
- lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
49
- padding: `${spacing === null || spacing === void 0 ? void 0 : spacing.xSmall} ${spacing === null || spacing === void 0 ? void 0 : spacing.small}`
43
+ fontSize: typography?.fontSizeMedium,
44
+ fontFamily: typography?.fontFamily,
45
+ fontWeight: typography?.fontWeightNormal,
46
+ color: colors?.contrasts?.grey125125,
47
+ background: colors?.contrasts?.white1010,
48
+ borderColor: colors?.contrasts?.grey3045,
49
+ lineHeight: typography?.lineHeightCondensed,
50
+ padding: `${spacing?.xSmall} ${spacing?.small}`
50
51
  };
51
52
  return {
52
53
  ...componentVariables
@@ -16,7 +16,7 @@ var _styles = _interopRequireDefault(require("./styles"));
16
16
  var _theme = _interopRequireDefault(require("./theme"));
17
17
  var _props = require("./props");
18
18
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
19
- var _dec, _class, _ColHeader;
19
+ var _dec, _class;
20
20
  /*
21
21
  * The MIT License (MIT)
22
22
  *
@@ -46,59 +46,66 @@ parent: Table
46
46
  id: Table.ColHeader
47
47
  ---
48
48
  **/
49
- let ColHeader = exports.ColHeader = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = (_ColHeader = class ColHeader extends _react.Component {
50
- constructor(...args) {
51
- super(...args);
52
- this.handleClick = event => {
53
- const _this$props = this.props,
54
- id = _this$props.id,
55
- onRequestSort = _this$props.onRequestSort;
56
- onRequestSort && onRequestSort(event, {
57
- id
58
- });
59
- };
60
- }
49
+ let ColHeader = exports.ColHeader = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class ColHeader extends _react.Component {
50
+ static displayName = "ColHeader";
51
+ static componentId = 'Table.ColHeader';
52
+ static allowedProps = _props.allowedProps;
53
+ static defaultProps = {
54
+ textAlign: 'start',
55
+ sortDirection: 'none',
56
+ children: null,
57
+ scope: 'col'
58
+ };
61
59
  componentDidMount() {
62
- var _this$props$makeStyle, _this$props2;
63
- (_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
60
+ this.props.makeStyles?.();
64
61
  }
65
62
  componentDidUpdate() {
66
- var _this$props$makeStyle2, _this$props3;
67
- (_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
63
+ this.props.makeStyles?.();
68
64
  }
65
+ handleClick = event => {
66
+ const {
67
+ id,
68
+ onRequestSort
69
+ } = this.props;
70
+ onRequestSort && onRequestSort(event, {
71
+ id
72
+ });
73
+ };
69
74
  renderSortArrow() {
70
- const _this$props4 = this.props,
71
- sortDirection = _this$props4.sortDirection,
72
- onRequestSort = _this$props4.onRequestSort,
73
- styles = _this$props4.styles;
75
+ const {
76
+ sortDirection,
77
+ onRequestSort,
78
+ styles
79
+ } = this.props;
74
80
  if (sortDirection === 'ascending') {
75
81
  return (0, _jsxRuntime.jsx)(_IconMiniArrowUpLine.IconMiniArrowUpLine, {
76
- css: styles === null || styles === void 0 ? void 0 : styles.sortedIconColor
82
+ css: styles?.sortedIconColor
77
83
  });
78
84
  }
79
85
  if (sortDirection === 'descending') {
80
86
  return (0, _jsxRuntime.jsx)(_IconMiniArrowDownLine.IconMiniArrowDownLine, {
81
- css: styles === null || styles === void 0 ? void 0 : styles.sortedIconColor
87
+ css: styles?.sortedIconColor
82
88
  });
83
89
  }
84
90
  if (onRequestSort) {
85
91
  return (0, _jsxRuntime.jsx)(_IconMiniArrowDoubleLine.IconMiniArrowDoubleLine, {
86
- css: styles === null || styles === void 0 ? void 0 : styles.unSortedIconColor
92
+ css: styles?.unSortedIconColor
87
93
  });
88
94
  }
89
- return void 0;
95
+ return undefined;
90
96
  }
91
97
  render() {
92
- const _this$props5 = this.props,
93
- onRequestSort = _this$props5.onRequestSort,
94
- width = _this$props5.width,
95
- children = _this$props5.children,
96
- sortDirection = _this$props5.sortDirection,
97
- scope = _this$props5.scope,
98
- styles = _this$props5.styles;
98
+ const {
99
+ onRequestSort,
100
+ width,
101
+ children,
102
+ sortDirection,
103
+ scope,
104
+ styles
105
+ } = this.props;
99
106
  return (0, _jsxRuntime.jsxs)("th", {
100
107
  ...(0, _omitProps.omitProps)(this.props, ColHeader.allowedProps),
101
- css: styles === null || styles === void 0 ? void 0 : styles.colHeader,
108
+ css: styles?.colHeader,
102
109
  style: {
103
110
  width
104
111
  },
@@ -106,18 +113,13 @@ let ColHeader = exports.ColHeader = (_dec = (0, _emotion.withStyleLegacy)(_style
106
113
  "aria-sort": sortDirection,
107
114
  children: [onRequestSort && (0, _jsxRuntime.jsx)("button", {
108
115
  onClick: this.handleClick,
109
- css: styles === null || styles === void 0 ? void 0 : styles.button,
116
+ css: styles?.button,
110
117
  children: (0, _jsxRuntime.jsxs)("div", {
111
- css: styles === null || styles === void 0 ? void 0 : styles.buttonContent,
118
+ css: styles?.buttonContent,
112
119
  children: [(0, _callRenderProp.callRenderProp)(children), this.renderSortArrow()]
113
120
  })
114
121
  }), !onRequestSort && children, !onRequestSort && this.renderSortArrow()]
115
122
  });
116
123
  }
117
- }, _ColHeader.displayName = "ColHeader", _ColHeader.componentId = 'Table.ColHeader', _ColHeader.allowedProps = _props.allowedProps, _ColHeader.defaultProps = {
118
- textAlign: 'start',
119
- sortDirection: 'none',
120
- children: null,
121
- scope: 'col'
122
- }, _ColHeader)) || _class);
124
+ }) || _class);
123
125
  var _default = exports.default = ColHeader;
@@ -38,8 +38,10 @@ exports.default = void 0;
38
38
  * @return {Object} The final style object, which will be used in the component
39
39
  */
40
40
  const generateStyle = (componentTheme, props) => {
41
- const onRequestSort = props.onRequestSort,
42
- textAlign = props.textAlign;
41
+ const {
42
+ onRequestSort,
43
+ textAlign
44
+ } = props;
43
45
  const headerStyle = {
44
46
  color: componentTheme.color,
45
47
  fontSize: componentTheme.fontSize,
@@ -34,12 +34,13 @@ 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, _colors$contrasts5, _colors$contrasts6;
38
- const typography = theme.typography,
39
- colors = theme.colors,
40
- borders = theme.borders,
41
- spacing = theme.spacing,
42
- themeName = theme.key;
37
+ const {
38
+ typography,
39
+ colors,
40
+ borders,
41
+ spacing,
42
+ key: themeName
43
+ } = theme;
43
44
  const themeSpecificStyle = {
44
45
  canvas: {
45
46
  focusOutlineColor: theme['ic-brand-primary'],
@@ -47,18 +48,18 @@ const generateComponentTheme = theme => {
47
48
  }
48
49
  };
49
50
  const componentVariables = {
50
- fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
51
- fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
52
- color: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey125125,
53
- background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.white1010,
54
- borderColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.grey1214,
55
- lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
56
- padding: `${spacing === null || spacing === void 0 ? void 0 : spacing.xSmall} ${spacing === null || spacing === void 0 ? void 0 : spacing.small}`,
57
- focusOutlineColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts4 = colors.contrasts) === null || _colors$contrasts4 === void 0 ? void 0 : _colors$contrasts4.blue4570,
58
- focusOutlineWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
59
- focusOutlineStyle: borders === null || borders === void 0 ? void 0 : borders.style,
60
- unSortedIconColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts5 = colors.contrasts) === null || _colors$contrasts5 === void 0 ? void 0 : _colors$contrasts5.grey3045,
61
- sortedIconColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts6 = colors.contrasts) === null || _colors$contrasts6 === void 0 ? void 0 : _colors$contrasts6.blue4570
51
+ fontSize: typography?.fontSizeMedium,
52
+ fontFamily: typography?.fontFamily,
53
+ color: colors?.contrasts?.grey125125,
54
+ background: colors?.contrasts?.white1010,
55
+ borderColor: colors?.contrasts?.grey1214,
56
+ lineHeight: typography?.lineHeightCondensed,
57
+ padding: `${spacing?.xSmall} ${spacing?.small}`,
58
+ focusOutlineColor: colors?.contrasts?.blue4570,
59
+ focusOutlineWidth: borders?.widthMedium,
60
+ focusOutlineStyle: borders?.style,
61
+ unSortedIconColor: colors?.contrasts?.grey3045,
62
+ sortedIconColor: colors?.contrasts?.blue4570
62
63
  };
63
64
  return {
64
65
  ...componentVariables,
@@ -5,12 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = exports.Head = void 0;
8
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
8
  var _react = require("react");
10
9
  var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
11
10
  var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
12
11
  var _v11_ = require("@instructure/ui-simple-select/v11_6");
13
- var _ScreenReaderContent2 = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
12
+ var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
14
13
  var _IconCheckLine = require("@instructure/ui-icons/lib/generated/IconCheckLine.js");
15
14
  var _console = require("@instructure/console");
16
15
  var _emotion = require("@instructure/emotion");
@@ -19,7 +18,7 @@ var _theme = _interopRequireDefault(require("./theme"));
19
18
  var _props = require("./props");
20
19
  var _TableContext = _interopRequireDefault(require("../TableContext"));
21
20
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
22
- var _dec, _class, _Head, _ScreenReaderContent;
21
+ var _dec, _class;
23
22
  /*
24
23
  * The MIT License (MIT)
25
24
  *
@@ -49,19 +48,24 @@ parent: Table
49
48
  id: Table.Head
50
49
  ---
51
50
  **/
52
- let Head = exports.Head = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = (_Head = class Head extends _react.Component {
51
+ let Head = exports.Head = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class Head extends _react.Component {
52
+ static displayName = "Head";
53
+ static componentId = 'Table.Head';
54
+ static contextType = _TableContext.default;
55
+ static allowedProps = _props.allowedProps;
56
+ static defaultProps = {
57
+ children: null
58
+ };
59
+
53
60
  /**
54
61
  * Returns `true` if the first child's children have a `onRequestSort` prop
55
62
  */
56
63
  get isSortable() {
57
- const _ref = _react.Children.toArray(this.props.children),
58
- _ref2 = (0, _slicedToArray2.default)(_ref, 1),
59
- firstRow = _ref2[0];
64
+ const [firstRow] = _react.Children.toArray(this.props.children);
60
65
  let sortable = false;
61
66
  if (firstRow && firstRow.props && firstRow.props.children) {
62
67
  _react.Children.forEach(firstRow.props.children, grandchild => {
63
- var _grandchild$props;
64
- if (grandchild !== null && grandchild !== void 0 && (_grandchild$props = grandchild.props) !== null && _grandchild$props !== void 0 && _grandchild$props.onRequestSort) {
68
+ if (grandchild?.props?.onRequestSort) {
65
69
  sortable = true;
66
70
  return;
67
71
  }
@@ -70,15 +74,13 @@ let Head = exports.Head = (_dec = (0, _emotion.withStyleLegacy)(_styles.default,
70
74
  return sortable;
71
75
  }
72
76
  componentDidMount() {
73
- var _this$props$makeStyle, _this$props;
74
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
77
+ this.props.makeStyles?.();
75
78
  }
76
79
  componentDidUpdate() {
77
- var _this$props$makeStyle2, _this$props2;
78
80
  if (this.isSortable && typeof this.props.renderSortLabel === 'undefined') {
79
81
  (0, _console.warn)(false, '[Table.Head] The `renderSortLabel` prop should be provided when Table is sortable.');
80
82
  }
81
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
83
+ this.props.makeStyles?.();
82
84
  }
83
85
 
84
86
  /**
@@ -87,14 +89,12 @@ let Head = exports.Head = (_dec = (0, _emotion.withStyleLegacy)(_styles.default,
87
89
  * there the `id`, `stackedSortByLabel`, `sortDirection`, `onRequestSort` props
88
90
  */
89
91
  renderSelect() {
90
- var _firstRow$props;
91
- const _this$props3 = this.props,
92
- children = _this$props3.children,
93
- renderSortLabel = _this$props3.renderSortLabel;
94
- const _ref3 = _react.Children.toArray(children),
95
- _ref4 = (0, _slicedToArray2.default)(_ref3, 1),
96
- firstRow = _ref4[0];
97
- if (!(firstRow !== null && firstRow !== void 0 && (_firstRow$props = firstRow.props) !== null && _firstRow$props !== void 0 && _firstRow$props.children)) {
92
+ const {
93
+ children,
94
+ renderSortLabel
95
+ } = this.props;
96
+ const [firstRow] = _react.Children.toArray(children);
97
+ if (!firstRow?.props?.children) {
98
98
  return null;
99
99
  }
100
100
  const options = [];
@@ -103,12 +103,13 @@ let Head = exports.Head = (_dec = (0, _emotion.withStyleLegacy)(_styles.default,
103
103
  let count = 0;
104
104
  _react.Children.forEach(firstRow.props.children, grandchild => {
105
105
  count += 1;
106
- if (!(grandchild !== null && grandchild !== void 0 && grandchild.props)) return; // grandchild can be false
107
- const _grandchild$props2 = grandchild.props,
108
- id = _grandchild$props2.id,
109
- stackedSortByLabel = _grandchild$props2.stackedSortByLabel,
110
- sortDirection = _grandchild$props2.sortDirection,
111
- onRequestSort = _grandchild$props2.onRequestSort;
106
+ if (!grandchild?.props) return; // grandchild can be false
107
+ const {
108
+ id,
109
+ stackedSortByLabel,
110
+ sortDirection,
111
+ onRequestSort
112
+ } = grandchild.props;
112
113
  if (id && onRequestSort) {
113
114
  const label = stackedSortByLabel || id;
114
115
  options.push({
@@ -141,7 +142,7 @@ let Head = exports.Head = (_dec = (0, _emotion.withStyleLegacy)(_styles.default,
141
142
  role: "cell",
142
143
  "aria-colspan": count,
143
144
  children: (0, _jsxRuntime.jsx)(_v11_.SimpleSelect, {
144
- renderLabel: renderSortLabel ? (0, _callRenderProp.callRenderProp)(renderSortLabel) : _ScreenReaderContent || (_ScreenReaderContent = (0, _jsxRuntime.jsx)(_ScreenReaderContent2.ScreenReaderContent, {})),
145
+ renderLabel: renderSortLabel ? (0, _callRenderProp.callRenderProp)(renderSortLabel) : (0, _jsxRuntime.jsx)(_ScreenReaderContent.ScreenReaderContent, {}),
145
146
  renderBeforeInput: selectedOption && _IconCheckLine.IconCheckLine,
146
147
  value: selectedOption,
147
148
  onChange: handleSelect,
@@ -164,16 +165,15 @@ let Head = exports.Head = (_dec = (0, _emotion.withStyleLegacy)(_styles.default,
164
165
  });
165
166
  }
166
167
  render() {
167
- const _this$props4 = this.props,
168
- children = _this$props4.children,
169
- styles = _this$props4.styles;
168
+ const {
169
+ children,
170
+ styles
171
+ } = this.props;
170
172
  return this.context.isStacked ? this.renderSelect() : (0, _jsxRuntime.jsx)("thead", {
171
173
  ...(0, _omitProps.omitProps)(this.props, Head.allowedProps),
172
- css: styles === null || styles === void 0 ? void 0 : styles.head,
174
+ css: styles?.head,
173
175
  children: children
174
176
  });
175
177
  }
176
- }, _Head.displayName = "Head", _Head.componentId = 'Table.Head', _Head.contextType = _TableContext.default, _Head.allowedProps = _props.allowedProps, _Head.defaultProps = {
177
- children: null
178
- }, _Head)) || _class);
178
+ }) || _class);
179
179
  var _default = exports.default = Head;
@@ -34,15 +34,16 @@ 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;
38
- const colors = theme.colors,
39
- typography = theme.typography;
37
+ const {
38
+ colors,
39
+ typography
40
+ } = theme;
40
41
  const componentVariables = {
41
- fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
42
- fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
43
- fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
44
- color: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey125125,
45
- background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.white1010
42
+ fontSize: typography?.fontSizeMedium,
43
+ fontFamily: typography?.fontFamily,
44
+ fontWeight: typography?.fontWeightNormal,
45
+ color: colors?.contrasts?.grey125125,
46
+ background: colors?.contrasts?.white1010
46
47
  };
47
48
  return {
48
49
  ...componentVariables
@@ -15,7 +15,7 @@ var _theme = _interopRequireDefault(require("./theme"));
15
15
  var _props = require("./props");
16
16
  var _TableContext = _interopRequireDefault(require("../TableContext"));
17
17
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
18
- var _dec, _class, _Row;
18
+ var _dec, _class;
19
19
  /*
20
20
  * The MIT License (MIT)
21
21
  *
@@ -45,32 +45,38 @@ parent: Table
45
45
  id: Table.Row
46
46
  ---
47
47
  **/
48
- let Row = exports.Row = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = (_Row = class Row extends _react.Component {
48
+ let Row = exports.Row = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class Row extends _react.Component {
49
+ static displayName = "Row";
50
+ static componentId = 'Table.Row';
51
+ static contextType = _TableContext.default;
52
+ static allowedProps = _props.allowedProps;
53
+ static defaultProps = {
54
+ children: null
55
+ };
49
56
  componentDidMount() {
50
- var _this$props$makeStyle, _this$props;
51
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, {
57
+ this.props.makeStyles?.({
52
58
  isStacked: this.context.isStacked,
53
59
  hover: this.context.hover
54
60
  });
55
61
  }
56
62
  componentDidUpdate() {
57
- var _this$props$makeStyle2, _this$props2;
58
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, {
63
+ this.props.makeStyles?.({
59
64
  isStacked: this.context.isStacked,
60
65
  hover: this.context.hover
61
66
  });
62
67
  }
63
68
  render() {
64
- const _this$props3 = this.props,
65
- children = _this$props3.children,
66
- styles = _this$props3.styles;
69
+ const {
70
+ children,
71
+ styles
72
+ } = this.props;
67
73
  const isStacked = this.context.isStacked;
68
74
  const headers = this.context.headers;
69
75
  return (0, _jsxRuntime.jsx)(_v11_.View, {
70
76
  ..._v11_.View.omitViewProps((0, _omitProps.omitProps)(this.props, Row.allowedProps), Row),
71
77
  as: isStacked ? 'div' : 'tr',
72
- css: styles === null || styles === void 0 ? void 0 : styles.row,
73
- role: isStacked ? 'row' : void 0,
78
+ css: styles?.row,
79
+ role: isStacked ? 'row' : undefined,
74
80
  children: _react.Children.toArray(children).filter(Boolean).map((child, index) => {
75
81
  if (/*#__PURE__*/(0, _react.isValidElement)(child)) {
76
82
  return (0, _safeCloneElement.safeCloneElement)(child, {
@@ -83,7 +89,5 @@ let Row = exports.Row = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _
83
89
  })
84
90
  });
85
91
  }
86
- }, _Row.displayName = "Row", _Row.componentId = 'Table.Row', _Row.contextType = _TableContext.default, _Row.allowedProps = _props.allowedProps, _Row.defaultProps = {
87
- children: null
88
- }, _Row)) || _class);
92
+ }) || _class);
89
93
  var _default = exports.default = Row;
@@ -39,7 +39,9 @@ exports.default = void 0;
39
39
  * @return {Object} The final style object, which will be used in the component
40
40
  */
41
41
  const generateStyle = (componentTheme, props, extraArgs) => {
42
- const setHoverStateTo = props.setHoverStateTo;
42
+ const {
43
+ setHoverStateTo
44
+ } = props;
43
45
  const hoverStyles = {
44
46
  borderLeftColor: componentTheme.hoverBorderColor,
45
47
  borderRightColor: componentTheme.hoverBorderColor
@@ -56,7 +58,7 @@ const generateStyle = (componentTheme, props, extraArgs) => {
56
58
  borderBottomStyle: 'solid',
57
59
  borderBottomWidth: '0.0625rem',
58
60
  borderBottomColor: componentTheme.borderColor,
59
- ...((setHoverStateTo !== null && setHoverStateTo !== void 0 ? setHoverStateTo : extraArgs.hover) && {
61
+ ...((setHoverStateTo ?? extraArgs.hover) && {
60
62
  borderLeft: '0.1875rem solid transparent',
61
63
  borderRight: '0.1875rem solid transparent',
62
64
  ...(setHoverStateTo === true ? hoverStyles : {
@@ -34,25 +34,26 @@ 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;
38
- const colors = theme.colors,
39
- typography = theme.typography,
40
- spacing = theme.spacing,
41
- themeName = theme.key;
37
+ const {
38
+ colors,
39
+ typography,
40
+ spacing,
41
+ key: themeName
42
+ } = theme;
42
43
  const themeSpecificStyle = {
43
44
  canvas: {
44
45
  hoverBorderColor: theme['ic-brand-primary']
45
46
  }
46
47
  };
47
48
  const componentVariables = {
48
- fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
49
- fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
50
- fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
51
- color: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey125125,
52
- background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.white1010,
53
- borderColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.grey3045,
54
- hoverBorderColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts4 = colors.contrasts) === null || _colors$contrasts4 === void 0 ? void 0 : _colors$contrasts4.blue4570,
55
- padding: `${spacing === null || spacing === void 0 ? void 0 : spacing.xSmall} 0`
49
+ fontSize: typography?.fontSizeMedium,
50
+ fontFamily: typography?.fontFamily,
51
+ fontWeight: typography?.fontWeightNormal,
52
+ color: colors?.contrasts?.grey125125,
53
+ background: colors?.contrasts?.white1010,
54
+ borderColor: colors?.contrasts?.grey3045,
55
+ hoverBorderColor: colors?.contrasts?.blue4570,
56
+ padding: `${spacing?.xSmall} 0`
56
57
  };
57
58
  return {
58
59
  ...componentVariables,
@@ -15,7 +15,7 @@ var _theme = _interopRequireDefault(require("./theme"));
15
15
  var _props = require("./props");
16
16
  var _TableContext = _interopRequireDefault(require("../TableContext"));
17
17
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
18
- var _dec, _class, _RowHeader;
18
+ var _dec, _class;
19
19
  /*
20
20
  * The MIT License (MIT)
21
21
  *
@@ -45,31 +45,35 @@ parent: Table
45
45
  id: Table.RowHeader
46
46
  ---
47
47
  **/
48
- let RowHeader = exports.RowHeader = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = (_RowHeader = class RowHeader extends _react.Component {
48
+ let RowHeader = exports.RowHeader = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class RowHeader extends _react.Component {
49
+ static displayName = "RowHeader";
50
+ static componentId = 'Table.RowHeader';
51
+ static contextType = _TableContext.default;
52
+ static allowedProps = _props.allowedProps;
53
+ static defaultProps = {
54
+ textAlign: 'start',
55
+ children: null
56
+ };
49
57
  componentDidMount() {
50
- var _this$props$makeStyle, _this$props;
51
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
58
+ this.props.makeStyles?.();
52
59
  }
53
60
  componentDidUpdate() {
54
- var _this$props$makeStyle2, _this$props2;
55
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
61
+ this.props.makeStyles?.();
56
62
  }
57
63
  render() {
58
- const _this$props3 = this.props,
59
- children = _this$props3.children,
60
- styles = _this$props3.styles;
64
+ const {
65
+ children,
66
+ styles
67
+ } = this.props;
61
68
  const isStacked = this.context.isStacked;
62
69
  return (0, _jsxRuntime.jsx)(_v11_.View, {
63
70
  ..._v11_.View.omitViewProps((0, _omitProps.omitProps)(this.props, RowHeader.allowedProps), RowHeader),
64
71
  as: isStacked ? 'div' : 'th',
65
- css: styles === null || styles === void 0 ? void 0 : styles.rowHeader,
72
+ css: styles?.rowHeader,
66
73
  scope: "row",
67
- role: isStacked ? 'rowheader' : void 0,
74
+ role: isStacked ? 'rowheader' : undefined,
68
75
  children: (0, _callRenderProp.callRenderProp)(children)
69
76
  });
70
77
  }
71
- }, _RowHeader.displayName = "RowHeader", _RowHeader.componentId = 'Table.RowHeader', _RowHeader.contextType = _TableContext.default, _RowHeader.allowedProps = _props.allowedProps, _RowHeader.defaultProps = {
72
- textAlign: 'start',
73
- children: null
74
- }, _RowHeader)) || _class);
78
+ }) || _class);
75
79
  var _default = exports.default = RowHeader;
@@ -39,7 +39,9 @@ exports.default = void 0;
39
39
  * @return {Object} The final style object, which will be used in the component
40
40
  */
41
41
  const generateStyle = (componentTheme, props) => {
42
- const textAlign = props.textAlign;
42
+ const {
43
+ textAlign
44
+ } = props;
43
45
  return {
44
46
  rowHeader: {
45
47
  label: 'rowHeader',
@@ -34,19 +34,20 @@ 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;
38
- const colors = theme.colors,
39
- typography = theme.typography,
40
- spacing = theme.spacing;
37
+ const {
38
+ colors,
39
+ typography,
40
+ spacing
41
+ } = theme;
41
42
  const componentVariables = {
42
- fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
43
- fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
44
- fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightBold,
45
- color: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey125125,
46
- background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.white1010,
47
- borderColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.grey4570,
48
- lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
49
- padding: `${spacing === null || spacing === void 0 ? void 0 : spacing.xSmall} ${spacing === null || spacing === void 0 ? void 0 : spacing.small}`
43
+ fontSize: typography?.fontSizeMedium,
44
+ fontFamily: typography?.fontFamily,
45
+ fontWeight: typography?.fontWeightBold,
46
+ color: colors?.contrasts?.grey125125,
47
+ background: colors?.contrasts?.white1010,
48
+ borderColor: colors?.contrasts?.grey4570,
49
+ lineHeight: typography?.lineHeightCondensed,
50
+ padding: `${spacing?.xSmall} ${spacing?.small}`
50
51
  };
51
52
  return {
52
53
  ...componentVariables