@gsa-tts/graymatter-ui 0.0.2 → 0.2.0
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/assets/images/ai-icons/chevron-up-down.svg +4 -0
- package/dist/graymatter-ui.js +4082 -0
- package/dist/graymatter-ui.umd.cjs +40 -0
- package/index.ts +3 -0
- package/package.json +10 -5
- package/src/components/Button.svelte +11 -23
- package/src/components/Button.webcomponent.svelte +44 -0
- package/src/components/DesktopHeader.svelte +101 -0
- package/src/components/DesktopHeader.webcomponent.svelte +17 -0
- package/src/components/DesktopSideNav.svelte +645 -0
- package/src/components/DesktopSideNav.webcomponent.svelte +19 -0
- package/src/components/GoogleTagManager.astro +16 -0
- package/src/components/Logo.svelte +8 -7
- package/src/components/Logo.webcomponent.svelte +26 -0
- package/src/components/MobileBottomNav.svelte +145 -0
- package/src/components/MobileBottomNav.webcomponent.svelte +14 -0
- package/src/components/MobileSideMenu.svelte +225 -0
- package/src/components/MobileSideMenu.webcomponent.svelte +11 -0
- package/src/components/MobileTopNav.svelte +235 -0
- package/src/components/MobileTopNav.webcomponent.svelte +14 -0
- package/src/components/NavigationInitializer.svelte +19 -0
- package/src/components/icons/ApiIcon.svelte +49 -0
- package/src/components/icons/ChatIcon.svelte +27 -0
- package/src/components/icons/CloseIcon.svelte +18 -0
- package/src/components/icons/ConsoleIcon.svelte +25 -0
- package/src/components/icons/DiscoverIcon.svelte +30 -0
- package/src/components/icons/MenuIcon.svelte +38 -0
- package/src/components/icons/index.ts +6 -0
- package/src/components/index.ts +9 -0
- package/src/index.ts +16 -0
- package/src/layouts/AppLayout.astro +1 -1
- package/src/layouts/BaseLayout.astro +4 -0
- package/src/layouts/GlobalAppLayout.astro +594 -0
- package/src/stores/navigationStore.ts +138 -0
- package/src/stores/subNavReadyStore.ts +3 -0
- package/src/styles/base/global.css +8 -1
- package/src/styles/base/typography.css +15 -14
- package/src/styles/components/globalAppLayout.css +73 -0
- package/src/styles/components/globalAppNav.css +95 -0
- package/src/utils/getAppUrls.ts +29 -0
- package/src/utils/index.ts +1 -0
- package/assets/images/gsai-logo-black.svg +0 -18
- package/assets/images/gsai-logo-white.svg +0 -18
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
isMenuButtonDisabled,
|
|
4
|
+
navigationStore,
|
|
5
|
+
selectedSubNavItemTitle,
|
|
6
|
+
} from '../stores/navigationStore.js';
|
|
7
|
+
import Logo from './Logo.svelte';
|
|
8
|
+
import MenuIcon from './icons/MenuIcon.svelte';
|
|
9
|
+
import { onMount } from 'svelte';
|
|
10
|
+
|
|
11
|
+
export let onProfileClick: (() => void) | undefined = undefined;
|
|
12
|
+
|
|
13
|
+
onMount(() => {
|
|
14
|
+
// Listen for section visibility changes to update header
|
|
15
|
+
const handleSectionVisible = (event: Event) => {
|
|
16
|
+
if (window.innerWidth <= 640) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const customEvent = event as CustomEvent;
|
|
20
|
+
if (customEvent.detail && customEvent.detail.title) {
|
|
21
|
+
selectedSubNavItemTitle.set(customEvent.detail.title);
|
|
22
|
+
if (typeof window !== 'undefined') {
|
|
23
|
+
sessionStorage.setItem('subNav-selectedTitle', JSON.stringify(customEvent.detail.title));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// Set default header based on first submenu item
|
|
29
|
+
const setDefaultHeaderFromFirstSubmenu = () => {
|
|
30
|
+
if (typeof window === 'undefined') return;
|
|
31
|
+
|
|
32
|
+
const mainContent = document.getElementById('main-content');
|
|
33
|
+
if (!mainContent) return;
|
|
34
|
+
|
|
35
|
+
// Find the first heading with an ID (first submenu item)
|
|
36
|
+
const firstSection = mainContent.querySelector('h2[id], h3[id], h4[id], h5[id], h6[id]');
|
|
37
|
+
if (firstSection && firstSection.textContent) {
|
|
38
|
+
const firstSectionTitle = firstSection.textContent.trim();
|
|
39
|
+
|
|
40
|
+
// Only set if no header is currently set
|
|
41
|
+
if (!$selectedSubNavItemTitle) {
|
|
42
|
+
selectedSubNavItemTitle.set(firstSectionTitle);
|
|
43
|
+
if (typeof window !== 'undefined') {
|
|
44
|
+
sessionStorage.setItem('subNav-selectedTitle', JSON.stringify(firstSectionTitle));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
window.addEventListener('sectionVisible', handleSectionVisible);
|
|
51
|
+
|
|
52
|
+
// Set default header on mount only if no stored title exists
|
|
53
|
+
const storedTitle = sessionStorage.getItem('subNav-selectedTitle');
|
|
54
|
+
if (!storedTitle || storedTitle === '""' || storedTitle === 'null') {
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
setDefaultHeaderFromFirstSubmenu();
|
|
57
|
+
}, 100);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return () => {
|
|
61
|
+
window.removeEventListener('sectionVisible', handleSectionVisible);
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
function toggleMobileNav() {
|
|
66
|
+
navigationStore.toggleExpanded();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function handleProfileClick() {
|
|
70
|
+
onProfileClick?.();
|
|
71
|
+
}
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<nav class="mobile-top-nav" part="mobile-top-nav">
|
|
75
|
+
<button
|
|
76
|
+
class="menu-button"
|
|
77
|
+
class:disabled={$isMenuButtonDisabled}
|
|
78
|
+
disabled={$isMenuButtonDisabled}
|
|
79
|
+
on:click={toggleMobileNav}
|
|
80
|
+
aria-label="Toggle navigation menu"
|
|
81
|
+
part="menu-button"
|
|
82
|
+
>
|
|
83
|
+
<MenuIcon />
|
|
84
|
+
</button>
|
|
85
|
+
|
|
86
|
+
<div class="brand">
|
|
87
|
+
<Logo width={75} height={22} />
|
|
88
|
+
<span class="brand-text">{$selectedSubNavItemTitle || ''}</span>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<button
|
|
92
|
+
class="profile-button"
|
|
93
|
+
on:click={handleProfileClick}
|
|
94
|
+
aria-label="Open profile menu"
|
|
95
|
+
part="profile-button"
|
|
96
|
+
>
|
|
97
|
+
<div class="user-profile-container">
|
|
98
|
+
<div class="user-profile-icon" part="user-profile-icon">
|
|
99
|
+
<span class="user-initials">ZW</span>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</button>
|
|
103
|
+
</nav>
|
|
104
|
+
|
|
105
|
+
<style>
|
|
106
|
+
.user-profile-container,
|
|
107
|
+
.user-profile-icon {
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.menu-button,
|
|
114
|
+
.profile-button {
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
justify-content: center;
|
|
118
|
+
border: none;
|
|
119
|
+
background: none;
|
|
120
|
+
cursor: pointer;
|
|
121
|
+
border-radius: var(--ai-size-8);
|
|
122
|
+
transition: background-color 0.2s ease;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.menu-button:disabled,
|
|
126
|
+
.menu-button.disabled {
|
|
127
|
+
cursor: not-allowed;
|
|
128
|
+
opacity: 0.5;
|
|
129
|
+
background-color: transparent;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.user-profile-icon {
|
|
133
|
+
border-radius: var(--ai-size-6);
|
|
134
|
+
background: var(--ai-color-steel-700);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.user-initials {
|
|
138
|
+
color: var(--ai-color-white);
|
|
139
|
+
text-align: center;
|
|
140
|
+
font-weight: 400;
|
|
141
|
+
line-height: 1.3;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.mobile-top-nav .menu-button {
|
|
145
|
+
width: var(--ai-size-40);
|
|
146
|
+
height: var(--ai-size-40);
|
|
147
|
+
color: var(--ai-color-neutral-700);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.menu-button:hover {
|
|
151
|
+
background-color: var(--ai-color-neutral-100);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* MobileTopNav specific disabled state */
|
|
155
|
+
.mobile-top-nav .menu-button.disabled,
|
|
156
|
+
.mobile-top-nav .menu-button:disabled {
|
|
157
|
+
cursor: not-allowed;
|
|
158
|
+
opacity: 0.5;
|
|
159
|
+
background-color: transparent;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.brand {
|
|
163
|
+
display: flex;
|
|
164
|
+
align-items: center;
|
|
165
|
+
gap: var(--ai-size-12);
|
|
166
|
+
flex: 1;
|
|
167
|
+
margin-left: var(--ai-size-8);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.brand-text {
|
|
171
|
+
color: var(--ai-color-neutral-900);
|
|
172
|
+
font-size: var(--ai-size-16);
|
|
173
|
+
font-weight: 600;
|
|
174
|
+
line-height: 1;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.profile-button {
|
|
178
|
+
width: var(--ai-size-40);
|
|
179
|
+
height: var(--ai-size-40);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.profile-button:hover {
|
|
183
|
+
background-color: var(--ai-color-neutral-100);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.mobile-top-nav .user-profile-icon {
|
|
187
|
+
width: var(--ai-size-32);
|
|
188
|
+
height: var(--ai-size-32);
|
|
189
|
+
border-radius: 0.3125rem;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.mobile-top-nav .user-initials {
|
|
193
|
+
font-size: var(--ai-size-14);
|
|
194
|
+
line-height: 1;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.user-profile-container {
|
|
198
|
+
width: var(--ai-size-40);
|
|
199
|
+
height: var(--ai-size-40);
|
|
200
|
+
aspect-ratio: 1/1;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.user-profile-icon {
|
|
204
|
+
padding: 0.5556rem 0.4931rem 0.5694rem 0.3819rem;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.user-initials {
|
|
208
|
+
font-size: var(--ai-size-16);
|
|
209
|
+
font-style: normal;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.menu-button {
|
|
213
|
+
display: flex;
|
|
214
|
+
padding: var(--ai-size-4);
|
|
215
|
+
justify-content: center;
|
|
216
|
+
align-items: center;
|
|
217
|
+
background: none;
|
|
218
|
+
border: none;
|
|
219
|
+
cursor: pointer;
|
|
220
|
+
opacity: 1;
|
|
221
|
+
transition: opacity 0.2s ease;
|
|
222
|
+
will-change: opacity;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.menu-button.disabled {
|
|
226
|
+
cursor: not-allowed;
|
|
227
|
+
opacity: 0.5;
|
|
228
|
+
will-change: opacity;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.menu-button:focus {
|
|
232
|
+
outline: none;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svelte:options customElement={{
|
|
2
|
+
tag: 'graymatter-mobile-top-nav'
|
|
3
|
+
}} />
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import MobileTopNav from './MobileTopNav.svelte';
|
|
7
|
+
|
|
8
|
+
// Props for the web component
|
|
9
|
+
let { onMenuToggle } = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<MobileTopNav
|
|
13
|
+
{onMenuToggle}
|
|
14
|
+
/>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte';
|
|
3
|
+
import { navigationStore, type NavigationItem } from '../stores/navigationStore.js';
|
|
4
|
+
|
|
5
|
+
export let item: NavigationItem;
|
|
6
|
+
export let autoExpand: boolean = false;
|
|
7
|
+
|
|
8
|
+
onMount(() => {
|
|
9
|
+
if (item) {
|
|
10
|
+
navigationStore.setSelectedItem(item);
|
|
11
|
+
// Auto-expand for non-discover pages on desktop
|
|
12
|
+
if (autoExpand && item !== 'discover' && typeof window !== 'undefined' && window.innerWidth > 640) {
|
|
13
|
+
navigationStore.setExpanded(true);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<!-- This component is invisible and only handles navigation initialization -->
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export let isSelected = false;
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="24"
|
|
8
|
+
height="24"
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
fill="none"
|
|
11
|
+
>
|
|
12
|
+
{#if isSelected}
|
|
13
|
+
<!-- Selected state - black outline with filled center -->
|
|
14
|
+
<rect x="4.41699" y="4.62451" width="15.1664" height="15.1664" rx="1.75" stroke="black" stroke-width="1.5"/>
|
|
15
|
+
<g>
|
|
16
|
+
<path d="M9.5 3.66664V2" stroke="black" stroke-width="1.5" stroke-linecap="round"/>
|
|
17
|
+
<path d="M3.66664 14.4998L2 14.4998" stroke="black" stroke-width="1.5" stroke-linecap="round"/>
|
|
18
|
+
<path d="M22.0001 14.4998L20.3335 14.4998" stroke="black" stroke-width="1.5" stroke-linecap="round"/>
|
|
19
|
+
<path d="M9.5 21.9999V20.3333" stroke="black" stroke-width="1.5" stroke-linecap="round"/>
|
|
20
|
+
<path d="M12.0005 3.66664V2" stroke="black" stroke-width="1.5" stroke-linecap="round"/>
|
|
21
|
+
<path d="M3.66664 12.0005L2 12.0005" stroke="black" stroke-width="1.5" stroke-linecap="round"/>
|
|
22
|
+
<path d="M22.0001 12.0005L20.3335 12.0005" stroke="black" stroke-width="1.5" stroke-linecap="round"/>
|
|
23
|
+
<path d="M12.0005 21.9999V20.3333" stroke="black" stroke-width="1.5" stroke-linecap="round"/>
|
|
24
|
+
<path d="M14.4995 3.66664V2" stroke="black" stroke-width="1.5" stroke-linecap="round"/>
|
|
25
|
+
<path d="M3.66664 9.5L2 9.5" stroke="black" stroke-width="1.5" stroke-linecap="round"/>
|
|
26
|
+
<path d="M22.0001 9.5L20.3335 9.5" stroke="black" stroke-width="1.5" stroke-linecap="round"/>
|
|
27
|
+
<path d="M14.4995 21.9999V20.3333" stroke="black" stroke-width="1.5" stroke-linecap="round"/>
|
|
28
|
+
</g>
|
|
29
|
+
<path d="M10.5 8.52856H13.7559C14.7224 8.52856 15.5059 9.31207 15.5059 10.2786V13.5344C15.5059 14.5009 14.7224 15.2844 13.7559 15.2844H10.5C9.5335 15.2844 8.75 14.5009 8.75 13.5344V10.2786C8.75 9.31207 9.5335 8.52856 10.5 8.52856Z" fill="black" stroke="black" stroke-width="1.5"/>
|
|
30
|
+
{:else}
|
|
31
|
+
<!-- Default state - gray outline -->
|
|
32
|
+
<rect x="4.41699" y="4.62451" width="15.1664" height="15.1664" rx="1.75" stroke="#585C63" stroke-width="1.5"/>
|
|
33
|
+
<g>
|
|
34
|
+
<path d="M9.5 3.66664V2" stroke="#585C63" stroke-width="1.5" stroke-linecap="round"/>
|
|
35
|
+
<path d="M3.66664 14.4995L2 14.4995" stroke="#585C63" stroke-width="1.5" stroke-linecap="round"/>
|
|
36
|
+
<path d="M22.0001 14.4995L20.3335 14.4995" stroke="#585C63" stroke-width="1.5" stroke-linecap="round"/>
|
|
37
|
+
<path d="M9.5 21.9999V20.3333" stroke="#585C63" stroke-width="1.5" stroke-linecap="round"/>
|
|
38
|
+
<path d="M12.0005 3.66664V2" stroke="#585C63" stroke-width="1.5" stroke-linecap="round"/>
|
|
39
|
+
<path d="M3.66664 12.0002L2 12.0002" stroke="#585C63" stroke-width="1.5" stroke-linecap="round"/>
|
|
40
|
+
<path d="M22.0001 12.0002L20.3335 12.0002" stroke="#585C63" stroke-width="1.5" stroke-linecap="round"/>
|
|
41
|
+
<path d="M12.0005 21.9999V20.3333" stroke="#585C63" stroke-width="1.5" stroke-linecap="round"/>
|
|
42
|
+
<path d="M14.4995 3.66664V2" stroke="#585C63" stroke-width="1.5" stroke-linecap="round"/>
|
|
43
|
+
<path d="M3.66664 9.49976L2 9.49976" stroke="#585C63" stroke-width="1.5" stroke-linecap="round"/>
|
|
44
|
+
<path d="M22.0001 9.49976L20.3335 9.49976" stroke="#585C63" stroke-width="1.5" stroke-linecap="round"/>
|
|
45
|
+
<path d="M14.4995 21.9999V20.3333" stroke="#585C63" stroke-width="1.5" stroke-linecap="round"/>
|
|
46
|
+
</g>
|
|
47
|
+
<rect x="8.52881" y="8.52856" width="6.75594" height="6.75594" rx="1.75" stroke="#585C63" stroke-width="1.5"/>
|
|
48
|
+
{/if}
|
|
49
|
+
</svg>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export let isSelected = false;
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="24"
|
|
8
|
+
height="24"
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
fill="none"
|
|
11
|
+
>
|
|
12
|
+
{#if isSelected}
|
|
13
|
+
<!-- Selected state - black filled -->
|
|
14
|
+
<path
|
|
15
|
+
fill-rule="evenodd"
|
|
16
|
+
clip-rule="evenodd"
|
|
17
|
+
d="M17.0508 3C19.6009 3.00039 21.6688 5.06802 21.6689 7.61816V13.2832C21.6688 15.8333 19.6009 17.901 17.0508 17.9014H13.2686L9.23926 21.7168C8.58852 22.3323 7.5166 21.8705 7.5166 20.9746V17.8984C5.01299 17.8445 3.00011 15.7997 3 13.2832V7.61816C3.00012 5.06785 5.06785 3.00012 7.61816 3H17.0508Z"
|
|
18
|
+
fill="black"
|
|
19
|
+
/>
|
|
20
|
+
{:else}
|
|
21
|
+
<!-- Default state - gray -->
|
|
22
|
+
<path
|
|
23
|
+
d="M17.0508 3C19.6009 3.00039 21.6688 5.06802 21.6689 7.61816V13.2832C21.6688 15.8333 19.6009 17.901 17.0508 17.9014H13.2686L9.23926 21.7168C8.58852 22.3323 7.5166 21.8705 7.5166 20.9746V17.8984C5.01299 17.8445 3.00011 15.7997 3 13.2832V7.61816C3.00012 5.06785 5.06785 3.00012 7.61816 3H17.0508ZM7.61816 4.45898C5.87327 4.4591 4.4591 5.87327 4.45898 7.61816V13.2832C4.4591 15.0281 5.87327 16.4432 7.61816 16.4434L8.24609 16.4424C8.64868 16.4424 8.97539 16.7693 8.97559 17.1719V19.958L12.4775 16.6426C12.6186 16.5091 12.7994 16.4443 12.9795 16.4443V16.4434H17.0508C18.7954 16.443 20.2099 15.0279 20.21 13.2832V7.61816C20.2098 5.87344 18.7954 4.45938 17.0508 4.45898H7.61816Z"
|
|
24
|
+
fill="#585C63"
|
|
25
|
+
/>
|
|
26
|
+
{/if}
|
|
27
|
+
</svg>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<svg
|
|
5
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
+
width="24"
|
|
7
|
+
height="24"
|
|
8
|
+
viewBox="0 0 24 24"
|
|
9
|
+
fill="none"
|
|
10
|
+
>
|
|
11
|
+
<path
|
|
12
|
+
d="M6 18L18 6M6 6L18 18"
|
|
13
|
+
stroke="#585C63"
|
|
14
|
+
stroke-width="1.5"
|
|
15
|
+
stroke-linecap="round"
|
|
16
|
+
stroke-linejoin="round"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export let isSelected = false;
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="24"
|
|
8
|
+
height="24"
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
fill="none"
|
|
11
|
+
>
|
|
12
|
+
{#if isSelected}
|
|
13
|
+
<!-- Selected state - black filled bars -->
|
|
14
|
+
<rect x="2.75" y="6.02856" width="3.7459" height="12.9262" fill="black" stroke="black" stroke-width="1.5"/>
|
|
15
|
+
<rect x="9.96338" y="9.96313" width="3.7459" height="8.9918" fill="black" stroke="black" stroke-width="1.5"/>
|
|
16
|
+
<rect x="17.1763" y="2.75" width="3.7459" height="16.2049" fill="black" stroke="black" stroke-width="1.5"/>
|
|
17
|
+
<path d="M2.32764 22H21.344" stroke="black" stroke-width="1.5" stroke-linecap="square"/>
|
|
18
|
+
{:else}
|
|
19
|
+
<!-- Default state - gray -->
|
|
20
|
+
<rect x="2.75" y="6.02856" width="3.7459" height="12.9262" stroke="#585C63" stroke-width="1.5"/>
|
|
21
|
+
<rect x="9.96338" y="9.96313" width="3.7459" height="8.9918" stroke="#585C63" stroke-width="1.5"/>
|
|
22
|
+
<rect x="17.1763" y="2.75" width="3.7459" height="16.2049" stroke="#585C63" stroke-width="1.5"/>
|
|
23
|
+
<path d="M2.32764 22H21.344" stroke="#585C63" stroke-width="1.5" stroke-linecap="square"/>
|
|
24
|
+
{/if}
|
|
25
|
+
</svg>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export let isSelected = false;
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="24"
|
|
8
|
+
height="24"
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
fill="none"
|
|
11
|
+
>
|
|
12
|
+
{#if isSelected}
|
|
13
|
+
<!-- Selected state - black filled -->
|
|
14
|
+
<path
|
|
15
|
+
fill-rule="evenodd"
|
|
16
|
+
clip-rule="evenodd"
|
|
17
|
+
d="M10.7883 3.2108C11.2367 2.13286 12.7637 2.13286 13.212 3.2108L15.294 8.21652L20.6981 8.64976C21.8619 8.74306 22.3337 10.1953 21.4471 10.9549L17.3298 14.4818L18.5877 19.7553C18.8585 20.8909 17.6232 21.7884 16.6268 21.1799L12.0002 18.354L7.37353 21.1799C6.37721 21.7884 5.14182 20.8909 5.4127 19.7553L6.67062 14.4818L2.55328 10.9549C1.66664 10.1953 2.13851 8.74306 3.30224 8.64976L8.70633 8.21652L10.7883 3.2108Z"
|
|
18
|
+
fill="black"
|
|
19
|
+
/>
|
|
20
|
+
{:else}
|
|
21
|
+
<!-- Default state - gray -->
|
|
22
|
+
<path
|
|
23
|
+
d="M11.4807 3.49883C11.6729 3.03685 12.3273 3.03685 12.5195 3.49883L14.6454 8.61028C14.7264 8.80504 14.9096 8.93811 15.1199 8.95497L20.6381 9.39736C21.1369 9.43735 21.3391 10.0598 20.9591 10.3853L16.7548 13.9867C16.5946 14.1239 16.5246 14.3392 16.5736 14.5444L17.858 19.9293C17.9741 20.416 17.4447 20.8007 17.0177 20.5398L12.2933 17.6542C12.1133 17.5443 11.8869 17.5443 11.7069 17.6542L6.98251 20.5398C6.55551 20.8007 6.02606 20.416 6.14215 19.9293L7.42664 14.5444C7.47558 14.3392 7.40562 14.1239 7.24543 13.9867L3.04111 10.3853C2.66112 10.0598 2.86335 9.43735 3.36209 9.39736L8.88034 8.95497C9.0906 8.93811 9.27375 8.80504 9.35476 8.61028L11.4807 3.49883Z"
|
|
24
|
+
stroke="#585C63"
|
|
25
|
+
stroke-width="1.5"
|
|
26
|
+
stroke-linecap="round"
|
|
27
|
+
stroke-linejoin="round"
|
|
28
|
+
/>
|
|
29
|
+
{/if}
|
|
30
|
+
</svg>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export let isDisabled: boolean = false;
|
|
3
|
+
export let isHovered: boolean = false;
|
|
4
|
+
export let isOpen: boolean = false;
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<svg
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
width="24"
|
|
10
|
+
height="24"
|
|
11
|
+
viewBox="0 0 24 24"
|
|
12
|
+
fill="none"
|
|
13
|
+
{...$$restProps}
|
|
14
|
+
>
|
|
15
|
+
{#if isDisabled}
|
|
16
|
+
<!-- Disabled state -->
|
|
17
|
+
<path d="M18.75 3H5.25C4.00736 3 3 4.09719 3 5.45064V7.90129V18.5207C3 19.8742 4.00736 20.9714 5.25 20.9714H18.75C19.9926 20.9714 21 19.8742 21 18.5207V7.90129V5.45064C21 4.09719 19.9926 3 18.75 3Z" stroke="#C7CDD6" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
18
|
+
<path d="M{isOpen ? '8.18018' : '9.18018'} {isOpen ? '5.45068' : '3.27222'}V{isOpen ? '18.5208' : '20.9203'}" stroke="#C7CDD6" stroke-width="1.5" />
|
|
19
|
+
{:else if isHovered}
|
|
20
|
+
{#if isOpen}
|
|
21
|
+
<!-- Hovered, nav open: arrow left -->
|
|
22
|
+
<path d="M12.25 18L6 12M6 12L12.25 6M6 12L21 12" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
23
|
+
<path d="M3 3V21" stroke="black" stroke-width="1.5" stroke-linecap="round" />
|
|
24
|
+
{:else}
|
|
25
|
+
<!-- Hovered, nav collapsed: arrow right -->
|
|
26
|
+
<path d="M11.75 18.25L18 12M18 12L11.75 5.75M18 12L3 12" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
27
|
+
<path d="M21 3V21" stroke="black" stroke-width="1.5" stroke-linecap="round" />
|
|
28
|
+
{/if}
|
|
29
|
+
{:else}
|
|
30
|
+
<!-- Default state -->
|
|
31
|
+
<path d="M18.75 3H5.25C4.00736 3 3 4.09719 3 5.45064V7.90129V18.5207C3 19.8742 4.00736 20.9714 5.25 20.9714H18.75C19.9926 20.9714 21 19.8742 21 18.5207V7.90129V5.45064C21 4.09719 19.9926 3 18.75 3Z" stroke="#585C63" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
32
|
+
{#if isOpen}
|
|
33
|
+
<path d="M8.18018 5.45068V18.5208" stroke="#585C63" stroke-width="1.5" />
|
|
34
|
+
{:else}
|
|
35
|
+
<path d="M9.18018 3.27222V20.9203" stroke="#585C63" stroke-width="1.5" />
|
|
36
|
+
{/if}
|
|
37
|
+
{/if}
|
|
38
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as DiscoverIcon } from './DiscoverIcon.svelte';
|
|
2
|
+
export { default as ChatIcon } from './ChatIcon.svelte';
|
|
3
|
+
export { default as ConsoleIcon } from './ConsoleIcon.svelte';
|
|
4
|
+
export { default as ApiIcon } from './ApiIcon.svelte';
|
|
5
|
+
export { default as MenuIcon } from './MenuIcon.svelte';
|
|
6
|
+
export { default as CloseIcon } from './CloseIcon.svelte';
|
package/src/components/index.ts
CHANGED
|
@@ -6,3 +6,12 @@ export { default as UsaSkipNav } from './UsaSkipNav.astro';
|
|
|
6
6
|
// Svelte Components
|
|
7
7
|
export { default as Logo } from './Logo.svelte';
|
|
8
8
|
export { default as Button } from './Button.svelte';
|
|
9
|
+
export { default as DesktopSideNav } from './DesktopSideNav.svelte';
|
|
10
|
+
export { default as DesktopHeader } from './DesktopHeader.svelte';
|
|
11
|
+
export { default as MobileTopNav } from './MobileTopNav.svelte';
|
|
12
|
+
export { default as MobileBottomNav } from './MobileBottomNav.svelte';
|
|
13
|
+
export { default as MobileSideMenu } from './MobileSideMenu.svelte';
|
|
14
|
+
export { default as NavigationInitializer } from './NavigationInitializer.svelte';
|
|
15
|
+
|
|
16
|
+
// Icon Components
|
|
17
|
+
export * from './icons/index.js';
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Button from './components/Button.webcomponent.svelte';
|
|
2
|
+
import DesktopHeader from './components/DesktopHeader.webcomponent.svelte';
|
|
3
|
+
import DesktopSideNav from './components/DesktopSideNav.webcomponent.svelte';
|
|
4
|
+
import Logo from './components/Logo.webcomponent.svelte';
|
|
5
|
+
import MobileBottomNav from './components/MobileBottomNav.webcomponent.svelte';
|
|
6
|
+
import MobileSideMenu from './components/MobileSideMenu.webcomponent.svelte';
|
|
7
|
+
import MobileTopNav from './components/MobileTopNav.webcomponent.svelte';
|
|
8
|
+
export {
|
|
9
|
+
Button,
|
|
10
|
+
DesktopHeader,
|
|
11
|
+
DesktopSideNav,
|
|
12
|
+
Logo,
|
|
13
|
+
MobileBottomNav,
|
|
14
|
+
MobileSideMenu,
|
|
15
|
+
MobileTopNav,
|
|
16
|
+
};
|
|
@@ -12,7 +12,7 @@ const { componentOptions = {} } = Astro.props;
|
|
|
12
12
|
const title = getPageTitle(Astro);
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
<BaseLayout title={title}>
|
|
15
|
+
<BaseLayout title={title} gtmID={Astro.props.gtmID}>
|
|
16
16
|
<div class="app">
|
|
17
17
|
<div class="banner">
|
|
18
18
|
<UsaBanner isInverted={componentOptions.usaBanner?.theme === 'inverse'} />
|
|
@@ -3,6 +3,7 @@ import '../styles/base/global.css';
|
|
|
3
3
|
import Head from '../components/Head.astro';
|
|
4
4
|
import UsaSkipNav from '../components/UsaSkipNav.astro';
|
|
5
5
|
import { getPageTitle } from '../helpers/meta';
|
|
6
|
+
import GoogleTagManager from '../components/GoogleTagManager.astro';
|
|
6
7
|
|
|
7
8
|
const title = getPageTitle(Astro);
|
|
8
9
|
---
|
|
@@ -12,6 +13,9 @@ const title = getPageTitle(Astro);
|
|
|
12
13
|
<head>
|
|
13
14
|
<meta charset="UTF-8" />
|
|
14
15
|
<Head title={title} />
|
|
16
|
+
<slot name="analytics">
|
|
17
|
+
<GoogleTagManager gtmID={Astro.props.gtmID} />
|
|
18
|
+
</slot>
|
|
15
19
|
</head>
|
|
16
20
|
<body>
|
|
17
21
|
<slot name="skip-nav">
|