clipboard.stories.js 833 B

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