numberDragControl.stories.js 790 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import styled from '@emotion/styled';
  2. import {action} from '@storybook/addon-actions';
  3. import NumberDragControl from 'sentry/components/numberDragControl';
  4. export default {
  5. title: 'Components/Forms/Controls/Number Drag Control',
  6. componet: NumberDragControl,
  7. args: {
  8. step: 1,
  9. shiftStep: 1,
  10. axis: 'x',
  11. },
  12. argTypes: {
  13. axis: {
  14. control: {
  15. type: 'select',
  16. options: ['x', 'y'],
  17. },
  18. },
  19. },
  20. };
  21. export const _NumberDragControl = ({axis, step, shiftStep}) => (
  22. <Container>
  23. <NumberDragControl
  24. axis={axis}
  25. step={step}
  26. shiftStep={shiftStep}
  27. onChange={action('onChange')}
  28. />
  29. </Container>
  30. );
  31. _NumberDragControl.storyName = 'Number Drag Control';
  32. const Container = styled('div')`
  33. display: inline-block;
  34. `;