hotkeysLabel.stories.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import HotkeysLabel from 'sentry/components/hotkeysLabel';
  2. export default {
  3. title: 'Components/HotkeysLabel',
  4. argTypes: {
  5. platform: {
  6. options: ['macos', 'generic'],
  7. control: {type: 'radio'},
  8. },
  9. },
  10. component: HotkeysLabel,
  11. };
  12. export const Default = args => (
  13. <div>
  14. <HotkeysLabel
  15. value={['command+option+a', 'ctrl+alt+a']}
  16. forcePlatform={args.platform}
  17. />
  18. <HotkeysLabel value="shift+!" forcePlatform={args.platform} />
  19. <HotkeysLabel value="ctrl+alt+delete" forcePlatform={args.platform} />
  20. <HotkeysLabel value="fn+backspace" forcePlatform={args.platform} />
  21. <HotkeysLabel value="left+right+up+down" forcePlatform={args.platform} />
  22. <HotkeysLabel value={['command+space', 'alt+space']} forcePlatform={args.platform} />
  23. <HotkeysLabel value=";+:+[+]" forcePlatform={args.platform} />
  24. Fallback to entirely different key combination:
  25. <HotkeysLabel value={['command+control', 'alt']} forcePlatform={args.platform} />
  26. No fallback for windows
  27. <HotkeysLabel value={['command+option']} forcePlatform={args.platform} />
  28. </div>
  29. );
  30. Default.args = {
  31. platform: 'macos',
  32. };
  33. Default.storyName = 'HotkeysLabel';
  34. Default.parameters = {
  35. docs: {
  36. description: {
  37. story: 'Render some cool keyboard keys',
  38. },
  39. },
  40. };