@gsa-tts/graymatter-ui 0.3.17 → 0.3.19
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 +11 -13
- package/dist/graymatter-ui.js +1565 -1599
- package/dist/graymatter-ui.umd.cjs +6 -6
- package/package.json +1 -1
- package/src/components/ApiDocSubNavMenu.svelte +78 -68
- package/src/components/DesktopSideNav.svelte +4 -11
- package/src/components/MobileBottomNav.svelte +4 -11
- package/src/layouts/GlobalAppLayout.astro +19 -1
- package/src/utils/getAppUrls.ts +84 -0
package/README.md
CHANGED
|
@@ -71,18 +71,9 @@ import { toggleNavigation } from '@gsa-tts/graymatter-ui';
|
|
|
71
71
|
|
|
72
72
|
## Navigation URL Configuration
|
|
73
73
|
|
|
74
|
-
Navigation components (`DesktopSideNav`, `MobileBottomNav`) support flexible URL configuration:
|
|
74
|
+
Navigation components (`DesktopSideNav`, `MobileBottomNav`) support flexible URL configuration via props:
|
|
75
75
|
|
|
76
|
-
### Option 1:
|
|
77
|
-
```bash
|
|
78
|
-
# .env
|
|
79
|
-
PUBLIC_CHAT_URL=https://your-chat-app.com
|
|
80
|
-
PUBLIC_CONSOLE_URL=https://your-console-app.com
|
|
81
|
-
PUBLIC_API_URL=https://your-api-app.com
|
|
82
|
-
PUBLIC_DISCOVER_URL=https://your-discover-page.com
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Option 2: Component Props (Override Environment)
|
|
76
|
+
### Option 1: Component Props (Recommended)
|
|
86
77
|
```svelte
|
|
87
78
|
<DesktopSideNav
|
|
88
79
|
showAppIcons={true}
|
|
@@ -96,18 +87,25 @@ PUBLIC_DISCOVER_URL=https://your-discover-page.com
|
|
|
96
87
|
</DesktopSideNav>
|
|
97
88
|
```
|
|
98
89
|
|
|
90
|
+
### Option 2: Minimal Usage (Uses # fallbacks)
|
|
91
|
+
```svelte
|
|
92
|
+
<DesktopSideNav showAppIcons={true}>
|
|
93
|
+
<!-- All navigation links will use # as href -->
|
|
94
|
+
</DesktopSideNav>
|
|
95
|
+
```
|
|
96
|
+
|
|
99
97
|
### Option 3: Mixed Approach
|
|
100
98
|
```svelte
|
|
101
99
|
<DesktopSideNav
|
|
102
100
|
showAppIcons={true}
|
|
103
101
|
apiUrl="https://custom-api.com"
|
|
104
|
-
<!-- chatUrl, consoleUrl, discoverUrl will
|
|
102
|
+
<!-- chatUrl, consoleUrl, discoverUrl will fallback to # -->
|
|
105
103
|
>
|
|
106
104
|
<!-- Sub navigation content -->
|
|
107
105
|
</DesktopSideNav>
|
|
108
106
|
```
|
|
109
107
|
|
|
110
|
-
**
|
|
108
|
+
**Fallback Behavior:** When no URL is provided for a navigation item, it will use `#` as the href, preventing navigation and keeping users on the current page.
|
|
111
109
|
|
|
112
110
|
### Discover Icon Control
|
|
113
111
|
|