Skip to content

Commit 3f270e4

Browse files
shleewhiteshleewhiteaklkv
authored andcommitted
Upgrade ember-a11y-refocus to v5.1.0 (#3234)
Co-authored-by: shleewhite <lee.white@hahicorp.com> Co-authored-by: Alexey Kulakov <uni_que@me.com>
1 parent 53cc5ee commit 3f270e4

File tree

17 files changed

+302
-315
lines changed

17 files changed

+302
-315
lines changed

.changeset/khaki-bananas-know.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@hashicorp/design-system-components": patch
3+
---
4+
5+
<!-- START components/side-nav -->
6+
`SideNav` - Fixed the type of `@a11yRefocusRouteChangeValidator` to match the expected type from `ember-a11y-refocus`. The new type is `(transition: Transition) => boolean` instead of `string`.
7+
<!-- END -->
8+
9+
<!-- START components/app-header -->
10+
`AppHeader` - Fixed the type of `@a11yRefocusRouteChangeValidator` to match the expected type from `ember-a11y-refocus`. The new type is `(transition: Transition) => boolean` instead of `string`.
11+
<!-- END -->

.changeset/puny-months-sit.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@hashicorp/design-system-components": major
3+
---
4+
5+
Upgraded `ember-a11y-refocus` dependency to version `5.0`
6+
Upgraded `@glimmer/component` dependency to version `2.0`

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
},
2727
"pnpm": {
2828
"overrides": {
29+
"@glimmer/component": "^2.0.0",
2930
"ember-composable-helpers": "npm:@nullvoxpopuli/ember-composable-helpers@^5.2.11"
3031
},
3132
"patchedDependencies": {

packages/components/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"clipboard-polyfill": "^4.1.1",
5959
"codemirror-lang-hcl": "^0.0.0-beta.2",
6060
"decorator-transforms": "^2.3.0",
61-
"ember-a11y-refocus": "^4.1.4",
61+
"ember-a11y-refocus": "^5.1.0",
6262
"ember-concurrency": "^4.0.4",
6363
"ember-element-helper": "^0.8.6",
6464
"ember-focus-trap": "^1.1.1",
@@ -83,7 +83,7 @@
8383
"@ember/test-helpers": "^4.0.4",
8484
"@embroider/addon-dev": "^7.1.5",
8585
"@eslint/js": "^9.23.0",
86-
"@glimmer/component": "^1.1.2",
86+
"@glimmer/component": "^2.0.0",
8787
"@glint/core": "^1.5.2",
8888
"@glint/environment-ember-loose": "^1.5.2",
8989
"@glint/environment-ember-template-imports": "^1.5.2",

packages/components/src/components/hds/advanced-table/th-resize-handle.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { action } from '@ember/object';
99
import { modifier } from 'ember-modifier';
1010
import { requestAnimationFrameWaiter } from './utils.ts';
1111
import { BORDER_WIDTH } from './index.ts';
12+
import type Owner from '@ember/owner';
1213

1314
import type HdsAdvancedTableColumn from './models/column.ts';
1415
import type { HdsAdvancedTableSignature } from './index.ts';
@@ -90,7 +91,7 @@ export default class HdsAdvancedTableThResizeHandle extends Component<HdsAdvance
9091
);
9192

9293
constructor(
93-
owner: unknown,
94+
owner: Owner,
9495
args: HdsAdvancedTableThResizeHandleSignature['Args']
9596
) {
9697
super(owner, args);

packages/components/src/components/hds/app-header/index.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
...attributes
1111
>
1212
{{#if (and this.hasA11yRefocus (not this._isOpen))}}
13-
{{! @glint-expect-error - `ember-a11y-refocus` doesn't expose types yet }}
1413
<NavigationNarrator
1514
@routeChangeValidator={{@a11yRefocusRouteChangeValidator}}
1615
@skipTo={{this.a11yRefocusSkipTo}}

packages/components/src/components/hds/app-header/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { guidFor } from '@ember/object/internals';
99
import { tracked } from '@glimmer/tracking';
1010
import { registerDestructor } from '@ember/destroyable';
1111
import type Owner from '@ember/owner';
12+
import type { NavigationNarratorSignature } from 'ember-a11y-refocus/components/navigation-narrator';
1213

1314
import { hdsBreakpoints } from '../../../utils/hds-breakpoints.ts';
1415

@@ -19,7 +20,7 @@ export interface HdsAppHeaderSignature {
1920
a11yRefocusSkipTo?: string;
2021
a11yRefocusSkipText?: string;
2122
a11yRefocusNavigationText?: string;
22-
a11yRefocusRouteChangeValidator?: string;
23+
a11yRefocusRouteChangeValidator?: NavigationNarratorSignature['Args']['routeChangeValidator'];
2324
a11yRefocusExcludeAllQueryParams?: boolean;
2425
};
2526
Blocks: {

packages/components/src/components/hds/side-nav/index.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
>
2121
<:root>
2222
{{#if this.hasA11yRefocus}}
23-
{{! @glint-expect-error - `ember-a11y-refocus` doesn't expose types yet }}
2423
<NavigationNarrator
2524
@routeChangeValidator={{@a11yRefocusRouteChangeValidator}}
2625
@skipTo={{this.a11yRefocusSkipTo}}

packages/components/src/components/hds/side-nav/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { registerDestructor } from '@ember/destroyable';
1111

1212
import type { HdsSideNavBaseSignature } from './base';
1313
import type Owner from '@ember/owner';
14+
import type { NavigationNarratorSignature } from 'ember-a11y-refocus/components/navigation-narrator';
1415

1516
export interface HdsSideNavSignature {
1617
Args: {
@@ -21,7 +22,7 @@ export interface HdsSideNavSignature {
2122
a11yRefocusSkipTo?: string;
2223
a11yRefocusSkipText?: string;
2324
a11yRefocusNavigationText?: string;
24-
a11yRefocusRouteChangeValidator?: string;
25+
a11yRefocusRouteChangeValidator?: NavigationNarratorSignature['Args']['routeChangeValidator'];
2526
a11yRefocusExcludeAllQueryParams?: boolean;
2627

2728
onToggleMinimizedStatus?: (arg: boolean) => void;

packages/components/src/styles/@hashicorp/design-system-components.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
@use "helpers/focus-ring";
1111
@use "helpers/typography";
1212

13+
// Vendor styles
14+
@use "./design-system-ember-a11y-refocus";
15+
1316
// Notice: this list can be automatically edited by the Ember blueprint, please don't remove the start/end comments
1417
// START COMPONENTS CSS FILES IMPORTS
1518
@use "../components/accordion";
@@ -58,6 +61,7 @@
5861
// END COMPONENT CSS FILES IMPORTS
5962

6063
@use "../mixins/screen-reader-only" as *;
64+
6165
// stylelint-disable-next-line selector-class-pattern
6266
.sr-only {
6367
@include screen-reader-only();

0 commit comments

Comments
 (0)