@internetarchive/ia-topnav 2.0.1 → 2.0.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.
@@ -1,172 +1,172 @@
1
1
  import { css } from 'lit';
2
- export default css `
3
- .nav-container {
4
- position: relative;
5
- }
6
-
7
- nav {
8
- position: absolute;
9
- right: 0;
10
- z-index: 4;
11
- overflow: hidden;
12
- font-size: 1.6rem;
13
- background-color: var(--dropdownMenuBg);
14
- transition-property: top;
15
- transition-duration: 0.2s;
16
- transition-timing-function: ease;
17
- }
18
-
19
- .initial,
20
- .closed {
21
- top: var(--topOffset, -1500px);
22
- }
23
-
24
- .closed {
25
- transition-duration: 0.5s;
26
- }
27
-
28
- .open {
29
- max-width: 100vw;
30
- overflow: auto;
31
- }
32
-
33
- h3 {
34
- padding: 0.6rem 2rem;
35
- margin: 0;
36
- font-size: inherit;
37
- overflow: hidden;
38
- text-overflow: ellipsis;
39
- }
40
-
41
- ul {
42
- padding: 0.4rem 0 0.7rem 0;
43
- margin: 0;
44
- list-style: none;
45
- /* viewport height - nav height + bottom nav border */
46
- max-height: calc(100vh - 7.2rem + 1px);
47
- overflow: auto;
48
- box-sizing: border-box;
49
- }
50
-
51
- .divider {
52
- margin: 0.5rem 0;
53
- border-bottom: 1px solid var(--dropdownMenuDivider);
54
- }
55
-
56
- a,
57
- .info-item {
58
- display: block;
59
- color: var(--primaryTextColor);
60
- text-decoration: none;
61
- padding: 1rem 2rem;
62
- }
63
-
64
- .info-item {
65
- font-size: 0.8em;
66
- color: var(--dropdownMenuInfoItem);
67
- }
68
-
69
- .callout {
70
- position: absolute;
71
- margin-left: 10px;
72
- padding: 0 5px;
73
- border-radius: 2px;
74
- background: #fee257;
75
- color: #2c2c2c;
76
- font-size: 1.4rem;
77
- font-weight: bold;
78
- }
79
-
80
- a.mobile-upload {
81
- display: flex;
82
- justify-content: left;
83
- align-items: center;
84
- }
85
- a.mobile-upload svg {
86
- fill: var(--white);
87
- margin-right: 1rem;
88
- height: 1.4rem;
89
- width: 1.4rem;
90
- }
91
-
92
- @media (min-width: 890px) {
93
- nav {
94
- display: flex;
95
- overflow: visible;
96
- top: 0;
97
- left: auto;
98
- right: var(--dropdownMenuRight, 0);
99
- z-index: 5;
100
- transition: opacity 0.2s ease-in-out;
101
- font-size: 1.4rem;
102
- border-radius: 2px;
103
- background: var(--primaryTextColor);
104
- box-shadow: 0 1px 2px 1px rgba(0, 0, 0, 0.15);
105
- }
106
-
107
- nav:after {
108
- position: absolute;
109
- right: 7px;
110
- top: -7px;
111
- width: 12px;
112
- height: 7px;
113
- box-sizing: border-box;
114
- color: var(--white);
115
- content: '';
116
- border-bottom: 7px solid currentColor;
117
- border-left: 6px solid transparent;
118
- border-right: 6px solid transparent;
119
- }
120
-
121
- h3 {
122
- display: none;
123
- }
124
-
125
- ul {
126
- /* viewport height - nav height + bottom nav border */
127
- max-height: calc(100vh - 8.5rem + 1px);
128
- }
129
-
130
- .divider {
131
- border-bottom-color: var(--dropdownMenuDivider);
132
- }
133
-
134
- a {
135
- padding: 0.5rem 2rem;
136
- color: var(--inverseTextColor);
137
- transition:
138
- background 0.1s ease-out,
139
- color 0.1s ease-out;
140
- }
141
-
142
- .info-item {
143
- padding: 0.5rem 2rem;
144
- font-size: 0.8em;
145
- color: var(--inverseDropdownMenuInfoItem);
146
- }
147
-
148
- a:hover,
149
- a:active,
150
- a:focus {
151
- color: var(--linkHoverColor);
152
- background: var(--linkColor);
153
- outline: none;
154
- }
155
-
156
- .initial,
157
- .closed {
158
- opacity: 0;
159
- transition-duration: 0.2s;
160
- }
161
-
162
- .open {
163
- opacity: 1;
164
- overflow: visible;
165
- }
166
-
167
- a.mobile-upload {
168
- display: none;
169
- }
170
- }
2
+ export default css `
3
+ .nav-container {
4
+ position: relative;
5
+ }
6
+
7
+ nav {
8
+ position: absolute;
9
+ right: 0;
10
+ z-index: 4;
11
+ overflow: hidden;
12
+ font-size: 1.6rem;
13
+ background-color: var(--dropdownMenuBg);
14
+ transition-property: top;
15
+ transition-duration: 0.2s;
16
+ transition-timing-function: ease;
17
+ }
18
+
19
+ .initial,
20
+ .closed {
21
+ top: var(--topOffset, -1500px);
22
+ }
23
+
24
+ .closed {
25
+ transition-duration: 0.5s;
26
+ }
27
+
28
+ .open {
29
+ max-width: 100vw;
30
+ overflow: auto;
31
+ }
32
+
33
+ h3 {
34
+ padding: 0.6rem 2rem;
35
+ margin: 0;
36
+ font-size: inherit;
37
+ overflow: hidden;
38
+ text-overflow: ellipsis;
39
+ }
40
+
41
+ ul {
42
+ padding: 0.4rem 0 0.7rem 0;
43
+ margin: 0;
44
+ list-style: none;
45
+ /* viewport height - nav height + bottom nav border */
46
+ max-height: calc(100vh - 7.2rem + 1px);
47
+ overflow: auto;
48
+ box-sizing: border-box;
49
+ }
50
+
51
+ .divider {
52
+ margin: 0.5rem 0;
53
+ border-bottom: 1px solid var(--dropdownMenuDivider);
54
+ }
55
+
56
+ a,
57
+ .info-item {
58
+ display: block;
59
+ color: var(--primaryTextColor);
60
+ text-decoration: none;
61
+ padding: 1rem 2rem;
62
+ }
63
+
64
+ .info-item {
65
+ font-size: 0.8em;
66
+ color: var(--dropdownMenuInfoItem);
67
+ }
68
+
69
+ .callout {
70
+ position: absolute;
71
+ margin-left: 10px;
72
+ padding: 0 5px;
73
+ border-radius: 2px;
74
+ background: #fee257;
75
+ color: #2c2c2c;
76
+ font-size: 1.4rem;
77
+ font-weight: bold;
78
+ }
79
+
80
+ a.mobile-upload {
81
+ display: flex;
82
+ justify-content: left;
83
+ align-items: center;
84
+ }
85
+ a.mobile-upload svg {
86
+ fill: var(--white);
87
+ margin-right: 1rem;
88
+ height: 1.4rem;
89
+ width: 1.4rem;
90
+ }
91
+
92
+ @media (min-width: 890px) {
93
+ nav {
94
+ display: flex;
95
+ overflow: visible;
96
+ top: 0;
97
+ left: auto;
98
+ right: var(--dropdownMenuRight, 0);
99
+ z-index: 5;
100
+ transition: opacity 0.2s ease-in-out;
101
+ font-size: 1.4rem;
102
+ border-radius: 2px;
103
+ background: var(--primaryTextColor);
104
+ box-shadow: 0 1px 2px 1px rgba(0, 0, 0, 0.15);
105
+ }
106
+
107
+ nav:after {
108
+ position: absolute;
109
+ right: 7px;
110
+ top: -7px;
111
+ width: 12px;
112
+ height: 7px;
113
+ box-sizing: border-box;
114
+ color: var(--white);
115
+ content: '';
116
+ border-bottom: 7px solid currentColor;
117
+ border-left: 6px solid transparent;
118
+ border-right: 6px solid transparent;
119
+ }
120
+
121
+ h3 {
122
+ display: none;
123
+ }
124
+
125
+ ul {
126
+ /* viewport height - nav height + bottom nav border */
127
+ max-height: calc(100vh - 8.5rem + 1px);
128
+ }
129
+
130
+ .divider {
131
+ border-bottom-color: var(--dropdownMenuDivider);
132
+ }
133
+
134
+ a {
135
+ padding: 0.5rem 2rem;
136
+ color: var(--inverseTextColor);
137
+ transition:
138
+ background 0.1s ease-out,
139
+ color 0.1s ease-out;
140
+ }
141
+
142
+ .info-item {
143
+ padding: 0.5rem 2rem;
144
+ font-size: 0.8em;
145
+ color: var(--inverseDropdownMenuInfoItem);
146
+ }
147
+
148
+ a:hover,
149
+ a:active,
150
+ a:focus {
151
+ color: var(--linkHoverColor);
152
+ background: var(--linkColor);
153
+ outline: none;
154
+ }
155
+
156
+ .initial,
157
+ .closed {
158
+ opacity: 0;
159
+ transition-duration: 0.2s;
160
+ }
161
+
162
+ .open {
163
+ opacity: 1;
164
+ overflow: visible;
165
+ }
166
+
167
+ a.mobile-upload {
168
+ display: none;
169
+ }
170
+ }
171
171
  `;
172
172
  //# sourceMappingURL=dropdown-menu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../src/styles/dropdown-menu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyKjB,CAAC","sourcesContent":["import { css } from 'lit';\r\n\r\nexport default css`\r\n .nav-container {\r\n position: relative;\r\n }\r\n\r\n nav {\r\n position: absolute;\r\n right: 0;\r\n z-index: 4;\r\n overflow: hidden;\r\n font-size: 1.6rem;\r\n background-color: var(--dropdownMenuBg);\r\n transition-property: top;\r\n transition-duration: 0.2s;\r\n transition-timing-function: ease;\r\n }\r\n\r\n .initial,\r\n .closed {\r\n top: var(--topOffset, -1500px);\r\n }\r\n\r\n .closed {\r\n transition-duration: 0.5s;\r\n }\r\n\r\n .open {\r\n max-width: 100vw;\r\n overflow: auto;\r\n }\r\n\r\n h3 {\r\n padding: 0.6rem 2rem;\r\n margin: 0;\r\n font-size: inherit;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n }\r\n\r\n ul {\r\n padding: 0.4rem 0 0.7rem 0;\r\n margin: 0;\r\n list-style: none;\r\n /* viewport height - nav height + bottom nav border */\r\n max-height: calc(100vh - 7.2rem + 1px);\r\n overflow: auto;\r\n box-sizing: border-box;\r\n }\r\n\r\n .divider {\r\n margin: 0.5rem 0;\r\n border-bottom: 1px solid var(--dropdownMenuDivider);\r\n }\r\n\r\n a,\r\n .info-item {\r\n display: block;\r\n color: var(--primaryTextColor);\r\n text-decoration: none;\r\n padding: 1rem 2rem;\r\n }\r\n\r\n .info-item {\r\n font-size: 0.8em;\r\n color: var(--dropdownMenuInfoItem);\r\n }\r\n\r\n .callout {\r\n position: absolute;\r\n margin-left: 10px;\r\n padding: 0 5px;\r\n border-radius: 2px;\r\n background: #fee257;\r\n color: #2c2c2c;\r\n font-size: 1.4rem;\r\n font-weight: bold;\r\n }\r\n\r\n a.mobile-upload {\r\n display: flex;\r\n justify-content: left;\r\n align-items: center;\r\n }\r\n a.mobile-upload svg {\r\n fill: var(--white);\r\n margin-right: 1rem;\r\n height: 1.4rem;\r\n width: 1.4rem;\r\n }\r\n\r\n @media (min-width: 890px) {\r\n nav {\r\n display: flex;\r\n overflow: visible;\r\n top: 0;\r\n left: auto;\r\n right: var(--dropdownMenuRight, 0);\r\n z-index: 5;\r\n transition: opacity 0.2s ease-in-out;\r\n font-size: 1.4rem;\r\n border-radius: 2px;\r\n background: var(--primaryTextColor);\r\n box-shadow: 0 1px 2px 1px rgba(0, 0, 0, 0.15);\r\n }\r\n\r\n nav:after {\r\n position: absolute;\r\n right: 7px;\r\n top: -7px;\r\n width: 12px;\r\n height: 7px;\r\n box-sizing: border-box;\r\n color: var(--white);\r\n content: '';\r\n border-bottom: 7px solid currentColor;\r\n border-left: 6px solid transparent;\r\n border-right: 6px solid transparent;\r\n }\r\n\r\n h3 {\r\n display: none;\r\n }\r\n\r\n ul {\r\n /* viewport height - nav height + bottom nav border */\r\n max-height: calc(100vh - 8.5rem + 1px);\r\n }\r\n\r\n .divider {\r\n border-bottom-color: var(--dropdownMenuDivider);\r\n }\r\n\r\n a {\r\n padding: 0.5rem 2rem;\r\n color: var(--inverseTextColor);\r\n transition:\r\n background 0.1s ease-out,\r\n color 0.1s ease-out;\r\n }\r\n\r\n .info-item {\r\n padding: 0.5rem 2rem;\r\n font-size: 0.8em;\r\n color: var(--inverseDropdownMenuInfoItem);\r\n }\r\n\r\n a:hover,\r\n a:active,\r\n a:focus {\r\n color: var(--linkHoverColor);\r\n background: var(--linkColor);\r\n outline: none;\r\n }\r\n\r\n .initial,\r\n .closed {\r\n opacity: 0;\r\n transition-duration: 0.2s;\r\n }\r\n\r\n .open {\r\n opacity: 1;\r\n overflow: visible;\r\n }\r\n\r\n a.mobile-upload {\r\n display: none;\r\n }\r\n }\r\n`;\r\n"]}
1
+ {"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../src/styles/dropdown-menu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyKjB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport default css`\n .nav-container {\n position: relative;\n }\n\n nav {\n position: absolute;\n right: 0;\n z-index: 4;\n overflow: hidden;\n font-size: 1.6rem;\n background-color: var(--dropdownMenuBg);\n transition-property: top;\n transition-duration: 0.2s;\n transition-timing-function: ease;\n }\n\n .initial,\n .closed {\n top: var(--topOffset, -1500px);\n }\n\n .closed {\n transition-duration: 0.5s;\n }\n\n .open {\n max-width: 100vw;\n overflow: auto;\n }\n\n h3 {\n padding: 0.6rem 2rem;\n margin: 0;\n font-size: inherit;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n ul {\n padding: 0.4rem 0 0.7rem 0;\n margin: 0;\n list-style: none;\n /* viewport height - nav height + bottom nav border */\n max-height: calc(100vh - 7.2rem + 1px);\n overflow: auto;\n box-sizing: border-box;\n }\n\n .divider {\n margin: 0.5rem 0;\n border-bottom: 1px solid var(--dropdownMenuDivider);\n }\n\n a,\n .info-item {\n display: block;\n color: var(--primaryTextColor);\n text-decoration: none;\n padding: 1rem 2rem;\n }\n\n .info-item {\n font-size: 0.8em;\n color: var(--dropdownMenuInfoItem);\n }\n\n .callout {\n position: absolute;\n margin-left: 10px;\n padding: 0 5px;\n border-radius: 2px;\n background: #fee257;\n color: #2c2c2c;\n font-size: 1.4rem;\n font-weight: bold;\n }\n\n a.mobile-upload {\n display: flex;\n justify-content: left;\n align-items: center;\n }\n a.mobile-upload svg {\n fill: var(--white);\n margin-right: 1rem;\n height: 1.4rem;\n width: 1.4rem;\n }\n\n @media (min-width: 890px) {\n nav {\n display: flex;\n overflow: visible;\n top: 0;\n left: auto;\n right: var(--dropdownMenuRight, 0);\n z-index: 5;\n transition: opacity 0.2s ease-in-out;\n font-size: 1.4rem;\n border-radius: 2px;\n background: var(--primaryTextColor);\n box-shadow: 0 1px 2px 1px rgba(0, 0, 0, 0.15);\n }\n\n nav:after {\n position: absolute;\n right: 7px;\n top: -7px;\n width: 12px;\n height: 7px;\n box-sizing: border-box;\n color: var(--white);\n content: '';\n border-bottom: 7px solid currentColor;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n }\n\n h3 {\n display: none;\n }\n\n ul {\n /* viewport height - nav height + bottom nav border */\n max-height: calc(100vh - 8.5rem + 1px);\n }\n\n .divider {\n border-bottom-color: var(--dropdownMenuDivider);\n }\n\n a {\n padding: 0.5rem 2rem;\n color: var(--inverseTextColor);\n transition:\n background 0.1s ease-out,\n color 0.1s ease-out;\n }\n\n .info-item {\n padding: 0.5rem 2rem;\n font-size: 0.8em;\n color: var(--inverseDropdownMenuInfoItem);\n }\n\n a:hover,\n a:active,\n a:focus {\n color: var(--linkHoverColor);\n background: var(--linkColor);\n outline: none;\n }\n\n .initial,\n .closed {\n opacity: 0;\n transition-duration: 0.2s;\n }\n\n .open {\n opacity: 1;\n overflow: visible;\n }\n\n a.mobile-upload {\n display: none;\n }\n }\n`;\n"]}
@@ -13,19 +13,19 @@ let UserMenu = class UserMenu extends DropdownMenu {
13
13
  return dropdownStyles;
14
14
  }
15
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>
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
29
  `;
30
30
  }
31
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"user-menu.js","sourceRoot":"","sources":["../../src/user-menu.ts"],"names":[],"mappings":";AAAA,OAAO,EAAkB,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,cAAc,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7C,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,YAAY;IAAnC;;QACe,aAAQ,GAAG,EAAE,CAAC;QACd,eAAU,GAAG,EAAE,CAAC;IAsB9C,CAAC;IApBC,MAAM,KAAK,MAAM;QACf,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;;;mBAGI,IAAI,CAAC,SAAS;wBACT,CAAC,IAAI,CAAC,IAAI;0BACR,IAAI,CAAC,IAAI;;gBAEnB,IAAI,CAAC,UAAU;;cAEjB,IAAI,CAAC,aAAa;;;;KAI3B,CAAC;IACJ,CAAC;CACF,CAAA;AAvB6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAiB;AAFzB,QAAQ;IAD5B,aAAa,CAAC,WAAW,CAAC;GACN,QAAQ,CAwB5B;eAxBoB,QAAQ","sourcesContent":["import { CSSResultGroup, html } from 'lit';\r\nimport DropdownMenu from './dropdown-menu';\r\nimport dropdownStyles from './styles/dropdown-menu';\r\nimport { customElement, property } from 'lit/decorators.js';\r\n\r\n@customElement('user-menu')\r\nexport default class UserMenu extends DropdownMenu {\r\n @property({ type: String }) username = '';\r\n @property({ type: String }) screenName = '';\r\n\r\n static get styles(): CSSResultGroup {\r\n return dropdownStyles;\r\n }\r\n\r\n render() {\r\n return html`\r\n <div class=\"nav-container\">\r\n <nav\r\n class=\"${this.menuClass}\"\r\n aria-hidden=${!this.open}\r\n aria-expanded=${this.open}\r\n >\r\n <h3>${this.screenName}</h3>\r\n <ul>\r\n ${this.dropdownItems}\r\n </ul>\r\n </nav>\r\n </div>\r\n `;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"user-menu.js","sourceRoot":"","sources":["../../src/user-menu.ts"],"names":[],"mappings":";AAAA,OAAO,EAAkB,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,cAAc,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7C,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,YAAY;IAAnC;;QACe,aAAQ,GAAG,EAAE,CAAC;QACd,eAAU,GAAG,EAAE,CAAC;IAsB9C,CAAC;IApBC,MAAM,KAAK,MAAM;QACf,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;;;mBAGI,IAAI,CAAC,SAAS;wBACT,CAAC,IAAI,CAAC,IAAI;0BACR,IAAI,CAAC,IAAI;;gBAEnB,IAAI,CAAC,UAAU;;cAEjB,IAAI,CAAC,aAAa;;;;KAI3B,CAAC;IACJ,CAAC;CACF,CAAA;AAvB6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAiB;AAFzB,QAAQ;IAD5B,aAAa,CAAC,WAAW,CAAC;GACN,QAAQ,CAwB5B;eAxBoB,QAAQ","sourcesContent":["import { CSSResultGroup, html } from 'lit';\nimport DropdownMenu from './dropdown-menu';\nimport dropdownStyles from './styles/dropdown-menu';\nimport { customElement, property } from 'lit/decorators.js';\n\n@customElement('user-menu')\nexport default class UserMenu extends DropdownMenu {\n @property({ type: String }) username = '';\n @property({ type: String }) screenName = '';\n\n static get styles(): CSSResultGroup {\n return dropdownStyles;\n }\n\n render() {\n return html`\n <div class=\"nav-container\">\n <nav\n class=\"${this.menuClass}\"\n aria-hidden=${!this.open}\n aria-expanded=${this.open}\n >\n <h3>${this.screenName}</h3>\n <ul>\n ${this.dropdownItems}\n </ul>\n </nav>\n </div>\n `;\n }\n}\n"]}
package/eslint.config.mjs CHANGED
@@ -1,53 +1,53 @@
1
- import typescriptEslint from '@typescript-eslint/eslint-plugin';
2
- import html from 'eslint-plugin-html';
3
- import tsParser from '@typescript-eslint/parser';
4
- import path from 'node:path';
5
- import { fileURLToPath } from 'node:url';
6
- import js from '@eslint/js';
7
- import { FlatCompat } from '@eslint/eslintrc';
8
-
9
- const __filename = fileURLToPath(import.meta.url);
10
- const __dirname = path.dirname(__filename);
11
- const compat = new FlatCompat({
12
- baseDirectory: __dirname,
13
- recommendedConfig: js.configs.recommended,
14
- allConfig: js.configs.all,
15
- });
16
-
17
- export default [
18
- ...compat.extends('plugin:@typescript-eslint/recommended'),
19
- {
20
- plugins: {
21
- '@typescript-eslint': typescriptEslint,
22
- html,
23
- },
24
-
25
- languageOptions: {
26
- parser: tsParser,
27
- },
28
-
29
- settings: {
30
- 'import/resolver': {
31
- node: {
32
- extensions: ['.ts', '.tsx'],
33
- moduleDirectory: ['node_modules', 'src', 'demo'],
34
- },
35
- },
36
- },
37
-
38
- rules: {
39
- '@typescript-eslint/no-unsafe-function-type': 'warn',
40
- '@typescript-eslint/no-unused-vars': 'warn',
41
- '@typescript-eslint/no-explicit-any': 'warn',
42
- },
43
- },
44
- {
45
- ignores: ['**/*.js', '**/*.mjs'],
46
- },
47
- {
48
- files: ['**/*.test.ts'],
49
- rules: {
50
- '@typescript-eslint/no-unused-expressions': 'off',
51
- },
52
- },
53
- ];
1
+ import typescriptEslint from '@typescript-eslint/eslint-plugin';
2
+ import html from 'eslint-plugin-html';
3
+ import tsParser from '@typescript-eslint/parser';
4
+ import path from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
6
+ import js from '@eslint/js';
7
+ import { FlatCompat } from '@eslint/eslintrc';
8
+
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = path.dirname(__filename);
11
+ const compat = new FlatCompat({
12
+ baseDirectory: __dirname,
13
+ recommendedConfig: js.configs.recommended,
14
+ allConfig: js.configs.all,
15
+ });
16
+
17
+ export default [
18
+ ...compat.extends('plugin:@typescript-eslint/recommended'),
19
+ {
20
+ plugins: {
21
+ '@typescript-eslint': typescriptEslint,
22
+ html,
23
+ },
24
+
25
+ languageOptions: {
26
+ parser: tsParser,
27
+ },
28
+
29
+ settings: {
30
+ 'import/resolver': {
31
+ node: {
32
+ extensions: ['.ts', '.tsx'],
33
+ moduleDirectory: ['node_modules', 'src', 'demo'],
34
+ },
35
+ },
36
+ },
37
+
38
+ rules: {
39
+ '@typescript-eslint/no-unsafe-function-type': 'warn',
40
+ '@typescript-eslint/no-unused-vars': 'warn',
41
+ '@typescript-eslint/no-explicit-any': 'warn',
42
+ },
43
+ },
44
+ {
45
+ ignores: ['**/*.js', '**/*.mjs'],
46
+ },
47
+ {
48
+ files: ['**/*.test.ts'],
49
+ rules: {
50
+ '@typescript-eslint/no-unused-expressions': 'off',
51
+ },
52
+ },
53
+ ];
package/package.json CHANGED
@@ -1,72 +1,72 @@
1
- {
2
- "name": "@internetarchive/ia-topnav",
3
- "version": "2.0.1",
4
- "description": "Top nav for Internet Archive",
5
- "license": "AGPL-3.0-only",
6
- "main": "dist/index.js",
7
- "module": "dist/index.js",
8
- "types": "dist/index.d.ts",
9
- "type": "module",
10
- "publishConfig": {
11
- "access": "public"
12
- },
13
- "scripts": {
14
- "start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
15
- "prepare": "rimraf dist && tsc && husky install",
16
- "build": "tsc",
17
- "lint": "eslint . && prettier \"**/*.ts\" --check",
18
- "format": "eslint . --fix && prettier \"**/*.ts\" --write",
19
- "circular": "madge --circular --extensions ts .",
20
- "test": "tsc && npm run lint && npm run circular && wtr --coverage",
21
- "test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\"",
22
- "ghpages:build": "rimraf ghpages && npm run prepare && vite build",
23
- "ghpages:publish": "npm run ghpages:prepare -e $(git branch --show-current)",
24
- "ghpages:prepare": "npm run ghpages:build && touch ghpages/.nojekyll && npm run ghpages:generate",
25
- "ghpages:generate": "gh-pages -t -d ghpages -m \"Build for $(git log --pretty=format:\"%h %an %ai %s\" -n1) [skip ci]\""
26
- },
27
- "dependencies": {
28
- "@internetarchive/ia-styles": "^1.0.0",
29
- "@internetarchive/ia-wayback-search": "^1.0.4",
30
- "lit": "^2.8.0"
31
- },
32
- "devDependencies": {
33
- "@open-wc/eslint-config": "^12.0.3",
34
- "@open-wc/testing": "^4.0.0",
35
- "@types/mocha": "^10.0.10",
36
- "@typescript-eslint/eslint-plugin": "^8.19.1",
37
- "@typescript-eslint/parser": "^8.19.1",
38
- "@web/dev-server": "^0.4.6",
39
- "@web/test-runner": "^0.20.0",
40
- "concurrently": "^9.1.2",
41
- "eslint": "^9.24.0",
42
- "eslint-config-prettier": "^10.1.1",
43
- "eslint-plugin-html": "^8.1.2",
44
- "eslint-plugin-import": "^2.31.0",
45
- "eslint-plugin-lit": "^2.0.0",
46
- "eslint-plugin-lit-a11y": "^4.1.4",
47
- "eslint-plugin-no-only-tests": "^3.3.0",
48
- "eslint-plugin-wc": "^3.0.0",
49
- "gh-pages": "^6.3.0",
50
- "husky": "^9.1.7",
51
- "madge": "^8.0.0",
52
- "prettier": "^3.4.2",
53
- "rimraf": "^6.0.1",
54
- "sinon": "^20.0.0",
55
- "ts-lit-plugin": "^2.0.2",
56
- "tslib": "^2.8.1",
57
- "typescript": "^5.7.2",
58
- "vite": "^6.0.7"
59
- },
60
- "husky": {
61
- "hooks": {
62
- "pre-commit": "lint-staged"
63
- }
64
- },
65
- "lint-staged": {
66
- "*.ts": [
67
- "eslint --fix",
68
- "prettier --write",
69
- "git add"
70
- ]
71
- }
72
- }
1
+ {
2
+ "name": "@internetarchive/ia-topnav",
3
+ "version": "2.0.2-alpha2",
4
+ "description": "Top nav for Internet Archive",
5
+ "license": "AGPL-3.0-only",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "type": "module",
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "scripts": {
14
+ "start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
15
+ "prepare": "rimraf dist && tsc && husky install",
16
+ "build": "tsc",
17
+ "lint": "eslint . && prettier \"**/*.ts\" --check",
18
+ "format": "eslint . --fix && prettier \"**/*.ts\" --write",
19
+ "circular": "madge --circular --extensions ts .",
20
+ "test": "tsc && npm run lint && npm run circular && wtr --coverage",
21
+ "test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\"",
22
+ "ghpages:build": "rimraf ghpages && npm run prepare && vite build",
23
+ "ghpages:publish": "npm run ghpages:prepare -e $(git branch --show-current)",
24
+ "ghpages:prepare": "npm run ghpages:build && touch ghpages/.nojekyll && npm run ghpages:generate",
25
+ "ghpages:generate": "gh-pages -t -d ghpages -m \"Build for $(git log --pretty=format:\"%h %an %ai %s\" -n1) [skip ci]\""
26
+ },
27
+ "dependencies": {
28
+ "@internetarchive/ia-styles": "^1.0.0",
29
+ "@internetarchive/ia-wayback-search": "^1.0.4",
30
+ "lit": "^2.8.0"
31
+ },
32
+ "devDependencies": {
33
+ "@open-wc/eslint-config": "^12.0.3",
34
+ "@open-wc/testing": "^4.0.0",
35
+ "@types/mocha": "^10.0.10",
36
+ "@typescript-eslint/eslint-plugin": "^8.19.1",
37
+ "@typescript-eslint/parser": "^8.19.1",
38
+ "@web/dev-server": "^0.4.6",
39
+ "@web/test-runner": "^0.20.0",
40
+ "concurrently": "^9.1.2",
41
+ "eslint": "^9.24.0",
42
+ "eslint-config-prettier": "^10.1.1",
43
+ "eslint-plugin-html": "^8.1.2",
44
+ "eslint-plugin-import": "^2.31.0",
45
+ "eslint-plugin-lit": "^2.0.0",
46
+ "eslint-plugin-lit-a11y": "^4.1.4",
47
+ "eslint-plugin-no-only-tests": "^3.3.0",
48
+ "eslint-plugin-wc": "^3.0.0",
49
+ "gh-pages": "^6.3.0",
50
+ "husky": "^9.1.7",
51
+ "madge": "^8.0.0",
52
+ "prettier": "^3.4.2",
53
+ "rimraf": "^6.0.1",
54
+ "sinon": "^20.0.0",
55
+ "ts-lit-plugin": "^2.0.2",
56
+ "tslib": "^2.8.1",
57
+ "typescript": "^5.7.2",
58
+ "vite": "^6.0.7"
59
+ },
60
+ "husky": {
61
+ "hooks": {
62
+ "pre-commit": "lint-staged"
63
+ }
64
+ },
65
+ "lint-staged": {
66
+ "*.ts": [
67
+ "eslint --fix",
68
+ "prettier --write",
69
+ "git add"
70
+ ]
71
+ }
72
+ }