Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a content block loading animation. #1730

Merged
merged 11 commits into from
Mar 22, 2019
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
## [`9.5.0`](https://github.com/elastic/eui/tree/v9.5.0)

- Changed `EuiSuperDatePicker` to call `onRefresh` instead of `onTimeChanged` when user clicks "Refresh" button ([#1745](https://github.com/elastic/eui/pull/1745))
- Added a new `EuiLoadingContent` component that displays blocks as placeholders for text. ([#1730](https://github.com/elastic/eui/pull/1730))
- Added documentation entry in `EuiPagination` for `activePage` prop. ([#1740](https://github.com/elastic/eui/pull/1740))
- Changed `EuiButton` to use "m" as it's default `size` prop ([#1742](https://github.com/elastic/eui/pull/1742))
- Adds type definitions for `EuiListGroup` and `EuiListGroupItem` ([#1737](https://github.com/elastic/eui/pull/1737))
Expand Down
9 changes: 9 additions & 0 deletions src-docs/src/views/loading/loading_content.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

import { EuiLoadingContent } from '../../../../src/components/loading';

export default () => (
<div>
<EuiLoadingContent lines={3} />
</div>
);
24 changes: 24 additions & 0 deletions src-docs/src/views/loading/loading_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import {
} from '../../components';

import {
EuiCode,
EuiLoadingKibana,
EuiLoadingSpinner,
EuiLoadingChart,
EuiLoadingContent,
} from '../../../../src/components';

import LoadingKibana from './loading_kibana';
Expand All @@ -24,6 +26,10 @@ import LoadingSpinner from './loading_spinner';
const loadingSpinnerSource = require('!!raw-loader!./loading_spinner');
const loadingSpinnerHtml = renderToHtml(LoadingSpinner);

import LoadingContent from './loading_content';
const loadingContentSource = require('!!raw-loader!./loading_content');
const loadingContentHtml = renderToHtml(LoadingContent);

export const LoadingExample = {
title: 'Loading',
sections: [{
Expand Down Expand Up @@ -80,5 +86,23 @@ export const LoadingExample = {
props: { EuiLoadingSpinner },
demo: <LoadingSpinner />,
snippet: `<EuiLoadingSpinner size="m" />`
}, {
title: 'Text Content',
source: [{
type: GuideSectionTypes.JS,
code: loadingContentSource,
}, {
type: GuideSectionTypes.HTML,
code: loadingContentHtml,
}],
text: (
<p>
A simple loading animation for displaying placeholder text content.
You can pass in a number of <EuiCode>lines</EuiCode> between 1 and 10.
</p>
),
props: { EuiLoadingContent },
demo: <LoadingContent />,
snippet: `<EuiLoadingContent lines={3} />`
}],
};
1 change: 1 addition & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export {
export {
EuiLoadingKibana,
EuiLoadingChart,
EuiLoadingContent,
EuiLoadingSpinner,
} from './loading';

Expand Down
Loading