@atlaskit/empty-state 7.5.0 → 7.5.2

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.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
8
+
9
+ ## 7.5.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
14
+
3
15
  ## 7.5.0
4
16
 
5
17
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/empty-state",
3
- "version": "7.5.0",
3
+ "version": "7.5.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/empty-state",
3
- "version": "7.5.0",
3
+ "version": "7.5.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/empty-state",
3
- "version": "7.5.0",
3
+ "version": "7.5.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { FC, ReactNode } from 'react';
3
3
  import type { Width } from '../index';
4
- declare type ContainerProps = {
4
+ type ContainerProps = {
5
5
  testId?: string;
6
6
  width: Width;
7
7
  children: ReactNode;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { FC } from 'react';
3
- declare type ImageProps = {
3
+ type ImageProps = {
4
4
  height?: number;
5
5
  maxHeight: number;
6
6
  maxWidth: number;
@@ -5,8 +5,8 @@ export interface RenderImageProps {
5
5
  imageWidth?: number;
6
6
  imageHeight?: number;
7
7
  }
8
- export declare type Sizes = 'narrow' | 'wide';
9
- export declare type Width = Sizes;
8
+ export type Sizes = 'narrow' | 'wide';
9
+ export type Width = Sizes;
10
10
  export interface EmptyStateProps {
11
11
  /**
12
12
  * Title that briefly describes the page to the user.
@@ -0,0 +1,26 @@
1
+ /// <reference types="react" />
2
+ import type { EmptyStateProps } from './types';
3
+ /**
4
+ * __Empty state__
5
+ *
6
+ * A component used for presenting various empty states.
7
+ * e.g. (no items, empty search, broken link, welcome screen etc.)
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * import EmptyState from '@atlaskit/empty-state';
12
+ *
13
+ * // An example of a 404 state
14
+ * export default () => {
15
+ * <EmptyState
16
+ * header="Page not found"
17
+ * imageUrl="https://cdn.io/images/404"
18
+ * description="Looks like you've stumbled off track. Sorry about that! This page either doesn't exist or has been removed."
19
+ * primaryAction={<Button appearance="primary">Home Page</Button>}
20
+ * secondaryAction={<Button>Report a problem</Button>}
21
+ * />;
22
+ * };
23
+ * ```
24
+ */
25
+ declare const EmptyState: ({ description, header, imageHeight, imageUrl, imageWidth, isLoading, maxImageHeight, maxImageWidth, primaryAction, renderImage, secondaryAction, width, size, tertiaryAction, testId, }: EmptyStateProps) => JSX.Element;
26
+ export default EmptyState;
@@ -0,0 +1,2 @@
1
+ export { default } from './empty-state';
2
+ export type { Sizes, Width, RenderImageProps, EmptyStateProps } from './types';
@@ -0,0 +1,13 @@
1
+ /** @jsx jsx */
2
+ import { FC, ReactNode } from 'react';
3
+ /**
4
+ * __Actions container__
5
+ *
6
+ * A container for actions: primary action, secondary action, and tertiary action.
7
+ *
8
+ * @internal
9
+ */
10
+ declare const ActionsContainer: FC<{
11
+ children: ReactNode;
12
+ }>;
13
+ export default ActionsContainer;
@@ -0,0 +1,17 @@
1
+ /** @jsx jsx */
2
+ import { FC, ReactNode } from 'react';
3
+ import type { Width } from '../index';
4
+ type ContainerProps = {
5
+ testId?: string;
6
+ width: Width;
7
+ children: ReactNode;
8
+ };
9
+ /**
10
+ * __Container__
11
+ *
12
+ * Upper level container for Empty State.
13
+ *
14
+ * @internal
15
+ */
16
+ declare const Container: FC<ContainerProps>;
17
+ export default Container;
@@ -0,0 +1,13 @@
1
+ /** @jsx jsx */
2
+ import { FC, ReactNode } from 'react';
3
+ /**
4
+ * __Description__
5
+ *
6
+ * Description of Empty State.
7
+ *
8
+ * @internal
9
+ */
10
+ declare const Description: FC<{
11
+ children: ReactNode;
12
+ }>;
13
+ export default Description;
@@ -0,0 +1,13 @@
1
+ /** @jsx jsx */
2
+ import { FC } from 'react';
3
+ /**
4
+ * __Header__
5
+ *
6
+ * Header of Empty State.
7
+ *
8
+ * @internal
9
+ */
10
+ declare const EmptyStateHeader: FC<{
11
+ children: string;
12
+ }>;
13
+ export default EmptyStateHeader;
@@ -0,0 +1,18 @@
1
+ /** @jsx jsx */
2
+ import { FC } from 'react';
3
+ type ImageProps = {
4
+ height?: number;
5
+ maxHeight: number;
6
+ maxWidth: number;
7
+ width?: number;
8
+ src: string;
9
+ };
10
+ /**
11
+ * __Image__
12
+ *
13
+ * Image in Empty State.
14
+ *
15
+ * @internal
16
+ */
17
+ declare const Image: FC<ImageProps>;
18
+ export default Image;
@@ -0,0 +1,6 @@
1
+ export { default as ActionsContainer } from './actions-container';
2
+ export { default as Container } from './container';
3
+ export { default as Description } from './description';
4
+ export { default as Header } from './header';
5
+ export { default as Image } from './image';
6
+ export { default as SpinnerContainer } from './spinner-container';
@@ -0,0 +1,13 @@
1
+ /** @jsx jsx */
2
+ import { FC, ReactNode } from 'react';
3
+ /**
4
+ * __Spinner container__
5
+ *
6
+ * A spinner container for loading state of Empty State.
7
+ *
8
+ * @internal
9
+ */
10
+ declare const SpinnerContainer: FC<{
11
+ children?: ReactNode;
12
+ }>;
13
+ export default SpinnerContainer;
@@ -0,0 +1,76 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface RenderImageProps {
3
+ maxImageWidth?: number;
4
+ maxImageHeight?: number;
5
+ imageWidth?: number;
6
+ imageHeight?: number;
7
+ }
8
+ export type Sizes = 'narrow' | 'wide';
9
+ export type Width = Sizes;
10
+ export interface EmptyStateProps {
11
+ /**
12
+ * Title that briefly describes the page to the user.
13
+ */
14
+ header: string;
15
+ /**
16
+ * The main block of text that holds additional supporting information.
17
+ */
18
+ description?: ReactNode;
19
+ /**
20
+ * Controls how much horizontal space the component fills. Defaults to "wide".
21
+ */
22
+ width?: Width;
23
+ /**
24
+ * @deprecated
25
+ * Duplicates the `width` prop. Use `width instead`.
26
+ */
27
+ size?: Width;
28
+ /**
29
+ * The url of image that will be shown above the title, fed directly into the `src` prop of an <img> element.
30
+ * Note, this image will be constrained by the `maxWidth` and `maxHeight` props.
31
+ */
32
+ imageUrl?: string;
33
+ /**
34
+ * Maximum width (in pixels) of the image, default value is 160.
35
+ */
36
+ maxImageWidth?: number;
37
+ /**
38
+ * Maximum height (in pixels) of the image, default value is 160.
39
+ */
40
+ maxImageHeight?: number;
41
+ /**
42
+ * Primary action button for the page, usually it will be something like "Create" (or "Retry" for error pages).
43
+ */
44
+ primaryAction?: ReactNode;
45
+ /**
46
+ * An alternative API to supply an image using a render prop. Only rendered if no `imageUrl` is supplied.
47
+ */
48
+ renderImage?: (props: RenderImageProps) => React.ReactNode;
49
+ /**
50
+ * Secondary action button for the page.
51
+ */
52
+ secondaryAction?: ReactNode;
53
+ /**
54
+ * Button with link to some external resource like documentation or tutorial, it will be opened in a new tab.
55
+ */
56
+ tertiaryAction?: ReactNode;
57
+ /**
58
+ * A hook for automated testing
59
+ */
60
+ testId?: string;
61
+ /**
62
+ * Used to indicate a loading state. Will show a spinner next to the action buttons when true.
63
+ */
64
+ isLoading?: boolean;
65
+ /**
66
+ * Width of the image that is rendered in EmptyState component.
67
+ * Useful when you want image to be of exact width to stop it bouncing around when loading in.
68
+ */
69
+ imageWidth?: number;
70
+ /**
71
+ * Height of the image that is rendered in EmptyState component.
72
+ * Useful when you want image to be of exact height to stop it bouncing around when loading in.
73
+ * Only set `height` if you want the image to resize down on smaller devices.
74
+ */
75
+ imageHeight?: number;
76
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/empty-state",
3
- "version": "7.5.0",
3
+ "version": "7.5.2",
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/"
@@ -13,6 +13,14 @@
13
13
  "module": "dist/esm/index.js",
14
14
  "module:es2019": "dist/es2019/index.js",
15
15
  "types": "dist/types/index.d.ts",
16
+ "typesVersions": {
17
+ ">=4.5 <4.9": {
18
+ "*": [
19
+ "dist/types-ts4.5/*",
20
+ "dist/types-ts4.5/index.d.ts"
21
+ ]
22
+ }
23
+ },
16
24
  "sideEffects": false,
17
25
  "atlaskit:src": "src/index.tsx",
18
26
  "atlassian": {
@@ -27,7 +35,7 @@
27
35
  "@atlaskit/button": "^16.7.0",
28
36
  "@atlaskit/spinner": "^15.5.0",
29
37
  "@atlaskit/theme": "^12.5.0",
30
- "@atlaskit/tokens": "^1.3.0",
38
+ "@atlaskit/tokens": "^1.4.0",
31
39
  "@babel/runtime": "^7.0.0",
32
40
  "@emotion/react": "^11.7.1"
33
41
  },
@@ -42,7 +50,7 @@
42
50
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
43
51
  "@testing-library/react": "^12.1.5",
44
52
  "react-dom": "^16.8.0",
45
- "typescript": "4.5.5",
53
+ "typescript": "~4.9.5",
46
54
  "wait-for-expect": "^1.2.0"
47
55
  },
48
56
  "techstack": {
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/types.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/types.d.ts"
11
+ "../dist/types-ts4.5/types.d.ts"
12
12
  ]
13
13
  }
14
14
  }