@gsa-tts/graymatter-ui 0.3.7 → 0.3.8

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.7",
3
+ "version": "0.3.8",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -28,6 +28,7 @@
28
28
  onNavItemClick = undefined,
29
29
  children,
30
30
  showAppIcons = true,
31
+ hideDiscover = true,
31
32
  profileMenuData,
32
33
  apiUrl,
33
34
  chatUrl,
@@ -330,29 +331,31 @@
330
331
 
331
332
  {#if showAppIcons}
332
333
  <div class="nav-items" part="nav-items">
333
- <a
334
- href={discoverUrl || urls.discover}
335
- class="nav-item discover-item"
336
- class:selected={isNavSelected('discover')}
337
- class:hovered={isNavHovered('discover')}
338
- onclick={() => handleNavItemClick('discover')}
339
- onkeydown={e => {
340
- handleKeyDown(e, 'discover');
341
- handleNavKeyDown(e, 0);
342
- }}
343
- onmouseenter={() => (hoveredItem = 'discover')}
344
- onmouseleave={() => (hoveredItem = null)}
345
- aria-current={isNavSelected('discover') ? 'page' : undefined}
346
- part="discover-item"
347
- bind:this={discoverNavRef}
348
- >
349
- <div class="icon-container" part="discover-icon-container">
350
- <div class="icon-wrapper">
351
- <DiscoverIcon isSelected={isNavSelected('discover')} />
334
+ {#if !hideDiscover}
335
+ <a
336
+ href={discoverUrl || urls.discover}
337
+ class="nav-item discover-item"
338
+ class:selected={isNavSelected('discover')}
339
+ class:hovered={isNavHovered('discover')}
340
+ onclick={() => handleNavItemClick('discover')}
341
+ onkeydown={e => {
342
+ handleKeyDown(e, 'discover');
343
+ handleNavKeyDown(e, 0);
344
+ }}
345
+ onmouseenter={() => (hoveredItem = 'discover')}
346
+ onmouseleave={() => (hoveredItem = null)}
347
+ aria-current={isNavSelected('discover') ? 'page' : undefined}
348
+ part="discover-item"
349
+ bind:this={discoverNavRef}
350
+ >
351
+ <div class="icon-container" part="discover-icon-container">
352
+ <div class="icon-wrapper">
353
+ <DiscoverIcon isSelected={isNavSelected('discover')} />
354
+ </div>
352
355
  </div>
353
- </div>
354
- <span class="nav-text">Discover</span>
355
- </a>
356
+ <span class="nav-text">Discover</span>
357
+ </a>
358
+ {/if}
356
359
  <a
357
360
  href={chatUrl || urls.chat}
358
361
  class="nav-item chat-item"
@@ -13,6 +13,7 @@
13
13
  onNavToggle,
14
14
  onNavItemClick,
15
15
  showAppIcons = true,
16
+ hideDiscover = true,
16
17
  profileMenuData,
17
18
  apiUrl,
18
19
  chatUrl,
@@ -27,6 +28,7 @@
27
28
  {onNavToggle}
28
29
  {onNavItemClick}
29
30
  {showAppIcons}
31
+ {hideDiscover}
30
32
  {profileMenuData}
31
33
  {apiUrl}
32
34
  {chatUrl}
@@ -11,6 +11,7 @@
11
11
  let {
12
12
  onNavItemClick,
13
13
  showAppIcons = true,
14
+ hideDiscover = true,
14
15
  apiUrl,
15
16
  chatUrl,
16
17
  consoleUrl,
@@ -21,6 +22,7 @@
21
22
  expanded: boolean;
22
23
  }) => void;
23
24
  showAppIcons: boolean;
25
+ hideDiscover: boolean;
24
26
  apiUrl?: string;
25
27
  chatUrl?: string;
26
28
  consoleUrl?: string;
@@ -33,7 +35,7 @@
33
35
  ? { api: '#', chat: '#', console: '#', discover: '#' }
34
36
  : getAppUrls();
35
37
 
36
- const navItems = [
38
+ const allNavItems = [
37
39
  {
38
40
  id: 'discover',
39
41
  label: 'Discover',
@@ -50,6 +52,11 @@
50
52
  { id: 'api', label: 'API', icon: ApiIcon, href: apiUrl || urls.api },
51
53
  ] as const;
52
54
 
55
+ // Filter out discover item if hideDiscover is true
56
+ const navItems = hideDiscover
57
+ ? allNavItems.filter(item => item.id !== 'discover')
58
+ : allNavItems;
59
+
53
60
  function handleNavItemClick(item: NavigationItem) {
54
61
  // Set navigation flag immediately to prevent header restoration
55
62
  if (item !== 'discover' && typeof window !== 'undefined') {
@@ -11,6 +11,7 @@
11
11
  let {
12
12
  onNavItemClick,
13
13
  showAppIcons = true,
14
+ hideDiscover = true,
14
15
  apiUrl,
15
16
  chatUrl,
16
17
  consoleUrl,
@@ -21,6 +22,7 @@
21
22
  <MobileBottomNav
22
23
  {onNavItemClick}
23
24
  {showAppIcons}
25
+ {hideDiscover}
24
26
  {apiUrl}
25
27
  {chatUrl}
26
28
  {consoleUrl}