Design system.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

50 lines
909 B

  1. import * as React from 'react';
  2. import type { Meta } from '@storybook/react';
  3. import { TextControl } from '@tesseract-design/web-base';
  4. import { NumberSpinner as Component, NumberSpinnerProps as Props } from '.';
  5. const meta: Meta<typeof Component> = {
  6. component: Component,
  7. argTypes: {
  8. label: {
  9. control: { type: 'text' },
  10. },
  11. hint: {
  12. control: { type: 'text' },
  13. },
  14. length: {
  15. control: { type: 'number' },
  16. },
  17. variant: {
  18. control: {
  19. type: 'select',
  20. },
  21. options: TextControl.AVAILABLE_VARIANTS,
  22. },
  23. size: {
  24. control: {
  25. type: 'select',
  26. },
  27. options: TextControl.AVAILABLE_SIZES,
  28. },
  29. onChange: {
  30. table: {
  31. disable: true,
  32. },
  33. action: 'changed',
  34. },
  35. },
  36. args: {
  37. ...(Component.defaultProps ?? {}),
  38. label: Component.displayName,
  39. },
  40. };
  41. export const NumberSpinner = (args: Omit<Props, 'ref'>) => (
  42. <Component
  43. {...args}
  44. />
  45. );
  46. export default meta;