panels.stories.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import React from 'react';
  2. import {storiesOf} from '@storybook/react';
  3. import {withInfo} from '@storybook/addon-info';
  4. import Button from 'app/components/button';
  5. import {Panel, PanelHeader, PanelBody, PanelItem} from 'app/components/panels';
  6. import Field from 'app/views/settings/components/forms/field';
  7. storiesOf('UI|Panels', module)
  8. .add(
  9. 'Basic Panel',
  10. withInfo({
  11. text: 'Basic Panel component used in most settings',
  12. propTablesExclude: [Button],
  13. })(() => (
  14. <Panel>
  15. <PanelHeader>Panel Header</PanelHeader>
  16. <PanelBody>
  17. <PanelItem>Panel Item</PanelItem>
  18. <PanelItem>Panel Item</PanelItem>
  19. <PanelItem>Panel Item</PanelItem>
  20. </PanelBody>
  21. </Panel>
  22. ))
  23. )
  24. .add(
  25. 'With Fields',
  26. withInfo({
  27. text: 'Non-connected form field item',
  28. propTablesExclude: [Panel, PanelBody, PanelItem],
  29. })(() => (
  30. <Panel>
  31. <PanelHeader>Panel Header</PanelHeader>
  32. <PanelBody>
  33. <Field label="Label" help="This is a helpful description for this form field">
  34. <Button priority="danger">Remove</Button>
  35. </Field>
  36. <Field
  37. label="Label"
  38. help="Control will fill up all available space, so wrap with a `<div>` to have it behave like an inline-block element."
  39. >
  40. <div>
  41. <Button priority="danger">Remove</Button>
  42. </div>
  43. </Field>
  44. </PanelBody>
  45. </Panel>
  46. ))
  47. );