@internetarchive/ia-topnav 2.0.1-alpha-webdev8396.0 → 2.0.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.
@@ -1,172 +1,172 @@
1
- import { css } from 'lit';
2
-
3
- export default css`
4
- .nav-container {
5
- position: relative;
6
- }
7
-
8
- nav {
9
- position: absolute;
10
- right: 0;
11
- z-index: 4;
12
- overflow: hidden;
13
- font-size: 1.6rem;
14
- background-color: var(--dropdownMenuBg);
15
- transition-property: top;
16
- transition-duration: 0.2s;
17
- transition-timing-function: ease;
18
- }
19
-
20
- .initial,
21
- .closed {
22
- top: var(--topOffset, -1500px);
23
- }
24
-
25
- .closed {
26
- transition-duration: 0.5s;
27
- }
28
-
29
- .open {
30
- max-width: 100vw;
31
- overflow: auto;
32
- }
33
-
34
- h3 {
35
- padding: 0.6rem 2rem;
36
- margin: 0;
37
- font-size: inherit;
38
- overflow: hidden;
39
- text-overflow: ellipsis;
40
- }
41
-
42
- ul {
43
- padding: 0.4rem 0 0.7rem 0;
44
- margin: 0;
45
- list-style: none;
46
- /* viewport height - nav height + bottom nav border */
47
- max-height: calc(100vh - 7.2rem + 1px);
48
- overflow: auto;
49
- box-sizing: border-box;
50
- }
51
-
52
- .divider {
53
- margin: 0.5rem 0;
54
- border-bottom: 1px solid var(--dropdownMenuDivider);
55
- }
56
-
57
- a,
58
- .info-item {
59
- display: block;
60
- color: var(--primaryTextColor);
61
- text-decoration: none;
62
- padding: 1rem 2rem;
63
- }
64
-
65
- .info-item {
66
- font-size: 0.8em;
67
- color: var(--dropdownMenuInfoItem);
68
- }
69
-
70
- .callout {
71
- position: absolute;
72
- margin-left: 10px;
73
- padding: 0 5px;
74
- border-radius: 2px;
75
- background: #fee257;
76
- color: #2c2c2c;
77
- font-size: 1.4rem;
78
- font-weight: bold;
79
- }
80
-
81
- a.mobile-upload {
82
- display: flex;
83
- justify-content: left;
84
- align-items: center;
85
- }
86
- a.mobile-upload svg {
87
- fill: var(--white);
88
- margin-right: 1rem;
89
- height: 1.4rem;
90
- width: 1.4rem;
91
- }
92
-
93
- @media (min-width: 890px) {
94
- nav {
95
- display: flex;
96
- overflow: visible;
97
- top: 0;
98
- left: auto;
99
- right: var(--dropdownMenuRight, 0);
100
- z-index: 5;
101
- transition: opacity 0.2s ease-in-out;
102
- font-size: 1.4rem;
103
- border-radius: 2px;
104
- background: var(--primaryTextColor);
105
- box-shadow: 0 1px 2px 1px rgba(0, 0, 0, 0.15);
106
- }
107
-
108
- nav:after {
109
- position: absolute;
110
- right: 7px;
111
- top: -7px;
112
- width: 12px;
113
- height: 7px;
114
- box-sizing: border-box;
115
- color: var(--white);
116
- content: '';
117
- border-bottom: 7px solid currentColor;
118
- border-left: 6px solid transparent;
119
- border-right: 6px solid transparent;
120
- }
121
-
122
- h3 {
123
- display: none;
124
- }
125
-
126
- ul {
127
- /* viewport height - nav height + bottom nav border */
128
- max-height: calc(100vh - 8.5rem + 1px);
129
- }
130
-
131
- .divider {
132
- border-bottom-color: var(--dropdownMenuDivider);
133
- }
134
-
135
- a {
136
- padding: 0.5rem 2rem;
137
- color: var(--inverseTextColor);
138
- transition:
139
- background 0.1s ease-out,
140
- color 0.1s ease-out;
141
- }
142
-
143
- .info-item {
144
- padding: 0.5rem 2rem;
145
- font-size: 0.8em;
146
- color: var(--inverseDropdownMenuInfoItem);
147
- }
148
-
149
- a:hover,
150
- a:active,
151
- a:focus {
152
- color: var(--linkHoverColor);
153
- background: var(--linkColor);
154
- outline: none;
155
- }
156
-
157
- .initial,
158
- .closed {
159
- opacity: 0;
160
- transition-duration: 0.2s;
161
- }
162
-
163
- .open {
164
- opacity: 1;
165
- overflow: visible;
166
- }
167
-
168
- a.mobile-upload {
169
- display: none;
170
- }
171
- }
172
- `;
1
+ import { css } from 'lit';
2
+
3
+ export default css`
4
+ .nav-container {
5
+ position: relative;
6
+ }
7
+
8
+ nav {
9
+ position: absolute;
10
+ right: 0;
11
+ z-index: 4;
12
+ overflow: hidden;
13
+ font-size: 1.6rem;
14
+ background-color: var(--dropdownMenuBg);
15
+ transition-property: top;
16
+ transition-duration: 0.2s;
17
+ transition-timing-function: ease;
18
+ }
19
+
20
+ .initial,
21
+ .closed {
22
+ top: var(--topOffset, -1500px);
23
+ }
24
+
25
+ .closed {
26
+ transition-duration: 0.5s;
27
+ }
28
+
29
+ .open {
30
+ max-width: 100vw;
31
+ overflow: auto;
32
+ }
33
+
34
+ h3 {
35
+ padding: 0.6rem 2rem;
36
+ margin: 0;
37
+ font-size: inherit;
38
+ overflow: hidden;
39
+ text-overflow: ellipsis;
40
+ }
41
+
42
+ ul {
43
+ padding: 0.4rem 0 0.7rem 0;
44
+ margin: 0;
45
+ list-style: none;
46
+ /* viewport height - nav height + bottom nav border */
47
+ max-height: calc(100vh - 7.2rem + 1px);
48
+ overflow: auto;
49
+ box-sizing: border-box;
50
+ }
51
+
52
+ .divider {
53
+ margin: 0.5rem 0;
54
+ border-bottom: 1px solid var(--dropdownMenuDivider);
55
+ }
56
+
57
+ a,
58
+ .info-item {
59
+ display: block;
60
+ color: var(--primaryTextColor);
61
+ text-decoration: none;
62
+ padding: 1rem 2rem;
63
+ }
64
+
65
+ .info-item {
66
+ font-size: 0.8em;
67
+ color: var(--dropdownMenuInfoItem);
68
+ }
69
+
70
+ .callout {
71
+ position: absolute;
72
+ margin-left: 10px;
73
+ padding: 0 5px;
74
+ border-radius: 2px;
75
+ background: #fee257;
76
+ color: #2c2c2c;
77
+ font-size: 1.4rem;
78
+ font-weight: bold;
79
+ }
80
+
81
+ a.mobile-upload {
82
+ display: flex;
83
+ justify-content: left;
84
+ align-items: center;
85
+ }
86
+ a.mobile-upload svg {
87
+ fill: var(--white);
88
+ margin-right: 1rem;
89
+ height: 1.4rem;
90
+ width: 1.4rem;
91
+ }
92
+
93
+ @media (min-width: 890px) {
94
+ nav {
95
+ display: flex;
96
+ overflow: visible;
97
+ top: 0;
98
+ left: auto;
99
+ right: var(--dropdownMenuRight, 0);
100
+ z-index: 5;
101
+ transition: opacity 0.2s ease-in-out;
102
+ font-size: 1.4rem;
103
+ border-radius: 2px;
104
+ background: var(--primaryTextColor);
105
+ box-shadow: 0 1px 2px 1px rgba(0, 0, 0, 0.15);
106
+ }
107
+
108
+ nav:after {
109
+ position: absolute;
110
+ right: 7px;
111
+ top: -7px;
112
+ width: 12px;
113
+ height: 7px;
114
+ box-sizing: border-box;
115
+ color: var(--white);
116
+ content: '';
117
+ border-bottom: 7px solid currentColor;
118
+ border-left: 6px solid transparent;
119
+ border-right: 6px solid transparent;
120
+ }
121
+
122
+ h3 {
123
+ display: none;
124
+ }
125
+
126
+ ul {
127
+ /* viewport height - nav height + bottom nav border */
128
+ max-height: calc(100vh - 8.5rem + 1px);
129
+ }
130
+
131
+ .divider {
132
+ border-bottom-color: var(--dropdownMenuDivider);
133
+ }
134
+
135
+ a {
136
+ padding: 0.5rem 2rem;
137
+ color: var(--inverseTextColor);
138
+ transition:
139
+ background 0.1s ease-out,
140
+ color 0.1s ease-out;
141
+ }
142
+
143
+ .info-item {
144
+ padding: 0.5rem 2rem;
145
+ font-size: 0.8em;
146
+ color: var(--inverseDropdownMenuInfoItem);
147
+ }
148
+
149
+ a:hover,
150
+ a:active,
151
+ a:focus {
152
+ color: var(--linkHoverColor);
153
+ background: var(--linkColor);
154
+ outline: none;
155
+ }
156
+
157
+ .initial,
158
+ .closed {
159
+ opacity: 0;
160
+ transition-duration: 0.2s;
161
+ }
162
+
163
+ .open {
164
+ opacity: 1;
165
+ overflow: visible;
166
+ }
167
+
168
+ a.mobile-upload {
169
+ display: none;
170
+ }
171
+ }
172
+ `;
package/src/user-menu.ts CHANGED
@@ -1,31 +1,31 @@
1
- import { html } from 'lit';
2
- import DropdownMenu from './dropdown-menu';
3
- import dropdownStyles from './styles/dropdown-menu';
4
- import { customElement, property } from 'lit/decorators.js';
5
-
6
- @customElement('user-menu')
7
- export default class UserMenu extends DropdownMenu {
8
- @property({ type: String }) username = '';
9
- @property({ type: String }) screenName = '';
10
-
11
- static get styles() {
12
- return dropdownStyles;
13
- }
14
-
15
- render() {
16
- return html`
17
- <div class="nav-container">
18
- <nav
19
- class="${this.menuClass}"
20
- aria-hidden=${!this.open}
21
- aria-expanded=${this.open}
22
- >
23
- <h3>${this.screenName}</h3>
24
- <ul>
25
- ${this.dropdownItems}
26
- </ul>
27
- </nav>
28
- </div>
29
- `;
30
- }
31
- }
1
+ import { CSSResultGroup, html } from 'lit';
2
+ import DropdownMenu from './dropdown-menu';
3
+ import dropdownStyles from './styles/dropdown-menu';
4
+ import { customElement, property } from 'lit/decorators.js';
5
+
6
+ @customElement('user-menu')
7
+ export default class UserMenu extends DropdownMenu {
8
+ @property({ type: String }) username = '';
9
+ @property({ type: String }) screenName = '';
10
+
11
+ static get styles(): CSSResultGroup {
12
+ return dropdownStyles;
13
+ }
14
+
15
+ render() {
16
+ return html`
17
+ <div class="nav-container">
18
+ <nav
19
+ class="${this.menuClass}"
20
+ aria-hidden=${!this.open}
21
+ aria-expanded=${this.open}
22
+ >
23
+ <h3>${this.screenName}</h3>
24
+ <ul>
25
+ ${this.dropdownItems}
26
+ </ul>
27
+ </nav>
28
+ </div>
29
+ `;
30
+ }
31
+ }