clipboard.stories.js 867 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import React from 'react';
  2. import Clipboard from 'app/components/clipboard';
  3. import Tooltip from 'app/components/tooltip';
  4. export default {
  5. title: 'UI/Clipboard',
  6. component: Clipboard,
  7. args: {
  8. value: 'This will be copied to clipboard',
  9. },
  10. argTypes: {
  11. onSuccess: {action: 'Copied to clipboard'},
  12. onError: {action: 'Failed copy to clipboard'},
  13. },
  14. };
  15. export const Default = ({...args}) => (
  16. <Clipboard {...args}>
  17. <span priority="primary">Click to Copy</span>
  18. </Clipboard>
  19. );
  20. Default.storyName = 'Clipboard';
  21. Default.parameters = {
  22. docs: {
  23. description: {
  24. story: 'Copy text to clipboard',
  25. },
  26. },
  27. };
  28. export const WrapTooltip = ({...args}) => (
  29. <Clipboard {...args}>
  30. <Tooltip title="Clipboard around tooltip element">Click to Copy</Tooltip>
  31. </Clipboard>
  32. );
  33. WrapTooltip.storyName = 'Clipboard wrapping tooltip';