@atlaskit/dynamic-table 14.6.0 → 14.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/cjs/components/{Body.js → body.js} +3 -3
  3. package/dist/cjs/components/{LoadingContainerAdvanced.js → loading-container-advanced.js} +3 -3
  4. package/dist/cjs/components/{LoadingContainer.js → loading-container.js} +3 -3
  5. package/dist/cjs/components/rankable/{Body.js → body.js} +3 -3
  6. package/dist/cjs/components/rankable/{TableCell.js → table-cell.js} +3 -3
  7. package/dist/cjs/components/rankable/{TableHeadCell.js → table-head-cell.js} +3 -3
  8. package/dist/cjs/components/rankable/{TableRow.js → table-row.js} +5 -5
  9. package/dist/cjs/components/{Stateful.js → stateful.js} +6 -4
  10. package/dist/cjs/components/{Stateless.js → stateless.js} +32 -23
  11. package/dist/cjs/components/{TableHeadCell.js → table-head-cell.js} +5 -3
  12. package/dist/cjs/components/{TableHead.js → table-head.js} +7 -6
  13. package/dist/cjs/components/{TableRow.js → table-row.js} +6 -5
  14. package/dist/cjs/hoc/{withDimensions.js → with-dimensions.js} +0 -0
  15. package/dist/cjs/hoc/{withSortedPageRows.js → with-sorted-page-rows.js} +0 -0
  16. package/dist/cjs/index.js +4 -4
  17. package/dist/cjs/styled/constants.js +2 -2
  18. package/dist/cjs/styled/{DynamicTable.js → dynamic-table.js} +19 -25
  19. package/dist/cjs/styled/{EmptyBody.js → empty-body.js} +4 -2
  20. package/dist/cjs/styled/{LoadingContainerAdvanced.js → loading-container-advanced.js} +10 -6
  21. package/dist/cjs/styled/{LoadingContainer.js → loading-container.js} +5 -3
  22. package/dist/cjs/styled/rankable/{RowPlaceholder.js → row-placeholder.js} +6 -4
  23. package/dist/cjs/styled/rankable/{TableCell.js → table-cell.js} +5 -4
  24. package/dist/cjs/styled/rankable/{TableRow.js → table-row.js} +10 -9
  25. package/dist/cjs/styled/{TableCell.js → table-cell.js} +3 -1
  26. package/dist/cjs/styled/{TableHead.js → table-head.js} +73 -95
  27. package/dist/cjs/styled/{TableRow.js → table-row.js} +7 -6
  28. package/dist/cjs/theme.js +13 -40
  29. package/dist/cjs/version.json +1 -1
  30. package/dist/es2019/components/{Body.js → body.js} +2 -2
  31. package/dist/es2019/components/{LoadingContainerAdvanced.js → loading-container-advanced.js} +3 -1
  32. package/dist/es2019/components/{LoadingContainer.js → loading-container.js} +1 -1
  33. package/dist/es2019/components/rankable/{Body.js → body.js} +2 -2
  34. package/dist/es2019/components/rankable/{TableCell.js → table-cell.js} +2 -2
  35. package/dist/es2019/components/rankable/{TableHeadCell.js → table-head-cell.js} +2 -2
  36. package/dist/es2019/components/rankable/{TableRow.js → table-row.js} +3 -3
  37. package/dist/es2019/components/{Stateful.js → stateful.js} +4 -3
  38. package/dist/es2019/components/{Stateless.js → stateless.js} +24 -16
  39. package/dist/es2019/components/{TableHeadCell.js → table-head-cell.js} +4 -2
  40. package/dist/es2019/components/{TableHead.js → table-head.js} +5 -4
  41. package/dist/es2019/components/{TableRow.js → table-row.js} +4 -3
  42. package/dist/es2019/hoc/{withDimensions.js → with-dimensions.js} +0 -0
  43. package/dist/es2019/hoc/{withSortedPageRows.js → with-sorted-page-rows.js} +0 -0
  44. package/dist/es2019/index.js +2 -2
  45. package/dist/es2019/styled/constants.js +4 -6
  46. package/dist/es2019/styled/{DynamicTable.js → dynamic-table.js} +24 -27
  47. package/dist/es2019/styled/{EmptyBody.js → empty-body.js} +4 -2
  48. package/dist/es2019/styled/{LoadingContainerAdvanced.js → loading-container-advanced.js} +7 -4
  49. package/dist/es2019/styled/{LoadingContainer.js → loading-container.js} +5 -3
  50. package/dist/es2019/styled/rankable/row-placeholder.js +12 -0
  51. package/dist/es2019/styled/rankable/{TableCell.js → table-cell.js} +5 -3
  52. package/dist/es2019/styled/rankable/{TableRow.js → table-row.js} +9 -8
  53. package/dist/es2019/styled/{TableCell.js → table-cell.js} +4 -2
  54. package/dist/es2019/styled/table-head.js +138 -0
  55. package/dist/es2019/styled/{TableRow.js → table-row.js} +3 -2
  56. package/dist/es2019/theme.js +10 -37
  57. package/dist/es2019/types.js +1 -0
  58. package/dist/es2019/version.json +1 -1
  59. package/dist/esm/components/{Body.js → body.js} +2 -2
  60. package/dist/esm/components/{LoadingContainerAdvanced.js → loading-container-advanced.js} +2 -1
  61. package/dist/esm/components/{LoadingContainer.js → loading-container.js} +1 -1
  62. package/dist/esm/components/rankable/{Body.js → body.js} +2 -2
  63. package/dist/esm/components/rankable/{TableCell.js → table-cell.js} +2 -2
  64. package/dist/esm/components/rankable/{TableHeadCell.js → table-head-cell.js} +2 -2
  65. package/dist/esm/components/rankable/{TableRow.js → table-row.js} +3 -3
  66. package/dist/esm/components/{Stateful.js → stateful.js} +4 -3
  67. package/dist/esm/components/{Stateless.js → stateless.js} +24 -16
  68. package/dist/esm/components/{TableHeadCell.js → table-head-cell.js} +4 -2
  69. package/dist/esm/components/{TableHead.js → table-head.js} +5 -4
  70. package/dist/esm/components/{TableRow.js → table-row.js} +4 -3
  71. package/dist/esm/hoc/{withDimensions.js → with-dimensions.js} +0 -0
  72. package/dist/esm/hoc/{withSortedPageRows.js → with-sorted-page-rows.js} +0 -0
  73. package/dist/esm/index.js +2 -2
  74. package/dist/esm/styled/constants.js +2 -2
  75. package/dist/esm/styled/{DynamicTable.js → dynamic-table.js} +22 -25
  76. package/dist/esm/styled/{EmptyBody.js → empty-body.js} +4 -2
  77. package/dist/esm/styled/{LoadingContainerAdvanced.js → loading-container-advanced.js} +10 -6
  78. package/dist/esm/styled/{LoadingContainer.js → loading-container.js} +5 -3
  79. package/dist/esm/styled/rankable/{RowPlaceholder.js → row-placeholder.js} +7 -4
  80. package/dist/esm/styled/rankable/{TableCell.js → table-cell.js} +5 -3
  81. package/dist/esm/styled/rankable/{TableRow.js → table-row.js} +9 -8
  82. package/dist/esm/styled/{TableCell.js → table-cell.js} +4 -2
  83. package/dist/esm/styled/{TableHead.js → table-head.js} +75 -94
  84. package/dist/esm/styled/{TableRow.js → table-row.js} +3 -2
  85. package/dist/esm/theme.js +10 -37
  86. package/dist/esm/types.js +1 -0
  87. package/dist/esm/version.json +1 -1
  88. package/dist/types/components/{Body.d.ts → body.d.ts} +23 -23
  89. package/dist/types/components/{LoadingContainerAdvanced.d.ts → loading-container-advanced.d.ts} +5 -5
  90. package/dist/types/components/{LoadingContainer.d.ts → loading-container.d.ts} +0 -0
  91. package/dist/types/components/rankable/body.d.ts +122 -0
  92. package/dist/types/components/rankable/table-cell.d.ts +14 -0
  93. package/dist/types/components/rankable/table-head-cell.d.ts +5 -0
  94. package/dist/types/components/rankable/table-row.d.ts +18 -0
  95. package/dist/types/components/{Stateful.d.ts → stateful.d.ts} +3 -2
  96. package/dist/types/components/{Stateless.d.ts → stateless.d.ts} +11 -10
  97. package/dist/types/components/{TableHeadCell.d.ts → table-head-cell.d.ts} +2 -2
  98. package/dist/types/components/{TableHead.d.ts → table-head.d.ts} +3 -3
  99. package/dist/types/components/{TableRow.d.ts → table-row.d.ts} +2 -2
  100. package/dist/types/hoc/{withDimensions.d.ts → with-dimensions.d.ts} +0 -0
  101. package/dist/types/hoc/{withSortedPageRows.d.ts → with-sorted-page-rows.d.ts} +23 -23
  102. package/dist/types/index.d.ts +2 -2
  103. package/dist/types/styled/constants.d.ts +2 -2
  104. package/dist/types/styled/{DynamicTable.d.ts → dynamic-table.d.ts} +2 -1
  105. package/dist/types/styled/{EmptyBody.d.ts → empty-body.d.ts} +0 -0
  106. package/dist/types/styled/{LoadingContainerAdvanced.d.ts → loading-container-advanced.d.ts} +1 -1
  107. package/dist/types/styled/{LoadingContainer.d.ts → loading-container.d.ts} +0 -0
  108. package/dist/types/styled/rankable/{RowPlaceholder.d.ts → row-placeholder.d.ts} +0 -0
  109. package/dist/types/styled/rankable/{TableCell.d.ts → table-cell.d.ts} +0 -0
  110. package/dist/types/styled/rankable/{TableRow.d.ts → table-row.d.ts} +1 -1
  111. package/dist/types/styled/{TableCell.d.ts → table-cell.d.ts} +0 -0
  112. package/dist/types/styled/{TableHead.d.ts → table-head.d.ts} +1 -3
  113. package/dist/types/styled/{TableRow.d.ts → table-row.d.ts} +0 -0
  114. package/dist/types/theme.d.ts +10 -9
  115. package/dist/types/types.d.ts +37 -33
  116. package/package.json +9 -5
  117. package/report.api.md +508 -0
  118. package/dist/es2019/styled/TableHead.js +0 -160
  119. package/dist/es2019/styled/rankable/RowPlaceholder.js +0 -10
  120. package/dist/types/components/rankable/Body.d.ts +0 -122
  121. package/dist/types/components/rankable/TableCell.d.ts +0 -14
  122. package/dist/types/components/rankable/TableHeadCell.d.ts +0 -5
  123. package/dist/types/components/rankable/TableRow.d.ts +0 -18
@@ -8,131 +8,114 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
8
8
 
9
9
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
10
 
11
+ /* eslint-disable @repo/internal/react/require-jsdoc */
12
+
11
13
  /** @jsx jsx */
12
14
  import { forwardRef } from 'react';
13
15
  import { css, jsx } from '@emotion/core';
14
16
  import { B100, N30A } from '@atlaskit/theme/colors';
15
- import { useGlobalTheme } from '@atlaskit/theme/components';
16
17
  import { gridSize as getGridSize } from '@atlaskit/theme/constants';
17
18
  import { ASC, DESC } from '../internal/constants';
18
- import { arrow, head, MSThemeColors } from '../theme';
19
+ import { arrow, head, MSThemeColors, tableBorder } from '../theme';
19
20
  import { cellStyles, fixedSizeTruncateStyles, getTruncationStyleVars, overflowTruncateStyles, truncationWidthStyles } from './constants';
20
21
  var gridSize = getGridSize();
21
22
  var CSS_VAR_TEXT_COLOR = '--local-dynamic-table-text-color';
22
23
  var rankingStyles = css({
23
24
  display: 'block'
24
25
  });
25
-
26
- var getHeadStyles = function getHeadStyles(theme) {
27
- return css({
28
- borderBottom: "2px solid ".concat(head.borderColor({
29
- theme: theme
30
- }))
31
- });
32
- };
33
-
26
+ var headStyles = css({
27
+ borderBottom: "none"
28
+ });
34
29
  export var Head = function Head(_ref) {
35
30
  var isRanking = _ref.isRanking,
36
31
  props = _objectWithoutProperties(_ref, _excluded);
37
32
 
38
- var theme = useGlobalTheme();
39
33
  return jsx("thead", _extends({
40
- css: [getHeadStyles(theme), isRanking && rankingStyles]
34
+ css: [headStyles, isRanking && rankingStyles] // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
35
+
41
36
  }, props));
42
37
  };
43
38
  var headCellStyles = css([cellStyles, {
44
- border: 'none',
45
39
  boxSizing: 'border-box',
40
+ position: 'relative',
41
+ border: 'none',
42
+ borderBottom: "2px solid ".concat(tableBorder.borderColor),
43
+ color: "var(--ds-text-subtlest, ".concat("var(".concat(CSS_VAR_TEXT_COLOR, ")"), ")"),
46
44
  fontSize: '12px',
47
45
  fontWeight: 600,
48
- position: 'relative',
49
46
  textAlign: 'left',
50
47
  verticalAlign: 'top',
51
- color: "var(--ds-text-subtlest, ".concat("var(".concat(CSS_VAR_TEXT_COLOR, ")"), ")"),
52
48
  '&:focus': {
53
49
  outline: "solid 2px ".concat("var(--ds-border-focused, ".concat(B100, ")"))
54
50
  }
55
- }]); // this needs to be made static: https://product-fabric.atlassian.net/browse/DSP-2011
56
-
57
- export var getArrowStyles = function getArrowStyles(isSortable, sortOrder, theme) {
58
- if (!isSortable) {
59
- return '';
51
+ }]);
52
+ var onClickStyles = css({
53
+ '&:hover': {
54
+ backgroundColor: "var(--ds-background-neutral-hovered, ".concat(N30A, ")"),
55
+ cursor: 'pointer'
60
56
  }
61
-
62
- var pseudoBaseStyles = {
63
- border: '3px solid transparent',
64
- display: 'block',
65
- height: 0,
66
- right: "-".concat(gridSize, "px"),
67
- width: 0,
68
- '@media (forced-colors: active)': {
69
- border: "3px solid ".concat(MSThemeColors.Background)
57
+ });
58
+ var baseStyles = css({
59
+ '& > span': {
60
+ position: 'relative',
61
+ '&::before, &::after': {
62
+ display: 'block',
63
+ width: 0,
64
+ height: 0,
65
+ position: 'absolute',
66
+ right: "-".concat(gridSize, "px"),
67
+ border: '3px solid transparent',
68
+ content: '""'
69
+ },
70
+ '&::before': {
71
+ bottom: '8px',
72
+ borderBottom: "3px solid ".concat(arrow.defaultColor)
73
+ },
74
+ '&::after': {
75
+ bottom: 0,
76
+ borderTop: "3px solid ".concat(arrow.defaultColor)
70
77
  }
71
- };
72
- return css({
78
+ },
79
+ '@media (forced-colors: active)': {
73
80
  '& > span': {
74
- position: 'relative',
75
- '&::before': _objectSpread(_objectSpread({}, pseudoBaseStyles), {}, {
76
- position: 'absolute',
77
- borderBottom: "3px solid ".concat(sortOrder === ASC ? arrow.selectedColor({
78
- theme: theme
79
- }) : arrow.defaultColor({
80
- theme: theme
81
- })),
82
- bottom: '8px',
83
- content: '""'
84
- }),
85
- '&::after': _objectSpread(_objectSpread({}, pseudoBaseStyles), {}, {
86
- position: 'absolute',
87
- borderTop: "3px solid ".concat(sortOrder === DESC ? arrow.selectedColor({
88
- theme: theme
89
- }) : arrow.defaultColor({
90
- theme: theme
91
- })),
92
- bottom: 0,
93
- content: '""'
94
- })
95
- },
96
- '&:hover > span': {
81
+ '&::before, &::after': {
82
+ border: "3px solid ".concat(MSThemeColors.Background)
83
+ },
97
84
  '&::before': {
98
- borderBottom: "3px solid\n ".concat(sortOrder === ASC ? arrow.selectedColor({
99
- theme: theme
100
- }) : arrow.hoverColor({
101
- theme: theme
102
- }))
85
+ borderBottom: "3px solid ".concat(MSThemeColors.Text)
103
86
  },
104
87
  '&::after': {
105
- borderTop: "3px solid\n ".concat(sortOrder === DESC ? arrow.selectedColor({
106
- theme: theme
107
- }) : arrow.hoverColor({
108
- theme: theme
109
- }))
88
+ borderTop: "3px solid ".concat(MSThemeColors.Text)
110
89
  }
111
- },
112
- '@media (forced-colors: active)': {
113
- '& > span': {
114
- '&::before': {
115
- borderBottom: "3px solid\n ".concat(sortOrder === ASC ? MSThemeColors.SelectedBackground : MSThemeColors.Text)
116
- },
117
- '&::after': {
118
- borderTop: "3px solid\n ".concat(sortOrder === DESC ? MSThemeColors.SelectedBackground : MSThemeColors.Text)
119
- }
120
- },
121
- '&:hover > span': {
122
- '&::before': {
123
- borderBottom: "3px solid\n ".concat(sortOrder === ASC ? MSThemeColors.SelectedBackground : MSThemeColors.Text)
124
- },
125
- '&::after': {
126
- borderTop: "3px solid\n ".concat(sortOrder === DESC ? MSThemeColors.SelectedBackground : MSThemeColors.Text)
127
- }
90
+ }
91
+ }
92
+ });
93
+ var ascendingStyles = css({
94
+ '& > span': {
95
+ '&::before': {
96
+ borderBottom: "3px solid ".concat(arrow.selectedColor)
97
+ }
98
+ },
99
+ '@media (forced-colors: active)': {
100
+ '& > span': {
101
+ '&::before': {
102
+ borderBottom: "3px solid ".concat(MSThemeColors.SelectedBackground)
103
+ }
104
+ }
105
+ }
106
+ });
107
+ var descendingStyles = css({
108
+ '& > span': {
109
+ '&::after': {
110
+ borderTop: "3px solid ".concat(arrow.selectedColor)
111
+ }
112
+ },
113
+ '@media (forced-colors: active)': {
114
+ '& > span': {
115
+ '&::after': {
116
+ borderTop: "3px solid ".concat(MSThemeColors.SelectedBackground)
128
117
  }
129
118
  }
130
- });
131
- };
132
- var onClickStyles = css({
133
- '&:hover': {
134
- cursor: 'pointer',
135
- backgroundColor: "var(--ds-background-neutral-hovered, ".concat(N30A, ")")
136
119
  }
137
120
  });
138
121
  export var HeadCell = /*#__PURE__*/forwardRef(function (_ref2, ref) {
@@ -146,17 +129,15 @@ export var HeadCell = /*#__PURE__*/forwardRef(function (_ref2, ref) {
146
129
  style = _ref2.style,
147
130
  rest = _objectWithoutProperties(_ref2, _excluded2);
148
131
 
149
- var theme = useGlobalTheme();
150
-
151
132
  var mergedStyles = _objectSpread(_objectSpread(_objectSpread({}, style), width && getTruncationStyleVars({
152
133
  width: width
153
- })), {}, _defineProperty({}, CSS_VAR_TEXT_COLOR, head.textColor({
154
- theme: theme
155
- })));
134
+ })), {}, _defineProperty({}, CSS_VAR_TEXT_COLOR, head.textColor));
156
135
 
136
+ var isASC = sortOrder === ASC;
137
+ var isDESC = sortOrder === DESC;
157
138
  return jsx("th", _extends({
158
139
  style: mergedStyles,
159
- css: [headCellStyles, onClick && onClickStyles, truncationWidthStyles, isFixedSize && shouldTruncate && fixedSizeTruncateStyles, isFixedSize && overflowTruncateStyles, getArrowStyles(isSortable, sortOrder, theme)],
140
+ css: [headCellStyles, onClick && onClickStyles, truncationWidthStyles, isFixedSize && shouldTruncate && fixedSizeTruncateStyles, isFixedSize && overflowTruncateStyles, isSortable && baseStyles, isASC && ascendingStyles, isDESC && descendingStyles],
160
141
  onClick: onClick,
161
142
  ref: ref
162
143
  }, rest), children);
@@ -5,7 +5,7 @@ var _excluded = ["isHighlighted", "children", "style"];
5
5
  /** @jsx jsx */
6
6
  import { forwardRef } from 'react';
7
7
  import { css, jsx } from '@emotion/core';
8
- import { tableRowCSSVars as cssVars } from './DynamicTable';
8
+ import { tableRowCSSVars as cssVars } from './dynamic-table';
9
9
  var rowStyles = css({
10
10
  '&:focus': {
11
11
  outline: "2px solid ".concat("var(--ds-border-focused, ".concat("var(".concat(cssVars.CSS_VAR_HOVER_BACKGROUND, ")"), ")")),
@@ -22,7 +22,8 @@ var rowHighlightedBackgroundStyles = css({
22
22
  '&:hover': {
23
23
  backgroundColor: "var(--ds-background-selected-hovered, ".concat("var(".concat(cssVars.CSS_VAR_HOVER_HIGHLIGHTED_BACKGROUND, ")"), ")")
24
24
  }
25
- });
25
+ }); // eslint-disable-next-line @repo/internal/react/require-jsdoc
26
+
26
27
  export var TableBodyRow = /*#__PURE__*/forwardRef(function (_ref, ref) {
27
28
  var isHighlighted = _ref.isHighlighted,
28
29
  children = _ref.children,
package/dist/esm/theme.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import * as colors from '@atlaskit/theme/colors';
2
- import { themed } from '@atlaskit/theme/components';
3
2
  export var MSThemeColors = {
4
3
  Background: 'Canvas',
5
4
  Text: 'CanvasText',
@@ -7,44 +6,18 @@ export var MSThemeColors = {
7
6
  SelectedText: 'HighlightText'
8
7
  };
9
8
  export var arrow = {
10
- defaultColor: themed({
11
- light: "var(--ds-icon-disabled, ".concat(colors.N40, ")"),
12
- dark: "var(--ds-icon-disabled, ".concat(colors.DN40, ")")
13
- }),
14
- selectedColor: themed({
15
- light: "var(--ds-icon-subtle, ".concat(colors.N300, ")"),
16
- dark: "var(--ds-icon-subtle, ".concat(colors.DN300, ")")
17
- }),
18
- hoverColor: themed({
19
- light: "var(--ds-icon-disabled, ".concat(colors.N60, ")"),
20
- dark: "var(--ds-icon-disabled, ".concat(colors.DN60, ")")
21
- })
9
+ defaultColor: "var(--ds-icon-disabled, ".concat(colors.N40, ")"),
10
+ selectedColor: "var(--ds-icon-subtle, ".concat(colors.N300, ")")
22
11
  };
23
12
  export var row = {
24
- focusOutline: themed({
25
- light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
26
- dark: "var(--ds-border-focused, ".concat(colors.B100, ")")
27
- }),
28
- highlightedBackground: themed({
29
- light: "var(--ds-background-selected, ".concat(colors.B50, ")"),
30
- dark: "var(--ds-background-selected, ".concat(colors.DN50, ")")
31
- }),
32
- hoverBackground: themed({
33
- light: "var(--ds-background-neutral-subtle-hovered, ".concat(colors.N10, ")"),
34
- dark: "var(--ds-background-neutral-subtle-hovered, ".concat(colors.DN40, ")")
35
- }),
36
- hoverHighlightedBackground: themed({
37
- light: "var(--ds-background-selected-hovered, ".concat(colors.B75, ")"),
38
- dark: "var(--ds-background-selected-hovered, ".concat(colors.DN60, ")")
39
- })
13
+ focusOutline: "var(--ds-border-focused, ".concat(colors.B100, ")"),
14
+ highlightedBackground: "var(--ds-background-selected, ".concat(colors.B50, ")"),
15
+ hoverBackground: "var(--ds-background-neutral-subtle-hovered, ".concat(colors.N10, ")"),
16
+ hoverHighlightedBackground: "var(--ds-background-selected-hovered, ".concat(colors.B75, ")")
40
17
  };
41
18
  export var head = {
42
- borderColor: themed({
43
- light: "var(--ds-border, ".concat(colors.N40, ")"),
44
- dark: "var(--ds-border, ".concat(colors.DN50, ")")
45
- }),
46
- textColor: themed({
47
- light: "var(--ds-text-subtlest, ".concat(colors.N300, ")"),
48
- dark: "var(--ds-text-subtlest, ".concat(colors.DN300, ")")
49
- })
19
+ textColor: "var(--ds-text-subtlest, ".concat(colors.N300, ")")
20
+ };
21
+ export var tableBorder = {
22
+ borderColor: "var(--ds-border, ".concat(colors.N40, ")")
50
23
  };
package/dist/esm/types.js CHANGED
@@ -1 +1,2 @@
1
+ /* eslint-disable @repo/internal/react/consistent-types-definitions */
1
2
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.6.0",
3
+ "version": "14.7.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,19 +1,19 @@
1
1
  import React from 'react';
2
- import { WithSortedPageRowsProps } from '../hoc/withSortedPageRows';
2
+ import { WithSortedPageRowsProps } from '../hoc/with-sorted-page-rows';
3
3
  import { HeadType } from '../types';
4
- interface Props extends WithSortedPageRowsProps {
4
+ interface BodyProps extends WithSortedPageRowsProps {
5
5
  head?: HeadType;
6
6
  highlightedRowIndex?: number | number[];
7
7
  isFixedSize: boolean;
8
8
  testId?: string;
9
9
  }
10
10
  declare const _default: {
11
- new (props: Readonly<Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">>): {
11
+ new (props: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>): {
12
12
  state: {
13
13
  pageRows: never[];
14
14
  };
15
15
  componentDidMount(): void;
16
- componentDidUpdate(_prevProps: Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">, prevState: {
16
+ componentDidUpdate(_prevProps: Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">, prevState: {
17
17
  pageRows: import("../types").RowType[];
18
18
  }): void;
19
19
  render(): JSX.Element;
@@ -22,7 +22,7 @@ declare const _default: {
22
22
  pageRows: import("../types").RowType[];
23
23
  } | ((prevState: Readonly<{
24
24
  pageRows: import("../types").RowType[];
25
- }>, props: Readonly<Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">>) => {
25
+ }>, props: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>) => {
26
26
  pageRows: import("../types").RowType[];
27
27
  } | Pick<{
28
28
  pageRows: import("../types").RowType[];
@@ -30,37 +30,37 @@ declare const _default: {
30
30
  pageRows: import("../types").RowType[];
31
31
  }, K> | null, callback?: (() => void) | undefined): void;
32
32
  forceUpdate(callBack?: (() => void) | undefined): void;
33
- readonly props: Readonly<Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">> & Readonly<{
33
+ readonly props: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">> & Readonly<{
34
34
  children?: React.ReactNode;
35
35
  }>;
36
36
  refs: {
37
37
  [key: string]: React.ReactInstance;
38
38
  };
39
- shouldComponentUpdate?(nextProps: Readonly<Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">>, nextState: Readonly<{
39
+ shouldComponentUpdate?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
40
40
  pageRows: import("../types").RowType[];
41
41
  }>, nextContext: any): boolean;
42
42
  componentWillUnmount?(): void;
43
43
  componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
44
- getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">>, prevState: Readonly<{
44
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, prevState: Readonly<{
45
45
  pageRows: import("../types").RowType[];
46
46
  }>): any;
47
47
  componentWillMount?(): void;
48
48
  UNSAFE_componentWillMount?(): void;
49
- componentWillReceiveProps?(nextProps: Readonly<Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">>, nextContext: any): void;
50
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">>, nextContext: any): void;
51
- componentWillUpdate?(nextProps: Readonly<Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">>, nextState: Readonly<{
49
+ componentWillReceiveProps?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextContext: any): void;
50
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextContext: any): void;
51
+ componentWillUpdate?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
52
52
  pageRows: import("../types").RowType[];
53
53
  }>, nextContext: any): void;
54
- UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">>, nextState: Readonly<{
54
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
55
55
  pageRows: import("../types").RowType[];
56
56
  }>, nextContext: any): void;
57
57
  };
58
- new (props: Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">, context?: any): {
58
+ new (props: Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">, context?: any): {
59
59
  state: {
60
60
  pageRows: never[];
61
61
  };
62
62
  componentDidMount(): void;
63
- componentDidUpdate(_prevProps: Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">, prevState: {
63
+ componentDidUpdate(_prevProps: Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">, prevState: {
64
64
  pageRows: import("../types").RowType[];
65
65
  }): void;
66
66
  render(): JSX.Element;
@@ -69,7 +69,7 @@ declare const _default: {
69
69
  pageRows: import("../types").RowType[];
70
70
  } | ((prevState: Readonly<{
71
71
  pageRows: import("../types").RowType[];
72
- }>, props: Readonly<Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">>) => {
72
+ }>, props: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>) => {
73
73
  pageRows: import("../types").RowType[];
74
74
  } | Pick<{
75
75
  pageRows: import("../types").RowType[];
@@ -77,32 +77,32 @@ declare const _default: {
77
77
  pageRows: import("../types").RowType[];
78
78
  }, K> | null, callback?: (() => void) | undefined): void;
79
79
  forceUpdate(callBack?: (() => void) | undefined): void;
80
- readonly props: Readonly<Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">> & Readonly<{
80
+ readonly props: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">> & Readonly<{
81
81
  children?: React.ReactNode;
82
82
  }>;
83
83
  refs: {
84
84
  [key: string]: React.ReactInstance;
85
85
  };
86
- shouldComponentUpdate?(nextProps: Readonly<Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">>, nextState: Readonly<{
86
+ shouldComponentUpdate?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
87
87
  pageRows: import("../types").RowType[];
88
88
  }>, nextContext: any): boolean;
89
89
  componentWillUnmount?(): void;
90
90
  componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
91
- getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">>, prevState: Readonly<{
91
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, prevState: Readonly<{
92
92
  pageRows: import("../types").RowType[];
93
93
  }>): any;
94
94
  componentWillMount?(): void;
95
95
  UNSAFE_componentWillMount?(): void;
96
- componentWillReceiveProps?(nextProps: Readonly<Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">>, nextContext: any): void;
97
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">>, nextContext: any): void;
98
- componentWillUpdate?(nextProps: Readonly<Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">>, nextState: Readonly<{
96
+ componentWillReceiveProps?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextContext: any): void;
97
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextContext: any): void;
98
+ componentWillUpdate?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
99
99
  pageRows: import("../types").RowType[];
100
100
  }>, nextContext: any): void;
101
- UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">>, nextState: Readonly<{
101
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
102
102
  pageRows: import("../types").RowType[];
103
103
  }>, nextContext: any): void;
104
104
  };
105
- getDerivedStateFromProps(props: Omit<Props & import("../hoc/withSortedPageRows").Props, "pageRows">, state: {
105
+ getDerivedStateFromProps(props: Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">, state: {
106
106
  pageRows: import("../types").RowType[];
107
107
  }): {
108
108
  pageRows: import("../types").RowType[];
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { SpinnerSizeType } from '../types';
3
- export interface Props {
3
+ export interface LoadingContainerAdvancedProps {
4
4
  children: React.ReactElement<any>;
5
5
  isLoading?: boolean;
6
6
  spinnerSize?: SpinnerSizeType;
@@ -8,7 +8,7 @@ export interface Props {
8
8
  targetRef?: () => HTMLDivElement | undefined;
9
9
  testId?: string;
10
10
  }
11
- export default class LoadingContainerAdvanced extends React.Component<Props, {}> {
11
+ export default class LoadingContainerAdvanced extends React.Component<LoadingContainerAdvancedProps, {}> {
12
12
  children?: HTMLElement;
13
13
  spinnerRef?: HTMLDivElement;
14
14
  static defaultProps: {
@@ -17,13 +17,13 @@ export default class LoadingContainerAdvanced extends React.Component<Props, {}>
17
17
  contentsOpacity: number;
18
18
  };
19
19
  componentDidMount: () => void;
20
- UNSAFE_componentWillReceiveProps: (nextProps: Props) => void;
20
+ UNSAFE_componentWillReceiveProps: (nextProps: LoadingContainerAdvancedProps) => void;
21
21
  componentDidUpdate: () => void;
22
22
  componentWillUnmount: () => void;
23
- getTargetNode: (nextProps?: Props) => Element | Text | null;
23
+ getTargetNode: (nextProps?: LoadingContainerAdvancedProps) => Element | Text | null;
24
24
  getThisNode: () => Element | Text | null;
25
25
  getSpinnerNode: () => Element | Text | null;
26
- hasTargetNode: (nextProps?: Props | undefined) => boolean;
26
+ hasTargetNode: (nextProps?: LoadingContainerAdvancedProps | undefined) => boolean;
27
27
  isVerticallyVisible: (elementRect: {
28
28
  top: number;
29
29
  bottom: number;
@@ -0,0 +1,122 @@
1
+ import React from 'react';
2
+ import { DragStart, DropResult } from 'react-beautiful-dnd';
3
+ import { WithSortedPageRowsProps } from '../../hoc/with-sorted-page-rows';
4
+ import { HeadType, RankEnd, RankStart, RowType } from '../../types';
5
+ export interface RankableBodyProps extends WithSortedPageRowsProps {
6
+ highlightedRowIndex?: number | number[];
7
+ onRankStart: (rankStart: RankStart) => void;
8
+ onRankEnd: (rankEnd: RankEnd) => void;
9
+ isFixedSize: boolean;
10
+ isRanking: boolean;
11
+ isRankingDisabled: boolean;
12
+ head?: HeadType;
13
+ testId?: string;
14
+ }
15
+ export declare class RankableBody extends React.Component<RankableBodyProps, {}> {
16
+ onBeforeDragStart: (dragStart: DragStart) => void;
17
+ onDragEnd: (result: DropResult) => void;
18
+ render(): JSX.Element;
19
+ }
20
+ declare const _default: {
21
+ new (props: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>): {
22
+ state: {
23
+ pageRows: never[];
24
+ };
25
+ componentDidMount(): void;
26
+ componentDidUpdate(_prevProps: Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">, prevState: {
27
+ pageRows: RowType[];
28
+ }): void;
29
+ render(): JSX.Element;
30
+ context: any;
31
+ setState<K extends "pageRows">(state: {
32
+ pageRows: RowType[];
33
+ } | ((prevState: Readonly<{
34
+ pageRows: RowType[];
35
+ }>, props: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>) => {
36
+ pageRows: RowType[];
37
+ } | Pick<{
38
+ pageRows: RowType[];
39
+ }, K> | null) | Pick<{
40
+ pageRows: RowType[];
41
+ }, K> | null, callback?: (() => void) | undefined): void;
42
+ forceUpdate(callBack?: (() => void) | undefined): void;
43
+ readonly props: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">> & Readonly<{
44
+ children?: React.ReactNode;
45
+ }>;
46
+ refs: {
47
+ [key: string]: React.ReactInstance;
48
+ };
49
+ shouldComponentUpdate?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
50
+ pageRows: RowType[];
51
+ }>, nextContext: any): boolean;
52
+ componentWillUnmount?(): void;
53
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
54
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, prevState: Readonly<{
55
+ pageRows: RowType[];
56
+ }>): any;
57
+ componentWillMount?(): void;
58
+ UNSAFE_componentWillMount?(): void;
59
+ componentWillReceiveProps?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextContext: any): void;
60
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextContext: any): void;
61
+ componentWillUpdate?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
62
+ pageRows: RowType[];
63
+ }>, nextContext: any): void;
64
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
65
+ pageRows: RowType[];
66
+ }>, nextContext: any): void;
67
+ };
68
+ new (props: Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">, context?: any): {
69
+ state: {
70
+ pageRows: never[];
71
+ };
72
+ componentDidMount(): void;
73
+ componentDidUpdate(_prevProps: Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">, prevState: {
74
+ pageRows: RowType[];
75
+ }): void;
76
+ render(): JSX.Element;
77
+ context: any;
78
+ setState<K extends "pageRows">(state: {
79
+ pageRows: RowType[];
80
+ } | ((prevState: Readonly<{
81
+ pageRows: RowType[];
82
+ }>, props: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>) => {
83
+ pageRows: RowType[];
84
+ } | Pick<{
85
+ pageRows: RowType[];
86
+ }, K> | null) | Pick<{
87
+ pageRows: RowType[];
88
+ }, K> | null, callback?: (() => void) | undefined): void;
89
+ forceUpdate(callBack?: (() => void) | undefined): void;
90
+ readonly props: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">> & Readonly<{
91
+ children?: React.ReactNode;
92
+ }>;
93
+ refs: {
94
+ [key: string]: React.ReactInstance;
95
+ };
96
+ shouldComponentUpdate?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
97
+ pageRows: RowType[];
98
+ }>, nextContext: any): boolean;
99
+ componentWillUnmount?(): void;
100
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
101
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, prevState: Readonly<{
102
+ pageRows: RowType[];
103
+ }>): any;
104
+ componentWillMount?(): void;
105
+ UNSAFE_componentWillMount?(): void;
106
+ componentWillReceiveProps?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextContext: any): void;
107
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextContext: any): void;
108
+ componentWillUpdate?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
109
+ pageRows: RowType[];
110
+ }>, nextContext: any): void;
111
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
112
+ pageRows: RowType[];
113
+ }>, nextContext: any): void;
114
+ };
115
+ getDerivedStateFromProps(props: Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">, state: {
116
+ pageRows: RowType[];
117
+ }): {
118
+ pageRows: RowType[];
119
+ };
120
+ contextType?: React.Context<any> | undefined;
121
+ };
122
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { WithDimensionsProps } from '../../hoc/with-dimensions';
3
+ import { HeadCellType, RowCellType } from '../../types';
4
+ export interface RankableTableCellProps extends WithDimensionsProps {
5
+ head?: HeadCellType;
6
+ cell: RowCellType;
7
+ isFixedSize: boolean;
8
+ testId?: string;
9
+ }
10
+ export declare class RankableTableCell extends React.Component<RankableTableCellProps, {}> {
11
+ render(): JSX.Element;
12
+ }
13
+ declare const _default: React.ComponentClass<Omit<RankableTableCellProps, "innerRef" | "refWidth" | "refHeight">, import("../../hoc/with-dimensions").State>;
14
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { WithDimensionsProps } from '../../hoc/with-dimensions';
3
+ import { TableHeadCellProps } from '../table-head-cell';
4
+ declare const _default: React.ComponentClass<Omit<WithDimensionsProps & TableHeadCellProps, "innerRef" | "refWidth" | "refHeight">, import("../../hoc/with-dimensions").State>;
5
+ export default _default;