Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

47 wiersze
1.0 KiB

  1. import {createFormElement} from "./FormElementComponent";
  2. export default {
  3. title: 'Components/Form Element',
  4. args: {
  5. inputType: 'text',
  6. },
  7. argTypes: {
  8. inputType: {
  9. control: 'select',
  10. options: ['text', 'checkbox', 'radio', 'select', 'password', 'textarea'],
  11. }
  12. }
  13. }
  14. const Template = ({...args}) => {
  15. return createFormElement({...args});
  16. };
  17. export const TextFormElement = Template.bind({});
  18. TextFormElement.args = {
  19. placeholder: 'Platzhalter',
  20. };
  21. export const CheckboxFormElement = Template.bind({});
  22. CheckboxFormElement.args = {
  23. inputType: 'checkbox',
  24. label: 'Ich akzeptiere die <a href="#">Datenschutzbestimmungen</a>.',
  25. };
  26. export const RadioFormElement = Template.bind({});
  27. RadioFormElement.args = {
  28. inputType: 'radio',
  29. label: 'Option 1',
  30. };
  31. export const SelectFormElement = Template.bind({});
  32. SelectFormElement.args = {
  33. inputType: 'select',
  34. label: 'Auswahl',
  35. };
  36. export const TextareaFormElement = Template.bind({});
  37. TextareaFormElement.args = {
  38. inputType: 'textarea',
  39. label: 'Ihre Nachricht',
  40. };