Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User Story: Implement Form Component #4

Open
csantiago132 opened this issue Oct 2, 2024 · 0 comments
Open

User Story: Implement Form Component #4

csantiago132 opened this issue Oct 2, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@csantiago132
Copy link
Contributor

csantiago132 commented Oct 2, 2024

As a Front-End Developer,I want to have a reusable Form component that manages form state and validation, so that I can easily handle form submissions and validations without boilerplate code.

Context Hierarchy

graph TD
    Form -->|Uses| InputField
    Form -->|Uses| TextareaField
    Form -->|Uses| CheckboxField
    Form -->|Uses| RadioGroupField
    Form -->|Uses| SelectField
    Form -->|Uses| FileField
    Form -->|Uses| DatePickerField
    Form -->|Uses| RangeField
    Form -->|Uses| ColorPickerField
Loading

Form Submission Flow

sequenceDiagram
    participant User
    participant FormComponent as Form Component
    participant FieldComponents as Field Components
    participant Conform
    participant Zod
    User->>FieldComponents: Fills in form fields
    FieldComponents->>FormComponent: Field values
    FormComponent->>Conform: Validates form data
    Conform->>Zod: Uses schema for validation
    Zod-->>Conform: Validation result
    Conform-->>FormComponent: Submission data or errors
    FormComponent-->>User: Displays errors or proceeds
Loading

Testing Strategy

https://kurocado-studio.github.io/html-forms/a11y-testing-strategy.html

Acceptance Criteria

  • The Form component should accept a validation schema (e.g., Zod schema).
  • It should provide form context to child components
  • It should handle form submissions and pass validated data to a callback function
  • It should prevent default form submission behavior and handle it via React
@csantiago132 csantiago132 self-assigned this Oct 2, 2024
@csantiago132 csantiago132 converted this from a draft issue Oct 2, 2024
@csantiago132 csantiago132 added the enhancement New feature or request label Oct 2, 2024
@csantiago132 csantiago132 moved this to Todo in HTML Forms Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

1 participant