tag.stories.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import React from 'react';
  2. import {storiesOf} from '@storybook/react';
  3. import {withInfo} from '@storybook/addon-info';
  4. import Tooltip from 'app/components/tooltip';
  5. import Tag from 'app/views/settings/components/tag';
  6. storiesOf('UI|Tags', module)
  7. .add(
  8. 'default',
  9. withInfo('A basic tag-like thing. If you pass no type, it will be gray')(() => (
  10. <Tag>Development</Tag>
  11. ))
  12. )
  13. .add(
  14. 'warning',
  15. withInfo(
  16. 'A warning tag-like thing. Use this to signal that something is maybe not so great'
  17. )(() => <Tag priority="warning">Development</Tag>)
  18. )
  19. .add(
  20. 'success',
  21. withInfo('A happy tag-like thing. Use this to signal something good')(() => (
  22. <Tag priority="success">Development</Tag>
  23. ))
  24. )
  25. .add(
  26. 'beta',
  27. withInfo(
  28. 'An attention grabbing thing. Use this to communicate shiny new functionality.'
  29. )(() => (
  30. <Tooltip
  31. title="This feature is in beta and may change in the future."
  32. tooltipOptions={{
  33. placement: 'right',
  34. }}
  35. >
  36. <span>
  37. <Tag priority="beta">beta</Tag>
  38. </span>
  39. </Tooltip>
  40. ))
  41. )
  42. .add(
  43. 'small',
  44. withInfo('A small tag-like thing. Use this when space is at a premium')(() => (
  45. <Tag size="small" border>
  46. new
  47. </Tag>
  48. ))
  49. )
  50. .add(
  51. 'with icon',
  52. withInfo(
  53. 'A tag-like thing with an icon. Use when you need to represent something'
  54. )(() => <Tag icon="icon-lock">Locked</Tag>)
  55. );