@patternfly/documentation-framework 2.0.0-alpha.8 → 5.0.1

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.
Files changed (71) hide show
  1. package/CHANGELOG.md +617 -0
  2. package/README.md +1 -1
  3. package/app.js +20 -14
  4. package/assets/Favicon-Light-16x16.png +0 -0
  5. package/assets/Favicon-Light-32x32.png +0 -0
  6. package/assets/Favicon-Light-48x48.png +0 -0
  7. package/assets/Favicon-Light.png +0 -0
  8. package/assets/android-chrome-36x36.png +0 -0
  9. package/assets/android-chrome-48x48.png +0 -0
  10. package/assets/android-chrome-96x96.png +0 -0
  11. package/components/autoLinkHeader/autoLinkHeader.css +2 -2
  12. package/components/autoLinkHeader/autoLinkHeader.js +18 -13
  13. package/components/cssVariables/cssSearch.js +3 -4
  14. package/components/cssVariables/cssVariables.css +4 -4
  15. package/components/cssVariables/cssVariables.js +83 -84
  16. package/components/example/example.css +29 -29
  17. package/components/example/example.js +34 -6
  18. package/components/footer/footer.css +16 -16
  19. package/components/footer/footer.js +16 -16
  20. package/components/functionsTable/functionsTable.js +57 -0
  21. package/components/gdprBanner/gdprBanner.css +2 -2
  22. package/components/gdprBanner/gdprBanner.js +3 -3
  23. package/components/inlineAlert/inlineAlert.js +1 -1
  24. package/components/link/link.js +1 -2
  25. package/components/propsTable/propsTable.js +85 -79
  26. package/components/sectionGallery/TextSummary.js +31 -0
  27. package/components/sectionGallery/sectionDataListLayout.js +51 -0
  28. package/components/sectionGallery/sectionGallery.css +53 -0
  29. package/components/sectionGallery/sectionGallery.js +76 -0
  30. package/components/sectionGallery/sectionGalleryLayout.js +41 -0
  31. package/components/sectionGallery/sectionGalleryToolbar.js +38 -0
  32. package/components/sectionGallery/sectionGalleryWrapper.js +110 -0
  33. package/components/sideNav/sideNav.css +12 -12
  34. package/components/sideNav/sideNav.js +44 -16
  35. package/components/tableOfContents/tableOfContents.css +17 -17
  36. package/helpers/codesandbox.js +3 -5
  37. package/helpers/getTitle.js +2 -2
  38. package/layouts/sideNavLayout/sideNavLayout.css +7 -11
  39. package/layouts/sideNavLayout/sideNavLayout.js +59 -45
  40. package/package.json +28 -29
  41. package/pages/404/404.css +2 -2
  42. package/pages/404/index.js +1 -1
  43. package/pages/global-css-variables.md +16 -16
  44. package/routes.js +20 -10
  45. package/scripts/cli/build.js +0 -1
  46. package/scripts/cli/cli.js +2 -1
  47. package/scripts/cli/generate.js +2 -2
  48. package/scripts/cli/start.js +6 -8
  49. package/scripts/md/parseMD.js +46 -11
  50. package/scripts/md/styled-tags.js +8 -4
  51. package/scripts/tsDocgen.js +119 -91
  52. package/scripts/typeDocGen.js +209 -0
  53. package/scripts/webpack/getHtmlWebpackPlugins.js +1 -2
  54. package/scripts/webpack/prerender.js +1 -2
  55. package/scripts/webpack/webpack.base.config.js +35 -35
  56. package/scripts/webpack/webpack.client.config.js +11 -8
  57. package/scripts/webpack/webpack.server.config.js +8 -5
  58. package/scripts/writeScreenshots.js +3 -3
  59. package/templates/html.ejs +6 -8
  60. package/templates/mdx.css +156 -161
  61. package/templates/mdx.js +122 -51
  62. package/templates/patternfly-docs/content/extensions/extension/design-guidelines/design-guidelines.md +2 -0
  63. package/templates/patternfly-docs/content/extensions/extension/examples/basic.md +2 -0
  64. package/templates/sitemap.ejs +1 -1
  65. package/versions.json +32 -13
  66. package/assets/favicon-16x16.png +0 -0
  67. package/assets/favicon-32x32.png +0 -0
  68. package/assets/favicon-48x48.png +0 -0
  69. package/assets/favicon.ico +0 -0
  70. package/components/topNav/topNav.css +0 -30
  71. 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
- key={version.name}
53
- component={
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
- alignment={{ default: 'alignRight' }}
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
- <DropdownToggle
125
- onToggle={() => setDropdownOpen(!isDropdownOpen)}
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
- </DropdownToggle>
126
+ </MenuToggle>
129
127
  )}
130
- dropdownItems={[
131
- <DropdownGroup key="latest" label="Latest">
128
+ >
129
+ <DropdownGroup key="Latest" label="Latest">
130
+ <DropdownList>
132
131
  {getDropdownItem(latestVersion, true)}
133
- </DropdownGroup>,
134
- <DropdownGroup key="Previous" label="Previous releases">
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
- </DropdownGroup>,
140
- <Divider key="divider" className="ws-switcher-divider"/>,
141
- <DropdownItem
142
- key="PatternFly 3"
143
- className="ws-patternfly-3"
144
- target="_blank"
145
- href="https://pf3.patternfly.org/"
146
- >
147
- PatternFly 3
148
- <ExternalLinkAltIcon />
149
- </DropdownItem>
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
- nav={<SideNav navItems={sideNavItems} groupedRoutes={groupedRoutes} />}
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 || pathPrefix || '/'}>
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,14 +1,10 @@
1
1
  {
2
2
  "name": "@patternfly/documentation-framework",
3
3
  "description": "A framework to build documentation for PatternFly.",
4
- "version": "2.0.0-alpha.8",
4
+ "version": "5.0.1",
5
5
  "author": "Red Hat",
6
6
  "license": "MIT",
7
7
  "private": false,
8
- "publishConfig": {
9
- "access": "public",
10
- "tag": "alpha"
11
- },
12
8
  "bin": {
13
9
  "pf-docs-framework": "scripts/cli/cli.js"
14
10
  },
@@ -22,19 +18,19 @@
22
18
  "@babel/preset-env": "7.18.2",
23
19
  "@mdx-js/util": "1.6.16",
24
20
  "@patternfly/ast-helpers": "^0.4.57",
25
- "@reach/router": "1.3.4",
21
+ "@reach/router": "npm:@gatsbyjs/reach-router@1.3.9",
26
22
  "autoprefixer": "9.8.6",
27
- "babel-loader": "8.2.5",
23
+ "babel-loader": "9.1.2",
28
24
  "camelcase-css": "2.0.1",
29
25
  "chokidar": "3.5.3",
30
- "clean-webpack-plugin": "3.0.0",
26
+ "clean-webpack-plugin": "4.0.0",
31
27
  "codesandbox": "2.2.0",
32
28
  "commander": "4.1.1",
33
- "copy-webpack-plugin": "6.1.0",
34
- "css-loader": "4.3.0",
29
+ "copy-webpack-plugin": "11.0.0",
30
+ "css-loader": "6.7.3",
35
31
  "detab": "2.0.3",
36
32
  "express": "4.18.1",
37
- "file-loader": "6.1.0",
33
+ "file-loader": "6.2.0",
38
34
  "file-saver": "1.3.8",
39
35
  "fs-extra": "9.0.1",
40
36
  "glob": "8.0.3",
@@ -42,51 +38,54 @@
42
38
  "hast-to-hyperscript": "9.0.0",
43
39
  "hast-util-to-text": "2.0.0",
44
40
  "html-formatter": "0.1.9",
45
- "html-webpack-plugin": "4.4.1",
41
+ "html-webpack-plugin": "5.5.0",
46
42
  "js-yaml": "3.14.0",
47
43
  "mdast-util-to-hast": "9.1.1",
48
44
  "mdurl": "1.0.1",
49
- "mini-css-extract-plugin": "1.3.9",
50
- "monaco-editor": "0.21.3",
51
- "monaco-editor-webpack-plugin": "2.1.0",
52
- "null-loader": "4.0.0",
45
+ "mini-css-extract-plugin": "2.7.5",
46
+ "monaco-editor": "0.34.1",
47
+ "monaco-editor-webpack-plugin": "7.0.1",
48
+ "null-loader": "4.0.1",
53
49
  "parse-entities": "2.0.0",
50
+ "path-browserify": "1.0.1",
54
51
  "postcss": "7.0.32",
55
- "postcss-loader": "4.2.0",
52
+ "postcss-loader": "7.1.0",
53
+ "process": "^0.11.10",
56
54
  "puppeteer": "14.3.0",
57
55
  "puppeteer-cluster": "0.23.0",
58
56
  "react-docgen": "5.3.1",
59
- "react-monaco-editor": "0.48.0",
60
- "react-ssr-prepass": "1.2.1",
57
+ "react-monaco-editor": "^0.51.0",
58
+ "react-ssr-prepass": "1.5.0",
61
59
  "remark-footnotes": "1.0.0",
62
60
  "remark-frontmatter": "2.0.0",
63
61
  "remark-mdx": "2.0.0-next.8",
64
62
  "remark-mdxjs": "2.0.0-next.8",
65
63
  "remark-parse": "8.0.3",
66
64
  "remark-squeeze-paragraphs": "4.0.0",
67
- "responsive-loader": "2.1.1",
65
+ "responsive-loader": "3.1.2",
68
66
  "sharp": "0.30.6",
69
67
  "style-to-object": "0.3.0",
70
68
  "to-vfile": "6.1.0",
69
+ "typedoc": "0.22.X",
71
70
  "typescript": "4.3.5",
72
71
  "unified": "9.1.0",
73
72
  "unist-util-remove": "2.0.0",
74
73
  "unist-util-visit": "2.0.3",
75
74
  "url-loader": "4.1.0",
76
75
  "vfile-reporter": "6.0.1",
77
- "webpack": "4.44.1",
78
- "webpack-bundle-analyzer": "3.8.0",
79
- "webpack-cli": "3.3.12",
80
- "webpack-dev-server": "3.11.0",
76
+ "webpack": "5.76.3",
77
+ "webpack-bundle-analyzer": "4.8.0",
78
+ "webpack-cli": "5.0.1",
79
+ "webpack-dev-server": "4.13.1",
81
80
  "webpack-merge": "5.8.0"
82
81
  },
83
82
  "peerDependencies": {
84
- "@patternfly/patternfly": "^5.0.0-alpha.13",
85
- "@patternfly/react-code-editor": "^5.0.0-alpha.7",
86
- "@patternfly/react-core": "^5.0.0-alpha.7",
87
- "@patternfly/react-table": "^5.0.0-alpha.7",
83
+ "@patternfly/patternfly": "5.0.0-prerelease.10",
84
+ "@patternfly/react-code-editor": "5.0.0-prerelease.13",
85
+ "@patternfly/react-core": "5.0.0-prerelease.13",
86
+ "@patternfly/react-table": "5.0.0-prerelease.13",
88
87
  "react": "^17.0.0 || ^18.0.0",
89
88
  "react-dom": "^17.0.0 || ^18.0.0"
90
89
  },
91
- "gitHead": "df59a623a599b2e8848ab898522119baf9c8557d"
90
+ "gitHead": "4f71ca7106465052b069de9d9ac79da061b5e614"
92
91
  }
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
  }
@@ -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
  ![Component variable mapping](./img/component-variable-mapping.png)
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, katacodaLayout, hideNavItem, relPath } = pageData;
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
- if (section !== 'isSubsection') {
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]) {
@@ -86,7 +86,6 @@ async function build(cmd, options) {
86
86
  config.legacySSL = options.legacySSL
87
87
 
88
88
  // These get passed to `fork`ed builds
89
- process.env.pathPrefix = config.pathPrefix;
90
89
  process.env.hasDesignGuidelines = config.hasDesignGuidelines;
91
90
  // console.log('build', cmd, options.parent.cssconfig);
92
91
  if (toBuild.includes('server')) {
@@ -44,7 +44,8 @@ program
44
44
 
45
45
  program
46
46
  .command('screenshots')
47
- .option('-u, --urlPrefix <prefix>', 'where fullscreen pages are hosted', 'http://localhost:5000/v4')
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)
48
49
  .description('updates screenshots for generated components')
49
50
  .action(options => {
50
51
  const { writeScreenshots } = require('../writeScreenshots');
@@ -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);
@@ -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.filename = webpackConfig.output.filename;
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(compiler, webpackConfig.devServer);
12
+ const server = new WebpackDevServer(webpackConfig.devServer, compiler);
14
13
 
15
- server.listen(port, 'localhost', err => {
16
- if (err) {
17
- console.log(err);
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) {