@hashicorp/design-system-components 2.12.2 → 2.14.0

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/addon/components/hds/app-footer/copyright.hbs +9 -0
  3. package/addon/components/hds/app-footer/copyright.js +18 -0
  4. package/addon/components/hds/app-footer/index.hbs +20 -0
  5. package/addon/components/hds/app-footer/index.js +41 -0
  6. package/addon/components/hds/app-footer/item.hbs +8 -0
  7. package/addon/components/hds/app-footer/legal-links.hbs +14 -0
  8. package/addon/components/hds/app-footer/legal-links.js +66 -0
  9. package/addon/components/hds/app-footer/link.hbs +22 -0
  10. package/addon/components/hds/app-footer/status-link.hbs +20 -0
  11. package/addon/components/hds/app-footer/status-link.js +133 -0
  12. package/addon/components/hds/pagination/compact/index.hbs +9 -0
  13. package/addon/components/hds/pagination/compact/index.js +23 -0
  14. package/addon/components/hds/side-nav/index.hbs +5 -8
  15. package/addon/components/hds/side-nav/index.js +22 -11
  16. package/addon/components/hds/side-nav/toggle-button.hbs +7 -0
  17. package/addon/components/hds/tabs/index.hbs +7 -2
  18. package/addon/components/hds/tabs/index.js +101 -46
  19. package/addon/components/hds/tabs/panel.hbs +3 -3
  20. package/addon/components/hds/tabs/panel.js +18 -11
  21. package/addon/components/hds/tabs/tab.hbs +2 -2
  22. package/addon/components/hds/tabs/tab.js +23 -25
  23. package/app/components/hds/app-footer/copyright.js +6 -0
  24. package/app/components/hds/app-footer/index.js +6 -0
  25. package/app/components/hds/app-footer/item.js +6 -0
  26. package/app/components/hds/app-footer/legal-links.js +6 -0
  27. package/app/components/hds/app-footer/link.js +6 -0
  28. package/app/components/hds/app-footer/status-link.js +6 -0
  29. package/app/components/hds/side-nav/toggle-button.js +6 -0
  30. package/app/styles/@hashicorp/design-system-components.scss +1 -0
  31. package/app/styles/components/app-footer.scss +154 -0
  32. package/app/styles/components/link/standalone.scss +3 -1
  33. package/app/styles/components/side-nav/header.scss +10 -0
  34. package/app/styles/components/side-nav/index.scss +1 -0
  35. package/app/styles/components/side-nav/main.scss +21 -72
  36. package/app/styles/components/side-nav/toggle-button.scss +106 -0
  37. package/app/styles/components/side-nav/vars.scss +2 -4
  38. package/app/styles/components/tag.scss +1 -1
  39. package/blueprints/hds-component-test/files/tests/acceptance/components/hds/__name__.js +21 -0
  40. package/package.json +2 -2
@@ -31,7 +31,13 @@
31
31
 
32
32
  // desktop
33
33
  &.hds-side-nav--is-desktop {
34
- width: var(--hds-app-sidenav-width-expanded);
34
+ &.hds-side-nav--is-not-minimized {
35
+ width: var(--hds-app-sidenav-width-expanded);
36
+ }
37
+
38
+ &.hds-side-nav--is-minimized {
39
+ width: var(--hds-app-sidenav-width-minimized);
40
+ }
35
41
  }
36
42
  }
37
43
 
@@ -61,65 +67,6 @@
61
67
  }
62
68
  }
63
69
 
64
-
65
- // MENU/TOGGLE BUTTON
66
-
67
- .hds-side-nav__menu-toggle-button {
68
- position: absolute;
69
- z-index: 1;
70
- color: var(--token-color-foreground-high-contrast);
71
- background: none;
72
- border: 1px solid transparent;
73
- cursor: pointer;
74
- transition-timing-function: var(--hds-app-sidenav-animation-easing);
75
- transition-duration: var(--hds-app-sidenav-animation-duration);
76
- transition-property: width, height, padding, border-radius, transform;
77
-
78
- &:hover {
79
- background-color: var(--token-color-palette-neutral-600);
80
- border-color: transparent;
81
- }
82
-
83
- &:active {
84
- background-color: var(--token-color-palette-neutral-500);
85
- border-color: transparent;
86
- }
87
-
88
- &:focus {
89
- background-color: var(--token-color-palette-neutral-500);
90
- border-color: var(--token-color-focus-action-internal);
91
- outline: 3px solid var(--token-color-focus-action-external);
92
- }
93
-
94
- // by default it's styled as "close" button
95
- .hds-side-nav--is-mobile & {
96
- width: 24px;
97
- height: 24px;
98
- padding: 1px;
99
- background-color: var(--token-color-foreground-primary);
100
- border-radius: 3px;
101
- transform:
102
- translateX(calc(var(--hds-app-sidenav-width-expanded) + 8px))
103
- translateY(24px);
104
- // z-index: 15; // not needed anymore?
105
- }
106
-
107
- // when the sidenav is minimized it's styled as "menu" button
108
- .hds-side-nav--is-mobile.hds-side-nav--is-minimized & {
109
- width: 36px;
110
- height: 36px;
111
- padding: 5px;
112
- border-radius: 5px;
113
- transform: translateX(22px) translateY(var(--hds-app-sidenav-menu-button-y-shift));
114
- }
115
-
116
- // when it's desktop we _never_ want to show the menu/toggle button
117
- .hds-side-nav--is-desktop & {
118
- display: none;
119
- }
120
- }
121
-
122
-
123
70
  // RESPONSIVE WRAPPER
124
71
  // this container element is used to control the width of the sidebar at different viewports (desktop/mobile) and states (minimized/expanded)
125
72
 
@@ -129,6 +76,7 @@
129
76
  height: 100%;
130
77
  color: var(--token-side-nav-color-foreground-primary); // we set a default color (in case generic content is added to the header/body/footer of the sidenav)
131
78
  background: var(--token-side-nav-color-surface-primary);
79
+ border-right: var(--token-side-nav-wrapper-border-width) solid var(--token-side-nav-wrapper-border-color);
132
80
 
133
81
  // RESPONSIVENESS - This controls the width of the "sidenav" container, and is independent (bur related) from the parent "sidebar" grid area
134
82
 
@@ -138,17 +86,11 @@
138
86
  var(--hds-app-sidenav-animation-easing);
139
87
  }
140
88
 
141
- // mobile
142
- .hds-side-nav--is-mobile.hds-side-nav--is-minimized & {
89
+ .hds-side-nav--is-minimized & {
143
90
  width: var(--hds-app-sidenav-width-minimized);
144
91
  }
145
92
 
146
- .hds-side-nav--is-mobile.hds-side-nav--is-not-minimized & {
147
- width: var(--hds-app-sidenav-width-expanded);
148
- }
149
-
150
- // desktop
151
- .hds-side-nav--is-desktop & {
93
+ .hds-side-nav--is-not-minimized & {
152
94
  width: var(--hds-app-sidenav-width-expanded);
153
95
  }
154
96
  }
@@ -160,6 +102,15 @@
160
102
  padding-right: var(--token-side-nav-wrapper-padding-horizontal);
161
103
  padding-bottom: 8px; // by design
162
104
  padding-left: var(--token-side-nav-wrapper-padding-horizontal);
105
+ transition:
106
+ padding var(--hds-app-sidenav-animation-duration)
107
+ var(--hds-app-sidenav-animation-easing);
108
+
109
+ .hds-side-nav--is-minimized & {
110
+ padding-top: var(--token-side-nav-wrapper-padding-vertical-minimized);
111
+ padding-right: var(--token-side-nav-wrapper-padding-horizontal-minimized);
112
+ padding-left: var(--token-side-nav-wrapper-padding-horizontal-minimized);
113
+ }
163
114
  }
164
115
 
165
116
  .hds-side-nav__wrapper-body {
@@ -187,10 +138,9 @@
187
138
  // - shown (transitioning their opacity) when the sidenav is "expanded"
188
139
 
189
140
  .hds-side-nav-hide-when-minimized {
190
- .hds-side-nav--is-mobile.hds-side-nav--is-minimized & {
141
+ .hds-side-nav--is-minimized & {
191
142
  visibility: hidden !important; // we need `!important` here to override the inline style applied to the single panels
192
143
  opacity: 0;
193
- transition: none;
194
144
  // this is needed because, despite the element having `visibility: hidden`,
195
145
  // the child elements ("panels") have their visibility dynamically managed via JS
196
146
  // and when they have "visibility: visible" applied, they are not visually visible
@@ -206,8 +156,7 @@
206
156
  pointer-events: none;
207
157
  }
208
158
 
209
- .hds-side-nav--is-mobile.hds-side-nav--is-not-minimized &,
210
- .hds-side-nav--is-desktop & {
159
+ .hds-side-nav--is-not-minimized & {
211
160
  visibility: visible;
212
161
  opacity: 1;
213
162
  transition:
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ //
7
+ // SIDE-NAV > TOGGLE BUTTON
8
+ //
9
+
10
+
11
+ .hds-side-nav__toggle-button {
12
+ position: absolute;
13
+ top: 22px;
14
+ left: calc(var(--token-side-nav-wrapper-border-width) * -1);
15
+ z-index: 1;
16
+ display: flex;
17
+ flex-direction: row-reverse;
18
+ align-items: center;
19
+ width: 26px;
20
+ height: 36px;
21
+ padding: 0 4px;
22
+ color: var(--token-color-foreground-high-contrast);
23
+ background: none;
24
+ background-color: var(--token-side-nav-color-surface-primary);
25
+ border: var(--token-side-nav-wrapper-border-width) solid var(--token-side-nav-wrapper-border-color);
26
+ border-left-color: transparent;
27
+ border-top-right-radius: var(--token-side-nav-toggle-button-border-radius);
28
+ border-bottom-right-radius: var(--token-side-nav-toggle-button-border-radius);
29
+ transform: translateX(var(--hds-app-sidenav-width-expanded));
30
+ cursor: pointer;
31
+ transition:
32
+ transform var(--hds-app-sidenav-animation-duration)
33
+ var(--hds-app-sidenav-animation-easing),
34
+ width var(--hds-app-sidenav-animation-duration)
35
+ var(--hds-app-sidenav-animation-easing);
36
+
37
+ &::before {
38
+ position: absolute;
39
+ top: calc(var(--token-side-nav-toggle-button-border-radius) * -2);
40
+ left: calc(var(--token-side-nav-wrapper-border-width) * -1);
41
+ box-sizing: border-box;
42
+ width: calc(var(--token-side-nav-toggle-button-border-radius) * 2);
43
+ height: calc(var(--token-side-nav-toggle-button-border-radius) * 2);
44
+ border-bottom: var(--token-side-nav-wrapper-border-width) solid var(--token-side-nav-wrapper-border-color);
45
+ border-left: var(--token-side-nav-wrapper-border-width) solid var(--token-side-nav-wrapper-border-color);
46
+ border-bottom-left-radius: var(--token-side-nav-toggle-button-border-radius);
47
+ box-shadow: 0 var(--token-side-nav-toggle-button-border-radius) 0 var(--token-side-nav-color-surface-primary);
48
+ content: "";
49
+ }
50
+
51
+ &::after {
52
+ position: absolute;
53
+ bottom: calc(var(--token-side-nav-toggle-button-border-radius) * -2);
54
+ left: calc(var(--token-side-nav-wrapper-border-width) * -1);
55
+ box-sizing: border-box;
56
+ width: calc(var(--token-side-nav-toggle-button-border-radius) * 2);
57
+ height: calc(var(--token-side-nav-toggle-button-border-radius) * 2);
58
+ border-top: var(--token-side-nav-wrapper-border-width) solid var(--token-side-nav-wrapper-border-color);
59
+ border-left: var(--token-side-nav-wrapper-border-width) solid var(--token-side-nav-wrapper-border-color);
60
+ border-top-left-radius: var(--token-side-nav-toggle-button-border-radius);
61
+ box-shadow: 0 calc(var(--token-side-nav-toggle-button-border-radius) * -1) 0 var(--token-side-nav-color-surface-primary);
62
+ content: "";
63
+ }
64
+
65
+ &:hover,
66
+ &.mock-hover {
67
+ width: 30px;
68
+ background-color: var(--token-side-nav-color-surface-interactive-hover);
69
+
70
+ &::before {
71
+ box-shadow: 0 var(--token-side-nav-toggle-button-border-radius) 0 var(--token-side-nav-color-surface-interactive-hover);
72
+ }
73
+
74
+ &::after {
75
+ box-shadow: 0 calc(var(--token-side-nav-toggle-button-border-radius) * -1) 0 var(--token-side-nav-color-surface-interactive-hover);
76
+ }
77
+ }
78
+
79
+ &:active,
80
+ &.mock-active {
81
+ background-color: var(--token-side-nav-color-surface-interactive-active);
82
+
83
+ &::before {
84
+ box-shadow: 0 var(--token-side-nav-toggle-button-border-radius) 0 var(--token-side-nav-color-surface-interactive-active);
85
+ }
86
+
87
+ &::after {
88
+ box-shadow: 0 calc(var(--token-side-nav-toggle-button-border-radius) * -1) 0 var(--token-side-nav-color-surface-interactive-active);
89
+ }
90
+ }
91
+
92
+ &:focus-visible,
93
+ &.mock-focus {
94
+ border-color: var(--token-color-focus-action-internal);
95
+ outline: 3px solid var(--token-color-focus-action-external);
96
+
97
+ &::before,
98
+ &::after {
99
+ display: none;
100
+ }
101
+ }
102
+
103
+ .hds-side-nav--is-minimized & {
104
+ transform: translateX(var(--hds-app-sidenav-width-minimized));
105
+ }
106
+ }
@@ -16,13 +16,11 @@
16
16
  // breakpoint
17
17
  --hds-app-desktop-breakpoint: 1088px; // this is used only to read its value via JS and set the `hds-side-nav--is-desktop` class
18
18
  // widths
19
- --hds-app-sidenav-width-minimized: 80px;
19
+ --hds-app-sidenav-width-minimized: 48px;
20
20
  --hds-app-sidenav-width-expanded: 280px;
21
21
  --hds-app-sidenav-width-fixed: var(--hds-app-sidenav-width-expanded);
22
- // sidebar menu
23
- --hds-app-sidenav-menu-button-y-shift: 84px;
24
22
  // animation
25
- --hds-app-sidenav-animation-duration: 250ms;
23
+ --hds-app-sidenav-animation-duration: 200ms;
26
24
  --hds-app-sidenav-animation-delay: var(--hds-app-sidenav-animation-duration);
27
25
  --hds-app-sidenav-animation-easing: cubic-bezier(0.65, 0, 0.35, 1);
28
26
  }
@@ -29,7 +29,7 @@ $hds-tag-border-radius: 50px;
29
29
  .hds-tag__dismiss {
30
30
  flex: 0 0 auto;
31
31
  margin: 0; // reset default button margin
32
- padding: 6px 2px 6px 8px;
32
+ padding: 6px 4px 6px 8px;
33
33
  border: none; // reset default button border
34
34
  border-radius: inherit;
35
35
  border-top-right-radius: 0;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ import { module, test } from 'qunit';
7
+ import { visit } from '@ember/test-helpers';
8
+ import { setupApplicationTest } from 'dummy/tests/helpers';
9
+ import { a11yAudit } from 'ember-a11y-testing/test-support';
10
+
11
+ module('Acceptance | components/<%= dasherizedModuleName %>', function (hooks) {
12
+ setupApplicationTest(hooks);
13
+
14
+ test('Components/<%= dasherizedModuleName %> page passes automated a11y checks', async function (assert) {
15
+ await visit('/components/<%= dasherizedModuleName %>');
16
+
17
+ await a11yAudit();
18
+
19
+ assert.ok(true, 'a11y automation audit passed');
20
+ });
21
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashicorp/design-system-components",
3
- "version": "2.12.2",
3
+ "version": "2.14.0",
4
4
  "description": "Helios Design System Components",
5
5
  "keywords": [
6
6
  "hashicorp",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@ember/render-modifiers": "^2.0.5",
43
43
  "@ember/test-waiters": "^3.0.2",
44
- "@hashicorp/design-system-tokens": "^1.8.0",
44
+ "@hashicorp/design-system-tokens": "^1.9.0",
45
45
  "@hashicorp/ember-flight-icons": "^3.1.3",
46
46
  "dialog-polyfill": "^0.5.6",
47
47
  "ember-a11y-refocus": "^3.0.2",