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

Form Revolution #1889

Closed
19 tasks done
sebald opened this issue Mar 23, 2022 · 11 comments
Closed
19 tasks done

Form Revolution #1889

sebald opened this issue Mar 23, 2022 · 11 comments
Labels
status:ready Ready for development type:feature New feature or component
Milestone

Comments

@sebald
Copy link
Member

sebald commented Mar 23, 2022

Description

We have to go over the forms and unify their API!

New


Refactor

Bugs

Delete

API

  • Make everything available under the "Field.<...>" API! Not doing this since Field.Select.Option is super long and weird to type. This doesn't make the usage of Marigold better.

Consequences

Easier to use forms in Marigold 🤞

@sebald sebald added status:rfc New issue that requires discussion and finalization type:feature New feature or component labels Mar 23, 2022
@sebald
Copy link
Member Author

sebald commented Mar 23, 2022

@ti10le we could also change the import API like the following:

import { Field } from '@marigold/components';

<Field.Text/>
<Field.TextArea/>
<Field.Checkbox/>
<Field.Select/>

I could life with that 😅

@sebald
Copy link
Member Author

sebald commented Mar 23, 2022

What's the common API of Field Elements?

  • name

  • label

  • description

  • errorMessage

  • disabled

  • readonly

  • required

  • defaultValue

  • error (boolean)

Plus the regular props that the form HTML element has

@ti10le
Copy link
Contributor

ti10le commented Mar 23, 2022

This would be also good for me. Then we don't include the same things from field in every field component 😊 It would be clear that all of them a Field component.

@sebald
Copy link
Member Author

sebald commented Mar 23, 2022

Yes, exactly 😄 question is how we document this and structure it inside of @marigold/components.

Do we create a Field/Form folder and put everything there?

@ti10le
Copy link
Contributor

ti10le commented Mar 24, 2022

I would create a folder for every component like now but dont show the Field component in docs or storybook. Only together with the other part. Not all inside Field i think 🤔

@sebald
Copy link
Member Author

sebald commented Mar 24, 2022

Might be confusing for imports

@ti10le
Copy link
Contributor

ti10le commented Mar 25, 2022

Why? Not publishing the Field folder

@sebald
Copy link
Member Author

sebald commented Mar 25, 2022

Why? Not publishing the Field folder

@ti10le not sure what do you mean.

I think our project structure has to reflect export, otherwise you'll have a hard time finding things. This would also mean that if we separate stuff in the documentation (e.g. forms, layout, content, ...) this should be reflected in side the project.

@ti10le
Copy link
Contributor

ti10le commented Mar 25, 2022

Ok I think the way you want to do this would be good for me, too 😊

sebald added a commit that referenced this issue Mar 25, 2022
- no variants anymore
- no disabled (not possible anyway)
- improve a11y

Ref #1889
sebald added a commit that referenced this issue Mar 25, 2022
- no variants anymore
- no disabled (not possible anyway)
- improve a11y

Ref #1889
@sebald sebald pinned this issue Mar 28, 2022
sebald added a commit that referenced this issue Mar 28, 2022
@sebald sebald moved this to In Progress in Cycles 2022 Mar 28, 2022
@ti10le
Copy link
Contributor

ti10le commented Mar 30, 2022

ℹ️ Note for later: Field.tsx and HelpText.tsx are not tested enough. Coverage is not 100%

@ti10le
Copy link
Contributor

ti10le commented Apr 5, 2022

I would make only a <RadioGroup /> component. The most DS have only the Group. Because you should never use an Radio standalone.

@sebald sebald added status:ready Ready for development and removed status:rfc New issue that requires discussion and finalization labels Apr 9, 2022
@sebald sebald added this to the 🎉🎊 Version 1.0 🎉🎊 milestone Apr 14, 2022
@sebald sebald closed this as completed May 17, 2022
Repository owner moved this from In Progress to Done in Cycles 2022 May 17, 2022
@sebald sebald unpinned this issue May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready Ready for development type:feature New feature or component
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants