@internetarchive/ia-topnav 2.0.0 → 2.0.1-alpha-webdev8396.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 (52) hide show
  1. package/dist/src/data/menus.js.map +1 -1
  2. package/dist/src/dropdown-menu.d.ts +3 -4
  3. package/dist/src/dropdown-menu.js +6 -13
  4. package/dist/src/dropdown-menu.js.map +1 -1
  5. package/dist/src/ia-topnav.d.ts +3 -0
  6. package/dist/src/ia-topnav.js +79 -69
  7. package/dist/src/ia-topnav.js.map +1 -1
  8. package/dist/src/login-button.d.ts +3 -0
  9. package/dist/src/login-button.js +28 -18
  10. package/dist/src/login-button.js.map +1 -1
  11. package/dist/src/models.js.map +1 -1
  12. package/dist/src/primary-nav.d.ts +4 -0
  13. package/dist/src/primary-nav.js +109 -90
  14. package/dist/src/primary-nav.js.map +1 -1
  15. package/dist/src/signed-out-dropdown.d.ts +1 -1
  16. package/dist/src/signed-out-dropdown.js +1 -2
  17. package/dist/src/signed-out-dropdown.js.map +1 -1
  18. package/dist/src/styles/dropdown-menu.js +1 -0
  19. package/dist/src/styles/dropdown-menu.js.map +1 -1
  20. package/dist/src/styles/ia-topnav.js +82 -82
  21. package/dist/src/styles/ia-topnav.js.map +1 -1
  22. package/dist/src/styles/primary-nav.js +353 -353
  23. package/dist/src/styles/primary-nav.js.map +1 -1
  24. package/dist/src/user-menu.d.ts +1 -2
  25. package/dist/src/user-menu.js +1 -2
  26. package/dist/src/user-menu.js.map +1 -1
  27. package/dist/test/ia-topnav.test.js +9 -9
  28. package/dist/test/ia-topnav.test.js.map +1 -1
  29. package/dist/test/primary-nav.test.js +7 -7
  30. package/dist/test/primary-nav.test.js.map +1 -1
  31. package/package.json +1 -1
  32. package/src/data/menus.ts +650 -650
  33. package/src/dropdown-menu.ts +6 -12
  34. package/src/ia-topnav.ts +332 -318
  35. package/src/login-button.ts +89 -78
  36. package/src/models.ts +58 -58
  37. package/src/primary-nav.ts +300 -277
  38. package/src/signed-out-dropdown.ts +1 -2
  39. package/src/styles/dropdown-menu.ts +1 -0
  40. package/src/styles/ia-topnav.ts +85 -85
  41. package/src/styles/primary-nav.ts +356 -356
  42. package/src/user-menu.ts +3 -4
  43. package/test/ia-topnav.test.ts +282 -282
  44. package/test/primary-nav.test.ts +135 -135
  45. package/dist/src/styles/signed-out-dropdown.d.ts +0 -2
  46. package/dist/src/styles/signed-out-dropdown.js +0 -31
  47. package/dist/src/styles/signed-out-dropdown.js.map +0 -1
  48. package/dist/src/styles/user-menu.d.ts +0 -2
  49. package/dist/src/styles/user-menu.js +0 -31
  50. package/dist/src/styles/user-menu.js.map +0 -1
  51. package/src/styles/signed-out-dropdown.ts +0 -31
  52. package/src/styles/user-menu.ts +0 -31
@@ -1,356 +1,356 @@
1
- import { css } from 'lit';
2
-
3
- export default css`
4
- button:focus,
5
- input:focus {
6
- outline: none;
7
- }
8
-
9
- nav {
10
- position: relative;
11
- display: flex;
12
- height: 4rem;
13
- grid-template-areas: 'hamburger empty heart search user';
14
- -ms-grid-columns: 4rem minmax(1rem, 100%) 4rem 4rem 4rem;
15
- grid-template-columns: 4rem auto 4rem 4rem 4rem;
16
- -ms-grid-rows: 100%;
17
- grid-template-rows: 100%;
18
- background: var(--primaryNavBg);
19
- border-bottom: 1px solid var(--primaryNavBottomBorder);
20
- }
21
-
22
- nav.hide-search {
23
- grid-template-areas: 'hamburger empty heart user';
24
- -ms-grid-columns: 4rem minmax(1rem, 100%) 4rem 4rem;
25
- grid-template-columns: 4rem auto 4rem 4rem;
26
- }
27
-
28
- .right-side-section {
29
- display: flex;
30
- margin-left: auto;
31
- user-select: none;
32
- }
33
- button {
34
- background: none;
35
- color: inherit;
36
- border: none;
37
- font: inherit;
38
- cursor: pointer;
39
- }
40
-
41
- .branding {
42
- position: static;
43
- float: left;
44
- margin: 0 !important;
45
- padding: 0 5px 0 10px;
46
- -webkit-transform: translate(0, 0);
47
- -ms-transform: translate(0, 0);
48
- transform: translate(0, 0);
49
- }
50
-
51
- slot,
52
- .branding {
53
- display: flex;
54
- justify-content: left;
55
- align-items: center;
56
- }
57
-
58
- media-menu {
59
- flex: 1;
60
- justify-self: stretch;
61
- }
62
-
63
- .ia-logo {
64
- height: 3rem;
65
- width: 2.7rem;
66
- display: inline-block;
67
- }
68
- .ia-wordmark {
69
- height: 3rem;
70
- width: 9.5rem;
71
- }
72
- .ia-logo,
73
- .ia-wordmark {
74
- margin-right: 5px;
75
- }
76
-
77
- .hamburger {
78
- -ms-grid-row: 1;
79
- -ms-grid-column: 1;
80
- grid-area: hamburger;
81
- padding: 0;
82
- }
83
- .hamburger svg {
84
- height: 4rem;
85
- width: 4rem;
86
- fill: var(--activeColor);
87
- }
88
-
89
- .mobile-donate-link {
90
- display: inline-block;
91
- }
92
- .mobile-donate-link svg {
93
- height: 4rem;
94
- width: 4rem;
95
- }
96
- .mobile-donate-link .fill-color {
97
- fill: rgb(255, 0, 0);
98
- }
99
-
100
- .sr-only {
101
- position: absolute;
102
- width: 1px;
103
- height: 1px;
104
- margin: -1px;
105
- padding: 0;
106
- border: 0;
107
- overflow: hidden;
108
- white-space: nowrap;
109
- clip: rect(1px, 1px, 1px, 1px);
110
- -webkit-clip-path: inset(50%);
111
- clip-path: inset(50%);
112
- user-select: none;
113
- }
114
-
115
- .search-trigger {
116
- padding: 0;
117
- }
118
- .search-trigger svg {
119
- height: 4rem;
120
- width: 4rem;
121
- }
122
- .search-trigger .fill-color {
123
- fill: var(--iconFill);
124
- }
125
-
126
- .search-container {
127
- display: none;
128
- }
129
-
130
- .search-container.open {
131
- display: flex;
132
- position: absolute;
133
- top: 0;
134
- right: 4rem;
135
- bottom: 0;
136
- left: 4rem;
137
- z-index: 3;
138
- padding: 0.5rem;
139
- border-radius: 1rem 1rem 0 0;
140
- background: var(--primaryNavBg);
141
- align-items: center;
142
- animation: fade-in 0.2s forwards;
143
- }
144
-
145
- .search-container ::slotted(*) {
146
- display: block;
147
- }
148
-
149
- .search-container slot {
150
- width: 100%;
151
- }
152
-
153
- @keyframes fade-in {
154
- 0% {
155
- opacity: 0;
156
- }
157
- 100% {
158
- opacity: 1;
159
- }
160
- }
161
-
162
- .upload {
163
- display: none;
164
- }
165
-
166
- .upload span {
167
- display: none;
168
- }
169
-
170
- .upload svg {
171
- height: 3rem;
172
- width: 3rem;
173
- }
174
-
175
- .screen-name {
176
- display: none;
177
- font-size: 1.3rem;
178
- vertical-align: middle;
179
- text-transform: uppercase;
180
- }
181
-
182
- .user-menu {
183
- color: var(--lightTextColor);
184
- padding: 0.5rem;
185
- height: 100%;
186
- }
187
-
188
- button.user-menu:hover,
189
- button.user-menu:focus {
190
- color: var(--linkHoverColor);
191
- outline: none;
192
- }
193
-
194
- .user-menu.active {
195
- border-radius: 1rem 1rem 0 0;
196
- background: var(--activeButtonBg);
197
- }
198
-
199
- .user-menu img {
200
- display: block;
201
- width: 3rem;
202
- height: 3rem;
203
- }
204
-
205
- .link-home {
206
- text-decoration: none;
207
- display: inline-flex;
208
- }
209
- a.link-home:focus,
210
- a.link-home:focus-visible {
211
- outline-offset: 1px;
212
- }
213
-
214
- @media only screen and (min-width: 890px) and (max-device-width: 905px) {
215
- .branding.second-logo {
216
- padding-right: 0;
217
- }
218
- }
219
-
220
- @media (min-width: 906px) {
221
- .branding.second-logo {
222
- padding-right: 20px;
223
- }
224
- }
225
-
226
- @media (max-width: 889px) {
227
- slot[name='opt-sec-logo'] {
228
- display: none;
229
- }
230
-
231
- .right-side-section {
232
- display: initial;
233
- }
234
- .right-side-section .user-info {
235
- float: right;
236
- }
237
- }
238
-
239
- @media (min-width: 890px) {
240
- :host {
241
- --userIconWidth: 3.2rem;
242
- --userIconHeight: 3.2rem;
243
- }
244
-
245
- nav {
246
- display: flex;
247
- z-index: 4;
248
- height: 5rem;
249
- padding-right: 1.5rem;
250
- }
251
-
252
- slot[name='opt-sec-logo-mobile'] {
253
- display: none;
254
- }
255
-
256
- .ia-logo,
257
- .ia-wordmark {
258
- margin-right: 10px;
259
- }
260
-
261
- .hamburger,
262
- .search-trigger,
263
- .mobile-donate-link {
264
- display: none;
265
- }
266
-
267
- .user-info {
268
- display: block;
269
- float: right;
270
- vertical-align: middle;
271
- height: 100%;
272
- }
273
-
274
- .user-info .user-menu img {
275
- height: 3rem;
276
- width: 3rem;
277
- margin-right: 0.5rem;
278
- }
279
-
280
- .user-menu {
281
- padding: 1rem 0.5rem;
282
- }
283
- .user-menu.active {
284
- background: transparent;
285
- }
286
-
287
- .user-menu img {
288
- display: inline-block;
289
- vertical-align: middle;
290
- margin-right: 0.5rem;
291
- }
292
-
293
- .upload {
294
- display: block;
295
- padding: 1rem 0.5rem;
296
- float: right;
297
- font-size: 1.4rem;
298
- text-transform: uppercase;
299
- text-decoration: none;
300
- color: var(--lightTextColor);
301
- }
302
- .upload:active,
303
- .upload:focus,
304
- .upload:hover {
305
- color: var(--linkHoverColor);
306
- }
307
- .upload:focus-visible {
308
- outline: none;
309
- }
310
-
311
- .upload svg {
312
- vertical-align: middle;
313
- fill: var(--iconFill);
314
- }
315
-
316
- .upload:hover svg,
317
- .upload:focus svg,
318
- .upload:active svg {
319
- fill: var(--linkHoverColor);
320
- }
321
-
322
- .search-container,
323
- .search-container.open {
324
- display: flex;
325
- position: static;
326
- top: auto;
327
- right: auto;
328
- bottom: auto;
329
- left: auto;
330
- align-items: center;
331
- padding: 0 0 0 1rem;
332
- background: transparent;
333
- border-radius: 0;
334
- z-index: auto;
335
- }
336
-
337
- .search-container slot {
338
- width: auto;
339
- }
340
- }
341
-
342
- @media (min-width: 990px) {
343
- .screen-name {
344
- display: inline-block;
345
- text-overflow: ellipsis;
346
- overflow: hidden;
347
- white-space: nowrap;
348
- max-width: 165px;
349
- }
350
-
351
- .upload span {
352
- display: inline-block;
353
- vertical-align: middle;
354
- }
355
- }
356
- `;
1
+ import { css } from 'lit';
2
+
3
+ export default css`
4
+ button:focus,
5
+ input:focus {
6
+ outline: none;
7
+ }
8
+
9
+ nav {
10
+ position: relative;
11
+ display: flex;
12
+ height: 4rem;
13
+ grid-template-areas: 'hamburger empty heart search user';
14
+ -ms-grid-columns: 4rem minmax(1rem, 100%) 4rem 4rem 4rem;
15
+ grid-template-columns: 4rem auto 4rem 4rem 4rem;
16
+ -ms-grid-rows: 100%;
17
+ grid-template-rows: 100%;
18
+ background: var(--primaryNavBg);
19
+ border-bottom: 1px solid var(--primaryNavBottomBorder);
20
+ }
21
+
22
+ nav.hide-search {
23
+ grid-template-areas: 'hamburger empty heart user';
24
+ -ms-grid-columns: 4rem minmax(1rem, 100%) 4rem 4rem;
25
+ grid-template-columns: 4rem auto 4rem 4rem;
26
+ }
27
+
28
+ .right-side-section {
29
+ display: flex;
30
+ margin-left: auto;
31
+ user-select: none;
32
+ }
33
+ button {
34
+ background: none;
35
+ color: inherit;
36
+ border: none;
37
+ font: inherit;
38
+ cursor: pointer;
39
+ }
40
+
41
+ .branding {
42
+ position: static;
43
+ float: left;
44
+ margin: 0 !important;
45
+ padding: 0 5px 0 10px;
46
+ -webkit-transform: translate(0, 0);
47
+ -ms-transform: translate(0, 0);
48
+ transform: translate(0, 0);
49
+ }
50
+
51
+ slot,
52
+ .branding {
53
+ display: flex;
54
+ justify-content: left;
55
+ align-items: center;
56
+ }
57
+
58
+ media-menu {
59
+ flex: 1;
60
+ justify-self: stretch;
61
+ }
62
+
63
+ .ia-logo {
64
+ height: 3rem;
65
+ width: 2.7rem;
66
+ display: inline-block;
67
+ }
68
+ .ia-wordmark {
69
+ height: 3rem;
70
+ width: 9.5rem;
71
+ }
72
+ .ia-logo,
73
+ .ia-wordmark {
74
+ margin-right: 5px;
75
+ }
76
+
77
+ .hamburger {
78
+ -ms-grid-row: 1;
79
+ -ms-grid-column: 1;
80
+ grid-area: hamburger;
81
+ padding: 0;
82
+ }
83
+ .hamburger svg {
84
+ height: 4rem;
85
+ width: 4rem;
86
+ fill: var(--activeColor);
87
+ }
88
+
89
+ .mobile-donate-link {
90
+ display: inline-block;
91
+ }
92
+ .mobile-donate-link svg {
93
+ height: 4rem;
94
+ width: 4rem;
95
+ }
96
+ .mobile-donate-link .fill-color {
97
+ fill: rgb(255, 0, 0);
98
+ }
99
+
100
+ .sr-only {
101
+ position: absolute;
102
+ width: 1px;
103
+ height: 1px;
104
+ margin: -1px;
105
+ padding: 0;
106
+ border: 0;
107
+ overflow: hidden;
108
+ white-space: nowrap;
109
+ clip: rect(1px, 1px, 1px, 1px);
110
+ -webkit-clip-path: inset(50%);
111
+ clip-path: inset(50%);
112
+ user-select: none;
113
+ }
114
+
115
+ .search-trigger {
116
+ padding: 0;
117
+ }
118
+ .search-trigger svg {
119
+ height: 4rem;
120
+ width: 4rem;
121
+ }
122
+ .search-trigger .fill-color {
123
+ fill: var(--iconFill);
124
+ }
125
+
126
+ .search-container {
127
+ display: none;
128
+ }
129
+
130
+ .search-container.open {
131
+ display: flex;
132
+ position: absolute;
133
+ top: 0;
134
+ right: 4rem;
135
+ bottom: 0;
136
+ left: 4rem;
137
+ z-index: 3;
138
+ padding: 0.5rem;
139
+ border-radius: 1rem 1rem 0 0;
140
+ background: var(--primaryNavBg);
141
+ align-items: center;
142
+ animation: fade-in 0.2s forwards;
143
+ }
144
+
145
+ .search-container ::slotted(*) {
146
+ display: block;
147
+ }
148
+
149
+ .search-container slot {
150
+ width: 100%;
151
+ }
152
+
153
+ @keyframes fade-in {
154
+ 0% {
155
+ opacity: 0;
156
+ }
157
+ 100% {
158
+ opacity: 1;
159
+ }
160
+ }
161
+
162
+ .upload {
163
+ display: none;
164
+ }
165
+
166
+ .upload span {
167
+ display: none;
168
+ }
169
+
170
+ .upload svg {
171
+ height: 3rem;
172
+ width: 3rem;
173
+ }
174
+
175
+ .screen-name {
176
+ display: none;
177
+ font-size: 1.3rem;
178
+ vertical-align: middle;
179
+ text-transform: uppercase;
180
+ }
181
+
182
+ .user-menu {
183
+ color: var(--lightTextColor);
184
+ padding: 0.5rem;
185
+ height: 100%;
186
+ }
187
+
188
+ button.user-menu:hover,
189
+ button.user-menu:focus {
190
+ color: var(--linkHoverColor);
191
+ outline: none;
192
+ }
193
+
194
+ .user-menu.active {
195
+ border-radius: 1rem 1rem 0 0;
196
+ background: var(--activeButtonBg);
197
+ }
198
+
199
+ .user-menu img {
200
+ display: block;
201
+ width: 3rem;
202
+ height: 3rem;
203
+ }
204
+
205
+ .link-home {
206
+ text-decoration: none;
207
+ display: inline-flex;
208
+ }
209
+ a.link-home:focus,
210
+ a.link-home:focus-visible {
211
+ outline-offset: 1px;
212
+ }
213
+
214
+ @media only screen and (min-width: 890px) and (max-device-width: 905px) {
215
+ .branding.second-logo {
216
+ padding-right: 0;
217
+ }
218
+ }
219
+
220
+ @media (min-width: 906px) {
221
+ .branding.second-logo {
222
+ padding-right: 20px;
223
+ }
224
+ }
225
+
226
+ @media (max-width: 889px) {
227
+ slot[name='opt-sec-logo'] {
228
+ display: none;
229
+ }
230
+
231
+ .right-side-section {
232
+ display: initial;
233
+ }
234
+ .right-side-section .user-info {
235
+ float: right;
236
+ }
237
+ }
238
+
239
+ @media (min-width: 890px) {
240
+ :host {
241
+ --userIconWidth: 3.2rem;
242
+ --userIconHeight: 3.2rem;
243
+ }
244
+
245
+ nav {
246
+ display: flex;
247
+ z-index: 4;
248
+ height: 5rem;
249
+ padding-right: 1.5rem;
250
+ }
251
+
252
+ slot[name='opt-sec-logo-mobile'] {
253
+ display: none;
254
+ }
255
+
256
+ .ia-logo,
257
+ .ia-wordmark {
258
+ margin-right: 10px;
259
+ }
260
+
261
+ .hamburger,
262
+ .search-trigger,
263
+ .mobile-donate-link {
264
+ display: none;
265
+ }
266
+
267
+ .user-info {
268
+ display: block;
269
+ float: right;
270
+ vertical-align: middle;
271
+ height: 100%;
272
+ }
273
+
274
+ .user-info .user-menu img {
275
+ height: 3rem;
276
+ width: 3rem;
277
+ margin-right: 0.5rem;
278
+ }
279
+
280
+ .user-menu {
281
+ padding: 1rem 0.5rem;
282
+ }
283
+ .user-menu.active {
284
+ background: transparent;
285
+ }
286
+
287
+ .user-menu img {
288
+ display: inline-block;
289
+ vertical-align: middle;
290
+ margin-right: 0.5rem;
291
+ }
292
+
293
+ .upload {
294
+ display: block;
295
+ padding: 1rem 0.5rem;
296
+ float: right;
297
+ font-size: 1.4rem;
298
+ text-transform: uppercase;
299
+ text-decoration: none;
300
+ color: var(--lightTextColor);
301
+ }
302
+ .upload:active,
303
+ .upload:focus,
304
+ .upload:hover {
305
+ color: var(--linkHoverColor);
306
+ }
307
+ .upload:focus-visible {
308
+ outline: none;
309
+ }
310
+
311
+ .upload svg {
312
+ vertical-align: middle;
313
+ fill: var(--iconFill);
314
+ }
315
+
316
+ .upload:hover svg,
317
+ .upload:focus svg,
318
+ .upload:active svg {
319
+ fill: var(--linkHoverColor);
320
+ }
321
+
322
+ .search-container,
323
+ .search-container.open {
324
+ display: flex;
325
+ position: static;
326
+ top: auto;
327
+ right: auto;
328
+ bottom: auto;
329
+ left: auto;
330
+ align-items: center;
331
+ padding: 0 0 0 1rem;
332
+ background: transparent;
333
+ border-radius: 0;
334
+ z-index: auto;
335
+ }
336
+
337
+ .search-container slot {
338
+ width: auto;
339
+ }
340
+ }
341
+
342
+ @media (min-width: 990px) {
343
+ .screen-name {
344
+ display: inline-block;
345
+ text-overflow: ellipsis;
346
+ overflow: hidden;
347
+ white-space: nowrap;
348
+ max-width: 165px;
349
+ }
350
+
351
+ .upload span {
352
+ display: inline-block;
353
+ vertical-align: middle;
354
+ }
355
+ }
356
+ `;