@grantcodes/ui 2.0.2 → 2.1.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 +15 -0
- package/custom-elements.json +1926 -191
- package/package.json +22 -21
- package/src/components/accordion/accordion.component.js +33 -0
- package/src/components/accordion/accordion.js +6 -0
- package/src/components/accordion/accordion.stories.js +88 -0
- package/src/components/accordion/accordion.styles.js +66 -0
- package/src/components/accordion/index.js +6 -0
- package/src/components/app-bar/app-bar.component.js +1 -3
- package/src/components/app-bar/app-bar.js +0 -2
- package/src/components/app-bar/app-bar.styles.js +222 -221
- package/src/components/app-bar/app-bar.test.js +58 -17
- package/src/components/app-bar/index.js +0 -2
- package/src/components/avatar/avatar.js +0 -12
- package/src/components/avatar/avatar.stories.js +0 -12
- package/src/components/avatar/avatar.styles.js +19 -19
- package/src/components/avatar/avatar.test.js +4 -4
- package/src/components/avatar/index.js +1 -13
- package/src/components/badge/badge.js +0 -2
- package/src/components/badge/badge.styles.js +78 -81
- package/src/components/badge/badge.test.js +18 -5
- package/src/components/badge/index.js +0 -2
- package/src/components/breadcrumb/breadcrumb.component.js +9 -10
- package/src/components/breadcrumb/breadcrumb.js +6 -4
- package/src/components/breadcrumb/breadcrumb.styles.js +86 -90
- package/src/components/breadcrumb/breadcrumb.test.js +15 -5
- package/src/components/breadcrumb/index.js +0 -2
- package/src/components/button/button.component.js +2 -2
- package/src/components/button/button.styles.js +58 -86
- package/src/components/button/button.test.js +8 -4
- package/src/components/button/index.js +1 -1
- package/src/components/button-group/button-group.test.js +0 -2
- package/src/components/button-group/index.js +1 -1
- package/src/components/card/card.component.js +40 -9
- package/src/components/card/card.js +3 -1
- package/src/components/card/card.stories.js +18 -5
- package/src/components/card/card.styles.js +46 -20
- package/src/components/card/card.test.js +0 -2
- package/src/components/card/index.js +1 -1
- package/src/components/code-preview/code-preview.component.js +9 -9
- package/src/components/code-preview/code-preview.js +0 -1
- package/src/components/code-preview/code-preview.styles.js +3 -3
- package/src/components/code-preview/code-preview.test.js +29 -8
- package/src/components/code-preview/index.js +1 -1
- package/src/components/container/container.component.js +1 -0
- package/src/components/container/container.js +0 -1
- package/src/components/container/container.stories.js +12 -4
- package/src/components/container/container.styles.js +37 -35
- package/src/components/container/container.test.js +0 -2
- package/src/components/container/index.js +1 -1
- package/src/components/cta/cta.component.js +108 -0
- package/src/components/cta/cta.js +6 -0
- package/src/components/cta/cta.stories.js +56 -0
- package/src/components/cta/cta.styles.js +64 -0
- package/src/components/cta/index.js +1 -0
- package/src/components/dialog/dialog.js +0 -1
- package/src/components/dialog/dialog.styles.js +8 -8
- package/src/components/dialog/dialog.test.js +11 -5
- package/src/components/dialog/index.js +1 -1
- package/src/components/dropdown/dropdown.component.js +5 -3
- package/src/components/dropdown/dropdown.js +6 -4
- package/src/components/dropdown/dropdown.styles.js +5 -5
- package/src/components/dropdown/dropdown.test.js +20 -4
- package/src/components/dropdown/index.js +0 -2
- package/src/components/dropzone/dropzone.component.js +7 -6
- package/src/components/dropzone/dropzone.styles.js +4 -4
- package/src/components/dropzone/dropzone.test.js +6 -4
- package/src/components/dropzone/index.js +1 -1
- package/src/components/feature-list/feature-list.component.js +130 -0
- package/src/components/feature-list/feature-list.js +6 -0
- package/src/components/feature-list/feature-list.stories.js +117 -0
- package/src/components/feature-list/feature-list.styles.js +82 -0
- package/src/components/feature-list/index.js +1 -0
- package/src/components/footer/footer-column.styles.js +46 -47
- package/src/components/footer/footer.js +6 -2
- package/src/components/footer/footer.styles.js +6 -6
- package/src/components/footer/footer.test.js +9 -4
- package/src/components/footer/index.js +1 -1
- package/src/components/form-field/form-field.component.js +1 -3
- package/src/components/form-field/form-field.js +0 -1
- package/src/components/form-field/form-field.styles.js +35 -37
- package/src/components/form-field/form-field.test.js +9 -4
- package/src/components/form-field/index.js +1 -1
- package/src/components/gallery/gallery-image.js +0 -1
- package/src/components/gallery/gallery.js +0 -1
- package/src/components/gallery/gallery.styles.js +1 -1
- package/src/components/gallery/gallery.test.js +5 -3
- package/src/components/gallery/index.js +2 -2
- package/src/components/hero/hero.component.js +66 -0
- package/src/components/hero/hero.js +6 -0
- package/src/components/hero/hero.stories.js +53 -0
- package/src/components/hero/hero.styles.js +46 -0
- package/src/components/hero/index.js +1 -0
- package/src/components/icon/icon.js +3 -2
- package/src/components/icon/icon.stories.js +2 -1
- package/src/components/icon/icon.styles.js +23 -21
- package/src/components/icon/icon.test.js +2 -3
- package/src/components/icon/index.js +1 -1
- package/src/components/loading/index.js +1 -1
- package/src/components/loading/loading.js +3 -2
- package/src/components/loading/loading.styles.js +1 -1
- package/src/components/loading/loading.test.js +0 -2
- package/src/components/logo-cloud/index.js +1 -0
- package/src/components/logo-cloud/logo-cloud.component.js +81 -0
- package/src/components/logo-cloud/logo-cloud.js +6 -0
- package/src/components/logo-cloud/logo-cloud.stories.js +107 -0
- package/src/components/logo-cloud/logo-cloud.styles.js +68 -0
- package/src/components/media-text/index.js +1 -0
- package/src/components/media-text/media-text.component.js +100 -0
- package/src/components/media-text/media-text.js +6 -0
- package/src/components/media-text/media-text.stories.js +69 -0
- package/src/components/media-text/media-text.styles.js +66 -0
- package/src/components/newsletter/index.js +1 -0
- package/src/components/newsletter/newsletter.component.js +101 -0
- package/src/components/newsletter/newsletter.js +6 -0
- package/src/components/newsletter/newsletter.stories.js +59 -0
- package/src/components/newsletter/newsletter.styles.js +89 -0
- package/src/components/notice/index.js +1 -1
- package/src/components/notice/notice.js +0 -1
- package/src/components/notice/notice.styles.js +7 -7
- package/src/components/notice/notice.test.js +15 -5
- package/src/components/pagination/index.js +1 -1
- package/src/components/pagination/pagination.stories.js +1 -3
- package/src/components/pagination/pagination.styles.js +1 -1
- package/src/components/pagination/pagination.test.js +9 -4
- package/src/components/pricing/index.js +1 -0
- package/src/components/pricing/pricing.component.js +119 -0
- package/src/components/pricing/pricing.js +6 -0
- package/src/components/pricing/pricing.stories.js +123 -0
- package/src/components/pricing/pricing.styles.js +135 -0
- package/src/components/sidebar/index.js +0 -2
- package/src/components/sidebar/sidebar.component.js +12 -10
- package/src/components/sidebar/sidebar.js +3 -3
- package/src/components/sidebar/sidebar.stories.js +0 -2
- package/src/components/sidebar/sidebar.styles.js +181 -186
- package/src/components/sidebar/sidebar.test.js +48 -13
- package/src/components/stats/index.js +1 -0
- package/src/components/stats/stats.component.js +73 -0
- package/src/components/stats/stats.js +6 -0
- package/src/components/stats/stats.stories.js +64 -0
- package/src/components/stats/stats.styles.js +66 -0
- package/src/components/tabs/index.js +2 -2
- package/src/components/tabs/internal/tabs-button.component.js +1 -1
- package/src/components/tabs/internal/tabs-button.js +0 -1
- package/src/components/tabs/tab.js +0 -1
- package/src/components/tabs/tabs.js +3 -2
- package/src/components/tabs/tabs.styles.js +84 -74
- package/src/components/testimonials/index.js +1 -0
- package/src/components/testimonials/testimonials.component.js +97 -0
- package/src/components/testimonials/testimonials.js +6 -0
- package/src/components/testimonials/testimonials.stories.js +78 -0
- package/src/components/testimonials/testimonials.styles.js +82 -0
- package/src/components/toast/index.js +0 -2
- package/src/components/toast/toast.component.js +1 -3
- package/src/components/toast/toast.js +10 -5
- package/src/components/toast/toast.stories.js +9 -5
- package/src/components/toast/toast.styles.js +199 -201
- package/src/components/toast/toast.test.js +38 -10
- package/src/components/tooltip/index.js +1 -1
- package/src/components/tooltip/tooltip.js +3 -2
- package/src/components/tooltip/tooltip.styles.js +3 -3
- package/src/components/tooltip/tooltip.test.js +10 -4
- package/src/css/base.css +8 -5
- package/src/css/colors.stories.js +27 -28
- package/src/css/elements/forms/input.css +9 -41
- package/src/css/elements/media/image.css +1 -1
- package/src/css/themes/todomap.css +1 -0
- package/src/css/tokens.stories.js +26 -21
- package/src/css/typography.css +1 -3
- package/src/css/util/focus-ring.css +30 -0
- package/src/css/util/index.css +1 -2
- package/src/lib/styles/focus-ring.styles.js +34 -0
- package/src/main.js +10 -1
- package/src/pages/agency.stories.js +164 -0
- package/src/pages/blog-post.stories.js +381 -0
- package/src/pages/saas-landing.stories.js +307 -0
- package/src/test-utils/assert-helpers.js +10 -8
- package/src/css/util/functions.css +0 -16
- package/src/css/util/mixins.css +0 -63
|
@@ -1,227 +1,228 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
|
+
import { focusRingStyles } from "../../lib/styles/focus-ring.styles.js";
|
|
2
3
|
|
|
3
4
|
export const appBarStyles = css`
|
|
4
|
-
|
|
5
|
+
${focusRingStyles}
|
|
6
|
+
|
|
7
|
+
*,
|
|
5
8
|
*::before,
|
|
6
9
|
*::after {
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
outline-offset: 2px;
|
|
226
|
-
}
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:host {
|
|
14
|
+
display: block;
|
|
15
|
+
container-type: inline-size;
|
|
16
|
+
container-name: app-bar;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.app-bar {
|
|
20
|
+
background-color: var(--g-theme-color-background-default);
|
|
21
|
+
border-block-end: 1px solid var(--g-theme-color-border-default);
|
|
22
|
+
position: sticky;
|
|
23
|
+
inset-block-start: 0;
|
|
24
|
+
z-index: 100;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.app-bar--transparent {
|
|
28
|
+
background-color: transparent;
|
|
29
|
+
border-block-end-color: transparent;
|
|
30
|
+
box-shadow: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.app-bar__container {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: var(--g-theme-spacing-lg);
|
|
37
|
+
padding-inline: var(--g-theme-spacing-md);
|
|
38
|
+
padding-block: var(--g-theme-spacing-md);
|
|
39
|
+
max-inline-size: 1400px;
|
|
40
|
+
margin-inline: auto;
|
|
41
|
+
flex-wrap: wrap;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Logo */
|
|
45
|
+
.app-bar__logo {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
flex-shrink: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Navigation */
|
|
52
|
+
.app-bar__nav {
|
|
53
|
+
display: none;
|
|
54
|
+
flex: 1;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: var(--g-theme-spacing-lg);
|
|
57
|
+
order: 5;
|
|
58
|
+
inline-size: 100%;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Mobile: when menu is open, show nav stacked vertically */
|
|
62
|
+
.app-bar__nav--mobile-open {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
gap: var(--g-theme-spacing-sm);
|
|
66
|
+
padding-inline: var(--g-theme-spacing-md);
|
|
67
|
+
padding-block: var(--g-theme-spacing-md);
|
|
68
|
+
border-block-start: 1px solid var(--g-theme-color-border-default);
|
|
69
|
+
width: 100%;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Show nav on larger screens using container queries */
|
|
73
|
+
@container app-bar (min-width: 768px) {
|
|
74
|
+
.app-bar__nav {
|
|
75
|
+
display: flex;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Actions */
|
|
80
|
+
.app-bar__actions {
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
gap: var(--g-spacing-12);
|
|
84
|
+
margin-inline-start: auto;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Mobile Menu Button */
|
|
88
|
+
.app-bar__menu-button {
|
|
89
|
+
all: unset;
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
inline-size: 2.5rem;
|
|
94
|
+
block-size: 2.5rem;
|
|
95
|
+
padding: var(--g-theme-spacing-sm);
|
|
96
|
+
border-radius: var(--g-theme-border-radius-md);
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
color: var(--g-theme-color-content-default);
|
|
99
|
+
transition: background-color 0.2s ease;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.app-bar__menu-button:hover {
|
|
103
|
+
background-color: var(--g-theme-color-background-subtle-hover);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* Hide menu button on larger screens */
|
|
107
|
+
@container app-bar (min-width: 768px) {
|
|
108
|
+
.app-bar__menu-button {
|
|
109
|
+
display: none;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* Hamburger Icon */
|
|
114
|
+
.app-bar__menu-icon {
|
|
115
|
+
display: block;
|
|
116
|
+
inline-size: 1.5rem;
|
|
117
|
+
block-size: 1.5rem;
|
|
118
|
+
position: relative;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.app-bar__menu-icon::before,
|
|
122
|
+
.app-bar__menu-icon::after {
|
|
123
|
+
content: "";
|
|
124
|
+
position: absolute;
|
|
125
|
+
inline-size: 100%;
|
|
126
|
+
block-size: 2px;
|
|
127
|
+
inset-inline-start: 0;
|
|
128
|
+
background-color: currentColor;
|
|
129
|
+
transition: transform 0.2s ease;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.app-bar__menu-icon::before {
|
|
133
|
+
inset-block-start: 0.25rem;
|
|
134
|
+
box-shadow: 0 0.5rem 0 currentColor;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.app-bar__menu-icon::after {
|
|
138
|
+
inset-block-end: 0.25rem;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Animated hamburger to X */
|
|
142
|
+
.app-bar__menu-button[aria-expanded="true"] .app-bar__menu-icon::before {
|
|
143
|
+
inset-block-start: 0.5rem;
|
|
144
|
+
transform: rotate(45deg);
|
|
145
|
+
box-shadow: none;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.app-bar__menu-button[aria-expanded="true"] .app-bar__menu-icon::after {
|
|
149
|
+
inset-block-end: 0.5rem;
|
|
150
|
+
transform: rotate(-45deg);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* Mobile Navigation */
|
|
154
|
+
.app-bar__mobile-nav {
|
|
155
|
+
display: flex;
|
|
156
|
+
flex-direction: column;
|
|
157
|
+
gap: var(--g-theme-spacing-sm);
|
|
158
|
+
padding-inline: var(--g-theme-spacing-md);
|
|
159
|
+
padding-block: var(--g-theme-spacing-md);
|
|
160
|
+
border-block-start: 1px solid var(--g-theme-color-border-default);
|
|
161
|
+
animation: slide-down 0.2s ease-out;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* Desktop: show nav inline and reset mobile styles */
|
|
165
|
+
@container app-bar (min-width: 768px) {
|
|
166
|
+
.app-bar__container {
|
|
167
|
+
flex-wrap: nowrap;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.app-bar__nav {
|
|
171
|
+
display: flex;
|
|
172
|
+
flex-direction: row;
|
|
173
|
+
gap: var(--g-theme-spacing-lg);
|
|
174
|
+
padding: 0;
|
|
175
|
+
border: 0;
|
|
176
|
+
width: auto;
|
|
177
|
+
order: 2;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.app-bar__actions {
|
|
181
|
+
order: 3;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.app-bar__menu-button {
|
|
185
|
+
order: 4;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* Ensure mobile-open class doesn't affect desktop */
|
|
189
|
+
.app-bar__nav--mobile-open {
|
|
190
|
+
display: flex;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@keyframes slide-down {
|
|
195
|
+
from {
|
|
196
|
+
opacity: 0;
|
|
197
|
+
transform: translateY(-0.5rem);
|
|
198
|
+
}
|
|
199
|
+
to {
|
|
200
|
+
opacity: 1;
|
|
201
|
+
transform: translateY(0);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* Slotted content styling helpers */
|
|
206
|
+
::slotted(a) {
|
|
207
|
+
color: var(--g-theme-color-content-default);
|
|
208
|
+
text-decoration: none;
|
|
209
|
+
padding-block: var(--g-theme-spacing-sm);
|
|
210
|
+
padding-inline: var(--g-spacing-12);
|
|
211
|
+
border-radius: var(--g-theme-border-radius-md);
|
|
212
|
+
transition: all 0.2s ease;
|
|
213
|
+
font-weight: var(--g-typography-font-weight-500);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
::slotted(a:hover) {
|
|
217
|
+
color: var(--g-theme-color-content-default);
|
|
218
|
+
background-color: var(--g-theme-color-background-subtle-hover);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
::slotted(ul) {
|
|
222
|
+
display: flex;
|
|
223
|
+
flex-direction: row;
|
|
224
|
+
margin: 0;
|
|
225
|
+
padding: 0;
|
|
226
|
+
list-style: none;
|
|
227
|
+
}
|
|
227
228
|
`;
|
|
@@ -18,12 +18,20 @@ describe("App Bar Component", () => {
|
|
|
18
18
|
|
|
19
19
|
it("should not be sticky by default", async () => {
|
|
20
20
|
element = await fixture("grantcodes-app-bar");
|
|
21
|
-
assert.strictEqual(
|
|
21
|
+
assert.strictEqual(
|
|
22
|
+
element.sticky,
|
|
23
|
+
false,
|
|
24
|
+
"Should not be sticky by default",
|
|
25
|
+
);
|
|
22
26
|
});
|
|
23
27
|
|
|
24
28
|
it("should not be transparent by default", async () => {
|
|
25
29
|
element = await fixture("grantcodes-app-bar");
|
|
26
|
-
assert.strictEqual(
|
|
30
|
+
assert.strictEqual(
|
|
31
|
+
element.transparent,
|
|
32
|
+
false,
|
|
33
|
+
"Should not be transparent by default",
|
|
34
|
+
);
|
|
27
35
|
});
|
|
28
36
|
|
|
29
37
|
it("should render header element", async () => {
|
|
@@ -64,19 +72,27 @@ describe("App Bar Component", () => {
|
|
|
64
72
|
|
|
65
73
|
it("should have actions slot", async () => {
|
|
66
74
|
element = await fixture("grantcodes-app-bar");
|
|
67
|
-
const actionsSlot = element.shadowRoot.querySelector(
|
|
75
|
+
const actionsSlot = element.shadowRoot.querySelector(
|
|
76
|
+
'slot[name="actions"]',
|
|
77
|
+
);
|
|
68
78
|
assert.ok(actionsSlot, "Actions slot should exist");
|
|
69
79
|
});
|
|
70
80
|
|
|
71
81
|
it("should render mobile menu button", async () => {
|
|
72
82
|
element = await fixture("grantcodes-app-bar");
|
|
73
|
-
const menuButton = element.shadowRoot.querySelector(
|
|
83
|
+
const menuButton = element.shadowRoot.querySelector(
|
|
84
|
+
".app-bar__menu-button",
|
|
85
|
+
);
|
|
74
86
|
assert.ok(menuButton, "Mobile menu button should exist");
|
|
75
87
|
});
|
|
76
88
|
|
|
77
89
|
it("should have mobile menu closed by default", async () => {
|
|
78
90
|
element = await fixture("grantcodes-app-bar");
|
|
79
|
-
assert.strictEqual(
|
|
91
|
+
assert.strictEqual(
|
|
92
|
+
element._mobileMenuOpen,
|
|
93
|
+
false,
|
|
94
|
+
"Mobile menu should be closed by default",
|
|
95
|
+
);
|
|
80
96
|
});
|
|
81
97
|
|
|
82
98
|
it("should not render mobile nav when closed", async () => {
|
|
@@ -91,25 +107,37 @@ describe("App Bar Component", () => {
|
|
|
91
107
|
|
|
92
108
|
await element.updateComplete;
|
|
93
109
|
|
|
94
|
-
const mobileNav = element.shadowRoot.querySelector(
|
|
110
|
+
const mobileNav = element.shadowRoot.querySelector(
|
|
111
|
+
".app-bar__nav--mobile-open",
|
|
112
|
+
);
|
|
95
113
|
assert.ok(mobileNav, "Mobile nav should be rendered when open");
|
|
96
114
|
});
|
|
97
115
|
|
|
98
116
|
it("should toggle mobile menu when button is clicked", async () => {
|
|
99
117
|
element = await fixture("grantcodes-app-bar");
|
|
100
|
-
const menuButton = element.shadowRoot.querySelector(
|
|
118
|
+
const menuButton = element.shadowRoot.querySelector(
|
|
119
|
+
".app-bar__menu-button",
|
|
120
|
+
);
|
|
101
121
|
|
|
102
122
|
assert.strictEqual(element._mobileMenuOpen, false, "Should start closed");
|
|
103
123
|
|
|
104
124
|
click(menuButton);
|
|
105
125
|
await element.updateComplete;
|
|
106
126
|
|
|
107
|
-
assert.strictEqual(
|
|
127
|
+
assert.strictEqual(
|
|
128
|
+
element._mobileMenuOpen,
|
|
129
|
+
true,
|
|
130
|
+
"Should be open after click",
|
|
131
|
+
);
|
|
108
132
|
|
|
109
133
|
click(menuButton);
|
|
110
134
|
await element.updateComplete;
|
|
111
135
|
|
|
112
|
-
assert.strictEqual(
|
|
136
|
+
assert.strictEqual(
|
|
137
|
+
element._mobileMenuOpen,
|
|
138
|
+
false,
|
|
139
|
+
"Should be closed after second click",
|
|
140
|
+
);
|
|
113
141
|
});
|
|
114
142
|
|
|
115
143
|
it("should emit menu-toggle event when menu is toggled", async () => {
|
|
@@ -120,23 +148,36 @@ describe("App Bar Component", () => {
|
|
|
120
148
|
toggledState = e.detail.open;
|
|
121
149
|
});
|
|
122
150
|
|
|
123
|
-
const menuButton = element.shadowRoot.querySelector(
|
|
151
|
+
const menuButton = element.shadowRoot.querySelector(
|
|
152
|
+
".app-bar__menu-button",
|
|
153
|
+
);
|
|
124
154
|
click(menuButton);
|
|
125
155
|
|
|
126
156
|
await element.updateComplete;
|
|
127
157
|
|
|
128
|
-
assert.strictEqual(
|
|
158
|
+
assert.strictEqual(
|
|
159
|
+
toggledState,
|
|
160
|
+
true,
|
|
161
|
+
"Toggle event should fire with open state",
|
|
162
|
+
);
|
|
129
163
|
});
|
|
130
164
|
|
|
131
165
|
it("should have aria-label on menu button", async () => {
|
|
132
166
|
element = await fixture("grantcodes-app-bar");
|
|
133
|
-
const menuButton = element.shadowRoot.querySelector(
|
|
134
|
-
|
|
167
|
+
const menuButton = element.shadowRoot.querySelector(
|
|
168
|
+
".app-bar__menu-button",
|
|
169
|
+
);
|
|
170
|
+
assert.ok(
|
|
171
|
+
menuButton.hasAttribute("aria-label"),
|
|
172
|
+
"Menu button should have aria-label",
|
|
173
|
+
);
|
|
135
174
|
});
|
|
136
175
|
|
|
137
176
|
it("should have aria-expanded on menu button", async () => {
|
|
138
177
|
element = await fixture("grantcodes-app-bar");
|
|
139
|
-
const menuButton = element.shadowRoot.querySelector(
|
|
178
|
+
const menuButton = element.shadowRoot.querySelector(
|
|
179
|
+
".app-bar__menu-button",
|
|
180
|
+
);
|
|
140
181
|
assert.ok(
|
|
141
182
|
menuButton.hasAttribute("aria-expanded"),
|
|
142
183
|
"Menu button should have aria-expanded",
|
|
@@ -145,7 +186,9 @@ describe("App Bar Component", () => {
|
|
|
145
186
|
|
|
146
187
|
it("should update aria-expanded when menu is toggled", async () => {
|
|
147
188
|
element = await fixture("grantcodes-app-bar");
|
|
148
|
-
const menuButton = element.shadowRoot.querySelector(
|
|
189
|
+
const menuButton = element.shadowRoot.querySelector(
|
|
190
|
+
".app-bar__menu-button",
|
|
191
|
+
);
|
|
149
192
|
|
|
150
193
|
assert.strictEqual(
|
|
151
194
|
menuButton.getAttribute("aria-expanded"),
|
|
@@ -170,5 +213,3 @@ describe("App Bar Component", () => {
|
|
|
170
213
|
assert.ok(nav.hasAttribute("aria-label"), "Nav should have aria-label");
|
|
171
214
|
});
|
|
172
215
|
});
|
|
173
|
-
|
|
174
|
-
|