@atlaskit/dynamic-table 14.3.2 → 14.4.0

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 (81) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/components/LoadingContainerAdvanced.js +3 -3
  3. package/dist/cjs/components/Stateless.js +1 -1
  4. package/dist/cjs/components/TableHeadCell.js +18 -48
  5. package/dist/cjs/components/rankable/TableCell.js +4 -4
  6. package/dist/cjs/components/rankable/TableHeadCell.js +2 -4
  7. package/dist/cjs/components/rankable/TableRow.js +3 -3
  8. package/dist/cjs/styled/DynamicTable.js +80 -14
  9. package/dist/cjs/styled/EmptyBody.js +23 -8
  10. package/dist/cjs/styled/LoadingContainer.js +41 -8
  11. package/dist/cjs/styled/LoadingContainerAdvanced.js +42 -8
  12. package/dist/cjs/styled/TableCell.js +21 -7
  13. package/dist/cjs/styled/TableHead.js +161 -25
  14. package/dist/cjs/styled/TableRow.js +36 -18
  15. package/dist/cjs/styled/constants.js +33 -38
  16. package/dist/cjs/styled/rankable/RowPlaceholder.js +11 -4
  17. package/dist/cjs/styled/rankable/TableCell.js +18 -13
  18. package/dist/cjs/styled/rankable/TableRow.js +32 -20
  19. package/dist/cjs/theme.js +20 -18
  20. package/dist/cjs/version.json +1 -1
  21. package/dist/es2019/components/LoadingContainerAdvanced.js +2 -4
  22. package/dist/es2019/components/Stateless.js +1 -1
  23. package/dist/es2019/components/TableHeadCell.js +18 -22
  24. package/dist/es2019/components/rankable/TableCell.js +4 -4
  25. package/dist/es2019/components/rankable/TableHeadCell.js +1 -3
  26. package/dist/es2019/components/rankable/TableRow.js +3 -3
  27. package/dist/es2019/styled/DynamicTable.js +75 -26
  28. package/dist/es2019/styled/EmptyBody.js +21 -10
  29. package/dist/es2019/styled/LoadingContainer.js +39 -18
  30. package/dist/es2019/styled/LoadingContainerAdvanced.js +38 -20
  31. package/dist/es2019/styled/TableCell.js +20 -5
  32. package/dist/es2019/styled/TableHead.js +160 -33
  33. package/dist/es2019/styled/TableRow.js +34 -20
  34. package/dist/es2019/styled/constants.js +30 -115
  35. package/dist/es2019/styled/rankable/RowPlaceholder.js +10 -4
  36. package/dist/es2019/styled/rankable/TableCell.js +16 -9
  37. package/dist/es2019/styled/rankable/TableRow.js +32 -24
  38. package/dist/es2019/theme.js +19 -18
  39. package/dist/es2019/version.json +1 -1
  40. package/dist/esm/components/LoadingContainerAdvanced.js +3 -3
  41. package/dist/esm/components/Stateless.js +1 -1
  42. package/dist/esm/components/TableHeadCell.js +19 -47
  43. package/dist/esm/components/rankable/TableCell.js +4 -4
  44. package/dist/esm/components/rankable/TableHeadCell.js +2 -4
  45. package/dist/esm/components/rankable/TableRow.js +3 -3
  46. package/dist/esm/styled/DynamicTable.js +77 -9
  47. package/dist/esm/styled/EmptyBody.js +23 -7
  48. package/dist/esm/styled/LoadingContainer.js +40 -8
  49. package/dist/esm/styled/LoadingContainerAdvanced.js +41 -7
  50. package/dist/esm/styled/TableCell.js +21 -7
  51. package/dist/esm/styled/TableHead.js +160 -21
  52. package/dist/esm/styled/TableRow.js +36 -12
  53. package/dist/esm/styled/constants.js +28 -29
  54. package/dist/esm/styled/rankable/RowPlaceholder.js +11 -5
  55. package/dist/esm/styled/rankable/TableCell.js +18 -9
  56. package/dist/esm/styled/rankable/TableRow.js +31 -14
  57. package/dist/esm/theme.js +19 -18
  58. package/dist/esm/version.json +1 -1
  59. package/dist/types/components/Body.d.ts +21 -21
  60. package/dist/types/components/LoadingContainerAdvanced.d.ts +2 -2
  61. package/dist/types/components/Stateless.d.ts +3 -3
  62. package/dist/types/components/TableHeadCell.d.ts +4 -9
  63. package/dist/types/components/rankable/Body.d.ts +21 -21
  64. package/dist/types/components/rankable/TableHeadCell.d.ts +1 -1
  65. package/dist/types/components/rankable/TableRow.d.ts +3 -3
  66. package/dist/types/hoc/withDimensions.d.ts +2 -2
  67. package/dist/types/hoc/withSortedPageRows.d.ts +20 -20
  68. package/dist/types/styled/DynamicTable.d.ts +13 -6
  69. package/dist/types/styled/EmptyBody.d.ts +4 -3
  70. package/dist/types/styled/LoadingContainer.d.ts +8 -7
  71. package/dist/types/styled/LoadingContainerAdvanced.d.ts +5 -4
  72. package/dist/types/styled/TableCell.d.ts +3 -2
  73. package/dist/types/styled/TableHead.d.ts +8 -5
  74. package/dist/types/styled/TableRow.d.ts +7 -4
  75. package/dist/types/styled/constants.d.ts +13 -10
  76. package/dist/types/styled/rankable/RowPlaceholder.d.ts +3 -2
  77. package/dist/types/styled/rankable/TableCell.d.ts +8 -6
  78. package/dist/types/styled/rankable/TableRow.d.ts +9 -6
  79. package/dist/types/theme.d.ts +9 -9
  80. package/dist/types/types.d.ts +2 -2
  81. package/package.json +9 -3
@@ -1,117 +1,32 @@
1
- import { css } from 'styled-components';
2
- import { N30A } from '@atlaskit/theme/colors';
3
- import { gridSize } from '@atlaskit/theme/constants';
4
- import { ASC, DESC } from '../internal/constants';
5
- import { arrow, MSThemeColors } from '../theme';
6
- export const truncateStyle = ({
7
- width,
8
- isFixedSize,
9
- shouldTruncate
10
- }) => css`
11
- ${width ? css`
12
- width: ${width}%;
13
- ` : ''} ${isFixedSize ? css`
14
- overflow: hidden;
15
- ` : ''};
16
- ${isFixedSize && shouldTruncate ? css`
17
- text-overflow: ellipsis;
18
- white-space: nowrap;
19
- ` : ''};
20
- `;
21
- export const onClickStyle = ({
22
- onClick
23
- }) => onClick && css`
24
- &:hover {
25
- cursor: pointer;
26
- background-color: ${N30A};
27
- }
28
- `;
29
- export const arrowsStyle = props => {
30
- const {
31
- isSortable,
32
- sortOrder
33
- } = props;
34
-
35
- if (!isSortable) {
36
- return '';
37
- }
38
-
39
- const pseudoBase = css`
40
- border: 3px solid transparent;
41
- display: block;
42
- height: 0;
43
- position: absolute;
44
- right: -${gridSize}px;
45
- width: 0;
46
-
47
- @media (forced-colors: active) {
48
- border: 3px solid ${MSThemeColors.Background};
49
- }
50
- `;
51
- return css`
52
- & > span {
53
- position: relative;
54
- &::before {
55
- ${pseudoBase};
56
- border-bottom: 3px solid
57
- ${sortOrder === ASC ? arrow.selectedColor(props) : arrow.defaultColor(props)};
58
- bottom: 8px;
59
- content: ' ';
60
- }
61
- &::after {
62
- ${pseudoBase};
63
- border-top: 3px solid
64
- ${sortOrder === DESC ? arrow.selectedColor(props) : arrow.defaultColor(props)};
65
- bottom: 0;
66
- content: ' ';
67
- }
68
- }
69
-
70
- &:hover > span {
71
- &::before {
72
- border-bottom: 3px solid
73
- ${sortOrder === ASC ? arrow.selectedColor(props) : arrow.hoverColor(props)};
74
- }
75
- &::after {
76
- border-top: 3px solid
77
- ${sortOrder === DESC ? arrow.selectedColor(props) : arrow.hoverColor(props)};
78
- }
79
- }
80
-
81
- @media (forced-colors: active) {
82
- & > span {
83
- &::before {
84
- border-bottom: 3px solid
85
- ${sortOrder === ASC ? MSThemeColors.SelectedBackground : MSThemeColors.Text};
86
- }
87
- &::after {
88
- border-top: 3px solid
89
- ${sortOrder === DESC ? MSThemeColors.SelectedBackground : MSThemeColors.Text};
90
- }
91
- }
92
-
93
- &:hover > span {
94
- &::before {
95
- border-bottom: 3px solid
96
- ${sortOrder === ASC ? MSThemeColors.SelectedBackground : MSThemeColors.Text};
97
- }
98
- &::after {
99
- border-top: 3px solid
100
- ${sortOrder === DESC ? MSThemeColors.SelectedBackground : MSThemeColors.Text};
101
- }
102
- }
103
- }
104
- `;
1
+ import { css } from '@emotion/core';
2
+ import { gridSize as getGridSize } from '@atlaskit/theme/constants';
3
+ const CSS_VAR_WIDTH = '--local-dynamic-table-width';
4
+ const gridSize = getGridSize();
5
+ export const truncationWidthStyles = css({
6
+ width: `var(${CSS_VAR_WIDTH})`
7
+ });
8
+ export const fixedSizeTruncateStyles = css({
9
+ textOverflow: 'ellipsis',
10
+ whiteSpace: 'nowrap'
11
+ });
12
+ export const overflowTruncateStyles = css({
13
+ overflow: 'hidden'
14
+ });
15
+ export const getTruncationStyleVars = ({
16
+ width
17
+ }) => {
18
+ return {
19
+ [CSS_VAR_WIDTH]: `${width}%`
20
+ };
105
21
  };
106
- export const cellStyle = css`
107
- border: none;
108
- padding: ${gridSize() / 2}px ${gridSize}px;
109
- text-align: left;
110
-
111
- &:first-child {
112
- padding-left: 0;
113
- }
114
- &:last-child {
115
- padding-right: 0;
22
+ export const cellStyles = css({
23
+ border: 'none',
24
+ padding: `${gridSize / 2}px ${gridSize}px`,
25
+ textAlign: 'left',
26
+ '&:first-of-type': {
27
+ paddingLeft: 0
28
+ },
29
+ '&:last-child': {
30
+ paddingRight: 0
116
31
  }
117
- `;
32
+ });
@@ -1,4 +1,10 @@
1
- import styled from 'styled-components';
2
- export const RowPlaceholderCell = styled.td`
3
- padding: 0;
4
- `;
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+
3
+ /** @jsx jsx */
4
+ import { css, jsx } from '@emotion/core';
5
+ const rowPlaceholderStyles = css({
6
+ padding: 0
7
+ });
8
+ export const RowPlaceholderCell = props => jsx("td", _extends({
9
+ css: rowPlaceholderStyles
10
+ }, props));
@@ -1,10 +1,17 @@
1
- import styled, { css } from 'styled-components';
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+
3
+ /** @jsx jsx */
4
+ import { css, jsx } from '@emotion/core';
2
5
  import { TableBodyCell } from '../TableCell';
3
- const rankingStyles = css`
4
- box-sizing: border-box;
5
- `;
6
- export const RankableTableBodyCell = styled(TableBodyCell)`
7
- ${({
8
- isRanking
9
- }) => isRanking && rankingStyles};
10
- `;
6
+ const rankingStyles = css({
7
+ boxSizing: 'border-box'
8
+ });
9
+ export const RankableTableBodyCell = ({
10
+ isRanking,
11
+ innerRef,
12
+ ...props
13
+ }) => jsx(TableBodyCell, _extends({
14
+ css: isRanking && rankingStyles
15
+ }, props, {
16
+ innerRef: innerRef
17
+ }));
@@ -1,31 +1,39 @@
1
- import styled, { css } from 'styled-components';
2
- import { B100, N20 } from '@atlaskit/theme/colors';
3
- import { e500 } from '@atlaskit/theme/elevation';
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+
3
+ /** @jsx jsx */
4
+ import { forwardRef } from 'react';
5
+ import { css, jsx } from '@emotion/core';
6
+ import { B100, N20, N50A, N60A } from '@atlaskit/theme/colors';
7
+ import { token } from '@atlaskit/tokens';
4
8
  import { TableBodyRow } from '../TableRow';
5
- const rankingStyles = css`
6
- display: block;
7
- `;
9
+ const rankingStyles = css({
10
+ display: 'block'
11
+ });
12
+ const elevationStyle = token('shadow.overlay', `0 20px 32px -8px ${N50A}, 0 0 1px ${N60A}`);
8
13
  /**
9
14
  * TODO: Pass the props here to get particular theme for the table
10
15
  * Skipping it for now as it may impact migration as util-shared-styles does not support this feature
11
16
  */
12
17
 
13
- const rankingItemStyles = css`
14
- background-color: ${N20};
15
- ${e500()} border-radius: 2px;
16
- `;
17
-
18
- const draggableStyles = ({
18
+ const rankingItemStyles = css({
19
+ backgroundColor: token('color.background.subtleNeutral.resting', N20),
20
+ boxShadow: elevationStyle,
21
+ borderRadius: '2px'
22
+ });
23
+ const draggableStyles = css({
24
+ '&:focus': {
25
+ outlineStyle: 'solid',
26
+ outlineColor: token('color.border.focus', B100)
27
+ },
28
+ outlineWidth: '2px'
29
+ });
30
+ export const RankableTableBodyRow = /*#__PURE__*/forwardRef(({
19
31
  isRanking,
20
- isRankingItem
21
- }) => css`
22
- ${isRanking && rankingStyles} ${isRankingItem && rankingItemStyles} &:focus {
23
- outline-style: solid;
24
- outline-color: ${B100};
25
- outline-width: 2px;
26
- }
27
- `;
28
-
29
- export const RankableTableBodyRow = styled(TableBodyRow)`
30
- ${draggableStyles};
31
- `;
32
+ isRankingItem,
33
+ ...props
34
+ }, ref) => {
35
+ return jsx(TableBodyRow, _extends({
36
+ css: [isRanking && rankingStyles, isRankingItem && rankingItemStyles, draggableStyles],
37
+ ref: ref
38
+ }, props));
39
+ });
@@ -1,5 +1,6 @@
1
1
  import * as colors from '@atlaskit/theme/colors';
2
2
  import { themed } from '@atlaskit/theme/components';
3
+ import { token } from '@atlaskit/tokens';
3
4
  export const MSThemeColors = {
4
5
  Background: 'Canvas',
5
6
  Text: 'CanvasText',
@@ -8,43 +9,43 @@ export const MSThemeColors = {
8
9
  };
9
10
  export const arrow = {
10
11
  defaultColor: themed({
11
- light: colors.N40,
12
- dark: colors.DN40
12
+ light: token('color.background.subtleNeutral.resting', colors.N40),
13
+ dark: token('color.background.subtleNeutral.resting', colors.DN40)
13
14
  }),
14
15
  selectedColor: themed({
15
- light: colors.N300,
16
- dark: colors.DN300
16
+ light: token('color.text.lowEmphasis', colors.N300),
17
+ dark: token('color.text.lowEmphasis', colors.DN300)
17
18
  }),
18
19
  hoverColor: themed({
19
- light: colors.N60,
20
- dark: colors.DN60
20
+ light: token('color.background.subtleNeutral.pressed', colors.N60),
21
+ dark: token('color.background.subtleNeutral.pressed', colors.DN60)
21
22
  })
22
23
  };
23
24
  export const row = {
24
25
  focusOutline: themed({
25
- light: colors.B100,
26
- dark: colors.B100
26
+ light: token('color.border.focus', colors.B100),
27
+ dark: token('color.border.focus', colors.B100)
27
28
  }),
28
29
  highlightedBackground: themed({
29
- light: colors.B50,
30
- dark: colors.DN50
30
+ light: token('color.background.selected.resting', colors.B50),
31
+ dark: token('color.background.selected.resting', colors.DN50)
31
32
  }),
32
33
  hoverBackground: themed({
33
- light: colors.N10,
34
- dark: colors.DN40
34
+ light: token('color.background.subtleBorderedNeutral.resting', colors.N10),
35
+ dark: token('color.background.subtleBorderedNeutral.resting', colors.DN40)
35
36
  }),
36
37
  hoverHighlightedBackground: themed({
37
- light: colors.B75,
38
- dark: colors.DN60
38
+ light: token('color.background.selected.hover', colors.B75),
39
+ dark: token('color.background.selected.hover', colors.DN60)
39
40
  })
40
41
  };
41
42
  export const head = {
42
43
  borderColor: themed({
43
- light: colors.N40,
44
- dark: colors.DN50
44
+ light: token('color.border.neutral', colors.N40),
45
+ dark: token('color.border.neutral', colors.DN50)
45
46
  }),
46
47
  textColor: themed({
47
- light: colors.N300,
48
- dark: colors.DN300
48
+ light: token('color.text.lowEmphasis', colors.N300),
49
+ dark: token('color.text.lowEmphasis', colors.DN300)
49
50
  })
50
51
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.3.2",
3
+ "version": "14.4.0",
4
4
  "sideEffects": false
5
5
  }
@@ -89,7 +89,7 @@ var LoadingContainerAdvanced = /*#__PURE__*/function (_React$Component) {
89
89
  });
90
90
 
91
91
  _defineProperty(_assertThisInitialized(_this), "getSpinnerNode", function () {
92
- return safeFindDOMNode(_this.spinner);
92
+ return safeFindDOMNode(_this.spinnerRef);
93
93
  });
94
94
 
95
95
  _defineProperty(_assertThisInitialized(_this), "hasTargetNode", function (nextProps) {
@@ -237,8 +237,8 @@ var LoadingContainerAdvanced = /*#__PURE__*/function (_React$Component) {
237
237
  _this2.children = el;
238
238
  }
239
239
  }), isLoading && /*#__PURE__*/React.createElement(SpinnerBackdrop, null, /*#__PURE__*/React.createElement(SpinnerContainer, {
240
- innerRef: function innerRef(el) {
241
- _this2.spinner = el;
240
+ ref: function ref(el) {
241
+ return _this2.spinnerRef = el;
242
242
  }
243
243
  }, /*#__PURE__*/React.createElement(Spinner, {
244
244
  size: spinnerSize,
@@ -24,7 +24,7 @@ import ManagedPagination from './managedPagination';
24
24
  import RankableTableBody from './rankable/Body';
25
25
  import TableHead from './TableHead';
26
26
  var packageName = "@atlaskit/dynamic-table";
27
- var packageVersion = "14.3.2";
27
+ var packageVersion = "14.4.0";
28
28
 
29
29
  function toggleSortOrder(currentSortOrder) {
30
30
  switch (currentSortOrder) {
@@ -1,54 +1,26 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
- import _createClass from "@babel/runtime/helpers/createClass";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
-
10
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
-
12
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
-
14
3
  import React from 'react';
15
4
  import { HeadCell } from '../styled/TableHead';
16
5
 
17
- var TableHeadCell = /*#__PURE__*/function (_React$Component) {
18
- _inherits(TableHeadCell, _React$Component);
19
-
20
- var _super = _createSuper(TableHeadCell);
21
-
22
- function TableHeadCell() {
23
- _classCallCheck(this, TableHeadCell);
24
-
25
- return _super.apply(this, arguments);
26
- }
27
-
28
- _createClass(TableHeadCell, [{
29
- key: "render",
30
- value: function render() {
31
- var _this$props = this.props,
32
- content = _this$props.content,
33
- inlineStyles = _this$props.inlineStyles,
34
- testId = _this$props.testId,
35
- rest = _objectWithoutProperties(_this$props, ["content", "inlineStyles", "testId"]);
36
-
37
- return /*#__PURE__*/React.createElement(HeadCell, _extends({
38
- style: inlineStyles,
39
- "data-testid": testId && "".concat(testId, "--head--cell")
40
- }, rest, {
41
- tabIndex: rest.isSortable ? 0 : undefined
42
- }), /*#__PURE__*/React.createElement("span", null, content));
43
- }
44
- }]);
45
-
46
- return TableHeadCell;
47
- }(React.Component);
48
-
49
- _defineProperty(TableHeadCell, "defaultProps", {
50
- innerRef: function innerRef() {},
51
- inlineStyles: {}
52
- });
6
+ var TableHeadCell = function TableHeadCell(_ref) {
7
+ var content = _ref.content,
8
+ inlineStyles = _ref.inlineStyles,
9
+ testId = _ref.testId,
10
+ isRanking = _ref.isRanking,
11
+ innerRef = _ref.innerRef,
12
+ isSortable = _ref.isSortable,
13
+ rest = _objectWithoutProperties(_ref, ["content", "inlineStyles", "testId", "isRanking", "innerRef", "isSortable"]);
14
+
15
+ return /*#__PURE__*/React.createElement(HeadCell, _extends({
16
+ style: inlineStyles,
17
+ "data-testid": testId && "".concat(testId, "--head--cell"),
18
+ ref: typeof innerRef !== 'string' ? innerRef : null // string refs must be discarded as LegacyRefs are not compatible with FC forwardRefs
19
+
20
+ }, rest, {
21
+ tabIndex: isSortable ? 0 : undefined,
22
+ isSortable: isSortable
23
+ }), /*#__PURE__*/React.createElement("span", null, content));
24
+ };
53
25
 
54
26
  export default TableHeadCell;
@@ -33,8 +33,8 @@ export var RankableTableCell = /*#__PURE__*/function (_React$Component) {
33
33
  head = _this$props.head,
34
34
  isFixedSize = _this$props.isFixedSize,
35
35
  isRanking = _this$props.isRanking,
36
- innerRef = _this$props.innerRef,
37
- refWidth = _this$props.refWidth;
36
+ refWidth = _this$props.refWidth,
37
+ innerRef = _this$props.innerRef;
38
38
 
39
39
  var content = cell.content,
40
40
  restCellProps = _objectWithoutProperties(cell, ["content"]);
@@ -50,10 +50,10 @@ export var RankableTableCell = /*#__PURE__*/function (_React$Component) {
50
50
  width: width,
51
51
  isRanking: isRanking,
52
52
  style: inlineStyles,
53
- innerRef: innerRef,
54
53
  onKeyDown: function onKeyDown(e) {
55
54
  return e.stopPropagation();
56
- }
55
+ },
56
+ innerRef: innerRef
57
57
  }), content);
58
58
  }
59
59
  }]);
@@ -33,13 +33,11 @@ var RankableTableHeadCell = /*#__PURE__*/function (_React$Component) {
33
33
  isRanking = _this$props.isRanking,
34
34
  refHeight = _this$props.refHeight,
35
35
  refWidth = _this$props.refWidth,
36
- innerRef = _this$props.innerRef,
37
- restProps = _objectWithoutProperties(_this$props, ["isRanking", "refHeight", "refWidth", "innerRef"]);
36
+ restProps = _objectWithoutProperties(_this$props, ["isRanking", "refHeight", "refWidth"]);
38
37
 
39
38
  var inlineStyles = inlineStylesIfRanking(isRanking, refWidth);
40
39
  return /*#__PURE__*/React.createElement(HeadCell, _extends({
41
- inlineStyles: inlineStyles,
42
- innerRef: innerRef
40
+ inlineStyles: inlineStyles
43
41
  }, restProps));
44
42
  }
45
43
  }]);
@@ -42,7 +42,7 @@ export var RankableTableRow = /*#__PURE__*/function (_React$Component) {
42
42
  return function (ref) {
43
43
  innerRefFn(ref);
44
44
 
45
- if (_this.props.innerRef) {
45
+ if (typeof _this.props.innerRef === 'function') {
46
46
  _this.props.innerRef(ref);
47
47
  }
48
48
  };
@@ -78,12 +78,12 @@ export var RankableTableRow = /*#__PURE__*/function (_React$Component) {
78
78
  }
79
79
 
80
80
  return /*#__PURE__*/React.createElement(Draggable, {
81
- draggableId: key || "".concat(rowIndex),
81
+ draggableId: key || rowIndex.toString(),
82
82
  index: rowIndex,
83
83
  isDragDisabled: isRankingDisabled
84
84
  }, function (provided, snapshot) {
85
85
  return /*#__PURE__*/React.createElement(RankableTableBodyRow, _extends({}, restRowProps, provided.dragHandleProps, provided.draggableProps, {
86
- innerRef: _this2.innerRef(provided.innerRef),
86
+ ref: _this2.innerRef(provided.innerRef),
87
87
  style: _objectSpread(_objectSpread({}, provided.draggableProps.style), inlineStyles),
88
88
  isHighlighted: isHighlighted,
89
89
  isRanking: isRanking,
@@ -1,12 +1,80 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
4
 
3
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
5
+ /** @jsx jsx */
6
+ import { forwardRef } from 'react';
7
+ import { css, jsx } from '@emotion/core';
8
+ import { useGlobalTheme } from '@atlaskit/theme/components';
9
+ import { gridSize as getGridSize } from '@atlaskit/theme/constants';
10
+ import { row } from '../theme';
11
+ var gridSize = getGridSize();
12
+ // CSS vars for table row
13
+ // these are declared here to avoid being re-declared in each table row
14
+ export var tableRowCSSVars = {
15
+ CSS_VAR_HOVER_BACKGROUND: '--local-dynamic-table-hover-bg',
16
+ CSS_VAR_HIGHLIGHTED_BACKGROUND: '--local-dynamic-table-highlighted-bg',
17
+ CSS_VAR_HOVER_HIGHLIGHTED_BACKGROUND: '--local-dynamic-table-hover-highlighted-bg',
18
+ CSS_VAR_ROW_FOCUS_OUTLINE: '--local-dynamic-table-row-focus-outline'
19
+ };
20
+ var fixedSizeTableStyles = css({
21
+ tableLayout: 'fixed'
22
+ });
23
+ var tableStyles = css({
24
+ borderCollapse: 'collapse',
25
+ width: '100%'
26
+ });
27
+ export var Table = /*#__PURE__*/forwardRef(function (_ref, ref) {
28
+ var _ref2;
29
+
30
+ var isFixedSize = _ref.isFixedSize,
31
+ children = _ref.children,
32
+ rest = _objectWithoutProperties(_ref, ["isFixedSize", "children"]);
4
33
 
5
- import styled, { css } from 'styled-components';
6
- import { gridSize } from '@atlaskit/theme/constants';
7
- export var Table = styled.table(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ";\n border-collapse: collapse;\n width: 100%;\n"])), function (_ref) {
8
- var isFixedSize = _ref.isFixedSize;
9
- return isFixedSize && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n table-layout: fixed;\n "])));
34
+ var theme = useGlobalTheme();
35
+ return jsx("table", _extends({
36
+ style: (_ref2 = {}, _defineProperty(_ref2, tableRowCSSVars.CSS_VAR_HOVER_BACKGROUND, row.hoverBackground({
37
+ theme: theme
38
+ })), _defineProperty(_ref2, tableRowCSSVars.CSS_VAR_HIGHLIGHTED_BACKGROUND, row.highlightedBackground({
39
+ theme: theme
40
+ })), _defineProperty(_ref2, tableRowCSSVars.CSS_VAR_HOVER_HIGHLIGHTED_BACKGROUND, row.hoverHighlightedBackground({
41
+ theme: theme
42
+ })), _defineProperty(_ref2, tableRowCSSVars.CSS_VAR_ROW_FOCUS_OUTLINE, row.focusOutline({
43
+ theme: theme
44
+ })), _ref2),
45
+ css: [tableStyles, isFixedSize && fixedSizeTableStyles],
46
+ ref: ref
47
+ }, rest), children);
48
+ });
49
+ var captionStyles = css({
50
+ fontSize: '1.42857143em',
51
+
52
+ /* there is a bug in Safari: if element which creates a new stacking context
53
+ is a child of a table, table caption re-renders in bad wrong position
54
+ https://stackoverflow.com/questions/44009186/safari-bug-translating-table-row-group-using-gsap-make-caption-jump-to-bottom
55
+ */
56
+ willChange: 'transform',
57
+ fontStyle: 'inherit',
58
+ fontWeight: 500,
59
+ letterSpacing: '-0.008em',
60
+ lineHeight: 1.2,
61
+ marginBottom: "".concat(gridSize, "px"),
62
+ marginTop: "".concat(gridSize * 3.5, "px"),
63
+ textAlign: 'left'
64
+ });
65
+ export var Caption = function Caption(_ref3) {
66
+ var children = _ref3.children;
67
+ return jsx("caption", {
68
+ css: captionStyles
69
+ }, children);
70
+ };
71
+ var paginationWrapperStyles = css({
72
+ display: 'flex',
73
+ justifyContent: 'center'
10
74
  });
11
- export var Caption = styled.caption(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-size: 1.42857143em;\n /* there is a bug in Safari: if element which creates a new stacking context\n is a child of a table, table caption re-renders in bad wrong position\n https://stackoverflow.com/questions/44009186/safari-bug-translating-table-row-group-using-gsap-make-caption-jump-to-bottom\n */\n will-change: transform;\n font-style: inherit;\n font-weight: 500;\n letter-spacing: -0.008em;\n line-height: 1.2;\n margin-bottom: ", "px;\n margin-top: ", "px;\n text-align: left;\n"])), gridSize, gridSize() * 3.5);
12
- export var PaginationWrapper = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n"])));
75
+ export var PaginationWrapper = function PaginationWrapper(_ref4) {
76
+ var children = _ref4.children;
77
+ return jsx("div", {
78
+ css: paginationWrapperStyles
79
+ }, children);
80
+ };
@@ -1,8 +1,24 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
- var _templateObject, _templateObject2;
4
-
5
- import styled from 'styled-components';
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/core';
6
3
  import { gridSize } from '@atlaskit/theme/constants';
7
- export var EmptyViewWithFixedHeight = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: ", "px;\n"])), gridSize() * 18);
8
- export var EmptyViewContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin: auto;\n padding: 10px;\n text-align: center;\n width: 50%;\n"])));
4
+ var fixedHeightStyles = css({
5
+ height: "".concat(gridSize() * 18, "px")
6
+ });
7
+ export var EmptyViewWithFixedHeight = function EmptyViewWithFixedHeight(_ref) {
8
+ var children = _ref.children;
9
+ return jsx("div", {
10
+ css: fixedHeightStyles
11
+ }, children);
12
+ };
13
+ var emptyViewContainerStyles = css({
14
+ margin: 'auto',
15
+ padding: '10px',
16
+ textAlign: 'center',
17
+ width: '50%'
18
+ });
19
+ export var EmptyViewContainer = function EmptyViewContainer(_ref2) {
20
+ var children = _ref2.children;
21
+ return jsx("div", {
22
+ css: emptyViewContainerStyles
23
+ }, children);
24
+ };