@patternfly/documentation-framework 6.0.0-alpha.8 → 6.0.0-alpha.81

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 (42) hide show
  1. package/CHANGELOG.md +1165 -0
  2. package/app.js +2 -5
  3. package/components/autoLinkHeader/autoLinkHeader.css +2 -2
  4. package/components/autoLinkHeader/autoLinkHeader.js +8 -19
  5. package/components/cssVariables/cssVariables.css +9 -11
  6. package/components/cssVariables/cssVariables.js +19 -32
  7. package/components/example/example.css +14 -58
  8. package/components/example/example.js +149 -78
  9. package/components/example/exampleToolbar.js +3 -2
  10. package/components/footer/footer.css +16 -16
  11. package/components/footer/footer.js +32 -32
  12. package/components/gdprBanner/gdprBanner.css +0 -3
  13. package/components/gdprBanner/gdprBanner.js +22 -16
  14. package/components/inlineAlert/inlineAlert.js +1 -1
  15. package/components/link/link.js +23 -18
  16. package/components/propsTable/propsTable.js +14 -10
  17. package/components/sectionGallery/TextSummary.js +5 -5
  18. package/components/sectionGallery/sectionDataListLayout.js +87 -41
  19. package/components/sectionGallery/sectionGallery.css +6 -39
  20. package/components/sectionGallery/sectionGalleryLayout.js +73 -23
  21. package/components/sectionGallery/sectionGalleryToolbar.js +47 -12
  22. package/components/sideNav/sideNav.js +3 -4
  23. package/components/tableOfContents/tableOfContents.css +26 -35
  24. package/components/tableOfContents/tableOfContents.js +58 -28
  25. package/layouts/sideNavLayout/sideNavLayout.css +1 -36
  26. package/layouts/sideNavLayout/sideNavLayout.js +188 -101
  27. package/package.json +12 -19
  28. package/pages/404/404.css +2 -2
  29. package/pages/404/index.js +23 -36
  30. package/routes.js +3 -1
  31. package/scripts/md/anchor-header.js +1 -1
  32. package/scripts/md/parseMD.js +20 -18
  33. package/scripts/md/styled-tags.js +22 -14
  34. package/scripts/webpack/webpack.base.config.js +7 -18
  35. package/scripts/writeScreenshots.js +2 -2
  36. package/templates/mdx.css +11 -288
  37. package/templates/mdx.js +40 -43
  38. package/templates/patternfly-docs/patternfly-docs.source.js +8 -8
  39. package/versions.json +42 -14
  40. package/components/sideNav/sideNav.css +0 -21
  41. package/pages/global-css-variables.md +0 -109
  42. package/pages/img/component-variable-mapping.png +0 -0
@@ -9,12 +9,10 @@ import {
9
9
  CardHeader,
10
10
  EmptyState,
11
11
  EmptyStateBody,
12
- EmptyStateIcon,
13
12
  Grid,
14
13
  GridItem,
15
14
  PageSection,
16
15
  TextInput,
17
- Title
18
16
  } from '@patternfly/react-core';
19
17
  import { attachDocSearch } from '../../layouts/sideNavLayout/sideNavLayout';
20
18
  import PathMissingIcon from './404.svg';
@@ -24,31 +22,16 @@ import ComponentsIcon from './components.svg';
24
22
  import ChartIcon from './chart.svg';
25
23
  import './404.css';
26
24
 
27
- const Card404 = ({
28
- img,
29
- alt,
30
- title,
31
- body,
32
- link: {
33
- text,
34
- to
35
- }
36
- }) => (
25
+ const Card404 = ({ img, alt, title, body, link: { text, to } }) => (
37
26
  <GridItem xl={3} md={6} xs={12}>
38
27
  <Card style={{ height: '340px' }}>
39
28
  <CardHeader className="ws-404-card-header">
40
29
  <img src={img} alt={alt} width="64px" />
41
30
  </CardHeader>
42
- <CardTitle>
43
- {title}
44
- </CardTitle>
45
- <CardBody>
46
- {body}
47
- </CardBody>
31
+ <CardTitle>{title}</CardTitle>
32
+ <CardBody>{body}</CardBody>
48
33
  <CardFooter>
49
- <Link to={to}>
50
- {text}
51
- </Link>
34
+ <Link to={to}>{text}</Link>
52
35
  </CardFooter>
53
36
  </Card>
54
37
  </GridItem>
@@ -65,20 +48,24 @@ const Page404 = () => {
65
48
  attachDocSearch(algolia, '#ws-404-search', 1000);
66
49
  }
67
50
  });
68
-
51
+
69
52
  return (
70
53
  <PageSection>
71
- <EmptyState variant="xl">
72
- <EmptyStateIcon icon={() => <img src={PathMissingIcon} alt="Missing path" width="128px" />} />
73
- <Title headingLevel="h1" size="2xl">
74
- 404: That page no longer exists
75
- </Title>
76
- <p style={{ marginTop: 'var(--pf-v5-global--spacer--sm)' }}>
77
- Another page might have the information you need, so try searching PatternFly.
78
- </p>
54
+ <EmptyState
55
+ headingLevel="h1"
56
+ titleText="404: That page no longer exists"
57
+ variant="xl"
58
+ icon={() => <img src={PathMissingIcon} alt="" width="128px" />}
59
+ >
60
+ Another page might have the information you need, so try searching
61
+ PatternFly.
79
62
  <EmptyStateBody>
80
63
  <div id="ws-404-search-wrapper">
81
- <TextInput id="ws-404-search" type="text" placeholder="Search PatternFly" />
64
+ <TextInput
65
+ id="ws-404-search"
66
+ type="text"
67
+ placeholder="Search PatternFly"
68
+ />
82
69
  </div>
83
70
  </EmptyStateBody>
84
71
  </EmptyState>
@@ -90,7 +77,7 @@ const Page404 = () => {
90
77
  body="Learn about designing and developing with PatternFly."
91
78
  link={{
92
79
  text: 'View getting started resources',
93
- to: '/get-started/about'
80
+ to: '/get-started/about-patternfly',
94
81
  }}
95
82
  />
96
83
  <Card404
@@ -100,7 +87,7 @@ const Page404 = () => {
100
87
  body="Check out PatternFly's design approach to icons, colors, and more."
101
88
  link={{
102
89
  text: 'View guidelines',
103
- to: '/design-foundations/colors'
90
+ to: '/design-foundations/colors',
104
91
  }}
105
92
  />
106
93
  <Card404
@@ -110,7 +97,7 @@ const Page404 = () => {
110
97
  body="Start creating your applications with components -- the building blocks of user interfaces."
111
98
  link={{
112
99
  text: 'View components',
113
- to: '/components/about-modal'
100
+ to: '/components/about-modal',
114
101
  }}
115
102
  />
116
103
  <Card404
@@ -120,7 +107,7 @@ const Page404 = () => {
120
107
  body="Visualize your facts and figures by designing the right charts for your data."
121
108
  link={{
122
109
  text: 'View charts',
123
- to: '/charts/about'
110
+ to: '/charts/about',
124
111
  }}
125
112
  />
126
113
  </Grid>
@@ -131,6 +118,6 @@ const Page404 = () => {
131
118
  </div>
132
119
  </PageSection>
133
120
  );
134
- }
121
+ };
135
122
 
136
123
  export default Page404;
package/routes.js CHANGED
@@ -83,7 +83,9 @@ const sourceOrder = {
83
83
  html: 3,
84
84
  'html-demos': 4,
85
85
  'design-guidelines': 99,
86
- 'accessibility': 100
86
+ 'accessibility': 100,
87
+ 'upgrade-guide': 101,
88
+ 'release-notes': 102,
87
89
  };
88
90
 
89
91
  const sortSources = ({ source: s1 }, { source: s2 }) => {
@@ -42,7 +42,7 @@ function anchorHeader(tocCallback) {
42
42
  // Add to TOC for indexing
43
43
  addTOCItem(tocItem, node.tagName);
44
44
 
45
- node.properties.size = node.tagName;
45
+ node.properties.headingLevel = node.tagName;
46
46
  node.properties.className = node.properties.className || '';
47
47
  node.properties.className += node.properties.className ? ' ' : '';
48
48
  node.properties.className += `ws-title ws-${node.tagName}`;
@@ -105,6 +105,7 @@ function toReactComponent(mdFilePath, source, buildMode) {
105
105
  section: frontmatter.section || '',
106
106
  subsection: frontmatter.subsection || '',
107
107
  deprecated: frontmatter.deprecated || false,
108
+ template: frontmatter.template || false,
108
109
  beta: frontmatter.beta || false,
109
110
  demo: frontmatter.demo || false,
110
111
  newImplementationLink: frontmatter.newImplementationLink || false,
@@ -213,24 +214,24 @@ function toReactComponent(mdFilePath, source, buildMode) {
213
214
  pageData.examples.push(node.title);
214
215
  }
215
216
  // Typecheck TS examples
216
- if (node.properties.lang === 'ts') {
217
- const typerrors = typecheck(
218
- path.join(pageData.id, node.title + '.tsx'), // Needs to be unique per-example
219
- node.properties.code
220
- );
221
- typerrors.forEach(({ line, character, message }) => {
222
- line = node.position.start.line + line + 1;
223
- const column = character;
224
- if (buildMode === 'start') {
225
- // Don't fail to start over types
226
- file.message(`\u001b[31m THIS WILL FAIL THE BUILD\u001b[0m\n ${message}`, { line, column });
227
- } else {
228
- console.log('\u001b[31m');
229
- file.fail(`\n ${message}\n`, { line, column });
230
- console.log('\u001b[0m');
231
- }
232
- });
233
- }
217
+ // if (node.properties.lang === 'ts') {
218
+ // const typerrors = typecheck(
219
+ // path.join(pageData.id, node.title + '.tsx'), // Needs to be unique per-example
220
+ // node.properties.code
221
+ // );
222
+ // typerrors.forEach(({ line, character, message }) => {
223
+ // line = node.position.start.line + line + 1;
224
+ // const column = character;
225
+ // if (buildMode === 'start') {
226
+ // // Don't fail to start over types
227
+ // file.message(`\u001b[31m THIS WILL FAIL THE BUILD\u001b[0m\n ${message}`, { line, column });
228
+ // } else {
229
+ // console.log('\u001b[31m');
230
+ // file.fail(`\n ${message}\n`, { line, column });
231
+ // console.log('\u001b[0m');
232
+ // }
233
+ // });
234
+ // }
234
235
  });
235
236
  })
236
237
  // Add custom PatternFly doc design things
@@ -295,6 +296,7 @@ function sourceMDFile(file, source, buildMode) {
295
296
  ...(pageData.hideNavItem && { hideNavItem: pageData.hideNavItem }),
296
297
  ...(pageData.beta && { beta: pageData.beta }),
297
298
  ...(pageData.deprecated && { deprecated: pageData.deprecated }),
299
+ ...(pageData.template && { template: pageData.template }),
298
300
  ...(pageData.demo && { demo: pageData.demo }),
299
301
  ...(pageData.sortValue && { sortValue: pageData.sortValue }),
300
302
  ...(pageData.subsectionSortValue && { subsectionSortValue: pageData.subsectionSortValue })
@@ -1,10 +1,8 @@
1
1
  const visit = require('unist-util-visit');
2
2
 
3
- const styledMdTags = [
3
+ const contentStyledMdTags = [
4
4
  'p',
5
5
  'ul',
6
- 'ul',
7
- 'ul',
8
6
  'ol',
9
7
  'li',
10
8
  'dl',
@@ -12,35 +10,45 @@ const styledMdTags = [
12
10
  'small',
13
11
  'hr',
14
12
  'dt',
13
+ 'dd'
14
+ ];
15
+
16
+ const styledMdTags = [
17
+ ...contentStyledMdTags,
15
18
  'code',
16
19
  'table',
17
20
  'img'
18
- ];
21
+ ]
19
22
 
20
23
  function styledTags() {
21
24
  return tree => {
22
25
  visit(tree, 'element', node => {
26
+ node.properties.className = node.properties.className || '';
27
+
28
+ if (contentStyledMdTags.includes(node.tagName)) {
29
+ node.properties.className += `pf-v6-c-content--${node.tagName}`;
30
+ }
31
+
23
32
  if (styledMdTags.includes(node.tagName)) {
24
- node.properties.className = node.properties.className || '';
25
33
  node.properties.className += node.properties.className ? ' ' : '';
26
- node.properties.className += `ws-${node.tagName}`;
27
- // Match pf-v5-c-table implementation
34
+ node.properties.className += `ws-${node.tagName} `;
35
+ // Match pf-v6-c-table implementation
28
36
  // https://pf4.patternfly.org/components/table/html/basic-table/
29
37
  if (node.tagName === 'table') {
30
- node.properties.className += ' pf-v5-c-table pf-m-grid-lg pf-m-compact';
38
+ node.properties.className += ' pf-v6-c-table pf-m-grid-lg pf-m-compact';
31
39
  node.properties.role = 'grid';
32
40
  let columnHeaders = [];
33
41
  for (let child of node.children) {
34
42
  if (child.tagName === 'thead') {
35
- child.properties.className = 'pf-v5-c-table__thead';
43
+ child.properties.className = 'pf-v6-c-table__thead';
36
44
  // Find column headers
37
45
  const tr = child.children.find(child => child.tagName === 'tr');
38
46
  tr.properties.role = 'row';
39
- tr.properties.className = 'pf-v5-c-table__tr';
47
+ tr.properties.className = 'pf-v6-c-table__tr';
40
48
  tr.children
41
49
  .filter(child => child.tagName === 'th')
42
50
  .forEach(th => {
43
- th.properties.className = `${th.properties.className} pf-v5-c-table__th pf-m-wrap`;
51
+ th.properties.className = `${th.properties.className} pf-v6-c-table__th pf-m-wrap`;
44
52
  th.properties.role = 'columnheader';
45
53
  th.properties.scope = 'col';
46
54
  let colName = '';
@@ -57,17 +65,17 @@ function styledTags() {
57
65
  }
58
66
  else if (child.tagName === 'tbody') {
59
67
  child.properties.role = 'rowgroup';
60
- child.properties.className = 'pf-v5-c-table__tbody';
68
+ child.properties.className = 'pf-v6-c-table__tbody';
61
69
  child.children
62
70
  .filter(tr => tr.tagName === 'tr')
63
71
  .forEach(tr => {
64
72
  tr.properties.role = 'row';
65
- tr.properties.className = 'pf-v5-c-table__tr';
73
+ tr.properties.className = 'pf-v6-c-table__tr';
66
74
  tr.children
67
75
  .filter(td => td.tagName === 'td')
68
76
  .forEach((td, i) => {
69
77
  td.properties.role = 'cell';
70
- td.properties.className = 'pf-v5-c-table__td';
78
+ td.properties.className = 'pf-v6-c-table__td';
71
79
  if (columnHeaders[i]) {
72
80
  td.properties['data-label'] = columnHeaders[i];
73
81
  }
@@ -2,7 +2,6 @@ const path = require('path');
2
2
  const webpack = require('webpack');
3
3
  const { CleanWebpackPlugin } = require('clean-webpack-plugin');
4
4
  const CopyWebpackPlugin = require('copy-webpack-plugin');
5
- const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
6
5
 
7
6
  module.exports = (_env, argv) => {
8
7
  const {
@@ -47,6 +46,7 @@ module.exports = (_env, argv) => {
47
46
  /react-[\w-]+\\src\\.*\\examples/, // fix for Windows
48
47
  /react-[\w-]+\/patternfly-docs\/.*\/examples/, //fixes for extensions
49
48
  /react-[\w-]+\\patternfly-docs\\.*\\examples/,
49
+ path.resolve(__dirname, '../../../../node_modules/@patternfly/design-tokens/patternfly-docs/content')
50
50
  ].concat(includePaths.map(path => new RegExp(path))),
51
51
  exclude: [
52
52
  path.resolve(__dirname, '../../node_modules'), // Temporarily compile theme using webpack for development
@@ -56,20 +56,12 @@ module.exports = (_env, argv) => {
56
56
  options: {
57
57
  cacheDirectory: '.cache/babel',
58
58
  cacheCompression: false,
59
- presets: [['@babel/preset-env', {
60
- loose: true,
61
- corejs: 3,
62
- useBuiltIns: 'entry',
63
- exclude: ['transform-regenerator', 'transform-async-to-generator'],
64
- modules: false,
65
- targets: "> 0.25%, not dead"
66
- }]],
67
- plugins: [
68
- '@babel/plugin-transform-react-jsx',
69
- '@babel/plugin-proposal-class-properties',
70
- '@babel/plugin-proposal-optional-chaining',
71
- ["@babel/plugin-proposal-private-methods", { "loose": false }],
72
- ["@babel/plugin-proposal-private-property-in-object", { "loose": false }]
59
+ presets: [
60
+ '@babel/preset-react',
61
+ ['@babel/preset-env', {
62
+ loose: true,
63
+ targets: '> 1%, not dead'
64
+ }],
73
65
  ],
74
66
  }
75
67
  },
@@ -155,9 +147,6 @@ module.exports = (_env, argv) => {
155
147
  patterns: [
156
148
  { from: path.join(__dirname, '../../assets'), to: 'assets' }
157
149
  ]
158
- }),
159
- new MonacoWebpackPlugin({
160
- globalAPI: true,
161
150
  })
162
151
  ],
163
152
  stats: 'minimal'
@@ -11,7 +11,7 @@ sharp.cache(false);
11
11
  async function writeScreenshot({ page, data: { url, urlPrefix } }) {
12
12
  await page.goto(url);
13
13
  await page.addStyleTag({content: '*,*::before,*::after{animation-delay:-1ms !important;animation-duration:1ms !important;animation-iteration-count:1 !important;transition-duration:0s !important;transition-delay:0s !important;}'}); // disable animations/transitions so they don't interfere with screenshot tool
14
- await page.waitForSelector('.pf-v5-u-h-100');
14
+ await page.waitForSelector('.pf-v6-u-h-100');
15
15
  const outfile = path.join(
16
16
  screenshotBase,
17
17
  url.replace(`${urlPrefix}/`, '') + '.png'
@@ -32,7 +32,7 @@ async function writeScreenshots({ urlPrefix, allRoutes, filterTerm }) {
32
32
  concurrency: Cluster.CONCURRENCY_CONTEXT,
33
33
  maxConcurrency: os.cpus().length,
34
34
  puppeteerOptions: {
35
- headless: true, // set to false for testing...
35
+ headless: 'new', // set to false for testing...
36
36
  args: ["--no-sandbox", "--disable-setuid-sandbox"],
37
37
  defaultViewport: {width: 1920, height: 1080}
38
38
  }