-
Notifications
You must be signed in to change notification settings - Fork 105
feat(helper-text): add pf-helper-text element #2947
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
base: main
Are you sure you want to change the base?
Conversation
|
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.
needs a changeset
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.
needs docs
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.
fixed
| iconSet: string | undefined; | ||
|
|
||
| /** | ||
| * מחשב את האייקון שיוצג, בהתבסס על הסטטוס או המאפיין icon |
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.
english please ;)
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.
fixed
| * @slot icon - Custom icon to override default | ||
| * @slot - Place element content here |
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.
move these to the render template. see RedHat-UX/red-hat-design-system#2548 for example
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.
fixed
What I did
Created a new custom element using LitElement.
Implemented a status property with options: 'default', 'success', 'warning', 'error', 'indeterminate'.
Added support for custom icons via icon and icon-set properties.
Added a slot named "icon" for overriding the default icon with a custom SVG.
Added a default slot for the text content.
Styled the element so that the text and icon colors correspond to the status.
Testing Instructions
- Import the element in a demo page:
<script type="module"> import '@patternfly/elements/pf-icon/pf-icon.js'; import '@patternfly/elements/pf-helper-text/pf-helper-text.js'; </script>- Add elements with different statuses and icons:
Default helper text Warning helper text Success helper textThe text appears correctly.
The icon matches the status or the custom icon if provided.
The slot "icon" can be overridden with a custom SVG.
Notes to Reviewers