Skip to content

Commit 38fcdd9

Browse files
authored
Merge branch 'main' into docs/jump-links/fix-demo
2 parents 70682e8 + bdb2b39 commit 38fcdd9

36 files changed

+1757
-1051
lines changed

.changeset/cold-bottles-roll.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@patternfly/eslint-config-elements": patch
3+
"@patternfly/pfe-tools": patch
4+
---
5+
6+
Update dependencies

.changeset/empty-ties-heal.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-text-area>`: auto-resize attribute now works as expected

.changeset/great-badgers-build.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
"@patternfly/pfe-core": major
3+
---
4+
`@cascades`: deprecated `@cascades` decorator and `CascadeController`. Use context instead.
5+
6+
**BEFORE**: The element in charge of the context cascades data down to
7+
specifically named children.
8+
9+
```ts
10+
import { LitElement } from 'lit';
11+
import { property } from 'lit/decorators/property.js';
12+
import { cascades } from '@patternfly/pfe-core/decorators/cascades.js';
13+
14+
class MyMood extends LitElement {
15+
@cascades('my-eyes', 'my-mouth')
16+
@property() mood: 'happy'|'sad'|'mad'|'glad';
17+
}
18+
```
19+
20+
**AFTER**: children subscribe to updates from the context provider.
21+
22+
```ts
23+
import { LitElement } from 'lit';
24+
import { property } from 'lit/decorators/property.js';
25+
import { provide } from '@lit/context';
26+
import { createContextWithRoot } from '@patternfly/pfe-core/functions/context.js';
27+
28+
export type Mood = 'happy'|'sad'|'mad'|'glad';
29+
30+
export const moodContext = createContextWithRoot<Mood>(Symbol('mood'));
31+
32+
class MyMood extends LitElement {
33+
@provide({ context: moodContext })
34+
@property() mood: Mood;
35+
}
36+
```
37+
38+
```ts
39+
import { LitElement } from 'lit';
40+
import { property } from 'lit/decorators/property.js';
41+
import { consume } from '@lit/context';
42+
import { moodContext, type Mood } from './my-mood.js';
43+
44+
class MyEyes extends LitElement {
45+
@consume({ context: moodContext, subscribe: true })
46+
@state() private mood: Mood;
47+
}
48+
```

.changeset/nice-moments-doubt.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-tabs>`: improved screen-reader accessibility

.changeset/upset-laws-camp.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+
`<pf-popover>`: prevent appearance of an unwanted scrollbar in some cases where
5+
popover is positioned at the far edge of the viewport

.changeset/violet-wombats-tell.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"@patternfly/elements": major
3+
---
4+
5+
`<pf-switch>`: Reimplemented label API improving accessibility.
6+
7+
```html
8+
<!-- BEFORE: -->
9+
<pf-switch id="checked" checked show-check-icon></pf-switch>
10+
<label for="checked" data-state="on">Message when on</label>
11+
<label for="checked" data-state="off">Message when off</label>
12+
<!-- AFTER: -->
13+
<pf-switch id="checked" checked show-check-icon></pf-switch>
14+
<label for="checked">
15+
<span data-state="on">Message when on</span>
16+
<span data-state="off" hidden>Message when off</span>
17+
</label>

.changeset/wet-moments-punch.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
"netlify-plugin-github-actions": major
3+
---
4+
Package is now `"type": "module"` aka ESM

.husky/commit-msg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npx --no -- commitlint --edit "$1"

.husky/pre-commit

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
#!/bin/sh
21
npx lint-staged

core/pfe-core/controllers/cascade-controller.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ import { bound } from '../decorators/bound.js';
44
import { debounce } from '../functions/debounce.js';
55
import { Logger } from './logger.js';
66

7+
/**
8+
* @deprecated: use context, especially via `@patternfly/pfe-core/functions/context.js`;
9+
*/
710
export interface Options<E extends ReactiveElement> {
811
properties: Partial<Record<keyof E, string | string[]>>;
912
prefix?: string;
1013
}
1114

15+
/**
16+
* @deprecated: use context, especially via `@patternfly/pfe-core/functions/context.js`;
17+
*/
1218
export class CascadeController<E extends ReactiveElement> implements ReactiveController {
1319
private class: typeof ReactiveElement;
1420

0 commit comments

Comments
 (0)