@atlaskit/empty-state 7.5.2 → 7.6.1

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/empty-state
2
2
 
3
+ ## 7.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4ae083a7e66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ae083a7e66) - Use `@af/accessibility-testing` for default jest-axe config and jest-axe import in accessibility testing.
8
+
9
+ ## 7.6.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`56d11ec914b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56d11ec914b) - Add a new prop `headingLevel` to set the heading level in the header element.
14
+
3
15
  ## 7.5.2
4
16
 
5
17
  ### Patch Changes
@@ -34,6 +34,8 @@ var _styled = require("./styled");
34
34
  var EmptyState = function EmptyState(_ref) {
35
35
  var description = _ref.description,
36
36
  header = _ref.header,
37
+ _ref$headingLevel = _ref.headingLevel,
38
+ headingLevel = _ref$headingLevel === void 0 ? 4 : _ref$headingLevel,
37
39
  imageHeight = _ref.imageHeight,
38
40
  imageUrl = _ref.imageUrl,
39
41
  imageWidth = _ref.imageWidth,
@@ -66,7 +68,9 @@ var EmptyState = function EmptyState(_ref) {
66
68
  maxImageHeight: maxImageHeight,
67
69
  imageWidth: imageWidth,
68
70
  imageHeight: imageHeight
69
- }), /*#__PURE__*/_react.default.createElement(_styled.Header, null, header), description && /*#__PURE__*/_react.default.createElement(_styled.Description, null, description), actionsContainer, tertiaryAction);
71
+ }), /*#__PURE__*/_react.default.createElement(_styled.Header, {
72
+ level: headingLevel
73
+ }, header), description && /*#__PURE__*/_react.default.createElement(_styled.Description, null, description), actionsContainer, tertiaryAction);
70
74
  };
71
75
  var _default = EmptyState;
72
76
  exports.default = _default;
@@ -15,7 +15,7 @@ var verticalMarginSize = "var(--ds-space-600, 48px)";
15
15
  var columnWidth = gridSize * 8;
16
16
  var gutter = gridSize * 2;
17
17
  var containerStyles = (0, _react.css)({
18
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
18
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
19
19
  margin: "".concat(verticalMarginSize, " auto"),
20
20
  textAlign: 'center'
21
21
  });
@@ -8,7 +8,7 @@ var _react = require("@emotion/react");
8
8
  var _typography = require("@atlaskit/theme/typography");
9
9
  /** @jsx jsx */
10
10
 
11
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
11
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
12
12
  var headerStyles = (0, _react.css)([(0, _typography.h600)(), {
13
13
  marginTop: "var(--ds-space-0, 0px)",
14
14
  marginBottom: "var(--ds-space-200, 16px)"
@@ -22,8 +22,11 @@ var headerStyles = (0, _react.css)([(0, _typography.h600)(), {
22
22
  * @internal
23
23
  */
24
24
  var EmptyStateHeader = function EmptyStateHeader(_ref) {
25
- var children = _ref.children;
26
- return (0, _react.jsx)("h4", {
25
+ var children = _ref.children,
26
+ _ref$level = _ref.level,
27
+ level = _ref$level === void 0 ? 4 : _ref$level;
28
+ var Tag = "h".concat(level > 0 && level < 7 ? level : level > 6 ? 6 : 4);
29
+ return (0, _react.jsx)(Tag, {
27
30
  css: headerStyles
28
31
  }, children);
29
32
  };
@@ -15,7 +15,7 @@ var imageStyles = (0, _react.css)({
15
15
  display: 'block',
16
16
  maxWidth: "var(".concat(CSS_VAR_MAX_WIDTH, ")"),
17
17
  maxHeight: "var(".concat(CSS_VAR_MAX_HEIGHT, ")"),
18
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
18
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
19
19
  margin: "0 auto ".concat("var(--ds-space-300, 24px)")
20
20
  });
21
21
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/empty-state",
3
- "version": "7.5.2",
3
+ "version": "7.6.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import ButtonGroup from '@atlaskit/button/button-group';
3
3
  import Spinner from '@atlaskit/spinner';
4
- import { ActionsContainer, Container, Description, Header, Image, SpinnerContainer } from './styled';
4
+ import { ActionsContainer, Container, Description, Header, Image as HeaderImage, SpinnerContainer } from './styled';
5
5
  /**
6
6
  * __Empty state__
7
7
  *
@@ -27,6 +27,7 @@ import { ActionsContainer, Container, Description, Header, Image, SpinnerContain
27
27
  const EmptyState = ({
28
28
  description,
29
29
  header,
30
+ headingLevel = 4,
30
31
  imageHeight,
31
32
  imageUrl,
32
33
  imageWidth,
@@ -47,7 +48,7 @@ const EmptyState = ({
47
48
  return /*#__PURE__*/React.createElement(Container, {
48
49
  testId: testId,
49
50
  width: width || size || 'wide'
50
- }, imageUrl ? /*#__PURE__*/React.createElement(Image, {
51
+ }, imageUrl ? /*#__PURE__*/React.createElement(HeaderImage, {
51
52
  src: imageUrl,
52
53
  maxWidth: maxImageWidth,
53
54
  maxHeight: maxImageHeight,
@@ -58,6 +59,8 @@ const EmptyState = ({
58
59
  maxImageHeight,
59
60
  imageWidth,
60
61
  imageHeight
61
- }), /*#__PURE__*/React.createElement(Header, null, header), description && /*#__PURE__*/React.createElement(Description, null, description), actionsContainer, tertiaryAction);
62
+ }), /*#__PURE__*/React.createElement(Header, {
63
+ level: headingLevel
64
+ }, header), description && /*#__PURE__*/React.createElement(Description, null, description), actionsContainer, tertiaryAction);
62
65
  };
63
66
  export default EmptyState;
@@ -9,7 +9,7 @@ const verticalMarginSize = "var(--ds-space-600, 48px)";
9
9
  const columnWidth = gridSize * 8;
10
10
  const gutter = gridSize * 2;
11
11
  const containerStyles = css({
12
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
12
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
13
13
  margin: `${verticalMarginSize} auto`,
14
14
  textAlign: 'center'
15
15
  });
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { h600 } from '@atlaskit/theme/typography';
5
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
5
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
6
6
  const headerStyles = css([h600(), {
7
7
  marginTop: "var(--ds-space-0, 0px)",
8
8
  marginBottom: "var(--ds-space-200, 16px)"
@@ -16,8 +16,12 @@ const headerStyles = css([h600(), {
16
16
  * @internal
17
17
  */
18
18
  const EmptyStateHeader = ({
19
- children
20
- }) => jsx("h4", {
21
- css: headerStyles
22
- }, children);
19
+ children,
20
+ level = 4
21
+ }) => {
22
+ const Tag = `h${level > 0 && level < 7 ? level : level > 6 ? 6 : 4}`;
23
+ return jsx(Tag, {
24
+ css: headerStyles
25
+ }, children);
26
+ };
23
27
  export default EmptyStateHeader;
@@ -7,7 +7,7 @@ const imageStyles = css({
7
7
  display: 'block',
8
8
  maxWidth: `var(${CSS_VAR_MAX_WIDTH})`,
9
9
  maxHeight: `var(${CSS_VAR_MAX_HEIGHT})`,
10
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
10
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
11
11
  margin: `0 auto ${"var(--ds-space-300, 24px)"}`
12
12
  });
13
13
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/empty-state",
3
- "version": "7.5.2",
3
+ "version": "7.6.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import ButtonGroup from '@atlaskit/button/button-group';
3
3
  import Spinner from '@atlaskit/spinner';
4
- import { ActionsContainer, Container, Description, Header, Image, SpinnerContainer } from './styled';
4
+ import { ActionsContainer, Container, Description, Header, Image as HeaderImage, SpinnerContainer } from './styled';
5
5
  /**
6
6
  * __Empty state__
7
7
  *
@@ -27,6 +27,8 @@ import { ActionsContainer, Container, Description, Header, Image, SpinnerContain
27
27
  var EmptyState = function EmptyState(_ref) {
28
28
  var description = _ref.description,
29
29
  header = _ref.header,
30
+ _ref$headingLevel = _ref.headingLevel,
31
+ headingLevel = _ref$headingLevel === void 0 ? 4 : _ref$headingLevel,
30
32
  imageHeight = _ref.imageHeight,
31
33
  imageUrl = _ref.imageUrl,
32
34
  imageWidth = _ref.imageWidth,
@@ -48,7 +50,7 @@ var EmptyState = function EmptyState(_ref) {
48
50
  return /*#__PURE__*/React.createElement(Container, {
49
51
  testId: testId,
50
52
  width: width || size || 'wide'
51
- }, imageUrl ? /*#__PURE__*/React.createElement(Image, {
53
+ }, imageUrl ? /*#__PURE__*/React.createElement(HeaderImage, {
52
54
  src: imageUrl,
53
55
  maxWidth: maxImageWidth,
54
56
  maxHeight: maxImageHeight,
@@ -59,6 +61,8 @@ var EmptyState = function EmptyState(_ref) {
59
61
  maxImageHeight: maxImageHeight,
60
62
  imageWidth: imageWidth,
61
63
  imageHeight: imageHeight
62
- }), /*#__PURE__*/React.createElement(Header, null, header), description && /*#__PURE__*/React.createElement(Description, null, description), actionsContainer, tertiaryAction);
64
+ }), /*#__PURE__*/React.createElement(Header, {
65
+ level: headingLevel
66
+ }, header), description && /*#__PURE__*/React.createElement(Description, null, description), actionsContainer, tertiaryAction);
63
67
  };
64
68
  export default EmptyState;
@@ -9,7 +9,7 @@ var verticalMarginSize = "var(--ds-space-600, 48px)";
9
9
  var columnWidth = gridSize * 8;
10
10
  var gutter = gridSize * 2;
11
11
  var containerStyles = css({
12
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
12
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
13
13
  margin: "".concat(verticalMarginSize, " auto"),
14
14
  textAlign: 'center'
15
15
  });
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { h600 } from '@atlaskit/theme/typography';
5
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
5
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
6
6
  var headerStyles = css([h600(), {
7
7
  marginTop: "var(--ds-space-0, 0px)",
8
8
  marginBottom: "var(--ds-space-200, 16px)"
@@ -16,8 +16,11 @@ var headerStyles = css([h600(), {
16
16
  * @internal
17
17
  */
18
18
  var EmptyStateHeader = function EmptyStateHeader(_ref) {
19
- var children = _ref.children;
20
- return jsx("h4", {
19
+ var children = _ref.children,
20
+ _ref$level = _ref.level,
21
+ level = _ref$level === void 0 ? 4 : _ref$level;
22
+ var Tag = "h".concat(level > 0 && level < 7 ? level : level > 6 ? 6 : 4);
23
+ return jsx(Tag, {
21
24
  css: headerStyles
22
25
  }, children);
23
26
  };
@@ -8,7 +8,7 @@ var imageStyles = css({
8
8
  display: 'block',
9
9
  maxWidth: "var(".concat(CSS_VAR_MAX_WIDTH, ")"),
10
10
  maxHeight: "var(".concat(CSS_VAR_MAX_HEIGHT, ")"),
11
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
11
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
12
12
  margin: "0 auto ".concat("var(--ds-space-300, 24px)")
13
13
  });
14
14
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/empty-state",
3
- "version": "7.5.2",
3
+ "version": "7.6.1",
4
4
  "sideEffects": false
5
5
  }
@@ -22,5 +22,5 @@ import type { EmptyStateProps } from './types';
22
22
  * };
23
23
  * ```
24
24
  */
25
- declare const EmptyState: ({ description, header, imageHeight, imageUrl, imageWidth, isLoading, maxImageHeight, maxImageWidth, primaryAction, renderImage, secondaryAction, width, size, tertiaryAction, testId, }: EmptyStateProps) => JSX.Element;
25
+ declare const EmptyState: ({ description, header, headingLevel, imageHeight, imageUrl, imageWidth, isLoading, maxImageHeight, maxImageWidth, primaryAction, renderImage, secondaryAction, width, size, tertiaryAction, testId, }: EmptyStateProps) => JSX.Element;
26
26
  export default EmptyState;
@@ -1,5 +1,9 @@
1
1
  /** @jsx jsx */
2
2
  import { FC } from 'react';
3
+ type HeaderProps = {
4
+ children: string;
5
+ level?: number;
6
+ };
3
7
  /**
4
8
  * __Header__
5
9
  *
@@ -7,7 +11,5 @@ import { FC } from 'react';
7
11
  *
8
12
  * @internal
9
13
  */
10
- declare const EmptyStateHeader: FC<{
11
- children: string;
12
- }>;
14
+ declare const EmptyStateHeader: FC<HeaderProps>;
13
15
  export default EmptyStateHeader;
@@ -12,6 +12,11 @@ export interface EmptyStateProps {
12
12
  * Title that briefly describes the page to the user.
13
13
  */
14
14
  header: string;
15
+ /**
16
+ * The value used to set the heading level of the header element.
17
+ * Must be in the range of 1 to 6. Defaults to 4.
18
+ */
19
+ headingLevel?: number;
15
20
  /**
16
21
  * The main block of text that holds additional supporting information.
17
22
  */
@@ -22,5 +22,5 @@ import type { EmptyStateProps } from './types';
22
22
  * };
23
23
  * ```
24
24
  */
25
- declare const EmptyState: ({ description, header, imageHeight, imageUrl, imageWidth, isLoading, maxImageHeight, maxImageWidth, primaryAction, renderImage, secondaryAction, width, size, tertiaryAction, testId, }: EmptyStateProps) => JSX.Element;
25
+ declare const EmptyState: ({ description, header, headingLevel, imageHeight, imageUrl, imageWidth, isLoading, maxImageHeight, maxImageWidth, primaryAction, renderImage, secondaryAction, width, size, tertiaryAction, testId, }: EmptyStateProps) => JSX.Element;
26
26
  export default EmptyState;
@@ -1,5 +1,9 @@
1
1
  /** @jsx jsx */
2
2
  import { FC } from 'react';
3
+ type HeaderProps = {
4
+ children: string;
5
+ level?: number;
6
+ };
3
7
  /**
4
8
  * __Header__
5
9
  *
@@ -7,7 +11,5 @@ import { FC } from 'react';
7
11
  *
8
12
  * @internal
9
13
  */
10
- declare const EmptyStateHeader: FC<{
11
- children: string;
12
- }>;
14
+ declare const EmptyStateHeader: FC<HeaderProps>;
13
15
  export default EmptyStateHeader;
@@ -12,6 +12,11 @@ export interface EmptyStateProps {
12
12
  * Title that briefly describes the page to the user.
13
13
  */
14
14
  header: string;
15
+ /**
16
+ * The value used to set the heading level of the header element.
17
+ * Must be in the range of 1 to 6. Defaults to 4.
18
+ */
19
+ headingLevel?: number;
15
20
  /**
16
21
  * The main block of text that holds additional supporting information.
17
22
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/empty-state",
3
- "version": "7.5.2",
3
+ "version": "7.6.1",
4
4
  "description": "An empty state appears when there is no data to display and describes what the user can do next.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -25,17 +25,17 @@
25
25
  "atlaskit:src": "src/index.tsx",
26
26
  "atlassian": {
27
27
  "team": "Design System Team",
28
- "releaseModel": "scheduled",
28
+ "releaseModel": "continuous",
29
29
  "website": {
30
30
  "name": "Empty state",
31
31
  "category": "Components"
32
32
  }
33
33
  },
34
34
  "dependencies": {
35
- "@atlaskit/button": "^16.7.0",
35
+ "@atlaskit/button": "^16.8.0",
36
36
  "@atlaskit/spinner": "^15.5.0",
37
37
  "@atlaskit/theme": "^12.5.0",
38
- "@atlaskit/tokens": "^1.4.0",
38
+ "@atlaskit/tokens": "^1.11.0",
39
39
  "@babel/runtime": "^7.0.0",
40
40
  "@emotion/react": "^11.7.1"
41
41
  },
@@ -43,7 +43,7 @@
43
43
  "react": "^16.8.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@atlaskit/docs": "*",
46
+ "@af/accessibility-testing": "*",
47
47
  "@atlaskit/ds-lib": "^2.2.0",
48
48
  "@atlaskit/ssr": "*",
49
49
  "@atlaskit/visual-regression": "*",
package/report.api.md CHANGED
@@ -8,6 +8,7 @@
8
8
  ### Table of contents
9
9
 
10
10
  - [Main Entry Types](#main-entry-types)
11
+ - [Peer Dependencies](#peer-dependencies)
11
12
 
12
13
  ### Main Entry Types
13
14
 
@@ -22,6 +23,7 @@ import type { ReactNode } from 'react';
22
23
  const EmptyState: ({
23
24
  description,
24
25
  header,
26
+ headingLevel,
25
27
  imageHeight,
26
28
  imageUrl,
27
29
  imageWidth,
@@ -42,6 +44,7 @@ export default EmptyState;
42
44
  export interface EmptyStateProps {
43
45
  description?: ReactNode;
44
46
  header: string;
47
+ headingLevel?: number;
45
48
  imageHeight?: number;
46
49
  imageUrl?: string;
47
50
  imageWidth?: number;
@@ -80,3 +83,15 @@ export type Width = Sizes;
80
83
  ```
81
84
 
82
85
  <!--SECTION END: Main Entry Types-->
86
+
87
+ ### Peer Dependencies
88
+
89
+ <!--SECTION START: Peer Dependencies-->
90
+
91
+ ```json
92
+ {
93
+ "react": "^16.8.0"
94
+ }
95
+ ```
96
+
97
+ <!--SECTION END: Peer Dependencies-->