@atlaskit/table-tree 9.2.4 → 9.2.6

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.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 9.2.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`25348ec8a74`](https://bitbucket.org/atlassian/atlassian-frontend/commits/25348ec8a74) - Updated to use spacing and typography tokens. With spacing tokens enabled, padding inside cells has changed slightly from 10px vertical to 8px vertical, and from 25px inline to 24px inline. No visual changes without tokens enabled.
14
+
3
15
  ## 9.2.4
4
16
 
5
17
  ### Patch Changes
@@ -29,6 +29,8 @@ var _commonCell = _interopRequireDefault(require("./internal/common-cell"));
29
29
 
30
30
  var _overflowContainer = _interopRequireDefault(require("./internal/overflow-container"));
31
31
 
32
+ var _styled = require("./internal/styled");
33
+
32
34
  var _withColumnWidth = _interopRequireDefault(require("./internal/with-column-width"));
33
35
 
34
36
  var _excluded = ["children", "singleLine", "indentLevel", "width", "className"];
@@ -63,7 +65,7 @@ var Cell = /*#__PURE__*/function (_Component) {
63
65
  props = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
64
66
  return /*#__PURE__*/_react.default.createElement(_commonCell.default, (0, _extends2.default)({
65
67
  role: "gridcell",
66
- indent: indentLevel ? "".concat(25 * indentLevel, "px") : undefined,
68
+ indent: indentLevel ? "calc(".concat(_styled.indentBase, " * ").concat(indentLevel, ")") : undefined,
67
69
  width: width,
68
70
  className: className
69
71
  }, props), /*#__PURE__*/_react.default.createElement(_overflowContainer.default, {
@@ -35,10 +35,10 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
35
35
 
36
36
  var headerStyles = (0, _react2.css)({
37
37
  color: "var(--ds-text-subtle, ".concat(_colors.N300, ")"),
38
- fontSize: 12,
39
- fontWeight: 'bold',
38
+ fontSize: "var(--ds-font-size-075, 12px)",
39
+ fontWeight: "var(--ds-font-weight-bold, bold)",
40
40
  letterSpacing: -0.1,
41
- lineHeight: '1.67'
41
+ lineHeight: "var(--ds-font-lineHeight-200, 20px)"
42
42
  });
43
43
 
44
44
  var Header = /*#__PURE__*/function (_Component) {
@@ -15,16 +15,18 @@ var _react = require("@emotion/react");
15
15
 
16
16
  var _colors = require("@atlaskit/theme/colors");
17
17
 
18
+ var _styled = require("./styled");
19
+
18
20
  var _excluded = ["indent", "width"];
19
21
  var commonStyles = (0, _react.css)({
20
22
  display: 'flex',
21
23
  boxSizing: 'border-box',
22
24
  minHeight: 40,
23
- padding: '10px 25px 10px var(--indent, 25px)',
25
+ padding: "var(--ds-space-100, 10px)".concat(" ", _styled.indentBase, " ", "var(--ds-space-100, 10px)", " var(--indent, ").concat(_styled.indentBase, ")"),
24
26
  position: 'relative',
25
- alignItems: 'flex-start',
27
+ alignItems: 'center',
26
28
  color: "var(--ds-text, ".concat(_colors.N800, ")"),
27
- lineHeight: '20px'
29
+ lineHeight: "var(--ds-font-lineHeight-200, 20px)"
28
30
  });
29
31
 
30
32
  /**
@@ -75,12 +75,13 @@ var LoaderItem = /*#__PURE__*/function (_Component) {
75
75
  var depth = this.props.depth;
76
76
  var phase = this.state.phase;
77
77
  return phase === 'loading' ? /*#__PURE__*/_react.default.createElement(_styled.TreeRowContainer, null, /*#__PURE__*/_react.default.createElement(_commonCell.default, {
78
- indent: "".concat(25 * depth, "px"),
78
+ indent: "calc(".concat(_styled.indentBase, " * ").concat(depth, ")"),
79
79
  width: "100%"
80
80
  }, /*#__PURE__*/_react.default.createElement(_styled.LoaderItemContainer, {
81
81
  isRoot: depth === 1
82
82
  }, /*#__PURE__*/_react.default.createElement(_spinner.default, {
83
- size: "small"
83
+ size: "small",
84
+ testId: "table-tree-spinner"
84
85
  })))) : null;
85
86
  }
86
87
  }], [{
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.iconColor = exports.TreeRowContainer = exports.LoaderItemContainer = exports.ChevronIconContainer = exports.ChevronContainer = void 0;
8
+ exports.indentBase = exports.iconColor = exports.TreeRowContainer = exports.LoaderItemContainer = exports.ChevronIconContainer = exports.ChevronContainer = void 0;
9
9
 
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
 
@@ -18,6 +18,8 @@ var _colors = require("@atlaskit/theme/colors");
18
18
  var _excluded = ["isRoot"];
19
19
  var iconColor = "var(--ds-text, ".concat(_colors.N800, ")");
20
20
  exports.iconColor = iconColor;
21
+ var indentBase = "var(--ds-space-300, 25px)";
22
+ exports.indentBase = indentBase;
21
23
  var treeRowContainerStyles = (0, _react.css)({
22
24
  display: 'flex',
23
25
  borderBottom: "1px solid ".concat("var(--ds-border, ".concat(_colors.N30, ")"))
@@ -37,7 +39,8 @@ var TreeRowContainer = function TreeRowContainer(props) {
37
39
  exports.TreeRowContainer = TreeRowContainer;
38
40
  var commonChevronContainerStyles = (0, _react.css)({
39
41
  display: 'flex',
40
- marginLeft: -25,
42
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
43
+ marginLeft: "calc(".concat(indentBase, " * -1)"),
41
44
  position: 'absolute',
42
45
  top: 7,
43
46
  alignItems: 'center'
@@ -74,9 +77,11 @@ var ChevronIconContainer = function ChevronIconContainer(props // eslint-disable
74
77
  exports.ChevronIconContainer = ChevronIconContainer;
75
78
  var loadingItemContainerStyles = (0, _react.css)({
76
79
  width: '100%',
80
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
77
81
  paddingTop: 5
78
82
  });
79
83
  var paddingLeftStyles = (0, _react.css)({
84
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
80
85
  paddingLeft: '50%'
81
86
  });
82
87
  /**
@@ -44,7 +44,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
44
44
  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; } }
45
45
 
46
46
  var packageName = "@atlaskit/table-tree";
47
- var packageVersion = "9.2.4";
47
+ var packageVersion = "9.2.6";
48
48
 
49
49
  var Row = /*#__PURE__*/function (_Component) {
50
50
  (0, _inherits2.default)(Row, _Component);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/table-tree",
3
- "version": "9.2.4",
3
+ "version": "9.2.6",
4
4
  "sideEffects": false
5
5
  }
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { Component } from 'react';
3
3
  import CommonCell from './internal/common-cell';
4
4
  import OverflowContainer from './internal/overflow-container';
5
+ import { indentBase } from './internal/styled';
5
6
  import withColumnWidth from './internal/with-column-width';
6
7
 
7
8
  class Cell extends Component {
@@ -16,7 +17,7 @@ class Cell extends Component {
16
17
  } = this.props;
17
18
  return /*#__PURE__*/React.createElement(CommonCell, _extends({
18
19
  role: "gridcell",
19
- indent: indentLevel ? `${25 * indentLevel}px` : undefined,
20
+ indent: indentLevel ? `calc(${indentBase} * ${indentLevel})` : undefined,
20
21
  width: width,
21
22
  className: className
22
23
  }, props), /*#__PURE__*/React.createElement(OverflowContainer, {
@@ -8,10 +8,10 @@ import ColumnCell from './internal/common-cell';
8
8
  import withColumnWidth from './internal/with-column-width';
9
9
  const headerStyles = css({
10
10
  color: `var(--ds-text-subtle, ${N300})`,
11
- fontSize: 12,
12
- fontWeight: 'bold',
11
+ fontSize: "var(--ds-font-size-075, 12px)",
12
+ fontWeight: "var(--ds-font-weight-bold, bold)",
13
13
  letterSpacing: -0.1,
14
- lineHeight: '1.67'
14
+ lineHeight: "var(--ds-font-lineHeight-200, 20px)"
15
15
  });
16
16
 
17
17
  class Header extends Component {
@@ -3,15 +3,16 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  /** @jsx jsx */
4
4
  import { css, jsx } from '@emotion/react';
5
5
  import { N800 } from '@atlaskit/theme/colors';
6
+ import { indentBase } from './styled';
6
7
  const commonStyles = css({
7
8
  display: 'flex',
8
9
  boxSizing: 'border-box',
9
10
  minHeight: 40,
10
- padding: '10px 25px 10px var(--indent, 25px)',
11
+ padding: `${"var(--ds-space-100, 10px)"} ${indentBase} ${"var(--ds-space-100, 10px)"} var(--indent, ${indentBase})`,
11
12
  position: 'relative',
12
- alignItems: 'flex-start',
13
+ alignItems: 'center',
13
14
  color: `var(--ds-text, ${N800})`,
14
- lineHeight: '20px'
15
+ lineHeight: "var(--ds-font-lineHeight-200, 20px)"
15
16
  });
16
17
 
17
18
  /**
@@ -4,7 +4,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import React, { Component } from 'react';
5
5
  import Spinner from '@atlaskit/spinner';
6
6
  import CommonCell from './common-cell';
7
- import { LoaderItemContainer, TreeRowContainer } from './styled';
7
+ import { indentBase, LoaderItemContainer, TreeRowContainer } from './styled';
8
8
  export default class LoaderItem extends Component {
9
9
  constructor(...args) {
10
10
  super(...args);
@@ -40,12 +40,13 @@ export default class LoaderItem extends Component {
40
40
  phase
41
41
  } = this.state;
42
42
  return phase === 'loading' ? /*#__PURE__*/React.createElement(TreeRowContainer, null, /*#__PURE__*/React.createElement(CommonCell, {
43
- indent: `${25 * depth}px`,
43
+ indent: `calc(${indentBase} * ${depth})`,
44
44
  width: "100%"
45
45
  }, /*#__PURE__*/React.createElement(LoaderItemContainer, {
46
46
  isRoot: depth === 1
47
47
  }, /*#__PURE__*/React.createElement(Spinner, {
48
- size: "small"
48
+ size: "small",
49
+ testId: "table-tree-spinner"
49
50
  })))) : null;
50
51
  }
51
52
 
@@ -4,6 +4,7 @@ import _extends from "@babel/runtime/helpers/extends";
4
4
  import { css, jsx } from '@emotion/react';
5
5
  import { N30, N800 } from '@atlaskit/theme/colors';
6
6
  export const iconColor = `var(--ds-text, ${N800})`;
7
+ export const indentBase = "var(--ds-space-300, 25px)";
7
8
  const treeRowContainerStyles = css({
8
9
  display: 'flex',
9
10
  borderBottom: `1px solid ${`var(--ds-border, ${N30})`}`
@@ -18,7 +19,8 @@ jsx("div", _extends({
18
19
  }, props));
19
20
  const commonChevronContainerStyles = css({
20
21
  display: 'flex',
21
- marginLeft: -25,
22
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
23
+ marginLeft: `calc(${indentBase} * -1)`,
22
24
  position: 'absolute',
23
25
  top: 7,
24
26
  alignItems: 'center'
@@ -47,9 +49,11 @@ export const ChevronIconContainer = (props // eslint-disable-next-line @repo/int
47
49
  }));
48
50
  const loadingItemContainerStyles = css({
49
51
  width: '100%',
52
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
50
53
  paddingTop: 5
51
54
  });
52
55
  const paddingLeftStyles = css({
56
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
53
57
  paddingLeft: '50%'
54
58
  });
55
59
  /**
@@ -8,7 +8,7 @@ import toItemId from '../utils/to-item-id';
8
8
  import Chevron from './internal/chevron';
9
9
  import { TreeRowContainer } from './internal/styled';
10
10
  const packageName = "@atlaskit/table-tree";
11
- const packageVersion = "9.2.4";
11
+ const packageVersion = "9.2.6";
12
12
 
13
13
  class Row extends Component {
14
14
  constructor(...args) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/table-tree",
3
- "version": "9.2.4",
3
+ "version": "9.2.6",
4
4
  "sideEffects": false
5
5
  }
@@ -14,6 +14,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
14
14
  import React, { Component } from 'react';
15
15
  import CommonCell from './internal/common-cell';
16
16
  import OverflowContainer from './internal/overflow-container';
17
+ import { indentBase } from './internal/styled';
17
18
  import withColumnWidth from './internal/with-column-width';
18
19
 
19
20
  var Cell = /*#__PURE__*/function (_Component) {
@@ -40,7 +41,7 @@ var Cell = /*#__PURE__*/function (_Component) {
40
41
 
41
42
  return /*#__PURE__*/React.createElement(CommonCell, _extends({
42
43
  role: "gridcell",
43
- indent: indentLevel ? "".concat(25 * indentLevel, "px") : undefined,
44
+ indent: indentLevel ? "calc(".concat(indentBase, " * ").concat(indentLevel, ")") : undefined,
44
45
  width: width,
45
46
  className: className
46
47
  }, props), /*#__PURE__*/React.createElement(OverflowContainer, {
@@ -17,10 +17,10 @@ import ColumnCell from './internal/common-cell';
17
17
  import withColumnWidth from './internal/with-column-width';
18
18
  var headerStyles = css({
19
19
  color: "var(--ds-text-subtle, ".concat(N300, ")"),
20
- fontSize: 12,
21
- fontWeight: 'bold',
20
+ fontSize: "var(--ds-font-size-075, 12px)",
21
+ fontWeight: "var(--ds-font-weight-bold, bold)",
22
22
  letterSpacing: -0.1,
23
- lineHeight: '1.67'
23
+ lineHeight: "var(--ds-font-lineHeight-200, 20px)"
24
24
  });
25
25
 
26
26
  var Header = /*#__PURE__*/function (_Component) {
@@ -5,15 +5,16 @@ var _excluded = ["indent", "width"];
5
5
  /** @jsx jsx */
6
6
  import { css, jsx } from '@emotion/react';
7
7
  import { N800 } from '@atlaskit/theme/colors';
8
+ import { indentBase } from './styled';
8
9
  var commonStyles = css({
9
10
  display: 'flex',
10
11
  boxSizing: 'border-box',
11
12
  minHeight: 40,
12
- padding: '10px 25px 10px var(--indent, 25px)',
13
+ padding: "var(--ds-space-100, 10px)".concat(" ", indentBase, " ", "var(--ds-space-100, 10px)", " var(--indent, ").concat(indentBase, ")"),
13
14
  position: 'relative',
14
- alignItems: 'flex-start',
15
+ alignItems: 'center',
15
16
  color: "var(--ds-text, ".concat(N800, ")"),
16
- lineHeight: '20px'
17
+ lineHeight: "var(--ds-font-lineHeight-200, 20px)"
17
18
  });
18
19
 
19
20
  /**
@@ -14,7 +14,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
14
14
  import React, { Component } from 'react';
15
15
  import Spinner from '@atlaskit/spinner';
16
16
  import CommonCell from './common-cell';
17
- import { LoaderItemContainer, TreeRowContainer } from './styled';
17
+ import { indentBase, LoaderItemContainer, TreeRowContainer } from './styled';
18
18
 
19
19
  var LoaderItem = /*#__PURE__*/function (_Component) {
20
20
  _inherits(LoaderItem, _Component);
@@ -54,12 +54,13 @@ var LoaderItem = /*#__PURE__*/function (_Component) {
54
54
  var depth = this.props.depth;
55
55
  var phase = this.state.phase;
56
56
  return phase === 'loading' ? /*#__PURE__*/React.createElement(TreeRowContainer, null, /*#__PURE__*/React.createElement(CommonCell, {
57
- indent: "".concat(25 * depth, "px"),
57
+ indent: "calc(".concat(indentBase, " * ").concat(depth, ")"),
58
58
  width: "100%"
59
59
  }, /*#__PURE__*/React.createElement(LoaderItemContainer, {
60
60
  isRoot: depth === 1
61
61
  }, /*#__PURE__*/React.createElement(Spinner, {
62
- size: "small"
62
+ size: "small",
63
+ testId: "table-tree-spinner"
63
64
  })))) : null;
64
65
  }
65
66
  }], [{
@@ -6,6 +6,7 @@ var _excluded = ["isRoot"];
6
6
  import { css, jsx } from '@emotion/react';
7
7
  import { N30, N800 } from '@atlaskit/theme/colors';
8
8
  export var iconColor = "var(--ds-text, ".concat(N800, ")");
9
+ export var indentBase = "var(--ds-space-300, 25px)";
9
10
  var treeRowContainerStyles = css({
10
11
  display: 'flex',
11
12
  borderBottom: "1px solid ".concat("var(--ds-border, ".concat(N30, ")"))
@@ -23,7 +24,8 @@ export var TreeRowContainer = function TreeRowContainer(props) {
23
24
  };
24
25
  var commonChevronContainerStyles = css({
25
26
  display: 'flex',
26
- marginLeft: -25,
27
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
28
+ marginLeft: "calc(".concat(indentBase, " * -1)"),
27
29
  position: 'absolute',
28
30
  top: 7,
29
31
  alignItems: 'center'
@@ -56,9 +58,11 @@ export var ChevronIconContainer = function ChevronIconContainer(props // eslint-
56
58
  };
57
59
  var loadingItemContainerStyles = css({
58
60
  width: '100%',
61
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
59
62
  paddingTop: 5
60
63
  });
61
64
  var paddingLeftStyles = css({
65
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
62
66
  paddingLeft: '50%'
63
67
  });
64
68
  /**
@@ -18,7 +18,7 @@ import toItemId from '../utils/to-item-id';
18
18
  import Chevron from './internal/chevron';
19
19
  import { TreeRowContainer } from './internal/styled';
20
20
  var packageName = "@atlaskit/table-tree";
21
- var packageVersion = "9.2.4";
21
+ var packageVersion = "9.2.6";
22
22
 
23
23
  var Row = /*#__PURE__*/function (_Component) {
24
24
  _inherits(Row, _Component);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/table-tree",
3
- "version": "9.2.4",
3
+ "version": "9.2.6",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { FC, HTMLAttributes } from 'react';
3
3
  export declare const iconColor: "var(--ds-text)";
4
+ export declare const indentBase: "var(--ds-space-300)";
4
5
  /**
5
6
  * __Tree row container__
6
7
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/table-tree",
3
- "version": "9.2.4",
3
+ "version": "9.2.6",
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/"
@@ -33,7 +33,7 @@
33
33
  "@atlaskit/icon": "^21.11.0",
34
34
  "@atlaskit/spinner": "^15.3.0",
35
35
  "@atlaskit/theme": "^12.2.0",
36
- "@atlaskit/tokens": "^0.11.0",
36
+ "@atlaskit/tokens": "^0.12.0",
37
37
  "@babel/runtime": "^7.0.0",
38
38
  "@emotion/react": "^11.7.1",
39
39
  "lodash": "^4.17.21",