Closed sebald closed 2 years ago
@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 đ
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
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.
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?
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 đ¤
Might be confusing for imports
Why? Not publishing the Field folder
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.
Ok I think the way you want to do this would be good for me, too đ
âšī¸ Note for later: Field.tsx and HelpText.tsx are not tested enough. Coverage is not 100%
I would make only a <RadioGroup />
component. The most DS have only the Group. Because you should never use an Radio standalone.
Description
We have to go over the forms and unify their API!
New
<CheckboxGroup>
#2016<RadioGroup>
#2029Refactor
<label>
use Box (<Box as="label" variant="checkbox.value"/>
)width
from theme via prop #2070Bugs
Delete
API
Make everything available under the "Field.<...>" API!Not doing this sinceField.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 đ¤