@internetarchive/ia-topnav 1.2.1 → 1.2.2-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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetarchive/ia-topnav",
3
- "version": "1.2.1",
3
+ "version": "1.2.2-alpha2",
4
4
  "description": "Top nav for Internet Archive",
5
5
  "license": "AGPL-3.0-only",
6
6
  "main": "index.js",
@@ -0,0 +1,15 @@
1
+ import { html } from 'https://offshoot.prod.archive.org/lit.js';
2
+
3
+ export default html`
4
+ <svg
5
+ height="14"
6
+ width="14"
7
+ viewBox="8 8 24 24"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ aria-labelledby="uploadTitleID uploadDescID"
10
+ >
11
+ <title id="uploadTitleID">Upload icon</title>
12
+ <desc id="uploadDescID">An illustration of a horizontal line over an up pointing arrow.</desc>
13
+ <path class="fill-color" d="m20 12.8 8 10.4h-4.8v8.8h-6.4v-8.8h-4.8zm12-4.8v3.2h-24v-3.2z" fill-rule="evenodd"/>
14
+ </svg>
15
+ `;
@@ -8,6 +8,7 @@ import search from './icon-search.js';
8
8
  import software from './icon-software.js';
9
9
  import texts from './icon-texts.js';
10
10
  import upload from './icon-upload.js';
11
+ import uploadUnpadded from './icon-upload-unpadded.js';
11
12
  import user from './icon-user.js';
12
13
  import video from './icon-video.js';
13
14
  import web from './icon-web.js';
@@ -23,6 +24,7 @@ export default {
23
24
  software,
24
25
  texts,
25
26
  upload,
27
+ uploadUnpadded,
26
28
  user,
27
29
  video,
28
30
  web,
package/src/data/menus.js CHANGED
@@ -524,6 +524,7 @@ export function buildTopNavMenus(userid = '___USERID___', localLinks = true, way
524
524
  url: `${prefix}/create`,
525
525
  title: 'Upload files',
526
526
  analyticsEvent: 'UserUpload',
527
+ class: 'mobile-upload',
527
528
  },
528
529
  {
529
530
  url: `${prefix}/details/@${userid}`,
@@ -1,7 +1,9 @@
1
1
  import { html, nothing } from 'https://offshoot.prod.archive.org/lit.js';
2
+ import { ifDefined } from 'https://offshoot.prod.archive.org/lit/directives/if-defined.js';
2
3
  import TrackedElement from './tracked-element.js';
3
4
  import dropdownMenuCSS from './styles/dropdown-menu.js';
4
5
  import formatUrl from './lib/formatUrl.js';
6
+ import icons from './assets/img/icons.js';
5
7
 
6
8
  class DropdownMenu extends TrackedElement {
7
9
  static get styles() {
@@ -55,9 +57,11 @@ class DropdownMenu extends TrackedElement {
55
57
  const calloutText = this.config.callouts?.[link.title];
56
58
  return html`<a
57
59
  href="${formatUrl(link.url, this.baseHost)}"
60
+ class="${ifDefined(link.class)}"
58
61
  @click=${this.trackClick}
59
62
  data-event-click-tracking="${this.config.eventCategory}|Nav${link.analyticsEvent}"
60
63
  aria-label=${calloutText ? `New feature: ${link.title}` : nothing}>
64
+ ${link.class === 'mobile-upload' ? icons.uploadUnpadded : nothing}
61
65
  ${link.title}
62
66
  ${calloutText ? html`<span class="callout" aria-hidden="true">${calloutText}</span>` : nothing}
63
67
  </a>`;
@@ -78,6 +78,16 @@ export default css`
78
78
  font-weight: bold;
79
79
  }
80
80
 
81
+ a.mobile-upload {
82
+ display: flex;
83
+ justify-content: left;
84
+ align-items: center;
85
+ }
86
+ a.mobile-upload svg {
87
+ fill: #fff;
88
+ margin-right: 10px;
89
+ }
90
+
81
91
  @media (min-width: 890px) {
82
92
  nav {
83
93
  overflow: visible;
@@ -146,5 +156,9 @@ export default css`
146
156
  opacity: 1;
147
157
  overflow: visible;
148
158
  }
159
+
160
+ a.mobile-upload {
161
+ display: none;
162
+ }
149
163
  }
150
164
  `;