Design system.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

63 строки
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 { TagInput as Component, TagInputProps as Props, AVAILABLE_TAG_INPUT_SEPARATORS } 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: {
  16. type: 'text',
  17. },
  18. },
  19. variant: {
  20. control: {
  21. type: 'select',
  22. },
  23. options: TextControl.AVAILABLE_VARIANTS,
  24. },
  25. size: {
  26. control: {
  27. type: 'select',
  28. },
  29. options: TextControl.AVAILABLE_SIZES,
  30. },
  31. fallbackElement: {
  32. table: {
  33. disable: true,
  34. },
  35. },
  36. valueSeparator: {
  37. control: {
  38. type: 'select',
  39. },
  40. options: AVAILABLE_TAG_INPUT_SEPARATORS,
  41. },
  42. onChange: {
  43. table: {
  44. disable: true,
  45. },
  46. action: 'changed',
  47. },
  48. },
  49. args: {
  50. ...(Component.defaultProps ?? {}),
  51. label: Component.displayName,
  52. },
  53. };
  54. export const TagInput = (args: Omit<Props, 'ref'>) => (
  55. <Component
  56. {...args}
  57. />
  58. );
  59. export default meta;