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.
 
 
 

61 regels
1.1 KiB

  1. import * as React from 'react';
  2. import type { Meta } from '@storybook/react';
  3. import { TextControl } from '@tesseract-design/web-base';
  4. import { PatternTextInput as Component, PatternTextInputProps 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. indicator: {
  15. control: { type: 'text' },
  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. inputMode: {
  30. control: {
  31. type: 'select',
  32. },
  33. options: TextControl.AVAILABLE_INPUT_MODES,
  34. },
  35. length: {
  36. control: {
  37. type: 'number',
  38. },
  39. },
  40. onChange: {
  41. table: {
  42. disable: true,
  43. },
  44. action: 'changed',
  45. },
  46. },
  47. args: {
  48. ...(Component.defaultProps ?? {}),
  49. label: Component.displayName,
  50. },
  51. };
  52. export const PatternTextInput = (args: Omit<Props, 'ref'>) => (
  53. <Component
  54. {...args}
  55. />
  56. );
  57. export default meta;