-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat(form): add forms and form element components #67
Conversation
👍 |
Apologies for the delay in reviewing this. It was a bigger pr and I didn't have a large block of time until today.
re: "Also, these are the basic building block components, there are no helper/wrapping components" I usually put together something like that for projects I'm working on. ex: forms, I usually have a formgroup, error and validation wrapped components (tailored to app ux). If they exist, they should be part of another repo like |
}; | ||
|
||
const defaultProps = { | ||
tag: 'p', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure why this would ever happen but then I remembered the static text class. 👍
A few comments. Great work! |
); | ||
|
||
return ( | ||
<Tag {...attributes} className={classes} htmlFor={htmlFor} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider adding {...attributes}
after htmlFor={htmlFor}
, I could imagine someone not using for
and sticking with htmlFor
, in which case it would be overridden with a falsey attribute.
Sorry about the copy-pasta with the exported component name. I'll clean these up Monday. As for taking select and textarea out, would it be acceptable to leave them in and create convenience components called |
Hmmm. That's a fair point. There would still be a switch for type and props assigned. In that case, no need to include Select & Textarea in this pr. If it's a big enough problem it can be addressed in a later pr without a breaking change. Removing it after it existed would be a breaking change. |
b22fe5a
to
cf8196e
Compare
/me kicks travis |
👍 |
#50
Forms and form element components as well as docs and tests including:
What this doesn't include for forms:
.form-check
vs.radio
and.check
) half of their docs use or the other)<Fieldset disabled>
-><fieldset disabled>
Also, these are the basic building block components, there are no helper/wrapping components (like a single component which will build out a form group with a label and an input for you.) The helper/wrapping components can utilize these, if you determine this library should have such components (in which case, let me know and I can add them).
I did the best I could with docs, there are a lot of examples which shows everything, but not everything has a dedicated section.