@hashicorp/design-system-components 1.8.0 → 1.8.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @hashicorp/design-system-components
2
2
 
3
+ ## 1.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1260](https://github.com/hashicorp/design-system/pull/1260) [`8eb0d1ff6`](https://github.com/hashicorp/design-system/commit/8eb0d1ff63248fe049962192190480a7fe6fdef9) Thanks [@didoo](https://github.com/didoo)! - Added `@ember/render-modifiers` as explicit dependency
8
+
9
+ - [#1256](https://github.com/hashicorp/design-system/pull/1256) [`451d98842`](https://github.com/hashicorp/design-system/commit/451d98842474dad2b3f3a6ad38c813e9d92d0f1d) Thanks [@alex-ju](https://github.com/alex-ju)! - Make the `Disclosure` mechanism more resilient
10
+
3
11
  ## 1.8.0
4
12
 
5
13
  ### Minor Changes
@@ -30,10 +30,9 @@ export default class HdsDisclosureComponent extends Component {
30
30
 
31
31
  @action
32
32
  onFocusOut(event) {
33
- if (
34
- !event.relatedTarget || // click or tap a non-related target (e.g. outside the element)
35
- !this.element.contains(event.relatedTarget) // move focus to a target outside the element
36
- ) {
33
+ // due to inconsitent implementation of relatedTarget across browsers we use the activeElement as a fallback
34
+ // if the related target is not part of the disclosed content we close the disclosed container
35
+ if (!this.element.contains(event.relatedTarget || document.activeElement)) {
37
36
  this.close();
38
37
  }
39
38
  }
@@ -1,3 +1,8 @@
1
+ {{!
2
+ Copyright (c) HashiCorp, Inc.
3
+ SPDX-License-Identifier: MPL-2.0
4
+ }}
5
+
1
6
  <div class="hds-side-nav-header" ...attributes>
2
7
  <div class="hds-side-nav-header__logo">
3
8
  {{yield to="logo"}}
@@ -1,3 +1,8 @@
1
+ {{!
2
+ Copyright (c) HashiCorp, Inc.
3
+ SPDX-License-Identifier: MPL-2.0
4
+ }}
5
+
1
6
  <Hds::Interactive
2
7
  class="hds-side-nav__home-link"
3
8
  @current-when={{@current-when}}
@@ -9,6 +14,7 @@
9
14
  @href={{@href}}
10
15
  @isHrefExternal={{@isHrefExternal}}
11
16
  ...attributes
17
+ aria-label={{this.ariaLabel}}
12
18
  >
13
19
  <FlightIcon @name={{@icon}} @color={{@color}} @stretched={{true}} />
14
20
  </Hds::Interactive>
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ import Component from '@glimmer/component';
7
+ import { assert } from '@ember/debug';
8
+
9
+ export default class HdsSideNavHomeLinkComponent extends Component {
10
+ /**
11
+ * @param ariaLabel
12
+ * @type {string}
13
+ * @description The value of `aria-label`
14
+ */
15
+ get ariaLabel() {
16
+ let { ariaLabel } = this.args;
17
+
18
+ assert(
19
+ '@ariaLabel for "Hds::SideNav::HomeLink" must have a valid value',
20
+ ariaLabel !== undefined
21
+ );
22
+
23
+ return ariaLabel;
24
+ }
25
+ }
@@ -1,3 +1,8 @@
1
+ {{!
2
+ Copyright (c) HashiCorp, Inc.
3
+ SPDX-License-Identifier: MPL-2.0
4
+ }}
5
+
1
6
  <Hds::Interactive
2
7
  class="hds-side-nav__icon-button"
3
8
  @current-when={{@current-when}}
@@ -1,3 +1,8 @@
1
+ {{!
2
+ Copyright (c) HashiCorp, Inc.
3
+ SPDX-License-Identifier: MPL-2.0
4
+ }}
5
+
1
6
  <Hds::SideNav::List::Item>
2
7
  <Hds::Interactive
3
8
  class="hds-side-nav__list-item-link hds-side-nav__list-item-link--back-link"
@@ -1,3 +1,8 @@
1
+ {{!
2
+ Copyright (c) HashiCorp, Inc.
3
+ SPDX-License-Identifier: MPL-2.0
4
+ }}
5
+
1
6
  <nav class="hds-side-nav__list-wrapper" ...attributes>
2
7
  <ul class="hds-side-nav__list" role="list">
3
8
  {{yield
@@ -1,3 +1,8 @@
1
+ {{!
2
+ Copyright (c) HashiCorp, Inc.
3
+ SPDX-License-Identifier: MPL-2.0
4
+ }}
5
+
1
6
  <li class="hds-side-nav__list-item" ...attributes>
2
7
  {{yield}}
3
8
  </li>
@@ -1,3 +1,8 @@
1
+ {{!
2
+ Copyright (c) HashiCorp, Inc.
3
+ SPDX-License-Identifier: MPL-2.0
4
+ }}
5
+
1
6
  <Hds::SideNav::List::Item>
2
7
  <Hds::Interactive
3
8
  class="hds-side-nav__list-item-link {{if @isActive 'active'}}"
@@ -1,3 +1,8 @@
1
+ {{!
2
+ Copyright (c) HashiCorp, Inc.
3
+ SPDX-License-Identifier: MPL-2.0
4
+ }}
5
+
1
6
  <Hds::SideNav::List::Item>
2
7
  <div class="hds-side-nav__list-title hds-typography-body-100 hds-font-weight-semibold" ...attributes>{{~yield~}}</div>
3
8
  </Hds::SideNav::List::Item>
@@ -1,3 +1,8 @@
1
+ {{!
2
+ Copyright (c) HashiCorp, Inc.
3
+ SPDX-License-Identifier: MPL-2.0
4
+ }}
5
+
1
6
  <div class="hds-side-nav__wrapper" ...attributes>
2
7
  <div class="hds-side-nav__wrapper-header">
3
8
  {{yield to="header"}}
@@ -1 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
1
6
  export { default } from '@hashicorp/design-system-components/components/hds/side-nav/header';
@@ -1 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
1
6
  export { default } from '@hashicorp/design-system-components/components/hds/side-nav/home-link';
@@ -1 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
1
6
  export { default } from '@hashicorp/design-system-components/components/hds/side-nav/icon-button';
@@ -1 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
1
6
  export { default } from '@hashicorp/design-system-components/components/hds/side-nav/list/back-link';
@@ -1 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
1
6
  export { default } from '@hashicorp/design-system-components/components/hds/side-nav/list/index';
@@ -1 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
1
6
  export { default } from '@hashicorp/design-system-components/components/hds/side-nav/list/item';
@@ -1 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
1
6
  export { default } from '@hashicorp/design-system-components/components/hds/side-nav/list/link';
@@ -1 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
1
6
  export { default } from '@hashicorp/design-system-components/components/hds/side-nav/list/title';
@@ -1 +1,6 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
1
6
  export { default } from '@hashicorp/design-system-components/components/hds/side-nav/wrapper';
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
1
6
  //
2
7
  // SIDE-NAV
3
8
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashicorp/design-system-components",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "Helios Design System Components",
5
5
  "keywords": [
6
6
  "hashicorp",
@@ -37,6 +37,7 @@
37
37
  "test:ember:percy": "percy exec ember test"
38
38
  },
39
39
  "dependencies": {
40
+ "@ember/render-modifiers": "^2.0.5",
40
41
  "@hashicorp/design-system-tokens": "^1.4.1",
41
42
  "@hashicorp/ember-flight-icons": "^3.0.2",
42
43
  "dialog-polyfill": "^0.5.6",
@@ -60,7 +61,7 @@
60
61
  "@embroider/test-setup": "^2.0.2",
61
62
  "@glimmer/component": "^1.1.2",
62
63
  "@glimmer/tracking": "^1.1.2",
63
- "@percy/cli": "^1.20.1",
64
+ "@percy/cli": "^1.21.0",
64
65
  "@percy/ember": "^4.2.0",
65
66
  "babel-eslint": "^10.1.0",
66
67
  "broccoli-asset-rev": "^3.0.0",
@@ -99,7 +100,7 @@
99
100
  "stylelint": "^14.16.1",
100
101
  "stylelint-config-rational-order": "^0.1.2",
101
102
  "stylelint-config-standard-scss": "^5.0.0",
102
- "webpack": "^5.75.0"
103
+ "webpack": "^5.76.0"
103
104
  },
104
105
  "engines": {
105
106
  "node": "12.* || 14.* || >= 16"