Skip to content

Commit ae36062

Browse files
bennypowersheyMP
andcommitted
feat(toast)!: migrate pfe-toast to lit
fix(toast): compose UI events chore: 2.0 [pfe-toast] update docs (#1826) * chore: pfe-toast update docs * chore:docs add .no-header-styles opt-out class for headers * style(toast): lint test(pfe-toast): e2e tests test(pfe-toast): e2e tests with page object model test(pfe-toast): build demo with optional shadowroot docs(pfe-toast): rearrange docs urls Co-Authored-by: Michael Potter <[email protected]>
1 parent ce0216e commit ae36062

31 files changed

+488
-962
lines changed

docs/main.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ p.subtitle {
5252
pfe-band.header h1 {
5353
margin: 0;
5454
}
55-
pfe-band h2[id] {
55+
pfe-band h2[id]:not(.no-header-styles) {
5656
font-size: 1.5rem;
5757
line-height: 1.9375rem;
5858
font-weight: bold;
@@ -627,7 +627,7 @@ blockquote {
627627
}
628628

629629
@media (min-width: 1200px) {
630-
pfe-band h2[id] {
630+
pfe-band h2[id]:not(.no-header-styles) {
631631
font-size: 2rem;
632632
line-height: 2.3125rem;
633633
}

elements/pfe-toast/.babelrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

elements/pfe-toast/.editorconfig

Lines changed: 0 additions & 17 deletions
This file was deleted.

elements/pfe-toast/.npmignore

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { pfeCustomElementsManifestConfig } from '@patternfly/pfe-tools/custom-elements-manifest.js';
2+
3+
export default pfeCustomElementsManifestConfig({
4+
globs: ['pfe-*.ts'],
5+
});

elements/pfe-toast/demo/index.html

Lines changed: 0 additions & 99 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<link rel="stylesheet" href="/core/pfe-styles/red-hat-font.min.css">
2+
<link rel="stylesheet" href="/core/pfe-styles/pfe-base.css">
3+
<link rel="stylesheet" href="/core/pfe-styles/pfe-context.css">
4+
<link rel="stylesheet" href="/core/pfe-styles/pfe-layouts.css">
5+
<link rel="stylesheet" href="/core/pfe-core/pfe.css">
6+
7+
<pfe-band color="lightest" size="small">
8+
<pfe-cta priority="secondary"><button data-toast="toast1">Toggle example one</button></pfe-cta>
9+
<pfe-cta priority="secondary"><button data-toast="toast2">Toggle example two</button></pfe-cta>
10+
<pfe-cta priority="secondary"><button data-toast="toast3">Toggle example three</button></pfe-cta>
11+
</pfe-band>
12+
13+
<pfe-toast auto-dismiss="3s" id="toast1">
14+
<p>Lorem ipsum dolor sit amet.</p>
15+
</pfe-toast>
16+
17+
<pfe-toast id="toast2">
18+
<p>Lorem ipsum dolor sit amet.</p>
19+
<pfe-cta priority="secondary"><button>Button 1</button></pfe-cta>
20+
<pfe-cta priority="secondary"><button>Button 2</button></pfe-cta>
21+
</pfe-toast>
22+
23+
<pfe-toast id="toast3" aria-label="Custom alert dialog" close-label="Cerrar">
24+
<h2>Lorem ipsum dolor sit amet</h2>
25+
<p>Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et
26+
dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
27+
clita
28+
kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur
29+
sadipscing elitr.</p>
30+
<pfe-cta priority="secondary"><button>Button 1</button></pfe-cta>
31+
<pfe-cta priority="secondary"><button>Button 2</button></pfe-cta>
32+
</pfe-toast>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import '@patternfly/pfe-band';
2+
import '@patternfly/pfe-cta';
3+
import '@patternfly/pfe-toast';
4+
5+
const root = document.querySelector('[data-demo="pfe-toast"]')?.shadowRoot ?? document;
6+
7+
for (const button of root.querySelectorAll('[data-toast]')) {
8+
button.addEventListener('click', function(event) {
9+
root.getElementById(event.target.dataset.toast).toggle();
10+
});
11+
}

elements/pfe-toast/demo/pfe-toast.story.js

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)