@atlaskit/table-tree 9.8.0 → 9.9.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.
@@ -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.8.0";
31
+ var packageVersion = "9.9.0";
32
32
  var Row = exports.RowWithoutAnalytics = /*#__PURE__*/function (_Component) {
33
33
  (0, _inherits2.default)(Row, _Component);
34
34
  var _super = _createSuper(Row);
@@ -12,7 +12,7 @@ const treeRowClickableStyles = css({
12
12
  cursor: 'pointer'
13
13
  });
14
14
  const packageName = "@atlaskit/table-tree";
15
- const packageVersion = "9.8.0";
15
+ const packageVersion = "9.9.0";
16
16
  class Row extends Component {
17
17
  constructor(...args) {
18
18
  super(...args);
@@ -20,7 +20,7 @@ var treeRowClickableStyles = css({
20
20
  cursor: 'pointer'
21
21
  });
22
22
  var packageName = "@atlaskit/table-tree";
23
- var packageVersion = "9.8.0";
23
+ var packageVersion = "9.9.0";
24
24
  var Row = /*#__PURE__*/function (_Component) {
25
25
  _inherits(Row, _Component);
26
26
  var _super = _createSuper(Row);
@@ -1,23 +1,23 @@
1
1
  import { ReactNode } from 'react';
2
2
  export interface CellProps {
3
3
  /**
4
- * Whether the cell contents should wrap or display on a single line and be concatenated.
4
+ * Sets whether the cell contents should wrap or display on a single line and be truncated. For accessibility reasons, wrapping the content is strongly recommended.
5
5
  */
6
6
  singleLine?: boolean;
7
7
  /**
8
- * Indent level for the cell. Each indent level adds 25px to the left padding.
8
+ * Sets the indent level for the cell. Each indent level adds `25px` to the left padding.
9
9
  */
10
10
  indentLevel?: number;
11
11
  /**
12
- * Width of the header item. Takes a string or a number representing the width in pixels.
12
+ * The width of the header item. Takes a string, or a number representing the width in pixels.
13
13
  */
14
14
  width?: number | string;
15
15
  /**
16
- * Class name to apply to cell.
16
+ * Class name to apply to the cell.
17
17
  */
18
18
  className?: string;
19
19
  /**
20
- * Children content, used when composing table-tree from internal components
20
+ * Children content, used when composing a table tree from internal components
21
21
  */
22
22
  children?: ReactNode;
23
23
  }
@@ -1,23 +1,23 @@
1
1
  import { ReactNode } from 'react';
2
2
  export interface CellProps {
3
3
  /**
4
- * Whether the cell contents should wrap or display on a single line and be concatenated.
4
+ * Sets whether the cell contents should wrap or display on a single line and be truncated. For accessibility reasons, wrapping the content is strongly recommended.
5
5
  */
6
6
  singleLine?: boolean;
7
7
  /**
8
- * Indent level for the cell. Each indent level adds 25px to the left padding.
8
+ * Sets the indent level for the cell. Each indent level adds `25px` to the left padding.
9
9
  */
10
10
  indentLevel?: number;
11
11
  /**
12
- * Width of the header item. Takes a string or a number representing the width in pixels.
12
+ * The width of the header item. Takes a string, or a number representing the width in pixels.
13
13
  */
14
14
  width?: number | string;
15
15
  /**
16
- * Class name to apply to cell.
16
+ * Class name to apply to the cell.
17
17
  */
18
18
  className?: string;
19
19
  /**
20
- * Children content, used when composing table-tree from internal components
20
+ * Children content, used when composing a table tree from internal components
21
21
  */
22
22
  children?: ReactNode;
23
23
  }
@@ -16,7 +16,7 @@ type RowProps = {
16
16
  */
17
17
  hasChildren?: boolean;
18
18
  /**
19
- * Children contained in the row. Should be one or more Cell components.
19
+ * Children contained in the row. Should be one or more cell components.
20
20
  */
21
21
  children?: React.ReactNode;
22
22
  /**
@@ -41,49 +41,49 @@ type RowProps = {
41
41
  */
42
42
  isDefaultExpanded?: ReactNode;
43
43
  /**
44
- * Visually hidden text placed inside the expand chevron button.
44
+ * This is the accessible name for the expand chevron button, used to tell assistive technology what the button is for.
45
45
  */
46
46
  expandLabel?: string;
47
47
  /**
48
- * Visually hidden text placed inside the collapse chevron button.
48
+ * This is the accessible name for the collapse chevron button, used to tell assistive technology what the button is for.
49
49
  */
50
50
  collapseLabel?: string;
51
51
  /**
52
- * Callback called when row collapses.
52
+ * Callback called when the row collapses.
53
53
  */
54
54
  onCollapse?: (data: Item) => void;
55
55
  /**
56
- * Callback called when row expands.
56
+ * Callback called when the row expands.
57
57
  */
58
58
  onExpand?: (data: Item) => void;
59
59
  /**
60
- * Children to render under row.
61
- * Normally set by parent Item component and does not need to be configured.
60
+ * Children to render under the row.
61
+ * This is normally set by the parent item component, and doesn't need to be configured.
62
62
  */
63
63
  renderChildren?: () => React.ReactNode;
64
64
  /**
65
- Whether a row with children should expand when clicked anywhere within the row. If false or unset, a row with children will only expand when the chevron is clicked.
65
+ Use this to set whether a row with children should expand when clicked anywhere within the row. If `false` or unset, a row with children will only expand when the chevron is clicked.
66
66
 
67
- If your cells contain interactive elements, this can cause unexpected expanding or collapsing.
67
+ If your cells contain interactive elements, always set this to `false` to avoid unexpected expanding or collapsing.
68
68
  */
69
69
  shouldExpandOnClick?: boolean;
70
70
  /**
71
- * Data to render. Passed down by Item and passed into onExpand and onCollapse callbacks.
72
- * Normally set by parent Item component and does not need to be configured.
71
+ * Data to render. Passed down by `item` and passed into `onExpand` and `onCollapse` callbacks.
72
+ * This is normally set by the parent `item` component, and doesn't need to be configured.
73
73
  */
74
74
  // eslint-disable-next-line @repo/internal/react/consistent-props-definitions
75
75
  data?: Item;
76
76
  /**
77
- * Depth used for rendering indent.
78
- * Normally set by parent Item component and does not need to be configured.
77
+ * The depth used for rendering an indent.
78
+ * This is normally set by parent `item` component, and doesn't need to be configured.
79
79
  */
80
80
  depth?: number;
81
81
  /**
82
82
  Adds detail to the expand and collapse row button's aria label by appending the value from the given column. If you don't set this prop, the aria label will read out "Expand `itemId` row".
83
83
 
84
- Should be a string when we pass data via `items` property in `<TableTree />`, value should be one of the property `columns` names in `<TableTree />`.
84
+ Should be a string when we pass data via `items` property in the table tree. The value should be one of the property `columns` names in the table tree.
85
85
 
86
- Should be a number when we pass data via `<Rows />` component as children in `<TableTree />`.
86
+ Should be a number when we pass data via the `Rows` component as children in the table tree.
87
87
  */
88
88
  mainColumnForExpandCollapseLabel?: string | number;
89
89
  };
@@ -20,8 +20,8 @@ type RowsProps = {
20
20
  items?: Item[] | null;
21
21
  /* eslint-enable jsdoc/require-asterisk-prefix, jsdoc/check-alignment */
22
22
  /**
23
- * Accessible name for loading states spinner. Can be used for internationalization.
24
- * Default is "Loading".
23
+ * This is an accessible name for the loading state's spinner.
24
+ * The default text is "Loading".
25
25
  */
26
26
  loadingLabel?: string | null;
27
27
  /**
@@ -18,9 +18,9 @@ export type Item = {
18
18
  */
19
19
  type TableTreeProps = {
20
20
  /**
21
- * The contents of the table,
22
- * used when composing `Cell`, `Header`, `Headers`, `Row`, and `Rows` components.
23
- * For basic usage, you can instead specify table contents with the `items` prop.
21
+ * The contents of the table.
22
+ * Use this when composing `Cell`, `Header`, `Headers`, `Row`, and `Rows` components.
23
+ * For basic usage, it's simpler to specify table contents with the `items` prop instead.
24
24
  */
25
25
  children?: ReactNode;
26
26
  /**
@@ -29,45 +29,44 @@ type TableTreeProps = {
29
29
  */
30
30
  columns?: ElementType<Content>[];
31
31
  /**
32
- * The widths of the respective columns in the table.
32
+ * The widths of the columns in the table.
33
33
  */
34
34
  columnWidths?: (string | number)[];
35
35
  /**
36
- * The header text of the respective columns of the table.
36
+ * The header text of the columns of the table.
37
37
  */
38
38
  headers?: string[];
39
39
  /* eslint-disable jsdoc/require-asterisk-prefix, jsdoc/check-alignment */
40
40
  /**
41
- Whether a row with children should expand when clicked anywhere within the row. If false or unset, a row with children will only expand when the chevron is clicked.
41
+ Use this to set whether a row with children should expand when clicked anywhere within the row. If `false` or unset, a row with children will only expand when the chevron is clicked.
42
42
 
43
- If your cells contain interactive elements, this can cause unexpected expanding or collapsing.
43
+ If your cells contain interactive elements, always set this to `false` to avoid unexpected expanding or collapsing.
44
44
 
45
- If not using the `items` prop, `shouldExpandOnClick` should be used on the row component instead.
45
+ If you aren’t using the `items` prop, `shouldExpandOnClick` should be used on the row component instead.
46
46
  */
47
47
  shouldExpandOnClick?: boolean;
48
48
  /**
49
- The data used to render the table.
49
+ The data used to render the table. If you’re creating a basic table, use this prop instead of composing cell, header, headers, row, and rows components.
50
50
 
51
- In addition to these props, any other data can be added, and it will
51
+ In addition to the `items` props, any other data can be added, and it will
52
52
  be provided as props when rendering each cell.
53
53
  */
54
54
  // eslint-disable-next-line @repo/internal/react/consistent-props-definitions
55
55
  items?: Item[] | null;
56
56
  /* eslint-enable jsdoc/require-asterisk-prefix, jsdoc/check-alignment */
57
57
  /**
58
- * The value used to extend the expand or collapse button label in cases where `Row` has child rows.
59
- *
60
- * Should be a string when we pass data via `items` property, value should be one of the `columns` names.
61
- * Should be a number when we pass data via `<Rows />` component as children in `<TableTree />`.
58
+ * The value used to extend the expand or collapse button label in cases where `row` has child rows.
59
+ * It should be a string when we pass data via the `items` property, the value should be one of the `columns` names.
60
+ * It should be a number when we pass data via the `rows` component as children in the table tree.
62
61
  */
63
62
  mainColumnForExpandCollapseLabel?: string | number;
64
63
  /**
65
- * Refers to an `aria-label` attribute. Use label to describe the table for assistive technologies.
64
+ * This is an `aria-label` attribute. Use the label to describe the table for assistive technologies.
66
65
  * Usage of either this, or the `labelId` attribute is strongly recommended.
67
66
  */
68
67
  label?: string;
69
68
  /**
70
- * Refers to an `aria-labelledby` attribute. Pass an id of the element which should define an accessible name for the table.
69
+ * This is an `aria-labelledby` attribute. Pass an ID for the element which should define an accessible name for the table.
71
70
  * Usage of either this, or the `label` attribute is strongly recommended.
72
71
  */
73
72
  referencedLabel?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/table-tree",
3
- "version": "9.8.0",
3
+ "version": "9.9.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/"
@@ -23,29 +23,30 @@
23
23
  "website": {
24
24
  "name": "Table tree",
25
25
  "category": "Components"
26
- }
26
+ },
27
+ "runReact18": true
27
28
  },
28
29
  "dependencies": {
29
- "@atlaskit/analytics-next": "^9.2.0",
30
- "@atlaskit/button": "^17.11.0",
31
- "@atlaskit/icon": "^22.1.0",
32
- "@atlaskit/spinner": "^16.0.0",
33
- "@atlaskit/theme": "^12.7.0",
34
- "@atlaskit/tokens": "^1.43.0",
30
+ "@atlaskit/analytics-next": "^9.3.0",
31
+ "@atlaskit/button": "^17.14.0",
32
+ "@atlaskit/icon": "^22.2.0",
33
+ "@atlaskit/spinner": "^16.1.0",
34
+ "@atlaskit/theme": "^12.8.0",
35
+ "@atlaskit/tokens": "^1.48.0",
35
36
  "@babel/runtime": "^7.0.0",
36
37
  "@emotion/react": "^11.7.1",
37
38
  "lodash": "^4.17.21"
38
39
  },
39
40
  "peerDependencies": {
40
- "react": "^16.8.0"
41
+ "react": "^16.8.0 || ^17.0.0 || ~18.2.0"
41
42
  },
42
43
  "devDependencies": {
43
44
  "@af/accessibility-testing": "*",
44
45
  "@af/visual-regression": "*",
45
- "@atlaskit/ds-lib": "^2.2.0",
46
+ "@atlaskit/ds-lib": "^2.3.0",
46
47
  "@atlaskit/ssr": "*",
47
48
  "@atlaskit/visual-regression": "*",
48
- "@atlaskit/visually-hidden": "^1.2.4",
49
+ "@atlaskit/visually-hidden": "^1.3.0",
49
50
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
50
51
  "@emotion/styled": "^11.0.0",
51
52
  "@testing-library/react": "^12.1.5",