@patternfly/elements 4.2.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +2556 -1279
- package/package.json +13 -7
- package/pf-accordion/pf-accordion-header.js +1 -1
- package/pf-accordion/pf-accordion-panel.js +1 -1
- package/pf-accordion/pf-accordion.js +1 -1
- package/pf-alert/pf-alert.css +193 -0
- package/pf-alert/pf-alert.d.ts +95 -0
- package/pf-alert/pf-alert.js +406 -0
- package/pf-alert/pf-alert.js.map +1 -0
- package/pf-alert/test/pf-alert.e2e.d.ts +1 -0
- package/pf-alert/test/pf-alert.e2e.js +45 -0
- package/pf-alert/test/pf-alert.e2e.js.map +1 -0
- package/pf-alert/test/pf-alert.spec.d.ts +1 -0
- package/pf-alert/test/pf-alert.spec.js +42 -0
- package/pf-alert/test/pf-alert.spec.js.map +1 -0
- package/pf-avatar/pf-avatar.js +1 -1
- package/pf-back-to-top/pf-back-to-top.js +1 -1
- package/pf-back-to-top/test/pf-back-to-top.spec.js +3 -2
- package/pf-back-to-top/test/pf-back-to-top.spec.js.map +1 -1
- package/pf-background-image/pf-background-image.js +1 -1
- package/pf-badge/pf-badge.js +1 -1
- package/pf-banner/pf-banner.js +1 -1
- package/pf-button/pf-button.js +1 -1
- package/pf-card/pf-card.js +1 -1
- package/pf-chip/pf-chip-group.js +1 -1
- package/pf-chip/pf-chip.js +1 -1
- package/pf-clipboard-copy/pf-clipboard-copy.js +1 -1
- package/pf-code-block/pf-code-block.js +1 -1
- package/pf-dropdown/pf-dropdown-group.js +1 -1
- package/pf-dropdown/pf-dropdown-item.js +1 -1
- package/pf-dropdown/pf-dropdown-menu.js +1 -1
- package/pf-dropdown/pf-dropdown.css +8 -1
- package/pf-dropdown/pf-dropdown.js +9 -2
- package/pf-dropdown/pf-dropdown.js.map +1 -1
- package/pf-helper-text/pf-helper-text.css +35 -0
- package/pf-helper-text/pf-helper-text.d.ts +41 -0
- package/pf-helper-text/pf-helper-text.js +107 -0
- package/pf-helper-text/pf-helper-text.js.map +1 -0
- package/pf-helper-text/test/pf-helper-text.e2e.d.ts +1 -0
- package/pf-helper-text/test/pf-helper-text.e2e.js +23 -0
- package/pf-helper-text/test/pf-helper-text.e2e.js.map +1 -0
- package/pf-helper-text/test/pf-helper-text.spec.d.ts +1 -0
- package/pf-helper-text/test/pf-helper-text.spec.js +57 -0
- package/pf-helper-text/test/pf-helper-text.spec.js.map +1 -0
- package/pf-hint/pf-hint.css +120 -0
- package/pf-hint/pf-hint.d.ts +19 -0
- package/pf-hint/pf-hint.js +180 -0
- package/pf-hint/pf-hint.js.map +1 -0
- package/pf-hint/test/pf-hint.e2e.d.ts +1 -0
- package/pf-hint/test/pf-hint.e2e.js +23 -0
- package/pf-hint/test/pf-hint.e2e.js.map +1 -0
- package/pf-hint/test/pf-hint.spec.d.ts +1 -0
- package/pf-hint/test/pf-hint.spec.js +87 -0
- package/pf-hint/test/pf-hint.spec.js.map +1 -0
- package/pf-icon/pf-icon.js +1 -1
- package/pf-jump-links/pf-jump-links-item.js +1 -1
- package/pf-jump-links/pf-jump-links-list.js +1 -1
- package/pf-jump-links/pf-jump-links.js +1 -1
- package/pf-label/pf-label.js +1 -1
- package/pf-modal/pf-modal.d.ts +1 -1
- package/pf-modal/pf-modal.js +1 -1
- package/pf-modal/pf-modal.js.map +1 -1
- package/pf-panel/pf-panel.js +1 -1
- package/pf-popover/pf-popover.js +1 -1
- package/pf-progress/pf-progress.js +1 -1
- package/pf-progress-stepper/pf-progress-step.js +1 -1
- package/pf-progress-stepper/pf-progress-stepper.js +1 -1
- package/pf-search-input/pf-search-input.js +1 -1
- package/pf-select/pf-option-group.js +1 -1
- package/pf-select/pf-option.js +1 -1
- package/pf-select/pf-select.js +1 -1
- package/pf-spinner/pf-spinner.js +1 -1
- package/pf-switch/pf-switch.js +1 -1
- package/pf-table/pf-caption.js +1 -1
- package/pf-table/pf-table.js +1 -1
- package/pf-table/pf-tbody.js +1 -1
- package/pf-table/pf-td.js +1 -1
- package/pf-table/pf-th.js +1 -1
- package/pf-table/pf-thead.js +1 -1
- package/pf-table/pf-tr.js +1 -1
- package/pf-tabs/pf-tab-panel.js +1 -1
- package/pf-tabs/pf-tab.js +1 -1
- package/pf-tabs/pf-tabs.js +1 -1
- package/pf-text-area/pf-text-area.js +1 -1
- package/pf-text-input/pf-text-input.js +1 -1
- package/pf-tile/pf-tile.js +1 -1
- package/pf-timestamp/pf-timestamp.js +1 -1
- package/pf-tooltip/pf-tooltip.js +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { expect, html } from '@open-wc/testing';
|
|
2
|
+
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
|
|
3
|
+
import { PfHelperText } from '@patternfly/elements/pf-helper-text/pf-helper-text.js';
|
|
4
|
+
describe('<pf-helper-text>', function () {
|
|
5
|
+
describe('simply instantiating', function () {
|
|
6
|
+
let element;
|
|
7
|
+
it('imperatively instantiates', function () {
|
|
8
|
+
expect(document.createElement('pf-helper-text')).to.be.an.instanceof(PfHelperText);
|
|
9
|
+
});
|
|
10
|
+
it('should upgrade', async function () {
|
|
11
|
+
element = await createFixture(html `<pf-helper-text></pf-helper-text>`);
|
|
12
|
+
const klass = customElements.get('pf-helper-text');
|
|
13
|
+
expect(element)
|
|
14
|
+
.to.be.an.instanceOf(klass)
|
|
15
|
+
.and
|
|
16
|
+
.to.be.an.instanceOf(PfHelperText);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
describe('variant property', function () {
|
|
20
|
+
it('should default to "default" variant', async function () {
|
|
21
|
+
const element = await createFixture(html `<pf-helper-text></pf-helper-text>`);
|
|
22
|
+
expect(element.variant).to.equal('default');
|
|
23
|
+
});
|
|
24
|
+
it('should reflect variant attribute', async function () {
|
|
25
|
+
const element = await createFixture(html `<pf-helper-text variant="success"></pf-helper-text>`);
|
|
26
|
+
expect(element.variant).to.equal('success');
|
|
27
|
+
expect(element.getAttribute('variant')).to.equal('success');
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
describe('icon display', function () {
|
|
31
|
+
it('should show icon when icon property is set', async function () {
|
|
32
|
+
const element = await createFixture(html `<pf-helper-text icon="check-circle">Success</pf-helper-text>`);
|
|
33
|
+
await element.updateComplete;
|
|
34
|
+
const iconContainer = element.shadowRoot?.querySelector('#icon');
|
|
35
|
+
expect(iconContainer?.hasAttribute('hidden')).to.be.false;
|
|
36
|
+
});
|
|
37
|
+
it('should hide icon when no icon or slotted icon is present', async function () {
|
|
38
|
+
const element = await createFixture(html `<pf-helper-text variant="default">Text</pf-helper-text>`);
|
|
39
|
+
await element.updateComplete;
|
|
40
|
+
const iconContainer = element.shadowRoot?.querySelector('#icon');
|
|
41
|
+
expect(iconContainer?.hasAttribute('hidden')).to.be.true;
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
describe('text content', function () {
|
|
45
|
+
it('should render text content in default slot', async function () {
|
|
46
|
+
const element = await createFixture(html `<pf-helper-text>Helper text content</pf-helper-text>`);
|
|
47
|
+
expect(element.textContent?.trim()).to.equal('Helper text content');
|
|
48
|
+
});
|
|
49
|
+
it('should have aria-live on text container', async function () {
|
|
50
|
+
const element = await createFixture(html `<pf-helper-text>Text</pf-helper-text>`);
|
|
51
|
+
await element.updateComplete;
|
|
52
|
+
const textContainer = element.shadowRoot?.querySelector('#text');
|
|
53
|
+
expect(textContainer?.getAttribute('aria-live')).to.equal('polite');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=pf-helper-text.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pf-helper-text.spec.js","sourceRoot":"","sources":["pf-helper-text.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAE,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AAG,MAAM,aAAa,CAAe,IAAI,CAAA,uCAAuC,CAAC,CAAC;YAC/F,MAAM,OAAO,CAAC,cAAc,CAAC;YAC7B,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;YACjE,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { expect, html } from '@open-wc/testing';\nimport { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';\nimport { PfHelperText } from '@patternfly/elements/pf-helper-text/pf-helper-text.js';\n\ndescribe('<pf-helper-text>', function() {\n describe('simply instantiating', function() {\n let element: PfHelperText;\n it('imperatively instantiates', function() {\n expect(document.createElement('pf-helper-text')).to.be.an.instanceof(PfHelperText);\n });\n\n it('should upgrade', async function() {\n element = await createFixture<PfHelperText>(html`<pf-helper-text></pf-helper-text>`);\n const klass = customElements.get('pf-helper-text');\n expect(element)\n .to.be.an.instanceOf(klass)\n .and\n .to.be.an.instanceOf(PfHelperText);\n });\n });\n\n describe('variant property', function() {\n it('should default to \"default\" variant', async function() {\n const element = await createFixture<PfHelperText>(html`<pf-helper-text></pf-helper-text>`);\n expect(element.variant).to.equal('default');\n });\n\n it('should reflect variant attribute', async function() {\n const element = await createFixture<PfHelperText>(html`<pf-helper-text variant=\"success\"></pf-helper-text>`);\n expect(element.variant).to.equal('success');\n expect(element.getAttribute('variant')).to.equal('success');\n });\n });\n\n describe('icon display', function() {\n it('should show icon when icon property is set', async function() {\n const element = await createFixture<PfHelperText>(html`<pf-helper-text icon=\"check-circle\">Success</pf-helper-text>`);\n await element.updateComplete;\n const iconContainer = element.shadowRoot?.querySelector('#icon');\n expect(iconContainer?.hasAttribute('hidden')).to.be.false;\n });\n\n it('should hide icon when no icon or slotted icon is present', async function() {\n const element = await createFixture<PfHelperText>(html`<pf-helper-text variant=\"default\">Text</pf-helper-text>`);\n await element.updateComplete;\n const iconContainer = element.shadowRoot?.querySelector('#icon');\n expect(iconContainer?.hasAttribute('hidden')).to.be.true;\n });\n });\n\n describe('text content', function() {\n it('should render text content in default slot', async function() {\n const element = await createFixture<PfHelperText>(html`<pf-helper-text>Helper text content</pf-helper-text>`);\n expect(element.textContent?.trim()).to.equal('Helper text content');\n });\n\n it('should have aria-live on text container', async function() {\n const element = await createFixture<PfHelperText>(html`<pf-helper-text>Text</pf-helper-text>`);\n await element.updateComplete;\n const textContainer = element.shadowRoot?.querySelector('#text');\n expect(textContainer?.getAttribute('aria-live')).to.equal('polite');\n });\n });\n});\n"]}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
|
|
4
|
+
/* Container */
|
|
5
|
+
--pf-c-hint--GridRowGap: var(--pf-global--spacer--md, 1rem);
|
|
6
|
+
--pf-c-hint--PaddingTop: var(--pf-global--spacer--lg, 1.5rem);
|
|
7
|
+
--pf-c-hint--PaddingRight: var(--pf-global--spacer--lg, 1.5rem);
|
|
8
|
+
--pf-c-hint--PaddingBottom: var(--pf-global--spacer--lg, 1.5rem);
|
|
9
|
+
--pf-c-hint--PaddingLeft: var(--pf-global--spacer--lg, 1.5rem);
|
|
10
|
+
--pf-c-hint--BackgroundColor: var(--pf-global--palette--blue-50, #e7f1fa);
|
|
11
|
+
--pf-c-hint--BorderColor: var(--pf-global--palette--blue-100, #bee1f4);
|
|
12
|
+
--pf-c-hint--BorderWidth: 1px;
|
|
13
|
+
--pf-c-hint--BorderRadius: var(--pf-global--BorderRadius--sm, 3px);
|
|
14
|
+
--pf-c-hint--BoxShadow: var(--pf-global--BoxShadow--sm, 0 0.0625rem 0.125rem 0 rgba(3, 3, 3, 0.12), 0 0 0.125rem 0 rgba(3, 3, 3, 0.06));
|
|
15
|
+
|
|
16
|
+
/* Title */
|
|
17
|
+
--pf-c-hint__title--FontSize: 1.125rem;
|
|
18
|
+
--pf-c-hint__title--FontWeight: var(--pf-global--FontWeight--semi-bold, 700);
|
|
19
|
+
--pf-c-hint__title--Color: var(--pf-global--Color--100, #151515);
|
|
20
|
+
--pf-c-hint__title--LineHeight: var(--pf-global--LineHeight--md, 1.5);
|
|
21
|
+
|
|
22
|
+
/* Body */
|
|
23
|
+
--pf-c-hint__body--FontSize: 1rem;
|
|
24
|
+
--pf-c-hint__body--Color: var(--pf-global--Color--100, #151515);
|
|
25
|
+
--pf-c-hint__body--LineHeight: var(--pf-global--LineHeight--md, 1.5);
|
|
26
|
+
|
|
27
|
+
/* Footer */
|
|
28
|
+
--pf-c-hint__footer--MarginTop: 0;
|
|
29
|
+
--pf-c-hint__footer--child--MarginRight: 1rem;
|
|
30
|
+
|
|
31
|
+
/* Actions */
|
|
32
|
+
--pf-c-hint__actions--Top: var(--pf-global--spacer--lg, 1.5rem);
|
|
33
|
+
--pf-c-hint__actions--Right: var(--pf-global--spacer--lg, 1.5rem);
|
|
34
|
+
--pf-c-hint__actions--MarginLeft: 3rem;
|
|
35
|
+
--pf-c-hint__actions--c-dropdown--MarginTop: calc(0.375rem * -1);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
#container {
|
|
39
|
+
position: relative;
|
|
40
|
+
display: grid;
|
|
41
|
+
grid-template-columns: 1fr auto;
|
|
42
|
+
gap: var(--pf-c-hint--GridRowGap);
|
|
43
|
+
padding:
|
|
44
|
+
var(--pf-c-hint--PaddingTop)
|
|
45
|
+
var(--pf-c-hint--PaddingRight)
|
|
46
|
+
var(--pf-c-hint--PaddingBottom)
|
|
47
|
+
var(--pf-c-hint--PaddingLeft);
|
|
48
|
+
background-color: var(--pf-c-hint--BackgroundColor);
|
|
49
|
+
border: var(--pf-c-hint--BorderWidth) solid var(--pf-c-hint--BorderColor);
|
|
50
|
+
border-radius: var(--pf-c-hint--BorderRadius);
|
|
51
|
+
box-shadow: var(--pf-c-hint--BoxShadow);
|
|
52
|
+
overflow: visible;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
#container > * {
|
|
56
|
+
grid-column: 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
#actions {
|
|
60
|
+
grid-column: 2;
|
|
61
|
+
grid-row: 1 / -1;
|
|
62
|
+
align-self: start;
|
|
63
|
+
position: relative;
|
|
64
|
+
z-index: 1000;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
#actions ::slotted(pf-dropdown) {
|
|
68
|
+
margin-top: var(--pf-c-hint__actions--c-dropdown--MarginTop);
|
|
69
|
+
--pf-c-dropdown__menu--MinWidth: auto;
|
|
70
|
+
--pf-c-dropdown__menu--Left: auto;
|
|
71
|
+
--pf-c-dropdown__menu--Right: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
#title {
|
|
75
|
+
font-size: var(--pf-c-hint__title--FontSize);
|
|
76
|
+
font-weight: var(--pf-c-hint__title--FontWeight);
|
|
77
|
+
color: var(--pf-c-hint__title--Color);
|
|
78
|
+
line-height: var(--pf-c-hint__title--LineHeight);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
#body {
|
|
82
|
+
font-size: var(--pf-c-hint__body--FontSize);
|
|
83
|
+
color: var(--pf-c-hint__body--Color);
|
|
84
|
+
line-height: var(--pf-c-hint__body--LineHeight);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
#footer {
|
|
88
|
+
margin-top: var(--pf-c-hint__footer--MarginTop);
|
|
89
|
+
font-size: var(--pf-c-hint__body--FontSize);
|
|
90
|
+
line-height: var(--pf-c-hint__body--LineHeight);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
#footer ::slotted(*) {
|
|
94
|
+
margin-right: var(--pf-c-hint__footer--child--MarginRight);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
#footer ::slotted(*:last-child) {
|
|
98
|
+
margin-right: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Hidden elements */
|
|
102
|
+
[hidden] {
|
|
103
|
+
display: none !important;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* Link styling within hint */
|
|
107
|
+
::slotted(a) {
|
|
108
|
+
color: var(--pf-global--link--Color, #06c);
|
|
109
|
+
text-decoration: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
::slotted(a:hover) {
|
|
113
|
+
color: var(--pf-global--link--Color--hover, #004080);
|
|
114
|
+
text-decoration: underline;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Button styling in footer */
|
|
118
|
+
::slotted(pf-button) {
|
|
119
|
+
--pf-c-button--m-link--Color: var(--pf-global--link--Color, #06c);
|
|
120
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* A **hint** is in-app messaging that provides a one-step reminder, explanation,
|
|
4
|
+
* or call to action for a page or modal. Hints provide information about an interaction
|
|
5
|
+
* or prerequisite step that might not be immediately obvious to the user.
|
|
6
|
+
*
|
|
7
|
+
* @summary Provides inline contextual help or information to users
|
|
8
|
+
* @alias Hint
|
|
9
|
+
*/
|
|
10
|
+
export declare class PfHint extends LitElement {
|
|
11
|
+
#private;
|
|
12
|
+
static readonly styles: CSSStyleSheet[];
|
|
13
|
+
render(): TemplateResult<1>;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'pf-hint': PfHint;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
var _PfHint_slots;
|
|
2
|
+
import { __classPrivateFieldGet, __decorate } from "tslib";
|
|
3
|
+
import { LitElement, html } from 'lit';
|
|
4
|
+
import { customElement } from 'lit/decorators/custom-element.js';
|
|
5
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
6
|
+
import { SlotController } from '@patternfly/pfe-core/controllers/slot-controller.js';
|
|
7
|
+
import { css } from "lit";
|
|
8
|
+
const styles = css `:host {
|
|
9
|
+
display: block;
|
|
10
|
+
|
|
11
|
+
/* Container */
|
|
12
|
+
--pf-c-hint--GridRowGap: var(--pf-global--spacer--md, 1rem);
|
|
13
|
+
--pf-c-hint--PaddingTop: var(--pf-global--spacer--lg, 1.5rem);
|
|
14
|
+
--pf-c-hint--PaddingRight: var(--pf-global--spacer--lg, 1.5rem);
|
|
15
|
+
--pf-c-hint--PaddingBottom: var(--pf-global--spacer--lg, 1.5rem);
|
|
16
|
+
--pf-c-hint--PaddingLeft: var(--pf-global--spacer--lg, 1.5rem);
|
|
17
|
+
--pf-c-hint--BackgroundColor: var(--pf-global--palette--blue-50, #e7f1fa);
|
|
18
|
+
--pf-c-hint--BorderColor: var(--pf-global--palette--blue-100, #bee1f4);
|
|
19
|
+
--pf-c-hint--BorderWidth: 1px;
|
|
20
|
+
--pf-c-hint--BorderRadius: var(--pf-global--BorderRadius--sm, 3px);
|
|
21
|
+
--pf-c-hint--BoxShadow: var(--pf-global--BoxShadow--sm, 0 0.0625rem 0.125rem 0 rgba(3, 3, 3, 0.12), 0 0 0.125rem 0 rgba(3, 3, 3, 0.06));
|
|
22
|
+
|
|
23
|
+
/* Title */
|
|
24
|
+
--pf-c-hint__title--FontSize: 1.125rem;
|
|
25
|
+
--pf-c-hint__title--FontWeight: var(--pf-global--FontWeight--semi-bold, 700);
|
|
26
|
+
--pf-c-hint__title--Color: var(--pf-global--Color--100, #151515);
|
|
27
|
+
--pf-c-hint__title--LineHeight: var(--pf-global--LineHeight--md, 1.5);
|
|
28
|
+
|
|
29
|
+
/* Body */
|
|
30
|
+
--pf-c-hint__body--FontSize: 1rem;
|
|
31
|
+
--pf-c-hint__body--Color: var(--pf-global--Color--100, #151515);
|
|
32
|
+
--pf-c-hint__body--LineHeight: var(--pf-global--LineHeight--md, 1.5);
|
|
33
|
+
|
|
34
|
+
/* Footer */
|
|
35
|
+
--pf-c-hint__footer--MarginTop: 0;
|
|
36
|
+
--pf-c-hint__footer--child--MarginRight: 1rem;
|
|
37
|
+
|
|
38
|
+
/* Actions */
|
|
39
|
+
--pf-c-hint__actions--Top: var(--pf-global--spacer--lg, 1.5rem);
|
|
40
|
+
--pf-c-hint__actions--Right: var(--pf-global--spacer--lg, 1.5rem);
|
|
41
|
+
--pf-c-hint__actions--MarginLeft: 3rem;
|
|
42
|
+
--pf-c-hint__actions--c-dropdown--MarginTop: calc(0.375rem * -1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
#container {
|
|
46
|
+
position: relative;
|
|
47
|
+
display: grid;
|
|
48
|
+
grid-template-columns: 1fr auto;
|
|
49
|
+
gap: var(--pf-c-hint--GridRowGap);
|
|
50
|
+
padding:
|
|
51
|
+
var(--pf-c-hint--PaddingTop)
|
|
52
|
+
var(--pf-c-hint--PaddingRight)
|
|
53
|
+
var(--pf-c-hint--PaddingBottom)
|
|
54
|
+
var(--pf-c-hint--PaddingLeft);
|
|
55
|
+
background-color: var(--pf-c-hint--BackgroundColor);
|
|
56
|
+
border: var(--pf-c-hint--BorderWidth) solid var(--pf-c-hint--BorderColor);
|
|
57
|
+
border-radius: var(--pf-c-hint--BorderRadius);
|
|
58
|
+
box-shadow: var(--pf-c-hint--BoxShadow);
|
|
59
|
+
overflow: visible;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
#container > * {
|
|
63
|
+
grid-column: 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
#actions {
|
|
67
|
+
grid-column: 2;
|
|
68
|
+
grid-row: 1 / -1;
|
|
69
|
+
align-self: start;
|
|
70
|
+
position: relative;
|
|
71
|
+
z-index: 1000;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
#actions ::slotted(pf-dropdown) {
|
|
75
|
+
margin-top: var(--pf-c-hint__actions--c-dropdown--MarginTop);
|
|
76
|
+
--pf-c-dropdown__menu--MinWidth: auto;
|
|
77
|
+
--pf-c-dropdown__menu--Left: auto;
|
|
78
|
+
--pf-c-dropdown__menu--Right: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
#title {
|
|
82
|
+
font-size: var(--pf-c-hint__title--FontSize);
|
|
83
|
+
font-weight: var(--pf-c-hint__title--FontWeight);
|
|
84
|
+
color: var(--pf-c-hint__title--Color);
|
|
85
|
+
line-height: var(--pf-c-hint__title--LineHeight);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
#body {
|
|
89
|
+
font-size: var(--pf-c-hint__body--FontSize);
|
|
90
|
+
color: var(--pf-c-hint__body--Color);
|
|
91
|
+
line-height: var(--pf-c-hint__body--LineHeight);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
#footer {
|
|
95
|
+
margin-top: var(--pf-c-hint__footer--MarginTop);
|
|
96
|
+
font-size: var(--pf-c-hint__body--FontSize);
|
|
97
|
+
line-height: var(--pf-c-hint__body--LineHeight);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
#footer ::slotted(*) {
|
|
101
|
+
margin-right: var(--pf-c-hint__footer--child--MarginRight);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
#footer ::slotted(*:last-child) {
|
|
105
|
+
margin-right: 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Hidden elements */
|
|
109
|
+
[hidden] {
|
|
110
|
+
display: none !important;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* Link styling within hint */
|
|
114
|
+
::slotted(a) {
|
|
115
|
+
color: var(--pf-global--link--Color, #06c);
|
|
116
|
+
text-decoration: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
::slotted(a:hover) {
|
|
120
|
+
color: var(--pf-global--link--Color--hover, #004080);
|
|
121
|
+
text-decoration: underline;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* Button styling in footer */
|
|
125
|
+
::slotted(pf-button) {
|
|
126
|
+
--pf-c-button--m-link--Color: var(--pf-global--link--Color, #06c);
|
|
127
|
+
}
|
|
128
|
+
`;
|
|
129
|
+
let PfHint = class PfHint extends LitElement {
|
|
130
|
+
constructor() {
|
|
131
|
+
super(...arguments);
|
|
132
|
+
_PfHint_slots.set(this, new SlotController(this, 'title', null, 'footer', 'actions'));
|
|
133
|
+
}
|
|
134
|
+
render() {
|
|
135
|
+
const hasActions = !__classPrivateFieldGet(this, _PfHint_slots, "f").isEmpty('actions');
|
|
136
|
+
return html `
|
|
137
|
+
<div id="container"
|
|
138
|
+
part="container"
|
|
139
|
+
class=${classMap({
|
|
140
|
+
'has-actions': hasActions,
|
|
141
|
+
})}>
|
|
142
|
+
<div id="actions"
|
|
143
|
+
part="actions"
|
|
144
|
+
class="pf-c-hint__actions"
|
|
145
|
+
?hidden=${__classPrivateFieldGet(this, _PfHint_slots, "f").isEmpty('actions')}>
|
|
146
|
+
<!-- summary: Actions menu (e.g., kebab dropdown) -->
|
|
147
|
+
<slot name="actions"></slot>
|
|
148
|
+
</div>
|
|
149
|
+
<div id="title"
|
|
150
|
+
part="title"
|
|
151
|
+
class="pf-c-hint__title"
|
|
152
|
+
?hidden=${__classPrivateFieldGet(this, _PfHint_slots, "f").isEmpty('title')}>
|
|
153
|
+
<!-- summary: Optional title for the hint -->
|
|
154
|
+
<slot name="title"></slot>
|
|
155
|
+
</div>
|
|
156
|
+
<div id="body"
|
|
157
|
+
part="body"
|
|
158
|
+
class="pf-c-hint__body">
|
|
159
|
+
<!-- summary: Body content of the hint. Main informational text. -->
|
|
160
|
+
<slot></slot>
|
|
161
|
+
</div>
|
|
162
|
+
<div id="footer"
|
|
163
|
+
part="footer"
|
|
164
|
+
class="pf-c-hint__footer"
|
|
165
|
+
?hidden=${__classPrivateFieldGet(this, _PfHint_slots, "f").isEmpty('footer')}>
|
|
166
|
+
<!-- summary: Optional footer content, typically containing action links or buttons -->
|
|
167
|
+
<slot name="footer"></slot>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
`;
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
_PfHint_slots = new WeakMap();
|
|
174
|
+
PfHint.styles = [styles];
|
|
175
|
+
PfHint.version = "4.3.0";
|
|
176
|
+
PfHint = __decorate([
|
|
177
|
+
customElement('pf-hint')
|
|
178
|
+
], PfHint);
|
|
179
|
+
export { PfHint };
|
|
180
|
+
//# sourceMappingURL=pf-hint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pf-hint.js","sourceRoot":"","sources":["pf-hint.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAa9E,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,UAAU;IAA/B;;QAGL,wBAAS,IAAI,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAC;;IAEtE,MAAM;QACJ,MAAM,UAAU,GAAG,CAAC,uBAAA,IAAI,qBAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAEnD,OAAO,IAAI,CAAA;;;mBAGI,QAAQ,CAAC;YACf,aAAa,EAAE,UAAU;SAC1B,CAAC;;;;uBAIU,uBAAA,IAAI,qBAAO,CAAC,OAAO,CAAC,SAAS,CAAC;;;;;;;uBAO9B,uBAAA,IAAI,qBAAO,CAAC,OAAO,CAAC,OAAO,CAAC;;;;;;;;;;;;;uBAa5B,uBAAA,IAAI,qBAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;;;;;KAK/C,CAAC;IACJ,CAAC;;;AA1Ce,aAAM,GAAoB,CAAC,MAAM,CAAC,AAA5B,CAA6B;;AADxC,MAAM;IADlB,aAAa,CAAC,SAAS,CAAC;GACZ,MAAM","sourcesContent":["import { LitElement, html, type TemplateResult } from 'lit';\nimport { customElement } from 'lit/decorators/custom-element.js';\nimport { classMap } from 'lit/directives/class-map.js';\n\nimport { SlotController } from '@patternfly/pfe-core/controllers/slot-controller.js';\n\nimport styles from './pf-hint.css';\n\n/**\n * A **hint** is in-app messaging that provides a one-step reminder, explanation,\n * or call to action for a page or modal. Hints provide information about an interaction\n * or prerequisite step that might not be immediately obvious to the user.\n *\n * @summary Provides inline contextual help or information to users\n * @alias Hint\n */\n@customElement('pf-hint')\nexport class PfHint extends LitElement {\n static readonly styles: CSSStyleSheet[] = [styles];\n\n #slots = new SlotController(this, 'title', null, 'footer', 'actions');\n\n render(): TemplateResult<1> {\n const hasActions = !this.#slots.isEmpty('actions');\n\n return html`\n <div id=\"container\"\n part=\"container\"\n class=${classMap({\n 'has-actions': hasActions,\n })}>\n <div id=\"actions\"\n part=\"actions\"\n class=\"pf-c-hint__actions\"\n ?hidden=${this.#slots.isEmpty('actions')}>\n <!-- summary: Actions menu (e.g., kebab dropdown) -->\n <slot name=\"actions\"></slot>\n </div>\n <div id=\"title\"\n part=\"title\"\n class=\"pf-c-hint__title\"\n ?hidden=${this.#slots.isEmpty('title')}>\n <!-- summary: Optional title for the hint -->\n <slot name=\"title\"></slot>\n </div>\n <div id=\"body\"\n part=\"body\"\n class=\"pf-c-hint__body\">\n <!-- summary: Body content of the hint. Main informational text. -->\n <slot></slot>\n </div>\n <div id=\"footer\"\n part=\"footer\"\n class=\"pf-c-hint__footer\"\n ?hidden=${this.#slots.isEmpty('footer')}>\n <!-- summary: Optional footer content, typically containing action links or buttons -->\n <slot name=\"footer\"></slot>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'pf-hint': PfHint;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
const tagName = 'pf-hint';
|
|
5
|
+
test.describe(tagName, () => {
|
|
6
|
+
test('snapshot', async ({ page }) => {
|
|
7
|
+
const componentPage = new PfeDemoPage(page, tagName);
|
|
8
|
+
await componentPage.navigate();
|
|
9
|
+
await componentPage.snapshot();
|
|
10
|
+
});
|
|
11
|
+
test('ssr', async ({ browser }) => {
|
|
12
|
+
const fixture = new SSRPage({
|
|
13
|
+
tagName,
|
|
14
|
+
browser,
|
|
15
|
+
demoDir: new URL('../demo/', import.meta.url),
|
|
16
|
+
importSpecifiers: [
|
|
17
|
+
`@patternfly/elements/${tagName}/${tagName}.js`,
|
|
18
|
+
],
|
|
19
|
+
});
|
|
20
|
+
await fixture.snapshots();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=pf-hint.e2e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pf-hint.e2e.js","sourceRoot":"","sources":["pf-hint.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAE3E,MAAM,OAAO,GAAG,SAAS,CAAC;AAE1B,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IAC1B,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QAClC,MAAM,aAAa,GAAG,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACrD,MAAM,aAAa,CAAC,QAAQ,EAAE,CAAC;QAC/B,MAAM,aAAa,CAAC,QAAQ,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC;YAC1B,OAAO;YACP,OAAO;YACP,OAAO,EAAE,IAAI,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;YAC7C,gBAAgB,EAAE;gBAChB,wBAAwB,OAAO,IAAI,OAAO,KAAK;aAChD;SACF,CAAC,CAAC;QACH,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { test } from '@playwright/test';\nimport { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';\nimport { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';\n\nconst tagName = 'pf-hint';\n\ntest.describe(tagName, () => {\n test('snapshot', async ({ page }) => {\n const componentPage = new PfeDemoPage(page, tagName);\n await componentPage.navigate();\n await componentPage.snapshot();\n });\n\n test('ssr', async ({ browser }) => {\n const fixture = new SSRPage({\n tagName,\n browser,\n demoDir: new URL('../demo/', import.meta.url),\n importSpecifiers: [\n `@patternfly/elements/${tagName}/${tagName}.js`,\n ],\n });\n await fixture.snapshots();\n });\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { expect, html } from '@open-wc/testing';
|
|
2
|
+
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
|
|
3
|
+
import { PfHint } from '@patternfly/elements/pf-hint/pf-hint.js';
|
|
4
|
+
import { a11ySnapshot } from '@patternfly/pfe-tools/test/a11y-snapshot.js';
|
|
5
|
+
describe('<pf-hint>', function () {
|
|
6
|
+
describe('simply instantiating', function () {
|
|
7
|
+
it('imperatively instantiates', function () {
|
|
8
|
+
expect(document.createElement('pf-hint')).to.be.an.instanceof(PfHint);
|
|
9
|
+
});
|
|
10
|
+
it('should upgrade', async function () {
|
|
11
|
+
const el = await createFixture(html `
|
|
12
|
+
<pf-hint>Basic hint</pf-hint>
|
|
13
|
+
`);
|
|
14
|
+
const klass = customElements.get('pf-hint');
|
|
15
|
+
expect(el)
|
|
16
|
+
.to.be.an.instanceOf(klass)
|
|
17
|
+
.and
|
|
18
|
+
.to.be.an.instanceOf(PfHint);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe('basic hint', function () {
|
|
22
|
+
let element;
|
|
23
|
+
beforeEach(async function () {
|
|
24
|
+
element = await createFixture(html `
|
|
25
|
+
<pf-hint>Welcome to the new documentation experience.</pf-hint>
|
|
26
|
+
`);
|
|
27
|
+
});
|
|
28
|
+
it('should render body content, and not title footer, or actions', async function () {
|
|
29
|
+
const snap = await a11ySnapshot();
|
|
30
|
+
expect(snap.children?.length).to.equal(1);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
describe('hint with title', function () {
|
|
34
|
+
let element;
|
|
35
|
+
beforeEach(async function () {
|
|
36
|
+
element = await createFixture(html `
|
|
37
|
+
<pf-hint>
|
|
38
|
+
<span slot="title">Do more with Find it Fix it capabilities</span>
|
|
39
|
+
Upgrade to Red Hat Smart Management.
|
|
40
|
+
</pf-hint>
|
|
41
|
+
`);
|
|
42
|
+
await element.updateComplete;
|
|
43
|
+
});
|
|
44
|
+
it('should render title and body content', async function () {
|
|
45
|
+
const snap = await a11ySnapshot();
|
|
46
|
+
expect(snap.children?.length).to.equal(2);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
describe('hint with footer', function () {
|
|
50
|
+
let element;
|
|
51
|
+
beforeEach(async function () {
|
|
52
|
+
element = await createFixture(html `
|
|
53
|
+
<pf-hint>
|
|
54
|
+
<span slot="title">Do more with Find it Fix it capabilities</span>
|
|
55
|
+
Upgrade to Red Hat Smart Management.
|
|
56
|
+
<a slot="footer" href="#">Try it for 90 days</a>
|
|
57
|
+
</pf-hint>
|
|
58
|
+
`);
|
|
59
|
+
await element.updateComplete;
|
|
60
|
+
});
|
|
61
|
+
it('should render footer', function () {
|
|
62
|
+
const footer = element.shadowRoot.querySelector('#footer');
|
|
63
|
+
expect(footer).to.exist;
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
describe('hint with actions', function () {
|
|
67
|
+
let element;
|
|
68
|
+
beforeEach(async function () {
|
|
69
|
+
element = await createFixture(html `
|
|
70
|
+
<pf-hint>
|
|
71
|
+
<button slot="actions" aria-label="Actions">⋮</button>
|
|
72
|
+
<span slot="title">Do more with Find it Fix it capabilities</span>
|
|
73
|
+
Upgrade to Red Hat Smart Management.
|
|
74
|
+
</pf-hint>
|
|
75
|
+
`);
|
|
76
|
+
await element.updateComplete;
|
|
77
|
+
});
|
|
78
|
+
it('should render title, body, and actions', async function () {
|
|
79
|
+
const { children: [actions, title, body, ...rest] = [] } = await a11ySnapshot();
|
|
80
|
+
expect(actions.role).to.equal('button');
|
|
81
|
+
expect(title.role).to.equal('text');
|
|
82
|
+
expect(body.role).to.equal('text');
|
|
83
|
+
expect(rest.length).to.equal(0);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=pf-hint.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pf-hint.spec.js","sourceRoot":"","sources":["pf-hint.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAE3E,QAAQ,CAAC,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,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACpC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACnC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { expect, html } from '@open-wc/testing';\nimport { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';\nimport { PfHint } from '@patternfly/elements/pf-hint/pf-hint.js';\nimport { a11ySnapshot } from '@patternfly/pfe-tools/test/a11y-snapshot.js';\n\ndescribe('<pf-hint>', function() {\n describe('simply instantiating', function() {\n it('imperatively instantiates', function() {\n expect(document.createElement('pf-hint')).to.be.an.instanceof(PfHint);\n });\n\n it('should upgrade', async function() {\n const el = await createFixture<PfHint>(html`\n <pf-hint>Basic hint</pf-hint>\n `);\n const klass = customElements.get('pf-hint');\n expect(el)\n .to.be.an.instanceOf(klass)\n .and\n .to.be.an.instanceOf(PfHint);\n });\n });\n\n describe('basic hint', function() {\n let element: PfHint;\n beforeEach(async function() {\n element = await createFixture<PfHint>(html`\n <pf-hint>Welcome to the new documentation experience.</pf-hint>\n `);\n });\n\n it('should render body content, and not title footer, or actions', async function() {\n const snap = await a11ySnapshot();\n expect(snap.children?.length).to.equal(1);\n });\n });\n\n describe('hint with title', function() {\n let element: PfHint;\n beforeEach(async function() {\n element = await createFixture<PfHint>(html`\n <pf-hint>\n <span slot=\"title\">Do more with Find it Fix it capabilities</span>\n Upgrade to Red Hat Smart Management.\n </pf-hint>\n `);\n await element.updateComplete;\n });\n\n it('should render title and body content', async function() {\n const snap = await a11ySnapshot();\n expect(snap.children?.length).to.equal(2);\n });\n });\n\n describe('hint with footer', function() {\n let element: PfHint;\n beforeEach(async function() {\n element = await createFixture<PfHint>(html`\n <pf-hint>\n <span slot=\"title\">Do more with Find it Fix it capabilities</span>\n Upgrade to Red Hat Smart Management.\n <a slot=\"footer\" href=\"#\">Try it for 90 days</a>\n </pf-hint>\n `);\n await element.updateComplete;\n });\n\n it('should render footer', function() {\n const footer = element.shadowRoot!.querySelector('#footer');\n expect(footer).to.exist;\n });\n });\n\n describe('hint with actions', function() {\n let element: PfHint;\n beforeEach(async function() {\n element = await createFixture<PfHint>(html`\n <pf-hint>\n <button slot=\"actions\" aria-label=\"Actions\">⋮</button>\n <span slot=\"title\">Do more with Find it Fix it capabilities</span>\n Upgrade to Red Hat Smart Management.\n </pf-hint>\n `);\n await element.updateComplete;\n });\n\n it('should render title, body, and actions', async function() {\n const { children: [actions, title, body, ...rest] = [] } = await a11ySnapshot();\n expect(actions.role).to.equal('button');\n expect(title.role).to.equal('text');\n expect(body.role).to.equal('text');\n expect(rest.length).to.equal(0);\n });\n });\n});\n"]}
|
package/pf-icon/pf-icon.js
CHANGED
|
@@ -118,7 +118,7 @@ PfJumpLinksItem.shadowRootOptions = {
|
|
|
118
118
|
...LitElement.shadowRootOptions,
|
|
119
119
|
delegatesFocus: true,
|
|
120
120
|
};
|
|
121
|
-
PfJumpLinksItem.version = "4.
|
|
121
|
+
PfJumpLinksItem.version = "4.3.0";
|
|
122
122
|
__decorate([
|
|
123
123
|
property({ type: Boolean, reflect: true })
|
|
124
124
|
], PfJumpLinksItem.prototype, "active", void 0);
|
|
@@ -29,7 +29,7 @@ let PfJumpLinksList = class PfJumpLinksList extends LitElement {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
PfJumpLinksList.styles = [style];
|
|
32
|
-
PfJumpLinksList.version = "4.
|
|
32
|
+
PfJumpLinksList.version = "4.3.0";
|
|
33
33
|
PfJumpLinksList = __decorate([
|
|
34
34
|
customElement('pf-jump-links-list')
|
|
35
35
|
], PfJumpLinksList);
|
|
@@ -283,7 +283,7 @@ _PfJumpLinks_onToggle = function _PfJumpLinks_onToggle(event) {
|
|
|
283
283
|
this.dispatchEvent(new Event('toggle'));
|
|
284
284
|
};
|
|
285
285
|
PfJumpLinks.styles = [style];
|
|
286
|
-
PfJumpLinks.version = "4.
|
|
286
|
+
PfJumpLinks.version = "4.3.0";
|
|
287
287
|
__decorate([
|
|
288
288
|
property({ reflect: true, type: Boolean })
|
|
289
289
|
], PfJumpLinks.prototype, "expandable", void 0);
|
package/pf-label/pf-label.js
CHANGED
package/pf-modal/pf-modal.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare class ModalOpenEvent extends ComposedEvent {
|
|
|
21
21
|
* @fires {ModalOpenEvent} open - Fires when a user clicks on the trigger or manually opens a modal.
|
|
22
22
|
* @fires {ModalCloseEvent} close - Fires when either a user clicks on either the close button or the overlay or manually closes a modal.
|
|
23
23
|
*/
|
|
24
|
-
export declare class PfModal extends LitElement
|
|
24
|
+
export declare class PfModal extends LitElement {
|
|
25
25
|
#private;
|
|
26
26
|
static readonly shadowRootOptions: ShadowRootInit;
|
|
27
27
|
static readonly styles: CSSStyleSheet[];
|
package/pf-modal/pf-modal.js
CHANGED
|
@@ -455,7 +455,7 @@ PfModal.shadowRootOptions = {
|
|
|
455
455
|
PfModal.styles = [style];
|
|
456
456
|
/** Should the dialog close when user clicks outside the dialog? */
|
|
457
457
|
PfModal.closeOnOutsideClick = false;
|
|
458
|
-
PfModal.version = "4.
|
|
458
|
+
PfModal.version = "4.3.0";
|
|
459
459
|
__decorate([
|
|
460
460
|
property({ reflect: true })
|
|
461
461
|
], PfModal.prototype, "variant", void 0);
|