@patternfly/documentation-framework 2.0.0-alpha.42 → 2.0.0-alpha.44
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/autoLinkHeader/autoLinkHeader.js +18 -13
- package/components/cssVariables/cssVariables.js +5 -6
- package/components/example/example.js +31 -3
- package/components/sideNav/sideNav.js +25 -10
- package/package.json +6 -6
- package/routes.js +1 -3
- package/scripts/md/parseMD.js +6 -3
- package/scripts/md/styled-tags.js +6 -2
- package/templates/mdx.js +68 -14
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
|
+
# 2.0.0-alpha.44 (2023-05-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @patternfly/documentation-framework
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# 2.0.0-alpha.43 (2023-05-25)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **labels:** add deprecated/demo/beta labels to headers + nav items ([#3547](https://github.com/patternfly/patternfly-org/issues/3547)) ([010a0e0](https://github.com/patternfly/patternfly-org/commit/010a0e05baea661964660d2a733569a34abbf243))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# 2.0.0-alpha.42 (2023-05-18)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @patternfly/documentation-framework
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Title } from '@patternfly/react-core';
|
|
2
|
+
import { Title, Flex, FlexItem } from '@patternfly/react-core';
|
|
3
3
|
import LinkIcon from '@patternfly/react-icons/dist/esm/icons/link-icon';
|
|
4
4
|
import { Link } from '../link/link';
|
|
5
5
|
import { slugger } from '../../helpers/slugger';
|
|
@@ -25,17 +25,22 @@ export const AutoLinkHeader = ({
|
|
|
25
25
|
const slug = id || slugger(children);
|
|
26
26
|
|
|
27
27
|
return (
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
<Flex alignItems={{ default: 'alignItemsCenter'}} spaceItems={{ default: 'spaceItemsNone' }}>
|
|
29
|
+
<FlexItem>
|
|
30
|
+
<Title
|
|
31
|
+
id={slug}
|
|
32
|
+
size={sizes[size]}
|
|
33
|
+
headingLevel={headingLevel || size}
|
|
34
|
+
className={`ws-heading ${className}`}
|
|
35
|
+
tabIndex={-1}
|
|
36
|
+
>
|
|
37
|
+
<Link href={`#${slug}`} className="ws-heading-anchor" tabIndex="-1" aria-hidden>
|
|
38
|
+
<LinkIcon className="ws-heading-anchor-icon" style={{ verticalAlign: 'middle' }} />
|
|
39
|
+
</Link>
|
|
40
|
+
{children}
|
|
41
|
+
</Title>
|
|
42
|
+
</FlexItem>
|
|
43
|
+
<FlexItem> {metaText}</FlexItem>
|
|
44
|
+
</Flex>
|
|
40
45
|
)
|
|
41
46
|
};
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
Tbody,
|
|
9
9
|
Td
|
|
10
10
|
} from "@patternfly/react-table";
|
|
11
|
+
import { AutoLinkHeader } from "../autoLinkHeader/autoLinkHeader";
|
|
11
12
|
import * as tokensModule from "@patternfly/react-tokens/dist/esm/componentIndex";
|
|
12
13
|
import global_spacer_md from "@patternfly/react-tokens/dist/esm/global_spacer_md";
|
|
13
14
|
import LevelUpAltIcon from "@patternfly/react-icons/dist/esm/icons/level-up-alt-icon";
|
|
@@ -59,12 +60,9 @@ const flattenList = files => {
|
|
|
59
60
|
export class CSSVariables extends React.Component {
|
|
60
61
|
constructor(props) {
|
|
61
62
|
super(props);
|
|
62
|
-
|
|
63
|
-
this.prefix =
|
|
64
|
-
typeof props.prefix === "string" ? [props.prefix] : props.prefix;
|
|
65
|
-
const prefixTokens = this.prefix.map(prefix => prefix.replace("pf-", "").replace(/-+/g, "_"));
|
|
63
|
+
const prefixToken = props.prefix.replace("pf-v5-", "").replace(/-+/g, "_");
|
|
66
64
|
const applicableFiles = Object.entries(tokensModule)
|
|
67
|
-
.filter(([key, val]) =>
|
|
65
|
+
.filter(([key, val]) => prefixToken === key)
|
|
68
66
|
.sort(([key1], [key2]) => key1.localeCompare(key2))
|
|
69
67
|
.map(([key, val]) => {
|
|
70
68
|
if (props.selector) {
|
|
@@ -170,10 +168,11 @@ export class CSSVariables extends React.Component {
|
|
|
170
168
|
render() {
|
|
171
169
|
return (
|
|
172
170
|
<React.Fragment>
|
|
171
|
+
{this.props.autoLinkHeader && <AutoLinkHeader size="h3" className="pf-v5-u-mt-lg pf-v5-u-mb-md">{`Prefixed with '${this.props.prefix}'`}</AutoLinkHeader>}
|
|
173
172
|
<CSSSearch getDebouncedFilteredRows={this.getDebouncedFilteredRows} />
|
|
174
173
|
<Table
|
|
175
174
|
variant="compact"
|
|
176
|
-
aria-label={`CSS Variables
|
|
175
|
+
aria-label={`CSS Variables prefixed with ${this.props.prefix}`}
|
|
177
176
|
>
|
|
178
177
|
<Thead>
|
|
179
178
|
<Tr>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useLocation } from '@reach/router';
|
|
3
|
-
import {
|
|
3
|
+
import { Button, CodeBlock, CodeBlockCode, debounce, Label, Switch, Tooltip } from '@patternfly/react-core';
|
|
4
4
|
import * as reactCoreModule from '@patternfly/react-core';
|
|
5
5
|
import * as reactCoreNextModule from '@patternfly/react-core/next';
|
|
6
6
|
import * as reactCoreDeprecatedModule from '@patternfly/react-core/deprecated';
|
|
@@ -71,7 +71,11 @@ export const Example = ({
|
|
|
71
71
|
// The image src thumbnail for the example
|
|
72
72
|
thumbnail = missingThumbnail,
|
|
73
73
|
// Whether the example shows demo capability
|
|
74
|
+
isDemo,
|
|
75
|
+
// Whether the example is open to further evolution
|
|
74
76
|
isBeta,
|
|
77
|
+
// Whether the example is deprecated
|
|
78
|
+
isDeprecated,
|
|
75
79
|
// Slugified source + title
|
|
76
80
|
id,
|
|
77
81
|
// Section in frontmatter of MD file (components, demos, etc)
|
|
@@ -173,12 +177,36 @@ export const Example = ({
|
|
|
173
177
|
+ (loc.pathname.endsWith(source) ? '' : `/${source}`)
|
|
174
178
|
+ '/'
|
|
175
179
|
+ slugger(title);
|
|
176
|
-
|
|
180
|
+
|
|
177
181
|
return (
|
|
178
182
|
<div className="ws-example">
|
|
179
183
|
<div className="ws-example-header">
|
|
180
184
|
<AutoLinkHeader
|
|
181
|
-
metaText={
|
|
185
|
+
metaText={
|
|
186
|
+
<React.Fragment>
|
|
187
|
+
{isBeta && (
|
|
188
|
+
<Tooltip content="This beta component is currently under review and is still open for further evolution.">
|
|
189
|
+
<Button variant="plain">
|
|
190
|
+
<Label isCompact color="blue">Beta</Label>
|
|
191
|
+
</Button>
|
|
192
|
+
</Tooltip>
|
|
193
|
+
)}
|
|
194
|
+
{isDemo && (
|
|
195
|
+
<Tooltip content="Demos show how multiple components can be used in a single design.">
|
|
196
|
+
<Button variant="plain">
|
|
197
|
+
<Label isCompact color="purple">Demo</Label>
|
|
198
|
+
</Button>
|
|
199
|
+
</Tooltip>
|
|
200
|
+
)}
|
|
201
|
+
{isDeprecated && (
|
|
202
|
+
<Tooltip content="Deprecated components are available for use but are no longer being maintained or enhanced.">
|
|
203
|
+
<Button variant="plain">
|
|
204
|
+
<Label isCompact color="grey">Deprecated</Label>
|
|
205
|
+
</Button>
|
|
206
|
+
</Tooltip>
|
|
207
|
+
)}
|
|
208
|
+
</React.Fragment>
|
|
209
|
+
}
|
|
182
210
|
size="h4"
|
|
183
211
|
headingLevel="h3"
|
|
184
212
|
className="ws-example-heading"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Link } from '../link/link';
|
|
3
|
-
import { Nav, NavList, NavExpandable, PageContextConsumer, capitalize } from '@patternfly/react-core';
|
|
3
|
+
import { Label, Nav, NavList, NavExpandable, PageContextConsumer, capitalize, Flex, FlexItem } from '@patternfly/react-core';
|
|
4
4
|
import { css } from '@patternfly/react-styles';
|
|
5
5
|
import { Location } from '@reach/router';
|
|
6
6
|
import { makeSlug } from '../../helpers';
|
|
@@ -14,12 +14,12 @@ const getIsActive = (location, section, subsection = null) => {
|
|
|
14
14
|
|
|
15
15
|
const defaultValue = 50;
|
|
16
16
|
|
|
17
|
-
const NavItem = ({ text, href }) => {
|
|
17
|
+
const NavItem = ({ text, href, isDeprecated, isBeta, isDemo }) => {
|
|
18
18
|
const isMobileView = window.innerWidth < Number.parseInt(globalBreakpointXl.value, 10);
|
|
19
19
|
return (
|
|
20
20
|
<PageContextConsumer key={href + text}>
|
|
21
21
|
{({onNavToggle, isNavOpen }) => (
|
|
22
|
-
<li key={href + text} className="pf-v5-c-nav__item" onClick={() => isMobileView && onNavToggle()}>
|
|
22
|
+
<li key={href + text} className="pf-v5-c-nav__item" onClick={() => isMobileView && onNavToggle && onNavToggle()}>
|
|
23
23
|
<Link
|
|
24
24
|
to={href}
|
|
25
25
|
getProps={({ isCurrent, href, location }) => {
|
|
@@ -33,7 +33,18 @@ const NavItem = ({ text, href }) => {
|
|
|
33
33
|
}
|
|
34
34
|
tabIndex={isNavOpen ? undefined : -1}
|
|
35
35
|
>
|
|
36
|
-
{
|
|
36
|
+
<Flex spaceItems={{ default: 'spaceItemsSm'}}>
|
|
37
|
+
<FlexItem>{text}</FlexItem>
|
|
38
|
+
{(isBeta || isDemo || isDeprecated) && (
|
|
39
|
+
<FlexItem>
|
|
40
|
+
{isBeta && (<Label color="blue" isCompact>Beta</Label>)}
|
|
41
|
+
{!isBeta && isDemo && (<Label color="purple" isCompact>Demo</Label>)}
|
|
42
|
+
{!isBeta && !isDemo && isDeprecated && (<Label color="grey" isCompact>Deprecated</Label>)}
|
|
43
|
+
</FlexItem>
|
|
44
|
+
)}
|
|
45
|
+
</Flex>
|
|
46
|
+
|
|
47
|
+
|
|
37
48
|
</Link>
|
|
38
49
|
</li>
|
|
39
50
|
)}
|
|
@@ -70,7 +81,7 @@ const ExpandableNav = ({groupedRoutes, location, section, subsection = null}) =>
|
|
|
70
81
|
>
|
|
71
82
|
{Object.entries(routes || {})
|
|
72
83
|
.filter(([id, navObj]) => !Boolean(navObj.hideNavItem) && (Object.entries(navObj).length > 0))
|
|
73
|
-
.map(([id, { slug, isSubsection = false, sortValue = defaultValue, subsectionSortValue = defaultValue }]) => ({ text: id, href: slug, isSubsection, sortValue: (isSubsection ? subsectionSortValue : sortValue) }))
|
|
84
|
+
.map(([id, { slug, isSubsection = false, sortValue = defaultValue, subsectionSortValue = defaultValue, sources }]) => ({ text: id, href: slug, isSubsection, sortValue: (isSubsection ? subsectionSortValue : sortValue), sources }))
|
|
74
85
|
.sort(({text: text1, sortValue: sortValue1}, {text: text2, sortValue: sortValue2}) => {
|
|
75
86
|
if (sortValue1 === sortValue2) {
|
|
76
87
|
return text1.localeCompare(text2);
|
|
@@ -78,10 +89,14 @@ const ExpandableNav = ({groupedRoutes, location, section, subsection = null}) =>
|
|
|
78
89
|
return sortValue1 > sortValue2 ? 1 : -1;
|
|
79
90
|
})
|
|
80
91
|
.map(navObj => navObj.isSubsection
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
92
|
+
? ExpandableNav({groupedRoutes, location, section, subsection: navObj.text})
|
|
93
|
+
: NavItem({
|
|
94
|
+
...navObj,
|
|
95
|
+
isDeprecated: navObj.href?.includes('components') && navObj.sources.some(source => source.source === "react-deprecated") && !navObj.sources.some(source => source.source === "react"),
|
|
96
|
+
isBeta: navObj.sources.some(source => source.beta),
|
|
97
|
+
isDemo: navObj.sources.some(source => source.source === "react-demos" || source.source === "html-demos") && !navObj.sources.some(source => source.source === "react" || source.source === "html")
|
|
98
|
+
})
|
|
99
|
+
)}
|
|
85
100
|
</NavExpandable>
|
|
86
101
|
);
|
|
87
102
|
}
|
|
@@ -101,7 +116,7 @@ export const SideNav = ({ groupedRoutes = {}, navItems = [] }) => {
|
|
|
101
116
|
lastElement.scrollIntoView({ block: 'center' });
|
|
102
117
|
}
|
|
103
118
|
}, []);
|
|
104
|
-
|
|
119
|
+
|
|
105
120
|
return (
|
|
106
121
|
<Nav aria-label="Side Nav" theme="light">
|
|
107
122
|
<NavList className="ws-side-nav-list">
|
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.44",
|
|
5
5
|
"author": "Red Hat",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"private": false,
|
|
@@ -84,12 +84,12 @@
|
|
|
84
84
|
"webpack-merge": "5.8.0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@patternfly/patternfly": "^5.0.0-alpha.
|
|
88
|
-
"@patternfly/react-code-editor": "^5.0.0-alpha.
|
|
89
|
-
"@patternfly/react-core": "^5.0.0-alpha.
|
|
90
|
-
"@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",
|
|
91
91
|
"react": "^17.0.0 || ^18.0.0",
|
|
92
92
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "eea3ab5ab5fb2eebf30ebda97b41739ae3ddf60e"
|
|
95
95
|
}
|
package/routes.js
CHANGED
|
@@ -78,10 +78,8 @@ const groupedRoutes = Object.entries(routes)
|
|
|
78
78
|
const sourceOrder = {
|
|
79
79
|
react: 1,
|
|
80
80
|
'react-next': 1.1,
|
|
81
|
-
'react-composable': 1.2,
|
|
82
|
-
'react-deprecated': 1.3,
|
|
83
|
-
'react-legacy': 1.4,
|
|
84
81
|
'react-demos': 2,
|
|
82
|
+
'react-deprecated': 2.1,
|
|
85
83
|
html: 3,
|
|
86
84
|
'html-demos': 4,
|
|
87
85
|
'design-guidelines': 99,
|
package/scripts/md/parseMD.js
CHANGED
|
@@ -104,6 +104,10 @@ function toReactComponent(mdFilePath, source, buildMode) {
|
|
|
104
104
|
id: frontmatter.id,
|
|
105
105
|
section: frontmatter.section || '',
|
|
106
106
|
subsection: frontmatter.subsection || '',
|
|
107
|
+
deprecated: frontmatter.deprecated || false,
|
|
108
|
+
beta: frontmatter.beta || false,
|
|
109
|
+
demo: frontmatter.demo || false,
|
|
110
|
+
newImplementationLink: frontmatter.newImplementationLink || false,
|
|
107
111
|
source,
|
|
108
112
|
tabName: frontmatter.tabName || null,
|
|
109
113
|
slug,
|
|
@@ -133,9 +137,6 @@ function toReactComponent(mdFilePath, source, buildMode) {
|
|
|
133
137
|
if (frontmatter.optIn) {
|
|
134
138
|
pageData.optIn = frontmatter.optIn;
|
|
135
139
|
}
|
|
136
|
-
if (frontmatter.beta) {
|
|
137
|
-
pageData.beta = frontmatter.beta;
|
|
138
|
-
}
|
|
139
140
|
if (frontmatter.cssPrefix) {
|
|
140
141
|
pageData.cssPrefix = Array.isArray(frontmatter.cssPrefix)
|
|
141
142
|
? frontmatter.cssPrefix
|
|
@@ -293,6 +294,8 @@ function sourceMDFile(file, source, buildMode) {
|
|
|
293
294
|
tabName: pageData.tabName,
|
|
294
295
|
...(pageData.hideNavItem && { hideNavItem: pageData.hideNavItem }),
|
|
295
296
|
...(pageData.beta && { beta: pageData.beta }),
|
|
297
|
+
...(pageData.deprecated && { deprecated: pageData.deprecated }),
|
|
298
|
+
...(pageData.demo && { demo: pageData.demo }),
|
|
296
299
|
...(pageData.sortValue && { sortValue: pageData.sortValue }),
|
|
297
300
|
...(pageData.subsectionSortValue && { subsectionSortValue: pageData.subsectionSortValue })
|
|
298
301
|
};
|
|
@@ -32,14 +32,15 @@ function styledTags() {
|
|
|
32
32
|
let columnHeaders = [];
|
|
33
33
|
for (let child of node.children) {
|
|
34
34
|
if (child.tagName === 'thead') {
|
|
35
|
+
child.properties.className = 'pf-v5-c-table__thead';
|
|
35
36
|
// Find column headers
|
|
36
37
|
const tr = child.children.find(child => child.tagName === 'tr');
|
|
37
38
|
tr.properties.role = 'row';
|
|
39
|
+
tr.properties.className = 'pf-v5-c-table__tr';
|
|
38
40
|
tr.children
|
|
39
41
|
.filter(child => child.tagName === 'th')
|
|
40
42
|
.forEach(th => {
|
|
41
|
-
th.properties.className = th.properties.className
|
|
42
|
-
th.properties.className += ' pf-m-wrap';
|
|
43
|
+
th.properties.className = `${th.properties.className} pf-v5-c-table__th pf-m-wrap`;
|
|
43
44
|
th.properties.role = 'columnheader';
|
|
44
45
|
th.properties.scope = 'col';
|
|
45
46
|
let colName = '';
|
|
@@ -56,14 +57,17 @@ function styledTags() {
|
|
|
56
57
|
}
|
|
57
58
|
else if (child.tagName === 'tbody') {
|
|
58
59
|
child.properties.role = 'rowgroup';
|
|
60
|
+
child.properties.className = 'pf-v5-c-table__tbody';
|
|
59
61
|
child.children
|
|
60
62
|
.filter(tr => tr.tagName === 'tr')
|
|
61
63
|
.forEach(tr => {
|
|
62
64
|
tr.properties.role = 'row';
|
|
65
|
+
tr.properties.className = 'pf-v5-c-table__tr';
|
|
63
66
|
tr.children
|
|
64
67
|
.filter(td => td.tagName === 'td')
|
|
65
68
|
.forEach((td, i) => {
|
|
66
69
|
td.properties.role = 'cell';
|
|
70
|
+
td.properties.className = 'pf-v5-c-table__td';
|
|
67
71
|
if (columnHeaders[i]) {
|
|
68
72
|
td.properties['data-label'] = columnHeaders[i];
|
|
69
73
|
}
|
package/templates/mdx.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PageSection, Title, PageSectionVariants, BackToTop, PageGroup, Page, Text, TextContent } from '@patternfly/react-core';
|
|
2
|
+
import { PageSection, Title, Tooltip, PageSectionVariants, Button, BackToTop, Flex, FlexItem, PageGroup, Page, Text, TextContent, Label } from '@patternfly/react-core';
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
4
|
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/esm/icons/external-link-alt-icon';
|
|
5
5
|
import { Router, useLocation } from '@reach/router';
|
|
@@ -22,6 +22,8 @@ const MDXChildTemplate = ({
|
|
|
22
22
|
cssPrefix = [],
|
|
23
23
|
optIn,
|
|
24
24
|
beta,
|
|
25
|
+
deprecated,
|
|
26
|
+
newImplementationLink,
|
|
25
27
|
functionDocumentation = []
|
|
26
28
|
} = Component.getPageData();
|
|
27
29
|
const cssVarsTitle = cssPrefix.length > 0 && 'CSS variables';
|
|
@@ -32,6 +34,9 @@ const MDXChildTemplate = ({
|
|
|
32
34
|
}
|
|
33
35
|
if (cssVarsTitle && !toc.find(item => item.text === cssVarsTitle)) {
|
|
34
36
|
toc.push({ text: cssVarsTitle });
|
|
37
|
+
if (cssPrefix.length > 1) {
|
|
38
|
+
toc.push(cssPrefix.map(cssPrefix => ({ text: `Prefixed with '${cssPrefix}'` })));
|
|
39
|
+
}
|
|
35
40
|
}
|
|
36
41
|
// We don't add `id`s in anchor-header.js for items where id === slugger(text)
|
|
37
42
|
// in order to save ~10KB bandwidth.
|
|
@@ -55,14 +60,22 @@ const MDXChildTemplate = ({
|
|
|
55
60
|
)}
|
|
56
61
|
{beta && (
|
|
57
62
|
<InlineAlert title="Beta feature">
|
|
58
|
-
This beta component is currently under review and is still open for further evolution. It is available for use in product.
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
This beta component is currently under review and is still open for further evolution. It is available for use in product. Beta components are considered for promotion on a quarterly basis. Please join in and give us your feedback or submit any questions on the <a href="https://forum.patternfly.org/">PatternFly forum</a> or via <a href="//slack.patternfly.org/" target="_blank" rel="noopener noreferrer">Slack</a>. To learn more about the process, visit our <Link to="/get-started/about#beta-components">about page</Link> or our <a href="https://github.com/patternfly/patternfly-org/tree/main/beta-component-promotion">Beta components</a> page on GitHub.
|
|
64
|
+
</InlineAlert>
|
|
65
|
+
)}
|
|
66
|
+
{(deprecated || source === 'react-deprecated') && (
|
|
67
|
+
<InlineAlert title="Deprecated feature" variant="warning">
|
|
68
|
+
This implementation has been deprecated in favor of a newer implementation, and is no longer getting maintained or enhanced.
|
|
69
|
+
{newImplementationLink && (
|
|
70
|
+
<React.Fragment>
|
|
71
|
+
You can find the <Link to={newImplementationLink}>updated implementation here</Link>.
|
|
72
|
+
</React.Fragment>
|
|
73
|
+
)}
|
|
74
|
+
{' '}To learn more about the process, visit our <Link to="/get-started/about#major-release-cadence">about page</Link>.
|
|
61
75
|
</InlineAlert>
|
|
62
76
|
)}
|
|
63
77
|
</React.Fragment>
|
|
64
78
|
);
|
|
65
|
-
console.log(id);
|
|
66
79
|
// Create dynamic component for @reach/router
|
|
67
80
|
const ChildComponent = () => (
|
|
68
81
|
<div className="pf-v5-u-display-flex ws-mdx-child-template">
|
|
@@ -97,12 +110,14 @@ const MDXChildTemplate = ({
|
|
|
97
110
|
))}
|
|
98
111
|
</React.Fragment>
|
|
99
112
|
)}
|
|
100
|
-
{
|
|
113
|
+
{cssPrefix.length > 0 && (
|
|
101
114
|
<React.Fragment>
|
|
102
115
|
<AutoLinkHeader size="h2" className="ws-h2" id="css-variables">
|
|
103
116
|
{cssVarsTitle}
|
|
104
117
|
</AutoLinkHeader>
|
|
105
|
-
|
|
118
|
+
{cssPrefix.map(prefix => (
|
|
119
|
+
<CSSVariables autoLinkHeader={cssPrefix.length > 1} prefix={prefix} />
|
|
120
|
+
))}
|
|
106
121
|
</React.Fragment>
|
|
107
122
|
)}
|
|
108
123
|
{sourceLink && (
|
|
@@ -126,6 +141,9 @@ export const MDXTemplate = ({
|
|
|
126
141
|
id,
|
|
127
142
|
componentsData
|
|
128
143
|
}) => {
|
|
144
|
+
const isDeprecated = sources.some(source => source.source === "react-deprecated") && !sources.some(source => source.source === "react");
|
|
145
|
+
const isBeta = sources.some(source => source.beta)
|
|
146
|
+
const isDemo = sources.some(source => source.source === "react-demos" || source.source === "html-demos") && !sources.some(source => source.source === "react" || source.source === "html");
|
|
129
147
|
// Build obj mapping source names to text displayed on tabs
|
|
130
148
|
const tabNames = sources.reduce((acc, curSrc) => {
|
|
131
149
|
const { source, tabName } = curSrc;
|
|
@@ -137,7 +155,7 @@ export const MDXTemplate = ({
|
|
|
137
155
|
const sourceKeys = Object.keys(tabNames);
|
|
138
156
|
const isSinglePage = sourceKeys.length === 1;
|
|
139
157
|
|
|
140
|
-
let isDevResources, isComponent, isExtension, isChart,
|
|
158
|
+
let isDevResources, isComponent, isExtension, isChart, isPattern, isLayout, isUtility;
|
|
141
159
|
|
|
142
160
|
const getSection = () => {
|
|
143
161
|
return sources.some((source) => {
|
|
@@ -154,8 +172,8 @@ export const MDXTemplate = ({
|
|
|
154
172
|
case "charts":
|
|
155
173
|
isChart = true;
|
|
156
174
|
return;
|
|
157
|
-
case "
|
|
158
|
-
|
|
175
|
+
case "patterns":
|
|
176
|
+
isPattern = true;
|
|
159
177
|
return;
|
|
160
178
|
case "layouts":
|
|
161
179
|
isLayout = true;
|
|
@@ -198,7 +216,7 @@ export const MDXTemplate = ({
|
|
|
198
216
|
return "pf-m-light-100";
|
|
199
217
|
}
|
|
200
218
|
return "pf-m-light";
|
|
201
|
-
} else if (isUtility ||
|
|
219
|
+
} else if (isUtility || isPattern || isLayout || isComponent) {
|
|
202
220
|
return "pf-m-light";
|
|
203
221
|
}
|
|
204
222
|
return "pf-m-light-100";
|
|
@@ -208,10 +226,9 @@ export const MDXTemplate = ({
|
|
|
208
226
|
(!isSinglePage && !hideTabName) ||
|
|
209
227
|
isComponent ||
|
|
210
228
|
isUtility ||
|
|
211
|
-
|
|
229
|
+
isPattern
|
|
212
230
|
);
|
|
213
231
|
|
|
214
|
-
console.log(id);
|
|
215
232
|
return (
|
|
216
233
|
<React.Fragment>
|
|
217
234
|
<PageGroup>
|
|
@@ -221,7 +238,44 @@ export const MDXTemplate = ({
|
|
|
221
238
|
isWidthLimited
|
|
222
239
|
>
|
|
223
240
|
<TextContent>
|
|
224
|
-
<
|
|
241
|
+
<Flex alignItems={{ default: 'alignItemsCenter'}}>
|
|
242
|
+
<FlexItem>
|
|
243
|
+
<Title headingLevel='h1' size='4xl' id="ws-page-title">
|
|
244
|
+
{title}
|
|
245
|
+
</Title>
|
|
246
|
+
</FlexItem>
|
|
247
|
+
<FlexItem>
|
|
248
|
+
<Flex display={{ default: 'inlineFlex' }}>
|
|
249
|
+
{isDeprecated && (
|
|
250
|
+
<FlexItem spacer={{ default: 'spacerSm' }}>
|
|
251
|
+
<Tooltip content="Deprecated components are available for use but are no longer being maintained or enhanced.">
|
|
252
|
+
<Button isInline component="span" variant="link">
|
|
253
|
+
<Label color="grey">Deprecated</Label>
|
|
254
|
+
</Button>
|
|
255
|
+
</Tooltip>
|
|
256
|
+
</FlexItem>
|
|
257
|
+
)}
|
|
258
|
+
{isDemo && (
|
|
259
|
+
<FlexItem spacer={{ default: 'spacerSm' }}>
|
|
260
|
+
<Tooltip content="Demos show how multiple components can be used in a single design.">
|
|
261
|
+
<Button isInline component="span" variant="link">
|
|
262
|
+
<Label color="purple">Demo</Label>
|
|
263
|
+
</Button>
|
|
264
|
+
</Tooltip>
|
|
265
|
+
</FlexItem>
|
|
266
|
+
)}
|
|
267
|
+
{isBeta && (
|
|
268
|
+
<FlexItem spacer={{ default: 'spacerSm' }}>
|
|
269
|
+
<Tooltip content="This beta component is currently under review and is still open for further evolution.">
|
|
270
|
+
<Button isInline component="span" variant="link">
|
|
271
|
+
<Label color="blue">Beta</Label>
|
|
272
|
+
</Button>
|
|
273
|
+
</Tooltip>
|
|
274
|
+
</FlexItem>
|
|
275
|
+
)}
|
|
276
|
+
</Flex>
|
|
277
|
+
</FlexItem>
|
|
278
|
+
</Flex>
|
|
225
279
|
{isComponent && summary && (<SummaryComponent />)}
|
|
226
280
|
</TextContent>
|
|
227
281
|
</PageSection>
|