@gsa-tts/graymatter-ui 0.3.5 → 0.3.7
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/dist/graymatter-ui.js +1039 -1043
- package/dist/graymatter-ui.umd.cjs +8 -8
- package/package.json +3 -3
- package/src/components/DesktopSideNav.svelte +18 -15
- package/src/components/Head.astro +1 -2
- package/src/components/MobileSideMenu.svelte +15 -18
- package/src/components/MobileTopNav.svelte +1 -1
- package/src/components/icons/CloseIcon.svelte +5 -5
- package/src/helpers/meta.ts +1 -2
- package/src/styles/components/globalAppLayout.css +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gsa-tts/graymatter-ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -46,7 +46,8 @@
|
|
|
46
46
|
"@testing-library/user-event": "^14.6.1",
|
|
47
47
|
"@types/node": "^22.13.0",
|
|
48
48
|
"@uswds/compile": "1.2.2",
|
|
49
|
-
"@vitest/coverage-istanbul": "^3.
|
|
49
|
+
"@vitest/coverage-istanbul": "^3.2.4",
|
|
50
|
+
"astro": "^5.13.7",
|
|
50
51
|
"astro-purgecss": "^5.2.2",
|
|
51
52
|
"eslint": "^9.21.0",
|
|
52
53
|
"gulp": "^5.0.0",
|
|
@@ -62,7 +63,6 @@
|
|
|
62
63
|
"@fontsource-variable/archivo": "^5.2.6",
|
|
63
64
|
"@fontsource/space-mono": "^5.2.8",
|
|
64
65
|
"@uswds/uswds": "3.12.0",
|
|
65
|
-
"astro": "^5.12.8",
|
|
66
66
|
"slugify": "^1.6.6",
|
|
67
67
|
"@gsa-tts/graymatter-style-tokens": "0.3.0"
|
|
68
68
|
},
|
|
@@ -143,8 +143,9 @@
|
|
|
143
143
|
window.addEventListener('keydown', handleEscape);
|
|
144
144
|
|
|
145
145
|
// Custom event system for external control
|
|
146
|
-
const handleDesktopNavControlEvent = (event:
|
|
147
|
-
const
|
|
146
|
+
const handleDesktopNavControlEvent = (event: Event) => {
|
|
147
|
+
const customEvent = event as CustomEvent;
|
|
148
|
+
const { action, isOpen: eventIsOpen } = customEvent.detail;
|
|
148
149
|
|
|
149
150
|
if (action === 'toggle') {
|
|
150
151
|
navigationStore.toggleExpanded();
|
|
@@ -208,19 +209,21 @@
|
|
|
208
209
|
|
|
209
210
|
// Set default header from first submenu item after a short delay
|
|
210
211
|
setTimeout(() => {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
212
|
+
if (typeof document !== 'undefined') {
|
|
213
|
+
const mainContent = document.getElementById('main-content');
|
|
214
|
+
if (mainContent) {
|
|
215
|
+
const firstSection = mainContent.querySelector(
|
|
216
|
+
'h2[id], h3[id], h4[id], h5[id], h6[id]'
|
|
217
|
+
);
|
|
218
|
+
if (firstSection && firstSection.textContent) {
|
|
219
|
+
const firstSectionTitle = firstSection.textContent.trim();
|
|
220
|
+
selectedSubNavItemTitle.set(firstSectionTitle);
|
|
221
|
+
if (typeof window !== 'undefined') {
|
|
222
|
+
sessionStorage.setItem(
|
|
223
|
+
'subNav-selectedTitle',
|
|
224
|
+
JSON.stringify(firstSectionTitle)
|
|
225
|
+
);
|
|
226
|
+
}
|
|
224
227
|
}
|
|
225
228
|
}
|
|
226
229
|
}
|
|
@@ -10,7 +10,6 @@ const defaultDescription =
|
|
|
10
10
|
'Accelerating trusted AI adoption across government. Three powerful AI tools. Industry-leading models. One integrated platform.';
|
|
11
11
|
const defaultOgImage = getUrlFromBase('/common/assets/images/og-preview.webp');
|
|
12
12
|
|
|
13
|
-
const pageTitle = `${title} | USAi`;
|
|
14
13
|
const ogTitle = title || siteName;
|
|
15
14
|
const ogDescription = description || defaultDescription;
|
|
16
15
|
const ogImage = openGraphImage || defaultOgImage;
|
|
@@ -19,7 +18,7 @@ const canonicalUrl = new URL(Astro.url.pathname, siteUrl).href;
|
|
|
19
18
|
---
|
|
20
19
|
|
|
21
20
|
<meta name="viewport" content="width=device-width" />
|
|
22
|
-
<title>{
|
|
21
|
+
<title>{title}</title>
|
|
23
22
|
<script is:inline>
|
|
24
23
|
if ('performance' in window) {
|
|
25
24
|
performance.mark('usai:documenthead:start');
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
navigationStore,
|
|
7
7
|
} from '../stores/navigationStore.js';
|
|
8
8
|
import Logo from './Logo.svelte';
|
|
9
|
-
import
|
|
9
|
+
import MenuIcon from './icons/MenuIcon.svelte';
|
|
10
10
|
|
|
11
11
|
let sideMenuElement: HTMLDivElement;
|
|
12
12
|
let pendingMobileHash: string | null = null;
|
|
@@ -152,6 +152,14 @@
|
|
|
152
152
|
part="mobile-side-menu"
|
|
153
153
|
>
|
|
154
154
|
<div class="menu-header" part="menu-header">
|
|
155
|
+
<button
|
|
156
|
+
class="close-button"
|
|
157
|
+
onclick={closeMobileMenu}
|
|
158
|
+
aria-label="Close navigation menu"
|
|
159
|
+
part="close-button"
|
|
160
|
+
>
|
|
161
|
+
<MenuIcon isOpen={true} />
|
|
162
|
+
</button>
|
|
155
163
|
<div class="logo-container" part="logo-container">
|
|
156
164
|
{#if logoLinkUrl}
|
|
157
165
|
<a
|
|
@@ -166,14 +174,6 @@
|
|
|
166
174
|
<Logo width={75} height={22} />
|
|
167
175
|
{/if}
|
|
168
176
|
</div>
|
|
169
|
-
<button
|
|
170
|
-
class="close-button"
|
|
171
|
-
onclick={closeMobileMenu}
|
|
172
|
-
aria-label="Close navigation menu"
|
|
173
|
-
part="close-button"
|
|
174
|
-
>
|
|
175
|
-
<CloseIcon />
|
|
176
|
-
</button>
|
|
177
177
|
</div>
|
|
178
178
|
|
|
179
179
|
<div class="menu-content" part="menu-content">
|
|
@@ -208,9 +208,9 @@
|
|
|
208
208
|
top: 0;
|
|
209
209
|
left: 0;
|
|
210
210
|
bottom: 0;
|
|
211
|
-
width:
|
|
211
|
+
width: 80%;
|
|
212
212
|
max-width: 85vw;
|
|
213
|
-
background: var(--ai-color-
|
|
213
|
+
background: var(--ai-color-steel-50);
|
|
214
214
|
transform: translateX(-100%);
|
|
215
215
|
transition: transform var(--ai-transition-ease-medium);
|
|
216
216
|
z-index: var(--ai-layer-50);
|
|
@@ -225,9 +225,8 @@
|
|
|
225
225
|
.menu-header {
|
|
226
226
|
display: flex;
|
|
227
227
|
align-items: center;
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
border-bottom: 0.0625rem solid var(--ai-color-neutral-200);
|
|
228
|
+
padding: var(--ai-size-16);
|
|
229
|
+
gap: var(--ai-size-16);
|
|
231
230
|
}
|
|
232
231
|
|
|
233
232
|
.mobile-side-menu .logo-container {
|
|
@@ -242,13 +241,12 @@
|
|
|
242
241
|
display: flex;
|
|
243
242
|
align-items: center;
|
|
244
243
|
justify-content: center;
|
|
245
|
-
|
|
246
|
-
height: var(--ai-size-32);
|
|
244
|
+
padding: 0;
|
|
247
245
|
border: none;
|
|
248
246
|
background: none;
|
|
249
247
|
color: var(--ai-color-neutral-700);
|
|
250
248
|
cursor: pointer;
|
|
251
|
-
border-radius: var(--ai-size-
|
|
249
|
+
border-radius: var(--ai-size-2);
|
|
252
250
|
transition: background-color var(--ai-transition-ease-fast);
|
|
253
251
|
}
|
|
254
252
|
|
|
@@ -263,7 +261,6 @@
|
|
|
263
261
|
}
|
|
264
262
|
|
|
265
263
|
.subnav-section {
|
|
266
|
-
padding: var(--ai-size-16) 0;
|
|
267
264
|
overflow-y: auto;
|
|
268
265
|
max-height: calc(100vh - 4rem); /* leave space for header/close */
|
|
269
266
|
}
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
<svg
|
|
5
5
|
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
-
width="
|
|
7
|
-
height="
|
|
8
|
-
viewBox="0 0
|
|
6
|
+
width="20"
|
|
7
|
+
height="20"
|
|
8
|
+
viewBox="0 0 20 20"
|
|
9
9
|
fill="none"
|
|
10
10
|
>
|
|
11
11
|
<path
|
|
12
|
-
d="
|
|
13
|
-
stroke="
|
|
12
|
+
d="M2 18L18 2M2 2L18 18"
|
|
13
|
+
stroke="black"
|
|
14
14
|
stroke-width="1.5"
|
|
15
15
|
stroke-linecap="round"
|
|
16
16
|
stroke-linejoin="round"
|
package/src/helpers/meta.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { AstroGlobal } from 'astro';
|
|
2
|
-
import { siteName } from '@gsa-tts/graymatter-ui/constants';
|
|
3
2
|
|
|
4
3
|
export const getPageTitle = (astro: Pick<AstroGlobal, 'props'>): string => {
|
|
5
|
-
return astro.props?.title
|
|
4
|
+
return astro.props?.title ? `${astro.props?.title} | USAi` : 'USAi';
|
|
6
5
|
};
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
z-index: var(--ai-layer-1);
|
|
57
57
|
}
|
|
58
58
|
.app main {
|
|
59
|
-
padding: var(--ai-size-40) var(--ai-size-
|
|
59
|
+
padding: var(--ai-size-40) var(--ai-size-16) var(--ai-size-8) 1rem;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
:global(.side-nav-container.expanded) ~ .main-container main {
|
|
@@ -71,3 +71,9 @@
|
|
|
71
71
|
height: 100%;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
+
|
|
75
|
+
@media (--ai-size-breakpoint-desktop) {
|
|
76
|
+
.app main {
|
|
77
|
+
padding: var(--ai-size-40) var(--ai-size-32) var(--ai-size-8) 4.875rem;
|
|
78
|
+
}
|
|
79
|
+
}
|