@patternfly/documentation-framework 6.0.0-alpha.4 → 6.0.0-alpha.40
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 +803 -0
- package/app.js +2 -5
- package/components/autoLinkHeader/autoLinkHeader.css +2 -2
- package/components/autoLinkHeader/autoLinkHeader.js +5 -4
- package/components/cssVariables/cssVariables.css +4 -4
- package/components/cssVariables/cssVariables.js +6 -6
- package/components/example/example.css +29 -29
- package/components/example/example.js +122 -56
- package/components/example/exampleToolbar.js +3 -2
- package/components/footer/footer.css +16 -16
- package/components/footer/footer.js +16 -16
- package/components/gdprBanner/gdprBanner.css +2 -2
- package/components/gdprBanner/gdprBanner.js +4 -4
- package/components/inlineAlert/inlineAlert.js +1 -1
- package/components/propsTable/propsTable.js +3 -3
- package/components/sectionGallery/sectionDataListLayout.js +3 -3
- package/components/sectionGallery/sectionGallery.css +12 -12
- package/components/sectionGallery/sectionGalleryToolbar.js +1 -1
- package/components/sideNav/sideNav.js +3 -4
- package/components/tableOfContents/tableOfContents.css +23 -24
- package/layouts/sideNavLayout/sideNavLayout.css +14 -14
- package/layouts/sideNavLayout/sideNavLayout.js +80 -28
- package/package.json +13 -20
- package/pages/404/404.css +2 -2
- package/pages/404/index.js +4 -2
- package/routes.js +3 -1
- package/scripts/md/parseMD.js +20 -18
- package/scripts/md/styled-tags.js +22 -14
- package/scripts/webpack/webpack.base.config.js +7 -18
- package/scripts/writeScreenshots.js +2 -2
- package/templates/mdx.css +28 -229
- package/templates/mdx.js +22 -16
- package/templates/patternfly-docs/patternfly-docs.source.js +8 -8
- package/versions.json +36 -11
- package/components/sideNav/sideNav.css +0 -21
- package/pages/global-css-variables.md +0 -109
- package/pages/img/component-variable-mapping.png +0 -0
package/app.js
CHANGED
|
@@ -3,7 +3,6 @@ import { createRoot, hydrateRoot } from 'react-dom/client';
|
|
|
3
3
|
import { Router, useLocation } from '@reach/router';
|
|
4
4
|
import 'client-styles'; // Webpack replaces this import: patternfly-docs.css.js
|
|
5
5
|
import { SideNavLayout } from '@patternfly/documentation-framework/layouts';
|
|
6
|
-
import { Footer } from '@patternfly/documentation-framework/components';
|
|
7
6
|
import { MDXTemplate } from '@patternfly/documentation-framework/templates/mdx';
|
|
8
7
|
import { routes, groupedRoutes, fullscreenRoutes, getAsyncComponent } from './routes';
|
|
9
8
|
import { trackEvent } from './helpers';
|
|
@@ -12,7 +11,6 @@ import './components/cssVariables/cssVariables.css';
|
|
|
12
11
|
import './components/tableOfContents/tableOfContents.css';
|
|
13
12
|
import './components/example/example.css';
|
|
14
13
|
import './components/footer/footer.css';
|
|
15
|
-
import './components/sideNav/sideNav.css';
|
|
16
14
|
import './layouts/sideNavLayout/sideNavLayout.css';
|
|
17
15
|
|
|
18
16
|
const AppRoute = ({ child, title, path }) => {
|
|
@@ -37,16 +35,15 @@ const AppRoute = ({ child, title, path }) => {
|
|
|
37
35
|
return (
|
|
38
36
|
<React.Fragment>
|
|
39
37
|
{child}
|
|
40
|
-
{process.env.hasFooter && <Footer />}
|
|
41
38
|
</React.Fragment>
|
|
42
39
|
);
|
|
43
40
|
}
|
|
44
41
|
|
|
45
42
|
const SideNavRouter = () => {
|
|
46
|
-
const componentsData = process
|
|
43
|
+
const componentsData = process.env.componentsData;
|
|
47
44
|
return (
|
|
48
45
|
<SideNavLayout groupedRoutes={groupedRoutes} navOpen={true} >
|
|
49
|
-
<Router id="ws-page-content-router">
|
|
46
|
+
<Router id="ws-page-content-router" component="main">
|
|
50
47
|
{Object.entries(routes)
|
|
51
48
|
.map(([path, { Component, title, sources, id }]) => Component
|
|
52
49
|
? <AppRoute
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.ws-heading-anchor {
|
|
6
|
-
|
|
7
|
-
transform: translate(calc(-100% - var(--pf-
|
|
6
|
+
/* color: var(--pf-v6-global--Color--100); */
|
|
7
|
+
transform: translate(calc(-100% - var(--pf-t--global--spacer--xs)), -50%);
|
|
8
8
|
opacity: 0;
|
|
9
9
|
position: absolute;
|
|
10
10
|
left: 0;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Title, Flex, FlexItem } from '@patternfly/react-core';
|
|
2
|
+
import { Title, Flex, FlexItem, Text } 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';
|
|
6
|
+
import { css } from '@patternfly/react-styles';
|
|
6
7
|
|
|
7
8
|
// "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl"
|
|
8
9
|
const sizes = {
|
|
@@ -25,13 +26,13 @@ export const AutoLinkHeader = ({
|
|
|
25
26
|
const slug = id || slugger(children);
|
|
26
27
|
|
|
27
28
|
return (
|
|
28
|
-
<Flex alignItems={{ default: 'alignItemsCenter'}} spaceItems={{ default:
|
|
29
|
+
<Flex alignItems={{ default: 'alignItemsCenter'}} spaceItems={{ default: "spaceItemsSm" }}>
|
|
29
30
|
<FlexItem>
|
|
30
31
|
<Title
|
|
31
32
|
id={slug}
|
|
32
33
|
size={sizes[size]}
|
|
33
34
|
headingLevel={headingLevel || size}
|
|
34
|
-
className={
|
|
35
|
+
className={css('ws-heading', className)}
|
|
35
36
|
tabIndex={-1}
|
|
36
37
|
>
|
|
37
38
|
<Link href={`#${slug}`} className="ws-heading-anchor" tabIndex="-1" aria-hidden>
|
|
@@ -40,7 +41,7 @@ export const AutoLinkHeader = ({
|
|
|
40
41
|
{children}
|
|
41
42
|
</Title>
|
|
42
43
|
</FlexItem>
|
|
43
|
-
<FlexItem>
|
|
44
|
+
<FlexItem>{metaText}</FlexItem>
|
|
44
45
|
</Flex>
|
|
45
46
|
)
|
|
46
47
|
};
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
display: inline-block;
|
|
3
3
|
height: 18px;
|
|
4
4
|
width: 18px;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/* border: var(--pf-v6-global--BorderWidth--sm) solid var(--pf-v6-global--BorderColor--200); */
|
|
6
|
+
/* border-radius: var(--pf-v6-global--BorderRadius--lg); */
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.ws-td-text {
|
|
10
|
-
|
|
10
|
+
/* font-size: var(--pf-v6-global--FontSize--sm) !important; */
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.ws-css-property {
|
|
14
|
-
padding: var(--pf-
|
|
14
|
+
padding: var(--pf-t--global--spacer--xs) var(--pf-t--global--spacer--md);
|
|
15
15
|
}
|
|
@@ -62,7 +62,7 @@ const flattenList = files => {
|
|
|
62
62
|
export class CSSVariables extends React.Component {
|
|
63
63
|
constructor(props) {
|
|
64
64
|
super(props);
|
|
65
|
-
const prefixToken = props.prefix.replace("pf-
|
|
65
|
+
const prefixToken = props.prefix.replace("pf-v6-", "").replace(/-+/g, "_");
|
|
66
66
|
const applicableFiles = Object.entries(tokensModule)
|
|
67
67
|
.filter(([key, val]) => prefixToken === key)
|
|
68
68
|
.sort(([key1], [key2]) => key1.localeCompare(key2))
|
|
@@ -103,12 +103,12 @@ export class CSSVariables extends React.Component {
|
|
|
103
103
|
<div key={rowKey}>
|
|
104
104
|
<div
|
|
105
105
|
key={`${rowKey}_1`}
|
|
106
|
-
className="pf-
|
|
106
|
+
className="pf-v6-l-flex pf-m-space-items-sm"
|
|
107
107
|
>
|
|
108
108
|
{isColorRegex.test(value) && (
|
|
109
109
|
<div
|
|
110
110
|
key={`${rowKey}_2`}
|
|
111
|
-
className="pf-
|
|
111
|
+
className="pf-v6-l-flex pf-m-column pf-m-align-self-center"
|
|
112
112
|
>
|
|
113
113
|
<span
|
|
114
114
|
className="ws-color-box"
|
|
@@ -118,7 +118,7 @@ export class CSSVariables extends React.Component {
|
|
|
118
118
|
)}
|
|
119
119
|
<div
|
|
120
120
|
key={`${rowKey}_3`}
|
|
121
|
-
className="pf-
|
|
121
|
+
className="pf-v6-l-flex pf-m-column pf-m-align-self-center ws-td-text"
|
|
122
122
|
>
|
|
123
123
|
{value}
|
|
124
124
|
</div>
|
|
@@ -170,7 +170,7 @@ export class CSSVariables extends React.Component {
|
|
|
170
170
|
render() {
|
|
171
171
|
return (
|
|
172
172
|
<React.Fragment>
|
|
173
|
-
{this.props.autoLinkHeader && <AutoLinkHeader size="h3" className="pf-
|
|
173
|
+
{this.props.autoLinkHeader && <AutoLinkHeader size="h3" className="pf-v6-u-mt-lg pf-v6-u-mb-md">{`Prefixed with '${this.props.prefix}'`}</AutoLinkHeader>}
|
|
174
174
|
<CSSSearch getDebouncedFilteredRows={this.getDebouncedFilteredRows} />
|
|
175
175
|
<Table
|
|
176
176
|
variant="compact"
|
|
@@ -180,7 +180,7 @@ export class CSSVariables extends React.Component {
|
|
|
180
180
|
<Tr>
|
|
181
181
|
{!this.props.hideSelectorColumn && (
|
|
182
182
|
<React.Fragment>
|
|
183
|
-
<Th />
|
|
183
|
+
<Th screenReaderText="Expand or collapse column" />
|
|
184
184
|
<Th>Selector</Th>
|
|
185
185
|
</React.Fragment>
|
|
186
186
|
)}
|
|
@@ -3,52 +3,52 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.ws-example {
|
|
6
|
-
margin-top: var(--pf-
|
|
7
|
-
margin-bottom: var(--pf-
|
|
6
|
+
margin-top: var(--pf-t--global--spacer--lg);
|
|
7
|
+
margin-bottom: var(--pf-t--global--spacer--lg);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.ws-example > .ws-example-header {
|
|
11
|
-
padding: var(--pf-
|
|
11
|
+
padding: var(--pf-t--global--spacer--md);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.ws-example-header > .ws-example-heading:not(:last-child) {
|
|
15
|
-
margin-bottom: var(--pf-
|
|
15
|
+
margin-bottom: var(--pf-t--global--spacer--md);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.ws-code-editor:not(.ws-example-code-expanded) > .pf-
|
|
19
|
-
--pf-
|
|
18
|
+
.ws-code-editor:not(.ws-example-code-expanded) > .pf-v6-c-code-editor__header::before {
|
|
19
|
+
--pf-v6-c-code-editor__header--before--BorderBottomWidth: 0;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.ws-code-editor-control {
|
|
23
|
-
--pf-
|
|
24
|
-
--pf-
|
|
25
|
-
--pf-
|
|
26
|
-
--pf-
|
|
23
|
+
--pf-v6-c-button--m-control--BackgroundColor: transparent;
|
|
24
|
+
--pf-v6-c-button--m-control--active--BackgroundColor: transparent;
|
|
25
|
+
--pf-v6-c-button--m-control--focus--BackgroundColor: transparent;
|
|
26
|
+
--pf-v6-c-button--m-control--hover--BackgroundColor: transparent;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.ws-code-editor-control.pf-
|
|
30
|
-
--pf-
|
|
29
|
+
.ws-code-editor-control.pf-v6-c-button {
|
|
30
|
+
--pf-v6-c-button--after--BorderWidth: 0;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.ws-preview {
|
|
34
|
-
padding: var(--pf-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
padding: var(--pf-t--global--spacer--md);
|
|
35
|
+
/* background-color: var(--pf-v6-global--BackgroundColor--100); */
|
|
36
|
+
/* border-bottom: var(--pf-v6-global--BorderWidth--sm) solid var(--pf-v6-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-
|
|
41
|
+
.ws-react-c-page.ws-preview > .pf-v6-c-page {
|
|
42
42
|
overflow: hidden;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.ws-editor {
|
|
46
|
-
|
|
46
|
+
/* font-size: var(--pf-v6-global--FontSize--md); */
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.ws-editor .token.punctuation,
|
|
50
50
|
.ws-editor .token.operator {
|
|
51
|
-
|
|
51
|
+
/* color: var(--pf-v6-global--danger-color--100); */
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
.ws-preview__thumbnail-link {
|
|
@@ -100,33 +100,33 @@
|
|
|
100
100
|
color: rgba(255,255,255,.4);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
.pf-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
.pf-v6-c-badge.ws-beta-badge {
|
|
104
|
+
/* --pf-v6-c-badge--m-unread--BackgroundColor: var(--pf-v6-global--BackgroundColor--100); */
|
|
105
|
+
/* --pf-v6-c-badge--m-unread--Color: var(--pf-v6-global--primary-color--100); */
|
|
106
|
+
/* border: var(--pf-v6-global--BorderWidth--sm) solid var(--pf-v6-global--primary-color--100); */
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
.ws-prop-required {
|
|
110
|
-
|
|
110
|
+
/* color: var(--pf-v6-global--danger-color--100); */
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
.ws-full-page-utils {
|
|
114
114
|
position: fixed;
|
|
115
115
|
right: 0;
|
|
116
116
|
bottom: 0;
|
|
117
|
-
padding: var(--pf-
|
|
118
|
-
|
|
117
|
+
padding: var(--pf-t--global--spacer--lg);
|
|
118
|
+
/* z-index: var(--pf-v6-global--ZIndex--2xl); */
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
.ws-full-page-utils::before {
|
|
122
122
|
position: absolute;
|
|
123
123
|
inset: 0;
|
|
124
124
|
content: "";
|
|
125
|
-
|
|
125
|
+
/* background-color: var(--pf-v6-global--BackgroundColor--100); */
|
|
126
126
|
opacity: 0.8;
|
|
127
|
-
|
|
127
|
+
/* box-shadow: var(--pf-v6-global--BoxShadow--sm); */
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
.pf-
|
|
131
|
-
|
|
130
|
+
.pf-v6-theme-dark .ws-theme-switch-full-page::before {
|
|
131
|
+
/* background-color: var(--pf-v6-global--BackgroundColor--300); */
|
|
132
132
|
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
1
|
+
import React, { useContext, useEffect } from 'react';
|
|
2
2
|
import { useLocation } from '@reach/router';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
CodeBlock,
|
|
6
|
+
Flex,
|
|
7
|
+
CodeBlockCode,
|
|
8
|
+
debounce,
|
|
9
|
+
Label,
|
|
10
|
+
Switch,
|
|
11
|
+
Tooltip,
|
|
12
|
+
} from '@patternfly/react-core';
|
|
4
13
|
import * as reactCoreModule from '@patternfly/react-core';
|
|
5
14
|
import * as reactCoreNextModule from '@patternfly/react-core/next';
|
|
6
15
|
import * as reactCoreDeprecatedModule from '@patternfly/react-core/deprecated';
|
|
@@ -16,13 +25,13 @@ import {
|
|
|
16
25
|
getReactParams,
|
|
17
26
|
getExampleClassName,
|
|
18
27
|
getExampleId,
|
|
19
|
-
liveCodeTypes
|
|
28
|
+
liveCodeTypes,
|
|
20
29
|
} from '../../helpers';
|
|
21
30
|
import { convertToReactComponent } from '@patternfly/ast-helpers';
|
|
22
31
|
import missingThumbnail from './missing-thumbnail.jpg';
|
|
23
32
|
import { RtlContext } from '../../layouts';
|
|
24
33
|
|
|
25
|
-
const errorComponent = err => <pre>{err.toString()}</pre>;
|
|
34
|
+
const errorComponent = (err) => <pre>{err.toString()}</pre>;
|
|
26
35
|
|
|
27
36
|
class ErrorBoundary extends React.Component {
|
|
28
37
|
constructor(props) {
|
|
@@ -34,7 +43,7 @@ class ErrorBoundary extends React.Component {
|
|
|
34
43
|
errorInfo._suppressLogging = true;
|
|
35
44
|
this.setState({
|
|
36
45
|
error: error,
|
|
37
|
-
errorInfo: errorInfo
|
|
46
|
+
errorInfo: errorInfo,
|
|
38
47
|
});
|
|
39
48
|
}
|
|
40
49
|
|
|
@@ -94,15 +103,24 @@ export const Example = ({
|
|
|
94
103
|
// md file location in node_modules, used to resolve relative import paths in examples
|
|
95
104
|
relPath = '',
|
|
96
105
|
// absolute url to hosted file
|
|
97
|
-
sourceLink = ''
|
|
106
|
+
sourceLink = '',
|
|
98
107
|
}) => {
|
|
99
108
|
if (isFullscreenPreview) {
|
|
100
109
|
isFullscreen = false;
|
|
101
|
-
window.addEventListener('load', () => {
|
|
102
|
-
//append a class to the document body to indicate to screenshot/automated visual regression tools that the page has loaded
|
|
103
|
-
document.body.classList.add('page-loaded');
|
|
104
|
-
});
|
|
105
110
|
}
|
|
111
|
+
|
|
112
|
+
//append a class to the document body on fullscreen examples to indicate to screenshot/automated visual regression tools that the page has loaded
|
|
113
|
+
const addPageLoadedClass = () => document.body.classList.add('page-loaded');
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
if (!isFullscreenPreview) return;
|
|
116
|
+
|
|
117
|
+
document.readyState === 'complete'
|
|
118
|
+
? addPageLoadedClass()
|
|
119
|
+
: window.addEventListener('load', addPageLoadedClass);
|
|
120
|
+
|
|
121
|
+
return () => window.removeEventListener('load', addPageLoadedClass);
|
|
122
|
+
}, []);
|
|
123
|
+
|
|
106
124
|
if (!lang) {
|
|
107
125
|
// Inline code
|
|
108
126
|
return <code className="ws-code">{code}</code>;
|
|
@@ -124,20 +142,26 @@ export const Example = ({
|
|
|
124
142
|
...reactCoreModule,
|
|
125
143
|
...reactTableModule,
|
|
126
144
|
...(source === 'react-next' ? reactCoreNextModule : {}),
|
|
127
|
-
...(source === 'react-deprecated'
|
|
145
|
+
...(source === 'react-deprecated'
|
|
146
|
+
? { ...reactCoreDeprecatedModule, ...reactTableDeprecatedModule }
|
|
147
|
+
: {}),
|
|
128
148
|
};
|
|
129
149
|
|
|
130
150
|
let livePreview = null;
|
|
131
151
|
if (lang === 'html') {
|
|
132
152
|
livePreview = (
|
|
133
153
|
<div
|
|
134
|
-
className={css(
|
|
154
|
+
className={css(
|
|
155
|
+
'ws-preview-html',
|
|
156
|
+
isFullscreenPreview && 'pf-v6-u-h-100'
|
|
157
|
+
)}
|
|
135
158
|
dangerouslySetInnerHTML={{ __html: editorCode }}
|
|
136
159
|
/>
|
|
137
160
|
);
|
|
138
161
|
} else {
|
|
139
162
|
try {
|
|
140
|
-
const { code: transformedCode, hasTS } =
|
|
163
|
+
const { code: transformedCode, hasTS } =
|
|
164
|
+
convertToReactComponent(editorCode);
|
|
141
165
|
if (hasTS) {
|
|
142
166
|
lang = 'ts';
|
|
143
167
|
} else {
|
|
@@ -147,7 +171,11 @@ export const Example = ({
|
|
|
147
171
|
const componentNames = Object.keys(scope);
|
|
148
172
|
const componentValues = Object.values(scope);
|
|
149
173
|
|
|
150
|
-
const getPreviewComponent = new Function(
|
|
174
|
+
const getPreviewComponent = new Function(
|
|
175
|
+
'React',
|
|
176
|
+
...componentNames,
|
|
177
|
+
transformedCode
|
|
178
|
+
);
|
|
151
179
|
const PreviewComponent = getPreviewComponent(React, ...componentValues);
|
|
152
180
|
|
|
153
181
|
livePreview = (
|
|
@@ -164,20 +192,37 @@ export const Example = ({
|
|
|
164
192
|
|
|
165
193
|
if (isFullscreenPreview) {
|
|
166
194
|
return (
|
|
167
|
-
<div id={previewId} className={css(className, 'pf-
|
|
195
|
+
<div id={previewId} className={css(className, 'pf-v6-u-h-100')}>
|
|
168
196
|
{livePreview}
|
|
169
197
|
{(hasDarkThemeSwitcher || hasRTLSwitcher) && (
|
|
170
|
-
<Flex
|
|
198
|
+
<Flex
|
|
199
|
+
direction={{ default: 'column' }}
|
|
200
|
+
gap={{ default: 'gapLg' }}
|
|
201
|
+
className="ws-full-page-utils pf-v6-m-dir-ltr "
|
|
202
|
+
>
|
|
171
203
|
{hasDarkThemeSwitcher && (
|
|
172
|
-
<Switch
|
|
173
|
-
|
|
204
|
+
<Switch
|
|
205
|
+
id="ws-example-theme-switch"
|
|
206
|
+
label="Dark theme"
|
|
207
|
+
defaultChecked={false}
|
|
208
|
+
onChange={() =>
|
|
209
|
+
document
|
|
210
|
+
.querySelector('html')
|
|
211
|
+
.classList.toggle('pf-v6-theme-dark')
|
|
212
|
+
}
|
|
213
|
+
/>
|
|
174
214
|
)}
|
|
175
215
|
{hasRTLSwitcher && (
|
|
176
|
-
<Switch
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
216
|
+
<Switch
|
|
217
|
+
id="ws-example-rtl-switch"
|
|
218
|
+
label="RTL"
|
|
219
|
+
defaultChecked={false}
|
|
220
|
+
onChange={() => {
|
|
221
|
+
const html = document.querySelector('html');
|
|
222
|
+
const curDir = html.dir;
|
|
223
|
+
html.dir = curDir !== 'rtl' ? 'rtl' : 'ltr';
|
|
224
|
+
}}
|
|
225
|
+
/>
|
|
181
226
|
)}
|
|
182
227
|
</Flex>
|
|
183
228
|
)}
|
|
@@ -188,12 +233,21 @@ export const Example = ({
|
|
|
188
233
|
const codeBoxParams = getParameters(
|
|
189
234
|
lang === 'html'
|
|
190
235
|
? getStaticParams(title, editorCode)
|
|
191
|
-
: getReactParams(
|
|
236
|
+
: getReactParams(
|
|
237
|
+
title,
|
|
238
|
+
editorCode,
|
|
239
|
+
scope,
|
|
240
|
+
lang,
|
|
241
|
+
relativeImports,
|
|
242
|
+
relPath,
|
|
243
|
+
sourceLink
|
|
244
|
+
)
|
|
192
245
|
);
|
|
193
|
-
const fullscreenLink =
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
+
|
|
246
|
+
const fullscreenLink =
|
|
247
|
+
loc.pathname.replace(/\/$/, '') +
|
|
248
|
+
(loc.pathname.endsWith(source) ? '' : `/${source}`) +
|
|
249
|
+
'/' +
|
|
250
|
+
slugger(title);
|
|
197
251
|
|
|
198
252
|
return (
|
|
199
253
|
<div className="ws-example">
|
|
@@ -203,22 +257,28 @@ export const Example = ({
|
|
|
203
257
|
<React.Fragment>
|
|
204
258
|
{isBeta && (
|
|
205
259
|
<Tooltip content="This beta component is currently under review and is still open for further evolution.">
|
|
206
|
-
<Button variant="plain">
|
|
207
|
-
<Label isCompact color="blue">
|
|
260
|
+
<Button variant="plain" hasNoPadding>
|
|
261
|
+
<Label isCompact color="blue">
|
|
262
|
+
Beta
|
|
263
|
+
</Label>
|
|
208
264
|
</Button>
|
|
209
265
|
</Tooltip>
|
|
210
266
|
)}
|
|
211
267
|
{isDemo && (
|
|
212
268
|
<Tooltip content="Demos show how multiple components can be used in a single design.">
|
|
213
|
-
<Button variant="plain">
|
|
214
|
-
<Label isCompact color="purple">
|
|
269
|
+
<Button variant="plain" hasNoPadding>
|
|
270
|
+
<Label isCompact color="purple">
|
|
271
|
+
Demo
|
|
272
|
+
</Label>
|
|
215
273
|
</Button>
|
|
216
274
|
</Tooltip>
|
|
217
275
|
)}
|
|
218
276
|
{isDeprecated && (
|
|
219
277
|
<Tooltip content="Deprecated components are available for use but are no longer being maintained or enhanced.">
|
|
220
|
-
<Button variant="plain">
|
|
221
|
-
<Label isCompact color="grey">
|
|
278
|
+
<Button variant="plain" hasNoPadding>
|
|
279
|
+
<Label isCompact color="grey">
|
|
280
|
+
Deprecated
|
|
281
|
+
</Label>
|
|
222
282
|
</Button>
|
|
223
283
|
</Tooltip>
|
|
224
284
|
)}
|
|
@@ -232,28 +292,34 @@ export const Example = ({
|
|
|
232
292
|
</AutoLinkHeader>
|
|
233
293
|
{children}
|
|
234
294
|
</div>
|
|
235
|
-
{isFullscreen
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
>
|
|
243
|
-
<img src={thumbnail.src} width={thumbnail.width} height={thumbnail.height} alt={`${title} screenshot`} />
|
|
244
|
-
</a>
|
|
245
|
-
</div>
|
|
246
|
-
: <div
|
|
247
|
-
id={previewId}
|
|
248
|
-
className={css(
|
|
249
|
-
className,
|
|
250
|
-
isFullscreen ? 'ws-preview-fullscreen' : 'ws-preview',
|
|
251
|
-
isRTL && 'pf-v5-m-dir-rtl')
|
|
252
|
-
}
|
|
295
|
+
{isFullscreen ? (
|
|
296
|
+
<div className="ws-preview">
|
|
297
|
+
<a
|
|
298
|
+
className="ws-preview__thumbnail-link"
|
|
299
|
+
href={fullscreenLink}
|
|
300
|
+
target="_blank"
|
|
301
|
+
aria-label={`Open fullscreen ${title} example`}
|
|
253
302
|
>
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
303
|
+
<img
|
|
304
|
+
src={thumbnail.src}
|
|
305
|
+
width={thumbnail.width}
|
|
306
|
+
height={thumbnail.height}
|
|
307
|
+
alt={`${title} screenshot`}
|
|
308
|
+
/>
|
|
309
|
+
</a>
|
|
310
|
+
</div>
|
|
311
|
+
) : (
|
|
312
|
+
<div
|
|
313
|
+
id={previewId}
|
|
314
|
+
className={css(
|
|
315
|
+
className,
|
|
316
|
+
isFullscreen ? 'ws-preview-fullscreen' : 'ws-preview',
|
|
317
|
+
isRTL && 'pf-v6-m-dir-rtl'
|
|
318
|
+
)}
|
|
319
|
+
>
|
|
320
|
+
{livePreview}
|
|
321
|
+
</div>
|
|
322
|
+
)}
|
|
257
323
|
<ExampleToolbar
|
|
258
324
|
lang={lang}
|
|
259
325
|
isFullscreen={isFullscreen}
|
|
@@ -266,4 +332,4 @@ export const Example = ({
|
|
|
266
332
|
/>
|
|
267
333
|
</div>
|
|
268
334
|
);
|
|
269
|
-
}
|
|
335
|
+
};
|
|
@@ -103,7 +103,7 @@ export const ExampleToolbar = ({
|
|
|
103
103
|
copyCode();
|
|
104
104
|
trackEvent('code_editor_control_click', 'click_event', 'COPY_CODE');
|
|
105
105
|
}}
|
|
106
|
-
variant="
|
|
106
|
+
variant="plain"
|
|
107
107
|
aria-label={copyAriaLabel}
|
|
108
108
|
className={editorControlProps.className}
|
|
109
109
|
>
|
|
@@ -124,7 +124,7 @@ export const ExampleToolbar = ({
|
|
|
124
124
|
>
|
|
125
125
|
<Button
|
|
126
126
|
aria-label={codesandboxAriaLabel}
|
|
127
|
-
variant="
|
|
127
|
+
variant="plain"
|
|
128
128
|
type="submit"
|
|
129
129
|
onClick={() => {
|
|
130
130
|
trackEvent('code_editor_control_click', 'click_event', 'CODESANDBOX_LINK');
|
|
@@ -218,6 +218,7 @@ export const ExampleToolbar = ({
|
|
|
218
218
|
onEditorDidMount={onEditorDidMount}
|
|
219
219
|
isReadOnly={isFullscreen}
|
|
220
220
|
className={`${isEditorOpen ? 'ws-example-code-expanded ' : ''}ws-code-editor`}
|
|
221
|
+
isHeaderPlain
|
|
221
222
|
/>
|
|
222
223
|
);
|
|
223
224
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
.ws-org-pfsite-l-footer.pf-
|
|
2
|
-
|
|
1
|
+
.ws-org-pfsite-l-footer.pf-v6-c-page__main-section {
|
|
2
|
+
/* font-family: var(--pf-v6-global--FontFamily--text); */
|
|
3
3
|
font-weight: 300;
|
|
4
4
|
background-color: #1a1a1a !important;
|
|
5
|
-
--pf-
|
|
6
|
-
--pf-
|
|
7
|
-
--pf-
|
|
8
|
-
--pf-
|
|
5
|
+
--pf-v6-c-page__main-section--PaddingTop: var(--pf-t--global--spacer--xl);
|
|
6
|
+
--pf-v6-c-page__main-section--PaddingRight: var(--pf-t--global--spacer--2xl);
|
|
7
|
+
--pf-v6-c-page__main-section--PaddingBottom: var(--pf-t--global--spacer--2xl);
|
|
8
|
+
--pf-v6-c-page__main-section--PaddingLeft: var(--pf-t--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-
|
|
38
|
-
|
|
37
|
+
margin-right: var(--pf-t--global--spacer--md);
|
|
38
|
+
/* color: var(--pf-v6-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-
|
|
47
|
-
margin-bottom: var(--pf-
|
|
46
|
+
margin-top: var(--pf-t--global--spacer--md);
|
|
47
|
+
margin-bottom: var(--pf-t--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
|
-
|
|
74
|
+
/* color: var(--pf-v6-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-
|
|
89
|
+
.pf-v6-c-page .pf-v6-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-
|
|
93
|
+
.pf-v6-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-
|
|
100
|
-
padding-left: var(--pf-
|
|
101
|
-
|
|
99
|
+
padding-right: var(--pf-t--global--spacer--sm);
|
|
100
|
+
padding-left: var(--pf-t--global--spacer--sm);
|
|
101
|
+
/* border-right: var(--pf-v6-global--BorderWidth--sm) solid #d2d2d2; */
|
|
102
102
|
font-weight: 300;
|
|
103
103
|
color: #d2d2d2;
|
|
104
104
|
text-decoration: underline;
|