Grafana-UI: Add story and mdx file (#27152)

This commit is contained in:
Alex Khomenko 2020-08-24 14:13:28 +03:00 committed by GitHub
parent f7950491a3
commit 4a6268014a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,10 @@
import { Meta, Story, Preview, Props } from '@storybook/addon-docs/blocks';
import { AlphaNotice } from './AlphaNotice';
<Meta title="MDX|AlphaNotice" component={AlphaNotice} />
# AlphaNotice
Used to indicate plugin state - Alpha, Beta or Deprecated.
<Props of={AlphaNotice}/>

View File

@ -0,0 +1,20 @@
import React from 'react';
import { PluginState } from '@grafana/data';
import { AlphaNotice } from './AlphaNotice';
import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory';
import mdx from './AlphaNotice.mdx';
export default {
title: 'Overlays/AlphaNotice',
component: AlphaNotice,
decorators: [withCenteredStory, withHorizontallyCenteredStory],
parameters: {
docs: {
page: mdx,
},
},
};
export const basic = () => {
return <AlphaNotice state={PluginState.alpha} text="This is an alpha feature" />;
};

View File

@ -4,7 +4,7 @@ import { ThemeContext } from '../../index';
import { PluginState } from '@grafana/data';
import { Icon } from '../Icon/Icon';
interface Props {
export interface Props {
state?: PluginState;
text?: string;
className?: string;