@atlaskit/table 0.4.12 → 0.4.13

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,11 @@
1
1
  # @atlaskit/table
2
2
 
3
+ ## 0.4.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a981691b65e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a981691b65e) - Updated internal dependencies.
8
+
3
9
  ## 0.4.12
4
10
 
5
11
  ### Patch Changes
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = require("@emotion/react");
8
- var _dsExplorations = require("@atlaskit/ds-explorations");
9
8
  var _th = require("./ui/th");
10
9
  /* eslint-disable no-unused-vars */
11
10
  /** @jsx jsx */
@@ -27,9 +26,14 @@ var HeadCell = function HeadCell(_ref) {
27
26
  align: align,
28
27
  testId: testId,
29
28
  backgroundColor: backgroundColor
30
- }, children && (0, _react.jsx)(_dsExplorations.UNSAFE_Text, {
31
- color: "color.text",
32
- fontWeight: "medium"
29
+ }, children &&
30
+ // migrate to <Text />
31
+ (0, _react.jsx)("span", {
32
+ style: {
33
+ color: "var(--ds-text, #172B4D)",
34
+ /* @ts-ignore migrate to Text */
35
+ fontWeight: "var(--ds-font-weight-medium, 500)"
36
+ }
33
37
  }, children));
34
38
  };
35
39
  var _default = HeadCell;
package/dist/cjs/thead.js CHANGED
@@ -9,7 +9,6 @@ exports.default = void 0;
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _react = require("@emotion/react");
11
11
  var _checkbox = _interopRequireDefault(require("@atlaskit/checkbox"));
12
- var _dsExplorations = require("@atlaskit/ds-explorations");
13
12
  var _inline = _interopRequireDefault(require("@atlaskit/primitives/inline"));
14
13
  var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
15
14
  var _selectionProvider = require("./hooks/selection-provider");
@@ -42,9 +41,12 @@ var THead = function THead(_ref) {
42
41
  onChange: isChecked ? removeAll : setAll,
43
42
  isChecked: isChecked,
44
43
  isIndeterminate: state.anyChecked && !state.allChecked
45
- })), children, isSelectable && isChecked && (0, _react.jsx)(Primitives.BulkActionOverlay, null, (0, _react.jsx)(_dsExplorations.UNSAFE_Text, {
46
- color: "color.text",
47
- fontWeight: "medium"
44
+ })), children, isSelectable && isChecked && (0, _react.jsx)(Primitives.BulkActionOverlay, null, (0, _react.jsx)("span", {
45
+ style: {
46
+ color: "var(--ds-text, #172B4D)",
47
+ /* @ts-ignore migrate to Text */
48
+ fontWeight: "var(--ds-font-weight-medium, 500)"
49
+ }
48
50
  }, state.checked.length, " selected"), actions && (0, _react.jsx)(_inline.default, {
49
51
  alignBlock: "stretch",
50
52
  space: "space.100"
@@ -1,43 +1,40 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.BaseCell = void 0;
8
- var _react = require("react");
9
- var _react2 = require("@emotion/react");
10
- var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box"));
11
- /* eslint-disable @atlassian/tangerine/import/entry-points */
12
- /** @jsx jsx */
13
-
9
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
+ var _react = _interopRequireWildcard(require("react"));
11
+ var _primitives = require("@atlaskit/primitives");
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
14
  /**
15
15
  * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-sort
16
16
  */
17
17
 
18
- var baseResetStyles = (0, _react2.css)({
18
+ var baseResetStyles = (0, _primitives.xcss)({
19
19
  display: 'table-cell',
20
20
  verticalAlign: 'middle',
21
- '&:first-of-type': {
21
+ ':first-of-type': {
22
22
  paddingLeft: "var(--ds-space-100, 8px)"
23
23
  },
24
- '&:last-of-type': {
24
+ ':last-of-type': {
25
25
  paddingRight: "var(--ds-space-100, 8px)"
26
26
  }
27
27
  });
28
- var alignLeftStyles = (0, _react2.css)({
29
- textAlign: 'left'
30
- });
31
- var alignCenterStyles = (0, _react2.css)({
32
- textAlign: 'center'
33
- });
34
- var alignRightStyles = (0, _react2.css)({
35
- textAlign: 'right'
36
- });
37
- var alignMap = {
38
- text: alignLeftStyles,
39
- number: alignRightStyles,
40
- icon: alignCenterStyles
28
+ var alignMapStyles = {
29
+ text: (0, _primitives.xcss)({
30
+ textAlign: 'left'
31
+ }),
32
+ icon: (0, _primitives.xcss)({
33
+ textAlign: 'center'
34
+ }),
35
+ number: (0, _primitives.xcss)({
36
+ textAlign: 'right'
37
+ })
41
38
  };
42
39
 
43
40
  /**
@@ -60,20 +57,21 @@ var BaseCell = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
60
57
  backgroundColor = _ref.backgroundColor,
61
58
  scope = _ref.scope,
62
59
  width = _ref.width,
63
- className = _ref.className,
60
+ xcss = _ref.xcss,
64
61
  sortDirection = _ref.sortDirection,
65
62
  colSpan = _ref.colSpan;
66
- return (0, _react2.jsx)(_box.default, {
67
- css: [baseResetStyles, alignMap[align]],
63
+ return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
64
+ xcss: [baseResetStyles, alignMapStyles[align]].concat((0, _toConsumableArray2.default)(Array.isArray(xcss) ? xcss : [xcss])),
68
65
  ref: ref,
69
66
  scope: scope,
70
67
  backgroundColor: backgroundColor,
71
68
  paddingBlock: paddingBlock,
72
- paddingInline: paddingInline,
69
+ paddingInline: paddingInline
70
+ // @ts-expect-error
71
+ ,
73
72
  as: as,
74
73
  testId: testId,
75
- className: className,
76
- UNSAFE_style: width ? {
74
+ style: width ? {
77
75
  width: width
78
76
  } : undefined,
79
77
  "aria-sort": sortDirection,
@@ -5,14 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.BulkActionOverlay = void 0;
8
- var _react = require("@emotion/react");
9
- var _dsExplorations = require("@atlaskit/ds-explorations");
10
- var _inline = _interopRequireDefault(require("@atlaskit/primitives/inline"));
11
- /** @jsx jsx */
12
-
13
- var overlayStyles = (0, _react.css)({
14
- inset: 0,
15
- left: "var(--ds-space-400, 32px)"
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _primitives = require("@atlaskit/primitives");
10
+ var overlayStyles = (0, _primitives.xcss)({
11
+ display: 'flex',
12
+ position: 'absolute',
13
+ inset: 'space.0',
14
+ left: 'space.400'
16
15
  });
17
16
 
18
17
  /**
@@ -22,13 +21,14 @@ var overlayStyles = (0, _react.css)({
22
21
  */
23
22
  var BulkActionOverlay = function BulkActionOverlay(_ref) {
24
23
  var children = _ref.children;
25
- return (0, _react.jsx)(_dsExplorations.UNSAFE_Box, {
24
+ return /*#__PURE__*/_react.default.createElement(_primitives.Box
25
+ // @ts-expect-error should box support table elements?
26
+ , {
26
27
  as: "th",
27
- position: "absolute",
28
28
  paddingInline: "space.100",
29
29
  backgroundColor: "elevation.surface",
30
- css: overlayStyles
31
- }, (0, _react.jsx)(_inline.default, {
30
+ xcss: overlayStyles
31
+ }, /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
32
32
  space: "space.300",
33
33
  alignBlock: "center"
34
34
  }, children));
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.ExpandableCell = void 0;
7
- var _react = require("@emotion/react");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _primitives = require("@atlaskit/primitives");
8
10
  var _baseCell = require("./base-cell");
9
- /** @jsx jsx */
10
-
11
- var spacingStyles = (0, _react.css)({
12
- width: 24,
13
- padding: "var(--ds-space-0, 0px)"
11
+ var spacingStyles = (0, _primitives.xcss)({
12
+ width: 'size.200',
13
+ padding: 'space.0'
14
14
  });
15
15
  /**
16
16
  * __Expandable cell__
@@ -20,9 +20,9 @@ var spacingStyles = (0, _react.css)({
20
20
  var ExpandableCell = function ExpandableCell(_ref) {
21
21
  var children = _ref.children,
22
22
  as = _ref.as;
23
- return (0, _react.jsx)(_baseCell.BaseCell, {
23
+ return /*#__PURE__*/_react.default.createElement(_baseCell.BaseCell, {
24
24
  as: as,
25
- css: spacingStyles
25
+ xcss: spacingStyles
26
26
  }, children);
27
27
  };
28
28
  exports.ExpandableCell = ExpandableCell;
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.SelectableCell = void 0;
7
- var _react = require("@emotion/react");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _primitives = require("@atlaskit/primitives");
8
10
  var _baseCell = require("./base-cell");
9
- /** @jsx jsx */
10
-
11
- var spacingStyles = (0, _react.css)({
12
- width: 32,
13
- padding: "var(--ds-space-0, 0px)"
11
+ var spacingStyles = (0, _primitives.xcss)({
12
+ width: 'size.300',
13
+ padding: 'space.0'
14
14
  });
15
15
  /**
16
16
  * __Selectable cell__
@@ -20,9 +20,9 @@ var spacingStyles = (0, _react.css)({
20
20
  var SelectableCell = function SelectableCell(_ref) {
21
21
  var children = _ref.children,
22
22
  as = _ref.as;
23
- return (0, _react.jsx)(_baseCell.BaseCell, {
23
+ return /*#__PURE__*/_react.default.createElement(_baseCell.BaseCell, {
24
24
  as: as,
25
- css: spacingStyles
25
+ xcss: spacingStyles
26
26
  }, children);
27
27
  };
28
28
  exports.SelectableCell = SelectableCell;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/table",
3
- "version": "0.4.12",
3
+ "version": "0.4.13",
4
4
  "sideEffects": false
5
5
  }
@@ -2,7 +2,6 @@
2
2
  /** @jsx jsx */
3
3
 
4
4
  import { jsx } from '@emotion/react';
5
- import { UNSAFE_Text as Text } from '@atlaskit/ds-explorations';
6
5
  import { TH } from './ui/th';
7
6
 
8
7
  /**
@@ -22,9 +21,14 @@ const HeadCell = ({
22
21
  align: align,
23
22
  testId: testId,
24
23
  backgroundColor: backgroundColor
25
- }, children && jsx(Text, {
26
- color: "color.text",
27
- fontWeight: "medium"
24
+ }, children &&
25
+ // migrate to <Text />
26
+ jsx("span", {
27
+ style: {
28
+ color: "var(--ds-text, #172B4D)",
29
+ /* @ts-ignore migrate to Text */
30
+ fontWeight: "var(--ds-font-weight-medium, 500)"
31
+ }
28
32
  }, children));
29
33
  };
30
34
  export default HeadCell;
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { jsx } from '@emotion/react';
4
4
  import Checkbox from '@atlaskit/checkbox';
5
- import { UNSAFE_Text as Text } from '@atlaskit/ds-explorations';
6
5
  import Inline from '@atlaskit/primitives/inline';
7
6
  import VisuallyHidden from '@atlaskit/visually-hidden';
8
7
  import { useSelection } from './hooks/selection-provider';
@@ -31,9 +30,12 @@ const THead = ({
31
30
  onChange: isChecked ? removeAll : setAll,
32
31
  isChecked: isChecked,
33
32
  isIndeterminate: state.anyChecked && !state.allChecked
34
- })), children, isSelectable && isChecked && jsx(Primitives.BulkActionOverlay, null, jsx(Text, {
35
- color: "color.text",
36
- fontWeight: "medium"
33
+ })), children, isSelectable && isChecked && jsx(Primitives.BulkActionOverlay, null, jsx("span", {
34
+ style: {
35
+ color: "var(--ds-text, #172B4D)",
36
+ /* @ts-ignore migrate to Text */
37
+ fontWeight: "var(--ds-font-weight-medium, 500)"
38
+ }
37
39
  }, state.checked.length, " selected"), actions && jsx(Inline, {
38
40
  alignBlock: "stretch",
39
41
  space: "space.100"
@@ -1,36 +1,30 @@
1
- /* eslint-disable @atlassian/tangerine/import/entry-points */
2
- /** @jsx jsx */
3
- import { forwardRef } from 'react';
4
- import { css, jsx } from '@emotion/react';
5
- import Box from '@atlaskit/ds-explorations/box';
1
+ import React, { forwardRef } from 'react';
2
+ import { Box, xcss } from '@atlaskit/primitives';
6
3
 
7
4
  /**
8
5
  * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-sort
9
6
  */
10
7
 
11
- const baseResetStyles = css({
8
+ const baseResetStyles = xcss({
12
9
  display: 'table-cell',
13
10
  verticalAlign: 'middle',
14
- '&:first-of-type': {
11
+ ':first-of-type': {
15
12
  paddingLeft: "var(--ds-space-100, 8px)"
16
13
  },
17
- '&:last-of-type': {
14
+ ':last-of-type': {
18
15
  paddingRight: "var(--ds-space-100, 8px)"
19
16
  }
20
17
  });
21
- const alignLeftStyles = css({
22
- textAlign: 'left'
23
- });
24
- const alignCenterStyles = css({
25
- textAlign: 'center'
26
- });
27
- const alignRightStyles = css({
28
- textAlign: 'right'
29
- });
30
- const alignMap = {
31
- text: alignLeftStyles,
32
- number: alignRightStyles,
33
- icon: alignCenterStyles
18
+ const alignMapStyles = {
19
+ text: xcss({
20
+ textAlign: 'left'
21
+ }),
22
+ icon: xcss({
23
+ textAlign: 'center'
24
+ }),
25
+ number: xcss({
26
+ textAlign: 'right'
27
+ })
34
28
  };
35
29
 
36
30
  /**
@@ -50,20 +44,21 @@ export const BaseCell = /*#__PURE__*/forwardRef(({
50
44
  backgroundColor,
51
45
  scope,
52
46
  width,
53
- className,
47
+ xcss,
54
48
  sortDirection,
55
49
  colSpan
56
- }, ref) => jsx(Box, {
57
- css: [baseResetStyles, alignMap[align]],
50
+ }, ref) => /*#__PURE__*/React.createElement(Box, {
51
+ xcss: [baseResetStyles, alignMapStyles[align], ...(Array.isArray(xcss) ? xcss : [xcss])],
58
52
  ref: ref,
59
53
  scope: scope,
60
54
  backgroundColor: backgroundColor,
61
55
  paddingBlock: paddingBlock,
62
- paddingInline: paddingInline,
56
+ paddingInline: paddingInline
57
+ // @ts-expect-error
58
+ ,
63
59
  as: as,
64
60
  testId: testId,
65
- className: className,
66
- UNSAFE_style: width ? {
61
+ style: width ? {
67
62
  width
68
63
  } : undefined,
69
64
  "aria-sort": sortDirection,
@@ -1,11 +1,10 @@
1
- /** @jsx jsx */
2
-
3
- import { css, jsx } from '@emotion/react';
4
- import { UNSAFE_Box as Box } from '@atlaskit/ds-explorations';
5
- import Inline from '@atlaskit/primitives/inline';
6
- const overlayStyles = css({
7
- inset: 0,
8
- left: "var(--ds-space-400, 32px)"
1
+ import React from 'react';
2
+ import { Box, Inline, xcss } from '@atlaskit/primitives';
3
+ const overlayStyles = xcss({
4
+ display: 'flex',
5
+ position: 'absolute',
6
+ inset: 'space.0',
7
+ left: 'space.400'
9
8
  });
10
9
 
11
10
  /**
@@ -15,13 +14,14 @@ const overlayStyles = css({
15
14
  */
16
15
  export const BulkActionOverlay = ({
17
16
  children
18
- }) => jsx(Box, {
17
+ }) => /*#__PURE__*/React.createElement(Box
18
+ // @ts-expect-error should box support table elements?
19
+ , {
19
20
  as: "th",
20
- position: "absolute",
21
21
  paddingInline: "space.100",
22
22
  backgroundColor: "elevation.surface",
23
- css: overlayStyles
24
- }, jsx(Inline, {
23
+ xcss: overlayStyles
24
+ }, /*#__PURE__*/React.createElement(Inline, {
25
25
  space: "space.300",
26
26
  alignBlock: "center"
27
27
  }, children));
@@ -1,10 +1,9 @@
1
- /** @jsx jsx */
2
-
3
- import { css, jsx } from '@emotion/react';
1
+ import React from 'react';
2
+ import { xcss } from '@atlaskit/primitives';
4
3
  import { BaseCell } from './base-cell';
5
- const spacingStyles = css({
6
- width: 24,
7
- padding: "var(--ds-space-0, 0px)"
4
+ const spacingStyles = xcss({
5
+ width: 'size.200',
6
+ padding: 'space.0'
8
7
  });
9
8
  /**
10
9
  * __Expandable cell__
@@ -15,8 +14,8 @@ export const ExpandableCell = ({
15
14
  children,
16
15
  as
17
16
  }) => {
18
- return jsx(BaseCell, {
17
+ return /*#__PURE__*/React.createElement(BaseCell, {
19
18
  as: as,
20
- css: spacingStyles
19
+ xcss: spacingStyles
21
20
  }, children);
22
21
  };
@@ -1,10 +1,9 @@
1
- /** @jsx jsx */
2
-
3
- import { css, jsx } from '@emotion/react';
1
+ import React from 'react';
2
+ import { xcss } from '@atlaskit/primitives';
4
3
  import { BaseCell } from './base-cell';
5
- const spacingStyles = css({
6
- width: 32,
7
- padding: "var(--ds-space-0, 0px)"
4
+ const spacingStyles = xcss({
5
+ width: 'size.300',
6
+ padding: 'space.0'
8
7
  });
9
8
  /**
10
9
  * __Selectable cell__
@@ -15,8 +14,8 @@ export const SelectableCell = ({
15
14
  children,
16
15
  as
17
16
  }) => {
18
- return jsx(BaseCell, {
17
+ return /*#__PURE__*/React.createElement(BaseCell, {
19
18
  as: as,
20
- css: spacingStyles
19
+ xcss: spacingStyles
21
20
  }, children);
22
21
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/table",
3
- "version": "0.4.12",
3
+ "version": "0.4.13",
4
4
  "sideEffects": false
5
5
  }
@@ -2,7 +2,6 @@
2
2
  /** @jsx jsx */
3
3
 
4
4
  import { jsx } from '@emotion/react';
5
- import { UNSAFE_Text as Text } from '@atlaskit/ds-explorations';
6
5
  import { TH } from './ui/th';
7
6
 
8
7
  /**
@@ -22,9 +21,14 @@ var HeadCell = function HeadCell(_ref) {
22
21
  align: align,
23
22
  testId: testId,
24
23
  backgroundColor: backgroundColor
25
- }, children && jsx(Text, {
26
- color: "color.text",
27
- fontWeight: "medium"
24
+ }, children &&
25
+ // migrate to <Text />
26
+ jsx("span", {
27
+ style: {
28
+ color: "var(--ds-text, #172B4D)",
29
+ /* @ts-ignore migrate to Text */
30
+ fontWeight: "var(--ds-font-weight-medium, 500)"
31
+ }
28
32
  }, children));
29
33
  };
30
34
  export default HeadCell;
package/dist/esm/thead.js CHANGED
@@ -3,7 +3,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
 
4
4
  import { jsx } from '@emotion/react';
5
5
  import Checkbox from '@atlaskit/checkbox';
6
- import { UNSAFE_Text as Text } from '@atlaskit/ds-explorations';
7
6
  import Inline from '@atlaskit/primitives/inline';
8
7
  import VisuallyHidden from '@atlaskit/visually-hidden';
9
8
  import { useSelection } from './hooks/selection-provider';
@@ -32,9 +31,12 @@ var THead = function THead(_ref) {
32
31
  onChange: isChecked ? removeAll : setAll,
33
32
  isChecked: isChecked,
34
33
  isIndeterminate: state.anyChecked && !state.allChecked
35
- })), children, isSelectable && isChecked && jsx(Primitives.BulkActionOverlay, null, jsx(Text, {
36
- color: "color.text",
37
- fontWeight: "medium"
34
+ })), children, isSelectable && isChecked && jsx(Primitives.BulkActionOverlay, null, jsx("span", {
35
+ style: {
36
+ color: "var(--ds-text, #172B4D)",
37
+ /* @ts-ignore migrate to Text */
38
+ fontWeight: "var(--ds-font-weight-medium, 500)"
39
+ }
38
40
  }, state.checked.length, " selected"), actions && jsx(Inline, {
39
41
  alignBlock: "stretch",
40
42
  space: "space.100"
@@ -1,36 +1,31 @@
1
- /* eslint-disable @atlassian/tangerine/import/entry-points */
2
- /** @jsx jsx */
3
- import { forwardRef } from 'react';
4
- import { css, jsx } from '@emotion/react';
5
- import Box from '@atlaskit/ds-explorations/box';
1
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
+ import React, { forwardRef } from 'react';
3
+ import { Box, xcss } from '@atlaskit/primitives';
6
4
 
7
5
  /**
8
6
  * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-sort
9
7
  */
10
8
 
11
- var baseResetStyles = css({
9
+ var baseResetStyles = xcss({
12
10
  display: 'table-cell',
13
11
  verticalAlign: 'middle',
14
- '&:first-of-type': {
12
+ ':first-of-type': {
15
13
  paddingLeft: "var(--ds-space-100, 8px)"
16
14
  },
17
- '&:last-of-type': {
15
+ ':last-of-type': {
18
16
  paddingRight: "var(--ds-space-100, 8px)"
19
17
  }
20
18
  });
21
- var alignLeftStyles = css({
22
- textAlign: 'left'
23
- });
24
- var alignCenterStyles = css({
25
- textAlign: 'center'
26
- });
27
- var alignRightStyles = css({
28
- textAlign: 'right'
29
- });
30
- var alignMap = {
31
- text: alignLeftStyles,
32
- number: alignRightStyles,
33
- icon: alignCenterStyles
19
+ var alignMapStyles = {
20
+ text: xcss({
21
+ textAlign: 'left'
22
+ }),
23
+ icon: xcss({
24
+ textAlign: 'center'
25
+ }),
26
+ number: xcss({
27
+ textAlign: 'right'
28
+ })
34
29
  };
35
30
 
36
31
  /**
@@ -53,20 +48,21 @@ export var BaseCell = /*#__PURE__*/forwardRef(function (_ref, ref) {
53
48
  backgroundColor = _ref.backgroundColor,
54
49
  scope = _ref.scope,
55
50
  width = _ref.width,
56
- className = _ref.className,
51
+ xcss = _ref.xcss,
57
52
  sortDirection = _ref.sortDirection,
58
53
  colSpan = _ref.colSpan;
59
- return jsx(Box, {
60
- css: [baseResetStyles, alignMap[align]],
54
+ return /*#__PURE__*/React.createElement(Box, {
55
+ xcss: [baseResetStyles, alignMapStyles[align]].concat(_toConsumableArray(Array.isArray(xcss) ? xcss : [xcss])),
61
56
  ref: ref,
62
57
  scope: scope,
63
58
  backgroundColor: backgroundColor,
64
59
  paddingBlock: paddingBlock,
65
- paddingInline: paddingInline,
60
+ paddingInline: paddingInline
61
+ // @ts-expect-error
62
+ ,
66
63
  as: as,
67
64
  testId: testId,
68
- className: className,
69
- UNSAFE_style: width ? {
65
+ style: width ? {
70
66
  width: width
71
67
  } : undefined,
72
68
  "aria-sort": sortDirection,
@@ -1,11 +1,10 @@
1
- /** @jsx jsx */
2
-
3
- import { css, jsx } from '@emotion/react';
4
- import { UNSAFE_Box as Box } from '@atlaskit/ds-explorations';
5
- import Inline from '@atlaskit/primitives/inline';
6
- var overlayStyles = css({
7
- inset: 0,
8
- left: "var(--ds-space-400, 32px)"
1
+ import React from 'react';
2
+ import { Box, Inline, xcss } from '@atlaskit/primitives';
3
+ var overlayStyles = xcss({
4
+ display: 'flex',
5
+ position: 'absolute',
6
+ inset: 'space.0',
7
+ left: 'space.400'
9
8
  });
10
9
 
11
10
  /**
@@ -15,13 +14,14 @@ var overlayStyles = css({
15
14
  */
16
15
  export var BulkActionOverlay = function BulkActionOverlay(_ref) {
17
16
  var children = _ref.children;
18
- return jsx(Box, {
17
+ return /*#__PURE__*/React.createElement(Box
18
+ // @ts-expect-error should box support table elements?
19
+ , {
19
20
  as: "th",
20
- position: "absolute",
21
21
  paddingInline: "space.100",
22
22
  backgroundColor: "elevation.surface",
23
- css: overlayStyles
24
- }, jsx(Inline, {
23
+ xcss: overlayStyles
24
+ }, /*#__PURE__*/React.createElement(Inline, {
25
25
  space: "space.300",
26
26
  alignBlock: "center"
27
27
  }, children));
@@ -1,10 +1,9 @@
1
- /** @jsx jsx */
2
-
3
- import { css, jsx } from '@emotion/react';
1
+ import React from 'react';
2
+ import { xcss } from '@atlaskit/primitives';
4
3
  import { BaseCell } from './base-cell';
5
- var spacingStyles = css({
6
- width: 24,
7
- padding: "var(--ds-space-0, 0px)"
4
+ var spacingStyles = xcss({
5
+ width: 'size.200',
6
+ padding: 'space.0'
8
7
  });
9
8
  /**
10
9
  * __Expandable cell__
@@ -14,8 +13,8 @@ var spacingStyles = css({
14
13
  export var ExpandableCell = function ExpandableCell(_ref) {
15
14
  var children = _ref.children,
16
15
  as = _ref.as;
17
- return jsx(BaseCell, {
16
+ return /*#__PURE__*/React.createElement(BaseCell, {
18
17
  as: as,
19
- css: spacingStyles
18
+ xcss: spacingStyles
20
19
  }, children);
21
20
  };
@@ -1,10 +1,9 @@
1
- /** @jsx jsx */
2
-
3
- import { css, jsx } from '@emotion/react';
1
+ import React from 'react';
2
+ import { xcss } from '@atlaskit/primitives';
4
3
  import { BaseCell } from './base-cell';
5
- var spacingStyles = css({
6
- width: 32,
7
- padding: "var(--ds-space-0, 0px)"
4
+ var spacingStyles = xcss({
5
+ width: 'size.300',
6
+ padding: 'space.0'
8
7
  });
9
8
  /**
10
9
  * __Selectable cell__
@@ -14,8 +13,8 @@ var spacingStyles = css({
14
13
  export var SelectableCell = function SelectableCell(_ref) {
15
14
  var children = _ref.children,
16
15
  as = _ref.as;
17
- return jsx(BaseCell, {
16
+ return /*#__PURE__*/React.createElement(BaseCell, {
18
17
  as: as,
19
- css: spacingStyles
18
+ xcss: spacingStyles
20
19
  }, children);
21
20
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/table",
3
- "version": "0.4.12",
3
+ "version": "0.4.13",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,5 @@
1
- /** @jsx jsx */
2
- import { ReactNode } from 'react';
3
- import { BoxProps } from '@atlaskit/ds-explorations/box';
1
+ import React, { ReactNode } from 'react';
2
+ import { BoxProps } from '@atlaskit/primitives';
4
3
  export type BaseCellProps = {
5
4
  /**
6
5
  * A percentage of pixel width of the table to apply to a column.
@@ -9,7 +8,7 @@ export type BaseCellProps = {
9
8
  /**
10
9
  * Horizontal alignment of content.
11
10
  */
12
- align?: keyof typeof alignMap;
11
+ align?: 'icon' | 'text' | 'number';
13
12
  /**
14
13
  * Whether the cell should render as a `td` or `th` element.
15
14
  */
@@ -33,16 +32,11 @@ export type BaseCellProps = {
33
32
  * Number of columns to span.
34
33
  */
35
34
  colSpan?: number;
36
- } & Pick<BoxProps, 'paddingBlock' | 'paddingInline' | 'backgroundColor' | 'className'>;
35
+ } & Pick<BoxProps, 'paddingBlock' | 'paddingInline' | 'backgroundColor' | 'xcss'>;
37
36
  /**
38
37
  * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-sort
39
38
  */
40
39
  export type SortDirection = 'ascending' | 'descending' | 'none' | 'other';
41
- declare const alignMap: {
42
- readonly text: import("@emotion/react").SerializedStyles;
43
- readonly number: import("@emotion/react").SerializedStyles;
44
- readonly icon: import("@emotion/react").SerializedStyles;
45
- };
46
40
  /**
47
41
  * __BaseCell__
48
42
  *
@@ -50,7 +44,7 @@ declare const alignMap: {
50
44
  *
51
45
  * Basic cell element.
52
46
  */
53
- export declare const BaseCell: import("react").ForwardRefExoticComponent<{
47
+ export declare const BaseCell: React.ForwardRefExoticComponent<{
54
48
  /**
55
49
  * A percentage of pixel width of the table to apply to a column.
56
50
  */
@@ -82,7 +76,6 @@ export declare const BaseCell: import("react").ForwardRefExoticComponent<{
82
76
  * Number of columns to span.
83
77
  */
84
78
  colSpan?: number | undefined;
85
- } & Pick<BoxProps<"div">, "className" | "backgroundColor" | "paddingBlock" | "paddingInline"> & {
79
+ } & Pick<BoxProps<"div">, "backgroundColor" | "paddingBlock" | "paddingInline" | "xcss"> & {
86
80
  sortDirection?: SortDirection | undefined;
87
- } & import("react").RefAttributes<HTMLTableCellElement>>;
88
- export {};
81
+ } & React.RefAttributes<HTMLTableCellElement>>;
@@ -1,4 +1,3 @@
1
- /** @jsx jsx */
2
1
  import { FC, ReactNode } from 'react';
3
2
  /**
4
3
  * __Bulk action overlay__
@@ -1,6 +1,4 @@
1
- /** @jsx jsx */
2
1
  import { ReactNode } from 'react';
3
- import { jsx } from '@emotion/react';
4
2
  type ExpandableCellProps = {
5
3
  as: 'td' | 'th';
6
4
  children?: ReactNode;
@@ -10,5 +8,5 @@ type ExpandableCellProps = {
10
8
  *
11
9
  * An expandable cell primitive designed to be used for light weight composition.
12
10
  */
13
- export declare const ExpandableCell: ({ children, as }: ExpandableCellProps) => jsx.JSX.Element;
11
+ export declare const ExpandableCell: ({ children, as }: ExpandableCellProps) => JSX.Element;
14
12
  export {};
@@ -1,6 +1,4 @@
1
- /** @jsx jsx */
2
1
  import { ReactNode } from 'react';
3
- import { jsx } from '@emotion/react';
4
2
  type SelectableCellProps = {
5
3
  as: 'td' | 'th';
6
4
  children?: ReactNode;
@@ -10,5 +8,5 @@ type SelectableCellProps = {
10
8
  *
11
9
  * A selectable cell primitive designed to be used for light weight composition.
12
10
  */
13
- export declare const SelectableCell: ({ children, as }: SelectableCellProps) => jsx.JSX.Element;
11
+ export declare const SelectableCell: ({ children, as }: SelectableCellProps) => JSX.Element;
14
12
  export {};
@@ -1,6 +1,5 @@
1
- /** @jsx jsx */
2
- import { ReactNode } from 'react';
3
- import { BoxProps } from '@atlaskit/ds-explorations/box';
1
+ import React, { ReactNode } from 'react';
2
+ import { BoxProps } from '@atlaskit/primitives';
4
3
  export type BaseCellProps = {
5
4
  /**
6
5
  * A percentage of pixel width of the table to apply to a column.
@@ -9,7 +8,7 @@ export type BaseCellProps = {
9
8
  /**
10
9
  * Horizontal alignment of content.
11
10
  */
12
- align?: keyof typeof alignMap;
11
+ align?: 'icon' | 'text' | 'number';
13
12
  /**
14
13
  * Whether the cell should render as a `td` or `th` element.
15
14
  */
@@ -33,16 +32,11 @@ export type BaseCellProps = {
33
32
  * Number of columns to span.
34
33
  */
35
34
  colSpan?: number;
36
- } & Pick<BoxProps, 'paddingBlock' | 'paddingInline' | 'backgroundColor' | 'className'>;
35
+ } & Pick<BoxProps, 'paddingBlock' | 'paddingInline' | 'backgroundColor' | 'xcss'>;
37
36
  /**
38
37
  * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-sort
39
38
  */
40
39
  export type SortDirection = 'ascending' | 'descending' | 'none' | 'other';
41
- declare const alignMap: {
42
- readonly text: import("@emotion/react").SerializedStyles;
43
- readonly number: import("@emotion/react").SerializedStyles;
44
- readonly icon: import("@emotion/react").SerializedStyles;
45
- };
46
40
  /**
47
41
  * __BaseCell__
48
42
  *
@@ -50,7 +44,7 @@ declare const alignMap: {
50
44
  *
51
45
  * Basic cell element.
52
46
  */
53
- export declare const BaseCell: import("react").ForwardRefExoticComponent<{
47
+ export declare const BaseCell: React.ForwardRefExoticComponent<{
54
48
  /**
55
49
  * A percentage of pixel width of the table to apply to a column.
56
50
  */
@@ -82,7 +76,6 @@ export declare const BaseCell: import("react").ForwardRefExoticComponent<{
82
76
  * Number of columns to span.
83
77
  */
84
78
  colSpan?: number | undefined;
85
- } & Pick<BoxProps<"div">, "className" | "backgroundColor" | "paddingBlock" | "paddingInline"> & {
79
+ } & Pick<BoxProps<"div">, "backgroundColor" | "paddingBlock" | "paddingInline" | "xcss"> & {
86
80
  sortDirection?: SortDirection | undefined;
87
- } & import("react").RefAttributes<HTMLTableCellElement>>;
88
- export {};
81
+ } & React.RefAttributes<HTMLTableCellElement>>;
@@ -1,4 +1,3 @@
1
- /** @jsx jsx */
2
1
  import { FC, ReactNode } from 'react';
3
2
  /**
4
3
  * __Bulk action overlay__
@@ -1,6 +1,4 @@
1
- /** @jsx jsx */
2
1
  import { ReactNode } from 'react';
3
- import { jsx } from '@emotion/react';
4
2
  type ExpandableCellProps = {
5
3
  as: 'td' | 'th';
6
4
  children?: ReactNode;
@@ -10,5 +8,5 @@ type ExpandableCellProps = {
10
8
  *
11
9
  * An expandable cell primitive designed to be used for light weight composition.
12
10
  */
13
- export declare const ExpandableCell: ({ children, as }: ExpandableCellProps) => jsx.JSX.Element;
11
+ export declare const ExpandableCell: ({ children, as }: ExpandableCellProps) => JSX.Element;
14
12
  export {};
@@ -1,6 +1,4 @@
1
- /** @jsx jsx */
2
1
  import { ReactNode } from 'react';
3
- import { jsx } from '@emotion/react';
4
2
  type SelectableCellProps = {
5
3
  as: 'td' | 'th';
6
4
  children?: ReactNode;
@@ -10,5 +8,5 @@ type SelectableCellProps = {
10
8
  *
11
9
  * A selectable cell primitive designed to be used for light weight composition.
12
10
  */
13
- export declare const SelectableCell: ({ children, as }: SelectableCellProps) => jsx.JSX.Element;
11
+ export declare const SelectableCell: ({ children, as }: SelectableCellProps) => JSX.Element;
14
12
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/table",
3
- "version": "0.4.12",
3
+ "version": "0.4.13",
4
4
  "description": "A table is used to display data.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,12 +42,11 @@
42
42
  "dependencies": {
43
43
  "@atlaskit/button": "^16.8.0",
44
44
  "@atlaskit/checkbox": "^12.6.0",
45
- "@atlaskit/ds-explorations": "^2.2.0",
46
45
  "@atlaskit/ds-lib": "^2.2.0",
47
46
  "@atlaskit/focus-ring": "^1.3.0",
48
47
  "@atlaskit/icon": "^21.12.0",
49
48
  "@atlaskit/primitives": "^1.0.0",
50
- "@atlaskit/tokens": "^1.11.0",
49
+ "@atlaskit/tokens": "^1.12.0",
51
50
  "@atlaskit/tooltip": "^17.8.0",
52
51
  "@atlaskit/visually-hidden": "^1.2.0",
53
52
  "@babel/runtime": "^7.0.0",
package/report.api.md CHANGED
@@ -17,26 +17,18 @@
17
17
  ```ts
18
18
  /// <reference types="react" />
19
19
 
20
- import { BoxProps } from '@atlaskit/ds-explorations/box';
20
+ import { BoxProps } from '@atlaskit/primitives';
21
21
  import { FC } from 'react';
22
22
  import { jsx } from '@emotion/react';
23
23
  import { MemoExoticComponent } from 'react';
24
24
  import { default as React_2 } from 'react';
25
25
  import { ReactElement } from 'react';
26
26
  import { ReactNode } from 'react';
27
- import { SerializedStyles } from '@emotion/react';
28
-
29
- // @public (undocumented)
30
- const alignMap: {
31
- readonly text: SerializedStyles;
32
- readonly number: SerializedStyles;
33
- readonly icon: SerializedStyles;
34
- };
35
27
 
36
28
  // @public (undocumented)
37
29
  type BaseCellProps = {
38
30
  width?: string;
39
- align?: keyof typeof alignMap;
31
+ align?: 'icon' | 'number' | 'text';
40
32
  as?: 'td' | 'th';
41
33
  scope?: 'col' | 'row';
42
34
  testId?: string;
@@ -44,7 +36,7 @@ type BaseCellProps = {
44
36
  colSpan?: number;
45
37
  } & Pick<
46
38
  BoxProps,
47
- 'backgroundColor' | 'className' | 'paddingBlock' | 'paddingInline'
39
+ 'backgroundColor' | 'paddingBlock' | 'paddingInline' | 'xcss'
48
40
  >;
49
41
 
50
42
  // @public (undocumented)