-
Notifications
You must be signed in to change notification settings - Fork 8
Enhanced form building #17
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
Conversation
Signed-off-by: 8845musign <hiroki.yokouchi@dr-ubie.com>
Signed-off-by: 8845musign <hiroki.yokouchi@dr-ubie.com>
Signed-off-by: 8845musign <hiroki.yokouchi@dr-ubie.com>
Signed-off-by: 8845musign <hiroki.yokouchi@dr-ubie.com>
Signed-off-by: 8845musign <hiroki.yokouchi@dr-ubie.com>
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.
- Sort alphabetically
- Add new component imports
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.
A prefix such as <FieldErrorMessage>
is also possible. However, this has been omitted due to its length.
@@ -28,7 +28,7 @@ const Select: FC<Props> = forwardRef<HTMLSelectElement, Props>( | |||
({ isInvalid = false, disabled = false, children, className, ...props }, ref) => { | |||
return ( | |||
<div className={clsx({ [styles.isInvalid]: isInvalid, [styles.disabled]: disabled }, styles.wrapper, className)}> | |||
<select {...props} disabled={disabled} className={styles.select} ref={ref}> | |||
<select {...props} disabled={disabled} className={styles.select} ref={ref} aria-invalid={isInvalid}> |
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.
Do not want to specify separately
}, []); | ||
|
||
return ( | ||
<fieldset style={{ border: 'none', padding: 0 }}> |
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 think we need a grouping component like
<FormControlGroup>
- Not implemented this time because there are many considerations (e.g., whether to have label prop)
@@ -113,5 +113,5 @@ export const Disabled: Story = { | |||
}; | |||
|
|||
export const IsInvalid: Story = { | |||
render: () => <Input value="wrong value" />, | |||
render: () => <Input value="wrong value" isInvalid />, |
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.
miss
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.
lgtm!
Overview
<Label>
,<ErrorMessage>
,<HelperText>
Implemented as individual components.
However, perhaps a wrapper component like
<FormContorol>
should be created in the futureFor example:
↓ convert to
Screenshot
Default
Textfield & HelperText
Error
Textfield & HelperText & ErrorMessage
InputGroup
<fieldset>
pattern