@hashicorp/design-system-components 1.7.3 → 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 +14 -0
- package/addon/components/hds/disclosure/index.js +3 -4
- package/addon/components/hds/side-nav/header.hbs +13 -0
- package/addon/components/hds/side-nav/home-link.hbs +20 -0
- package/addon/components/hds/side-nav/home-link.js +25 -0
- package/addon/components/hds/side-nav/icon-button.hbs +20 -0
- package/addon/components/hds/side-nav/icon-button.js +25 -0
- package/addon/components/hds/side-nav/list/back-link.hbs +24 -0
- package/addon/components/hds/side-nav/list/index.hbs +17 -0
- package/addon/components/hds/side-nav/list/item.hbs +8 -0
- package/addon/components/hds/side-nav/list/link.hbs +48 -0
- package/addon/components/hds/side-nav/list/title.hbs +8 -0
- package/addon/components/hds/side-nav/wrapper.hbs +18 -0
- package/app/components/hds/side-nav/header.js +6 -0
- package/app/components/hds/side-nav/home-link.js +6 -0
- package/app/components/hds/side-nav/icon-button.js +6 -0
- package/app/components/hds/side-nav/list/back-link.js +6 -0
- package/app/components/hds/side-nav/list/index.js +6 -0
- package/app/components/hds/side-nav/list/item.js +6 -0
- package/app/components/hds/side-nav/list/link.js +6 -0
- package/app/components/hds/side-nav/list/title.js +6 -0
- package/app/components/hds/side-nav/wrapper.js +6 -0
- package/app/styles/@hashicorp/design-system-components.scss +1 -0
- package/app/styles/components/side-nav.scss +275 -0
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
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
|
+
|
|
11
|
+
## 1.8.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#1163](https://github.com/hashicorp/design-system/pull/1163) [`992fde13f`](https://github.com/hashicorp/design-system/commit/992fde13f48b925563e85a7253f4c0aaeca50b9d) Thanks [@KristinLBradley](https://github.com/KristinLBradley)! - Add new `SideNav` components
|
|
16
|
+
|
|
3
17
|
## 1.7.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -30,10 +30,9 @@ export default class HdsDisclosureComponent extends Component {
|
|
|
30
30
|
|
|
31
31
|
@action
|
|
32
32
|
onFocusOut(event) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
|
|
6
|
+
<div class="hds-side-nav-header" ...attributes>
|
|
7
|
+
<div class="hds-side-nav-header__logo">
|
|
8
|
+
{{yield to="logo"}}
|
|
9
|
+
</div>
|
|
10
|
+
<div class="hds-side-nav-header__actions">
|
|
11
|
+
{{yield to="actions"}}
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
|
|
6
|
+
<Hds::Interactive
|
|
7
|
+
class="hds-side-nav__home-link"
|
|
8
|
+
@current-when={{@current-when}}
|
|
9
|
+
@models={{hds-link-to-models @model @models}}
|
|
10
|
+
@query={{hds-link-to-query @query}}
|
|
11
|
+
@replace={{@replace}}
|
|
12
|
+
@route={{@route}}
|
|
13
|
+
@isRouteExternal={{@isRouteExternal}}
|
|
14
|
+
@href={{@href}}
|
|
15
|
+
@isHrefExternal={{@isHrefExternal}}
|
|
16
|
+
...attributes
|
|
17
|
+
aria-label={{this.ariaLabel}}
|
|
18
|
+
>
|
|
19
|
+
<FlightIcon @name={{@icon}} @color={{@color}} @stretched={{true}} />
|
|
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
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
|
|
6
|
+
<Hds::Interactive
|
|
7
|
+
class="hds-side-nav__icon-button"
|
|
8
|
+
@current-when={{@current-when}}
|
|
9
|
+
@models={{hds-link-to-models @model @models}}
|
|
10
|
+
@query={{hds-link-to-query @query}}
|
|
11
|
+
@replace={{@replace}}
|
|
12
|
+
@route={{@route}}
|
|
13
|
+
@isRouteExternal={{@isRouteExternal}}
|
|
14
|
+
@href={{@href}}
|
|
15
|
+
@isHrefExternal={{@isHrefExternal}}
|
|
16
|
+
...attributes
|
|
17
|
+
aria-label={{this.ariaLabel}}
|
|
18
|
+
>
|
|
19
|
+
<FlightIcon @name={{@icon}} @color={{@color}} @stretched={{true}} @size="24" />
|
|
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 HdsSideNavIconButtonComponent 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::IconButton" must have a valid value',
|
|
20
|
+
ariaLabel !== undefined
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
return ariaLabel;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
|
|
6
|
+
<Hds::SideNav::List::Item>
|
|
7
|
+
<Hds::Interactive
|
|
8
|
+
class="hds-side-nav__list-item-link hds-side-nav__list-item-link--back-link"
|
|
9
|
+
@current-when={{@current-when}}
|
|
10
|
+
@models={{hds-link-to-models @model @models}}
|
|
11
|
+
@query={{hds-link-to-query @query}}
|
|
12
|
+
@replace={{@replace}}
|
|
13
|
+
@route={{@route}}
|
|
14
|
+
@isRouteExternal={{@isRouteExternal}}
|
|
15
|
+
@href={{@href}}
|
|
16
|
+
@isHrefExternal={{@isHrefExternal}}
|
|
17
|
+
...attributes
|
|
18
|
+
>
|
|
19
|
+
<FlightIcon class="hds-side-nav__list-item-icon-leading" @name="chevron-left" />
|
|
20
|
+
<span class="hds-side-nav__list-item-text hds-typography-body-200 hds-font-weight-medium">
|
|
21
|
+
{{@text}}
|
|
22
|
+
</span>
|
|
23
|
+
</Hds::Interactive>
|
|
24
|
+
</Hds::SideNav::List::Item>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
|
|
6
|
+
<nav class="hds-side-nav__list-wrapper" ...attributes>
|
|
7
|
+
<ul class="hds-side-nav__list" role="list">
|
|
8
|
+
{{yield
|
|
9
|
+
(hash
|
|
10
|
+
Item=(component "hds/side-nav/list/item")
|
|
11
|
+
BackLink=(component "hds/side-nav/list/back-link")
|
|
12
|
+
Title=(component "hds/side-nav/list/title")
|
|
13
|
+
Link=(component "hds/side-nav/list/link")
|
|
14
|
+
)
|
|
15
|
+
}}
|
|
16
|
+
</ul>
|
|
17
|
+
</nav>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
|
|
6
|
+
<Hds::SideNav::List::Item>
|
|
7
|
+
<Hds::Interactive
|
|
8
|
+
class="hds-side-nav__list-item-link {{if @isActive 'active'}}"
|
|
9
|
+
@current-when={{@current-when}}
|
|
10
|
+
@models={{hds-link-to-models @model @models}}
|
|
11
|
+
@query={{hds-link-to-query @query}}
|
|
12
|
+
@replace={{@replace}}
|
|
13
|
+
@route={{@route}}
|
|
14
|
+
@isRouteExternal={{@isRouteExternal}}
|
|
15
|
+
@href={{@href}}
|
|
16
|
+
@isHrefExternal={{@isHrefExternal}}
|
|
17
|
+
...attributes
|
|
18
|
+
>
|
|
19
|
+
{{#if @icon}}
|
|
20
|
+
<FlightIcon class="hds-side-nav__list-item-icon-leading" @name={{@icon}} />
|
|
21
|
+
{{/if}}
|
|
22
|
+
|
|
23
|
+
<span class="hds-side-nav__list-item-text hds-typography-body-200 hds-font-weight-medium">
|
|
24
|
+
{{@text}}
|
|
25
|
+
</span>
|
|
26
|
+
|
|
27
|
+
{{#if @count}}
|
|
28
|
+
<Hds::BadgeCount @text={{@count}} @type="inverted" @size="small" />
|
|
29
|
+
{{/if}}
|
|
30
|
+
|
|
31
|
+
{{#if @badge}}
|
|
32
|
+
<Hds::Badge @text={{@badge}} @type="inverted" @size="small" />
|
|
33
|
+
{{/if}}
|
|
34
|
+
|
|
35
|
+
{{yield}}
|
|
36
|
+
|
|
37
|
+
{{#if @hasSubItems}}
|
|
38
|
+
<span class="hds-side-nav__list-item-icon-trailing">
|
|
39
|
+
<FlightIcon @name="chevron-right" @isInlineBlock={{false}} />
|
|
40
|
+
</span>
|
|
41
|
+
{{/if}}
|
|
42
|
+
{{#if @isHrefExternal}}
|
|
43
|
+
<span class="hds-side-nav__list-item-icon-trailing">
|
|
44
|
+
<FlightIcon @name="external-link" @isInlineBlock={{false}} />
|
|
45
|
+
</span>
|
|
46
|
+
{{/if}}
|
|
47
|
+
</Hds::Interactive>
|
|
48
|
+
</Hds::SideNav::List::Item>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
|
|
6
|
+
<div class="hds-side-nav__wrapper" ...attributes>
|
|
7
|
+
<div class="hds-side-nav__wrapper-header">
|
|
8
|
+
{{yield to="header"}}
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="hds-side-nav__wrapper-body" aria-label="contents">
|
|
12
|
+
{{yield to="body"}}
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div class="hds-side-nav__wrapper-footer">
|
|
16
|
+
{{yield to="footer"}}
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
//
|
|
7
|
+
// SIDE-NAV
|
|
8
|
+
//
|
|
9
|
+
|
|
10
|
+
@use "../mixins/focus-ring" as *;
|
|
11
|
+
|
|
12
|
+
// WIP, naming, etc. will be refined... TODO: Add JSON for color tokens, etc.
|
|
13
|
+
:root {
|
|
14
|
+
// Sizes:
|
|
15
|
+
|
|
16
|
+
// header, body, footer "wrappers":
|
|
17
|
+
--token-side-nav-wrapper-padding-horizontal: 16px;
|
|
18
|
+
--token-side-nav-wrapper-padding-vertical: 16px;
|
|
19
|
+
--token-side-nav-wrapper-header-padding-bottom: 8px;
|
|
20
|
+
|
|
21
|
+
// header content:
|
|
22
|
+
--token-side-nav-header-home-link-padding: 4px;
|
|
23
|
+
--token-side-nav-header-home-link-logo-size: 48px;
|
|
24
|
+
--token-side-nav-header-actions-spacing: 8px;
|
|
25
|
+
|
|
26
|
+
// body content:
|
|
27
|
+
--token-side-nav-body-list-margin-vertical: 16px;
|
|
28
|
+
--token-side-nav-body-list-item-padding-horizontal: 8px;
|
|
29
|
+
--token-side-nav-body-list-item-padding-vertical: 4px;
|
|
30
|
+
--token-side-nav-body-list-item-spacing-vertical: 2px;
|
|
31
|
+
--token-side-nav-body-list-item-content-spacing-horizontal: 8px;
|
|
32
|
+
--token-side-nav-body-list-item-border-radius: 5px;
|
|
33
|
+
|
|
34
|
+
// Colors:
|
|
35
|
+
|
|
36
|
+
// SideNav container:
|
|
37
|
+
--token-side-nav-foreground-primary: #dedfe3;
|
|
38
|
+
--token-side-nav-foreground-primary-strong: #fff;
|
|
39
|
+
--token-side-nav-foreground-faint: #8c909c;
|
|
40
|
+
--token-side-nav-surface-primary: #0c0c0e;
|
|
41
|
+
|
|
42
|
+
// Interactive elements:
|
|
43
|
+
// base:
|
|
44
|
+
--token-side-nav-interactive-surface-hover: #3b3d45;
|
|
45
|
+
--token-side-nav-interactive-surface-active: #656a76;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@mixin hds-side-nav-icon-button($add-visible-border: false) {
|
|
49
|
+
color: var(--token-side-nav-foreground-primary-strong);
|
|
50
|
+
background-color: transparent;
|
|
51
|
+
border: 1px solid transparent;
|
|
52
|
+
border-radius: var(--token-side-nav-body-list-item-border-radius);
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
|
|
55
|
+
@if ($add-visible-border) {
|
|
56
|
+
border-color: var(--token-color-palette-neutral-500);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&:focus,
|
|
60
|
+
&.mock-focus {
|
|
61
|
+
@include hds-focus-ring-with-pseudo-element($top: -1px, $right: -1px, $bottom: -1px, $left: -1px);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:hover,
|
|
65
|
+
&.mock-hover {
|
|
66
|
+
color: var(--token-side-nav-foreground-primary-strong); // to avoid overrides by specificity (eg. `a:hover`)
|
|
67
|
+
background: var(--token-side-nav-interactive-surface-hover);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&:active,
|
|
71
|
+
&.mock-active {
|
|
72
|
+
color: var(--token-side-nav-foreground-primary-strong); // to avoid overrides by specificity (eg. `a:hover`)
|
|
73
|
+
background: var(--token-side-nav-interactive-surface-active);
|
|
74
|
+
|
|
75
|
+
@if ($add-visible-border) {
|
|
76
|
+
border-color: var(--token-color-palette-neutral-400);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
// * SideNav Parent (wrapper) component
|
|
83
|
+
// -------------------------------------------------------------------
|
|
84
|
+
|
|
85
|
+
.hds-side-nav__wrapper {
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
width: 100%;
|
|
89
|
+
height: 100%;
|
|
90
|
+
color: var(--token-side-nav-foreground-primary); // Default color
|
|
91
|
+
background: var(--token-side-nav-surface-primary);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.hds-side-nav__wrapper-header {
|
|
95
|
+
padding-top: var(--token-side-nav-wrapper-padding-vertical);
|
|
96
|
+
padding-right: var(--token-side-nav-wrapper-padding-horizontal);
|
|
97
|
+
padding-bottom: var(--token-side-nav-wrapper-header-padding-bottom); // by design
|
|
98
|
+
padding-left: var(--token-side-nav-wrapper-padding-horizontal);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.hds-side-nav__wrapper-body {
|
|
102
|
+
flex: 1;
|
|
103
|
+
padding: var(--token-side-nav-wrapper-padding-vertical) var(--token-side-nav-wrapper-padding-horizontal);
|
|
104
|
+
overflow-y: auto;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.hds-side-nav__wrapper-footer {
|
|
108
|
+
padding: var(--token-side-nav-wrapper-padding-vertical) var(--token-side-nav-wrapper-padding-horizontal);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// * Header child elements
|
|
112
|
+
// ---------------------------------------
|
|
113
|
+
|
|
114
|
+
.hds-side-nav-header {
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
justify-content: space-between;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.hds-side-nav-header__logo {
|
|
121
|
+
display: block;
|
|
122
|
+
flex: none;
|
|
123
|
+
align-items: center;
|
|
124
|
+
justify-content: center;
|
|
125
|
+
width: var(--token-side-nav-header-home-link-logo-size);
|
|
126
|
+
height: var(--token-side-nav-header-home-link-logo-size);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.hds-side-nav-header__actions {
|
|
130
|
+
display: flex;
|
|
131
|
+
|
|
132
|
+
> * + * { margin-left: var(--token-side-nav-header-actions-spacing); }
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.hds-side-nav__home-link {
|
|
136
|
+
@include hds-side-nav-icon-button();
|
|
137
|
+
display: block;
|
|
138
|
+
width: 100%;
|
|
139
|
+
height: 100%;
|
|
140
|
+
padding: calc(var(--token-side-nav-header-home-link-padding) - 1px); // by design - we take in account the transparent border
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Apply class name to Hds::Dropdown component
|
|
144
|
+
.hds-side-nav__dropdown {
|
|
145
|
+
.hds-dropdown-toggle-icon {
|
|
146
|
+
@include hds-side-nav-icon-button($add-visible-border: true);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.hds-side-nav__icon-button {
|
|
151
|
+
@include hds-side-nav-icon-button($add-visible-border: true);
|
|
152
|
+
display: flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
justify-content: center;
|
|
155
|
+
width: 36px;
|
|
156
|
+
height: 36px;
|
|
157
|
+
padding: 5px; // we take in account the transparent border
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// * Body child elements
|
|
161
|
+
// ---------------------------------------
|
|
162
|
+
|
|
163
|
+
.hds-side-nav__list-title {
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
min-height: 34px;
|
|
167
|
+
margin-top: var(--token-side-nav-body-list-margin-vertical);
|
|
168
|
+
padding: 0 var(--token-side-nav-body-list-item-padding-horizontal);
|
|
169
|
+
color: var(--token-side-nav-foreground-faint);
|
|
170
|
+
|
|
171
|
+
// Remove margin from title at top of all list-items & lists
|
|
172
|
+
.hds-side-nav__list-wrapper:first-child .hds-side-nav__list-item:first-child > & {
|
|
173
|
+
margin-top: 0;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.hds-side-nav__list {
|
|
178
|
+
margin: 0;
|
|
179
|
+
padding: 0;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.hds-side-nav__list-item {
|
|
183
|
+
list-style-type: none; // Q: Should ul have role="list" added for accessibility?
|
|
184
|
+
|
|
185
|
+
& + & {
|
|
186
|
+
margin-top: var(--token-side-nav-body-list-item-spacing-vertical);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.hds-side-nav__list-item-link {
|
|
191
|
+
display: flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
width: 100%;
|
|
194
|
+
min-height: 36px;
|
|
195
|
+
padding: var(--token-side-nav-body-list-item-padding-vertical) var(--token-side-nav-body-list-item-padding-horizontal);
|
|
196
|
+
color: var(--token-side-nav-foreground-primary);
|
|
197
|
+
text-decoration: none;
|
|
198
|
+
background: var(--token-side-nav-surface-primary);
|
|
199
|
+
// "Link" could render as an HTML button element so this overrides the default border style in that case:
|
|
200
|
+
border-color: transparent;
|
|
201
|
+
border-radius: var(--token-side-nav-body-list-item-border-radius);
|
|
202
|
+
|
|
203
|
+
&:focus,
|
|
204
|
+
&.mock-focus {
|
|
205
|
+
@include hds-focus-ring-with-pseudo-element();
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
&:hover,
|
|
209
|
+
&.mock-hover {
|
|
210
|
+
background: var(--token-side-nav-interactive-surface-hover);
|
|
211
|
+
border-color: transparent;
|
|
212
|
+
|
|
213
|
+
.hds-side-nav__list-item-text,
|
|
214
|
+
.hds-side-nav__list-item-icon-leading,
|
|
215
|
+
.hds-side-nav__list-item-icon-trailing {
|
|
216
|
+
color: var(--token-side-nav-foreground-primary-strong);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// notice: this ".active" extra class is used to match the corresponding `active` class assigned automatically
|
|
221
|
+
// by the `<LinkTo>` Ember component (when the link is "current), so that consumers get it for free if they want
|
|
222
|
+
// otherwise they can use the `@isActive` argument to set this visual state directly
|
|
223
|
+
&.active,
|
|
224
|
+
&:active,
|
|
225
|
+
&.mock-active {
|
|
226
|
+
background: var(--token-side-nav-interactive-surface-active);
|
|
227
|
+
|
|
228
|
+
.hds-side-nav__list-item-text,
|
|
229
|
+
.hds-side-nav__list-item-icon-leading,
|
|
230
|
+
.hds-side-nav__list-item-icon-trailing {
|
|
231
|
+
color: var(--token-side-nav-foreground-primary-strong);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.hds-badge,
|
|
235
|
+
.hds-badge-count {
|
|
236
|
+
color: var(--token-color-foreground-primary);
|
|
237
|
+
background: var(--token-color-surface-strong);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.hds-badge,
|
|
242
|
+
.hds-badge-count {
|
|
243
|
+
margin-left: var(--token-side-nav-body-list-item-content-spacing-horizontal);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// special override for the "back-link" element (no visible active state, by design)
|
|
248
|
+
.hds-side-nav__list-item-link--back-link {
|
|
249
|
+
&:active,
|
|
250
|
+
&.mock-active {
|
|
251
|
+
background: var(--token-side-nav-surface-primary);
|
|
252
|
+
|
|
253
|
+
.hds-side-nav__list-item-text,
|
|
254
|
+
.hds-side-nav__list-item-icon-leading,
|
|
255
|
+
.hds-side-nav__list-item-icon-trailing {
|
|
256
|
+
color: var(--token-side-nav-foreground-primary);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.hds-side-nav__list-item-text {
|
|
262
|
+
color: var(--token-side-nav-foreground-primary);
|
|
263
|
+
text-align: left;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.hds-side-nav__list-item-icon-leading {
|
|
267
|
+
flex: none;
|
|
268
|
+
margin-right: var(--token-side-nav-body-list-item-content-spacing-horizontal);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.hds-side-nav__list-item-icon-trailing {
|
|
272
|
+
flex: none;
|
|
273
|
+
margin-left: auto;
|
|
274
|
+
padding-left: var(--token-side-nav-body-list-item-content-spacing-horizontal);
|
|
275
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashicorp/design-system-components",
|
|
3
|
-
"version": "1.
|
|
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.
|
|
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.
|
|
103
|
+
"webpack": "^5.76.0"
|
|
103
104
|
},
|
|
104
105
|
"engines": {
|
|
105
106
|
"node": "12.* || 14.* || >= 16"
|