@patternfly/documentation-framework 6.49.3 → 6.49.4
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/CHANGELOG.md +11 -0
- package/components/sideNav/sideNav.js +25 -28
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.49.4 (2026-07-27)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **nav:** close sidebar on mobile breakpoint ([#5087](https://github.com/patternfly/patternfly-org/issues/5087)) ([75b6042](https://github.com/patternfly/patternfly-org/commit/75b6042db3183f752f64b83a52ab1818d70c261d))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## 6.49.3 (2026-07-27)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -20,7 +20,6 @@ const DIVIDER_STYLES = {
|
|
|
20
20
|
marginBottom: 'var(--pf-t--global--spacer--xs)'
|
|
21
21
|
};
|
|
22
22
|
import { makeSlug } from '../../helpers';
|
|
23
|
-
import globalBreakpointXl from '@patternfly/react-tokens/dist/esm/t_global_breakpoint_xl';
|
|
24
23
|
import { trackEvent } from '../../helpers';
|
|
25
24
|
|
|
26
25
|
const getIsActive = (location, section, subsection = null) => {
|
|
@@ -31,14 +30,13 @@ const getIsActive = (location, section, subsection = null) => {
|
|
|
31
30
|
const defaultValue = 50;
|
|
32
31
|
|
|
33
32
|
const NavItem = ({ text, href, isDeprecated, isBeta, isDemo }) => {
|
|
34
|
-
const isMobileView = window.innerWidth < Number.parseInt(globalBreakpointXl.value, 10);
|
|
35
33
|
return (
|
|
36
34
|
<PageContextConsumer key={href + text}>
|
|
37
|
-
{({ onSidebarToggle, isSidebarOpen }) => (
|
|
35
|
+
{({ onSidebarToggle, isSidebarOpen, isMobile }) => (
|
|
38
36
|
<li
|
|
39
37
|
key={href + text}
|
|
40
38
|
className="pf-v6-c-nav__item"
|
|
41
|
-
onClick={() =>
|
|
39
|
+
onClick={() => isMobile && onSidebarToggle && onSidebarToggle()}
|
|
42
40
|
>
|
|
43
41
|
<Link
|
|
44
42
|
to={href}
|
|
@@ -170,24 +168,27 @@ export const SideNav = ({ groupedRoutes = {}, navItems = [] }) => {
|
|
|
170
168
|
}
|
|
171
169
|
}, []);
|
|
172
170
|
|
|
173
|
-
const groupedItems = React.useMemo(() =>
|
|
174
|
-
|
|
175
|
-
const ungroupedItems = React.useMemo(() =>
|
|
176
|
-
(navItems || []).filter(entry => entry && !entry.title), [navItems]);
|
|
171
|
+
const groupedItems = React.useMemo(() => (navItems || []).filter((entry) => entry && entry.title), [navItems]);
|
|
172
|
+
const ungroupedItems = React.useMemo(() => (navItems || []).filter((entry) => entry && !entry.title), [navItems]);
|
|
177
173
|
|
|
178
|
-
const renderNavItem = React.useCallback(
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
174
|
+
const renderNavItem = React.useCallback(
|
|
175
|
+
(item) => {
|
|
176
|
+
if (!item) return null;
|
|
177
|
+
|
|
178
|
+
return item.section ? (
|
|
179
|
+
<Location key={item.section}>
|
|
180
|
+
{({ location }) => ExpandableNav({ groupedRoutes, location, section: item.section })}
|
|
181
|
+
</Location>
|
|
182
|
+
) : (
|
|
183
|
+
NavItem({
|
|
184
|
+
key: item.href || `nav-item-${Math.random()}`,
|
|
185
|
+
text: item.text || (item.href ? capitalize(item.href.replace(/\//g, '').replace(/-/g, ' ')) : 'Untitled'),
|
|
186
|
+
href: item.href
|
|
187
|
+
})
|
|
188
|
+
);
|
|
189
|
+
},
|
|
190
|
+
[groupedRoutes]
|
|
191
|
+
);
|
|
191
192
|
|
|
192
193
|
return (
|
|
193
194
|
<Nav aria-label="Side Nav" theme="light">
|
|
@@ -202,13 +203,9 @@ export const SideNav = ({ groupedRoutes = {}, navItems = [] }) => {
|
|
|
202
203
|
{group.hasDivider && <Divider style={DIVIDER_STYLES} />}
|
|
203
204
|
</React.Fragment>
|
|
204
205
|
))}
|
|
205
|
-
|
|
206
|
+
|
|
206
207
|
{/* Render ungrouped items - this handles the current flat structure */}
|
|
207
|
-
{ungroupedItems.length > 0 && (
|
|
208
|
-
<NavList className="ws-side-nav-list">
|
|
209
|
-
{ungroupedItems.map(renderNavItem)}
|
|
210
|
-
</NavList>
|
|
211
|
-
)}
|
|
208
|
+
{ungroupedItems.length > 0 && <NavList className="ws-side-nav-list">{ungroupedItems.map(renderNavItem)}</NavList>}
|
|
212
209
|
</Nav>
|
|
213
210
|
);
|
|
214
|
-
};
|
|
211
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/documentation-framework",
|
|
3
3
|
"description": "A framework to build documentation for PatternFly.",
|
|
4
|
-
"version": "6.49.
|
|
4
|
+
"version": "6.49.4",
|
|
5
5
|
"author": "Red Hat",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"http-cache-semantics": ">=4.1.1",
|
|
93
93
|
"nanoid": "3.3.8"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "957756128e8ddfc4be5db49e72312a2c43b9d220"
|
|
96
96
|
}
|