-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Forms): add inline HelpButton to all Field.* components as defau…
…lt (with option to open in Dialog) (#4282) This PR changes the existing behavior of the `help` prop for Fields that previously supported it. The content now opens inline instead of in a Dialog. The `help` prop has now all of these optional props: ```tsx <Field.String label="Label text" help={{ title: 'Help is available', content: 'Take the time to help other people without expecting a reward or gratitude is definitely important in living an optimistic life.', open: false,// only for the inline variant renderAs: 'dialog' }} /> ``` We use this prop description: > Provide help content for the field using `title` and `content` as a string or React.Node. Additionally, you can set `open` to `true` to display the inline help or use `renderAs` set to `dialog` to render the content in a [Dialog](/uilib/components/dialog/) (recommended for larger amounts of content). Examples with inline "HelpButton": - [FieldBlock](https://eufemia-git-feat-forms-inline-help-button-eufemia.vercel.app/uilib/extensions/forms/create-component/FieldBlock/demos/#inline-help-button-vertical-only) (several examples) - [Form.MainHeading](https://eufemia-git-feat-forms-inline-help-button-eufemia.vercel.app/uilib/extensions/forms/Form/MainHeading/#with-helpbutton) - [Form.SubHeading](https://eufemia-git-feat-forms-inline-help-button-eufemia.vercel.app/uilib/extensions/forms/Form/SubHeading/#with-helpbutton) - [Field.String](https://eufemia-git-feat-forms-inline-help-button-eufemia.vercel.app/uilib/extensions/forms/base-fields/String/#with-help) - [Field.Number](https://eufemia-git-feat-forms-inline-help-button-eufemia.vercel.app/uilib/extensions/forms/base-fields/Number/#with-help) - [Field.Upload](https://eufemia-git-feat-forms-inline-help-button-eufemia.vercel.app/uilib/extensions/forms/feature-fields/more-fields/Upload/#with-help) - ... many other fields do have an example as well. **NB:** We do not document the internals of the inline version at this time. This can be included in another PR. The reason is that it would require additional tests, examples, and documentation. It is also an "isolated" feature specific to the HelpButton. However, as of this writing, I am unsure if we will ever document it, as integration is not straightforward. There are several considerations to address when implementing it.
- Loading branch information
1 parent
030a09c
commit e869a60
Showing
190 changed files
with
3,058 additions
and
819 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.