@gsa-tts/graymatter-ui 0.3.6 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gsa-tts/graymatter-ui",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -143,8 +143,9 @@
143
143
  window.addEventListener('keydown', handleEscape);
144
144
 
145
145
  // Custom event system for external control
146
- const handleDesktopNavControlEvent = (event: CustomEvent) => {
147
- const { action, isOpen: eventIsOpen } = event.detail;
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
- const mainContent = document.getElementById('main-content');
212
- if (mainContent) {
213
- const firstSection = mainContent.querySelector(
214
- 'h2[id], h3[id], h4[id], h5[id], h6[id]'
215
- );
216
- if (firstSection && firstSection.textContent) {
217
- const firstSectionTitle = firstSection.textContent.trim();
218
- selectedSubNavItemTitle.set(firstSectionTitle);
219
- if (typeof window !== 'undefined') {
220
- sessionStorage.setItem(
221
- 'subNav-selectedTitle',
222
- JSON.stringify(firstSectionTitle)
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>{pageTitle}</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 CloseIcon from './icons/CloseIcon.svelte';
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: 15rem;
211
+ width: 80%;
212
212
  max-width: 85vw;
213
- background: var(--ai-color-white);
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
- justify-content: space-between;
229
- padding: var(--ai-size-16) var(--ai-size-20);
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
- width: var(--ai-size-32);
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-6);
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
  }
@@ -131,7 +131,7 @@
131
131
  }
132
132
 
133
133
  .mobile-top-nav .menu-button {
134
- width: var(--ai-size-40);
134
+ padding: 0;
135
135
  height: var(--ai-size-40);
136
136
  color: var(--ai-color-neutral-700);
137
137
  }
@@ -3,14 +3,14 @@
3
3
 
4
4
  <svg
5
5
  xmlns="http://www.w3.org/2000/svg"
6
- width="24"
7
- height="24"
8
- viewBox="0 0 24 24"
6
+ width="20"
7
+ height="20"
8
+ viewBox="0 0 20 20"
9
9
  fill="none"
10
10
  >
11
11
  <path
12
- d="M6 18L18 6M6 6L18 18"
13
- stroke="#585C63"
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"
@@ -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 || siteName;
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-32) var(--ai-size-8) 4.875rem;
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
+ }