buttonBar.stories.tsx 977 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import {Button} from 'sentry/components/button';
  2. import ButtonBar from 'sentry/components/buttonBar';
  3. import Matrix from 'sentry/components/stories/matrix';
  4. import storyBook from 'sentry/stories/storyBook';
  5. export default storyBook(ButtonBar, story => {
  6. story('Default', () => (
  7. <ButtonBar>
  8. <Button>One</Button>
  9. <Button>Two</Button>
  10. <Button>Three</Button>
  11. </ButtonBar>
  12. ));
  13. story('Active', () => (
  14. <ButtonBar active="two">
  15. <Button barId="one">One</Button>
  16. <Button barId="two">Two</Button>
  17. <Button barId="three">Three</Button>
  18. </ButtonBar>
  19. ));
  20. story('Props', () => (
  21. <Matrix
  22. render={props => (
  23. <ButtonBar {...props}>
  24. <Button>One</Button>
  25. <Button>One</Button>
  26. <Button>One</Button>
  27. </ButtonBar>
  28. )}
  29. selectedProps={['gap', 'merged']}
  30. propMatrix={{
  31. merged: [true, false],
  32. gap: [0 as const, 2 as const],
  33. }}
  34. />
  35. ));
  36. });