Conversation
🦋 Changeset detectedLatest commit: 472fa59 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for patternfly-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
… feat/add-pf-alert
….Add function to SlotController
bennypowers
left a comment
There was a problem hiding this comment.
some preliminary comments. i didn't get to the lifecycle or template or styles yet
| const hasContent = this.#slots.hasAnonymousSlot(); | ||
|
|
||
| return html` | ||
| <div id="container" role="alert" aria-hidden="false" class="${classMap({ truncateTitle })}"> |
There was a problem hiding this comment.
can a role=alert have interactive children @nikkimk?
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Alert_Role
…nfly-elements into feat/add-pf-alert
Co-authored-by: Benny Powers <bennypowers@users.noreply.github.com>
…nfly-elements into feat/add-pf-alert
| <link rel="stylesheet" href="demo.css"> | ||
| <script type="module" src="pf-alert.js"></script> |
There was a problem hiding this comment.
let's prefer to inline this stuff, to make the demos easier to grok
elements/pf-alert/demo/inline.html
Outdated
| <link rel="stylesheet" href="demo.css"> | ||
| <script type="module" src="pf-alert.js"></script> |
elements/pf-alert/demo/inline.html
Outdated
| <h1> | ||
| Inline | ||
| </h1> | ||
|
|
There was a problem hiding this comment.
| <h1> | |
| Inline | |
| </h1> |
elements/pf-alert/demo/inline.html
Outdated
| <h1> | ||
| Inline Plain | ||
| </h1> | ||
|
|
There was a problem hiding this comment.
| <h1> | |
| Inline Plain | |
| </h1> | |
| <h2>Plain</h2> | |
| <link rel="stylesheet" href="demo.css"> | ||
| <script type="module" src="pf-alert.js"></script> |
elements/pf-alert/demo/pf-alert.html
Outdated
| <pf-alert variant="info" header="Info alert title"></pf-alert> | ||
| <pf-alert variant="success" header="Success alert title"></pf-alert> | ||
| <pf-alert variant="warning" header="Warning alert title"></pf-alert> | ||
| <pf-alert variant="danger" header="Danger alert title"></pf-alert> No newline at end of file |
There was a problem hiding this comment.
| <pf-alert variant="info" header="Info alert title"></pf-alert> | |
| <pf-alert variant="success" header="Success alert title"></pf-alert> | |
| <pf-alert variant="warning" header="Warning alert title"></pf-alert> | |
| <pf-alert variant="danger" header="Danger alert title"></pf-alert> |
we can leave these for variants.html
elements/pf-alert/demo/plain.html
Outdated
| <link rel="stylesheet" href="demo.css"> | ||
| <script type="module" src="pf-alert.js"></script> |
elements/pf-alert/pf-alert.css
Outdated
| --pf-alert-title-color: var(--pf-alert-title-color, var(--pf-global--default-color--300, #003737)); | ||
| --pf-alert-icon-color: var(--pf-alert-icon-color, var(--pf-global--default-color--200, #009596)); | ||
| --pf-alert-inline-background-color: var(--pf-global--palette--cyan-50, #f2f9f9); | ||
| --alert-title-color: var(--alert-title-color, var(--pf-global--default-color--300, #003737)); |
There was a problem hiding this comment.
| --alert-title-color: var(--alert-title-color, var(--pf-global--default-color--300, #003737)); | |
| --_alert-title-color: var(--pf-global--default-color--300, #003737); |
etc, and at call sites
| danger: { set: 'fas', icon: 'exclamation-circle' }, | ||
| info: { set: 'fas', icon: 'info-circle' }, | ||
| close: { set: 'patternfly', icon: 'close' }, | ||
| get(name: 'default' | 'success' | 'warning' | 'danger' | 'info' | 'close') { |
There was a problem hiding this comment.
remove get() and reference the data here in render
elements/pf-alert/pf-alert.ts
Outdated
| <div id="container" role="alert" aria-hidden="false" class="${classMap({ truncateTitle })}"> | ||
| <div id="left-column" part="left-column"> | ||
| <slot name="icon" id="icon">${icon}</slot> | ||
| <slot name="icon" id="icon">${this.#icon}</slot> |
There was a problem hiding this comment.
inline the pf-icon, reference data in ICONS directly here. remove #icon
| @@ -1,5 +1,4 @@ | |||
| <link rel="stylesheet" href="demo.css"> | |||
| <script type="module" src="pf-alert.js"></script> | |||
| <link rel="stylesheet" href="demo.css"><script type="module" src="pf-alert.js"></script> | |||
There was a problem hiding this comment.
For the sake of clarity, What I mean by inline is to replace <link href with <style and <script src with <script
In other words, each demo file would be self contained except for the files we ship in our package
|
Thanks @brianferry ! If you don't mind, I'd like to continue with this. I started with your work in my branch https://github.com/martinpitt/patternfly-elements/tree/pf-alert and now I am adding some commits on top. The demo at least works again, but this still needs a lot of effort, so no new PR yet. |
#2539
What I did
Testing Instructions
Notes to Reviewers