@hashicorp/design-system-components 2.3.0 → 2.3.2
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 +14 -0
- package/addon/components/hds/side-nav/base.hbs +5 -0
- package/addon/components/hds/side-nav/portal/index.hbs +1 -1
- package/addon/components/hds/side-nav/portal/target.hbs +1 -1
- package/addon/components/hds/side-nav/portal/target.js +13 -4
- package/app/styles/components/side-nav/main.scss +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @hashicorp/design-system-components
|
|
2
2
|
|
|
3
|
+
## 2.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1344](https://github.com/hashicorp/design-system/pull/1344) [`6d6cf3ea8`](https://github.com/hashicorp/design-system/commit/6d6cf3ea81bf5bd1f631c99fc53cc88318d7d52f) Thanks [@cbfx](https://github.com/cbfx)! - `SideNav::Portal::Target` - Fixed a possible source of flickering when a panel has already been rendered
|
|
8
|
+
|
|
9
|
+
## 2.3.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#1338](https://github.com/hashicorp/design-system/pull/1338) [`2bc23fd20`](https://github.com/hashicorp/design-system/commit/2bc23fd20bafdedda65126f606c345ea5eb6fa1e) Thanks [@didoo](https://github.com/didoo)! - `SideNav` - Fix issue with links being clickable even if not visible
|
|
14
|
+
|
|
15
|
+
- [#1339](https://github.com/hashicorp/design-system/pull/1339) [`ea8edb9bf`](https://github.com/hashicorp/design-system/commit/ea8edb9bf0567b5dc97ded9efbfeb5c6f27f52d5) Thanks [@didoo](https://github.com/didoo)! - `SideNav` - Updated CSS declaration that was causing an horizontal scrollbar to appear in some conditions
|
|
16
|
+
|
|
3
17
|
## 2.3.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -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" ...attributes>
|
|
7
|
+
<div class="hds-side-nav__content-panel hds-side-nav-hide-when-minimized" ...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"
|
|
12
12
|
{{did-update this.didUpdateSubnav this.numSubnavs}}
|
|
13
13
|
/>
|
|
14
14
|
</div>
|
|
@@ -9,12 +9,12 @@ import { tracked } from '@glimmer/tracking';
|
|
|
9
9
|
import { action } from '@ember/object';
|
|
10
10
|
import { DEBUG } from '@glimmer/env';
|
|
11
11
|
import Ember from 'ember';
|
|
12
|
-
import { debounce } from '@ember/runloop';
|
|
13
12
|
|
|
14
13
|
export default class SidenavPortalTarget extends Component {
|
|
15
14
|
@service router;
|
|
16
15
|
|
|
17
16
|
@tracked numSubnavs = 0;
|
|
17
|
+
@tracked lastPanelEl = null;
|
|
18
18
|
|
|
19
19
|
static get prefersReducedMotionOverride() {
|
|
20
20
|
return Ember.testing;
|
|
@@ -38,7 +38,7 @@ export default class SidenavPortalTarget extends Component {
|
|
|
38
38
|
|
|
39
39
|
@action
|
|
40
40
|
didUpdateSubnav(element, [count]) {
|
|
41
|
-
|
|
41
|
+
this.animateSubnav(element, [count]);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
@action
|
|
@@ -135,14 +135,23 @@ export default class SidenavPortalTarget extends Component {
|
|
|
135
135
|
|
|
136
136
|
// fade in next panel
|
|
137
137
|
let nextPanelEl = targetElement.children[activeIndex];
|
|
138
|
+
|
|
139
|
+
// get reference to last child panel
|
|
140
|
+
let lastPanelEl = targetElement.children[targetElement.children.length - 1];
|
|
141
|
+
|
|
138
142
|
if (nextPanelEl) {
|
|
139
143
|
nextPanelEl.ariaHidden = 'false';
|
|
140
144
|
nextPanelEl.style.setProperty('visibility', 'visible');
|
|
141
|
-
// this eliminates a flicker if there's only
|
|
142
|
-
|
|
145
|
+
// this eliminates a flicker if there's only one subnav rendering or if we
|
|
146
|
+
// already just rendered this panel.
|
|
147
|
+
if (activeIndex === 0 || nextPanelEl.isSameNode(this.lastPanelEl)) {
|
|
143
148
|
fadeDelay = 0;
|
|
144
149
|
fadeDuration = 0;
|
|
145
150
|
}
|
|
151
|
+
|
|
152
|
+
// remember the last panel
|
|
153
|
+
this.lastPanelEl = lastPanelEl;
|
|
154
|
+
|
|
146
155
|
nextPanelEl.animate([{ opacity: '0' }, { opacity: '1' }], {
|
|
147
156
|
delay: fadeDelay,
|
|
148
157
|
duration: fadeDuration,
|
|
@@ -167,6 +167,10 @@
|
|
|
167
167
|
padding:
|
|
168
168
|
var(--token-side-nav-wrapper-padding-vertical)
|
|
169
169
|
var(--token-side-nav-wrapper-padding-horizontal);
|
|
170
|
+
// this is necessary, otherwise when the sidenav is minimized an horizontal scrollbar may appear
|
|
171
|
+
// (if there are words longer than the width of the available space for the list "item" content)
|
|
172
|
+
overflow-x: hidden;
|
|
173
|
+
// we want the content to vertically scroll if needed
|
|
170
174
|
overflow-y: auto;
|
|
171
175
|
}
|
|
172
176
|
|