tag.stories.js 1.5 KB

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