@atlaskit/empty-state 7.3.10 → 7.4.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,27 @@
1
1
  # @atlaskit/empty-state
2
2
 
3
+ ## 7.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`645ec6a64a8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/645ec6a64a8) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 7.3.12
14
+
15
+ ### Patch Changes
16
+
17
+ - [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
18
+
19
+ ## 7.3.11
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies
24
+
3
25
  ## 7.3.10
4
26
 
5
27
  ### Patch Changes
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _core = require("@emotion/core");
8
+ var _react = require("@emotion/react");
9
9
 
10
10
  var _constants = require("@atlaskit/theme/constants");
11
11
 
12
12
  /** @jsx jsx */
13
13
  var gridSize = (0, _constants.gridSize)();
14
- var actionsStyles = (0, _core.css)({
14
+ var actionsStyles = (0, _react.css)({
15
15
  display: 'flex',
16
16
  marginBottom: "".concat(gridSize, "px"),
17
17
  paddingLeft: "".concat(5 * gridSize, "px"),
@@ -28,7 +28,7 @@ var actionsStyles = (0, _core.css)({
28
28
 
29
29
  var ActionsContainer = function ActionsContainer(_ref) {
30
30
  var children = _ref.children;
31
- return (0, _core.jsx)("div", {
31
+ return (0, _react.jsx)("div", {
32
32
  css: actionsStyles
33
33
  }, children);
34
34
  };
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _core = require("@emotion/core");
8
+ var _react = require("@emotion/react");
9
9
 
10
10
  var _constants = require("@atlaskit/theme/constants");
11
11
 
@@ -14,16 +14,16 @@ var gridSize = (0, _constants.gridSize)();
14
14
  var verticalMarginSize = gridSize * 6;
15
15
  var columnWidth = gridSize * 8;
16
16
  var gutter = gridSize * 2;
17
- var containerStyles = (0, _core.css)({
17
+ var containerStyles = (0, _react.css)({
18
18
  margin: "".concat(verticalMarginSize, "px auto"),
19
19
  textAlign: 'center'
20
20
  });
21
21
  /* Use max-width so the component can shrink on smaller viewports. */
22
22
 
23
- var wideContainerStyles = (0, _core.css)({
23
+ var wideContainerStyles = (0, _react.css)({
24
24
  maxWidth: "".concat(columnWidth * 6 + gutter * 5, "px")
25
25
  });
26
- var narrowContainerStyles = (0, _core.css)({
26
+ var narrowContainerStyles = (0, _react.css)({
27
27
  maxWidth: "".concat(columnWidth * 4 + gutter * 3, "px")
28
28
  });
29
29
  /**
@@ -38,7 +38,7 @@ var Container = function Container(_ref) {
38
38
  var children = _ref.children,
39
39
  width = _ref.width,
40
40
  testId = _ref.testId;
41
- return (0, _core.jsx)("div", {
41
+ return (0, _react.jsx)("div", {
42
42
  "data-testid": testId,
43
43
  css: [containerStyles, width === 'narrow' ? narrowContainerStyles : wideContainerStyles]
44
44
  }, children);
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _core = require("@emotion/core");
8
+ var _react = require("@emotion/react");
9
9
 
10
10
  var _colors = require("@atlaskit/theme/colors");
11
11
 
12
12
  var _constants = require("@atlaskit/theme/constants");
13
13
 
14
14
  /** @jsx jsx */
15
- var descriptionStyles = (0, _core.css)({
15
+ var descriptionStyles = (0, _react.css)({
16
16
  marginTop: 0,
17
17
  marginBottom: "".concat((0, _constants.gridSize)() * 3, "px"),
18
18
  color: "var(--ds-text, ".concat(_colors.N800, ")")
@@ -27,7 +27,7 @@ var descriptionStyles = (0, _core.css)({
27
27
 
28
28
  var Description = function Description(_ref) {
29
29
  var children = _ref.children;
30
- return (0, _core.jsx)("p", {
30
+ return (0, _react.jsx)("p", {
31
31
  css: descriptionStyles
32
32
  }, children);
33
33
  };
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _core = require("@emotion/core");
8
+ var _react = require("@emotion/react");
9
9
 
10
10
  var _constants = require("@atlaskit/theme/constants");
11
11
 
@@ -13,7 +13,7 @@ var _typography = require("@atlaskit/theme/typography");
13
13
 
14
14
  /** @jsx jsx */
15
15
  // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
16
- var headerStyles = (0, _core.css)([(0, _typography.h600)(), {
16
+ var headerStyles = (0, _react.css)([(0, _typography.h600)(), {
17
17
  marginTop: 0,
18
18
  marginBottom: "".concat((0, _constants.gridSize)() * 2, "px")
19
19
  }]);
@@ -27,7 +27,7 @@ var headerStyles = (0, _core.css)([(0, _typography.h600)(), {
27
27
 
28
28
  var EmptyStateHeader = function EmptyStateHeader(_ref) {
29
29
  var children = _ref.children;
30
- return (0, _core.jsx)("h4", {
30
+ return (0, _react.jsx)("h4", {
31
31
  css: headerStyles
32
32
  }, children);
33
33
  };
@@ -9,14 +9,14 @@ exports.default = void 0;
9
9
 
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
 
12
- var _core = require("@emotion/core");
12
+ var _react = require("@emotion/react");
13
13
 
14
14
  var _constants = require("@atlaskit/theme/constants");
15
15
 
16
16
  /** @jsx jsx */
17
17
  var CSS_VAR_MAX_WIDTH = '--max-width';
18
18
  var CSS_VAR_MAX_HEIGHT = '--max-height';
19
- var imageStyles = (0, _core.css)({
19
+ var imageStyles = (0, _react.css)({
20
20
  display: 'block',
21
21
  maxWidth: "var(".concat(CSS_VAR_MAX_WIDTH, ")"),
22
22
  maxHeight: "var(".concat(CSS_VAR_MAX_HEIGHT, ")"),
@@ -40,7 +40,7 @@ var Image = function Image(_ref) {
40
40
  _ref$width = _ref.width,
41
41
  width = _ref$width === void 0 ? 'auto' : _ref$width,
42
42
  src = _ref.src;
43
- return (0, _core.jsx)("img", {
43
+ return (0, _react.jsx)("img", {
44
44
  style: (_ref2 = {}, (0, _defineProperty2.default)(_ref2, CSS_VAR_MAX_WIDTH, "".concat(maxWidth, "px")), (0, _defineProperty2.default)(_ref2, CSS_VAR_MAX_HEIGHT, "".concat(maxHeight, "px")), _ref2),
45
45
  width: width,
46
46
  height: height,
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _core = require("@emotion/core");
8
+ var _react = require("@emotion/react");
9
9
 
10
10
  var _constants = require("@atlaskit/theme/constants");
11
11
 
12
12
  /** @jsx jsx */
13
13
  var gridSize = (0, _constants.gridSize)();
14
- var spinnerContainerStyles = (0, _core.css)({
14
+ var spinnerContainerStyles = (0, _react.css)({
15
15
  width: "".concat(3 * gridSize, "px"),
16
16
  marginLeft: "".concat(2 * gridSize, "px")
17
17
  });
@@ -25,7 +25,7 @@ var spinnerContainerStyles = (0, _core.css)({
25
25
 
26
26
  var SpinnerContainer = function SpinnerContainer(_ref) {
27
27
  var children = _ref.children;
28
- return (0, _core.jsx)("div", {
28
+ return (0, _react.jsx)("div", {
29
29
  css: spinnerContainerStyles
30
30
  }, children);
31
31
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/empty-state",
3
- "version": "7.3.10",
3
+ "version": "7.4.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { gridSize as getGridSize } from '@atlaskit/theme/constants';
4
4
  const gridSize = getGridSize();
5
5
  const actionsStyles = css({
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { gridSize as getGridSize } from '@atlaskit/theme/constants';
4
4
  const gridSize = getGridSize();
5
5
  const verticalMarginSize = gridSize * 6;
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { N800 } from '@atlaskit/theme/colors';
4
4
  import { gridSize as getGridSize } from '@atlaskit/theme/constants';
5
5
  const descriptionStyles = css({
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { gridSize as getGridSize } from '@atlaskit/theme/constants';
4
4
  import { h600 } from '@atlaskit/theme/typography'; // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
5
5
 
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { gridSize as getGridSize } from '@atlaskit/theme/constants';
4
4
  const CSS_VAR_MAX_WIDTH = '--max-width';
5
5
  const CSS_VAR_MAX_HEIGHT = '--max-height';
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { gridSize as getGridSize } from '@atlaskit/theme/constants';
4
4
  const gridSize = getGridSize();
5
5
  const spinnerContainerStyles = css({
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/empty-state",
3
- "version": "7.3.10",
3
+ "version": "7.4.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { gridSize as getGridSize } from '@atlaskit/theme/constants';
4
4
  var gridSize = getGridSize();
5
5
  var actionsStyles = css({
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { gridSize as getGridSize } from '@atlaskit/theme/constants';
4
4
  var gridSize = getGridSize();
5
5
  var verticalMarginSize = gridSize * 6;
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { N800 } from '@atlaskit/theme/colors';
4
4
  import { gridSize as getGridSize } from '@atlaskit/theme/constants';
5
5
  var descriptionStyles = css({
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { gridSize as getGridSize } from '@atlaskit/theme/constants';
4
4
  import { h600 } from '@atlaskit/theme/typography'; // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
5
5
 
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
 
3
3
  /** @jsx jsx */
4
- import { css, jsx } from '@emotion/core';
4
+ import { css, jsx } from '@emotion/react';
5
5
  import { gridSize as getGridSize } from '@atlaskit/theme/constants';
6
6
  var CSS_VAR_MAX_WIDTH = '--max-width';
7
7
  var CSS_VAR_MAX_HEIGHT = '--max-height';
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { gridSize as getGridSize } from '@atlaskit/theme/constants';
4
4
  var gridSize = getGridSize();
5
5
  var spinnerContainerStyles = css({
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/empty-state",
3
- "version": "7.3.10",
3
+ "version": "7.4.0",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@atlaskit/empty-state",
3
- "version": "7.3.10",
3
+ "version": "7.4.0",
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/"
7
7
  },
8
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
8
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
9
9
  "homepage": "https://atlassian.design/components/empty-state/",
10
10
  "author": "Atlassian Pty Ltd",
11
11
  "license": "Apache-2.0",
@@ -19,29 +19,31 @@
19
19
  "team": "Design System Team",
20
20
  "releaseModel": "scheduled",
21
21
  "website": {
22
- "name": "Empty state"
22
+ "name": "Empty state",
23
+ "category": "Components"
23
24
  }
24
25
  },
25
26
  "dependencies": {
26
27
  "@atlaskit/button": "^16.3.0",
27
28
  "@atlaskit/spinner": "^15.1.0",
28
- "@atlaskit/theme": "^12.1.0",
29
- "@atlaskit/tokens": "^0.9.0",
29
+ "@atlaskit/theme": "^12.2.0",
30
+ "@atlaskit/tokens": "^0.10.0",
30
31
  "@babel/runtime": "^7.0.0",
31
- "@emotion/core": "^10.0.9"
32
+ "@emotion/react": "^11.7.1"
32
33
  },
33
34
  "peerDependencies": {
34
35
  "react": "^16.8.0"
35
36
  },
36
37
  "devDependencies": {
37
- "@atlaskit/docs": "^9.0.0",
38
+ "@atlaskit/docs": "*",
39
+ "@atlaskit/ds-lib": "^2.0.1",
38
40
  "@atlaskit/ssr": "*",
39
41
  "@atlaskit/visual-regression": "*",
40
42
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
41
43
  "@testing-library/react": "^8.0.1",
42
44
  "enzyme": "^3.10.0",
43
45
  "react-dom": "^16.8.0",
44
- "typescript": "4.2.4",
46
+ "typescript": "4.3.5",
45
47
  "wait-for-expect": "^1.2.0"
46
48
  },
47
49
  "techstack": {
@@ -49,6 +51,7 @@
49
51
  "import-structure": "atlassian-conventions"
50
52
  },
51
53
  "@repo/internal": {
54
+ "dom-events": "use-bind-event-listener",
52
55
  "analytics": "analytics-next",
53
56
  "theming": "tokens",
54
57
  "styling": [
package/report.api.md ADDED
@@ -0,0 +1,131 @@
1
+ ## API Report File for "@atlaskit/empty-state"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ````ts
6
+ /// <reference types="react" />
7
+
8
+ import type { ReactNode } from 'react';
9
+
10
+ /**
11
+ * __Empty state__
12
+ *
13
+ * A component used for presenting various empty states.
14
+ * e.g. (no items, empty search, broken link, welcome screen etc.)
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * import EmptyState from '@atlaskit/empty-state';
19
+ *
20
+ * // An example of a 404 state
21
+ * export default () => {
22
+ * <EmptyState
23
+ * header="Page not found"
24
+ * imageUrl="https://cdn.io/images/404"
25
+ * description="Looks like you've stumbled off track. Sorry about that! This page either doesn't exist or has been removed."
26
+ * primaryAction={<Button appearance="primary">Home Page</Button>}
27
+ * secondaryAction={<Button>Report a problem</Button>}
28
+ * />;
29
+ * };
30
+ * ```
31
+ */
32
+ declare const EmptyState: ({
33
+ description,
34
+ header,
35
+ imageHeight,
36
+ imageUrl,
37
+ imageWidth,
38
+ isLoading,
39
+ maxImageHeight,
40
+ maxImageWidth,
41
+ primaryAction,
42
+ renderImage,
43
+ secondaryAction,
44
+ width,
45
+ size,
46
+ tertiaryAction,
47
+ testId,
48
+ }: EmptyStateProps) => JSX.Element;
49
+ export default EmptyState;
50
+
51
+ export declare interface EmptyStateProps {
52
+ /**
53
+ * Title that briefly describes the page to the user.
54
+ */
55
+ header: string;
56
+ /**
57
+ * The main block of text that holds additional supporting information.
58
+ */
59
+ description?: ReactNode;
60
+ /**
61
+ * Controls how much horizontal space the component fills. Defaults to "wide".
62
+ */
63
+ width?: Width;
64
+ /**
65
+ * @deprecated
66
+ * Duplicates the `width` prop. Use `width instead`.
67
+ */
68
+ size?: Width;
69
+ /**
70
+ * The url of image that will be shown above the title, fed directly into the `src` prop of an <img> element.
71
+ * Note, this image will be constrained by the `maxWidth` and `maxHeight` props.
72
+ */
73
+ imageUrl?: string;
74
+ /**
75
+ * Maximum width (in pixels) of the image, default value is 160.
76
+ */
77
+ maxImageWidth?: number;
78
+ /**
79
+ * Maximum height (in pixels) of the image, default value is 160.
80
+ */
81
+ maxImageHeight?: number;
82
+ /**
83
+ * Primary action button for the page, usually it will be something like "Create" (or "Retry" for error pages).
84
+ */
85
+ primaryAction?: ReactNode;
86
+ /**
87
+ * An alternative API to supply an image using a render prop. Only rendered if no `imageUrl` is supplied.
88
+ */
89
+ renderImage?: (props: RenderImageProps) => React.ReactNode;
90
+ /**
91
+ * Secondary action button for the page.
92
+ */
93
+ secondaryAction?: ReactNode;
94
+ /**
95
+ * Button with link to some external resource like documentation or tutorial, it will be opened in a new tab.
96
+ */
97
+ tertiaryAction?: ReactNode;
98
+ /**
99
+ * A hook for automated testing
100
+ */
101
+ testId?: string;
102
+ /**
103
+ * Used to indicate a loading state. Will show a spinner next to the action buttons when true.
104
+ */
105
+ isLoading?: boolean;
106
+ /**
107
+ * Width of the image that is rendered in EmptyState component.
108
+ * Useful when you want image to be of exact width to stop it bouncing around when loading in.
109
+ */
110
+ imageWidth?: number;
111
+ /**
112
+ * Height of the image that is rendered in EmptyState component.
113
+ * Useful when you want image to be of exact height to stop it bouncing around when loading in.
114
+ * Only set `height` if you want the image to resize down on smaller devices.
115
+ */
116
+ imageHeight?: number;
117
+ }
118
+
119
+ export declare interface RenderImageProps {
120
+ maxImageWidth?: number;
121
+ maxImageHeight?: number;
122
+ imageWidth?: number;
123
+ imageHeight?: number;
124
+ }
125
+
126
+ export declare type Sizes = 'narrow' | 'wide';
127
+
128
+ export declare type Width = Sizes;
129
+
130
+ export {};
131
+ ````
@@ -3,5 +3,6 @@
3
3
  "main": "../dist/cjs/types.js",
4
4
  "module": "../dist/esm/types.js",
5
5
  "module:es2019": "../dist/es2019/types.js",
6
+ "sideEffects": false,
6
7
  "types": "../dist/types/types.d.ts"
7
8
  }