Skip to content
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

feat(alert): add pf-alert #2593

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions elements/pf-alert/demo/custom-icons.html
Original file line number Diff line number Diff line change
@@ -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>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

<pf-alert header="Custom icon">
<pf-icon slot="icon" set="fas" icon="users" loading="idle"></pf-icon>
Expand Down
13 changes: 6 additions & 7 deletions elements/pf-alert/demo/inline.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
<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>

<h1>
<h2>
Inline
</h1>
</h2>

<pf-alert header="Default inline" inline></pf-alert>
<pf-alert variant="info" header="Info inline" inline></pf-alert>
<pf-alert variant="success" header="Success inline" inline></pf-alert>
<pf-alert variant="warning" header="Warning inline" inline></pf-alert>
<pf-alert variant="danger" header="Danger inline" inline></pf-alert>

<h1>
<h2>
Inline Plain
</h1>
</h2>

<pf-alert header="Default inline" inline plain></pf-alert>
<pf-alert variant="info" header="Info inline" inline plain></pf-alert>
<pf-alert variant="success" header="Success inline" inline plain></pf-alert>
<pf-alert variant="warning" header="Warning inline" inline plain></pf-alert>
<pf-alert variant="danger" header="Danger inline" inline plain></pf-alert>
<pf-alert variant="danger" header="Danger inline" inline plain></pf-alert>
37 changes: 18 additions & 19 deletions elements/pf-alert/demo/kitchen-sink.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<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>

<pf-alert header="Default alert title"></pf-alert>
<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>

<h1>
Alert Variations
</h1>
<h2>
Alert Variations
</h2>

<pf-alert header="Success alert title" variant="success" dismissable>
<p>Success alert description. This should tell the user more information about the alert.</p>
Expand Down Expand Up @@ -41,9 +40,9 @@ <h1>

<pf-alert header="Success alert title" variant="success" dismissable></pf-alert>

<h1>
<h2>
Default Icons
</h1>
</h2>

<pf-alert header="Custom icon">
<pf-icon slot="icon" set="fas" icon="users" loading="idle"></pf-icon>
Expand All @@ -61,9 +60,9 @@ <h1>
<pf-icon slot="icon" set="fas" icon="laptop" loading="idle"></pf-icon>
</pf-alert>

<h1>
<h2>
Plain
</h1>
</h2>

<pf-alert header="Default plain" plain></pf-alert>
<pf-alert variant="info" header="Info plain" plain></pf-alert>
Expand All @@ -74,45 +73,45 @@ <h1>
<pf-alert variant="warning" header="Warning plain" plain></pf-alert>
<pf-alert variant="danger" header="Danger plain" plain></pf-alert>

<h1>
<h2>
Inline
</h1>
</h2>

<pf-alert header="Default inline" inline></pf-alert>
<pf-alert variant="info" header="Info inline" inline></pf-alert>
<pf-alert variant="success" header="Success inline" inline></pf-alert>
<pf-alert variant="warning" header="Warning inline" inline></pf-alert>
<pf-alert variant="danger" header="Danger inline" inline></pf-alert>

<h1>
<h2>
Plain
</h1>
</h2>

<pf-alert header="Default inline" plain></pf-alert>
<pf-alert variant="info" header="Info inline" plain></pf-alert>
<pf-alert variant="success" header="Success inline" plain></pf-alert>
<pf-alert variant="warning" header="Warning inline" plain></pf-alert>
<pf-alert variant="danger" header="Danger inline" plain></pf-alert>

<h1>
<h2>
Inline Plain
</h1>
</h2>

<pf-alert header="Default inline" inline plain></pf-alert>
<pf-alert variant="info" header="Info inline" inline plain></pf-alert>
<pf-alert variant="success" header="Success inline" inline plain></pf-alert>
<pf-alert variant="warning" header="Warning inline" inline plain></pf-alert>
<pf-alert variant="danger" header="Danger inline" inline plain></pf-alert>

<h1>
<h2>
Truncated Title
</h1>
</h2>

<pf-alert style="width:100px;" truncate-title header="It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of light, it was the season of darkness, it was the spring of hope, it was the winter of despair."></pf-alert>

<h1>
<h2>
Timeout
</h1>
</h2>

<pf-button id="create-timeout-alert">Create default timeout alert</pf-button>
<pf-button id="create-timeout-inline-alert">Create inline timeout alert</pf-button>
Expand Down
7 changes: 1 addition & 6 deletions elements/pf-alert/demo/pf-alert.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
<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>

<pf-alert header="Default alert title"></pf-alert>
<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>
11 changes: 5 additions & 6 deletions elements/pf-alert/demo/plain.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<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>

<h1>
<h2>
Plain
</h1>
</h2>

<pf-alert header="Default plain" plain></pf-alert>
<pf-alert variant="info" header="Info plain" plain></pf-alert>
Expand All @@ -14,9 +13,9 @@ <h1>
<pf-alert variant="warning" header="Warning plain" plain></pf-alert>
<pf-alert variant="danger" header="Danger plain" plain></pf-alert>

<h1>
<h2>
Inline Plain
</h1>
</h2>

<pf-alert header="Default inline" inline plain></pf-alert>
<pf-alert variant="info" header="Info inline" inline plain></pf-alert>
Expand Down
7 changes: 3 additions & 4 deletions elements/pf-alert/demo/timeout.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<link rel="stylesheet" href="demo.css">
<script type="module" src="timeout.js"></script>
<link rel="stylesheet" href="demo.css"><script type="module" src="timeout.js"></script>

<h1>
<h2>
Timeout
</h1>
</h2>

<pf-button id="create-timeout-alert">Create default timeout alert</pf-button>
<pf-button id="create-timeout-inline-alert">Create inline timeout alert</pf-button>
Expand Down
9 changes: 4 additions & 5 deletions elements/pf-alert/demo/truncated.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<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>

<h1>
<h2>
Truncated Title
</h1>
</h2>

<pf-alert style="width:100px;" truncate-title header="It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of light, it was the season of darkness, it was the spring of hope, it was the winter of despair."></pf-alert>
<pf-alert style="width:100px;" truncate-title header="It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of light, it was the season of darkness, it was the spring of hope, it was the winter of despair."></pf-alert>
11 changes: 5 additions & 6 deletions elements/pf-alert/demo/variants.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<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>

<pf-alert header="Default alert title"></pf-alert>
<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>

<h1>
Alert Variations
</h1>
<h2>
Alert Variations
</h2>

<pf-alert header="Success alert title" variant="success" dismissable>
<p>Success alert description. This should tell the user more information about the alert.</p>
Expand Down Expand Up @@ -39,4 +38,4 @@ <h1>
<button slot="actions">Ignore</button>
</pf-alert>

<pf-alert header="Success alert title" variant="success" dismissable></pf-alert>
<pf-alert header="Success alert title" variant="success" dismissable></pf-alert>
Loading
Loading