@gsa-tts/graymatter-ui 0.2.7 → 0.3.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/README.md +81 -0
- package/assets/images/favicon-dark.ico +0 -0
- package/assets/images/favicon-dark.svg +7 -0
- package/assets/images/favicon-light.svg +7 -0
- package/assets/images/favicon.ico +0 -0
- package/assets/images/favicon.svg +5 -6
- package/dist/graymatter-ui.js +1663 -1628
- package/dist/graymatter-ui.umd.cjs +80 -33
- package/package.json +4 -4
- package/src/components/Button.svelte +27 -31
- package/src/components/Button.webcomponent.svelte +13 -11
- package/src/components/DesktopHeader.svelte +70 -53
- package/src/components/DesktopHeader.webcomponent.svelte +13 -9
- package/src/components/DesktopSideNav.svelte +209 -166
- package/src/components/DesktopSideNav.webcomponent.svelte +7 -5
- package/src/components/Head.astro +24 -2
- package/src/components/Logo.svelte +48 -41
- package/src/components/Logo.webcomponent.svelte +16 -16
- package/src/components/MobileBottomNav.svelte +102 -69
- package/src/components/MobileBottomNav.webcomponent.svelte +13 -4
- package/src/components/MobileSideMenu.svelte +70 -42
- package/src/components/MobileSideMenu.webcomponent.svelte +6 -4
- package/src/components/MobileTopNav.svelte +24 -19
- package/src/components/MobileTopNav.webcomponent.svelte +6 -6
- package/src/components/NavigationInitializer.svelte +10 -2
- package/src/components/ProfileMenu.svelte +116 -27
- package/src/components/UsaSkipNav.svelte +23 -0
- package/src/components/icons/ApiIcon.svelte +182 -33
- package/src/components/icons/ChatIcon.svelte +10 -10
- package/src/components/icons/CloseIcon.svelte +10 -10
- package/src/components/icons/ConsoleIcon.svelte +68 -13
- package/src/components/icons/DiscoverIcon.svelte +14 -14
- package/src/components/icons/HelpIcon.svelte +2 -1
- package/src/components/icons/MenuIcon.svelte +47 -7
- package/src/components/index.ts +1 -1
- package/src/layouts/BaseLayout.astro +1 -1
- package/src/styles/base/global.css +7 -1
- package/src/components/UsaSkipNav.astro +0 -5
|
@@ -8,56 +8,63 @@
|
|
|
8
8
|
...restProps
|
|
9
9
|
} = $props();
|
|
10
10
|
|
|
11
|
-
const logoColor = isInverted
|
|
11
|
+
const logoColor = isInverted
|
|
12
|
+
? 'var(--ai-color-white)'
|
|
13
|
+
: 'var(--ai-color-black)';
|
|
12
14
|
</script>
|
|
13
15
|
|
|
14
16
|
{#if !showServiceMark}
|
|
15
|
-
<svg
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
>
|
|
24
|
-
|
|
17
|
+
<svg
|
|
18
|
+
{width}
|
|
19
|
+
{height}
|
|
20
|
+
viewBox="0 0 102 30"
|
|
21
|
+
fill="none"
|
|
22
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
23
|
+
style="fill: {logoColor};"
|
|
24
|
+
{...restProps}
|
|
25
|
+
>
|
|
26
|
+
<g>
|
|
27
|
+
<path
|
|
28
|
+
d="M57.5791 20.4177C57.5791 15.5645 53.7309 11.6187 48.9988 11.6187H40.188C38.6688 11.6187 37.4304 10.3567 37.4304 8.80197C37.4304 7.24729 38.6658 5.98522 40.188 5.98522H56.2373V0H38.8757C34.1466 0 30.2983 3.94877 30.2983 8.80197C30.2983 13.6552 34.1466 17.6039 38.8757 17.6039H47.6865C49.2057 17.6039 50.4442 18.866 50.4442 20.4207C50.4442 21.9754 49.2087 23.2374 47.6865 23.2374H31.0284V29.2197H48.9988C53.7309 29.2197 57.5791 25.2709 57.5791 20.4207V20.4177Z"
|
|
29
|
+
/>
|
|
30
|
+
<path
|
|
31
|
+
d="M82.1466 24.7153L82.188 24.7685L83.6747 29.2197H90.6914L80.917 0H68.3525L58.5781 29.2167H65.5949L67.0993 24.7153H82.1466ZM69.186 18.4818L73.3653 5.98522H75.9013L75.919 6.03547L80.1161 18.5793H69.1535L69.186 18.4818Z"
|
|
32
|
+
/>
|
|
33
|
+
<path
|
|
34
|
+
d="M27.198 0H20.5626V15.8158C20.5626 21.4345 16.9626 23.4355 13.5961 23.4355C9.03842 23.4355 6.62956 20.799 6.62956 15.8158V0H0V17.0069C0 20.6985 1.46305 24.0532 4.11724 26.4532C6.64729 28.7409 10.0138 30 13.599 30C20.3586 30 27.198 25.5369 27.198 17.0039V0Z"
|
|
35
|
+
/>
|
|
36
|
+
<path d="M101.708 9.78915H93.8662V29.2197H101.708V9.78915Z" />
|
|
37
|
+
<path d="M101.823 0H93.8662V5.98227H101.823V0Z" />
|
|
38
|
+
</g>
|
|
39
|
+
</svg>
|
|
40
|
+
{:else}
|
|
41
|
+
<svg
|
|
42
|
+
{width}
|
|
43
|
+
{height}
|
|
44
|
+
viewBox="0 0 75 20"
|
|
45
|
+
fill="none"
|
|
46
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
47
|
+
style="fill: {logoColor};"
|
|
48
|
+
{...restProps}
|
|
49
|
+
>
|
|
25
50
|
<path
|
|
26
|
-
d="
|
|
51
|
+
d="M38.1538 13.6118C38.1538 10.3764 35.6038 7.74581 32.4682 7.74581H26.6298C25.6231 7.74581 24.8025 6.90443 24.8025 5.86798C24.8025 4.83153 25.6211 3.99015 26.6298 3.99015H37.2646V0H25.7602C22.6266 0 20.0765 2.63251 20.0765 5.86798C20.0765 9.10345 22.6266 11.736 25.7602 11.736H31.5986C32.6053 11.736 33.4259 12.5773 33.4259 13.6138C33.4259 14.6502 32.6072 15.4916 31.5986 15.4916H20.5603V19.4798H32.4682C35.6038 19.4798 38.1538 16.8473 38.1538 13.6138V13.6118Z"
|
|
27
52
|
/>
|
|
28
53
|
<path
|
|
29
|
-
d="
|
|
54
|
+
d="M54.4317 16.4768L54.4591 16.5123L55.4442 19.4798H60.0938L53.6169 0H45.2912L38.8143 19.4778H43.4639L44.4608 16.4768H54.4317ZM48.6129 3.99015H50.2933L50.305 4.02365L53.0861 12.3862H45.822L48.6129 3.99015Z"
|
|
30
55
|
/>
|
|
31
56
|
<path
|
|
32
|
-
d="
|
|
57
|
+
d="M18.0224 0H13.6255V10.5438C13.6255 14.2897 11.24 15.6236 9.00924 15.6236C5.98918 15.6236 4.39298 13.866 4.39298 10.5438V0H0V11.3379C0 13.799 0.969472 16.0355 2.72823 17.6355C4.40473 19.1606 6.6355 20 9.01119 20C13.4903 20 18.0224 17.0246 18.0224 11.336V0Z"
|
|
33
58
|
/>
|
|
34
|
-
<path d="
|
|
35
|
-
<path
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
fill="none"
|
|
44
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
45
|
-
style="fill: {logoColor};"
|
|
46
|
-
{...restProps}
|
|
47
|
-
>
|
|
48
|
-
<path
|
|
49
|
-
d="M38.1538 13.6118C38.1538 10.3764 35.6038 7.74581 32.4682 7.74581H26.6298C25.6231 7.74581 24.8025 6.90443 24.8025 5.86798C24.8025 4.83153 25.6211 3.99015 26.6298 3.99015H37.2646V0H25.7602C22.6266 0 20.0765 2.63251 20.0765 5.86798C20.0765 9.10345 22.6266 11.736 25.7602 11.736H31.5986C32.6053 11.736 33.4259 12.5773 33.4259 13.6138C33.4259 14.6502 32.6072 15.4916 31.5986 15.4916H20.5603V19.4798H32.4682C35.6038 19.4798 38.1538 16.8473 38.1538 13.6138V13.6118Z"/>
|
|
50
|
-
<path
|
|
51
|
-
d="M54.4317 16.4768L54.4591 16.5123L55.4442 19.4798H60.0938L53.6169 0H45.2912L38.8143 19.4778H43.4639L44.4608 16.4768H54.4317ZM48.6129 3.99015H50.2933L50.305 4.02365L53.0861 12.3862H45.822L48.6129 3.99015Z"/>
|
|
52
|
-
<path
|
|
53
|
-
d="M18.0224 0H13.6255V10.5438C13.6255 14.2897 11.24 15.6236 9.00924 15.6236C5.98918 15.6236 4.39298 13.866 4.39298 10.5438V0H0V11.3379C0 13.799 0.969472 16.0355 2.72823 17.6355C4.40473 19.1606 6.6355 20 9.01119 20C13.4903 20 18.0224 17.0246 18.0224 11.336V0Z"/>
|
|
54
|
-
<path d="M67.3965 6.52612H62.2005V19.4798H67.3965V6.52612Z"/>
|
|
55
|
-
<path
|
|
56
|
-
d="M70.6978 2.72727C70.5495 2.72727 70.4078 2.71191 70.2726 2.68118C70.1374 2.64789 70.0178 2.59795 69.9138 2.53137C69.8097 2.46223 69.7278 2.37772 69.668 2.27785C69.6082 2.17542 69.5783 2.05506 69.5783 1.91677C69.5783 1.90141 69.5783 1.88604 69.5783 1.87068C69.5809 1.85531 69.5822 1.84379 69.5822 1.83611H70.0932C70.0932 1.84123 70.0919 1.85147 70.0893 1.86684C70.0893 1.87964 70.0893 1.89117 70.0893 1.90141C70.0893 1.98592 70.114 2.0589 70.1634 2.12036C70.2128 2.17926 70.2843 2.22535 70.3779 2.25864C70.4715 2.28937 70.582 2.30474 70.7095 2.30474C70.7953 2.30474 70.8707 2.29962 70.9357 2.28937C71.0033 2.27913 71.0605 2.26504 71.1073 2.24712C71.1567 2.22663 71.197 2.20359 71.2282 2.17798C71.2594 2.14981 71.2815 2.11908 71.2945 2.08579C71.3101 2.0525 71.3179 2.01665 71.3179 1.97823C71.3179 1.90397 71.2945 1.84251 71.2477 1.79385C71.2009 1.7452 71.1372 1.70423 71.0566 1.67093C70.9786 1.63764 70.8889 1.60819 70.7875 1.58259C70.6887 1.55442 70.586 1.52625 70.4793 1.49808C70.3753 1.46991 70.2726 1.43662 70.1712 1.39821C70.0724 1.35723 69.9827 1.30858 69.9021 1.25224C69.824 1.1959 69.7616 1.12548 69.7148 1.04097C69.668 0.953905 69.6446 0.850192 69.6446 0.729833C69.6446 0.606914 69.6706 0.49936 69.7226 0.40717C69.7772 0.314981 69.8526 0.239437 69.9489 0.180538C70.0477 0.119078 70.1621 0.0742637 70.2921 0.0460946C70.4221 0.0153649 70.5638 0 70.7173 0C70.8603 0 70.9942 0.0153649 71.119 0.0460946C71.2464 0.0742637 71.3582 0.120358 71.4545 0.184379C71.5507 0.245839 71.6261 0.325224 71.6807 0.422535C71.7353 0.517286 71.7626 0.631242 71.7626 0.764405V0.810499H71.2594V0.772087C71.2594 0.697823 71.236 0.635083 71.1892 0.583867C71.145 0.53265 71.0813 0.492958 70.9981 0.464789C70.9175 0.43662 70.8226 0.422535 70.7134 0.422535C70.5963 0.422535 70.4962 0.434059 70.413 0.457106C70.3298 0.477593 70.2661 0.509603 70.2219 0.553137C70.1777 0.59411 70.1556 0.645326 70.1556 0.706786C70.1556 0.770807 70.179 0.824584 70.2258 0.868118C70.2726 0.911652 70.335 0.948784 70.413 0.979513C70.4936 1.01024 70.5833 1.03841 70.6822 1.06402C70.7836 1.08963 70.8863 1.1178 70.9903 1.14853C71.0969 1.1767 71.1996 1.20999 71.2984 1.2484C71.3999 1.28681 71.4896 1.33547 71.5676 1.39437C71.6482 1.4507 71.7119 1.52113 71.7587 1.60563C71.8055 1.69014 71.8289 1.79129 71.8289 1.90909C71.8289 2.10627 71.7795 2.26504 71.6807 2.3854C71.5845 2.50576 71.4506 2.59283 71.2789 2.64661C71.1099 2.70038 70.9162 2.72727 70.6978 2.72727Z"/>
|
|
57
|
-
<path
|
|
58
|
-
d="M72.3008 2.68118V0.0460946H73.1004L73.5217 1.51344C73.5373 1.56466 73.5529 1.62228 73.5685 1.6863C73.5841 1.75032 73.5984 1.81178 73.6114 1.87068C73.627 1.92958 73.6387 1.98079 73.6465 2.02433H73.6777C73.6829 1.98592 73.6907 1.93854 73.7011 1.8822C73.7115 1.82586 73.7232 1.76568 73.7362 1.70166C73.7518 1.63508 73.7687 1.57106 73.7869 1.5096L74.2082 0.0460946H75V2.68118H74.4929V1.34827C74.4929 1.23047 74.4942 1.11268 74.4968 0.994878C74.4994 0.877081 74.502 0.775928 74.5046 0.691421C74.5098 0.606914 74.5124 0.556978 74.5124 0.541613H74.4812C74.476 0.564661 74.463 0.614597 74.4422 0.691421C74.4214 0.768246 74.3993 0.851472 74.3759 0.941101C74.3525 1.03073 74.3317 1.10755 74.3135 1.17157L73.8727 2.68118H73.4047L72.9639 1.17542C72.9483 1.12164 72.9301 1.05762 72.9093 0.983355C72.8911 0.90653 72.8716 0.828425 72.8508 0.74904C72.8326 0.669654 72.8157 0.600512 72.8001 0.541613H72.7689C72.7715 0.610755 72.7741 0.693982 72.7767 0.791293C72.7793 0.886043 72.7819 0.983355 72.7845 1.08323C72.7871 1.18054 72.7884 1.26889 72.7884 1.34827V2.68118H72.3008Z"/>
|
|
59
|
-
<path d="M67.4728 0H62.2005V3.98818H67.4728V0Z"/>
|
|
60
|
-
</svg>
|
|
59
|
+
<path d="M67.3965 6.52612H62.2005V19.4798H67.3965V6.52612Z" />
|
|
60
|
+
<path
|
|
61
|
+
d="M70.6978 2.72727C70.5495 2.72727 70.4078 2.71191 70.2726 2.68118C70.1374 2.64789 70.0178 2.59795 69.9138 2.53137C69.8097 2.46223 69.7278 2.37772 69.668 2.27785C69.6082 2.17542 69.5783 2.05506 69.5783 1.91677C69.5783 1.90141 69.5783 1.88604 69.5783 1.87068C69.5809 1.85531 69.5822 1.84379 69.5822 1.83611H70.0932C70.0932 1.84123 70.0919 1.85147 70.0893 1.86684C70.0893 1.87964 70.0893 1.89117 70.0893 1.90141C70.0893 1.98592 70.114 2.0589 70.1634 2.12036C70.2128 2.17926 70.2843 2.22535 70.3779 2.25864C70.4715 2.28937 70.582 2.30474 70.7095 2.30474C70.7953 2.30474 70.8707 2.29962 70.9357 2.28937C71.0033 2.27913 71.0605 2.26504 71.1073 2.24712C71.1567 2.22663 71.197 2.20359 71.2282 2.17798C71.2594 2.14981 71.2815 2.11908 71.2945 2.08579C71.3101 2.0525 71.3179 2.01665 71.3179 1.97823C71.3179 1.90397 71.2945 1.84251 71.2477 1.79385C71.2009 1.7452 71.1372 1.70423 71.0566 1.67093C70.9786 1.63764 70.8889 1.60819 70.7875 1.58259C70.6887 1.55442 70.586 1.52625 70.4793 1.49808C70.3753 1.46991 70.2726 1.43662 70.1712 1.39821C70.0724 1.35723 69.9827 1.30858 69.9021 1.25224C69.824 1.1959 69.7616 1.12548 69.7148 1.04097C69.668 0.953905 69.6446 0.850192 69.6446 0.729833C69.6446 0.606914 69.6706 0.49936 69.7226 0.40717C69.7772 0.314981 69.8526 0.239437 69.9489 0.180538C70.0477 0.119078 70.1621 0.0742637 70.2921 0.0460946C70.4221 0.0153649 70.5638 0 70.7173 0C70.8603 0 70.9942 0.0153649 71.119 0.0460946C71.2464 0.0742637 71.3582 0.120358 71.4545 0.184379C71.5507 0.245839 71.6261 0.325224 71.6807 0.422535C71.7353 0.517286 71.7626 0.631242 71.7626 0.764405V0.810499H71.2594V0.772087C71.2594 0.697823 71.236 0.635083 71.1892 0.583867C71.145 0.53265 71.0813 0.492958 70.9981 0.464789C70.9175 0.43662 70.8226 0.422535 70.7134 0.422535C70.5963 0.422535 70.4962 0.434059 70.413 0.457106C70.3298 0.477593 70.2661 0.509603 70.2219 0.553137C70.1777 0.59411 70.1556 0.645326 70.1556 0.706786C70.1556 0.770807 70.179 0.824584 70.2258 0.868118C70.2726 0.911652 70.335 0.948784 70.413 0.979513C70.4936 1.01024 70.5833 1.03841 70.6822 1.06402C70.7836 1.08963 70.8863 1.1178 70.9903 1.14853C71.0969 1.1767 71.1996 1.20999 71.2984 1.2484C71.3999 1.28681 71.4896 1.33547 71.5676 1.39437C71.6482 1.4507 71.7119 1.52113 71.7587 1.60563C71.8055 1.69014 71.8289 1.79129 71.8289 1.90909C71.8289 2.10627 71.7795 2.26504 71.6807 2.3854C71.5845 2.50576 71.4506 2.59283 71.2789 2.64661C71.1099 2.70038 70.9162 2.72727 70.6978 2.72727Z"
|
|
62
|
+
/>
|
|
63
|
+
<path
|
|
64
|
+
d="M72.3008 2.68118V0.0460946H73.1004L73.5217 1.51344C73.5373 1.56466 73.5529 1.62228 73.5685 1.6863C73.5841 1.75032 73.5984 1.81178 73.6114 1.87068C73.627 1.92958 73.6387 1.98079 73.6465 2.02433H73.6777C73.6829 1.98592 73.6907 1.93854 73.7011 1.8822C73.7115 1.82586 73.7232 1.76568 73.7362 1.70166C73.7518 1.63508 73.7687 1.57106 73.7869 1.5096L74.2082 0.0460946H75V2.68118H74.4929V1.34827C74.4929 1.23047 74.4942 1.11268 74.4968 0.994878C74.4994 0.877081 74.502 0.775928 74.5046 0.691421C74.5098 0.606914 74.5124 0.556978 74.5124 0.541613H74.4812C74.476 0.564661 74.463 0.614597 74.4422 0.691421C74.4214 0.768246 74.3993 0.851472 74.3759 0.941101C74.3525 1.03073 74.3317 1.10755 74.3135 1.17157L73.8727 2.68118H73.4047L72.9639 1.17542C72.9483 1.12164 72.9301 1.05762 72.9093 0.983355C72.8911 0.90653 72.8716 0.828425 72.8508 0.74904C72.8326 0.669654 72.8157 0.600512 72.8001 0.541613H72.7689C72.7715 0.610755 72.7741 0.693982 72.7767 0.791293C72.7793 0.886043 72.7819 0.983355 72.7845 1.08323C72.7871 1.18054 72.7884 1.26889 72.7884 1.34827V2.68118H72.3008Z"
|
|
65
|
+
/>
|
|
66
|
+
<path d="M67.4728 0H62.2005V3.98818H67.4728V0Z" />
|
|
67
|
+
</svg>
|
|
61
68
|
{/if}
|
|
62
69
|
|
|
63
70
|
<style>
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
<svelte:options
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<svelte:options
|
|
2
|
+
customElement={{
|
|
3
|
+
tag: 'graymatter-logo',
|
|
4
|
+
props: {
|
|
5
|
+
isInverted: { reflect: true, type: 'Boolean', attribute: 'is-inverted' },
|
|
6
|
+
width: { reflect: true, type: 'Number', attribute: 'width' },
|
|
7
|
+
height: { reflect: true, type: 'Number', attribute: 'height' },
|
|
8
|
+
showServiceMark: {
|
|
9
|
+
reflect: true,
|
|
10
|
+
type: 'Boolean',
|
|
11
|
+
attribute: 'show-service-mark',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
}}
|
|
15
|
+
/>
|
|
10
16
|
|
|
11
17
|
<script lang="ts">
|
|
12
18
|
import Logo from './Logo.svelte';
|
|
@@ -20,10 +26,4 @@
|
|
|
20
26
|
} = $props();
|
|
21
27
|
</script>
|
|
22
28
|
|
|
23
|
-
<Logo
|
|
24
|
-
{isInverted}
|
|
25
|
-
{width}
|
|
26
|
-
{height}
|
|
27
|
-
{showServiceMark}
|
|
28
|
-
{...props}
|
|
29
|
-
/>
|
|
29
|
+
<Logo {isInverted} {width} {height} {showServiceMark} {...props} />
|
|
@@ -6,105 +6,138 @@
|
|
|
6
6
|
import ConsoleIcon from './icons/ConsoleIcon.svelte';
|
|
7
7
|
import ApiIcon from './icons/ApiIcon.svelte';
|
|
8
8
|
import { getAppUrls } from '../utils/getAppUrls';
|
|
9
|
-
import slugify from
|
|
9
|
+
import slugify from 'slugify';
|
|
10
10
|
|
|
11
|
-
let {
|
|
12
|
-
onNavItemClick
|
|
13
|
-
showAppIcons
|
|
14
|
-
apiUrl
|
|
15
|
-
chatUrl
|
|
16
|
-
consoleUrl
|
|
17
|
-
discoverUrl
|
|
11
|
+
let {
|
|
12
|
+
onNavItemClick,
|
|
13
|
+
showAppIcons = true,
|
|
14
|
+
apiUrl,
|
|
15
|
+
chatUrl,
|
|
16
|
+
consoleUrl,
|
|
17
|
+
discoverUrl,
|
|
18
|
+
}: {
|
|
19
|
+
onNavItemClick?: (data: {
|
|
20
|
+
item: NavigationItem;
|
|
21
|
+
expanded: boolean;
|
|
22
|
+
}) => void;
|
|
23
|
+
showAppIcons: boolean;
|
|
24
|
+
apiUrl?: string;
|
|
25
|
+
chatUrl?: string;
|
|
26
|
+
consoleUrl?: string;
|
|
27
|
+
discoverUrl?: string;
|
|
18
28
|
} = $props();
|
|
19
29
|
|
|
20
30
|
const urls = getAppUrls();
|
|
21
31
|
|
|
22
32
|
const navItems = [
|
|
23
|
-
{
|
|
33
|
+
{
|
|
34
|
+
id: 'discover',
|
|
35
|
+
label: 'Discover',
|
|
36
|
+
icon: DiscoverIcon,
|
|
37
|
+
href: discoverUrl || urls.discover,
|
|
38
|
+
},
|
|
24
39
|
{ id: 'chat', label: 'Chat', icon: ChatIcon, href: chatUrl || urls.chat },
|
|
25
|
-
{
|
|
26
|
-
|
|
40
|
+
{
|
|
41
|
+
id: 'console',
|
|
42
|
+
label: 'Console',
|
|
43
|
+
icon: ConsoleIcon,
|
|
44
|
+
href: consoleUrl || urls.console,
|
|
45
|
+
},
|
|
46
|
+
{ id: 'api', label: 'API', icon: ApiIcon, href: apiUrl || urls.api },
|
|
27
47
|
] as const;
|
|
28
48
|
|
|
29
|
-
function handleNavItemClick(item: NavigationItem) {
|
|
49
|
+
function handleNavItemClick(item: NavigationItem) {
|
|
30
50
|
// Set navigation flag immediately to prevent header restoration
|
|
31
51
|
if (item !== 'discover' && typeof window !== 'undefined') {
|
|
32
52
|
sessionStorage.setItem('navigatingToMainNav', 'true');
|
|
33
53
|
}
|
|
34
|
-
|
|
54
|
+
|
|
35
55
|
navigationStore.setSelectedItem(item);
|
|
36
|
-
|
|
56
|
+
|
|
37
57
|
// Clear header state for main navigation items (including discover)
|
|
38
58
|
if (item !== 'discover') {
|
|
39
59
|
try {
|
|
40
|
-
import('@gsa-tts/graymatter-ui/stores/navigationStore')
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (
|
|
57
|
-
|
|
60
|
+
import('@gsa-tts/graymatter-ui/stores/navigationStore')
|
|
61
|
+
.then(({ selectedSubNavItemTitle }) => {
|
|
62
|
+
// Clear the store value immediately
|
|
63
|
+
selectedSubNavItemTitle.set('');
|
|
64
|
+
if (typeof window !== 'undefined') {
|
|
65
|
+
sessionStorage.removeItem('subNav-selectedTitle');
|
|
66
|
+
sessionStorage.removeItem('subNav-selectedId');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Set default header from first submenu item after a short delay
|
|
70
|
+
setTimeout(() => {
|
|
71
|
+
const mainContent = document.getElementById('main-content');
|
|
72
|
+
if (mainContent) {
|
|
73
|
+
const firstSection = mainContent.querySelector(
|
|
74
|
+
'h2[id], h3[id], h4[id], h5[id], h6[id]'
|
|
75
|
+
);
|
|
76
|
+
if (firstSection && firstSection.textContent) {
|
|
77
|
+
const firstSectionTitle = firstSection.textContent.trim();
|
|
78
|
+
selectedSubNavItemTitle.set(firstSectionTitle);
|
|
79
|
+
if (typeof window !== 'undefined') {
|
|
80
|
+
sessionStorage.setItem(
|
|
81
|
+
'subNav-selectedTitle',
|
|
82
|
+
JSON.stringify(firstSectionTitle)
|
|
83
|
+
);
|
|
84
|
+
}
|
|
58
85
|
}
|
|
59
86
|
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
87
|
+
}, 200); // Delay to ensure page content is loaded
|
|
88
|
+
})
|
|
89
|
+
.catch(err => {
|
|
90
|
+
console.log('[MobileBottomNav] Error clearing header state:', err);
|
|
91
|
+
});
|
|
65
92
|
} catch (err) {
|
|
66
93
|
console.log('[MobileBottomNav] Import failed for clearing state:', err);
|
|
67
94
|
}
|
|
68
95
|
} else {
|
|
69
96
|
// Clear header state for Discover page
|
|
70
97
|
try {
|
|
71
|
-
import('@gsa-tts/graymatter-ui/stores/navigationStore')
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
98
|
+
import('@gsa-tts/graymatter-ui/stores/navigationStore')
|
|
99
|
+
.then(({ selectedSubNavItemTitle }) => {
|
|
100
|
+
selectedSubNavItemTitle.set('');
|
|
101
|
+
if (typeof window !== 'undefined') {
|
|
102
|
+
sessionStorage.removeItem('subNav-selectedTitle');
|
|
103
|
+
sessionStorage.removeItem('subNav-selectedId');
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
.catch(err => {
|
|
107
|
+
console.log(
|
|
108
|
+
'[MobileBottomNav] Error clearing header state for Discover:',
|
|
109
|
+
err
|
|
110
|
+
);
|
|
111
|
+
});
|
|
80
112
|
} catch (err) {
|
|
81
|
-
console.log(
|
|
113
|
+
console.log(
|
|
114
|
+
'[MobileBottomNav] Import failed for clearing Discover state:',
|
|
115
|
+
err
|
|
116
|
+
);
|
|
82
117
|
}
|
|
83
118
|
}
|
|
84
|
-
|
|
119
|
+
|
|
85
120
|
onNavItemClick?.({ item, expanded: false });
|
|
86
121
|
}
|
|
87
122
|
</script>
|
|
88
123
|
|
|
89
124
|
{#if showAppIcons}
|
|
90
|
-
<nav class="mobile-bottom-nav" part="mobile-bottom-nav">
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
</
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
{/each}
|
|
107
|
-
</nav>
|
|
125
|
+
<nav class="mobile-bottom-nav" part="mobile-bottom-nav">
|
|
126
|
+
{#each navItems as navItem}
|
|
127
|
+
<a
|
|
128
|
+
href={navItem.href}
|
|
129
|
+
class={`nav-item ${slugify(navItem.id)}-item`}
|
|
130
|
+
class:active={$selectedItem === navItem.id}
|
|
131
|
+
onclick={() => handleNavItemClick(navItem.id)}
|
|
132
|
+
part={`${slugify(navItem.id)}-item`}
|
|
133
|
+
>
|
|
134
|
+
<div class="icon">
|
|
135
|
+
<navItem.icon isSelected={$selectedItem === navItem.id} />
|
|
136
|
+
</div>
|
|
137
|
+
<span class="label">{navItem.label}</span>
|
|
138
|
+
</a>
|
|
139
|
+
{/each}
|
|
140
|
+
</nav>
|
|
108
141
|
{/if}
|
|
109
142
|
|
|
110
143
|
<style>
|
|
@@ -117,7 +150,7 @@
|
|
|
117
150
|
padding: var(--ai-size-4);
|
|
118
151
|
text-decoration: none;
|
|
119
152
|
color: var(--ai-color-neutral-600);
|
|
120
|
-
transition: color
|
|
153
|
+
transition: color var(--ai-transition-ease-fast);
|
|
121
154
|
height: 100%;
|
|
122
155
|
}
|
|
123
156
|
|
|
@@ -133,7 +166,7 @@
|
|
|
133
166
|
.nav-item:hover {
|
|
134
167
|
color: var(--ai-color-neutral-700);
|
|
135
168
|
}
|
|
136
|
-
|
|
169
|
+
|
|
137
170
|
.icon {
|
|
138
171
|
width: var(--ai-size-24);
|
|
139
172
|
height: var(--ai-size-24);
|
|
@@ -142,7 +175,7 @@
|
|
|
142
175
|
align-items: center;
|
|
143
176
|
justify-content: center;
|
|
144
177
|
padding: var(--ai-size-2);
|
|
145
|
-
transition: background-color
|
|
178
|
+
transition: background-color var(--ai-transition-ease-fast);
|
|
146
179
|
}
|
|
147
180
|
|
|
148
181
|
.label {
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
<svelte:options
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<svelte:options
|
|
2
|
+
customElement={{
|
|
3
|
+
tag: 'graymatter-mobile-bottom-nav',
|
|
4
|
+
}}
|
|
5
|
+
/>
|
|
4
6
|
|
|
5
7
|
<script lang="ts">
|
|
6
8
|
import MobileBottomNav from './MobileBottomNav.svelte';
|
|
7
9
|
|
|
8
10
|
// Props for the web component
|
|
9
|
-
let {
|
|
11
|
+
let {
|
|
12
|
+
onNavItemClick,
|
|
13
|
+
showAppIcons = true,
|
|
14
|
+
apiUrl,
|
|
15
|
+
chatUrl,
|
|
16
|
+
consoleUrl,
|
|
17
|
+
discoverUrl,
|
|
18
|
+
} = $props();
|
|
10
19
|
</script>
|
|
11
20
|
|
|
12
21
|
<MobileBottomNav
|