@grantcodes/ui 2.10.0 → 2.10.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.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/components/accordion/accordion.component.js +3 -1
- package/src/components/accordion/accordion.css +47 -42
- package/src/components/accordion/accordion.react.js +4 -4
- package/src/components/app-bar/app-bar.component.js +15 -9
- package/src/components/app-bar/app-bar.css +256 -250
- package/src/components/app-bar/app-bar.react.js +4 -4
- package/src/components/app-bar/app-bar.test.js +1 -3
- package/src/components/app-bar/nav-link.component.js +3 -1
- package/src/components/app-bar/nav-link.css +50 -45
- package/src/components/app-bar/nav-link.react.js +4 -4
- package/src/components/avatar/avatar.css +19 -21
- package/src/components/avatar/avatar.react.js +4 -4
- package/src/components/badge/badge.css +51 -51
- package/src/components/badge/badge.react.js +4 -4
- package/src/components/breadcrumb/breadcrumb.component.js +3 -1
- package/src/components/breadcrumb/breadcrumb.css +73 -73
- package/src/components/breadcrumb/breadcrumb.react.js +8 -5
- package/src/components/button/button.component.js +3 -1
- package/src/components/button/button.css +38 -38
- package/src/components/button/button.react.js +4 -4
- package/src/components/button-group/button-group.css +33 -33
- package/src/components/button-group/button-group.react.js +4 -4
- package/src/components/card/card.css +150 -150
- package/src/components/card/card.react.js +4 -4
- package/src/components/code-preview/code-preview.css +11 -12
- package/src/components/code-preview/code-preview.react.js +4 -4
- package/src/components/container/container.css +37 -37
- package/src/components/container/container.react.js +4 -4
- package/src/components/countdown/countdown.component.js +5 -3
- package/src/components/countdown/countdown.stories.js +1 -2
- package/src/components/cta/cta.css +55 -55
- package/src/components/cta/cta.react.js +4 -4
- package/src/components/dialog/dialog.css +48 -49
- package/src/components/dialog/dialog.react.js +4 -4
- package/src/components/dropdown/dropdown.css +123 -121
- package/src/components/dropdown/dropdown.react.js +5 -5
- package/src/components/dropzone/dropzone.css +5 -3
- package/src/components/dropzone/dropzone.react.js +4 -4
- package/src/components/feature-list/feature-list.css +71 -71
- package/src/components/feature-list/feature-list.react.js +4 -4
- package/src/components/footer/footer-column.css +39 -39
- package/src/components/footer/footer.css +68 -69
- package/src/components/footer/footer.react.js +5 -5
- package/src/components/form-field/form-field.css +40 -40
- package/src/components/form-field/form-field.react.js +4 -4
- package/src/components/gallery/gallery-image.react.js +4 -4
- package/src/components/gallery/gallery.css +72 -72
- package/src/components/gallery/gallery.react.js +4 -4
- package/src/components/gallery/gallery.test.js +5 -1
- package/src/components/hero/hero.css +61 -57
- package/src/components/hero/hero.react.js +4 -4
- package/src/components/icon/icon.css +27 -27
- package/src/components/icon/icon.react.js +4 -4
- package/src/components/loading/loading.css +30 -31
- package/src/components/loading/loading.react.js +4 -4
- package/src/components/logo-cloud/logo-cloud.css +60 -60
- package/src/components/logo-cloud/logo-cloud.react.js +4 -4
- package/src/components/map/map.component.js +3 -4
- package/src/components/map/map.css +36 -36
- package/src/components/media-text/media-text.css +58 -58
- package/src/components/media-text/media-text.react.js +4 -4
- package/src/components/newsletter/newsletter.css +78 -78
- package/src/components/newsletter/newsletter.react.js +4 -4
- package/src/components/notice/notice.css +38 -38
- package/src/components/notice/notice.react.js +4 -4
- package/src/components/pagination/pagination.css +6 -7
- package/src/components/pagination/pagination.react.js +4 -4
- package/src/components/pricing/pricing.css +137 -137
- package/src/components/pricing/pricing.react.js +4 -4
- package/src/components/sidebar/sidebar.component.js +3 -1
- package/src/components/sidebar/sidebar.css +180 -180
- package/src/components/sidebar/sidebar.react.js +4 -4
- package/src/components/stats/stats.css +58 -58
- package/src/components/stats/stats.react.js +4 -4
- package/src/components/tabs/internal/tabs-button.component.js +3 -1
- package/src/components/tabs/internal/tabs-button.react.js +4 -4
- package/src/components/tabs/tab.component.js +3 -1
- package/src/components/tabs/tab.react.js +4 -4
- package/src/components/tabs/tabs.component.js +3 -1
- package/src/components/tabs/tabs.css +82 -82
- package/src/components/tabs/tabs.react.js +4 -4
- package/src/components/testimonials/testimonials.css +72 -72
- package/src/components/testimonials/testimonials.react.js +4 -4
- package/src/components/toast/toast.component.js +3 -1
- package/src/components/toast/toast.css +198 -198
- package/src/components/toast/toast.react.js +5 -5
- package/src/components/tooltip/tooltip.css +52 -51
- package/src/components/tooltip/tooltip.react.js +4 -4
- package/src/css/reset.css +102 -102
- package/src/css/typography.css +13 -11
- package/src/exports.test.js +101 -95
- package/src/lib/styles/all.css +37 -37
- package/src/lib/styles/focus-ring.css +20 -20
- package/src/react.js +45 -39
- package/vite-plugin-css-import-attributes.js +5 -2
|
@@ -1,253 +1,259 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
1
|
+
*,
|
|
2
|
+
*::before,
|
|
3
|
+
*::after {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:host {
|
|
8
|
+
display: block;
|
|
9
|
+
container-type: inline-size;
|
|
10
|
+
container-name: app-bar;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.app-bar {
|
|
14
|
+
background-color: var(--g-theme-color-background-default);
|
|
15
|
+
border-block-end: 1px solid var(--g-theme-color-border-default);
|
|
16
|
+
position: relative;
|
|
17
|
+
z-index: 100;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.app-bar--sticky {
|
|
21
|
+
position: sticky;
|
|
22
|
+
inset-block-start: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.app-bar--transparent {
|
|
26
|
+
background-color: transparent;
|
|
27
|
+
border-block-end-color: transparent;
|
|
28
|
+
box-shadow: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Top bar row — always visible */
|
|
32
|
+
.app-bar__bar {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: var(--g-theme-spacing-lg);
|
|
36
|
+
padding-inline: var(--g-theme-spacing-md);
|
|
37
|
+
padding-block: var(--g-theme-spacing-md);
|
|
38
|
+
max-inline-size: 1400px;
|
|
39
|
+
margin-inline: auto;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Logo */
|
|
43
|
+
.app-bar__logo {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
flex-shrink: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Navigation — hidden on mobile, shown on desktop */
|
|
50
|
+
.app-bar__nav {
|
|
51
|
+
display: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Actions */
|
|
55
|
+
.app-bar__actions {
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
gap: var(--g-theme-spacing-sm);
|
|
59
|
+
margin-inline-start: auto;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Mobile Menu Button */
|
|
63
|
+
.app-bar__menu-button {
|
|
64
|
+
all: unset;
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
inline-size: 2.75rem;
|
|
69
|
+
block-size: 2.75rem;
|
|
70
|
+
padding: var(--g-theme-spacing-sm);
|
|
71
|
+
border-radius: var(--g-theme-border-radius-md);
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
color: var(--g-theme-color-content-default);
|
|
74
|
+
transition: background-color 0.2s ease;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.app-bar__menu-button:hover {
|
|
78
|
+
background-color: var(--g-theme-color-background-subtle-hover);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Hamburger Icon */
|
|
82
|
+
.app-bar__menu-icon {
|
|
83
|
+
display: block;
|
|
84
|
+
inline-size: 1.25rem;
|
|
85
|
+
block-size: 1rem;
|
|
86
|
+
position: relative;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.app-bar__menu-icon::before,
|
|
90
|
+
.app-bar__menu-icon::after {
|
|
91
|
+
content: "";
|
|
92
|
+
position: absolute;
|
|
93
|
+
inline-size: 100%;
|
|
94
|
+
block-size: 2px;
|
|
95
|
+
inset-inline-start: 0;
|
|
96
|
+
background-color: currentColor;
|
|
97
|
+
transition:
|
|
98
|
+
transform 0.2s ease,
|
|
99
|
+
inset 0.2s ease;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.app-bar__menu-icon::before {
|
|
103
|
+
inset-block-start: 0;
|
|
104
|
+
box-shadow: 0 0.4375rem 0 currentColor;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.app-bar__menu-icon::after {
|
|
108
|
+
inset-block-end: 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* Animated hamburger to X */
|
|
112
|
+
.app-bar__menu-button[aria-expanded="true"] .app-bar__menu-icon::before {
|
|
113
|
+
inset-block-start: calc(50% - 1px);
|
|
114
|
+
transform: rotate(45deg);
|
|
115
|
+
box-shadow: none;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.app-bar__menu-button[aria-expanded="true"] .app-bar__menu-icon::after {
|
|
119
|
+
inset-block-end: calc(50% - 1px);
|
|
120
|
+
transform: rotate(-45deg);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/*
|
|
122
124
|
* Mobile menu — full-width panel below the app bar.
|
|
123
125
|
* Uses clip-path for a clean slide-down reveal animation.
|
|
124
126
|
*/
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
127
|
+
.app-bar__nav--open {
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
gap: var(--g-theme-spacing-xs, 0.25rem);
|
|
131
|
+
position: absolute;
|
|
132
|
+
inset-inline: 0;
|
|
133
|
+
inset-block-start: 100%;
|
|
134
|
+
z-index: 99;
|
|
135
|
+
background-color: var(--g-theme-color-background-default);
|
|
136
|
+
border-block-end: 1px solid var(--g-theme-color-border-default);
|
|
137
|
+
padding-block: var(--g-theme-spacing-md);
|
|
138
|
+
padding-inline: var(--g-theme-spacing-md);
|
|
139
|
+
box-shadow: var(--g-theme-shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.12));
|
|
140
|
+
animation: menu-open 0.25s ease-out;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@keyframes menu-open {
|
|
144
|
+
from {
|
|
145
|
+
opacity: 0;
|
|
146
|
+
transform: translateY(-0.5rem);
|
|
147
|
+
}
|
|
148
|
+
to {
|
|
149
|
+
opacity: 1;
|
|
150
|
+
transform: translateY(0);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* Slotted nav content stacks vertically in mobile menu */
|
|
155
|
+
.app-bar__nav--open ::slotted(ul),
|
|
156
|
+
.app-bar__nav--open ::slotted(div[slot="nav"]) {
|
|
157
|
+
display: flex;
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
gap: var(--g-theme-spacing-xs, 0.25rem);
|
|
160
|
+
margin: 0;
|
|
161
|
+
padding: 0;
|
|
162
|
+
list-style: none;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* Backdrop overlay — covers viewport below app bar when menu is open */
|
|
166
|
+
.app-bar__overlay {
|
|
167
|
+
display: none;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.app-bar__overlay--visible {
|
|
171
|
+
display: block;
|
|
172
|
+
position: fixed;
|
|
173
|
+
inset: 0;
|
|
174
|
+
z-index: 98;
|
|
175
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
176
|
+
animation: overlay-fade 0.2s ease-out;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
@keyframes overlay-fade {
|
|
180
|
+
from {
|
|
181
|
+
opacity: 0;
|
|
182
|
+
}
|
|
183
|
+
to {
|
|
184
|
+
opacity: 1;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* Reduced motion preferences */
|
|
189
|
+
@media (prefers-reduced-motion: reduce) {
|
|
190
|
+
.app-bar__menu-icon::before,
|
|
191
|
+
.app-bar__menu-icon::after {
|
|
192
|
+
transition: none;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.app-bar__menu-button {
|
|
196
|
+
transition: none;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.app-bar__nav--open {
|
|
200
|
+
animation: none;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.app-bar__overlay--visible {
|
|
204
|
+
animation: none;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/* Desktop: show nav inline, hide hamburger */
|
|
209
|
+
@container app-bar (min-width: 768px) {
|
|
210
|
+
.app-bar__nav {
|
|
211
|
+
display: flex;
|
|
212
|
+
flex-direction: row;
|
|
213
|
+
align-items: center;
|
|
214
|
+
gap: var(--g-theme-spacing-xs, 0.25rem);
|
|
215
|
+
flex: 1;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/* Reset mobile-open styles at desktop — nav is always inline */
|
|
219
|
+
.app-bar__nav--open {
|
|
220
|
+
position: static;
|
|
221
|
+
background-color: transparent;
|
|
222
|
+
border: 0;
|
|
223
|
+
padding: 0;
|
|
224
|
+
box-shadow: none;
|
|
225
|
+
animation: none;
|
|
226
|
+
flex-direction: row;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.app-bar__actions {
|
|
230
|
+
order: 3;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.app-bar__menu-button {
|
|
234
|
+
display: none;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* Overlay is never visible on desktop */
|
|
238
|
+
.app-bar__overlay--visible {
|
|
239
|
+
display: none;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/* Slotted content styling */
|
|
244
|
+
::slotted(a[slot="logo"]) {
|
|
245
|
+
color: var(--g-theme-color-content-default) !important;
|
|
246
|
+
text-decoration: none !important;
|
|
247
|
+
font-family: var(--g-theme-typography-label-font-family);
|
|
248
|
+
font-weight: var(--g-theme-typography-label-font-weight);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
::slotted(ul),
|
|
252
|
+
::slotted(div[slot="nav"]) {
|
|
253
|
+
display: flex;
|
|
254
|
+
flex-direction: row;
|
|
255
|
+
gap: var(--g-theme-spacing-xs, 0.25rem);
|
|
256
|
+
margin: 0;
|
|
257
|
+
padding: 0;
|
|
258
|
+
list-style: none;
|
|
259
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import { createComponent } from "@lit/react"
|
|
3
|
-
import { GrantCodesAppBar } from "./app-bar.js"
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { createComponent } from "@lit/react";
|
|
3
|
+
import { GrantCodesAppBar } from "./app-bar.js";
|
|
4
4
|
|
|
5
5
|
export const AppBar = createComponent({
|
|
6
6
|
tagName: "grantcodes-app-bar",
|
|
@@ -9,4 +9,4 @@ export const AppBar = createComponent({
|
|
|
9
9
|
events: {
|
|
10
10
|
onMenuToggle: "menu-toggle",
|
|
11
11
|
},
|
|
12
|
-
})
|
|
12
|
+
});
|
|
@@ -113,9 +113,7 @@ describe("App Bar Component", () => {
|
|
|
113
113
|
|
|
114
114
|
await element.updateComplete;
|
|
115
115
|
|
|
116
|
-
const mobileNav = element.shadowRoot.querySelector(
|
|
117
|
-
".app-bar__nav--open",
|
|
118
|
-
);
|
|
116
|
+
const mobileNav = element.shadowRoot.querySelector(".app-bar__nav--open");
|
|
119
117
|
assert.ok(mobileNav, "Mobile nav should be rendered when open");
|
|
120
118
|
});
|
|
121
119
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { LitElement, html } from "lit";
|
|
2
|
-
import focusRingStyles from "../../lib/styles/focus-ring.css" with {
|
|
2
|
+
import focusRingStyles from "../../lib/styles/focus-ring.css" with {
|
|
3
|
+
type: "css",
|
|
4
|
+
};
|
|
3
5
|
import navLinkStyles from "./nav-link.css" with { type: "css" };
|
|
4
6
|
|
|
5
7
|
export class GrantCodesNavLink extends LitElement {
|
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
*,
|
|
2
|
+
*::before,
|
|
3
|
+
*::after {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
}
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
:host {
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
.nav-link {
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
border-radius: var(--g-theme-border-radius-md);
|
|
15
|
+
background-color: transparent;
|
|
16
|
+
transition: background-color 0.15s ease;
|
|
17
|
+
}
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
.nav-link:hover {
|
|
20
|
+
background-color: color-mix(
|
|
21
|
+
in srgb,
|
|
22
|
+
var(--g-theme-color-content-default) 8%,
|
|
23
|
+
transparent
|
|
24
|
+
);
|
|
25
|
+
}
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
/*
|
|
24
28
|
* Override light-DOM :where(a) base styles for slotted links.
|
|
25
29
|
* ::slotted() has lower cascade priority than outer-tree normal rules,
|
|
26
30
|
* so !important is needed for properties that the base layer also sets
|
|
@@ -28,31 +32,32 @@
|
|
|
28
32
|
* use-case — nav links must look like ghost buttons regardless of what
|
|
29
33
|
* global link styles exist in the light DOM.
|
|
30
34
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
35
|
+
::slotted(a),
|
|
36
|
+
::slotted(a:visited),
|
|
37
|
+
::slotted(a:hover),
|
|
38
|
+
::slotted(a:active),
|
|
39
|
+
::slotted(a:focus-visible) {
|
|
40
|
+
display: inline-flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
color: var(--g-theme-color-content-default) !important;
|
|
43
|
+
text-decoration: none !important;
|
|
44
|
+
opacity: 1 !important;
|
|
45
|
+
padding-block: var(--g-theme-spacing-xs, 0.25rem);
|
|
46
|
+
padding-inline: var(--g-theme-spacing-sm);
|
|
47
|
+
font-family: var(--g-theme-typography-label-font-family);
|
|
48
|
+
font-weight: var(--g-theme-typography-label-font-weight);
|
|
49
|
+
white-space: nowrap;
|
|
50
|
+
}
|
|
47
51
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
::slotted(a:focus-visible) {
|
|
53
|
+
outline: var(--g-theme-focus-ring-width-default) solid
|
|
54
|
+
var(--g-theme-focus-ring-color-default);
|
|
55
|
+
outline-offset: var(--g-theme-focus-ring-offset-default);
|
|
56
|
+
border-radius: var(--g-theme-border-radius-md);
|
|
57
|
+
}
|
|
53
58
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
@media (prefers-reduced-motion: reduce) {
|
|
60
|
+
.nav-link {
|
|
61
|
+
transition: none;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import { createComponent } from "@lit/react"
|
|
3
|
-
import { GrantCodesNavLink } from "./nav-link.js"
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { createComponent } from "@lit/react";
|
|
3
|
+
import { GrantCodesNavLink } from "./nav-link.js";
|
|
4
4
|
|
|
5
5
|
export const NavLink = createComponent({
|
|
6
6
|
tagName: "grantcodes-nav-link",
|
|
7
7
|
elementClass: GrantCodesNavLink,
|
|
8
8
|
react: React,
|
|
9
|
-
})
|
|
9
|
+
});
|