Skip to content

Commit cde174b

Browse files
committed
Merge branch 'main' into feat/tools/knobs
2 parents b414786 + 3e9d785 commit cde174b

File tree

17 files changed

+238
-79
lines changed

17 files changed

+238
-79
lines changed

.changeset/huge-mice-build.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
"@patternfly/pfe-tools": patch
3+
---
4+
**Dev Server**: load lightdom shim files

.changeset/legal-chairs-double.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
"@patternfly/pfe-tools": patch
3+
---
4+
**Dev Server**: reload on typescript file changes

.changeset/little-bags-post.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
"@patternfly/elements": patch
3+
---
4+
`<pf-select>`: prevent bug when select is in a deeply nested in shadow root

.changeset/purple-boxes-stare.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@patternfly/elements": patch
3+
---
4+
5+
`<pf-back-to-top>`: fix hover color

.changeset/shaky-cats-share.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
"@patternfly/create-element": patch
3+
---
4+
Element generator now generates demo files with inlined script and styles

elements/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@
138138
"Nikki Massaro Kauffman <[email protected]> (https://github.com/nikkimk)",
139139
"Steven Spriggs <[email protected]",
140140
"castastrophe (https://github.com/castastrophe)",
141-
"Wes Ruvalcaba"
141+
"Wes Ruvalcaba",
142+
"Rohit Bharmal (https://github.com/Rohit2601)",
143+
"Ajinyka Shinde <[email protected]>"
142144
],
143145
"dependencies": {
144146
"@lit/context": "^1.1.0",

elements/pf-back-to-top/pf-back-to-top.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ a {
2929
gap: var(--pf-c-button__icon--m-end--MarginLeft, var(--pf-global--spacer--xs, 0.25rem));
3030
}
3131

32+
a:hover {
33+
--pf-c-button--m-primary--Color: var(--pf-c-button--m-primary--hover--Color, var(--pf-global--Color--light-100, #fff));
34+
--pf-c-button--m-primary--BackgroundColor: var(--pf-c-button--m-primary--hover--BackgroundColor, var(--pf-global--primary-color--200, #004080));
35+
}
36+
37+
a:focus {
38+
--pf-c-button--m-primary--Color: var(--pf-c-button--m-primary--hover--Color, var(--pf-global--Color--light-100,#fff));
39+
--pf-c-button--m-primary--BackgroundColor: var(--pf-c-button--m-primary--hover--BackgroundColor, var(--pf-global--primary-color--200, #004080));
40+
}
41+
3242
[part="trigger"][hidden] {
3343
display: none;
3444
}

elements/pf-select/test/pf-select.spec.ts

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,82 @@ describe('<pf-select>', function() {
529529
});
530530
});
531531

532+
describe('in a deep shadow root', function() {
533+
let element: PfSelect;
534+
const focus = () => element.focus();
535+
const updateComplete = () => element.updateComplete;
536+
beforeEach(async function() {
537+
const fixture = await createFixture(html`
538+
<shadow-root>
539+
<template shadowrootmode="open">
540+
<shadow-root>
541+
<template shadowrootmode="open">
542+
<pf-select variant="single"
543+
accessible-label="Choose a number"
544+
placeholder="Choose a number">
545+
<pf-option value="1">1</pf-option>
546+
<pf-option value="2">2</pf-option>
547+
<pf-option value="3">3</pf-option>
548+
<pf-option value="4">4</pf-option>
549+
<pf-option value="5">5</pf-option>
550+
<pf-option value="6">6</pf-option>
551+
<pf-option value="7">7</pf-option>
552+
<pf-option value="8">8</pf-option>
553+
</pf-select>
554+
</template>
555+
</shadow-root>
556+
</template>
557+
</shadow-root>`);
558+
559+
function attachShadowRoots(root?: Document | ShadowRoot) {
560+
root?.querySelectorAll<HTMLTemplateElement>('template[shadowrootmode]').forEach(template => {
561+
const mode = template.getAttribute('shadowrootmode') as 'open' | 'closed';
562+
const shadowRoot = template.parentElement?.attachShadow?.({ mode });
563+
shadowRoot?.appendChild(template.content);
564+
template.remove();
565+
attachShadowRoots(shadowRoot);
566+
});
567+
}
568+
attachShadowRoots(document);
569+
570+
const select = fixture.shadowRoot?.firstElementChild?.shadowRoot?.querySelector('pf-select');
571+
if (select) {
572+
element = select;
573+
await element?.updateComplete;
574+
} else {
575+
throw new Error('no element!');
576+
}
577+
});
578+
describe('expanding', function() {
579+
beforeEach(focus);
580+
beforeEach(press('Enter'));
581+
describe('pressing ArrowDown', function() {
582+
beforeEach(press('ArrowDown'));
583+
beforeEach(updateComplete);
584+
it('remains expanded', function() {
585+
expect(element.expanded).to.be.true;
586+
});
587+
describe('pressing ArrowDown', function() {
588+
beforeEach(press('ArrowDown'));
589+
beforeEach(updateComplete);
590+
it('remains expanded', function() {
591+
expect(element.expanded).to.be.true;
592+
});
593+
describe('pressing Space', function() {
594+
beforeEach(press(' '));
595+
beforeEach(updateComplete);
596+
it('closes', function() {
597+
expect(element.expanded).to.be.false;
598+
});
599+
it('sets value', function() {
600+
expect(element.value).to.equal('2');
601+
});
602+
});
603+
});
604+
});
605+
});
606+
});
607+
532608
// try again when we implement activedescendant
533609
describe.skip('variant="typeahead"', function() {
534610
beforeEach(async function() {

elements/pf-text-area/docs/pf-text-area.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,43 @@
22
<pf-text-area></pf-text-area>
33
{% endrenderOverview %}
44

5-
{% band header="Usage" %}{% endband %}
5+
{% band header="Usage" %}
6+
### Basic
7+
{% htmlexample %}
8+
<label for="text">Text Area : </label>
9+
<pf-text-area id="text"></pf-text-area>
10+
{% endhtmlexample %}
11+
12+
### With Placeholder
13+
{% htmlexample %}
14+
<label for="text">Text Area : </label>
15+
<pf-text-area id="text" placeholder="placeholder"></pf-text-area>
16+
{% endhtmlexample %}
17+
18+
### Required
19+
{% htmlexample %}
20+
<label for="text">Text Area : </label>
21+
<pf-text-area id="text" placeholder="placeholder" required="true" ></pf-text-area>
22+
{% endhtmlexample %}
23+
24+
### Disabled state
25+
{% htmlexample %}
26+
<label for="text">Text Area : </label>
27+
<pf-text-area id="text" placeholder="placeholder" disabled="true" ></pf-text-area>
28+
{% endhtmlexample %}
29+
30+
### Resize Vertical
31+
{% htmlexample %}
32+
<label for="text">Text Area : </label>
33+
<pf-text-area id="text" placeholder="placeholder" resize='vertical'></pf-text-area>
34+
{% endhtmlexample %}
35+
36+
### Resize Horizontal
37+
{% htmlexample %}
38+
<label for="text">Text Area : </label>
39+
<pf-text-area id="text" placeholder="placeholder" resize='horizontal'></pf-text-area>
40+
{% endhtmlexample %}
41+
{% endband %}
642

743
{% renderSlots %}{% endrenderSlots %}
844

elements/pf-text-input/docs/pf-text-input.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
<pf-text-input></pf-text-input>
33
{% endrenderOverview %}
44

5-
{% band header="Usage" %}{% endband %}
5+
{% band header="Usage" %}
6+
### Basic
7+
{% htmlexample %}
8+
<label for="input-box">Input: </label>
9+
<pf-text-input id="input-box" type="text" placeholder="Placeholder"></pf-text-input>
10+
{% endhtmlexample %}
11+
{% endband %}
612

713
{% renderSlots %}{% endrenderSlots %}
814

0 commit comments

Comments
 (0)