@atlaskit/empty-state 7.5.1 → 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 +6 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types-ts4.5/empty-state.d.ts +26 -0
- package/dist/types-ts4.5/index.d.ts +2 -0
- package/dist/types-ts4.5/styled/actions-container.d.ts +13 -0
- package/dist/types-ts4.5/styled/container.d.ts +17 -0
- package/dist/types-ts4.5/styled/description.d.ts +13 -0
- package/dist/types-ts4.5/styled/header.d.ts +13 -0
- package/dist/types-ts4.5/styled/image.d.ts +18 -0
- package/dist/types-ts4.5/styled/index.d.ts +6 -0
- package/dist/types-ts4.5/styled/spinner-container.d.ts +13 -0
- package/dist/types-ts4.5/types.d.ts +76 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/version.json
CHANGED
|
@@ -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,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,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