@atlaskit/table 0.2.3 → 0.2.5

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
2
2
 
3
+ ## 0.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`261420360ec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/261420360ec) - Upgrades component types to support React 18.
8
+
9
+ ## 0.2.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [`cfe48bb7ece`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cfe48bb7ece) - Internal change only. Replace usages of Inline/Stack with stable version from `@atlaskit/primitives`.
14
+
3
15
  ## 0.2.3
4
16
 
5
17
  ### Patch Changes
package/dist/cjs/thead.js CHANGED
@@ -10,6 +10,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
10
10
  var _react = require("@emotion/react");
11
11
  var _checkbox = _interopRequireDefault(require("@atlaskit/checkbox"));
12
12
  var _dsExplorations = require("@atlaskit/ds-explorations");
13
+ var _inline = _interopRequireDefault(require("@atlaskit/primitives/inline"));
13
14
  var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
14
15
  var _selectionProvider = require("./hooks/selection-provider");
15
16
  var _useTable2 = require("./hooks/use-table");
@@ -49,8 +50,8 @@ var THead = function THead(_ref) {
49
50
  })), children, isChecked && (0, _react.jsx)(Primitives.BulkActionOverlay, null, (0, _react.jsx)(_dsExplorations.UNSAFE_Text, {
50
51
  color: "color.text",
51
52
  fontWeight: "medium"
52
- }, state.checked.length, " selected"), actions && (0, _react.jsx)(_dsExplorations.UNSAFE_Inline, {
53
- gap: "space.100"
53
+ }, state.checked.length, " selected"), actions && (0, _react.jsx)(_inline.default, {
54
+ space: "100"
54
55
  }, actions(state.checked)))));
55
56
  };
56
57
  var _default = THead;
@@ -8,13 +8,13 @@ exports.BaseCell = void 0;
8
8
  var _react = require("react");
9
9
  var _react2 = require("@emotion/react");
10
10
  var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box"));
11
- var _inline = _interopRequireDefault(require("@atlaskit/ds-explorations/inline"));
11
+ var _inline = _interopRequireDefault(require("@atlaskit/primitives/inline"));
12
12
  /* eslint-disable @atlassian/tangerine/import/entry-points */
13
13
  /** @jsx jsx */
14
14
 
15
15
  var alignMap = {
16
- text: 'flexStart',
17
- number: 'flexEnd',
16
+ text: 'start',
17
+ number: 'end',
18
18
  icon: 'center'
19
19
  };
20
20
  var baseResetStyles = (0, _react2.css)({
@@ -65,8 +65,8 @@ var BaseCell = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
65
65
  } : undefined,
66
66
  "aria-sort": sortDirection
67
67
  }, (0, _react2.jsx)(_inline.default, {
68
- justifyContent: alignMap[align],
69
- gap: "space.0"
68
+ alignInline: alignMap[align],
69
+ space: "0"
70
70
  }, children));
71
71
  });
72
72
  exports.BaseCell = BaseCell;
@@ -1,11 +1,13 @@
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.BulkActionOverlay = void 0;
7
8
  var _react = require("@emotion/react");
8
9
  var _dsExplorations = require("@atlaskit/ds-explorations");
10
+ var _inline = _interopRequireDefault(require("@atlaskit/primitives/inline"));
9
11
  /** @jsx jsx */
10
12
 
11
13
  var overlayStyles = (0, _react.css)({
@@ -28,9 +30,9 @@ var BulkActionOverlay = function BulkActionOverlay(_ref) {
28
30
  paddingInline: "space.100",
29
31
  backgroundColor: "elevation.surface",
30
32
  css: overlayStyles
31
- }, (0, _react.jsx)(_dsExplorations.UNSAFE_Inline, {
32
- gap: "space.300",
33
- alignItems: "center"
33
+ }, (0, _react.jsx)(_inline.default, {
34
+ space: "300",
35
+ alignBlock: "center"
34
36
  }, children));
35
37
  };
36
38
  exports.BulkActionOverlay = BulkActionOverlay;
@@ -18,7 +18,6 @@ var spacingStyles = (0, _react.css)({
18
18
  paddingLeft: '8px !important'
19
19
  }
20
20
  });
21
-
22
21
  /**
23
22
  * __Selectable cell__
24
23
  *
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/table",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "sideEffects": false
5
5
  }
@@ -2,7 +2,8 @@
2
2
 
3
3
  import { jsx } from '@emotion/react';
4
4
  import Checkbox from '@atlaskit/checkbox';
5
- import { UNSAFE_Inline as Inline, UNSAFE_Text as Text } from '@atlaskit/ds-explorations';
5
+ import { UNSAFE_Text as Text } from '@atlaskit/ds-explorations';
6
+ import Inline from '@atlaskit/primitives/inline';
6
7
  import VisuallyHidden from '@atlaskit/visually-hidden';
7
8
  import { useSelection } from './hooks/selection-provider';
8
9
  import { useTable } from './hooks/use-table';
@@ -39,7 +40,7 @@ const THead = ({
39
40
  color: "color.text",
40
41
  fontWeight: "medium"
41
42
  }, state.checked.length, " selected"), actions && jsx(Inline, {
42
- gap: "space.100"
43
+ space: "100"
43
44
  }, actions(state.checked)))));
44
45
  };
45
46
  export default THead;
@@ -3,10 +3,10 @@
3
3
  import { forwardRef } from 'react';
4
4
  import { css, jsx } from '@emotion/react';
5
5
  import Box from '@atlaskit/ds-explorations/box';
6
- import Inline from '@atlaskit/ds-explorations/inline';
6
+ import Inline from '@atlaskit/primitives/inline';
7
7
  const alignMap = {
8
- text: 'flexStart',
9
- number: 'flexEnd',
8
+ text: 'start',
9
+ number: 'end',
10
10
  icon: 'center'
11
11
  };
12
12
  const baseResetStyles = css({
@@ -54,6 +54,6 @@ export const BaseCell = /*#__PURE__*/forwardRef(({
54
54
  } : undefined,
55
55
  "aria-sort": sortDirection
56
56
  }, jsx(Inline, {
57
- justifyContent: alignMap[align],
58
- gap: "space.0"
57
+ alignInline: alignMap[align],
58
+ space: "0"
59
59
  }, children)));
@@ -1,7 +1,8 @@
1
1
  /** @jsx jsx */
2
2
 
3
3
  import { css, jsx } from '@emotion/react';
4
- import { UNSAFE_Box as Box, UNSAFE_Inline as Inline } from '@atlaskit/ds-explorations';
4
+ import { UNSAFE_Box as Box } from '@atlaskit/ds-explorations';
5
+ import Inline from '@atlaskit/primitives/inline';
5
6
  const overlayStyles = css({
6
7
  top: 0,
7
8
  right: 0,
@@ -23,6 +24,6 @@ export const BulkActionOverlay = ({
23
24
  backgroundColor: "elevation.surface",
24
25
  css: overlayStyles
25
26
  }, jsx(Inline, {
26
- gap: "space.300",
27
- alignItems: "center"
27
+ space: "300",
28
+ alignBlock: "center"
28
29
  }, children));
@@ -12,7 +12,6 @@ const spacingStyles = css({
12
12
  paddingLeft: '8px !important'
13
13
  }
14
14
  });
15
-
16
15
  /**
17
16
  * __Selectable cell__
18
17
  *
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/table",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "sideEffects": false
5
5
  }
package/dist/esm/thead.js CHANGED
@@ -3,7 +3,8 @@ 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_Inline as Inline, UNSAFE_Text as Text } from '@atlaskit/ds-explorations';
6
+ import { UNSAFE_Text as Text } from '@atlaskit/ds-explorations';
7
+ import Inline from '@atlaskit/primitives/inline';
7
8
  import VisuallyHidden from '@atlaskit/visually-hidden';
8
9
  import { useSelection } from './hooks/selection-provider';
9
10
  import { useTable } from './hooks/use-table';
@@ -40,7 +41,7 @@ var THead = function THead(_ref) {
40
41
  color: "color.text",
41
42
  fontWeight: "medium"
42
43
  }, state.checked.length, " selected"), actions && jsx(Inline, {
43
- gap: "space.100"
44
+ space: "100"
44
45
  }, actions(state.checked)))));
45
46
  };
46
47
  export default THead;
@@ -3,10 +3,10 @@
3
3
  import { forwardRef } from 'react';
4
4
  import { css, jsx } from '@emotion/react';
5
5
  import Box from '@atlaskit/ds-explorations/box';
6
- import Inline from '@atlaskit/ds-explorations/inline';
6
+ import Inline from '@atlaskit/primitives/inline';
7
7
  var alignMap = {
8
- text: 'flexStart',
9
- number: 'flexEnd',
8
+ text: 'start',
9
+ number: 'end',
10
10
  icon: 'center'
11
11
  };
12
12
  var baseResetStyles = css({
@@ -57,7 +57,7 @@ export var BaseCell = /*#__PURE__*/forwardRef(function (_ref, ref) {
57
57
  } : undefined,
58
58
  "aria-sort": sortDirection
59
59
  }, jsx(Inline, {
60
- justifyContent: alignMap[align],
61
- gap: "space.0"
60
+ alignInline: alignMap[align],
61
+ space: "0"
62
62
  }, children));
63
63
  });
@@ -1,7 +1,8 @@
1
1
  /** @jsx jsx */
2
2
 
3
3
  import { css, jsx } from '@emotion/react';
4
- import { UNSAFE_Box as Box, UNSAFE_Inline as Inline } from '@atlaskit/ds-explorations';
4
+ import { UNSAFE_Box as Box } from '@atlaskit/ds-explorations';
5
+ import Inline from '@atlaskit/primitives/inline';
5
6
  var overlayStyles = css({
6
7
  top: 0,
7
8
  right: 0,
@@ -23,7 +24,7 @@ export var BulkActionOverlay = function BulkActionOverlay(_ref) {
23
24
  backgroundColor: "elevation.surface",
24
25
  css: overlayStyles
25
26
  }, jsx(Inline, {
26
- gap: "space.300",
27
- alignItems: "center"
27
+ space: "300",
28
+ alignBlock: "center"
28
29
  }, children));
29
30
  };
@@ -12,7 +12,6 @@ var spacingStyles = css({
12
12
  paddingLeft: '8px !important'
13
13
  }
14
14
  });
15
-
16
15
  /**
17
16
  * __Selectable cell__
18
17
  *
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/table",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,4 @@
1
- import React, { FC } from 'react';
1
+ import React, { FC, ReactNode } from 'react';
2
2
  import { SelectableActions, SelectableState } from './use-selectable';
3
3
  declare type SelectionContext = [
4
4
  SelectableState,
@@ -17,6 +17,8 @@ declare const SelectionContext: React.Context<SelectionContext>;
17
17
  * - [Code](https://atlassian.design/components/{packageName}/code)
18
18
  * - [Usage](https://atlassian.design/components/{packageName}/usage)
19
19
  */
20
- declare const SelectionProvider: FC;
20
+ declare const SelectionProvider: FC<{
21
+ children: ReactNode;
22
+ }>;
21
23
  export declare const useSelection: () => SelectionContext;
22
24
  export default SelectionProvider;
@@ -1,11 +1,15 @@
1
1
  /** @jsx jsx */
2
- import { FC } from 'react';
2
+ import { FC, ReactNode } from 'react';
3
3
  export declare type RowProps = {
4
4
  /**
5
5
  * A `testId` prop is a unique string that appears as a data attribute `data-testid`
6
6
  * in the rendered code, serving as a hook for automated tests.
7
7
  */
8
8
  testId?: string;
9
+ /**
10
+ * Content of the row.
11
+ */
12
+ children?: ReactNode;
9
13
  };
10
14
  /**
11
15
  * __Row__
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { FC } from 'react';
2
+ import { FC, ReactNode } from 'react';
3
3
  export interface CellProps {
4
4
  /**
5
5
  * Unique key used for sorting table data by this column
@@ -11,6 +11,7 @@ export interface CellProps {
11
11
  */
12
12
  testId?: string;
13
13
  onClick?: React.MouseEventHandler;
14
+ children?: ReactNode;
14
15
  }
15
16
  /**
16
17
  * __SortableColumn__
@@ -2,6 +2,7 @@
2
2
  import { FC, ReactNode } from 'react';
3
3
  declare type THeadProps = {
4
4
  actions?: (selected: number[]) => ReactNode;
5
+ children?: ReactNode;
5
6
  };
6
7
  declare const THead: FC<THeadProps>;
7
8
  export default THead;
@@ -35,8 +35,8 @@ export declare type BaseCellProps = {
35
35
  */
36
36
  export declare type SortDirection = 'ascending' | 'descending' | 'none' | 'other';
37
37
  declare const alignMap: {
38
- readonly text: "flexStart";
39
- readonly number: "flexEnd";
38
+ readonly text: "start";
39
+ readonly number: "end";
40
40
  readonly icon: "center";
41
41
  };
42
42
  /**
@@ -1,8 +1,10 @@
1
1
  /** @jsx jsx */
2
- import { FC } from 'react';
2
+ import { FC, ReactNode } from 'react';
3
3
  /**
4
4
  * __Bulk action overlay__
5
5
  *
6
6
  * A bulk action overlay is used to conditionally render when a user makes a row selection
7
7
  */
8
- export declare const BulkActionOverlay: FC;
8
+ export declare const BulkActionOverlay: FC<{
9
+ children: ReactNode;
10
+ }>;
@@ -1,10 +1,13 @@
1
1
  /** @jsx jsx */
2
- import { FC } from 'react';
2
+ import { FC, ReactNode } from 'react';
3
+ declare type SelectableCellProps = {
4
+ as: 'td' | 'th';
5
+ children?: ReactNode;
6
+ };
3
7
  /**
4
8
  * __Selectable cell__
5
9
  *
6
10
  * A selectable cell primitive designed to be used for light weight composition.
7
11
  */
8
- export declare const SelectableCell: FC<{
9
- as: 'td' | 'th';
10
- }>;
12
+ export declare const SelectableCell: FC<SelectableCellProps>;
13
+ export {};
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { FC } from 'react';
2
+ import { FC, ReactNode } from 'react';
3
3
  declare type TableProps = {
4
4
  /**
5
5
  * A `testId` prop is a unique string that appears as a data attribute `data-testid`
@@ -12,6 +12,10 @@ declare type TableProps = {
12
12
  * @see 'https://www.w3.org/WAI/EO/Drafts/tutorials/tables/summary/'
13
13
  */
14
14
  summary?: string;
15
+ /**
16
+ * Table content.
17
+ */
18
+ children: ReactNode;
15
19
  };
16
20
  /**
17
21
  * __Table__
@@ -1,8 +1,10 @@
1
1
  /** @jsx jsx */
2
- import { FC } from 'react';
2
+ import { FC, ReactNode } from 'react';
3
3
  /**
4
4
  * __TBody__
5
5
  * @primitive
6
6
  */
7
- export declare const TBody: FC;
7
+ export declare const TBody: FC<{
8
+ children: ReactNode;
9
+ }>;
8
10
  export default TBody;
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { FC } from 'react';
2
+ import { FC, ReactNode } from 'react';
3
3
  /**
4
4
  * __THead__
5
5
  *
@@ -7,4 +7,6 @@ import { FC } from 'react';
7
7
  *
8
8
  * @primitive
9
9
  */
10
- export declare const THead: FC;
10
+ export declare const THead: FC<{
11
+ children?: ReactNode;
12
+ }>;
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { FC } from 'react';
2
+ import { FC, ReactNode } from 'react';
3
3
  interface TRProps {
4
4
  /**
5
5
  * A `testId` prop is a unique string that appears as a data attribute `data-testid`
@@ -14,6 +14,10 @@ interface TRProps {
14
14
  * Adjust the behavior of the element depending on whether the row is in the `THead` or in the `TBody`.
15
15
  */
16
16
  isBodyRow?: boolean;
17
+ /**
18
+ * Content of the row.
19
+ */
20
+ children?: ReactNode;
17
21
  }
18
22
  /**
19
23
  * __Row__
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/table",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "A table is used to display data.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,6 +38,7 @@
38
38
  "@atlaskit/ds-lib": "^2.1.2",
39
39
  "@atlaskit/focus-ring": "^1.2.1",
40
40
  "@atlaskit/icon": "^21.11.2",
41
+ "@atlaskit/primitives": "^0.3.0",
41
42
  "@atlaskit/tokens": "^1.2.0",
42
43
  "@atlaskit/tooltip": "^17.7.0",
43
44
  "@atlaskit/visually-hidden": "^1.0.0",
package/report.api.md CHANGED
@@ -23,8 +23,8 @@ import { ReactNode } from 'react';
23
23
 
24
24
  // @public (undocumented)
25
25
  const alignMap: {
26
- readonly text: 'flexStart';
27
- readonly number: 'flexEnd';
26
+ readonly text: 'start';
27
+ readonly number: 'end';
28
28
  readonly icon: 'center';
29
29
  };
30
30
 
@@ -57,6 +57,8 @@ export const Cell: FC<Omit<BaseCellProps, 'as'>>;
57
57
 
58
58
  // @public (undocumented)
59
59
  interface CellProps {
60
+ // (undocumented)
61
+ children?: ReactNode;
60
62
  name: string;
61
63
  // (undocumented)
62
64
  onClick?: React.MouseEventHandler;
@@ -72,6 +74,7 @@ export const Row: FC<RowProps>;
72
74
  // @public (undocumented)
73
75
  type RowProps = {
74
76
  testId?: string;
77
+ children?: ReactNode;
75
78
  };
76
79
 
77
80
  // @public
@@ -116,6 +119,7 @@ export const THead: FC<THeadProps>;
116
119
  // @public (undocumented)
117
120
  type THeadProps = {
118
121
  actions?: (selected: number[]) => ReactNode;
122
+ children?: ReactNode;
119
123
  };
120
124
 
121
125
  // @public (undocumented)
@@ -12,8 +12,8 @@ import { ReactNode } from 'react';
12
12
 
13
13
  // @public (undocumented)
14
14
  const alignMap: {
15
- readonly text: "flexStart";
16
- readonly number: "flexEnd";
15
+ readonly text: "start";
16
+ readonly number: "end";
17
17
  readonly icon: "center";
18
18
  };
19
19
 
@@ -41,6 +41,8 @@ export const Cell: FC<Omit<BaseCellProps, 'as'>>;
41
41
 
42
42
  // @public (undocumented)
43
43
  interface CellProps {
44
+ // (undocumented)
45
+ children?: ReactNode;
44
46
  name: string;
45
47
  // (undocumented)
46
48
  onClick?: React.MouseEventHandler;
@@ -56,6 +58,7 @@ export const Row: FC<RowProps>;
56
58
  // @public (undocumented)
57
59
  type RowProps = {
58
60
  testId?: string;
61
+ children?: ReactNode;
59
62
  };
60
63
 
61
64
  // @public
@@ -89,6 +92,7 @@ export const THead: FC<THeadProps>;
89
92
  // @public (undocumented)
90
93
  type THeadProps = {
91
94
  actions?: (selected: number[]) => ReactNode;
95
+ children?: ReactNode;
92
96
  };
93
97
 
94
98
  // @public (undocumented)