@patternfly/documentation-framework 2.0.0-alpha.7 → 2.0.0-alpha.71
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 +590 -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
|
@@ -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
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { SearchInput } from "@patternfly/react-core";
|
|
3
3
|
|
|
4
4
|
export class CSSSearch extends React.Component {
|
|
5
5
|
constructor(props) {
|
|
@@ -9,7 +9,7 @@ export class CSSSearch extends React.Component {
|
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
onFilterChange = (
|
|
12
|
+
onFilterChange = (event) => {
|
|
13
13
|
this.setState(
|
|
14
14
|
{
|
|
15
15
|
filterValue: event.target.value
|
|
@@ -20,8 +20,7 @@ export class CSSSearch extends React.Component {
|
|
|
20
20
|
|
|
21
21
|
render() {
|
|
22
22
|
return (
|
|
23
|
-
<
|
|
24
|
-
type="text"
|
|
23
|
+
<SearchInput
|
|
25
24
|
aria-label="Filter CSS Variables"
|
|
26
25
|
placeholder="Filter CSS Variables"
|
|
27
26
|
value={this.state.filterValue}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
display: inline-block;
|
|
3
3
|
height: 18px;
|
|
4
4
|
width: 18px;
|
|
5
|
-
border: var(--pf-global--BorderWidth--sm) solid var(--pf-global--BorderColor--200);
|
|
6
|
-
border-radius: var(--pf-global--BorderRadius--lg);
|
|
5
|
+
border: var(--pf-v5-global--BorderWidth--sm) solid var(--pf-v5-global--BorderColor--200);
|
|
6
|
+
border-radius: var(--pf-v5-global--BorderRadius--lg);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.ws-td-text {
|
|
10
|
-
font-size: var(--pf-global--FontSize--sm) !important;
|
|
10
|
+
font-size: var(--pf-v5-global--FontSize--sm) !important;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.ws-css-property {
|
|
14
|
-
padding: var(--pf-global--spacer--xs) var(--pf-global--spacer--md);
|
|
14
|
+
padding: var(--pf-v5-global--spacer--xs) var(--pf-v5-global--spacer--md);
|
|
15
15
|
}
|
|
@@ -2,12 +2,13 @@ import React from "react";
|
|
|
2
2
|
import { debounce } from "@patternfly/react-core";
|
|
3
3
|
import {
|
|
4
4
|
Table,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
Thead,
|
|
6
|
+
Th,
|
|
7
|
+
Tr,
|
|
8
|
+
Tbody,
|
|
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";
|
|
@@ -42,15 +43,17 @@ const flattenList = files => {
|
|
|
42
43
|
let list = [];
|
|
43
44
|
files.forEach(file => {
|
|
44
45
|
Object.entries(file).forEach(([selector, values]) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
if(values !== undefined) {
|
|
47
|
+
Object.entries(values).forEach(([key, val]) => {
|
|
48
|
+
list.push({
|
|
49
|
+
selector,
|
|
50
|
+
property: val.name,
|
|
51
|
+
token: key,
|
|
52
|
+
value: val.value,
|
|
53
|
+
values: val.values
|
|
54
|
+
});
|
|
52
55
|
});
|
|
53
|
-
}
|
|
56
|
+
}
|
|
54
57
|
});
|
|
55
58
|
});
|
|
56
59
|
return list;
|
|
@@ -59,12 +62,9 @@ const flattenList = files => {
|
|
|
59
62
|
export class CSSVariables extends React.Component {
|
|
60
63
|
constructor(props) {
|
|
61
64
|
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, "_"));
|
|
65
|
+
const prefixToken = props.prefix.replace("pf-v5-", "").replace(/-+/g, "_");
|
|
66
66
|
const applicableFiles = Object.entries(tokensModule)
|
|
67
|
-
.filter(([key, val]) =>
|
|
67
|
+
.filter(([key, val]) => prefixToken === key)
|
|
68
68
|
.sort(([key1], [key2]) => key1.localeCompare(key2))
|
|
69
69
|
.map(([key, val]) => {
|
|
70
70
|
if (props.selector) {
|
|
@@ -77,23 +77,10 @@ export class CSSVariables extends React.Component {
|
|
|
77
77
|
|
|
78
78
|
this.flatList = flattenList(applicableFiles);
|
|
79
79
|
|
|
80
|
-
this.columns = [
|
|
81
|
-
...props.hideSelectorColumn ? [] : [{
|
|
82
|
-
title: "Selector",
|
|
83
|
-
transforms: [sortable],
|
|
84
|
-
cellFormatters: [expandable]
|
|
85
|
-
}],
|
|
86
|
-
{ title: "Variable", transforms: [sortable] },
|
|
87
|
-
{ title: "Value", transforms: [sortable] }
|
|
88
|
-
]
|
|
89
|
-
|
|
90
80
|
this.state = {
|
|
91
81
|
searchRE: '',
|
|
92
82
|
rows: this.getFilteredRows(),
|
|
93
|
-
|
|
94
|
-
index: 0,
|
|
95
|
-
direction: "asc" // a-z
|
|
96
|
-
}
|
|
83
|
+
allRowsExpanded: true
|
|
97
84
|
};
|
|
98
85
|
}
|
|
99
86
|
|
|
@@ -116,12 +103,12 @@ export class CSSVariables extends React.Component {
|
|
|
116
103
|
<div key={rowKey}>
|
|
117
104
|
<div
|
|
118
105
|
key={`${rowKey}_1`}
|
|
119
|
-
className="pf-l-flex pf-m-space-items-sm"
|
|
106
|
+
className="pf-v5-l-flex pf-m-space-items-sm"
|
|
120
107
|
>
|
|
121
108
|
{isColorRegex.test(value) && (
|
|
122
109
|
<div
|
|
123
110
|
key={`${rowKey}_2`}
|
|
124
|
-
className="pf-l-flex pf-m-column pf-m-align-self-center"
|
|
111
|
+
className="pf-v5-l-flex pf-m-column pf-m-align-self-center"
|
|
125
112
|
>
|
|
126
113
|
<span
|
|
127
114
|
className="ws-color-box"
|
|
@@ -131,7 +118,7 @@ export class CSSVariables extends React.Component {
|
|
|
131
118
|
)}
|
|
132
119
|
<div
|
|
133
120
|
key={`${rowKey}_3`}
|
|
134
|
-
className="pf-l-flex pf-m-column pf-m-align-self-center ws-td-text"
|
|
121
|
+
className="pf-v5-l-flex pf-m-column pf-m-align-self-center ws-td-text"
|
|
135
122
|
>
|
|
136
123
|
{value}
|
|
137
124
|
</div>
|
|
@@ -140,20 +127,16 @@ export class CSSVariables extends React.Component {
|
|
|
140
127
|
];
|
|
141
128
|
filteredRows.push({
|
|
142
129
|
isOpen: values ? false : undefined,
|
|
143
|
-
cells
|
|
130
|
+
cells,
|
|
131
|
+
details: values ? {
|
|
132
|
+
parent: rowNumber,
|
|
133
|
+
fullWidth: true,
|
|
134
|
+
data: mappingAsList(property, values)
|
|
135
|
+
} : undefined
|
|
144
136
|
});
|
|
145
137
|
rowNumber += 1;
|
|
146
138
|
if (values) {
|
|
147
|
-
|
|
148
|
-
parent: rowNumber,
|
|
149
|
-
fullWidth: true,
|
|
150
|
-
cells: [
|
|
151
|
-
{
|
|
152
|
-
title: mappingAsList(property, values)
|
|
153
|
-
}
|
|
154
|
-
]
|
|
155
|
-
});
|
|
156
|
-
rowNumber += 1;
|
|
139
|
+
rowNumber += 1
|
|
157
140
|
}
|
|
158
141
|
}
|
|
159
142
|
});
|
|
@@ -170,9 +153,10 @@ export class CSSVariables extends React.Component {
|
|
|
170
153
|
} else {
|
|
171
154
|
newRows[rowKey] = { ...newRows[rowKey], isOpen };
|
|
172
155
|
}
|
|
173
|
-
this.setState({
|
|
156
|
+
this.setState(prevState => ({
|
|
174
157
|
rows: newRows,
|
|
175
|
-
|
|
158
|
+
...(collapseAll && {allRowsExpanded: !prevState.allRowsExpanded})
|
|
159
|
+
}));
|
|
176
160
|
};
|
|
177
161
|
|
|
178
162
|
getDebouncedFilteredRows = debounce(value => {
|
|
@@ -183,49 +167,64 @@ export class CSSVariables extends React.Component {
|
|
|
183
167
|
});
|
|
184
168
|
}, 500);
|
|
185
169
|
|
|
186
|
-
onSort = (_event, index, direction) => {
|
|
187
|
-
this.flatList = this.flatList.sort((a, b) => {
|
|
188
|
-
const indexToColMap = {
|
|
189
|
-
'1': 'selector',
|
|
190
|
-
'2': 'property',
|
|
191
|
-
'3': 'value'
|
|
192
|
-
};
|
|
193
|
-
const column = indexToColMap[index];
|
|
194
|
-
if (direction === SortByDirection.asc) {
|
|
195
|
-
return a[column] < b[column] ? -1 : a[column] > b[column] ? 1 : 0;
|
|
196
|
-
} else {
|
|
197
|
-
return a[column] > b[column] ? -1 : a[column] < b[column] ? 1 : 0;
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
this.setState({
|
|
201
|
-
sortBy: {
|
|
202
|
-
index,
|
|
203
|
-
direction
|
|
204
|
-
},
|
|
205
|
-
rows: this.getFilteredRows(this.state.searchRE)
|
|
206
|
-
});
|
|
207
|
-
};
|
|
208
|
-
|
|
209
170
|
render() {
|
|
210
171
|
return (
|
|
211
172
|
<React.Fragment>
|
|
173
|
+
{this.props.autoLinkHeader && <AutoLinkHeader size="h3" className="pf-v5-u-mt-lg pf-v5-u-mb-md">{`Prefixed with '${this.props.prefix}'`}</AutoLinkHeader>}
|
|
212
174
|
<CSSSearch getDebouncedFilteredRows={this.getDebouncedFilteredRows} />
|
|
213
175
|
<Table
|
|
214
176
|
variant="compact"
|
|
215
|
-
aria-label={`CSS Variables
|
|
216
|
-
sortBy={this.state.sortBy}
|
|
217
|
-
onSort={this.onSort}
|
|
218
|
-
cells={this.columns}
|
|
219
|
-
rows={this.state.rows}
|
|
220
|
-
onCollapse={this.onCollapse}
|
|
221
|
-
canCollapseAll={true}
|
|
222
|
-
collapseAllAriaLabel="expand all css variables"
|
|
223
|
-
gridBreakPoint="grid-lg"
|
|
224
|
-
contentId="css-variables-content"
|
|
225
|
-
expandId="css-variables-toggle"
|
|
177
|
+
aria-label={`CSS Variables prefixed with ${this.props.prefix}`}
|
|
226
178
|
>
|
|
227
|
-
<
|
|
228
|
-
|
|
179
|
+
<Thead>
|
|
180
|
+
<Tr>
|
|
181
|
+
{!this.props.hideSelectorColumn && (
|
|
182
|
+
<React.Fragment>
|
|
183
|
+
<Th />
|
|
184
|
+
<Th>Selector</Th>
|
|
185
|
+
</React.Fragment>
|
|
186
|
+
)}
|
|
187
|
+
<Th>Variable</Th>
|
|
188
|
+
<Th>Value</Th>
|
|
189
|
+
</Tr>
|
|
190
|
+
</Thead>
|
|
191
|
+
{!this.props.hideSelectorColumn ? (
|
|
192
|
+
this.state.rows.map((row, rowIndex) => (
|
|
193
|
+
<Tbody key={rowIndex} isExpanded={row.isOpen}>
|
|
194
|
+
<Tr>
|
|
195
|
+
<Td
|
|
196
|
+
expand={
|
|
197
|
+
row.details
|
|
198
|
+
? {
|
|
199
|
+
rowIndex,
|
|
200
|
+
isExpanded: row.isOpen,
|
|
201
|
+
onToggle: this.onCollapse,
|
|
202
|
+
expandId: `css-vars-expandable-toggle-${this.props.prefix}`
|
|
203
|
+
}
|
|
204
|
+
: undefined
|
|
205
|
+
}
|
|
206
|
+
/>
|
|
207
|
+
<Td dataLabel="Selector">{row.cells[0]}</Td>
|
|
208
|
+
<Td dataLabel="Variable">{row.cells[1]}</Td>
|
|
209
|
+
<Td dataLabel="Value">{row.cells[2]}</Td>
|
|
210
|
+
</Tr>
|
|
211
|
+
{row.details ? (
|
|
212
|
+
<Tr isExpanded={row.isOpen}>
|
|
213
|
+
{!row.details.fullWidth ? <Td /> : null}
|
|
214
|
+
<Td dataLabel="Selector" colSpan={5}>{row.details.data}</Td>
|
|
215
|
+
</Tr>
|
|
216
|
+
) : null}
|
|
217
|
+
</Tbody>
|
|
218
|
+
))) : (
|
|
219
|
+
<Tbody>
|
|
220
|
+
{this.state.rows.map((row, rowIndex) => (
|
|
221
|
+
<Tr key={rowIndex}>
|
|
222
|
+
<Td dataLabel="Variable">{row.cells[0]}</Td>
|
|
223
|
+
<Td dataLabel="Value">{row.cells[1]}</Td>
|
|
224
|
+
</Tr>
|
|
225
|
+
))}
|
|
226
|
+
</Tbody>
|
|
227
|
+
)}
|
|
229
228
|
</Table>
|
|
230
229
|
</React.Fragment>
|
|
231
230
|
);
|
|
@@ -3,52 +3,52 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.ws-example {
|
|
6
|
-
margin-top: var(--pf-global--spacer--lg);
|
|
7
|
-
margin-bottom: var(--pf-global--spacer--lg);
|
|
6
|
+
margin-top: var(--pf-v5-global--spacer--lg);
|
|
7
|
+
margin-bottom: var(--pf-v5-global--spacer--lg);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.ws-example > .ws-example-header {
|
|
11
|
-
padding: var(--pf-global--spacer--md);
|
|
11
|
+
padding: var(--pf-v5-global--spacer--md);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.ws-example-header > .ws-example-heading:not(:last-child) {
|
|
15
|
-
margin-bottom: var(--pf-global--spacer--md);
|
|
15
|
+
margin-bottom: var(--pf-v5-global--spacer--md);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.ws-code-editor:not(.ws-example-code-expanded) > .pf-c-code-editor__header::before {
|
|
19
|
-
--pf-c-code-editor__header--before--BorderBottomWidth: 0;
|
|
18
|
+
.ws-code-editor:not(.ws-example-code-expanded) > .pf-v5-c-code-editor__header::before {
|
|
19
|
+
--pf-v5-c-code-editor__header--before--BorderBottomWidth: 0;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.ws-code-editor-control {
|
|
23
|
-
--pf-c-button--m-control--BackgroundColor: transparent;
|
|
24
|
-
--pf-c-button--m-control--active--BackgroundColor: transparent;
|
|
25
|
-
--pf-c-button--m-control--focus--BackgroundColor: transparent;
|
|
26
|
-
--pf-c-button--m-control--hover--BackgroundColor: transparent;
|
|
23
|
+
--pf-v5-c-button--m-control--BackgroundColor: transparent;
|
|
24
|
+
--pf-v5-c-button--m-control--active--BackgroundColor: transparent;
|
|
25
|
+
--pf-v5-c-button--m-control--focus--BackgroundColor: transparent;
|
|
26
|
+
--pf-v5-c-button--m-control--hover--BackgroundColor: transparent;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.ws-code-editor-control.pf-c-button {
|
|
30
|
-
--pf-c-button--after--BorderWidth: 0;
|
|
29
|
+
.ws-code-editor-control.pf-v5-c-button {
|
|
30
|
+
--pf-v5-c-button--after--BorderWidth: 0;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.ws-preview {
|
|
34
|
-
padding: var(--pf-global--spacer--md);
|
|
35
|
-
background-color: var(--pf-global--BackgroundColor--100);
|
|
36
|
-
border-bottom: var(--pf-global--BorderWidth--sm) solid var(--pf-global--BorderColor--300);
|
|
34
|
+
padding: var(--pf-v5-global--spacer--md);
|
|
35
|
+
background-color: var(--pf-v5-global--BackgroundColor--100);
|
|
36
|
+
border-bottom: var(--pf-v5-global--BorderWidth--sm) solid var(--pf-v5-global--BorderColor--300);
|
|
37
37
|
transition: width .2s ease-in-out;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.ws-core-c-page.ws-preview > .ws-preview-html,
|
|
41
|
-
.ws-react-c-page.ws-preview > .pf-c-page {
|
|
41
|
+
.ws-react-c-page.ws-preview > .pf-v5-c-page {
|
|
42
42
|
overflow: hidden;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.ws-editor {
|
|
46
|
-
font-size: var(--pf-global--FontSize--md);
|
|
46
|
+
font-size: var(--pf-v5-global--FontSize--md);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.ws-editor .token.punctuation,
|
|
50
50
|
.ws-editor .token.operator {
|
|
51
|
-
color: var(--pf-global--danger-color--100);
|
|
51
|
+
color: var(--pf-v5-global--danger-color--100);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
.ws-preview__thumbnail-link {
|
|
@@ -100,22 +100,22 @@
|
|
|
100
100
|
color: rgba(255,255,255,.4);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
.pf-c-badge.ws-beta-badge {
|
|
104
|
-
--pf-c-badge--m-unread--BackgroundColor: var(--pf-global--BackgroundColor--100);
|
|
105
|
-
--pf-c-badge--m-unread--Color: var(--pf-global--primary-color--100);
|
|
106
|
-
border: var(--pf-global--BorderWidth--sm) solid var(--pf-global--primary-color--100);
|
|
103
|
+
.pf-v5-c-badge.ws-beta-badge {
|
|
104
|
+
--pf-v5-c-badge--m-unread--BackgroundColor: var(--pf-v5-global--BackgroundColor--100);
|
|
105
|
+
--pf-v5-c-badge--m-unread--Color: var(--pf-v5-global--primary-color--100);
|
|
106
|
+
border: var(--pf-v5-global--BorderWidth--sm) solid var(--pf-v5-global--primary-color--100);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
.ws-prop-required {
|
|
110
|
-
color: var(--pf-global--danger-color--100);
|
|
110
|
+
color: var(--pf-v5-global--danger-color--100);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
.ws-theme-switch-full-page {
|
|
114
114
|
position: fixed;
|
|
115
115
|
right: 0;
|
|
116
116
|
bottom: 0;
|
|
117
|
-
padding: var(--pf-global--spacer--md);
|
|
118
|
-
z-index: var(--pf-global--ZIndex--2xl);
|
|
117
|
+
padding: var(--pf-v5-global--spacer--md);
|
|
118
|
+
z-index: var(--pf-v5-global--ZIndex--2xl);
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
.ws-theme-switch-full-page::before {
|
|
@@ -125,11 +125,11 @@
|
|
|
125
125
|
content: "";
|
|
126
126
|
width: 100%;
|
|
127
127
|
height: 100%;
|
|
128
|
-
background-color: var(--pf-global--BackgroundColor--100);
|
|
128
|
+
background-color: var(--pf-v5-global--BackgroundColor--100);
|
|
129
129
|
opacity: 0.8;
|
|
130
|
-
box-shadow: var(--pf-global--BoxShadow--sm);
|
|
130
|
+
box-shadow: var(--pf-v5-global--BoxShadow--sm);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
.pf-theme-dark .ws-theme-switch-full-page::before {
|
|
134
|
-
background-color: var(--pf-global--BackgroundColor--300);
|
|
133
|
+
.pf-v5-theme-dark .ws-theme-switch-full-page::before {
|
|
134
|
+
background-color: var(--pf-v5-global--BackgroundColor--300);
|
|
135
135
|
}
|
|
@@ -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)
|
|
@@ -119,7 +123,7 @@ export const Example = ({
|
|
|
119
123
|
if (lang === 'html') {
|
|
120
124
|
livePreview = (
|
|
121
125
|
<div
|
|
122
|
-
className={css('ws-preview-html', isFullscreenPreview && 'pf-u-h-100')}
|
|
126
|
+
className={css('ws-preview-html', isFullscreenPreview && 'pf-v5-u-h-100')}
|
|
123
127
|
dangerouslySetInnerHTML={{ __html: editorCode }}
|
|
124
128
|
/>
|
|
125
129
|
);
|
|
@@ -152,12 +156,12 @@ export const Example = ({
|
|
|
152
156
|
|
|
153
157
|
if (isFullscreenPreview) {
|
|
154
158
|
return (
|
|
155
|
-
<div id={previewId} className={css(className, 'pf-u-h-100')}>
|
|
159
|
+
<div id={previewId} className={css(className, 'pf-v5-u-h-100')}>
|
|
156
160
|
{livePreview}
|
|
157
161
|
{hasDarkThemeSwitcher && (
|
|
158
162
|
<div className="ws-theme-switch-full-page">
|
|
159
163
|
<Switch id="ws-theme-switch" label="Dark theme" defaultChecked={false} onChange={() =>
|
|
160
|
-
document.querySelector('html').classList.toggle('pf-theme-dark')} />
|
|
164
|
+
document.querySelector('html').classList.toggle('pf-v5-theme-dark')} />
|
|
161
165
|
</div>
|
|
162
166
|
)}
|
|
163
167
|
</div>
|
|
@@ -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,11 +1,11 @@
|
|
|
1
|
-
.ws-org-pfsite-l-footer.pf-c-page__main-section {
|
|
2
|
-
font-family:
|
|
1
|
+
.ws-org-pfsite-l-footer.pf-v5-c-page__main-section {
|
|
2
|
+
font-family: var(--pf-v5-global--FontFamily--text);
|
|
3
3
|
font-weight: 300;
|
|
4
4
|
background-color: #1a1a1a !important;
|
|
5
|
-
--pf-c-page__main-section--PaddingTop: var(--pf-global--spacer--xl);
|
|
6
|
-
--pf-c-page__main-section--PaddingRight: var(--pf-global--spacer--2xl);
|
|
7
|
-
--pf-c-page__main-section--PaddingBottom: var(--pf-global--spacer--2xl);
|
|
8
|
-
--pf-c-page__main-section--PaddingLeft: var(--pf-global--spacer--2xl);
|
|
5
|
+
--pf-v5-c-page__main-section--PaddingTop: var(--pf-v5-global--spacer--xl);
|
|
6
|
+
--pf-v5-c-page__main-section--PaddingRight: var(--pf-v5-global--spacer--2xl);
|
|
7
|
+
--pf-v5-c-page__main-section--PaddingBottom: var(--pf-v5-global--spacer--2xl);
|
|
8
|
+
--pf-v5-c-page__main-section--PaddingLeft: var(--pf-v5-global--spacer--2xl);
|
|
9
9
|
/* Hide long overflowing tocs */
|
|
10
10
|
z-index: 1;
|
|
11
11
|
}
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
.ws-org-pfsite-l-footer-column .ws-org-pfsite-footer-menu-social-links a {
|
|
37
|
-
margin-right: var(--pf-global--spacer--md);
|
|
38
|
-
color: var(--pf-global--Color--light-100) !important;
|
|
37
|
+
margin-right: var(--pf-v5-global--spacer--md);
|
|
38
|
+
color: var(--pf-v5-global--Color--light-100) !important;
|
|
39
39
|
}
|
|
40
40
|
.ws-org-pfsite-l-footer-column
|
|
41
41
|
.ws-org-pfsite-footer-menu-social-links
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
margin-right: 0;
|
|
44
44
|
}
|
|
45
45
|
.ws-org-pfsite-l-footer-column .ws-org-pfsite-footer-menu-social-links {
|
|
46
|
-
margin-top: var(--pf-global--spacer--md);
|
|
47
|
-
margin-bottom: var(--pf-global--spacer--md);
|
|
46
|
+
margin-top: var(--pf-v5-global--spacer--md);
|
|
47
|
+
margin-bottom: var(--pf-v5-global--spacer--md);
|
|
48
48
|
}
|
|
49
49
|
@media (max-width: 768px) {
|
|
50
50
|
.ws-org-pfsite-l-footer-column .ws-org-pfsite-footer-menu-social-links {
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
padding-right: 10px;
|
|
72
72
|
}
|
|
73
73
|
.ws-org-pfsite-l-footer .ws-org-pfsite-footer-menu-link {
|
|
74
|
-
color: var(--pf-global--Color--light-100);
|
|
74
|
+
color: var(--pf-v5-global--Color--light-100);
|
|
75
75
|
font-size: 14px !important;
|
|
76
76
|
}
|
|
77
77
|
.ws-org-pfsite-l-footer .ws-org-pfsite-footer-menu-link:hover {
|
|
@@ -86,19 +86,19 @@
|
|
|
86
86
|
.ws-org-pfsite-l-footer-dark {
|
|
87
87
|
background: #151515 !important;
|
|
88
88
|
}
|
|
89
|
-
.pf-c-page .pf-c-page__main-section.ws-org-pfsite-l-footer-dark {
|
|
89
|
+
.pf-v5-c-page .pf-v5-c-page__main-section.ws-org-pfsite-l-footer-dark {
|
|
90
90
|
/* Hide long overflowing tocs */
|
|
91
91
|
z-index: 1;
|
|
92
92
|
}
|
|
93
|
-
.pf-c-page__main-section.ws-org-pfsite-l-footer-dark > * {
|
|
93
|
+
.pf-v5-c-page__main-section.ws-org-pfsite-l-footer-dark > * {
|
|
94
94
|
font-weight: 300;
|
|
95
95
|
font-size: 12px;
|
|
96
96
|
color: #d2d2d2;
|
|
97
97
|
}
|
|
98
98
|
.ws-org-pfsite-l-footer-dark a {
|
|
99
|
-
padding-right: var(--pf-global--spacer--sm);
|
|
100
|
-
padding-left: var(--pf-global--spacer--sm);
|
|
101
|
-
border-right: var(--pf-global--BorderWidth--sm) solid #d2d2d2;
|
|
99
|
+
padding-right: var(--pf-v5-global--spacer--sm);
|
|
100
|
+
padding-left: var(--pf-v5-global--spacer--sm);
|
|
101
|
+
border-right: var(--pf-v5-global--BorderWidth--sm) solid #d2d2d2;
|
|
102
102
|
font-weight: 300;
|
|
103
103
|
color: #d2d2d2;
|
|
104
104
|
text-decoration: underline;
|