feat(label)!: port to <pf-v6-label> - #3161
Conversation
|
✅ Commitlint tests passed!More Info{
"valid": true,
"errors": [],
"warnings": [],
"input": "feat(label)!: port to `<pf-v6-label>`"
} |
✅ Deploy Preview for patternfly-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
This comment has been minimized.
This comment has been minimized.
<pf-v6-label>
zeroedin
left a comment
There was a problem hiding this comment.
Needs:
- improved PR description
- changeset
- tests
| | `isEditable` / `editableProps` | Complex inline editing pattern; deferred to a future release | | ||
| | `onEditComplete` / `onEditCancel` | Dependent on editable support | | ||
| | `render` | React-specific render prop for router integration; not applicable to web components | | ||
| | `tooltipPosition` | Tooltip integration for truncated labels; will integrate with `<pf-v6-tooltip>` in a future release | |
There was a problem hiding this comment.
Not sure why this is marked for future release. This PR might just be blocked on #3141
Once that PR merges we can do the integration here.
There was a problem hiding this comment.
@zeroedin are you suggesting we wait for Tooltip to merge, before finishing this PR?
There was a problem hiding this comment.
Yes. my assumption is that we'd have to import tooltip inside of label to support this, wrapping the tooltip around the label when truncated is set. I haven't looked deeply into how patternfly itself does this internally.
| | `isEditable` / `editableProps` | Complex inline editing pattern; deferred to a future release | | ||
| | `onEditComplete` / `onEditCancel` | Dependent on editable support | |
There was a problem hiding this comment.
We should investigate these further instead of defering.
| | `render` | React-specific render prop for router integration; not applicable to web components | | ||
| | `tooltipPosition` | Tooltip integration for truncated labels; will integrate with `<pf-v6-tooltip>` in a future release | | ||
| | `closeBtn` / `closeBtnProps` | Custom close button node; the web component always renders a native `<button>` | | ||
| | `variant="add"` | Add button styling (used by LabelGroup); will be added with `<pf-v6-label-group>` | |
There was a problem hiding this comment.
Remove this should be a built in function of label-group not label. while it does render like a label it is itself a button action of label group. It does not need to be listed in these tables.
| | `variant="add"` | Add button styling (used by LabelGroup); will be added with `<pf-v6-label-group>` | |
| | `onEditComplete` / `onEditCancel` | Dependent on editable support | | ||
| | `render` | React-specific render prop for router integration; not applicable to web components | | ||
| | `tooltipPosition` | Tooltip integration for truncated labels; will integrate with `<pf-v6-tooltip>` in a future release | | ||
| | `closeBtn` / `closeBtnProps` | Custom close button node; the web component always renders a native `<button>` | |
There was a problem hiding this comment.
This might need to be slottable if it is customizable instead of just statically always a button.
| | `closeBtn` / `closeBtnProps` | Custom close button node; the web component always renders a native `<button>` | |
But fix the code so <button id="close"> is wrapped in a <slot name="close-button></slot>
| <button id="close" | ||
| type="button" | ||
| aria-label="${this.closeButtonLabel ?? 'Close'}" | ||
| ?disabled="${this.disabled}" | ||
| @click="${this.#onClose}"> | ||
| <svg viewBox="0 0 384 512" aria-hidden="true"> | ||
| <path d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3l105.4 105.3c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256l105.3-105.4z"/> | ||
| </svg> | ||
| </button>`} |
There was a problem hiding this comment.
In PF React this is customizable, we likely will need to wrap the <button> with a slot. Then we'll have to ensure we can listen for the click event and still trigger the #onClose and properly disable the button when this.disabled is set.
Co-authored-by: Steven Spriggs <steven.spriggs@gmail.com>
Co-authored-by: Steven Spriggs <steven.spriggs@gmail.com>
Co-authored-by: Steven Spriggs <steven.spriggs@gmail.com>
What I did
<pf-v6-label>element