@patternfly/documentation-framework 6.26.0 → 6.26.2
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 +19 -0
- package/components/themeSelector/themeSelector.js +49 -4
- package/package.json +3 -3
- package/templates/html.ejs +14 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.26.2 (2025-10-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* enable HC switcher, add beta label ([#4766](https://github.com/patternfly/patternfly-org/issues/4766)) ([bdcd2b8](https://github.com/patternfly/patternfly-org/commit/bdcd2b80a0939ae8362d8ebcd4d14f79ef0c1831))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 6.26.1 (2025-10-08)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @patternfly/documentation-framework
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# 6.26.0 (2025-10-07)
|
|
7
26
|
|
|
8
27
|
|
|
@@ -10,8 +10,12 @@ import {
|
|
|
10
10
|
ToggleGroup,
|
|
11
11
|
ToggleGroupItem,
|
|
12
12
|
Icon,
|
|
13
|
-
Divider
|
|
13
|
+
Divider,
|
|
14
|
+
Label,
|
|
15
|
+
Popover,
|
|
16
|
+
Button
|
|
14
17
|
} from '@patternfly/react-core';
|
|
18
|
+
import { HelpIcon, ExternalLinkAltIcon } from '@patternfly/react-icons';
|
|
15
19
|
import { useTheme, THEME_TYPES } from '../../hooks/useTheme';
|
|
16
20
|
|
|
17
21
|
const SunIcon = (
|
|
@@ -45,6 +49,47 @@ const DesktopIcon = (
|
|
|
45
49
|
</svg>
|
|
46
50
|
);
|
|
47
51
|
|
|
52
|
+
const ColorSchemeGroupLabel = () => {
|
|
53
|
+
return (
|
|
54
|
+
<div className="pf-v6-c-menu__group-title" id="theme-selector-color-scheme-title">
|
|
55
|
+
Color scheme
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const HighContrastGroupLabel = () => {
|
|
61
|
+
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<div className="pf-v6-c-menu__group-title">
|
|
65
|
+
High contrast{' '}
|
|
66
|
+
<Popover
|
|
67
|
+
onClick={(e) => e.stopPropagation()}
|
|
68
|
+
headerContent={"Under development"}
|
|
69
|
+
headerComponent="h1"
|
|
70
|
+
bodyContent={
|
|
71
|
+
"We are still working to add high contrast support across all PatternFly components and extensions. This beta allows you to preview our progress."
|
|
72
|
+
}
|
|
73
|
+
footerContent={
|
|
74
|
+
<Button icon={<ExternalLinkAltIcon />} component="a" isInline variant="link" href="/design-foundations/theming" target="_blank">
|
|
75
|
+
Learn more
|
|
76
|
+
</Button>
|
|
77
|
+
}
|
|
78
|
+
aria-label="More info about high contrast"
|
|
79
|
+
appendTo={() => document.body}
|
|
80
|
+
>
|
|
81
|
+
<Button
|
|
82
|
+
variant="plain"
|
|
83
|
+
hasNoPadding
|
|
84
|
+
icon={<HelpIcon />}
|
|
85
|
+
aria-label="High contrast help"
|
|
86
|
+
/>
|
|
87
|
+
</Popover>{' '}
|
|
88
|
+
<Label color="blue" isCompact>Beta</Label>
|
|
89
|
+
</div>
|
|
90
|
+
)
|
|
91
|
+
};
|
|
92
|
+
|
|
48
93
|
export const ThemeSelector = ({ id }) => {
|
|
49
94
|
const { mode: themeMode, setMode: setThemeMode, modes: colorModes } = useTheme(THEME_TYPES.COLOR);
|
|
50
95
|
const {
|
|
@@ -109,8 +154,8 @@ export const ThemeSelector = ({ id }) => {
|
|
|
109
154
|
preventOverflow: true
|
|
110
155
|
}}
|
|
111
156
|
>
|
|
112
|
-
<SelectGroup>
|
|
113
|
-
<SelectList aria-
|
|
157
|
+
<SelectGroup label={ColorSchemeGroupLabel}>
|
|
158
|
+
<SelectList aria-labelledby="theme-selector-color-scheme-title">
|
|
114
159
|
<SelectOption value={colorModes.SYSTEM} icon={DesktopIcon} description="Follow system preference">
|
|
115
160
|
System
|
|
116
161
|
</SelectOption>
|
|
@@ -124,7 +169,7 @@ export const ThemeSelector = ({ id }) => {
|
|
|
124
169
|
</SelectGroup>
|
|
125
170
|
{process.env.hasHighContrastSwitcher && (<>
|
|
126
171
|
<Divider />
|
|
127
|
-
<SelectGroup label=
|
|
172
|
+
<SelectGroup label={HighContrastGroupLabel}>
|
|
128
173
|
<MenuSearch>
|
|
129
174
|
<MenuSearchInput>
|
|
130
175
|
<ToggleGroup aria-label="High contrast theme switcher">
|
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.26.
|
|
4
|
+
"version": "6.26.2",
|
|
5
5
|
"author": "Red Hat",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@babel/preset-env": "7.27.1",
|
|
13
13
|
"@babel/preset-react": "^7.24.1",
|
|
14
14
|
"@mdx-js/util": "1.6.16",
|
|
15
|
-
"@patternfly/ast-helpers": "^1.4.0-alpha.
|
|
15
|
+
"@patternfly/ast-helpers": "^1.4.0-alpha.287",
|
|
16
16
|
"@reach/router": "npm:@gatsbyjs/reach-router@1.3.9",
|
|
17
17
|
"autoprefixer": "10.4.19",
|
|
18
18
|
"babel-loader": "^9.1.3",
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
"http-cache-semantics": ">=4.1.1",
|
|
96
96
|
"nanoid": "3.3.8"
|
|
97
97
|
},
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "46716c44750c4ced29c0f727c64849eb009e81de"
|
|
99
99
|
}
|
package/templates/html.ejs
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en-US">
|
|
3
3
|
<head>
|
|
4
|
+
<script>
|
|
5
|
+
{
|
|
6
|
+
try {
|
|
7
|
+
let mode = localStorage.getItem('theme-preference');
|
|
8
|
+
if (!mode || mode === 'system') {
|
|
9
|
+
mode = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
10
|
+
}
|
|
11
|
+
if (mode === 'dark') {
|
|
12
|
+
document.documentElement.classList.add('pf-v6-theme-dark');
|
|
13
|
+
}
|
|
14
|
+
} catch (e) {}
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
4
17
|
<meta charset="utf-8">
|
|
5
18
|
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
|
|
6
19
|
<meta name="description" content="PatternFly is Red Hat's open source design system. It consists of components, documentation, and code for building enterprise applications at scale.">
|
|
@@ -12,6 +25,7 @@
|
|
|
12
25
|
<link rel="manifest" href="/assets/manifest.json">
|
|
13
26
|
<meta name="mobile-web-app-capable" content="yes">
|
|
14
27
|
<meta name="theme-color" content="#151515">
|
|
28
|
+
<meta name="color-scheme" content="light dark">
|
|
15
29
|
<meta name="application-name" content="PatternFly docs">
|
|
16
30
|
<%= htmlWebpackPlugin.tags.headTags %>
|
|
17
31
|
</head>
|