@patternfly/documentation-framework 2.0.0-alpha.7 → 2.0.0-alpha.70
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 +582 -0
- package/README.md +1 -1
- package/app.js +20 -14
- package/components/autoLinkHeader/autoLinkHeader.css +2 -2
- package/components/autoLinkHeader/autoLinkHeader.js +18 -13
- package/components/cssVariables/cssSearch.js +3 -4
- package/components/cssVariables/cssVariables.css +4 -4
- package/components/cssVariables/cssVariables.js +83 -84
- package/components/example/example.css +29 -29
- package/components/example/example.js +34 -6
- package/components/footer/footer.css +16 -16
- package/components/footer/footer.js +16 -16
- package/components/functionsTable/functionsTable.js +57 -0
- package/components/gdprBanner/gdprBanner.css +2 -2
- package/components/gdprBanner/gdprBanner.js +3 -3
- package/components/inlineAlert/inlineAlert.js +1 -1
- package/components/link/link.js +1 -2
- package/components/propsTable/propsTable.js +85 -79
- package/components/sectionGallery/TextSummary.js +31 -0
- package/components/sectionGallery/sectionDataListLayout.js +51 -0
- package/components/sectionGallery/sectionGallery.css +53 -0
- package/components/sectionGallery/sectionGallery.js +76 -0
- package/components/sectionGallery/sectionGalleryLayout.js +41 -0
- package/components/sectionGallery/sectionGalleryToolbar.js +38 -0
- package/components/sectionGallery/sectionGalleryWrapper.js +110 -0
- package/components/sideNav/sideNav.css +12 -12
- package/components/sideNav/sideNav.js +44 -16
- package/components/tableOfContents/tableOfContents.css +17 -17
- package/helpers/codesandbox.js +3 -5
- package/helpers/getTitle.js +2 -2
- package/layouts/sideNavLayout/sideNavLayout.css +7 -11
- package/layouts/sideNavLayout/sideNavLayout.js +59 -45
- package/package.json +28 -25
- package/pages/404/404.css +2 -2
- package/pages/404/index.js +1 -1
- package/pages/global-css-variables.md +16 -16
- package/routes.js +20 -10
- package/scripts/cli/build.js +6 -1
- package/scripts/cli/cli.js +3 -1
- package/scripts/cli/generate.js +2 -2
- package/scripts/cli/start.js +6 -8
- package/scripts/md/parseMD.js +46 -11
- package/scripts/md/styled-tags.js +8 -4
- package/scripts/tsDocgen.js +119 -91
- package/scripts/typeDocGen.js +209 -0
- package/scripts/webpack/getHtmlWebpackPlugins.js +1 -2
- package/scripts/webpack/prerender.js +1 -2
- package/scripts/webpack/webpack.base.config.js +35 -35
- package/scripts/webpack/webpack.client.config.js +11 -8
- package/scripts/webpack/webpack.server.config.js +8 -5
- package/scripts/writeScreenshots.js +3 -3
- package/templates/html.ejs +2 -4
- package/templates/mdx.css +156 -161
- package/templates/mdx.js +122 -51
- package/templates/patternfly-docs/content/extensions/extension/design-guidelines/design-guidelines.md +2 -0
- package/templates/patternfly-docs/content/extensions/extension/examples/basic.md +2 -0
- package/templates/sitemap.ejs +1 -1
- package/versions.json +29 -9
- package/components/topNav/topNav.css +0 -30
- package/pages/red-hat-font.md +0 -40
|
@@ -3,17 +3,19 @@ import {
|
|
|
3
3
|
Button,
|
|
4
4
|
Page,
|
|
5
5
|
PageSidebar,
|
|
6
|
+
PageSidebarBody,
|
|
6
7
|
Brand,
|
|
7
8
|
Dropdown,
|
|
8
|
-
DropdownToggle,
|
|
9
9
|
DropdownItem,
|
|
10
10
|
DropdownGroup,
|
|
11
|
+
DropdownList,
|
|
11
12
|
Divider,
|
|
12
13
|
Masthead,
|
|
13
14
|
MastheadToggle,
|
|
14
15
|
MastheadMain,
|
|
15
16
|
MastheadContent,
|
|
16
17
|
MastheadBrand,
|
|
18
|
+
MenuToggle,
|
|
17
19
|
PageToggleButton,
|
|
18
20
|
Toolbar,
|
|
19
21
|
ToolbarGroup,
|
|
@@ -23,7 +25,6 @@ import {
|
|
|
23
25
|
Switch,
|
|
24
26
|
SearchInput
|
|
25
27
|
} from '@patternfly/react-core';
|
|
26
|
-
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/esm/icons/external-link-alt-icon';
|
|
27
28
|
import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
|
|
28
29
|
import GithubIcon from '@patternfly/react-icons/dist/esm/icons/github-icon';
|
|
29
30
|
import { SideNav, TopNav, GdprBanner } from '../../components';
|
|
@@ -37,8 +38,7 @@ const HeaderTools = ({
|
|
|
37
38
|
hasVersionSwitcher,
|
|
38
39
|
algolia,
|
|
39
40
|
hasDarkThemeSwitcher,
|
|
40
|
-
topNavItems
|
|
41
|
-
pathPrefix
|
|
41
|
+
topNavItems
|
|
42
42
|
}) => {
|
|
43
43
|
const initialVersion = staticVersions.Releases.find(release => release.latest);
|
|
44
44
|
const latestVersion = versions.Releases.find(version => version.latest);
|
|
@@ -48,14 +48,9 @@ const HeaderTools = ({
|
|
|
48
48
|
const [isSearchExpanded, setIsSearchExpanded] = React.useState(false);
|
|
49
49
|
|
|
50
50
|
const getDropdownItem = (version, isLatest = false) => (
|
|
51
|
-
<DropdownItem
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<a href={isLatest ? '/' : `/${version.name}`}>
|
|
55
|
-
{`Release ${version.name}`}
|
|
56
|
-
</a>
|
|
57
|
-
}
|
|
58
|
-
/>
|
|
51
|
+
<DropdownItem itemId={version.name} key={version.name} to={isLatest ? '/' : `/${version.name}`}>
|
|
52
|
+
{`Release ${version.name}`}
|
|
53
|
+
</DropdownItem>
|
|
59
54
|
);
|
|
60
55
|
|
|
61
56
|
const onChange = (_evt, value) => {
|
|
@@ -69,7 +64,7 @@ const HeaderTools = ({
|
|
|
69
64
|
useEffect(() => {
|
|
70
65
|
// reattach algolia to input each time search is expanded
|
|
71
66
|
if (hasSearch && isSearchExpanded) {
|
|
72
|
-
attachDocSearch(algolia, '.ws-global-search .pf-c-text-input-group__text-input', 1000);
|
|
67
|
+
attachDocSearch(algolia, '.ws-global-search .pf-v5-c-text-input-group__text-input', 1000);
|
|
73
68
|
}
|
|
74
69
|
}, [isSearchExpanded])
|
|
75
70
|
|
|
@@ -82,13 +77,13 @@ const HeaderTools = ({
|
|
|
82
77
|
</ToolbarItem>
|
|
83
78
|
)}
|
|
84
79
|
<ToolbarGroup
|
|
85
|
-
|
|
80
|
+
align={{ default: 'alignRight' }}
|
|
86
81
|
spaceItems={{ default: 'spacerNone', md: 'spacerMd' }}
|
|
87
82
|
>
|
|
88
83
|
{hasDarkThemeSwitcher && (
|
|
89
84
|
<ToolbarItem>
|
|
90
85
|
<Switch id="ws-theme-switch" label="Dark theme" defaultChecked={false} onChange={() =>
|
|
91
|
-
document.querySelector('html').classList.toggle('pf-theme-dark')} />
|
|
86
|
+
document.querySelector('html').classList.toggle('pf-v5-theme-dark')} />
|
|
92
87
|
</ToolbarItem>
|
|
93
88
|
)}
|
|
94
89
|
{hasSearch && (
|
|
@@ -117,42 +112,60 @@ const HeaderTools = ({
|
|
|
117
112
|
{hasVersionSwitcher && (
|
|
118
113
|
<ToolbarItem>
|
|
119
114
|
<Dropdown
|
|
120
|
-
isFullHeight
|
|
121
115
|
onSelect={() => setDropdownOpen(!isDropdownOpen)}
|
|
116
|
+
onOpenChange={(isOpen) => setDropdownOpen(isOpen)}
|
|
122
117
|
isOpen={isDropdownOpen}
|
|
123
|
-
toggle={(
|
|
124
|
-
<
|
|
125
|
-
|
|
118
|
+
toggle={(toggleRef) => (
|
|
119
|
+
<MenuToggle
|
|
120
|
+
isFullHeight
|
|
121
|
+
ref={toggleRef}
|
|
122
|
+
onClick={() => setDropdownOpen(!isDropdownOpen)}
|
|
123
|
+
isExpanded={isDropdownOpen}
|
|
126
124
|
>
|
|
127
125
|
Release {initialVersion.name}
|
|
128
|
-
</
|
|
126
|
+
</MenuToggle>
|
|
129
127
|
)}
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
>
|
|
129
|
+
<DropdownGroup key="Latest" label="Latest">
|
|
130
|
+
<DropdownList>
|
|
132
131
|
{getDropdownItem(latestVersion, true)}
|
|
133
|
-
</
|
|
134
|
-
|
|
132
|
+
</DropdownList>
|
|
133
|
+
</DropdownGroup>
|
|
134
|
+
<DropdownGroup key="Previous releases" label="Previous releases">
|
|
135
|
+
<DropdownList>
|
|
135
136
|
{Object.values(versions.Releases)
|
|
136
137
|
.filter(version => !version.hidden && !version.latest)
|
|
137
138
|
.slice(0,3)
|
|
138
139
|
.map(version => getDropdownItem(version))}
|
|
139
|
-
</
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
140
|
+
</DropdownList>
|
|
141
|
+
</DropdownGroup>
|
|
142
|
+
<Divider key="divider" className="ws-switcher-divider"/>
|
|
143
|
+
<DropdownGroup key="Previous versions" label="Previous versions">
|
|
144
|
+
<DropdownList>
|
|
145
|
+
<DropdownItem
|
|
146
|
+
key="PatternFly 4"
|
|
147
|
+
className="ws-patternfly-3"
|
|
148
|
+
isExternalLink
|
|
149
|
+
to="http://v4-archive.patternfly.org/v4/"
|
|
150
|
+
itemId="patternfly-4"
|
|
151
|
+
>
|
|
152
|
+
PatternFly 4
|
|
153
|
+
</DropdownItem>
|
|
154
|
+
<DropdownItem
|
|
155
|
+
key="PatternFly 3"
|
|
156
|
+
className="ws-patternfly-3"
|
|
157
|
+
isExternalLink
|
|
158
|
+
to="https://pf3.patternfly.org/"
|
|
159
|
+
itemId="patternfly-3"
|
|
160
|
+
>
|
|
161
|
+
PatternFly 3
|
|
162
|
+
</DropdownItem>
|
|
163
|
+
</DropdownList>
|
|
164
|
+
</DropdownGroup>
|
|
165
|
+
</Dropdown>
|
|
152
166
|
</ToolbarItem>
|
|
153
167
|
)}
|
|
154
|
-
</ToolbarGroup>
|
|
155
|
-
</ToolbarContent>
|
|
168
|
+
</ToolbarGroup></ToolbarContent>
|
|
156
169
|
</Toolbar>
|
|
157
170
|
);
|
|
158
171
|
}
|
|
@@ -164,7 +177,7 @@ export function attachDocSearch(algolia, inputSelector, timeout) {
|
|
|
164
177
|
inputSelector,
|
|
165
178
|
autocompleteOptions: {
|
|
166
179
|
hint: false,
|
|
167
|
-
appendTo: `.ws-global-search .pf-c-text-input-group`,
|
|
180
|
+
appendTo: `.ws-global-search .pf-v5-c-text-input-group`,
|
|
168
181
|
},
|
|
169
182
|
debug: process.env.NODE_ENV !== 'production',
|
|
170
183
|
...algolia
|
|
@@ -176,7 +189,6 @@ export function attachDocSearch(algolia, inputSelector, timeout) {
|
|
|
176
189
|
}
|
|
177
190
|
|
|
178
191
|
export const SideNavLayout = ({ children, groupedRoutes, navOpen: navOpenProp }) => {
|
|
179
|
-
const pathPrefix = process.env.pathPrefix;
|
|
180
192
|
const algolia = process.env.algolia;
|
|
181
193
|
const hasGdprBanner = process.env.hasGdprBanner;
|
|
182
194
|
const hasVersionSwitcher = process.env.hasVersionSwitcher;
|
|
@@ -205,8 +217,11 @@ export const SideNavLayout = ({ children, groupedRoutes, navOpen: navOpenProp })
|
|
|
205
217
|
<PageSidebar
|
|
206
218
|
className="ws-page-sidebar"
|
|
207
219
|
theme="light"
|
|
208
|
-
|
|
209
|
-
|
|
220
|
+
>
|
|
221
|
+
<PageSidebarBody>
|
|
222
|
+
<SideNav navItems={sideNavItems} groupedRoutes={groupedRoutes} />
|
|
223
|
+
</PageSidebarBody>
|
|
224
|
+
</PageSidebar>
|
|
210
225
|
);
|
|
211
226
|
|
|
212
227
|
const Header = (
|
|
@@ -217,7 +232,7 @@ export const SideNavLayout = ({ children, groupedRoutes, navOpen: navOpenProp })
|
|
|
217
232
|
</PageToggleButton>
|
|
218
233
|
</MastheadToggle>
|
|
219
234
|
<MastheadMain>
|
|
220
|
-
<MastheadBrand href={prurl ||
|
|
235
|
+
<MastheadBrand href={prurl || '/'}>
|
|
221
236
|
{prnum ? `PR #${prnum}` : (
|
|
222
237
|
<Brand src={logoBase} alt="PatternFly logo" widths={{ default: '180px', '2xl': '220px' }}>
|
|
223
238
|
<source media="(min-width: 768px)" srcSet={logoMd} />
|
|
@@ -233,7 +248,6 @@ export const SideNavLayout = ({ children, groupedRoutes, navOpen: navOpenProp })
|
|
|
233
248
|
algolia={algolia}
|
|
234
249
|
hasVersionSwitcher={hasVersionSwitcher}
|
|
235
250
|
hasDarkThemeSwitcher={hasDarkThemeSwitcher}
|
|
236
|
-
pathPrefix={pathPrefix}
|
|
237
251
|
topNavItems={topNavItems}
|
|
238
252
|
/>
|
|
239
253
|
)}
|
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": "2.0.0-alpha.
|
|
4
|
+
"version": "2.0.0-alpha.70",
|
|
5
5
|
"author": "Red Hat",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"private": false,
|
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
"@babel/preset-env": "7.18.2",
|
|
23
23
|
"@mdx-js/util": "1.6.16",
|
|
24
24
|
"@patternfly/ast-helpers": "^0.4.57",
|
|
25
|
-
"@reach/router": "1.3.
|
|
25
|
+
"@reach/router": "npm:@gatsbyjs/reach-router@1.3.9",
|
|
26
26
|
"autoprefixer": "9.8.6",
|
|
27
|
-
"babel-loader": "
|
|
27
|
+
"babel-loader": "9.1.2",
|
|
28
28
|
"camelcase-css": "2.0.1",
|
|
29
29
|
"chokidar": "3.5.3",
|
|
30
|
-
"clean-webpack-plugin": "
|
|
30
|
+
"clean-webpack-plugin": "4.0.0",
|
|
31
31
|
"codesandbox": "2.2.0",
|
|
32
32
|
"commander": "4.1.1",
|
|
33
|
-
"copy-webpack-plugin": "
|
|
34
|
-
"css-loader": "
|
|
33
|
+
"copy-webpack-plugin": "11.0.0",
|
|
34
|
+
"css-loader": "6.7.3",
|
|
35
35
|
"detab": "2.0.3",
|
|
36
36
|
"express": "4.18.1",
|
|
37
|
-
"file-loader": "6.
|
|
37
|
+
"file-loader": "6.2.0",
|
|
38
38
|
"file-saver": "1.3.8",
|
|
39
39
|
"fs-extra": "9.0.1",
|
|
40
40
|
"glob": "8.0.3",
|
|
@@ -42,51 +42,54 @@
|
|
|
42
42
|
"hast-to-hyperscript": "9.0.0",
|
|
43
43
|
"hast-util-to-text": "2.0.0",
|
|
44
44
|
"html-formatter": "0.1.9",
|
|
45
|
-
"html-webpack-plugin": "
|
|
45
|
+
"html-webpack-plugin": "5.5.0",
|
|
46
46
|
"js-yaml": "3.14.0",
|
|
47
47
|
"mdast-util-to-hast": "9.1.1",
|
|
48
48
|
"mdurl": "1.0.1",
|
|
49
|
-
"mini-css-extract-plugin": "
|
|
50
|
-
"monaco-editor": "0.
|
|
51
|
-
"monaco-editor-webpack-plugin": "
|
|
52
|
-
"null-loader": "4.0.
|
|
49
|
+
"mini-css-extract-plugin": "2.7.5",
|
|
50
|
+
"monaco-editor": "0.34.1",
|
|
51
|
+
"monaco-editor-webpack-plugin": "7.0.1",
|
|
52
|
+
"null-loader": "4.0.1",
|
|
53
53
|
"parse-entities": "2.0.0",
|
|
54
|
+
"path-browserify": "1.0.1",
|
|
54
55
|
"postcss": "7.0.32",
|
|
55
|
-
"postcss-loader": "
|
|
56
|
+
"postcss-loader": "7.1.0",
|
|
57
|
+
"process": "^0.11.10",
|
|
56
58
|
"puppeteer": "14.3.0",
|
|
57
59
|
"puppeteer-cluster": "0.23.0",
|
|
58
60
|
"react-docgen": "5.3.1",
|
|
59
|
-
"react-monaco-editor": "0.
|
|
60
|
-
"react-ssr-prepass": "1.
|
|
61
|
+
"react-monaco-editor": "^0.51.0",
|
|
62
|
+
"react-ssr-prepass": "1.5.0",
|
|
61
63
|
"remark-footnotes": "1.0.0",
|
|
62
64
|
"remark-frontmatter": "2.0.0",
|
|
63
65
|
"remark-mdx": "2.0.0-next.8",
|
|
64
66
|
"remark-mdxjs": "2.0.0-next.8",
|
|
65
67
|
"remark-parse": "8.0.3",
|
|
66
68
|
"remark-squeeze-paragraphs": "4.0.0",
|
|
67
|
-
"responsive-loader": "
|
|
69
|
+
"responsive-loader": "3.1.2",
|
|
68
70
|
"sharp": "0.30.6",
|
|
69
71
|
"style-to-object": "0.3.0",
|
|
70
72
|
"to-vfile": "6.1.0",
|
|
73
|
+
"typedoc": "0.22.X",
|
|
71
74
|
"typescript": "4.3.5",
|
|
72
75
|
"unified": "9.1.0",
|
|
73
76
|
"unist-util-remove": "2.0.0",
|
|
74
77
|
"unist-util-visit": "2.0.3",
|
|
75
78
|
"url-loader": "4.1.0",
|
|
76
79
|
"vfile-reporter": "6.0.1",
|
|
77
|
-
"webpack": "
|
|
78
|
-
"webpack-bundle-analyzer": "
|
|
79
|
-
"webpack-cli": "
|
|
80
|
-
"webpack-dev-server": "
|
|
80
|
+
"webpack": "5.76.3",
|
|
81
|
+
"webpack-bundle-analyzer": "4.8.0",
|
|
82
|
+
"webpack-cli": "5.0.1",
|
|
83
|
+
"webpack-dev-server": "4.13.1",
|
|
81
84
|
"webpack-merge": "5.8.0"
|
|
82
85
|
},
|
|
83
86
|
"peerDependencies": {
|
|
84
|
-
"@patternfly/patternfly": "^5.0.0-alpha.
|
|
85
|
-
"@patternfly/react-code-editor": "^5.0.0-alpha.
|
|
86
|
-
"@patternfly/react-core": "^5.0.0-alpha.
|
|
87
|
-
"@patternfly/react-table": "^5.0.0-alpha.
|
|
87
|
+
"@patternfly/patternfly": "^5.0.0-alpha.64",
|
|
88
|
+
"@patternfly/react-code-editor": "^5.0.0-alpha.116",
|
|
89
|
+
"@patternfly/react-core": "^5.0.0-alpha.115",
|
|
90
|
+
"@patternfly/react-table": "^5.0.0-alpha.117",
|
|
88
91
|
"react": "^17.0.0 || ^18.0.0",
|
|
89
92
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
90
93
|
},
|
|
91
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "2d4e4a47ffbbfdb3f24b6e4a6491020be0fb79c5"
|
|
92
95
|
}
|
package/pages/404/404.css
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.ws-404-card-header {
|
|
8
|
-
padding: var(--pf-global--spacer--lg);
|
|
8
|
+
padding: var(--pf-v5-global--spacer--lg);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
div.ws-404-button-wrapper {
|
|
12
12
|
width: 100%;
|
|
13
13
|
display: flex;
|
|
14
14
|
justify-content: center;
|
|
15
|
-
padding: var(--pf-global--spacer--xl);
|
|
15
|
+
padding: var(--pf-v5-global--spacer--xl);
|
|
16
16
|
}
|
package/pages/404/index.js
CHANGED
|
@@ -73,7 +73,7 @@ const Page404 = () => {
|
|
|
73
73
|
<Title headingLevel="h1" size="2xl">
|
|
74
74
|
404: That page no longer exists
|
|
75
75
|
</Title>
|
|
76
|
-
<p style={{ marginTop: 'var(--pf-global--spacer--sm)' }}>
|
|
76
|
+
<p style={{ marginTop: 'var(--pf-v5-global--spacer--sm)' }}>
|
|
77
77
|
Another page might have the information you need, so try searching PatternFly.
|
|
78
78
|
</p>
|
|
79
79
|
<EmptyStateBody>
|
|
@@ -16,7 +16,7 @@ Global variables define and enforce global style elements (like values for color
|
|
|
16
16
|
|
|
17
17
|
Global variables follow this formula:
|
|
18
18
|
|
|
19
|
-
`--pf-global--concept--PropertyCamelCase--modifier--state`
|
|
19
|
+
`--pf-v5-global--concept--PropertyCamelCase--modifier--state`
|
|
20
20
|
|
|
21
21
|
Where...
|
|
22
22
|
|
|
@@ -30,8 +30,8 @@ Example:
|
|
|
30
30
|
```css
|
|
31
31
|
:root {
|
|
32
32
|
/* Default & hovered link colors */
|
|
33
|
-
--pf-global--link--Color: #06c;
|
|
34
|
-
--pf-global--link--Color--hover: #004080;
|
|
33
|
+
--pf-v5-global--link--Color: #06c;
|
|
34
|
+
--pf-v5-global--link--Color--hover: #004080;
|
|
35
35
|
}
|
|
36
36
|
```
|
|
37
37
|
|
|
@@ -44,33 +44,33 @@ Component variables are used to define custom properties at the component-level.
|
|
|
44
44
|
|
|
45
45
|
Component variables follow this formula:
|
|
46
46
|
|
|
47
|
-
`--pf-c-block__element--modifier--state--breakpoint--['child'|tag|c-component]pseudo-element--PropertyCamelCase`
|
|
47
|
+
`--pf-v5-c-block__element--modifier--state--breakpoint--['child'|tag|c-component]pseudo-element--PropertyCamelCase`
|
|
48
48
|
|
|
49
49
|
Where...
|
|
50
50
|
|
|
51
|
-
- `pf-c-block` refers to the block, usually the component or layout name, like `pf-c-alert`.
|
|
51
|
+
- `pf-v5-c-block` refers to the block, usually the component or layout name, like `pf-v5-c-alert`.
|
|
52
52
|
- `__element` refers to the element inside of the block, like `__title`.
|
|
53
53
|
- `modifier` is prefixed with`-m` and refers to a modifier class such as `.pf-m-danger`.
|
|
54
54
|
- `state` is something like `hover` or `active`.
|
|
55
|
-
- `breakpoint` is a media query breakpoint such as `sm` for `$pf-global--breakpoint--xs`.
|
|
55
|
+
- `breakpoint` is a media query breakpoint such as `sm` for `$pf-v5-global--breakpoint--xs`.
|
|
56
56
|
- `pseudo-element` is either `before` or `after`.
|
|
57
57
|
- `child`, `tag`, or `c-component` refers to a child element. It could be a tag or component name, like `svg` or `c-menu`, or it could use `child` to refer to any child element. If any modifiers, states, breakpoints, or pseudo-elements are on the child, include those after this portion of the name.
|
|
58
58
|
|
|
59
59
|
Example:
|
|
60
60
|
- Note: component variables are scoped to the top-level component selector
|
|
61
61
|
```css
|
|
62
|
-
.pf-c-button {
|
|
62
|
+
.pf-v5-c-button {
|
|
63
63
|
/* Default, primary, and primary hovered button background colors */
|
|
64
|
-
--pf-c-button--BackgroundColor: transparent;
|
|
65
|
-
--pf-c-button--m-primary--BackgroundColor: var(--pf-global--primary-color--100);
|
|
66
|
-
--pf-c-button--m-primary--hover--BackgroundColor: var(--pf-global--primary-color--200);
|
|
64
|
+
--pf-v5-c-button--BackgroundColor: transparent;
|
|
65
|
+
--pf-v5-c-button--m-primary--BackgroundColor: var(--pf-v5-global--primary-color--100);
|
|
66
|
+
--pf-v5-c-button--m-primary--hover--BackgroundColor: var(--pf-v5-global--primary-color--200);
|
|
67
67
|
}
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
<br/>
|
|
71
71
|
Component variables are listed at the bottom of each component page (for example, [button css variables](/components/button#css-variables)).
|
|
72
72
|
|
|
73
|
-
Note that all component variables are declared at the top component level (for example, `.pf-c-button`). The component variable table linked above also shows all usages of each variable and the values they evaluate to in each case - expand any component variable row to view the global variable it is mapped to.
|
|
73
|
+
Note that all component variables are declared at the top component level (for example, `.pf-v5-c-button`). The component variable table linked above also shows all usages of each variable and the values they evaluate to in each case - expand any component variable row to view the global variable it is mapped to.
|
|
74
74
|
|
|
75
75
|

|
|
76
76
|
|
|
@@ -78,25 +78,25 @@ Note that all component variables are declared at the top component level (for e
|
|
|
78
78
|
|
|
79
79
|
PatternFly defines a number of standard breakpoints. These are always used as a `min-width` breakpoint; i.e. using the `-md` breakpoint would apply to everything at the `-md` width and wider. (There is one exception to this, which is in the responsive behavior of the [table component](/components/table).)
|
|
80
80
|
|
|
81
|
-
Breakpoint suffixes are used in utility classes and layouts as well as in many components as a way to apply class styles at a specified breakpoint. When available, `{-on-[breakpoint]}` will be shown as an available suffix for the class in the usage section of the documentation. The breakpoint suffix is optional and if not specified, the base class will be used. There are breakpoints for `sm`, `md`, `lg`, `xl`, and `2xl`, and the values for the corresponding breakpoints are defined below in the global variables `—pf-global—breakpoint—[breakpoint]`.
|
|
81
|
+
Breakpoint suffixes are used in utility classes and layouts as well as in many components as a way to apply class styles at a specified breakpoint. When available, `{-on-[breakpoint]}` will be shown as an available suffix for the class in the usage section of the documentation. The breakpoint suffix is optional and if not specified, the base class will be used. There are breakpoints for `sm`, `md`, `lg`, `xl`, and `2xl`, and the values for the corresponding breakpoints are defined below in the global variables `—pf-v5-global—breakpoint—[breakpoint]`.
|
|
82
82
|
|
|
83
83
|
### Using the variable system
|
|
84
84
|
|
|
85
85
|
PatternFly 4 styles provide a default starting point. You can use the variable system to make adjustments to that default styling. When you change one or more elements, you should package those values into a new SCSS stylesheet to replace the default styling.
|
|
86
86
|
|
|
87
|
-
Overrides to PatternFly variables should be made at the `:root` level for global variables or at the top-level component selector for component variables (for example, `.pf-c-button`), as these overrides will cascade down to children elements accordingly.
|
|
87
|
+
Overrides to PatternFly variables should be made at the `:root` level for global variables or at the top-level component selector for component variables (for example, `.pf-v5-c-button`), as these overrides will cascade down to children elements accordingly.
|
|
88
88
|
|
|
89
89
|
Example:
|
|
90
90
|
- Change the global primary color to red, but keep the original primary blue color as the background for primary buttons.
|
|
91
91
|
```css
|
|
92
92
|
/* Override global primary color 100 to red */
|
|
93
93
|
:root {
|
|
94
|
-
--pf-global--primary-color--100: var(--pf-global--palette--red-400);
|
|
94
|
+
--pf-v5-global--primary-color--100: var(--pf-v5-global--palette--red-400);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
/* Override the above override for only the primary button background color */
|
|
98
|
-
.pf-c-button {
|
|
99
|
-
--pf-c-button--m-primary--BackgroundColor: var(--pf-global--palette--blue-400);
|
|
98
|
+
.pf-v5-c-button {
|
|
99
|
+
--pf-v5-c-button--m-primary--BackgroundColor: var(--pf-v5-global--palette--blue-400);
|
|
100
100
|
}
|
|
101
101
|
```
|
|
102
102
|
|
package/routes.js
CHANGED
|
@@ -9,6 +9,8 @@ const routes = {
|
|
|
9
9
|
...generatedRoutes
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
+
const defaultOrder = 50;
|
|
13
|
+
|
|
12
14
|
for (let route in routes) {
|
|
13
15
|
const pageData = routes[route];
|
|
14
16
|
if (pageData.SyncComponent) {
|
|
@@ -28,7 +30,7 @@ const isNull = o => o === null || o === undefined;
|
|
|
28
30
|
const groupedRoutes = Object.entries(routes)
|
|
29
31
|
.filter(([_slug, { id, section }]) => !isNull(id) && !isNull(section))
|
|
30
32
|
.reduce((accum, [slug, pageData]) => {
|
|
31
|
-
const { section, subsection = null, id, title, source,
|
|
33
|
+
const { section, subsection = null, id, title, source, hideNavItem, relPath, sortValue = null, subsectionSortValue = null } = pageData;
|
|
32
34
|
pageData.slug = slug;
|
|
33
35
|
// add section to groupedRoutes obj if not yet created
|
|
34
36
|
accum[section] = accum[section] || {};
|
|
@@ -40,9 +42,10 @@ const groupedRoutes = Object.entries(routes)
|
|
|
40
42
|
title,
|
|
41
43
|
slug: makeSlug(source, section, id, true, subsection),
|
|
42
44
|
sources: [],
|
|
43
|
-
katacodaLayout,
|
|
44
45
|
hideNavItem,
|
|
45
|
-
relPath
|
|
46
|
+
relPath,
|
|
47
|
+
...(sortValue && { sortValue }),
|
|
48
|
+
...(subsectionSortValue && { subsectionSortValue })
|
|
46
49
|
}
|
|
47
50
|
// add page to groupedRoutes obj section or subsection
|
|
48
51
|
if (subsection) {
|
|
@@ -52,10 +55,21 @@ const groupedRoutes = Object.entries(routes)
|
|
|
52
55
|
// add page to subsection
|
|
53
56
|
accum[section][subsection][id] = accum[section][subsection][id] || data;
|
|
54
57
|
accum[section][subsection][id].sources.push(pageData);
|
|
58
|
+
// nav item ordering
|
|
59
|
+
if (sortValue) {
|
|
60
|
+
accum[section][subsection].sortValue = sortValue;
|
|
61
|
+
}
|
|
62
|
+
if (subsectionSortValue) {
|
|
63
|
+
accum[section][subsection].subsectionSortValue = subsectionSortValue;
|
|
64
|
+
}
|
|
55
65
|
} else {
|
|
56
66
|
// add page to section
|
|
57
67
|
accum[section][id] = accum[section][id] || data;
|
|
58
68
|
accum[section][id].sources.push(pageData);
|
|
69
|
+
// nav item ordering
|
|
70
|
+
if (sortValue) {
|
|
71
|
+
accum[section][id].sortValue = sortValue;
|
|
72
|
+
}
|
|
59
73
|
}
|
|
60
74
|
|
|
61
75
|
return accum;
|
|
@@ -64,16 +78,13 @@ const groupedRoutes = Object.entries(routes)
|
|
|
64
78
|
const sourceOrder = {
|
|
65
79
|
react: 1,
|
|
66
80
|
'react-next': 1.1,
|
|
67
|
-
'react-composable': 1.2,
|
|
68
|
-
'react-deprecated': 1.3,
|
|
69
|
-
'react-legacy': 1.4,
|
|
70
81
|
'react-demos': 2,
|
|
82
|
+
'react-deprecated': 2.1,
|
|
71
83
|
html: 3,
|
|
72
84
|
'html-demos': 4,
|
|
73
85
|
'design-guidelines': 99,
|
|
74
86
|
'accessibility': 100
|
|
75
87
|
};
|
|
76
|
-
const defaultOrder = 50;
|
|
77
88
|
|
|
78
89
|
const sortSources = ({ source: s1 }, { source: s2 }) => {
|
|
79
90
|
const s1Index = sourceOrder[s1] || defaultOrder;
|
|
@@ -108,7 +119,8 @@ Object.entries(groupedRoutes)
|
|
|
108
119
|
// Loop through each page in expandable subsection
|
|
109
120
|
if (pageData.isSubsection) {
|
|
110
121
|
Object.entries(pageData).map(([section, ids]) => {
|
|
111
|
-
|
|
122
|
+
// only push nested page objects
|
|
123
|
+
if (ids && ids?.id) {
|
|
112
124
|
pageDataArr.push(ids);
|
|
113
125
|
}
|
|
114
126
|
})
|
|
@@ -133,8 +145,6 @@ function getAsyncComponent(url) {
|
|
|
133
145
|
if (!url && typeof window !== 'undefined') {
|
|
134
146
|
url = window.location.pathname.replace(/\/$/, '') || '/';
|
|
135
147
|
}
|
|
136
|
-
// Normalize path for matching
|
|
137
|
-
url = url.replace(process.env.pathPrefix, '');
|
|
138
148
|
let res;
|
|
139
149
|
|
|
140
150
|
if (allRoutes[url]) {
|
package/scripts/cli/build.js
CHANGED
|
@@ -50,6 +50,11 @@ async function execFile(file, args) {
|
|
|
50
50
|
const child_execArgv = [
|
|
51
51
|
'--max-old-space-size=4096'
|
|
52
52
|
];
|
|
53
|
+
|
|
54
|
+
if (args.legacySSL) {
|
|
55
|
+
child_execArgv.push('--openssl-legacy-provider')
|
|
56
|
+
}
|
|
57
|
+
|
|
53
58
|
const child = fork(path.join(__dirname, file), child_argv, { execArgv: child_execArgv });
|
|
54
59
|
function errorHandler(err) {
|
|
55
60
|
console.error(err);
|
|
@@ -78,9 +83,9 @@ async function build(cmd, options) {
|
|
|
78
83
|
const config = getConfig(options);
|
|
79
84
|
config.analyze = options.analyze;
|
|
80
85
|
config.output = options.output;
|
|
86
|
+
config.legacySSL = options.legacySSL
|
|
81
87
|
|
|
82
88
|
// These get passed to `fork`ed builds
|
|
83
|
-
process.env.pathPrefix = config.pathPrefix;
|
|
84
89
|
process.env.hasDesignGuidelines = config.hasDesignGuidelines;
|
|
85
90
|
// console.log('build', cmd, options.parent.cssconfig);
|
|
86
91
|
if (toBuild.includes('server')) {
|
package/scripts/cli/cli.js
CHANGED
|
@@ -26,6 +26,7 @@ program
|
|
|
26
26
|
.command('build <server|client|all>')
|
|
27
27
|
.option('-a, --analyze', 'use webpack-bundle-analyzer', false)
|
|
28
28
|
.option('-o, --output <folder>', 'output folder', 'public')
|
|
29
|
+
.option('--legacySSL', 'use legacy version of openssl, needed to support Node 18 until we upgrade webpack to v5', false)
|
|
29
30
|
.description('generates source files and runs webpack')
|
|
30
31
|
.action((cmd, options) => {
|
|
31
32
|
const { build } = require('./build');
|
|
@@ -43,7 +44,8 @@ program
|
|
|
43
44
|
|
|
44
45
|
program
|
|
45
46
|
.command('screenshots')
|
|
46
|
-
.option('-u, --urlPrefix <prefix>', 'where fullscreen pages are hosted', 'http://localhost:5000
|
|
47
|
+
.option('-u, --urlPrefix <prefix>', 'where fullscreen pages are hosted', 'http://localhost:5000')
|
|
48
|
+
.option('-a, --allRoutes', 'true if screenshots of all examples - not just full screen', false)
|
|
47
49
|
.description('updates screenshots for generated components')
|
|
48
50
|
.action(options => {
|
|
49
51
|
const { writeScreenshots } = require('../writeScreenshots');
|
package/scripts/cli/generate.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
-
const { sourceMD, sourceProps, writeIndex } = require('../md/parseMD');
|
|
2
|
+
const { sourceMD, sourceProps, sourceFunctionDocs, writeIndex } = require('../md/parseMD');
|
|
3
3
|
|
|
4
4
|
function getSource(options) {
|
|
5
5
|
return require(path.join(process.cwd(), options.parent.source));
|
|
@@ -9,7 +9,7 @@ function generate(options) {
|
|
|
9
9
|
const start = new Date();
|
|
10
10
|
console.log('write source files to patternfly-docs/generated');
|
|
11
11
|
const sourceMDWithOptions = (glob, source, ignore) => sourceMD(glob, source, ignore, options._name);
|
|
12
|
-
getSource(options)(sourceMDWithOptions, sourceProps);
|
|
12
|
+
getSource(options)(sourceMDWithOptions, sourceProps, sourceFunctionDocs);
|
|
13
13
|
const exitCode = writeIndex();
|
|
14
14
|
if (exitCode !== 0) {
|
|
15
15
|
process.exit(exitCode);
|
package/scripts/cli/start.js
CHANGED
|
@@ -6,17 +6,15 @@ const { getConfig } = require('./helpers');
|
|
|
6
6
|
const { watchMD } = require('../md/parseMD');
|
|
7
7
|
|
|
8
8
|
function startWebpackDevServer(webpackConfig) {
|
|
9
|
-
webpackConfig.devServer.
|
|
10
|
-
webpackConfig.devServer.publicPath = webpackConfig.output.publicPath;
|
|
9
|
+
webpackConfig.devServer.static = false;
|
|
11
10
|
const { port } = webpackConfig.devServer;
|
|
12
11
|
const compiler = webpack(webpackConfig);
|
|
13
|
-
const server = new WebpackDevServer(
|
|
12
|
+
const server = new WebpackDevServer(webpackConfig.devServer, compiler);
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
});
|
|
14
|
+
(async () => {
|
|
15
|
+
await server.start();
|
|
16
|
+
console.log(`Dev server is listening on port ${port}`);
|
|
17
|
+
})();
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
async function start(options) {
|