@atlaskit/dynamic-table 14.5.5 → 14.6.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,15 @@
1
1
  # @atlaskit/dynamic-table
2
2
 
3
+ ## 14.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`1cc3c9f1c8f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1cc3c9f1c8f) - Add test ID to table pagination so it can be queried in tests. It will be prefixed with the `testId` prop: `{testId}--pagination`.
8
+
9
+ ### Patch Changes
10
+
11
+ - [`0b545855a57`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0b545855a57) - [ux] Updated tokens in `@atlaskit/dynamic-table`
12
+
3
13
  ## 14.5.5
4
14
 
5
15
  ### Patch Changes
@@ -52,7 +52,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
52
52
  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; } }
53
53
 
54
54
  var packageName = "@atlaskit/dynamic-table";
55
- var packageVersion = "14.5.5";
55
+ var packageVersion = "14.6.0";
56
56
 
57
57
  function toggleSortOrder(currentSortOrder) {
58
58
  switch (currentSortOrder) {
@@ -277,7 +277,8 @@ var DynamicTable = /*#__PURE__*/function (_React$Component) {
277
277
  value: page,
278
278
  onChange: this.onSetPage,
279
279
  total: totalPages,
280
- i18n: paginationi18n
280
+ i18n: paginationi18n,
281
+ testId: testId
281
282
  })), !rowsExist && emptyBody && /*#__PURE__*/_react.default.createElement(_LoadingContainer.default, {
282
283
  isLoading: isLoading,
283
284
  spinnerSize: _constants.LARGE,
@@ -59,7 +59,8 @@ var ManagedPagination = /*#__PURE__*/function (_React$Component) {
59
59
  total = _this$props.total,
60
60
  _this$props$value = _this$props.value,
61
61
  value = _this$props$value === void 0 ? 1 : _this$props$value,
62
- i18n = _this$props.i18n;
62
+ i18n = _this$props.i18n,
63
+ testId = _this$props.testId;
63
64
  var pages = (0, _toConsumableArray2.default)(Array(total)).map(function (_, index) {
64
65
  return index + 1;
65
66
  }); // Pagination accepts array now thus selectedIndex starts with 0
@@ -72,7 +73,8 @@ var ManagedPagination = /*#__PURE__*/function (_React$Component) {
72
73
  nextLabel: i18n === null || i18n === void 0 ? void 0 : i18n.next,
73
74
  previousLabel: i18n === null || i18n === void 0 ? void 0 : i18n.prev,
74
75
  onChange: this.onChange,
75
- pages: pages
76
+ pages: pages,
77
+ testId: testId && "".concat(testId, "--pagination")
76
78
  });
77
79
  }
78
80
  }]);
@@ -44,9 +44,9 @@ var rankingStyles = (0, _core.css)({
44
44
 
45
45
  var getHeadStyles = function getHeadStyles(theme) {
46
46
  return (0, _core.css)({
47
- borderBottom: "2px solid ".concat("var(--ds-border, ".concat(_theme.head.borderColor({
47
+ borderBottom: "2px solid ".concat(_theme.head.borderColor({
48
48
  theme: theme
49
- }), ")"))
49
+ }))
50
50
  });
51
51
  };
52
52
 
package/dist/cjs/theme.js CHANGED
@@ -24,16 +24,16 @@ var MSThemeColors = {
24
24
  exports.MSThemeColors = MSThemeColors;
25
25
  var arrow = {
26
26
  defaultColor: (0, _components.themed)({
27
- light: "var(--ds-background-neutral, ".concat(colors.N40, ")"),
28
- dark: "var(--ds-background-neutral, ".concat(colors.DN40, ")")
27
+ light: "var(--ds-icon-disabled, ".concat(colors.N40, ")"),
28
+ dark: "var(--ds-icon-disabled, ".concat(colors.DN40, ")")
29
29
  }),
30
30
  selectedColor: (0, _components.themed)({
31
- light: "var(--ds-text-subtlest, ".concat(colors.N300, ")"),
32
- dark: "var(--ds-text-subtlest, ".concat(colors.DN300, ")")
31
+ light: "var(--ds-icon-subtle, ".concat(colors.N300, ")"),
32
+ dark: "var(--ds-icon-subtle, ".concat(colors.DN300, ")")
33
33
  }),
34
34
  hoverColor: (0, _components.themed)({
35
- light: "var(--ds-background-neutral-pressed, ".concat(colors.N60, ")"),
36
- dark: "var(--ds-background-neutral-pressed, ".concat(colors.DN60, ")")
35
+ light: "var(--ds-icon-disabled, ".concat(colors.N60, ")"),
36
+ dark: "var(--ds-icon-disabled, ".concat(colors.DN60, ")")
37
37
  })
38
38
  };
39
39
  exports.arrow = arrow;
@@ -47,8 +47,8 @@ var row = {
47
47
  dark: "var(--ds-background-selected, ".concat(colors.DN50, ")")
48
48
  }),
49
49
  hoverBackground: (0, _components.themed)({
50
- light: "var(--ds-background-input, ".concat(colors.N10, ")"),
51
- dark: "var(--ds-background-input, ".concat(colors.DN40, ")")
50
+ light: "var(--ds-background-neutral-subtle-hovered, ".concat(colors.N10, ")"),
51
+ dark: "var(--ds-background-neutral-subtle-hovered, ".concat(colors.DN40, ")")
52
52
  }),
53
53
  hoverHighlightedBackground: (0, _components.themed)({
54
54
  light: "var(--ds-background-selected-hovered, ".concat(colors.B75, ")"),
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.5.5",
3
+ "version": "14.6.0",
4
4
  "sideEffects": false
5
5
  }
@@ -13,7 +13,7 @@ import ManagedPagination from './managed-pagination';
13
13
  import RankableTableBody from './rankable/Body';
14
14
  import TableHead from './TableHead';
15
15
  const packageName = "@atlaskit/dynamic-table";
16
- const packageVersion = "14.5.5";
16
+ const packageVersion = "14.6.0";
17
17
 
18
18
  function toggleSortOrder(currentSortOrder) {
19
19
  switch (currentSortOrder) {
@@ -230,7 +230,8 @@ class DynamicTable extends React.Component {
230
230
  value: page,
231
231
  onChange: this.onSetPage,
232
232
  total: totalPages,
233
- i18n: paginationi18n
233
+ i18n: paginationi18n,
234
+ testId: testId
234
235
  })), !rowsExist && emptyBody && /*#__PURE__*/React.createElement(LoadingContainer, {
235
236
  isLoading: isLoading,
236
237
  spinnerSize: LARGE,
@@ -14,7 +14,8 @@ export default class ManagedPagination extends React.Component {
14
14
  const {
15
15
  total,
16
16
  value = 1,
17
- i18n
17
+ i18n,
18
+ testId
18
19
  } = this.props;
19
20
  const pages = [...Array(total)].map((_, index) => index + 1); // Pagination accepts array now thus selectedIndex starts with 0
20
21
  // So, we are substracting value by one thus not breaking dynamic table
@@ -26,7 +27,8 @@ export default class ManagedPagination extends React.Component {
26
27
  nextLabel: i18n === null || i18n === void 0 ? void 0 : i18n.next,
27
28
  previousLabel: i18n === null || i18n === void 0 ? void 0 : i18n.prev,
28
29
  onChange: this.onChange,
29
- pages: pages
30
+ pages: pages,
31
+ testId: testId && `${testId}--pagination`
30
32
  });
31
33
  }
32
34
 
@@ -16,9 +16,9 @@ const rankingStyles = css({
16
16
  });
17
17
 
18
18
  const getHeadStyles = theme => css({
19
- borderBottom: `2px solid ${`var(--ds-border, ${head.borderColor({
19
+ borderBottom: `2px solid ${head.borderColor({
20
20
  theme
21
- })})`}`
21
+ })}`
22
22
  });
23
23
 
24
24
  export const Head = ({
@@ -8,16 +8,16 @@ export const MSThemeColors = {
8
8
  };
9
9
  export const arrow = {
10
10
  defaultColor: themed({
11
- light: `var(--ds-background-neutral, ${colors.N40})`,
12
- dark: `var(--ds-background-neutral, ${colors.DN40})`
11
+ light: `var(--ds-icon-disabled, ${colors.N40})`,
12
+ dark: `var(--ds-icon-disabled, ${colors.DN40})`
13
13
  }),
14
14
  selectedColor: themed({
15
- light: `var(--ds-text-subtlest, ${colors.N300})`,
16
- dark: `var(--ds-text-subtlest, ${colors.DN300})`
15
+ light: `var(--ds-icon-subtle, ${colors.N300})`,
16
+ dark: `var(--ds-icon-subtle, ${colors.DN300})`
17
17
  }),
18
18
  hoverColor: themed({
19
- light: `var(--ds-background-neutral-pressed, ${colors.N60})`,
20
- dark: `var(--ds-background-neutral-pressed, ${colors.DN60})`
19
+ light: `var(--ds-icon-disabled, ${colors.N60})`,
20
+ dark: `var(--ds-icon-disabled, ${colors.DN60})`
21
21
  })
22
22
  };
23
23
  export const row = {
@@ -30,8 +30,8 @@ export const row = {
30
30
  dark: `var(--ds-background-selected, ${colors.DN50})`
31
31
  }),
32
32
  hoverBackground: themed({
33
- light: `var(--ds-background-input, ${colors.N10})`,
34
- dark: `var(--ds-background-input, ${colors.DN40})`
33
+ light: `var(--ds-background-neutral-subtle-hovered, ${colors.N10})`,
34
+ dark: `var(--ds-background-neutral-subtle-hovered, ${colors.DN40})`
35
35
  }),
36
36
  hoverHighlightedBackground: themed({
37
37
  light: `var(--ds-background-selected-hovered, ${colors.B75})`,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.5.5",
3
+ "version": "14.6.0",
4
4
  "sideEffects": false
5
5
  }
@@ -24,7 +24,7 @@ import ManagedPagination from './managed-pagination';
24
24
  import RankableTableBody from './rankable/Body';
25
25
  import TableHead from './TableHead';
26
26
  var packageName = "@atlaskit/dynamic-table";
27
- var packageVersion = "14.5.5";
27
+ var packageVersion = "14.6.0";
28
28
 
29
29
  function toggleSortOrder(currentSortOrder) {
30
30
  switch (currentSortOrder) {
@@ -257,7 +257,8 @@ var DynamicTable = /*#__PURE__*/function (_React$Component) {
257
257
  value: page,
258
258
  onChange: this.onSetPage,
259
259
  total: totalPages,
260
- i18n: paginationi18n
260
+ i18n: paginationi18n,
261
+ testId: testId
261
262
  })), !rowsExist && emptyBody && /*#__PURE__*/React.createElement(LoadingContainer, {
262
263
  isLoading: isLoading,
263
264
  spinnerSize: LARGE,
@@ -44,7 +44,8 @@ var ManagedPagination = /*#__PURE__*/function (_React$Component) {
44
44
  total = _this$props.total,
45
45
  _this$props$value = _this$props.value,
46
46
  value = _this$props$value === void 0 ? 1 : _this$props$value,
47
- i18n = _this$props.i18n;
47
+ i18n = _this$props.i18n,
48
+ testId = _this$props.testId;
48
49
 
49
50
  var pages = _toConsumableArray(Array(total)).map(function (_, index) {
50
51
  return index + 1;
@@ -59,7 +60,8 @@ var ManagedPagination = /*#__PURE__*/function (_React$Component) {
59
60
  nextLabel: i18n === null || i18n === void 0 ? void 0 : i18n.next,
60
61
  previousLabel: i18n === null || i18n === void 0 ? void 0 : i18n.prev,
61
62
  onChange: this.onChange,
62
- pages: pages
63
+ pages: pages,
64
+ testId: testId && "".concat(testId, "--pagination")
63
65
  });
64
66
  }
65
67
  }]);
@@ -25,9 +25,9 @@ var rankingStyles = css({
25
25
 
26
26
  var getHeadStyles = function getHeadStyles(theme) {
27
27
  return css({
28
- borderBottom: "2px solid ".concat("var(--ds-border, ".concat(head.borderColor({
28
+ borderBottom: "2px solid ".concat(head.borderColor({
29
29
  theme: theme
30
- }), ")"))
30
+ }))
31
31
  });
32
32
  };
33
33
 
package/dist/esm/theme.js CHANGED
@@ -8,16 +8,16 @@ export var MSThemeColors = {
8
8
  };
9
9
  export var arrow = {
10
10
  defaultColor: themed({
11
- light: "var(--ds-background-neutral, ".concat(colors.N40, ")"),
12
- dark: "var(--ds-background-neutral, ".concat(colors.DN40, ")")
11
+ light: "var(--ds-icon-disabled, ".concat(colors.N40, ")"),
12
+ dark: "var(--ds-icon-disabled, ".concat(colors.DN40, ")")
13
13
  }),
14
14
  selectedColor: themed({
15
- light: "var(--ds-text-subtlest, ".concat(colors.N300, ")"),
16
- dark: "var(--ds-text-subtlest, ".concat(colors.DN300, ")")
15
+ light: "var(--ds-icon-subtle, ".concat(colors.N300, ")"),
16
+ dark: "var(--ds-icon-subtle, ".concat(colors.DN300, ")")
17
17
  }),
18
18
  hoverColor: themed({
19
- light: "var(--ds-background-neutral-pressed, ".concat(colors.N60, ")"),
20
- dark: "var(--ds-background-neutral-pressed, ".concat(colors.DN60, ")")
19
+ light: "var(--ds-icon-disabled, ".concat(colors.N60, ")"),
20
+ dark: "var(--ds-icon-disabled, ".concat(colors.DN60, ")")
21
21
  })
22
22
  };
23
23
  export var row = {
@@ -30,8 +30,8 @@ export var row = {
30
30
  dark: "var(--ds-background-selected, ".concat(colors.DN50, ")")
31
31
  }),
32
32
  hoverBackground: themed({
33
- light: "var(--ds-background-input, ".concat(colors.N10, ")"),
34
- dark: "var(--ds-background-input, ".concat(colors.DN40, ")")
33
+ light: "var(--ds-background-neutral-subtle-hovered, ".concat(colors.N10, ")"),
34
+ dark: "var(--ds-background-neutral-subtle-hovered, ".concat(colors.DN40, ")")
35
35
  }),
36
36
  hoverHighlightedBackground: themed({
37
37
  light: "var(--ds-background-selected-hovered, ".concat(colors.B75, ")"),
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.5.5",
3
+ "version": "14.6.0",
4
4
  "sideEffects": false
5
5
  }
@@ -6,6 +6,7 @@ interface ManagedPaginationProps {
6
6
  onChange: (newValue: any, analyticsEvent?: UIAnalyticsEvent) => void;
7
7
  total: number;
8
8
  i18n?: I18nShape;
9
+ testId?: string;
9
10
  }
10
11
  export default class ManagedPagination extends React.Component<ManagedPaginationProps> {
11
12
  onChange: (_event: any, newValue: any, analyticsEvent?: UIAnalyticsEvent | undefined) => void;
@@ -5,14 +5,14 @@ export declare const MSThemeColors: {
5
5
  SelectedText: string;
6
6
  };
7
7
  export declare const arrow: {
8
- defaultColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-neutral)">;
9
- selectedColor: import("@atlaskit/theme").ThemedValue<"var(--ds-text-subtlest)">;
10
- hoverColor: import("@atlaskit/theme").ThemedValue<"var(--ds-background-neutral-pressed)">;
8
+ defaultColor: import("@atlaskit/theme").ThemedValue<"var(--ds-icon-disabled)">;
9
+ selectedColor: import("@atlaskit/theme").ThemedValue<"var(--ds-icon-subtle)">;
10
+ hoverColor: import("@atlaskit/theme").ThemedValue<"var(--ds-icon-disabled)">;
11
11
  };
12
12
  export declare const row: {
13
13
  focusOutline: import("@atlaskit/theme").ThemedValue<"var(--ds-border-focused)">;
14
14
  highlightedBackground: import("@atlaskit/theme").ThemedValue<"var(--ds-background-selected)">;
15
- hoverBackground: import("@atlaskit/theme").ThemedValue<"var(--ds-background-input)">;
15
+ hoverBackground: import("@atlaskit/theme").ThemedValue<"var(--ds-background-neutral-subtle-hovered)">;
16
16
  hoverHighlightedBackground: import("@atlaskit/theme").ThemedValue<"var(--ds-background-selected-hovered)">;
17
17
  };
18
18
  export declare const head: {
@@ -134,13 +134,14 @@ export interface StatelessProps extends WithAnalyticsEventsProps {
134
134
  `data-testid` in the rendered code, serving as a hook for automated tests.
135
135
 
136
136
  The value of `testId` is used to prefix `testId` props in given elements.
137
- + `${testId}--table` - Table.
138
- + `${testId}--head` - Table header.
139
- + `${testId}--head--{content of the cell}` - Table header cell can be identified by their content.
140
- + `${testId}--row--{index - content of the first cell}` - Table row.
141
- + `${testId}--body` - Table body.
142
- + `${testId}--body--{content of the cell}` - Table body cell can be identified by their content.
143
- + `${testId}--loadingSpinner` - The spinner overlaid when loading.
137
+ - `{testId}--table` - Table.
138
+ - `{testId}--head` - Table header.
139
+ - `{testId}--head--{content of the cell}` - Table header cell can be identified by their content.
140
+ - `{testId}--row--{index - content of the first cell}` - Table row.
141
+ - `{testId}--body` - Table body.
142
+ - `{testId}--body--{content of the cell}` - Table body cell can be identified by their content.
143
+ - `{testId}--loadingSpinner` - The spinner overlaid when loading.
144
+ - `{testId}--pagination` - The table pagination.
144
145
  */
145
146
  testId?: string;
146
147
  /**
@@ -265,13 +266,14 @@ export interface StatefulProps extends WithAnalyticsEventsProps {
265
266
  `data-testid` in the rendered code, serving as a hook for automated tests.
266
267
 
267
268
  The value of `testId` is used to prefix `testId` props in given elements.
268
- + `${testId}--table` - Table.
269
- + `${testId}--head` - Table header.
270
- + `${testId}--head--{content of the cell}` - Table header cell can be identified by their content.
271
- + `${testId}--row--{index - content of the first cell}` - Table row.
272
- + `${testId}--body` - Table body.
273
- + `${testId}--body--{content of the cell}` - Table body cell can be identified by their content.
274
- + `${testId}--loadingSpinner` - The spinner overlaid when loading.
269
+ - `{testId}--table` - Table.
270
+ - `{testId}--head` - Table header.
271
+ - `{testId}--head--{content of the cell}` - Table header cell can be identified by their content.
272
+ - `{testId}--row--{index - content of the first cell}` - Table row.
273
+ - `{testId}--body` - Table body.
274
+ - `{testId}--body--{content of the cell}` - Table body cell can be identified by their content.
275
+ - `{testId}--loadingSpinner` - The spinner overlaid when loading.
276
+ - `{testId}--pagination` - The table pagination.
275
277
  */
276
278
  testId?: string;
277
279
  /**
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.5.5",
3
+ "version": "14.6.0",
4
4
  "description": "A dynamic table displays rows of data with built-in pagination, sorting, and re-ordering functionality.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
7
7
  },
8
8
  "homepage": "https://atlassian.design/components/dynamic-table/",
9
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
9
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
10
10
  "author": "Atlassian Pty Ltd",
11
11
  "license": "Apache-2.0",
12
12
  "main": "dist/cjs/index.js",
@@ -38,10 +38,10 @@
38
38
  "react-dom": "^16.8.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@atlaskit/avatar": "^20.5.0",
41
+ "@atlaskit/avatar": "^21.0.0",
42
42
  "@atlaskit/button": "^16.3.0",
43
43
  "@atlaskit/docs": "*",
44
- "@atlaskit/dropdown-menu": "^11.1.0",
44
+ "@atlaskit/dropdown-menu": "^11.2.0",
45
45
  "@atlaskit/ssr": "*",
46
46
  "@atlaskit/toggle": "^12.4.0",
47
47
  "@atlaskit/visual-regression": "*",