@internetarchive/ia-topnav 1.3.0 → 1.3.1-alpha2
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/package.json +1 -1
- package/src/assets/img/icon-hamburger.js +18 -0
- package/src/assets/img/icons.js +2 -0
- package/src/ia-topnav.js +7 -0
- package/src/primary-nav.js +22 -14
- package/src/styles/desktop-subnav.js +3 -3
- package/src/styles/ia-topnav.js +2 -3
- package/src/styles/login-button.js +6 -3
- package/src/styles/media-button.js +7 -5
- package/src/styles/media-menu.js +2 -2
- package/src/styles/nav-search.js +9 -7
- package/src/styles/primary-nav.js +58 -59
- package/src/styles/signed-out-dropdown.js +3 -3
- package/src/styles/user-menu.js +2 -2
- package/test/ia-topnav.test.js +1 -1
- package/test/primary-nav.test.js +1 -1
- package/src/assets/img/hamburger.js +0 -36
- package/src/assets/img/user.js +0 -38
package/package.json
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { html } from 'https://offshoot.prod.archive.org/lit.js';
|
|
2
|
+
|
|
3
|
+
export default html`
|
|
4
|
+
<svg
|
|
5
|
+
viewBox="0 0 40 40"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
aria-labelledby="hamburgerTitleID"
|
|
8
|
+
>
|
|
9
|
+
<title id="hamburgerTitleID">Hamburger icon</title>
|
|
10
|
+
<path
|
|
11
|
+
d="m30.5 26.5c.8284271 0 1.5.6715729 1.5 1.5s-.6715729 1.5-1.5 1.5h-21c-.82842712 0-1.5-.6715729-1.5-1.5s.67157288-1.5 1.5-1.5zm0-8c.8284271 0 1.5.6715729 1.5 1.5s-.6715729 1.5-1.5 1.5h-21c-.82842712 0-1.5-.6715729-1.5-1.5s.67157288-1.5 1.5-1.5zm0-8c.8284271 0 1.5.6715729 1.5 1.5s-.6715729 1.5-1.5 1.5h-21c-.82842712 0-1.5-.6715729-1.5-1.5s.67157288-1.5 1.5-1.5z"
|
|
12
|
+
fill="#999"
|
|
13
|
+
fill-rule="evenodd"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
|
package/src/assets/img/icons.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import audio from './icon-audio.js';
|
|
2
2
|
import close from './icon-close.js';
|
|
3
|
+
import hamburger from './icon-hamburger.js';
|
|
3
4
|
import donate from './icon-donate.js';
|
|
4
5
|
import ellipses from './icon-ellipses.js';
|
|
5
6
|
import iaLogo from './icon-ia-logo.js';
|
|
@@ -16,6 +17,7 @@ import web from './icon-web.js';
|
|
|
16
17
|
export default {
|
|
17
18
|
audio,
|
|
18
19
|
close,
|
|
20
|
+
hamburger,
|
|
19
21
|
donate,
|
|
20
22
|
ellipses,
|
|
21
23
|
iaLogo,
|
package/src/ia-topnav.js
CHANGED
|
@@ -86,6 +86,13 @@ export default class IATopNav extends LitElement {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
firstUpdated() {
|
|
90
|
+
// close open menu on `esc` click
|
|
91
|
+
document.addEventListener('keydown', e => {
|
|
92
|
+
if (e.key === 'Escape') this.closeMenus();
|
|
93
|
+
}, false);
|
|
94
|
+
}
|
|
95
|
+
|
|
89
96
|
menuSetup() {
|
|
90
97
|
this.localLinks = this.getAttribute('localLinks') !== 'false' && this.getAttribute('localLinks') !== false;
|
|
91
98
|
this.username = this.getAttribute('username')
|
package/src/primary-nav.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { html, nothing } from 'https://offshoot.prod.archive.org/lit.js';
|
|
2
2
|
import TrackedElement from './tracked-element.js';
|
|
3
3
|
import icons from './assets/img/icons.js';
|
|
4
|
-
import './assets/img/hamburger.js';
|
|
5
4
|
import './login-button.js';
|
|
6
5
|
import './nav-search.js';
|
|
7
6
|
import './media-menu.js';
|
|
@@ -124,7 +123,7 @@ class PrimaryNav extends TrackedElement {
|
|
|
124
123
|
|
|
125
124
|
return html`
|
|
126
125
|
<button
|
|
127
|
-
class="search-trigger"
|
|
126
|
+
class="mobile-search-trigger"
|
|
128
127
|
@click="${this.toggleSearchMenu}"
|
|
129
128
|
data-event-click-tracking="${this.config.eventCategory}|NavSearchOpen"
|
|
130
129
|
>
|
|
@@ -145,14 +144,25 @@ class PrimaryNav extends TrackedElement {
|
|
|
145
144
|
get mobileDonateHeart() {
|
|
146
145
|
return html`
|
|
147
146
|
<a class="mobile-donate-link" href=${formatUrl('/donate/?origin=iawww-mbhrt', this.baseHost)}>
|
|
148
|
-
<span class="icon">
|
|
149
147
|
${icons.donate}
|
|
150
|
-
|
|
151
|
-
<span class="label">"Donate to the archive"</span>
|
|
148
|
+
<span class="sr-only">"Donate to the archive"</span>
|
|
152
149
|
</a>
|
|
153
150
|
`;
|
|
154
151
|
}
|
|
155
152
|
|
|
153
|
+
get uploadButtonTemplate() {
|
|
154
|
+
return html`<a href="${formatUrl('/create', this.baseHost)}" class="upload">
|
|
155
|
+
${icons.upload}
|
|
156
|
+
<span>Upload</span>
|
|
157
|
+
</a>`;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
get userStateTemplate() {
|
|
161
|
+
return html`<div class="user-info">
|
|
162
|
+
${this.username ? this.userIcon : this.loginIcon}
|
|
163
|
+
</div>`;
|
|
164
|
+
}
|
|
165
|
+
|
|
156
166
|
get secondLogoSlot() {
|
|
157
167
|
return this.allowSecondaryIcon
|
|
158
168
|
? html`
|
|
@@ -181,14 +191,12 @@ class PrimaryNav extends TrackedElement {
|
|
|
181
191
|
>
|
|
182
192
|
${this.secondLogoSlot}
|
|
183
193
|
</div>
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
${
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
<div class="user-info">
|
|
191
|
-
${this.username ? this.userIcon : this.loginIcon}
|
|
194
|
+
|
|
195
|
+
<div class="right-side-section">
|
|
196
|
+
${this.mobileDonateHeart}
|
|
197
|
+
${this.searchMenu}
|
|
198
|
+
${this.uploadButtonTemplate}
|
|
199
|
+
${this.userStateTemplate}
|
|
192
200
|
</div>
|
|
193
201
|
<media-menu
|
|
194
202
|
.baseHost=${this.baseHost}
|
|
@@ -205,7 +213,7 @@ class PrimaryNav extends TrackedElement {
|
|
|
205
213
|
data-event-click-tracking="${this.config.eventCategory}|NavHamburger"
|
|
206
214
|
title="Open main menu"
|
|
207
215
|
>
|
|
208
|
-
|
|
216
|
+
${this.openMenu === 'media' ? icons.close : icons.hamburger}
|
|
209
217
|
</button>
|
|
210
218
|
</nav>
|
|
211
219
|
`;
|
package/src/styles/ia-topnav.js
CHANGED
|
@@ -54,7 +54,6 @@ export default css`
|
|
|
54
54
|
--savePageErrorText: var(--errorYellow);
|
|
55
55
|
|
|
56
56
|
color: var(--primaryTextColor);
|
|
57
|
-
font-size: 2rem;
|
|
58
57
|
font-family: var(--themeFontFamily);
|
|
59
58
|
}
|
|
60
59
|
|
|
@@ -69,7 +68,7 @@ export default css`
|
|
|
69
68
|
right: 0;
|
|
70
69
|
bottom: 0;
|
|
71
70
|
left: 0;
|
|
72
|
-
z-index:
|
|
71
|
+
z-index: 3;
|
|
73
72
|
}
|
|
74
73
|
#close-layer.visible {
|
|
75
74
|
display: block;
|
|
@@ -77,7 +76,7 @@ export default css`
|
|
|
77
76
|
|
|
78
77
|
.topnav {
|
|
79
78
|
position: relative;
|
|
80
|
-
z-index:
|
|
79
|
+
z-index: 4;
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
@media (max-width: 889px) {
|
|
@@ -4,13 +4,16 @@ export default css`
|
|
|
4
4
|
.dropdown-toggle {
|
|
5
5
|
display: block;
|
|
6
6
|
height: 4rem;
|
|
7
|
-
font-size: 1.6rem;
|
|
8
7
|
text-transform: uppercase;
|
|
9
|
-
text-decoration: none;
|
|
10
8
|
color: var(--grey80);
|
|
11
9
|
cursor: pointer;
|
|
12
10
|
}
|
|
13
11
|
|
|
12
|
+
.dropdown-toggle svg {
|
|
13
|
+
height: 4rem;
|
|
14
|
+
width: 4rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
14
17
|
.dropdown-toggle .fill-color {
|
|
15
18
|
fill: var(--iconFill);
|
|
16
19
|
}
|
|
@@ -50,7 +53,7 @@ export default css`
|
|
|
50
53
|
|
|
51
54
|
@media (min-width: 890px) {
|
|
52
55
|
.logged-out-toolbar {
|
|
53
|
-
|
|
56
|
+
padding: 0.5rem;
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
.active {
|
|
@@ -33,8 +33,6 @@ export default css`
|
|
|
33
33
|
|
|
34
34
|
.menu-item > .icon {
|
|
35
35
|
display: inline-flex;
|
|
36
|
-
width: 42px;
|
|
37
|
-
height: 42px;
|
|
38
36
|
vertical-align: middle;
|
|
39
37
|
-webkit-box-align: center;
|
|
40
38
|
-ms-flex-align: center;
|
|
@@ -44,6 +42,11 @@ export default css`
|
|
|
44
42
|
justify-content: center;
|
|
45
43
|
}
|
|
46
44
|
|
|
45
|
+
.menu-item > .icon > svg {
|
|
46
|
+
height: 4rem;
|
|
47
|
+
width: 4rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
47
50
|
.menu-item.selected .icon {
|
|
48
51
|
background-color: var(--activeButtonBg);
|
|
49
52
|
border-radius: 1rem 0 0 1rem;
|
|
@@ -61,7 +64,7 @@ export default css`
|
|
|
61
64
|
fill: #f00;
|
|
62
65
|
}
|
|
63
66
|
|
|
64
|
-
@media (min-width:
|
|
67
|
+
@media (min-width: 55.62rem) {
|
|
65
68
|
.menu-item {
|
|
66
69
|
width: auto;
|
|
67
70
|
height: 5rem;
|
|
@@ -91,7 +94,6 @@ export default css`
|
|
|
91
94
|
color: inherit;
|
|
92
95
|
}
|
|
93
96
|
|
|
94
|
-
|
|
95
97
|
.web:after {
|
|
96
98
|
display: none;
|
|
97
99
|
content: "web";
|
|
@@ -140,7 +142,7 @@ export default css`
|
|
|
140
142
|
}
|
|
141
143
|
}
|
|
142
144
|
|
|
143
|
-
@media (min-width:
|
|
145
|
+
@media (min-width: 81.25rem) {
|
|
144
146
|
.label,
|
|
145
147
|
.web:after {
|
|
146
148
|
display: inline;
|
package/src/styles/media-menu.js
CHANGED
package/src/styles/nav-search.js
CHANGED
|
@@ -24,8 +24,6 @@ export default css`
|
|
|
24
24
|
}
|
|
25
25
|
.search svg {
|
|
26
26
|
position: relative;
|
|
27
|
-
top: -5px;
|
|
28
|
-
right: -3px;
|
|
29
27
|
fill: var(--activeSearchColor);
|
|
30
28
|
}
|
|
31
29
|
.search-activated {
|
|
@@ -65,6 +63,10 @@ export default css`
|
|
|
65
63
|
-ms-grid-row-align: center;
|
|
66
64
|
align-self: center;
|
|
67
65
|
}
|
|
66
|
+
.search-activated .search svg {
|
|
67
|
+
height: 3rem;
|
|
68
|
+
width: 3rem;
|
|
69
|
+
}
|
|
68
70
|
.search-activated .search-field {
|
|
69
71
|
width: 100%;
|
|
70
72
|
height: 100%;
|
|
@@ -93,8 +95,8 @@ export default css`
|
|
|
93
95
|
@media (min-width: 890px) {
|
|
94
96
|
.search svg {
|
|
95
97
|
display: inline;
|
|
96
|
-
width:
|
|
97
|
-
height:
|
|
98
|
+
width: 2.8rem;
|
|
99
|
+
height: 2.8rem;
|
|
98
100
|
vertical-align: -14px;
|
|
99
101
|
}
|
|
100
102
|
.search path {
|
|
@@ -105,7 +107,7 @@ export default css`
|
|
|
105
107
|
.search-activated {
|
|
106
108
|
display: block;
|
|
107
109
|
position: static;
|
|
108
|
-
padding: 1.
|
|
110
|
+
padding: 1.1rem 0.2rem;
|
|
109
111
|
background: transparent;
|
|
110
112
|
}
|
|
111
113
|
|
|
@@ -127,8 +129,8 @@ export default css`
|
|
|
127
129
|
}
|
|
128
130
|
|
|
129
131
|
.search-activated .search svg {
|
|
130
|
-
width:
|
|
131
|
-
height:
|
|
132
|
+
width: 2.8rem;
|
|
133
|
+
height: 2.8rem;
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
136
|
`;
|
|
@@ -11,10 +11,10 @@ export default css`
|
|
|
11
11
|
position: relative;
|
|
12
12
|
display: -ms-grid;
|
|
13
13
|
display: grid;
|
|
14
|
-
height:
|
|
14
|
+
height: 4rem;
|
|
15
15
|
grid-template-areas: 'hamburger empty heart search user';
|
|
16
|
-
-ms-grid-columns:
|
|
17
|
-
grid-template-columns:
|
|
16
|
+
-ms-grid-columns: 4rem minmax(1rem, 100%) 4rem 4rem 4rem;
|
|
17
|
+
grid-template-columns: 4rem auto 5rem 4rem 4rem;
|
|
18
18
|
-ms-grid-rows: 100%;
|
|
19
19
|
grid-template-rows: 100%;
|
|
20
20
|
background: var(--primaryNavBg);
|
|
@@ -23,10 +23,15 @@ export default css`
|
|
|
23
23
|
|
|
24
24
|
nav.hide-search {
|
|
25
25
|
grid-template-areas: 'hamburger empty heart user';
|
|
26
|
-
-ms-grid-columns:
|
|
27
|
-
grid-template-columns:
|
|
26
|
+
-ms-grid-columns: 4rem minmax(1rem, 100%) 4rem 4rem;
|
|
27
|
+
grid-template-columns: 4rem auto 5rem 4rem;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
.right-side-section {
|
|
31
|
+
display: flex;
|
|
32
|
+
user-select: none;
|
|
33
|
+
align-items: center;
|
|
34
|
+
}
|
|
30
35
|
button {
|
|
31
36
|
background: none;
|
|
32
37
|
color: inherit;
|
|
@@ -56,6 +61,14 @@ export default css`
|
|
|
56
61
|
grid-column-end: user-end;
|
|
57
62
|
}
|
|
58
63
|
|
|
64
|
+
.ia-logo {
|
|
65
|
+
height: 3rem;
|
|
66
|
+
width: 3rem;
|
|
67
|
+
}
|
|
68
|
+
.ia-wordmark {
|
|
69
|
+
height: 3rem;
|
|
70
|
+
width: 9.5rem;
|
|
71
|
+
}
|
|
59
72
|
.ia-logo,
|
|
60
73
|
.ia-wordmark {
|
|
61
74
|
margin-right: 5px;
|
|
@@ -67,55 +80,39 @@ export default css`
|
|
|
67
80
|
grid-area: hamburger;
|
|
68
81
|
padding: 0;
|
|
69
82
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
grid-area: heart;
|
|
75
|
-
position: relative;
|
|
76
|
-
padding: 0;
|
|
77
|
-
z-index: 1;
|
|
78
|
-
width: 100%;
|
|
79
|
-
text-align: right;
|
|
80
|
-
-webkit-box-align: center;
|
|
81
|
-
-ms-flex-align: center;
|
|
82
|
-
align-items: center;
|
|
83
|
+
.hamburger svg {
|
|
84
|
+
height: 4rem;
|
|
85
|
+
width: 4rem;
|
|
86
|
+
fill: var(--activeColor);
|
|
83
87
|
}
|
|
88
|
+
|
|
84
89
|
.mobile-donate-link svg {
|
|
85
|
-
height:
|
|
86
|
-
width:
|
|
87
|
-
margin-top: -5px;
|
|
88
|
-
margin-left: -5px;
|
|
90
|
+
height: 5rem;
|
|
91
|
+
width: 5rem;
|
|
89
92
|
}
|
|
90
93
|
.mobile-donate-link .fill-color {
|
|
91
94
|
fill: rgb(255, 0, 0);
|
|
92
95
|
}
|
|
93
|
-
|
|
96
|
+
|
|
97
|
+
.sr-only {
|
|
94
98
|
position: absolute;
|
|
95
99
|
width: 1px;
|
|
96
100
|
height: 1px;
|
|
97
|
-
padding: 0;
|
|
98
101
|
margin: -1px;
|
|
99
|
-
|
|
100
|
-
clip: rect(0,0,0,0);
|
|
102
|
+
padding: 0;
|
|
101
103
|
border: 0;
|
|
104
|
+
overflow: hidden;
|
|
105
|
+
white-space: nowrap;
|
|
106
|
+
clip: rect(1px, 1px, 1px, 1px);
|
|
107
|
+
-webkit-clip-path: inset(50%);
|
|
108
|
+
clip-path: inset(50%);
|
|
109
|
+
user-select: none;
|
|
102
110
|
}
|
|
103
111
|
|
|
104
|
-
.search-trigger {
|
|
105
|
-
-ms-grid-row: 1;
|
|
106
|
-
-ms-grid-column: 4;
|
|
107
|
-
grid-area: search;
|
|
108
|
-
position: relative;
|
|
112
|
+
.mobile-search-trigger {
|
|
109
113
|
padding: 0;
|
|
110
|
-
z-index: 1;
|
|
111
|
-
width: 100%;
|
|
112
|
-
text-align: right;
|
|
113
|
-
-webkit-box-align: center;
|
|
114
|
-
-ms-flex-align: center;
|
|
115
|
-
align-items: center;
|
|
116
114
|
}
|
|
117
|
-
|
|
118
|
-
.search-trigger .fill-color {
|
|
115
|
+
.mobile-search-trigger .fill-color {
|
|
119
116
|
fill: var(--iconFill);
|
|
120
117
|
}
|
|
121
118
|
|
|
@@ -132,14 +129,9 @@ export default css`
|
|
|
132
129
|
display: none;
|
|
133
130
|
}
|
|
134
131
|
|
|
135
|
-
.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
grid-area: user;
|
|
139
|
-
-ms-grid-row-align: stretch;
|
|
140
|
-
align-self: stretch;
|
|
141
|
-
-ms-grid-column-align: end;
|
|
142
|
-
justify-self: end;
|
|
132
|
+
.upload svg {
|
|
133
|
+
height: 3rem;
|
|
134
|
+
width: 3rem;
|
|
143
135
|
}
|
|
144
136
|
|
|
145
137
|
.screen-name {
|
|
@@ -150,9 +142,8 @@ export default css`
|
|
|
150
142
|
}
|
|
151
143
|
|
|
152
144
|
.user-menu {
|
|
153
|
-
height: 100%;
|
|
154
|
-
padding: 0.5rem 1rem;
|
|
155
145
|
color: var(--lightTextColor);
|
|
146
|
+
padding: 0.5rem;
|
|
156
147
|
}
|
|
157
148
|
|
|
158
149
|
.user-menu:hover {
|
|
@@ -166,8 +157,8 @@ export default css`
|
|
|
166
157
|
|
|
167
158
|
.user-menu img {
|
|
168
159
|
display: block;
|
|
169
|
-
width:
|
|
170
|
-
height:
|
|
160
|
+
width: 3rem;
|
|
161
|
+
height: 3rem;
|
|
171
162
|
}
|
|
172
163
|
|
|
173
164
|
.link-home {
|
|
@@ -195,8 +186,12 @@ export default css`
|
|
|
195
186
|
|
|
196
187
|
@media (min-width: 890px) {
|
|
197
188
|
:host {
|
|
198
|
-
--userIconWidth:
|
|
199
|
-
--userIconHeight:
|
|
189
|
+
--userIconWidth: 3.2rem;
|
|
190
|
+
--userIconHeight: 3.2rem;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.right-side-section {
|
|
194
|
+
display: contents;
|
|
200
195
|
}
|
|
201
196
|
|
|
202
197
|
nav {
|
|
@@ -220,18 +215,23 @@ export default css`
|
|
|
220
215
|
}
|
|
221
216
|
|
|
222
217
|
.hamburger,
|
|
223
|
-
.search-trigger,
|
|
218
|
+
.mobile-search-trigger,
|
|
224
219
|
.mobile-donate-link {
|
|
225
220
|
display: none;
|
|
226
221
|
}
|
|
227
222
|
|
|
228
223
|
.user-info {
|
|
229
224
|
float: right;
|
|
230
|
-
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.user-info .user-menu img {
|
|
228
|
+
height: 3rem;
|
|
229
|
+
width: 3rem;
|
|
230
|
+
margin-right: 0.5rem;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
.user-menu {
|
|
234
|
-
padding
|
|
234
|
+
padding: 1rem;
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
.user-menu.active {
|
|
@@ -241,12 +241,13 @@ export default css`
|
|
|
241
241
|
.user-menu img {
|
|
242
242
|
display: inline-block;
|
|
243
243
|
vertical-align: middle;
|
|
244
|
+
margin-right: 0.5rem;
|
|
244
245
|
}
|
|
245
246
|
|
|
246
247
|
.upload {
|
|
247
248
|
display: block;
|
|
249
|
+
padding: 1rem 0.5rem;
|
|
248
250
|
float: right;
|
|
249
|
-
margin-top: 1rem;
|
|
250
251
|
font-size: 1.4rem;
|
|
251
252
|
text-transform: uppercase;
|
|
252
253
|
text-decoration: none;
|
|
@@ -259,8 +260,6 @@ export default css`
|
|
|
259
260
|
}
|
|
260
261
|
|
|
261
262
|
.upload svg {
|
|
262
|
-
width: 32px;
|
|
263
|
-
height: 32px;
|
|
264
263
|
vertical-align: middle;
|
|
265
264
|
fill: var(--iconFill);
|
|
266
265
|
}
|
|
@@ -5,7 +5,7 @@ export default css`
|
|
|
5
5
|
.initial,
|
|
6
6
|
.closed,
|
|
7
7
|
.open {
|
|
8
|
-
right:
|
|
8
|
+
right: 35rem;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.search-hidden.initial,
|
|
@@ -19,13 +19,13 @@ export default css`
|
|
|
19
19
|
.initial,
|
|
20
20
|
.closed,
|
|
21
21
|
.open {
|
|
22
|
-
right:
|
|
22
|
+
right: 41rem;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.search-hidden.initial,
|
|
26
26
|
.search-hidden.closed,
|
|
27
27
|
.search-hidden.open {
|
|
28
|
-
right:
|
|
28
|
+
right: 26rem;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
`;
|
package/src/styles/user-menu.js
CHANGED
|
@@ -5,7 +5,7 @@ export default css`
|
|
|
5
5
|
.initial,
|
|
6
6
|
.closed,
|
|
7
7
|
.open {
|
|
8
|
-
right:
|
|
8
|
+
right: 22.4rem;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.search-hidden.initial,
|
|
@@ -19,7 +19,7 @@ export default css`
|
|
|
19
19
|
.initial,
|
|
20
20
|
.closed,
|
|
21
21
|
.open {
|
|
22
|
-
right: 27.
|
|
22
|
+
right: 27.2rem;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.search-hidden.initial,
|
package/test/ia-topnav.test.js
CHANGED
|
@@ -198,7 +198,7 @@ describe('<ia-topnav>', () => {
|
|
|
198
198
|
|
|
199
199
|
it('toggles search menu when search toggle button clicked', async () => {
|
|
200
200
|
const el = await fixture(container());
|
|
201
|
-
el.shadowRoot.querySelector('primary-nav').shadowRoot.querySelector('.search-trigger').click();
|
|
201
|
+
el.shadowRoot.querySelector('primary-nav').shadowRoot.querySelector('.mobile-search-trigger').click();
|
|
202
202
|
await el.updateComplete;
|
|
203
203
|
|
|
204
204
|
expect(el.openMenu).to.equal('search');
|
package/test/primary-nav.test.js
CHANGED
|
@@ -40,7 +40,7 @@ describe('<primary-nav>', () => {
|
|
|
40
40
|
hideSearch: true,
|
|
41
41
|
}));
|
|
42
42
|
|
|
43
|
-
expect(el.shadowRoot.querySelector('.search-trigger')).to.equal(null);
|
|
43
|
+
expect(el.shadowRoot.querySelector('.mobile-search-trigger')).to.equal(null);
|
|
44
44
|
expect(el.shadowRoot.querySelector('nav-search')).to.equal(null);
|
|
45
45
|
});
|
|
46
46
|
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { html, css } from 'https://offshoot.prod.archive.org/lit.js';
|
|
2
|
-
import Icon from './icon.js';
|
|
3
|
-
import icons from './icons.js';
|
|
4
|
-
|
|
5
|
-
class HamBurger extends Icon {
|
|
6
|
-
static get styles() {
|
|
7
|
-
return css`
|
|
8
|
-
svg {
|
|
9
|
-
display: block;
|
|
10
|
-
}
|
|
11
|
-
.fill-color {
|
|
12
|
-
fill: var(--activeColor);
|
|
13
|
-
}
|
|
14
|
-
`;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
static get closed() {
|
|
18
|
-
return html`
|
|
19
|
-
<svg height="40" viewBox="0 0 40 40" width="40" xmlns="http://www.w3.org/2000/svg" aria-labelledby="hamburgerTitleID hamburgerDescID">
|
|
20
|
-
<title id="hamburgerTitleID">Hamburger icon</title>
|
|
21
|
-
<desc id="hamburgerDescID">An icon used to represent a menu that can be toggled by interacting with this icon.</desc>
|
|
22
|
-
<path d="m30.5 26.5c.8284271 0 1.5.6715729 1.5 1.5s-.6715729 1.5-1.5 1.5h-21c-.82842712 0-1.5-.6715729-1.5-1.5s.67157288-1.5 1.5-1.5zm0-8c.8284271 0 1.5.6715729 1.5 1.5s-.6715729 1.5-1.5 1.5h-21c-.82842712 0-1.5-.6715729-1.5-1.5s.67157288-1.5 1.5-1.5zm0-8c.8284271 0 1.5.6715729 1.5 1.5s-.6715729 1.5-1.5 1.5h-21c-.82842712 0-1.5-.6715729-1.5-1.5s.67157288-1.5 1.5-1.5z" fill="#999" fill-rule="evenodd"/>
|
|
23
|
-
</svg>
|
|
24
|
-
`;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
static get opened() {
|
|
28
|
-
return icons.close;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
render() {
|
|
32
|
-
return this.active ? HamBurger.opened : HamBurger.closed;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
customElements.define('icon-hamburger', HamBurger);
|
package/src/assets/img/user.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { html, css } from 'https://offshoot.prod.archive.org/lit.js';
|
|
2
|
-
import Icon from './icon.js';
|
|
3
|
-
|
|
4
|
-
class User extends Icon {
|
|
5
|
-
static get styles() {
|
|
6
|
-
return css`
|
|
7
|
-
svg {
|
|
8
|
-
vertical-align: middle;
|
|
9
|
-
width: var(--userIconWidth);
|
|
10
|
-
height: var(--userIconHeight);
|
|
11
|
-
}
|
|
12
|
-
path {
|
|
13
|
-
fill: var(--baseColor);
|
|
14
|
-
}
|
|
15
|
-
.active {
|
|
16
|
-
fill: var(--activeColor);
|
|
17
|
-
}
|
|
18
|
-
`;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
render() {
|
|
22
|
-
return html`
|
|
23
|
-
<svg
|
|
24
|
-
width="40"
|
|
25
|
-
height="40"
|
|
26
|
-
viewBox="0 0 40 40"
|
|
27
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
28
|
-
aria-labelledby="userTitleID userDescID"
|
|
29
|
-
>
|
|
30
|
-
<title id="userTitleID">User icon</title>
|
|
31
|
-
<desc id="userDescID">An illustration of a person's head and chest.</desc>
|
|
32
|
-
<path class="${this.active ? 'active' : ''}" d="m20.7130435 18.0434783c-3.5658385 0-6.4565218-2.9198821-6.4565218-6.5217392 0-3.60185703 2.8906833-6.5217391 6.4565218-6.5217391s6.4565217 2.91988207 6.4565217 6.5217391c0 3.6018571-2.8906832 6.5217392-6.4565217 6.5217392zm-12.9130435 16.9565217c0-7.9240855 5.7813665-14.3478261 12.9130435-14.3478261s12.9130435 6.4237406 12.9130435 14.3478261z" fill-rule="evenodd"/>
|
|
33
|
-
</svg>
|
|
34
|
-
`;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
customElements.define('user-image', User);
|