@hashicorp/design-system-components 2.4.2 → 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 +6 -0
- package/addon/components/hds/breadcrumb/truncation.js +5 -0
- package/addon/components/hds/dismiss-button/index.js +5 -0
- package/addon/components/hds/side-nav/index.hbs +7 -1
- package/addon/components/hds/side-nav/index.js +17 -0
- package/addon/components/hds/side-nav/portal/index.hbs +1 -1
- package/addon/components/hds/side-nav/portal/target.hbs +1 -1
- package/app/styles/components/side-nav/content.scss +1 -1
- package/app/styles/components/side-nav/main.scss +6 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
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
|
+
|
|
3
9
|
## 2.4.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
SPDX-License-Identifier: MPL-2.0
|
|
4
4
|
}}
|
|
5
5
|
|
|
6
|
-
<Hds::SideNav::Base
|
|
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
|
|
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>
|
|
@@ -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
|
+
}
|