@hashicorp/design-system-components 2.4.1 → 2.4.3

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,17 @@
1
1
  # @hashicorp/design-system-components
2
2
 
3
+ ## 2.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1388](https://github.com/hashicorp/design-system/pull/1388) [`56a6b94df`](https://github.com/hashicorp/design-system/commit/56a6b94dfa337a887153e39393ed2a2bb1b93774) Thanks [@didoo](https://github.com/didoo)! - Fixed `SideNav` issue with content resizing when transitioning its `width`
8
+
9
+ ## 2.4.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#1380](https://github.com/hashicorp/design-system/pull/1380) [`cd16ccc19`](https://github.com/hashicorp/design-system/commit/cd16ccc19e0992be2bed5d567880d2d0d36f1880) Thanks [@MelSumner](https://github.com/MelSumner)! - A11y Fix: removes `aria-label` from stepper/indicator and from task/indicator, which was causing an accessibility test error.
14
+
3
15
  ## 2.4.1
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -10,7 +10,6 @@ Compatibility
10
10
  ------------------------------------------------------------------------------
11
11
 
12
12
  * Ember.js v3.28 or above
13
- * Note: The library _should_ work with earlier versions of Ember, but we only test with Ember 3.28 and newer
14
13
  * Ember CLI v3.28 or above
15
14
  * Node.js v12 or above
16
15
 
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
1
6
  import Component from '@glimmer/component';
2
7
 
3
8
  export default class HdsBreadcrumbTruncationComponent extends Component {
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
1
6
  import Component from '@glimmer/component';
2
7
 
3
8
  export default class HdsDismissButtonIndexComponent extends Component {
@@ -3,7 +3,13 @@
3
3
  SPDX-License-Identifier: MPL-2.0
4
4
  }}
5
5
 
6
- <Hds::SideNav::Base class={{this.classNames}} ...attributes {{focus-trap isActive=this.shouldTrapFocus}}>
6
+ <Hds::SideNav::Base
7
+ class={{this.classNames}}
8
+ ...attributes
9
+ {{on "transitionstart" (fn this.setTransition "start")}}
10
+ {{on "transitionend" (fn this.setTransition "end")}}
11
+ {{focus-trap isActive=this.shouldTrapFocus}}
12
+ >
7
13
  <:root>
8
14
  {{#if this.hasA11yRefocus}}
9
15
  <NavigationNarrator
@@ -12,6 +12,7 @@ import { registerDestructor } from '@ember/destroyable';
12
12
  export default class HdsSideNavComponent extends Component {
13
13
  @tracked isResponsive = this.args.isResponsive ?? true;
14
14
  @tracked isMinimized = this.isResponsive; // we set it minimized by default so that if we switch viewport from desktop to mobile its already minimized
15
+ @tracked isAnimating = false;
15
16
  @tracked isDesktop = true;
16
17
  hasA11yRefocus = this.args.hasA11yRefocus ?? true;
17
18
 
@@ -84,6 +85,9 @@ export default class HdsSideNavComponent extends Component {
84
85
  } else {
85
86
  classes.push('hds-side-nav--is-not-minimized');
86
87
  }
88
+ if (this.isAnimating) {
89
+ classes.push('hds-side-nav--is-animating');
90
+ }
87
91
 
88
92
  return classes.join(' ');
89
93
  }
@@ -106,6 +110,19 @@ export default class HdsSideNavComponent extends Component {
106
110
  }
107
111
  }
108
112
 
113
+ @action
114
+ setTransition(phase, event) {
115
+ // we only want to respond to `width` animation/transitions
116
+ if (event.propertyName !== 'width') {
117
+ return;
118
+ }
119
+ if (phase === 'start') {
120
+ this.isAnimating = true;
121
+ } else {
122
+ this.isAnimating = false;
123
+ }
124
+ }
125
+
109
126
  @action
110
127
  updateDesktopVariable(event) {
111
128
  this.isDesktop = event.matches;
@@ -4,7 +4,7 @@
4
4
  }}
5
5
 
6
6
  <Portal @target={{if @targetName @targetName "hds-side-nav-portal-target"}}>
7
- <div class="hds-side-nav__content-panel hds-side-nav-hide-when-minimized" ...attributes>
7
+ <div class="hds-side-nav__content-panel" ...attributes>
8
8
  <Hds::SideNav::List aria-label={{@ariaLabel}} as |ListElements|>
9
9
  {{yield ListElements}}
10
10
  </Hds::SideNav::List>
@@ -8,7 +8,7 @@
8
8
  @multiple={{true}}
9
9
  @onChange={{this.panelsChanged}}
10
10
  @name={{if @targetName @targetName "hds-side-nav-portal-target"}}
11
- class="hds-side-nav__content-panels"
11
+ class="hds-side-nav__content-panels hds-side-nav-hide-when-minimized"
12
12
  {{did-update this.didUpdateSubnav this.numSubnavs}}
13
13
  />
14
14
  </div>
@@ -2,7 +2,7 @@
2
2
  Copyright (c) HashiCorp, Inc.
3
3
  SPDX-License-Identifier: MPL-2.0
4
4
  }}
5
- <div class={{this.classNames}} ...attributes aria-label={{@status}}>
5
+ <div class={{this.classNames}} ...attributes>
6
6
  <div class="hds-stepper-indicator-step__svg-hexagon">
7
7
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
8
8
  <path
@@ -2,6 +2,6 @@
2
2
  Copyright (c) HashiCorp, Inc.
3
3
  SPDX-License-Identifier: MPL-2.0
4
4
  }}
5
- <div class={{this.classNames}} ...attributes aria-label={{@status}}>
5
+ <div class={{this.classNames}} ...attributes>
6
6
  <FlightIcon class="hds-stepper-indicator-task__icon" @name={{this.iconName}} @size="16" />
7
7
  </div>
@@ -21,7 +21,7 @@
21
21
  .hds-side-nav__content-panels {
22
22
  // see https://codepen.io/didoo/pen/YzOeRPr
23
23
  display: grid;
24
- grid-template-columns: repeat(5, 100%);
24
+ grid-template-columns: repeat(5, var(--hds-app-sidenav-width-expanded));
25
25
  width: 100%;
26
26
  }
27
27
 
@@ -202,5 +202,10 @@
202
202
  var(--hds-app-sidenav-animation-easing)
203
203
  var(--hds-app-sidenav-animation-delay);
204
204
  }
205
- }
206
205
 
206
+ // we want to avoid accidental interactions with the navigation elements while the sidenav is animating its width
207
+ // (elements with `visibility: visible` can already be interacted with, while their opacity is transitioning)
208
+ .hds-side-nav--is-animating & {
209
+ pointer-events: none;
210
+ }
211
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashicorp/design-system-components",
3
- "version": "2.4.1",
3
+ "version": "2.4.3",
4
4
  "description": "Helios Design System Components",
5
5
  "keywords": [
6
6
  "hashicorp",