@patternfly/documentation-framework 2.0.0-alpha.6 → 2.0.0-alpha.61
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 +512 -0
- package/app.js +12 -12
- 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 +13 -13
- 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/propsTable/propsTable.js +85 -79
- package/components/sectionGallery/TextSummary.js +31 -0
- package/components/sectionGallery/sectionDataListLayout.js +49 -0
- package/components/sectionGallery/sectionGallery.css +53 -0
- package/components/sectionGallery/sectionGallery.js +76 -0
- package/components/sectionGallery/sectionGalleryLayout.js +39 -0
- package/components/sectionGallery/sectionGalleryToolbar.js +38 -0
- package/components/sectionGallery/sectionGalleryWrapper.js +105 -0
- package/components/sideNav/sideNav.css +12 -12
- package/components/sideNav/sideNav.js +41 -13
- package/components/tableOfContents/tableOfContents.css +17 -17
- package/helpers/codesandbox.js +2 -2
- package/helpers/getTitle.js +2 -2
- package/layouts/sideNavLayout/sideNavLayout.css +7 -11
- package/layouts/sideNavLayout/sideNavLayout.js +57 -40
- 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 -8
- package/scripts/cli/build.js +6 -0
- package/scripts/cli/cli.js +2 -0
- 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/webpack.base.config.js +34 -32
- 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/versions.json +29 -9
- package/components/topNav/topNav.css +0 -30
- package/pages/red-hat-font.md +0 -40
|
@@ -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;
|
|
@@ -19,12 +19,12 @@ export const Footer = () => (
|
|
|
19
19
|
sm={12}
|
|
20
20
|
md={6}
|
|
21
21
|
mdOffset={1}
|
|
22
|
-
className="pf-u-mb-lg pf-u-mb-0-on-sm"
|
|
22
|
+
className="pf-v5-u-mb-lg pf-v5-u-mb-0-on-sm"
|
|
23
23
|
>
|
|
24
|
-
<Grid className="pf-u-py-xl">
|
|
25
|
-
<GridItem sm={6} md={4} className="pf-u-ml-md pf-u-ml-0-on-md pf-u-mb-xl pf-u-mb-0-on-md">
|
|
24
|
+
<Grid className="pf-v5-u-py-xl">
|
|
25
|
+
<GridItem sm={6} md={4} className="pf-v5-u-ml-md pf-v5-u-ml-0-on-md pf-v5-u-mb-xl pf-v5-u-mb-0-on-md">
|
|
26
26
|
<p
|
|
27
|
-
className="pf-c-title ws-org-pfsite-footer-menu-list-title"
|
|
27
|
+
className="pf-v5-c-title ws-org-pfsite-footer-menu-list-title"
|
|
28
28
|
>
|
|
29
29
|
QUICKLINKS
|
|
30
30
|
</p>
|
|
@@ -82,10 +82,10 @@ export const Footer = () => (
|
|
|
82
82
|
<GridItem
|
|
83
83
|
sm={6}
|
|
84
84
|
md={4}
|
|
85
|
-
className="pf-u-mt-lg pf-u-mt-0-on-sm pf-u-ml-md pf-u-ml-0-on-md pf-u-mb-xl pf-u-mb-0-on-md"
|
|
85
|
+
className="pf-v5-u-mt-lg pf-v5-u-mt-0-on-sm pf-v5-u-ml-md pf-v5-u-ml-0-on-md pf-v5-u-mb-xl pf-v5-u-mb-0-on-md"
|
|
86
86
|
>
|
|
87
87
|
<p
|
|
88
|
-
className="pf-c-title ws-org-pfsite-footer-menu-list-title"
|
|
88
|
+
className="pf-v5-c-title ws-org-pfsite-footer-menu-list-title"
|
|
89
89
|
>
|
|
90
90
|
CONTRIBUTE
|
|
91
91
|
</p>
|
|
@@ -125,7 +125,7 @@ export const Footer = () => (
|
|
|
125
125
|
<GridItem
|
|
126
126
|
sm={6}
|
|
127
127
|
md={4}
|
|
128
|
-
className="pf-u-mt-lg pf-u-mt-0-on-md pf-u-ml-md pf-u-ml-0-on-md"
|
|
128
|
+
className="pf-v5-u-mt-lg pf-v5-u-mt-0-on-md pf-v5-u-ml-md pf-v5-u-ml-0-on-md"
|
|
129
129
|
>
|
|
130
130
|
<p
|
|
131
131
|
className="ws-org-pfsite-footer-menu-list-title"
|
|
@@ -180,10 +180,10 @@ export const Footer = () => (
|
|
|
180
180
|
</Grid>
|
|
181
181
|
</GridItem>
|
|
182
182
|
<GridItem sm={12} md={4}>
|
|
183
|
-
<Grid className="pf-u-pt-xl ws-org-pfsite-l-footer-column">
|
|
184
|
-
<GridItem className="pf-u-px-xl">
|
|
183
|
+
<Grid className="pf-v5-u-pt-xl ws-org-pfsite-l-footer-column">
|
|
184
|
+
<GridItem className="pf-v5-u-px-xl">
|
|
185
185
|
<Link
|
|
186
|
-
className="pf-c-page__header-brand-link pf-c-brand ws-org-pfsite-footer-menu-about-logo pf-u-pb-md"
|
|
186
|
+
className="pf-v5-c-page__header-brand-link pf-v5-c-brand ws-org-pfsite-footer-menu-about-logo pf-v5-u-pb-md"
|
|
187
187
|
to="/"
|
|
188
188
|
>
|
|
189
189
|
<Brand src={logo} alt="Patternfly Logo" />
|
|
@@ -192,7 +192,7 @@ export const Footer = () => (
|
|
|
192
192
|
PatternFly is an open source design system built to drive consistency and unify teams. From documentation and components to code examples and tutorials, PatternFly is a place where design and development can thrive. We’re on a mission to help teams build consistent, accessible, and scalable enterprise product experiences—the open source way.
|
|
193
193
|
</p>
|
|
194
194
|
</GridItem>
|
|
195
|
-
<GridItem className="ws-org-pfsite-footer-menu-social-links pf-u-px-xl">
|
|
195
|
+
<GridItem className="ws-org-pfsite-footer-menu-social-links pf-v5-u-px-xl">
|
|
196
196
|
<Link
|
|
197
197
|
to="//github.com/patternfly"
|
|
198
198
|
target="top"
|
|
@@ -213,7 +213,7 @@ export const Footer = () => (
|
|
|
213
213
|
</Grid>
|
|
214
214
|
</PageSection>
|
|
215
215
|
<PageSection key="footer-2" className="ws-org-pfsite-l-footer-dark pf-m-no-fill">
|
|
216
|
-
<Grid className="pf-u-py-xl-on-sm pf-u-py-0-on-md pf-u-align-items-center">
|
|
216
|
+
<Grid className="pf-v5-u-py-xl-on-sm pf-v5-u-py-0-on-md pf-v5-u-align-items-center">
|
|
217
217
|
<GridItem md={2} mdOffset={1}>
|
|
218
218
|
<Link
|
|
219
219
|
to="//www.redhat.com"
|
|
@@ -233,7 +233,7 @@ export const Footer = () => (
|
|
|
233
233
|
Copyright © 2022 Red Hat, Inc.
|
|
234
234
|
</span>
|
|
235
235
|
</GridItem>
|
|
236
|
-
<GridItem md={4} lg={5} className="pf-u-ml-xl-on-xl">
|
|
236
|
+
<GridItem md={4} lg={5} className="pf-v5-u-ml-xl-on-xl">
|
|
237
237
|
<Link
|
|
238
238
|
to="//www.redhat.com/en/about/privacy-policy"
|
|
239
239
|
target="top"
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
Table,
|
|
4
|
+
Caption,
|
|
5
|
+
Thead,
|
|
6
|
+
Tr,
|
|
7
|
+
Th,
|
|
8
|
+
Tbody,
|
|
9
|
+
Td,
|
|
10
|
+
} from "@patternfly/react-table";
|
|
11
|
+
|
|
12
|
+
export const FunctionsTable = ({ functionDescriptions }) => {
|
|
13
|
+
const columnNames = {
|
|
14
|
+
name: "Function name",
|
|
15
|
+
description: "Description",
|
|
16
|
+
signature: "Type signature",
|
|
17
|
+
defaultValues: "Default parameter values",
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const formatDefaultValues = (parameters) =>
|
|
21
|
+
parameters.map((param) => `${param.name}: ${param.default}; `);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Table
|
|
25
|
+
aria-label="Function documentation table"
|
|
26
|
+
variant="compact"
|
|
27
|
+
>
|
|
28
|
+
<Caption>Table showing documentation for relevant functions</Caption>
|
|
29
|
+
<Thead>
|
|
30
|
+
<Tr>
|
|
31
|
+
<Th>{columnNames.name}</Th>
|
|
32
|
+
<Th>{columnNames.signature}</Th>
|
|
33
|
+
<Th>{columnNames.defaultValues}</Th>
|
|
34
|
+
<Th>{columnNames.description}</Th>
|
|
35
|
+
</Tr>
|
|
36
|
+
</Thead>
|
|
37
|
+
<Tbody>
|
|
38
|
+
{functionDescriptions.map((functionDescription) => (
|
|
39
|
+
<Tr key={functionDescription.functionName}>
|
|
40
|
+
<Td dataLabel={columnNames.name}>
|
|
41
|
+
{functionDescription.functionName}
|
|
42
|
+
</Td>
|
|
43
|
+
<Td dataLabel={columnNames.signature}>
|
|
44
|
+
{functionDescription.type}
|
|
45
|
+
</Td>
|
|
46
|
+
<Td dataLabel={columnNames.defaultValues}>
|
|
47
|
+
{formatDefaultValues(functionDescription.params)}
|
|
48
|
+
</Td>
|
|
49
|
+
<Td dataLabel={columnNames.description}>
|
|
50
|
+
{functionDescription.description}
|
|
51
|
+
</Td>
|
|
52
|
+
</Tr>
|
|
53
|
+
))}
|
|
54
|
+
</Tbody>
|
|
55
|
+
</Table>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
#ws-gdpr-banner {
|
|
10
10
|
max-width: 95vw;
|
|
11
11
|
flex-wrap: nowrap;
|
|
12
|
-
background: var(--pf-global--BackgroundColor--100);
|
|
13
|
-
border: var(--pf-global--BorderWidth--sm) solid var(--pf-global--Color--100);
|
|
12
|
+
background: var(--pf-v5-global--BackgroundColor--100);
|
|
13
|
+
border: var(--pf-v5-global--BorderWidth--sm) solid var(--pf-v5-global--Color--100);
|
|
14
14
|
}
|