@atlaskit/table-tree 9.7.0 → 9.8.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/table-tree
2
2
 
3
+ ## 9.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#87326](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87326) [`a79d6ea51b5a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a79d6ea51b5a) - Introducing props `label` and `referencedLabel` to provide/reference accessible name for TableTree.
8
+
9
+ ## 9.7.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#83297](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83297) [`6b1707c169e0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6b1707c169e0) - The internal composition of this component has changed. There is no expected change in behaviour.
14
+
3
15
  ## 9.7.0
4
16
 
5
17
  ### Minor Changes
@@ -39,6 +39,7 @@ var commonCellElementStyles = (0, _react.css)({
39
39
  var commonChevronContainerStyles = (0, _react.css)({
40
40
  // Aligns position:absolute chevron button with the adjacent text. Any future visual breaking changes
41
41
  // should consider setting this to `-2px` for better alignment, or refactor completely
42
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
42
43
  marginBlockStart: -3
43
44
  });
44
45
  /**
@@ -55,7 +56,7 @@ var loadingItemContainerStyles = (0, _react.css)({
55
56
  width: '100%'
56
57
  });
57
58
  var paddingLeftStyles = (0, _react.css)({
58
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
59
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
59
60
  paddingInlineStart: '50%'
60
61
  });
61
62
  /**
@@ -28,7 +28,7 @@ var treeRowClickableStyles = (0, _react2.css)({
28
28
  cursor: 'pointer'
29
29
  });
30
30
  var packageName = "@atlaskit/table-tree";
31
- var packageVersion = "9.7.0";
31
+ var packageVersion = "9.8.0";
32
32
  var Row = exports.RowWithoutAnalytics = /*#__PURE__*/function (_Component) {
33
33
  (0, _inherits2.default)(Row, _Component);
34
34
  var _super = _createSuper(Row);
@@ -67,6 +67,8 @@ var TableTree = exports.default = /*#__PURE__*/function (_Component) {
67
67
  value: function render() {
68
68
  var _this$props = this.props,
69
69
  items = _this$props.items,
70
+ label = _this$props.label,
71
+ referencedLabel = _this$props.referencedLabel,
70
72
  shouldExpandOnClick = _this$props.shouldExpandOnClick,
71
73
  headers = _this$props.headers,
72
74
  columns = _this$props.columns,
@@ -118,7 +120,9 @@ var TableTree = exports.default = /*#__PURE__*/function (_Component) {
118
120
  }
119
121
  }, /*#__PURE__*/_react.default.createElement("div", {
120
122
  role: "treegrid",
121
- "aria-readonly": true
123
+ "aria-readonly": true,
124
+ "aria-label": label,
125
+ "aria-labelledby": referencedLabel
122
126
  }, heads, rows, this.props.children));
123
127
  }
124
128
  }]);
@@ -28,6 +28,7 @@ const commonCellElementStyles = css({
28
28
  const commonChevronContainerStyles = css({
29
29
  // Aligns position:absolute chevron button with the adjacent text. Any future visual breaking changes
30
30
  // should consider setting this to `-2px` for better alignment, or refactor completely
31
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
31
32
  marginBlockStart: -3
32
33
  });
33
34
  /**
@@ -42,7 +43,7 @@ const loadingItemContainerStyles = css({
42
43
  width: '100%'
43
44
  });
44
45
  const paddingLeftStyles = css({
45
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
46
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
46
47
  paddingInlineStart: '50%'
47
48
  });
48
49
  /**
@@ -12,7 +12,7 @@ const treeRowClickableStyles = css({
12
12
  cursor: 'pointer'
13
13
  });
14
14
  const packageName = "@atlaskit/table-tree";
15
- const packageVersion = "9.7.0";
15
+ const packageVersion = "9.8.0";
16
16
  class Row extends Component {
17
17
  constructor(...args) {
18
18
  super(...args);
@@ -40,6 +40,8 @@ export default class TableTree extends Component {
40
40
  render() {
41
41
  const {
42
42
  items,
43
+ label,
44
+ referencedLabel,
43
45
  shouldExpandOnClick,
44
46
  headers,
45
47
  columns,
@@ -87,7 +89,9 @@ export default class TableTree extends Component {
87
89
  }
88
90
  }, /*#__PURE__*/React.createElement("div", {
89
91
  role: "treegrid",
90
- "aria-readonly": true
92
+ "aria-readonly": true,
93
+ "aria-label": label,
94
+ "aria-labelledby": referencedLabel
91
95
  }, heads, rows, this.props.children));
92
96
  }
93
97
  }
@@ -33,6 +33,7 @@ var commonCellElementStyles = css({
33
33
  var commonChevronContainerStyles = css({
34
34
  // Aligns position:absolute chevron button with the adjacent text. Any future visual breaking changes
35
35
  // should consider setting this to `-2px` for better alignment, or refactor completely
36
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
36
37
  marginBlockStart: -3
37
38
  });
38
39
  /**
@@ -49,7 +50,7 @@ var loadingItemContainerStyles = css({
49
50
  width: '100%'
50
51
  });
51
52
  var paddingLeftStyles = css({
52
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
53
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
53
54
  paddingInlineStart: '50%'
54
55
  });
55
56
  /**
@@ -20,7 +20,7 @@ var treeRowClickableStyles = css({
20
20
  cursor: 'pointer'
21
21
  });
22
22
  var packageName = "@atlaskit/table-tree";
23
- var packageVersion = "9.7.0";
23
+ var packageVersion = "9.8.0";
24
24
  var Row = /*#__PURE__*/function (_Component) {
25
25
  _inherits(Row, _Component);
26
26
  var _super = _createSuper(Row);
@@ -58,6 +58,8 @@ var TableTree = /*#__PURE__*/function (_Component) {
58
58
  value: function render() {
59
59
  var _this$props = this.props,
60
60
  items = _this$props.items,
61
+ label = _this$props.label,
62
+ referencedLabel = _this$props.referencedLabel,
61
63
  shouldExpandOnClick = _this$props.shouldExpandOnClick,
62
64
  headers = _this$props.headers,
63
65
  columns = _this$props.columns,
@@ -109,7 +111,9 @@ var TableTree = /*#__PURE__*/function (_Component) {
109
111
  }
110
112
  }, /*#__PURE__*/React.createElement("div", {
111
113
  role: "treegrid",
112
- "aria-readonly": true
114
+ "aria-readonly": true,
115
+ "aria-label": label,
116
+ "aria-labelledby": referencedLabel
113
117
  }, heads, rows, this.props.children));
114
118
  }
115
119
  }]);
@@ -61,6 +61,16 @@ type TableTreeProps = {
61
61
  * Should be a number when we pass data via `<Rows />` component as children in `<TableTree />`.
62
62
  */
63
63
  mainColumnForExpandCollapseLabel?: string | number;
64
+ /**
65
+ * Refers to an `aria-label` attribute. Use label to describe the table for assistive technologies.
66
+ * Usage of either this, or the `labelId` attribute is strongly recommended.
67
+ */
68
+ label?: string;
69
+ /**
70
+ * Refers to an `aria-labelledby` attribute. Pass an id of the element which should define an accessible name for the table.
71
+ * Usage of either this, or the `label` attribute is strongly recommended.
72
+ */
73
+ referencedLabel?: string;
64
74
  };
65
75
 
66
76
  export default function (props: TableTreeProps) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/table-tree",
3
- "version": "9.7.0",
3
+ "version": "9.8.0",
4
4
  "description": "A table tree is an expandable table for showing nested hierarchies of information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -27,11 +27,11 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@atlaskit/analytics-next": "^9.2.0",
30
- "@atlaskit/button": "^17.7.0",
30
+ "@atlaskit/button": "^17.11.0",
31
31
  "@atlaskit/icon": "^22.1.0",
32
32
  "@atlaskit/spinner": "^16.0.0",
33
- "@atlaskit/theme": "^12.6.0",
34
- "@atlaskit/tokens": "^1.41.0",
33
+ "@atlaskit/theme": "^12.7.0",
34
+ "@atlaskit/tokens": "^1.43.0",
35
35
  "@babel/runtime": "^7.0.0",
36
36
  "@emotion/react": "^11.7.1",
37
37
  "lodash": "^4.17.21"
@@ -96,4 +96,4 @@
96
96
  ".": "./src/index.tsx"
97
97
  },
98
98
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
99
- }
99
+ }