Docs: Storybook - Spinner (#26754)

* add docs for spinner component

* fix lint

* Code review fixes
This commit is contained in:
Karine Valença 2020-08-03 10:34:09 -03:00 committed by GitHub
parent 41f7bccb24
commit fa7c4d91aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,17 @@
import { Meta, Story, Preview, Props } from '@storybook/addon-docs/blocks';
import { Spinner } from './Spinner';
<Meta title="MDX|Spinner" component={Spinner} />
# Spinner
Spinner is `fa-spinner` icon animated. It is used to alert a user to wait for an activity to complete.
<Preview>
<div>
<Spinner />
<Spinner className="my-spin-div" iconClassName="my-spinner-classname" size={24}/>
</div>
</Preview>
<Props of={Spinner} />

View File

@ -1,12 +1,18 @@
import React from 'react';
import { number, color } from '@storybook/addon-knobs';
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
import { Spinner } from '@grafana/ui';
import mdx from './Spinner.mdx';
export default {
title: 'Visualizations/Spinner',
component: Spinner,
decorators: [withCenteredStory],
parameters: {
docs: {
page: mdx,
},
},
};
export const basic = () => {
@ -16,3 +22,17 @@ export const basic = () => {
</div>
);
};
export const withStyle = () => {
return (
<div>
<Spinner
style={{
backgroundColor: color('White', 'white'),
color: color('Red', 'red'),
}}
size={number('Size', 34)}
/>
</div>
);
};