File tree Expand file tree Collapse file tree 8 files changed +115
-0
lines changed
Expand file tree Collapse file tree 8 files changed +115
-0
lines changed Original file line number Diff line number Diff line change 1515 "./pf-accordion/pf-accordion-header.js" : " ./pf-accordion/pf-accordion-header.js" ,
1616 "./pf-accordion/pf-accordion-panel.js" : " ./pf-accordion/pf-accordion-panel.js" ,
1717 "./pf-accordion/pf-accordion.js" : " ./pf-accordion/pf-accordion.js" ,
18+ "./pf-alert/pf-alert.js" : " ./pf-alert/pf-alert.js" ,
1819 "./pf-avatar/pf-avatar.js" : " ./pf-avatar/pf-avatar.js" ,
1920 "./pf-back-to-top/pf-back-to-top.js" : " ./pf-back-to-top/pf-back-to-top.js" ,
2021 "./pf-background-image/pf-background-image.js" : " ./pf-background-image/pf-background-image.js" ,
Original file line number Diff line number Diff line change 1+ # Alert
2+ Add a description of the component here.
3+
4+ ## Usage
5+ Describe how best to use this web component along with best practices.
6+
7+ ``` html
8+ <pf-alert >
9+
10+ </pf-alert >
11+ ```
Original file line number Diff line number Diff line change 1+ < pf-alert > </ pf-alert >
2+
3+ < script type ="module ">
4+ import '@patternfly/elements/pf-alert/pf-alert.js' ;
5+ </ script >
6+
7+ < style >
8+ pf-alert {
9+ /* insert demo styles */
10+ }
11+ </ style >
12+
Original file line number Diff line number Diff line change 1+ {% renderOverview %}
2+ <pf-alert ></pf-alert >
3+ {% endrenderOverview %}
4+
5+ {% band header="Usage" %}{% endband %}
6+
7+ {% renderSlots %}{% endrenderSlots %}
8+
9+ {% renderAttributes %}{% endrenderAttributes %}
10+
11+ {% renderMethods %}{% endrenderMethods %}
12+
13+ {% renderEvents %}{% endrenderEvents %}
14+
15+ {% renderCssCustomProperties %}{% endrenderCssCustomProperties %}
16+
17+ {% renderCssParts %}{% endrenderCssParts %}
Original file line number Diff line number Diff line change 1+ : host {
2+ dis play: block;
3+ }
Original file line number Diff line number Diff line change 1+ import { LitElement , html , type TemplateResult } from 'lit' ;
2+ import { customElement } from 'lit/decorators/custom-element.js' ;
3+
4+ import styles from './pf-alert.css' ;
5+
6+ /**
7+ * Alert
8+ * @slot - Place element content here
9+ */
10+ @customElement ( 'pf-alert' )
11+ export class PfAlert extends LitElement {
12+ static readonly styles : CSSStyleSheet [ ] = [ styles ] ;
13+
14+ render ( ) : TemplateResult < 1 > {
15+ return html `
16+ < slot > </ slot >
17+ ` ;
18+ }
19+ }
20+
21+ declare global {
22+ interface HTMLElementTagNameMap {
23+ 'pf-alert' : PfAlert ;
24+ }
25+ }
Original file line number Diff line number Diff line change 1+ import { test } from '@playwright/test' ;
2+ import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js' ;
3+ import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js' ;
4+
5+ const tagName = 'pf-alert' ;
6+
7+ test . describe ( tagName , ( ) => {
8+ test ( 'snapshot' , async ( { page } ) => {
9+ const componentPage = new PfeDemoPage ( page , tagName ) ;
10+ await componentPage . navigate ( ) ;
11+ await componentPage . snapshot ( ) ;
12+ } ) ;
13+
14+ test ( 'ssr' , async ( { browser } ) => {
15+ const fixture = new SSRPage ( {
16+ tagName,
17+ browser,
18+ demoDir : new URL ( '../demo/' , import . meta. url ) ,
19+ importSpecifiers : [
20+ `@patternfly/elements/${ tagName } /${ tagName } .js` ,
21+ ] ,
22+ } ) ;
23+ await fixture . snapshots ( ) ;
24+ } ) ;
25+ } ) ;
Original file line number Diff line number Diff line change 1+ import { expect , html } from '@open-wc/testing' ;
2+ import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js' ;
3+ import { PfAlert } from '@patternfly/elements/pf-alert/pf-alert.js' ;
4+
5+ describe ( '<pf-alert>' , function ( ) {
6+ describe ( 'simply instantiating' , function ( ) {
7+ let element : PfAlert ;
8+ it ( 'imperatively instantiates' , function ( ) {
9+ expect ( document . createElement ( 'pf-alert' ) ) . to . be . an . instanceof ( PfAlert ) ;
10+ } ) ;
11+
12+ it ( 'should upgrade' , async function ( ) {
13+ element = await createFixture < PfAlert > ( html `< pf-alert > </ pf-alert > ` ) ;
14+ const klass = customElements . get ( 'pf-alert' ) ;
15+ expect ( element )
16+ . to . be . an . instanceOf ( klass )
17+ . and
18+ . to . be . an . instanceOf ( PfAlert ) ;
19+ } ) ;
20+ } ) ;
21+ } ) ;
You can’t perform that action at this time.
0 commit comments